Estimates gas fees that will be incurred for a contract execution transaction, given its ABI parameters and blockchain.
Represents the input parameters for estimating transfer fees.
The contract ABI function signature to be interacted with in the smart contract. For example, burn(uint256)
.
The parameters required by the contract ABI function to perform the contract interaction.
The blockchain address of the contract to be executed.
Information about the source.
Identifier for the originating wallet.
Blockchain associated with the transaction. Required along with sourceAddress
if you don't provide walletId
. The blockchain
and walletId
fields are mutually exclusive.
The source blockchain address of the transaction.
The raw transaction data, must be an even-length hexadecimal string with the 0x prefix, to be executed. It is important to note that the usage of callData is mutually exclusive with the abiFunctionSignature and abiParameters. Therefore, callData cannot be utilized simultaneously with either abiFunctionSignature or abiParameters.
The blockchain address of the contract to be executed.
Information about the source.
Identifier for the originating wallet.
Blockchain associated with the transaction. Required along with sourceAddress
if you don't provide walletId
. The blockchain
and walletId
fields are mutually exclusive.
The source blockchain address of the transaction.
1const response = await client.estimateContractExecutionFee({
2 abiFunctionSignature: 'burn(uint256)',
3 abiParameters: [1000],
4 contractAddress: '656d6fd6-d430-459c-9ba4-5c2074433f1b',
5 source: {
6 walletId: '9a014a34-4706-4e3f-879d-fc2a8764877c',
7 },
8})
9console.log(response.data)
1{
2 "data": {
3 "high": {
4 "gasLimit": "21000",
5 "gasPrice": "",
6 "maxFee": "5.935224468",
7 "priorityFee": "1.022783914",
8 "baseFee": "1.022783914",
9 "networkFee": "0.0001246397138"
10 },
11 "low": {
12 "gasLimit": "21000",
13 "gasPrice": "",
14 "maxFee": "5.935224468",
15 "priorityFee": "1.022783914",
16 "baseFee": "1.022783914",
17 "networkFee": "0.0001246397138"
18 },
19 "medium": {
20 "gasLimit": "21000",
21 "gasPrice": "",
22 "maxFee": "5.935224468",
23 "priorityFee": "1.022783914",
24 "baseFee": "1.022783914",
25 "networkFee": "0.0001246397138"
26 },
27 "callGasLimit": "69222",
28 "verificationGasLimit": "56863",
29 "preVerificationGas": "44112"
30 }
31}