Skip to content

Estimate Transaction Fee API

David Tavarez edited this page Jun 20, 2020 · 1 revision

Estimate Transaction Fee.

URL : /v2

Method : estimate_fee

Params

  • session_token(string): The user's session token in base64.
  • amount(number): Amount to send.
  • fee_base(number): Fee base.
  • change_outputs(number): Change outputs.
  • selection_strategy(object): Selection Strategy.

Request

{
  "jsonrpc": "2.0",
  "method": "estimate_fee",
  "id": 1,
  "params": {
    "session_token": "mFHve+/CFsPuQf1+Anp24+R1rLZCVBIyKF+fJEuxAappgT2WKMfpOiNwvRk=",
    "amount": 12345678,
    "fee_base": "1000000",
    "change_outputs": 1,
    "selection_strategy": {
      "strategy": "SMALLEST"
    }
  }
}

Reponse

{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "fee": "7000000",
    "inputs": [
      {
        "keychain_path": "m/1/0/1000",
        "commitment": "0808657d5346f4061e5484b6f57ed036ce2cb4430599cec5dcb999d07755772010",
        "amount": 30000000,
        "status": "Spendable"
      }
    ]
  }
}