BCH Blockbook WSS

Get Info

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"2","method":"getInfo","params":{}}	

Response: 200

{
    "id": "2",
    "data": {
        "name": "Bcash",
        "shortcut": "BCH",
        "decimals": 8,
        "version": "devel",
        "bestHeight": 840801,
        "bestHash": "0000000000000000001ca9ce1e285a8c42aca68076b0a9a656b566653d576d69",
        "block0Hash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
        "testnet": false,
        "backend": {
            "version": "27000000",
            "subversion": "/Bitcoin Cash Node:27.0.0(EB32.0)/"
        }
    }
}

Ping

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"3","method":"ping","params":{}}	

Response: 200

{
    "id": "3",
    "data": {}
}

Get block hash

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"4","method":"getBlockHash","params":{"height":100000}}

Response: 200

{
    "id": "4",
    "data": {
        "hash": "000000000003ba27aa200b1cecaad478d2b00432346c3f1f3986da1afd33e506"
    }
}

Get account info

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{
  "id": "5",
  "method": "getAccountInfo",
  "params": {
    "descriptor": "bitcoincash:qqx8w7tap7u7hs30mczndlmfnfa8l2jykvyyqqy0lt",
    "details": "basic",
    "tokens": "derived",
    "page": null,
    "pageSize": 10,
    "from": null,
    "to": null,
    "contractFilter": ""
  }
}	

Response: 200

{
    "id": "5",
    "data": {
        "address": "bitcoincash:qqx8w7tap7u7hs30mczndlmfnfa8l2jykvyyqqy0lt",
        "balance": "363184496",
        "totalReceived": "485288718",
        "totalSent": "122104222",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 22
    }
}

Get balance history

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{
  "id": "7",
  "method": "getBalanceHistory",
  "params": {
    "descriptor": "bitcoincash:qqx8w7tap7u7hs30mczndlmfnfa8l2jykvyyqqy0lt",
    "from": null,
    "to": null,
    "currencies": [
      ""
    ],
    "groupBy": null
  }
}

Response: 200

{
    "id": "7",
    "data": [
        {
            "time": 1692331200,
            "txs": 1,
            "received": "8662763",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1692694800,
            "txs": 1,
            "received": "6204099",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1694404800,
            "txs": 1,
            "received": "28889209",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1695276000,
            "txs": 2,
            "received": "25343747",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1696406400,
            "txs": 1,
            "received": "6484761",
            "sent": "62895719",
            "sentToSelf": "6484761"
        },
        {
            "time": 1696762800,
            "txs": 1,
            "received": "17920661",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1697367600,
            "txs": 1,
            "received": "11084442",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1697972400,
            "txs": 1,
            "received": "21573070",
            "sent": "0",
            "sentToSelf": "0"
        },
        {
            "time": 1699286400,
            "txs": 1,
            "received": "12641143",
            "sent": "0",
            "sentToSelf": "0"
        },

Get transaction

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"9","method":"getTransaction","params":{"txid":"000d1de57f44570814c41ede03779c61f539179c773013545012cefb420c24b9"}}	

Response: 200

{
    "id": "9",
    "data": {
        "txid": "000d1de57f44570814c41ede03779c61f539179c773013545012cefb420c24b9",
        "version": 1,
        "vin": [
            {
                "txid": "89cae982b3434a8b31b5ab96a12cfe8ceed70c7802f5cc8a8c2856f9dc35f36c",
                "sequence": 4294967295,
                "n": 0,
                "addresses": [
                    "bitcoincash:qqx8w7tap7u7hs30mczndlmfnfa8l2jykvyyqqy0lt"
                ],
                "isAddress": true,
                "value": "19714772",
                "hex": "483045022100ff5e0a663f2831a3178c2400bfcb889a002a5410d40269aae8b2e91fd383c0e902202ffc219665dc195f76cf6fc83de99966d6e493c5c81ab96fc0acc94bdbba922441210340b9ff8973614c195feaab1a04abbe7fc793a29070e489945cf9c8629ea04e5b"
            }
        ],
        "vout": [
            {
                "value": "10000000",
                "n": 0,
                "hex": "76a9140a0e2c484394a7698ac0bab399933d34bc0ff4da88ac",
                "addresses": [
                    "bitcoincash:qq9qutzggw22w6v2czat8xvn856tcrl5mglxgt4c8q"
                ],
                "isAddress": true
            },
            {
                "value": "9714320",
                "n": 1,
                "hex": "76a9140c77797d0fb9ebc22fde0536ff699a7a7faa44b388ac",
                "addresses": [
                    "bitcoincash:qqx8w7tap7u7hs30mczndlmfnfa8l2jykvyyqqy0lt"
                ],
                "isAddress": true
            },
            {
                "value": "0",
                "n": 2,
                "hex": "6a403d3a4253432e424e423a3078374233356645316366394341344344663538383863393439343946316164433531313932363931363a302f312f303a74643a3730",
                "addresses": [
                    "OP_RETURN (=:BSC.BNB:0x7B35fE1cf9CA4CDf5888c94949F1adC511926916:0/1/0:td:70)"
                ],
                "isAddress": false
            }
        ],
        "blockHash": "0000000000000000021118988454b6bbf97060ed77dd07995479b018e613f283",
        "blockHeight": 840800,
        "confirmations": 2,
        "blockTime": 1712831710,
        "value": "19714320",
        "valueIn": "19714772",
        "fees": "452",
        "hex": "01000000016cf335dcf956288c8accf502780cd7ee8cfe2ca196abb5318b4a43b382e9ca89000000006b483045022100ff5e0a663f2831a3178c2400bfcb889a002a5410d40269aae8b2e91fd383c0e902202ffc219665dc195f76cf6fc83de99966d6e493c5c81ab96fc0acc94bdbba922441210340b9ff8973614c195feaab1a04abbe7fc793a29070e489945cf9c8629ea04e5bffffffff0380969800000000001976a9140a0e2c484394a7698ac0bab399933d34bc0ff4da88ac903a9400000000001976a9140c77797d0fb9ebc22fde0536ff699a7a7faa44b388ac0000000000000000426a403d3a4253432e424e423a3078374233356645316366394341344344663538383863393439343946316164433531313932363931363a302f312f303a74643a373000000000"
    }
}

Get transaction specific

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"10","method":"getTransactionSpecific","params":{"txid":"000d1de57f44570814c41ede03779c61f539179c773013545012cefb420c24b9"}}	

Response: 200

{
    "id": "10",
    "data": {
        "txid": "000d1de57f44570814c41ede03779c61f539179c773013545012cefb420c24b9",
        "hash": "000d1de57f44570814c41ede03779c61f539179c773013545012cefb420c24b9",
        "version": 1,
        "size": 301,
        "locktime": 0,
        "vin": [
            {
                "txid": "89cae982b3434a8b31b5ab96a12cfe8ceed70c7802f5cc8a8c2856f9dc35f36c",
                "vout": 0,
                "scriptSig": {
                    "asm": "3045022100ff5e0a663f2831a3178c2400bfcb889a002a5410d40269aae8b2e91fd383c0e902202ffc219665dc195f76cf6fc83de99966d6e493c5c81ab96fc0acc94bdbba9224[ALL|FORKID] 0340b9ff8973614c195feaab1a04abbe7fc793a29070e489945cf9c8629ea04e5b",
                    "hex": "483045022100ff5e0a663f2831a3178c2400bfcb889a002a5410d40269aae8b2e91fd383c0e902202ffc219665dc195f76cf6fc83de99966d6e493c5c81ab96fc0acc94bdbba922441210340b9ff8973614c195feaab1a04abbe7fc793a29070e489945cf9c8629ea04e5b"
                },
                "sequence": 4294967295
            }
        ],
        "vout": [
            {
                "value": 0.10000000,
                "n": 0,
                "scriptPubKey": {
                    "asm": "OP_DUP OP_HASH160 0a0e2c484394a7698ac0bab399933d34bc0ff4da OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a9140a0e2c484394a7698ac0bab399933d34bc0ff4da88ac",
                    "reqSigs": 1,
                    "type": "pubkeyhash",
                    "addresses": [
                        "bitcoincash:qq9qutzggw22w6v2czat8xvn856tcrl5mglxgt4c8q"
                    ]
                }
            },
            {
                "value": 0.09714320,
                "n": 1,
                "scriptPubKey": {
                    "asm": "OP_DUP OP_HASH160 0c77797d0fb9ebc22fde0536ff699a7a7faa44b3 OP_EQUALVERIFY OP_CHECKSIG",
                    "hex": "76a9140c77797d0fb9ebc22fde0536ff699a7a7faa44b388ac",
                    "reqSigs": 1,
                    "type": "pubkeyhash",
                    "addresses": [
                        "bitcoincash:qqx8w7tap7u7hs30mczndlmfnfa8l2jykvyyqqy0lt"
                    ]
                }
            },
            {
                "value": 0.00000000,
                "n": 2,
                "scriptPubKey": {
                    "asm": "OP_RETURN 3d3a4253432e424e423a3078374233356645316366394341344344663538383863393439343946316164433531313932363931363a302f312f303a74643a3730",
                    "hex": "6a403d3a4253432e424e423a3078374233356645316366394341344344663538383863393439343946316164433531313932363931363a302f312f303a74643a3730",
                    "type": "nulldata"
                }
            }
        ],
        "hex": "01000000016cf335dcf956288c8accf502780cd7ee8cfe2ca196abb5318b4a43b382e9ca89000000006b483045022100ff5e0a663f2831a3178c2400bfcb889a002a5410d40269aae8b2e91fd383c0e902202ffc219665dc195f76cf6fc83de99966d6e493c5c81ab96fc0acc94bdbba922441210340b9ff8973614c195feaab1a04abbe7fc793a29070e489945cf9c8629ea04e5bffffffff0380969800000000001976a9140a0e2c484394a7698ac0bab399933d34bc0ff4da88ac903a9400000000001976a9140c77797d0fb9ebc22fde0536ff699a7a7faa44b388ac0000000000000000426a403d3a4253432e424e423a3078374233356645316366394341344344663538383863393439343946316164433531313932363931363a302f312f303a74643a373000000000",
        "blockhash": "0000000000000000021118988454b6bbf97060ed77dd07995479b018e613f283",
        "confirmations": 2,
        "time": 1712831710,
        "blocktime": 1712831710
    }
}

Estimate fee

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"11","method":"estimateFee","params":{"blocks":[2,5,10,20]}}	

Response: 200

{
    "id": "11",
    "data": [
        {
            "feePerUnit": "1000"
        },
        {
            "feePerUnit": "1000"
        },
        {
            "feePerUnit": "1000"
        },
        {
            "feePerUnit": "1000"
        }
    ]
}

Send transaction

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"1","method":"sendTransaction","params":{"hex":"01000000016cf335dcf956288c8accf502780cd7ee8cfe2ca196abb5318b4a43b382e9ca89000000006b483045022100ff5e0a663f2831a3178c2400bfcb889a002a5410d40269aae8b2e91fd383c0e902202ffc219665dc195f76cf6fc83de99966d6e493c5c81ab96fc0acc94bdbba922441210340b9ff8973614c195feaab1a04abbe7fc793a29070e489945cf9c8629ea04e5bffffffff0380969800000000001976a9140a0e2c484394a7698ac0bab399933d34bc0ff4da88ac903a9400000000001976a9140c77797d0fb9ebc22fde0536ff699a7a7faa44b388ac0000000000000000426a403d3a4253432e424e423a3078374233356645316366394341344344663538383863393439343946316164433531313932363931363a302f312f303a74643a373000000000"}}		

Response: 200

{
    "id": "1",
    "data": {
        "error": {
            "message": "-27: transaction already in block chain"
        }
    }
}

Get fiat rates for timestamps

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"13","method":"getFiatRatesForTimestamps","params":{"timestamps":[1575288000,1575550800],"currencies":[""]}}	

Response: 200

{
    "id": "13",
    "data": {
        "tickers": [
            {
                "ts": 1575288000,
                "rates": {}
            },
            {
                "ts": 1575550800,
                "rates": {}
            }
        ]
    }
}

Get fiat rates for tickers list

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"15","method":"getFiatRatesTickersList","params":{"timestamp":1676591569}}

Response: 200

{
    "id": "15",
    "data": {
        "error": {
            "message": "No tickers found for date 2023-02-16 23:52:49 +0000 UTC."
        }
    }
}

Get current fiat rates

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"6","method":"getCurrentFiatRates","params":{"currencies":[""]}}	

Response: 200

{
    "id": "6",
    "data": {
        "error": {
            "message": "No tickers found!"
        }
    }
}

Subscribe new block

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"16","method":"subscribeNewBlock","params":{}}

Response: 200

{
    "id": "17",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new block

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"16","method":"unsubscribeNewBlock","params":{}}	

Response: 200

{
    "id": "16",
    "data": {
        "subscribed": false
    }
}

Subscribe new transaction

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"17","method":"subscribeNewTransaction","params":{}}	

Response: 200

{
    "id": "17",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new transaction

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"17","method":"unsubscribeNewTransaction","params":{}}	

Response: 200

{
    "id": "17",
    "data": {
        "subscribed": false
    }
}

Subscribe address

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"18","method":"subscribeAddresses","params":{"addresses":["bc1qrhsext2jjaczc26etu58fry28ycatznn2zv706","bc1pvan3ka9p3fqln8277hp0m9qts4h7qpcupvz3z2s0v9687tfulcfs9aydm5"]}}	

Response: 200

{
    "id": "18",
    "data": {
        "subscribed": true
    }
}

Unsubscribe address

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"18","method":"unsubscribeAddresses","params":{}}		

Response: 200

{
    "id": "18",
    "data": {
        "subscribed": false
    }
}

Subscribe new fiat rates

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"19","method":"subscribeFiatRates","params":{"currency":"usd"}}		

Response: 200

{
    "id": "19",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new fiat rates

wss://bchbook.nownodes.io/wss/{{api_key}}

Body

{"id":"19","method":"unsubscribeFiatRates","params":{}}		

Response: 200

{
    "id": "19",
    "data": {
        "subscribed": false
    }
}

Last updated