Passer au contenu principal
POST
/
v1
/
wallets
/
{walletId}
/
withdraw
/
network-fee
Master Wallet Network Fee
curl --request POST \
  --url https://api.blockradar.co/v1/wallets/{walletId}/withdraw/network-fee \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "assets": [
    {
      "address": "0xRecipient1Address",
      "amount": "10.5",
      "id": "{{assetId1}}"
    },
    {
      "address": "0xRecipient2Address",
      "amount": "25.0",
      "id": "{{assetId2}}"
    }
  ]
}
'
{
  "data": {
    "nativeBalance": "0.04998428208321722",
    "nativeBalanceInUSD": "4950.00",
    "networkFee": "0.000000021112014"
  },
  "message": "Network fee fetched successfully",
  "statusCode": 200
}

Batch Operations

This endpoint supports batch operations, allowing you to estimate network fees for multiple withdrawal operations in a single API call.

Batch Request Format

To estimate fees for multiple withdrawals, use the assets array:
{
  "assets": [
    {
      "id": "asset-uuid-1",
      "address": "0xRecipient1...",
      "amount": "100"
    },
    {
      "id": "asset-uuid-2",
      "address": "0xRecipient2...",
      "amount": "50"
    }
  ]
}

Batch Response Format

Returns individual fees plus totals:
{
  "message": "Network fee fetched successfully",
  "statusCode": 200,
  "data": {
    "fees": [
      {
        "index": 0,
        "assetId": "asset-uuid-1",
        "address": "0xRecipient1...",
        "amount": "100",
        "networkFee": "0.00001247904",
        "transactionFee": "0",
        "estimatedArrivalTime": 30
      },
      {
        "index": 1,
        "assetId": "asset-uuid-2",
        "address": "0xRecipient2...",
        "amount": "50",
        "networkFee": "0.00000504",
        "transactionFee": "0",
        "estimatedArrivalTime": 30
      }
    ],
    "totalNetworkFee": "0.00001751904",
    "totalNetworkFeeInUSD": "0.0158202186912",
    "totalTransactionFee": "0",
    "nativeBalance": "0.073690520542044578",
    "nativeBalanceInUSD": "66.54",
    "estimatedArrivalTime": 60,
    "errors": []
  }
}

Response Fields

FieldDescription
feesArray of individual fee estimates per withdrawal
totalNetworkFeeSum of all network fees
totalNetworkFeeInUSDTotal network fee in USD
totalTransactionFeeSum of all transaction fees
nativeBalanceCurrent native token balance
estimatedArrivalTimeTotal time (sum of individual times, 30s each)
errorsArray of any failed estimations

Validation Rules

RuleValue
Max batch size20 operations
Min batch size1 operation

Use Cases

  • Multi-recipient withdrawal: Estimate fees for sending to multiple addresses
  • Bulk payouts: Calculate total cost for batch payment operations
  • Budget planning: Plan withdrawal operations with accurate fee estimates

Autorisations

x-api-key
string
header
requis

Paramètres de chemin

walletId
string
requis
Exemple:

"{{walletId}}"

Corps

application/json
assets
object[]
Exemple:
[
{
"address": "0xRecipient1Address",
"amount": "10.5",
"id": "{{assetId1}}"
},
{
"address": "0xRecipient2Address",
"amount": "25.0",
"id": "{{assetId2}}"
}
]

Réponse

200 - application/json

Withdraw / Withdraw (Batch)

data
object
message
string
Exemple:

"Network fee fetched successfully"

statusCode
number
Exemple:

200