BSC Blockbook WSS

Get Info

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "2",
    "data": {
        "name": "BNB Smart Chain",
        "shortcut": "BNB",
        "decimals": 18,
        "version": "devel",
        "bestHeight": 37794371,
        "bestHash": "0xf162dac74709d8e00b17df9b25b65d539e12d05146c20d52a84bd269d411d8bf",
        "block0Hash": "0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b",
        "testnet": false,
        "backend": {
            "version": "Geth/v1.3.8-c6aeee20-20240123/linux-amd64/go1.21.6"
        }
    }
}

Ping

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Get block hash

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "4",
    "data": {
        "hash": "0xe468563fd42441b615ef6132474b2b6692fea05c7523356b79b8e5a414909360"
    }
}

Get account info

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "5",
    "data": {
        "address": "0xba98D6a5ac827632E3457De7512d211e4ff7e8bD",
        "balance": "0",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 0,
        "nonce": "0"
    }
}

Get balance history

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "7",
    "data": [
        {
            "time": 1711288800,
            "txs": 1,
            "received": "0",
            "sent": "0",
            "sentToSelf": "0"
        }
    ]
}

Get transaction

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

{"id":"9","method":"getTransaction","params":{"txid":"0xb720d6f672bd2f5236a7808eb106905e193f55660e0b8dab0856e428dae88c09"}}	

Response: 200

{
    "id": "9",
    "data": {
        "txid": "0xb720d6f672bd2f5236a7808eb106905e193f55660e0b8dab0856e428dae88c09",
        "vin": [
            {
                "n": 0,
                "addresses": [
                    "0xe2d3A739EFFCd3A99387d015E260eEFAc72EBea1"
                ],
                "isAddress": true
            }
        ],
        "vout": [
            {
                "value": "35872515233244859",
                "n": 0,
                "addresses": [
                    "0x0000000000000000000000000000000000001000"
                ],
                "isAddress": true
            }
        ],
        "blockHash": "0x7ac33d5c2abfa5c86b688239812db61f36f10dfbfc76e1b977ec6eca7618b247",
        "blockHeight": 37793570,
        "confirmations": 868,
        "blockTime": 1712920338,
        "value": "35872515233244859",
        "fees": "0",
        "ethereumSpecific": {
            "status": 1,
            "nonce": 1645004,
            "gasLimit": 9223372036854775807,
            "gasUsed": 51008,
            "gasPrice": "0",
            "data": "0xf340fa01000000000000000000000000e2d3a739effcd3a99387d015e260eefac72ebea1",
            "parsedData": {
                "methodId": "0xf340fa01",
                "name": ""
            }
        }
    }
}

Get transaction specific

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

{"id":"10","method":"getTransactionSpecific","params":{"txid":"0xdc18ac078e20f5ce8ee72004c89400ffa4bee67e8aa292dce69f5978dce84532"}}	

Response: 200

{
    "id": "10",
    "data": {
        "tx": {
            "nonce": "0x1919cc",
            "gasPrice": "0x0",
            "gas": "0x7fffffffffffffff",
            "to": "0x0000000000000000000000000000000000001000",
            "value": "0x7f71dccfad66bb",
            "input": "0xf340fa01000000000000000000000000e2d3a739effcd3a99387d015e260eefac72ebea1",
            "hash": "0xb720d6f672bd2f5236a7808eb106905e193f55660e0b8dab0856e428dae88c09",
            "blockNumber": "0x240af22",
            "blockHash": "0x7ac33d5c2abfa5c86b688239812db61f36f10dfbfc76e1b977ec6eca7618b247",
            "from": "0xe2d3A739EFFCd3A99387d015E260eEFAc72EBea1",
            "transactionIndex": "0xb4"
        },
        "receipt": {
            "gasUsed": "0xc740",
            "status": "0x1",
            "logs": [
                {
                    "address": "0x0000000000000000000000000000000000001002",
                    "topics": [
                        "0x6c98249d85d88c3753a04a22230f595e4dc8d3dc86c34af35deeeedc861b89db",
                        "0x0000000000000000000000000000000000000000000000000000000000001000"
                    ],
                    "data": "0x0000000000000000000000000000000000000000000000000007f71dccfad66b"
                },
                {
                    "address": "0x0000000000000000000000000000000000001000",
                    "topics": [
                        "0x6ecc855f9440a9282c90913bbc91619fd44f5ec0b462af28d127b116f130aa4d"
                    ],
                    "data": "0x0000000000000000000000000000000000000000000000000007f71dccfad66b"
                },
                {
                    "address": "0x0000000000000000000000000000000000001000",
                    "topics": [
                        "0x627059660ea01c4733a328effb2294d2f86905bf806da763a89cee254de8bee5"
                    ],
                    "data": "0x000000000000000000000000000000000000000000000000000cbe9614c48a45"
                },
                {
                    "address": "0x0000000000000000000000000000000000001000",
                    "topics": [
                        "0x93a090ecc682c002995fad3c85b30c5651d7fd29b0be5da9d784a3302aedc055",
                        "0x000000000000000000000000e2d3a739effcd3a99387d015e260eefac72ebea1"
                    ],
                    "data": "0x000000000000000000000000000000000000000000000000006abc28edee060b"
                }
            ]
        }
    }
}

Estimate fee

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "11",
    "data": [
        {
            "feePerTx": "159000000000000",
            "feePerUnit": "3000000000",
            "feeLimit": "53000"
        },
        {
            "feePerTx": "8427000000000000000",
            "feePerUnit": "159000000000000",
            "feeLimit": "53000"
        },
        {
            "feePerTx": "446631000000000000000000",
            "feePerUnit": "8427000000000000000",
            "feeLimit": "53000"
        },
        {
            "feePerTx": "23671443000000000000000000000",
            "feePerUnit": "446631000000000000000000",
            "feeLimit": "53000"
        }
    ]
}

Send transaction

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

{"id":"1","method":"sendTransaction","params":{"hex":"010000000001019d64f0c72a0d206001decbffaa722eb1044534c74eee7a5df8318e42a4323ec10000000017160014550da1f5d25a9dae2eafd6902b4194c4c6500af6ffffffff02809698000000000017a914cd668d781ece600efa4b2404dc91fd26b8b8aed8870553d7360000000017a914246655bdbd54c7e477d0ea2375e86e0db2b8f80a8702473044022076aba4ad559616905fa51d4ddd357fc1fdb428d40cb388e042cdd1da4a1b7357022011916f90c712ead9a66d5f058252efd280439ad8956a967e95d437d246710bc9012102a80a5964c5612bb769ef73147b2cf3c149bc0fd4ecb02f8097629c94ab013ffd00000000"}}		

Response: 200

{
    "id": "1",
    "data": {
        "error": {
            "message": "invalid argument 0: json: cannot unmarshal hex string without 0x prefix into Go value of type hexutil.Bytes"
        }
    }
}

Get fiat rates for timestamps

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Get fiat rates for tickers list

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Get current fiat rates

wss://bsc-blockbook.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://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Unsubscribe new block

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Subscribe new transaction

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Unsubscribe new transaction

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Subscribe address

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

{"id":"18","method":"subscribeAddresses","params":{"addresses":["0xba98d6a5ac827632e3457de7512d211e4ff7e8bd","0x73d0385f4d8e00c5e6504c6030f47bf6212736a8"]}}	

Response: 200

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

Unsubscribe address

wss://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Subscribe new fiat rates

wss://bsc-blockbook.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://bsc-blockbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Last updated