Skip to content

Commit

Permalink
Skip gas estimation if already present (ethereum) (#1081)
Browse files Browse the repository at this point in the history
  • Loading branch information
korkoshko committed Mar 27, 2024
1 parent c0fd551 commit 9ed1d59
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "1.37.44",
"version": "1.37.45",
"description": "Tatum API client allows browsers and Node.js clients to interact with Tatum API.",
"main": "dist/src/index.js",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
3 changes: 1 addition & 2 deletions src/transaction/eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,8 @@ export const signEthKMSTransaction = async (tx: TransactionKMS, fromPrivateKey:
}
const client = getClient(provider, fromPrivateKey);
const transactionConfig = JSON.parse(tx.serializedTransaction);
const gas = await client.eth.estimateGas(transactionConfig);
if (!transactionConfig.gas) {
transactionConfig.gas = gas;
transactionConfig.gas = await client.eth.estimateGas(transactionConfig);
}
if (!transactionConfig.nonce) {
transactionConfig.nonce = await ethGetTransactionsCount(client.eth.defaultAccount as string);
Expand Down

0 comments on commit 9ed1d59

Please sign in to comment.