Estimate transaction fee
POST {{baseUrl}}/protocols/eth/transactions/estimate
Returns estimated Ethereum transaction fees for given configuration.
Accepts identical configuration options as in POST /protocols/eth/transactions
. Declines invalid transaction or contract interaction configurations with status 400
.
In EIP-1559 transactions the fee
and gasPrice
estimations represent the maximum possible values that can occur in a transaction. Due to the nature of EIP-1559 the actual transaction fee will be likely lower than estimated and the difference is refunded back to the wallet during the transaction.
The fee estimation is based on the current Ethereum network utilization and can fluctuate in a random fashion.
This call does not send an actual transaction to the Ethereum network.
Note further responses under the examples section
Request Body
{"from"=>{"wallet"=>"{{wallet}}"}, "to"=>{"wallet"=>"my-other-wallet"}, "amount"=>"0.000457"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
tangany-version | number | (Required) Default header that directs the request towards desired Tangany Custody Api version (e.g 2 directs to Tangany Custody APi v2). |
Supports only major versions. |
| tangany-network
| string | | (Optional header) Define an API-supported public Ethereum network or a custom external Ethereum RPC endpoint to operate in.
Accepts supported public network enums and custom Ethereum RPC URLs. Defaults to mainnet
when omitted from the call.
Supported public networks: mainnet
, goerli
, sepolia
, polygon
, mumbai
, bsc
, bsc-testnet
, gnosis
, and chiado
.
Examples for private Ethereum RPC: https://somenetwork.example.org:8540?mykey
.
External RPCs must be whitelisted by the Tangany support in order to be used in the API.
Example: sepolia
|
| tangany-use-gas-tank
| boolean | | (Optional header) Allows to pre-fund the transaction fee of a transaction.
Accepts boolean values. Defaults to false
.
One possible use case for pre-funding of the transaction fees is to enable wallets to interact with smart contracts on public networks (e.g. trading tokens) without requiring wallet Ether balance ("Ether-less" wallet principle)
This feature is enabled on a subscription basis.
Example: true
|
| Content-Type
| string | | |
| Accept
| string | | |
RESPONSES
status: OK
{"gas":"21584","gasPrice":"6717468056","fee":"0.000144989830520704","nonce":121,"data":"0xa9059cbb000000000000000000000000ab174eab6761d6525a8a3a2e065ca042e74d002500000000000000000000000000000000000000000000000000000000000afc80"}