Skip to content

Commit

Permalink
fix: updated the estimation TX method (#9)
Browse files Browse the repository at this point in the history
* feat: implemented transaction estimation method

Signed-off-by: tipusinghaw <[email protected]>

* fix: formatter issue

Signed-off-by: tipusinghaw <[email protected]>

* fix: initialized the smart contract and rpcUrl

Signed-off-by: tipusinghaw <[email protected]>

* fix: formatter issue

Signed-off-by: tipusinghaw <[email protected]>

* feat: implemneted logic for schema checksum

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added validation empty schema details

Signed-off-by: tipusinghaw <[email protected]>

* feat: add getAllSchema method

Signed-off-by: tipusinghaw <[email protected]>

* fix: lock.yaml

Signed-off-by: tipusinghaw <[email protected]>

* fix: did resolve method for create schema

Signed-off-by: tipusinghaw <[email protected]>

* refactor: changed schema filter approach

Signed-off-by: tipusinghaw <[email protected]>

* refactor: added validation for empty parameters

Signed-off-by: tipusinghaw <[email protected]>

* fix: updated the estimation method

Signed-off-by: tipusinghaw <[email protected]>

---------

Signed-off-by: tipusinghaw <[email protected]>
  • Loading branch information
tipusinghaw authored Feb 13, 2024
1 parent af95ccb commit 7f29ef2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/schema-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,17 @@ export class PolygonSchema {
if (!networkDetails) {
throw new Error('Network details not found!')
}
const maxGasFee = parseFloat(String(gasPriceDetails.maxFeePerGas)) / 1e9

// Calculate transaction fee
const transactionFee = gasLimitGwei * gasPriceGwei
const transactionFee = gasLimitGwei * maxGasFee

// Create EstimatedTxDetails object
const estimatedTxDetails: EstimatedTxDetails = {
transactionFee: String(transactionFee),
gasLimit: String(gasLimitGwei),
gasPrice: String(gasPriceGwei),
maxFeePerGas: parseFloat(String(gasPriceDetails.maxFeePerGas)) / 1e9,
maxFeePerGas: maxGasFee,
maxPriorityFeePerGas:
parseFloat(String(gasPriceDetails.maxPriorityFeePerGas)) / 1e9,
network: String(networkDetails.name),
Expand Down

0 comments on commit 7f29ef2

Please sign in to comment.