Estimates gas fees that will be incurred for a contract execution transaction, given its ABI parameters and blockchain.
The contract ABI function signature or callData
field is required for interacting with the smart contract. The ABI function signature cannot be used simultaneously with callData
. e.g. burn(uint256)
The contract ABI function signature parameters for executing the contract interaction. Supported parameter types include string, integer, boolean, and array. These parameters should be used exclusively with the abiFunctionSignature and cannot be used with callData
.
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 amount of native token that will be sent to the contract abi execution. Optional field for payable api only, if not provided, no native token will be sent.
Blockchain associated with the contract execution transaction. Required when either of walletAddress
or sourceAddress
is provided.
The blockchain
and walletId
fields are mutually exclusive.
The blockchain address of the contract to be executed.
Source address of the transaction. Required along with blockchain
if walletId
is not provided.
The sourceAddress
and walletId
fields are mutually exclusive.
Unique system generated identifier of the wallet. For contract deploys this wallet ID will be used as the source.
Unique system generated JWT session token for specific user.
Developer-provided parameter used to identify this request. Useful when communicating with Circle Support.
1from circle.web3 import user_controlled_wallets
2from circle.web3 import utils
3
4client = utils.init_user_controlled_wallets_client(api_key=key)
5
6api_instance = user_controlled_wallets.TransactionsApi(client)
7request = user_controlled_wallets.EstimateContractExecutionTransactionFeeRequest.from_dict({
8 "abiFunctionSignature": "ping()",
9 "walletId": "290926b7-3790-5789-a7a9-594a9b99f1cc",
10 "contractAddress": "0x4e2f1c3a5d8b7c9e5f6a8b7c9e5f6a8b7c9e5f6a",
11 "feeLevel": "HIGH",
12 "idempotencyKey": "d1b66f87-2320-5834-bcd3-175a36a4d331",
13})
14response = api_instance.create_transaction_estimate_fee(x_user_token=user_token, estimate_contract_execution_transaction_fee_request=request)
15print(response.json())
16
1{
2 "data": {
3 "high": {
4 "gas_limit": "21000",
5 "gas_price": "",
6 "max_fee": "5.935224468",
7 "priority_fee": "1.022783914",
8 "base_fee": "1.022783914",
9 "network_fee": "0.0001246397138",
10 "network_fee_raw": "0.0001246397138",
11 "l_1_fee": "0.000000000000140021"
12 },
13 "low": {
14 "gas_limit": "21000",
15 "gas_price": "",
16 "max_fee": "5.935224468",
17 "priority_fee": "1.022783914",
18 "base_fee": "1.022783914",
19 "network_fee": "0.0001246397138",
20 "network_fee_raw": "0.0001246397138",
21 "l_1_fee": "0.000000000000140021"
22 },
23 "medium": {
24 "gas_limit": "21000",
25 "gas_price": "",
26 "max_fee": "5.935224468",
27 "priority_fee": "1.022783914",
28 "base_fee": "1.022783914",
29 "network_fee": "0.0001246397138",
30 "network_fee_raw": "0.0001246397138",
31 "l_1_fee": "0.000000000000140021"
32 },
33 "call_gas_limit": "69222",
34 "verification_gas_limit": "56863",
35 "pre_verification_gas": "44112"
36 }
37}