π Generic JSON-RPC proxy to BTC node
Code samples
POST /api/v1/btc/jsonrpc
Proxies any valid Bitcoin JSON-RPC 1.0 request to the configured BTC node. The request body is forwarded as-is and the node's response is returned.
Body parameter
{
"jsonrpc": "1.0",
"method": "getblockchaininfo",
"params": [
null
],
"id": null
}
π οΈ Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | any | true | none |
Example responses
200 Response
{}
π Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | JSON-RPC response from BTC node | Inline |
| 500 | Internal Server Error | BTC node URL or credentials are not configured | BtcJsonRpcError |
| 502 | Bad Gateway | Failed to connect to BTC node | BtcJsonRpcError |
π Response Schema
Schemas
BtcBlock
{
"hash": "string",
"confirmations": 0,
"height": 0,
"version": 0,
"versionHex": "string",
"merkleroot": "string",
"time": 0,
"mediantime": 0,
"nonce": 0,
"bits": "string",
"difficulty": 0.1,
"chainwork": "string",
"nTx": 0,
"strippedsize": 0,
"size": 0,
"weight": 0,
"previousblockhash": "string",
"nextblockhash": "string",
"tx": [
"string"
]
}
Bitcoin block object as returned by getblock with verbosity 1 or 2.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| hash | string | false | none | Hash of the block. |
| confirmations | integer(int64) | false | none | Number of confirmations for the block. |
| height | integer(int64) | false | none | Block height. |
| version | integer | false | none | Block version. |
| versionHex | string | false | none | none |
| merkleroot | string | false | none | Merkle root of the block's transactions. |
| time | integer(int64) | false | none | Block time in seconds since Unix epoch. |
| mediantime | integer(int64) | false | none | none |
| nonce | integer(int64) | false | none | none |
| bits | string | false | none | none |
| difficulty | number(double) | false | none | none |
| chainwork | string | false | none | none |
| nTx | integer(int64) | false | none | Number of transactions in the block. |
| strippedsize | integer(int64) | false | none | none |
| size | integer(int64) | false | none | none |
| weight | integer(int64) | false | none | none |
| previousblockhash | string¦null | false | none | none |
| nextblockhash | string¦null | false | none | none |
| tx | [oneOf] | false | none | Transactions included in the block. When verbosity=2, this is an array of full transaction objects; otherwise it may be an array of transaction IDs. |
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» anonymous | string | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| Β» anonymous | BtcTransaction | false | none | Bitcoin transaction object as returned by getrawtransaction with verbose=true. |
BtcTransaction
{
"txid": "string",
"hash": "string",
"version": 0,
"size": 0,
"vsize": 0,
"weight": 0,
"locktime": 0,
"blockhash": "string",
"confirmations": 0,
"time": 0,
"blocktime": 0,
"hex": "string",
"vin": [
{
"txid": "string",
"vout": 0,
"coinbase": "string",
"scriptSig": {
"asm": "string",
"hex": "string"
},
"sequence": 0
}
],
"vout": [
{
"value": 0.1,
"n": 0,
"scriptPubKey": {
"asm": "string",
"hex": "string",
"type": "string",
"reqSigs": 0,
"addresses": [
"string"
]
}
}
]
}
Bitcoin transaction object as returned by getrawtransaction with verbose=true.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txid | string | false | none | Transaction ID. |
| hash | string | false | none | none |
| version | integer | false | none | none |
| size | integer | false | none | none |
| vsize | integer | false | none | none |
| weight | integer | false | none | none |
| locktime | integer | false | none | none |
| blockhash | string¦null | false | none | none |
| confirmations | integer(int64)Β¦null | false | none | none |
| time | integer(int64)Β¦null | false | none | none |
| blocktime | integer(int64)Β¦null | false | none | none |
| hex | string | false | none | Raw hex-encoded transaction. |
| vin | [BtcVin] | false | none | [Transaction input (vin) entry.] |
| vout | [BtcVout] | false | none | [Transaction output (vout) entry.] |
BtcVin
{
"txid": "string",
"vout": 0,
"coinbase": "string",
"scriptSig": {
"asm": "string",
"hex": "string"
},
"sequence": 0
}
Transaction input (vin) entry.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txid | string¦null | false | none | none |
| vout | integer¦null | false | none | none |
| coinbase | string¦null | false | none | none |
| scriptSig | object¦null | false | none | none |
| Β» asm | string | false | none | none |
| Β» hex | string | false | none | none |
| sequence | integer(int64) | false | none | none |
BtcVout
{
"value": 0.1,
"n": 0,
"scriptPubKey": {
"asm": "string",
"hex": "string",
"type": "string",
"reqSigs": 0,
"addresses": [
"string"
]
}
}
Transaction output (vout) entry.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| value | number(double) | false | none | Value in BTC. |
| n | integer | false | none | Output index. |
| scriptPubKey | object | false | none | none |
| Β» asm | string | false | none | none |
| Β» hex | string | false | none | none |
| Β» type | string | false | none | none |
| » reqSigs | integer¦null | false | none | none |
| Β» addresses | [string]Β¦null | false | none | none |
BtcReceivedByAddress
{
"address": "string",
"amount": 0.1,
"confirmations": 0,
"label": "string",
"txids": [
"string"
]
}
Entry returned by listreceivedbyaddress.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| address | string | false | none | Bitcoin address. |
| amount | number(double) | false | none | Total amount received by this address in BTC. |
| confirmations | integer(int64) | false | none | none |
| label | string¦null | false | none | none |
| txids | [string] | false | none | none |
BtcJsonRpcRequest
{
"jsonrpc": "1.0",
"method": "getblockchaininfo",
"params": [
null
],
"id": null
}
Generic Bitcoin JSON-RPC 1.0 request.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| jsonrpc | string | false | none | none |
| method | string | true | none | Bitcoin JSON-RPC method name (e.g. getblockchaininfo). |
| params | [any] | true | none | Positional parameters for the method. |
| id | any | false | none | Request identifier (string, number, or null). |
BtcJsonRpcError
{
"error": {
"code": -32603,
"message": "Failed to connect to BTC node"
}
}
Error response used when BTC JSON-RPC proxy fails.
π οΈ Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| error | object | false | none | none |
| Β» code | integer | false | none | none |
| Β» message | string | false | none | none |