Website
Dashboard
Website
Dashboard
  • ๐Ÿ‘‰ Welcome
  • ๐Ÿง How to set up an account
  • ๐Ÿ“ˆ Monitoring and analytics
  • ๐Ÿ” Introducing coins vs tokens
  • ๐Ÿ‘จโ€๐Ÿ’ผ The meaning of owning crypto
  • ๐Ÿ’ฐ Wallets
  • ๐Ÿ“œ Supported Blockchains
  • GITHUB
    • ๐Ÿ˜ SDK PHP
    • ๐Ÿ“ SDK Python
    • ๐Ÿ‘จโ€๐Ÿ’ป SDK GOLANG
    • โœณ๏ธ SDK NODE JS
    • โœณ๏ธ PHP Wallet
  • API REFERENCE
    • ๐Ÿ”‘ Authentication & base URL
    • Bitcoin
      • ๐Ÿ” Info
        • ๐Ÿง Check BTC node health
        • ๐Ÿ“œ Get latest Bitcoin block
      • ๐Ÿ†Ž Block
        • ๐Ÿ“ˆ Get Bitcoin block by height
        • ๐Ÿ‘จโ€๐Ÿ’ป Get Bitcoin block by hash
        • ๐Ÿ“‘ Get transaction count in block by height
        • ๐Ÿ“‘ Get transaction count in block by hash
      • ๐Ÿ’ฐ Transactions
        • ๐Ÿ‘จโ€๐Ÿ’ป Get Bitcoin transaction by hash
        • ๐Ÿ“ Send pre-signed raw Bitcoin transaction
      • ๐Ÿ‘จโ€๐Ÿ’ผ Account
        • ๐Ÿ’ฐ List BTC addresses managed by node wallet
        • ๐Ÿ†Ž Get BTC received amount for address
      • ๐Ÿ” Watch-only addresses
        • ๐Ÿ” Register an account zpub
        • ๐Ÿ“œ List registered extended public keys
        • ๐Ÿ†Ž Issue the next BTC address
        • ๐Ÿ“‘ History of issued BTC addresses
        • โŒ Delete a registered zpub
      • ๐Ÿ” JSON-RPC
        • ๐Ÿ” JSON-RPC
    • Ethereum
      • ๐Ÿ” Info
        • ๐Ÿง Check ETH node health
        • ๐Ÿ“œ Get latest Ethereum block
      • ๐Ÿ†Ž Block
        • ๐Ÿ“ˆ Get Ethereum block by height
        • ๐Ÿ‘จโ€๐Ÿ’ป Get Ethereum block by hash
        • ๐Ÿ“‘ Get transaction count in block by height
        • ๐Ÿ“‘ Get transaction count in block by hash
      • ๐Ÿ’ฐ Transactions
        • ๐Ÿ‘จโ€๐Ÿ’ป Get Ethereum transaction by hash
        • ๐Ÿ‘จโ€๐Ÿ’ป Get Ethereum transaction receipt by hash
        • ๐Ÿ“ Send pre-signed raw Ethereum transaction
      • ๐Ÿ‘จโ€๐Ÿ’ผ Account
        • ๐Ÿ” List ETH accounts managed by node
        • ๐Ÿ†Ž Get ETH balance for address
        • ๐Ÿ†Ž Get transaction count (nonce) for address
        • ๐Ÿ‘‰ Estimate gas for transaction
        • ๐Ÿ“‘ Read-only contract call (eth_call)
        • ๐Ÿ‘จโ€๐Ÿ’ผ Send transaction from node-managed account
      • ๐Ÿ” Watch-only addresses
        • ๐Ÿ” Register an account xpub
        • ๐Ÿ“œ List registered extended public keys
        • ๐Ÿ†Ž Issue the next ETH address
        • ๐Ÿ“‘ History of issued ETH addresses
        • โŒ Delete a registered xpub
      • ๐Ÿ” JSON-RPC
        • ๐Ÿ” JSON-RPC
    • Tron
      • ๐Ÿ” Info
        • ๐Ÿ“‘ Get TRX node info
        • ๐Ÿง Check Tron node health
        • ๐Ÿช™ List supported TRC20 tokens
      • ๐Ÿ†Ž Block
        • ๐Ÿ“œ Get latest Tron block
        • ๐Ÿ“œ Get latest N blocks
        • ๐ŸŸ  Get block by number
        • ๐Ÿ‘จโ€๐Ÿ’ป Get block by hash
      • ๐Ÿ’ฐ Transactions
        • ๐Ÿ‘จโ€๐Ÿ’ป Get transaction by hash
        • ๐Ÿ†Ž Get all transactions for an address
        • ๐Ÿ“ Create an unsigned transaction
        • ๐Ÿ“ก Broadcast a signed transaction
      • ๐Ÿ‘จโ€๐Ÿ’ผ Account
        • ๐Ÿ†Ž Validate a Tron address
        • ๐Ÿ” Get account information
        • ๐Ÿ’ฐ Get account balance
        • ๐Ÿ’ฐ Get all asset balances
        • ๐Ÿ’ต Get a single TRC20 balance
        • โš ๏ธ Create a new Tron address (deprecated)
        • โš ๏ธ Generate a private key from a mnemonic (deprecated)
        • โš ๏ธ Send TRX from one address to another (deprecated)
        • โš ๏ธ Send USDT (TRC20) from one address to another (deprecated)
      • ๐Ÿ“Š Schemas
      • ๐Ÿ” JSON-RPC
    • Webhooks
      • โœณ๏ธ Management
        • ๐Ÿ‘จโ€๐Ÿ“œ List webhooks
        • ๐Ÿง Create webhook
        • ๐Ÿ‘‰ Get webhook
        • ๐Ÿ‘จโ€๐Ÿ” Update webhook
        • โŒ Delete webhook
        • ๐Ÿ”‘ Rotate signing secret
      • ๐Ÿ“จ Receiving notifications

๐Ÿ” JSON-RPC

Code samples

POST /api/v1/btc/jsonrpc

curl -X POST 'https://settla.net/api/v1/btc/jsonrpc' \
  -H 'X-API-Key: $SETTLA_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "jsonrpc": "1.0",
  "method": "getblockchaininfo",
  "params": [],
  "id": 1
}'

Proxies a Bitcoin JSON-RPC 1.0 request to the configured BTC node and returns the node's response.

Only read-only chain queries and broadcasting of an already signed transaction are accepted: decoderawtransaction, estimatesmartfee, getbestblockhash, getblock, getblockchaininfo, getblockcount, getblockhash, getblockheader, getblockstats, getdifficulty, getmempoolinfo, getrawtransaction, gettxout, sendrawtransaction, testmempoolaccept. Any other method โ€” in particular wallet methods โ€” is rejected with -32601 and never reaches the node.

Batches are supported and are validated as a whole: a single disallowed method rejects the entire batch. A batch is limited to 20 calls. The forwarded body is re-encoded from the parsed request, so duplicate JSON keys cannot smuggle a different method to the node.

The response is the node's own JSON-RPC envelope โ€” {result, error, id} โ€” not the flattened shape the REST endpoints return. Branch on error, not on the status code: a node-level failure comes back as HTTP 500 but still carries a usable {result: null, error: {code, message}, id} body, and in a batch the per-call errors sit inside a 200. params is required even when the method takes none: send [].

This is the escape hatch for everything the REST endpoints do not cover โ€” estimatesmartfee before building a transaction, gettxout to check whether an output is still unspent, testmempoolaccept to dry-run a broadcast, getblockheader to read a block header without pulling megabytes of transactions.

Body parameter โ€” Chain state โ€” height, difficulty, sync progress

{
  "jsonrpc": "1.0",
  "method": "getblockchaininfo",
  "params": [],
  "id": 1
}

Body parameter โ€” Fee estimate for confirmation within 6 blocks

{
  "jsonrpc": "1.0",
  "method": "estimatesmartfee",
  "params": [
    6
  ],
  "id": 1
}

Body parameter โ€” Is output 0 of this transaction still spendable?

{
  "jsonrpc": "1.0",
  "method": "gettxout",
  "params": [
    "5fc111d07140a808ba08ac28f61fd436efbfe9d84f5437abe980b42c8d9f0a5e",
    0
  ],
  "id": 1
}

Body parameter โ€” Batch โ€” two calls in one round trip

[
  {
    "jsonrpc": "1.0",
    "method": "getblockcount",
    "params": [],
    "id": 1
  },
  {
    "jsonrpc": "1.0",
    "method": "getblockhash",
    "params": [
      965000
    ],
    "id": 2
  }
]

๐Ÿ› ๏ธ Parameters

NameInTypeRequiredDescription
bodybodyobjecttruenone

Example responses

200 Response โ€” getblockchaininfo (trimmed)

{
  "result": {
    "chain": "main",
    "blocks": 965135,
    "headers": 965135,
    "bestblockhash": "00000000000000000001f61ff38b20267df62cd2264085bbe23997d9b36a2c69",
    "bits": "17023cc1",
    "target": "000000000000000000023cc10000000000000000000000000000000000000000",
    "difficulty": 125807076547197.5,
    "time": 1788332427,
    "mediantime": 1788329121,
    "verificationprogress": 1,
    "initialblockdownload": false,
    "chainwork": "00000000000000000000000000000000000000014426abd5a51cc72b122956f0",
    "size_on_disk": 872577596875,
    "pruned": false,
    "warnings": []
  },
  "error": null,
  "id": 1
}

200 Response โ€” estimatesmartfee โ€” feerate is BTC per kvB, not sat/vB

{
  "result": {
    "feerate": 0.00001013,
    "blocks": 6
  },
  "error": null,
  "id": 1
}

200 Response โ€” gettxout โ€” a result of null means the output is already spent or never existed

{
  "result": {
    "bestblock": "00000000000000000000612c6c03a9b1465947557f7d45a82aeca20156902ff8",
    "confirmations": 137,
    "value": 0.012,
    "scriptPubKey": {
      "asm": "0 e93523416d7137dad7b63813ca2a72010bc94d3b",
      "desc": "addr(bc1qay6jxstdwyma44ak8qfu52njqy9ujnfm37hllg)#dxsdzh08",
      "hex": "0014e93523416d7137dad7b63813ca2a72010bc94d3b",
      "address": "bc1qay6jxstdwyma44ak8qfu52njqy9ujnfm37hllg",
      "type": "witness_v0_keyhash"
    },
    "coinbase": false
  },
  "error": null,
  "id": 1
}

200 Response โ€” Batch response โ€” match by id, do not rely on position

[
  {
    "result": 965136,
    "error": null,
    "id": 1
  },
  {
    "result": "00000000000000000001595977e6000ce56129f5c9b4073e31ccc30b90b97da9",
    "error": null,
    "id": 2
  }
]

400 Response โ€” Body is not valid JSON

{
  "error": {
    "code": -32700,
    "message": "Parse error: request body is not valid JSON"
  }
}

400 Response โ€” No method field

{
  "error": {
    "code": -32600,
    "message": "Invalid Request: \"method\" must be a string"
  }
}

400 Response โ€” Batch is an empty array

{
  "error": {
    "code": -32600,
    "message": "Invalid Request: empty batch"
  }
}

403 Response

{
  "error": {
    "code": -32601,
    "message": "Method \"getbalance\" is not available through this endpoint"
  },
  "id": 1
}

500 Response

{
  "result": null,
  "error": {
    "code": -22,
    "message": "TX decode failed: 0100000000010000 Make sure the tx has at least one input."
  },
  "id": 1
}

502 Response

{
  "error": {
    "code": -32603,
    "message": "Failed to connect to BTC node"
  },
  "id": 1
}

๐Ÿ” Responses

StatusMeaningDescriptionSchema
200OKNode answered. For a single call the body is one {result, error, id} object; for a batch it is an array of them, one per request, in the order sent.Inline
400Bad RequestMalformed request, rejected before the node was contacted: body is not valid JSON (-32700), method missing or not a string, batch empty or over 20 calls (-32600).Inline
403403Method is not on the allowlist. Every wallet method lands here โ€” getbalance, sendtoaddress, listunspent, dumpprivkey and the rest. The request never reaches the node.Inline
500Internal Server ErrorThe node itself rejected the call โ€” bad parameters, undecodable transaction, unknown hash. The body is a normal JSON-RPC envelope and the node's own error code is in error.code; this is not necessarily an outage. Also returned when the BTC node URL or credentials are not configured.Inline
502Bad GatewayCould not reach the BTC node at all โ€” connection refused or timed out.Inline

๐Ÿ”„ Response Schema

Status Code 400

NameTypeRequiredRestrictionsDescription
ยป resultobjectยฆnullfalsenoneAlways null when the node produced the error. Absent on proxy-level rejections.
ยป errorobjectfalsenonenone
ยปยป codeintegerfalsenone-32700 parse error, -32600 invalid request, -32601 method not allowed, -32603 proxy could not reach the node. Any other value is Bitcoin Core's own code passed through (-22 decode failed, -5 not found, -8 bad parameter, -26 transaction rejected).
ยปยป messagestringfalsenonenone
ยป idobjectfalsenoneEchoed back from the rejected request when it carried an id, so client libraries can match the error to the call.

Status Code 403

NameTypeRequiredRestrictionsDescription
ยป resultobjectยฆnullfalsenoneAlways null when the node produced the error. Absent on proxy-level rejections.
ยป errorobjectfalsenonenone
ยปยป codeintegerfalsenone-32700 parse error, -32600 invalid request, -32601 method not allowed, -32603 proxy could not reach the node. Any other value is Bitcoin Core's own code passed through (-22 decode failed, -5 not found, -8 bad parameter, -26 transaction rejected).
ยปยป messagestringfalsenonenone
ยป idobjectfalsenoneEchoed back from the rejected request when it carried an id, so client libraries can match the error to the call.

Status Code 500

NameTypeRequiredRestrictionsDescription
ยป resultobjectยฆnullfalsenoneAlways null when the node produced the error. Absent on proxy-level rejections.
ยป errorobjectfalsenonenone
ยปยป codeintegerfalsenone-32700 parse error, -32600 invalid request, -32601 method not allowed, -32603 proxy could not reach the node. Any other value is Bitcoin Core's own code passed through (-22 decode failed, -5 not found, -8 bad parameter, -26 transaction rejected).
ยปยป messagestringfalsenonenone
ยป idobjectfalsenoneEchoed back from the rejected request when it carried an id, so client libraries can match the error to the call.

Status Code 502

NameTypeRequiredRestrictionsDescription
ยป resultobjectยฆnullfalsenoneAlways null when the node produced the error. Absent on proxy-level rejections.
ยป errorobjectfalsenonenone
ยปยป codeintegerfalsenone-32700 parse error, -32600 invalid request, -32601 method not allowed, -32603 proxy could not reach the node. Any other value is Bitcoin Core's own code passed through (-22 decode failed, -5 not found, -8 bad parameter, -26 transaction rejected).
ยปยป messagestringfalsenonenone
ยป idobjectfalsenoneEchoed back from the rejected request when it carried an id, so client libraries can match the error to the call.
To perform this operation, you must be authenticated by means of one of the following methods: ApiKeyAuth
Prev
๐Ÿ” Watch-only addresses