Estimate Fees

Estimate blockchain fees for transactions and check gas tank balances. See the Guide.

  1. Estimate the blockchain fee at the time you initiate a transaction. UTXO-based coins return a fee per kB, while account-based coins return a flat fee. BitGo reassesses the actual fee when it receives the final signature, so the sooner your wallet users sign, the more accurate the estimate.

    feeByBlockTarget is a JSON object whose property names are block-count targets (for example, "1" means the next block, "6" means within 6 blocks). These are not cryptographic keys.

    The fee estimate provided by BitGo is higher than the usual network fee. BitGo does not charge this additional fee, but it ensures that transactions process faster and do not fail on the blockchain network.

    Prerequisites: Complete Get Started, Create Wallets, and build an unsigned transaction.

    API Reference

  2. All tokens on the Ethereum network require a gas tank. If you have an Ethereum-based wallet, you must maintain enough ETH to cover gas fees. BitGo stores this balance in a separate address from the rest of your wallet balance.

    API Reference

// 1. Estimate Fees
export COIN="<ASSET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X GET \
  https://app.bitgo-test.com/api/v2/$COIN/tx/fee \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
// 2. Check Gas Tank Balance
export COIN="<ASSET_ID>"
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"

curl -X GET \
  https://app.bitgo-test.com/api/v2/$COIN/enterprise/$ENTERPRISE_ID/feeAddressBalance \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
Response
// 1. Estimate Fees Response
{
  "feePerKb": 1000,
  "cpfpFeePerKb": 1000,
  "numBlocks": 2,
  "feeByBlockTarget": {
    "1": 1000,
    "2": 1000,
    "3": 1000,
    "4": 1000,
    "5": 1000,
    "6": 1000,
    "10": 1000,
    "20": 1000,
    "50": 1000,
    "100": 1000,
    "144": 1000
  }
}

// 2. Check Gas Tank Balance Response
{
  "balance": "0",
  "address": "0x3a8c19d7e04b52f9a1c6e83d71f2b0a5c94e7d8"
}