This operation estimates the transaction fee of a token transfer or a contract call based on the fee model that the chain uses, considering factors such as network congestion and transaction complexity.
You need to specify the transaction information, including the request ID, request type, source address, destination address, token ID (only applicable to token transfers), and chain ID (only applicable to contract calls).
The response can contain different properties based on the transaction fee model used by the chain. For the legacy, EIP-1559, and UTXO fee models, Cobo also supports three different transaction speed levels: slow, recommended, and fast. For more information about estimating transaction fees, refer to Estimate transaction fee.
The API key. For more details, refer to API key.
In the API playground, enter your API secret, and your API key will be accordingly calculated.
The request body to estimate the transaction fee of a token transfer or a contract call.
The information about a token transfer.
The request type. Possible values include:
Transfer: A request to transfer tokens.ContractCall: A request to interact with a smart contract.Transfer, ContractCall "Transfer"
The information about the transaction source types Asset. Refer to Transaction sources and destinations for a detailed introduction about the supported sources and destinations for each transaction type.
Switch between the tabs to display the properties for different transaction sources.
The token ID of the transferred token. You can retrieve the IDs of all the tokens you can use by calling List enabled tokens.
"ETH_USDT"
The request ID that is used to track a transaction request.
"f47ac10b-58cc-4372-a567-0e02b2c3d479"
The information about the transaction destination type Address. Refer to Transaction sources and destinations for a detailed introduction about the supported sources and destinations for each transaction type.
You need to specify either the account_output property or the utxo_outputs property.
You can transfer tokens to multiple addresses only if you use MPC Wallets as the transaction source. To do this, you should use the utxo_outputs property to specify the destination addresses.
Switch between the tabs to display the properties for different transaction destinations.
The fee model. Possible values include:
Fixed: The fixed fee model.EVM_EIP_1559: The EIP-1559 fee model.EVM_Legacy: The legacy fee model.UTXO: The fee model used in UTXO-based blockchains, such as Bitcoin.SOL: The fee model used in Solana.FIL: The fee model used in Filecoin.Each fee model requires a different set of properties. Switch between the above tabs for details.
To learn more about the fee models, refer to Fee models.
Fixed, EVM_EIP_1559, EVM_Legacy, UTXO, SOL, FIL "EVM_EIP_1559"
The ID of the transaction that this transaction replaced.
"aff0e1cb-15b2-4e1f-9b9d-a9133715986f"
The request was successful.
The estimated transaction fee based on the fixed fee model.
For more details about the fixed fee model, see Fee models.
The fee model. Possible values include:
Fixed: The fixed fee model.EVM_EIP_1559: The EIP-1559 fee model.EVM_Legacy: The legacy fee model.UTXO: The fee model used in UTXO-based blockchains, such as Bitcoin.SOL: The fee model used in Solana.FIL: The fee model used in Filecoin.Each fee model requires a different set of properties. Switch between the above tabs for details.
To learn more about the fee models, refer to Fee models.
Fixed, EVM_EIP_1559, EVM_Legacy, UTXO, SOL, FIL "EVM_EIP_1559"
The token used to pay the transaction fee.
"TRON"
The transaction fee that you need to pay for the transaction.
"0.1"