Home

Blockbook WSS 0.6.0

Get Info

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"1","method":"getInfo","params":{}}

Response: 200

Copied!
{
    "id": "1",
    "data": {
        "name": "Polygon",
        "shortcut": "MATIC",
        "network": "MATIC",
        "decimals": 18,
        "version": "0.6.0",
        "bestHeight": 77092542,
        "bestHash": "0x3c67aa0c53d27a99ebcd1c7cc2edfe313a345b978306d901030144d17776610e",
        "block0Hash": "",
        "testnet": false,
        "backend": {
            "version": "bor/c4740cb6b024/v2.8.2/linux-amd64/go1.26.2"
        }
    }
}

Ping

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"2","method":"ping","params":{}}

Response: 200

Copied!
{
    "id": "2",
    "data": {}
}

Get block hash

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"3","method":"getBlockHash","params":{"height":1000000}}

Response: 200

Copied!
{
    "id": "3",
    "data": {
        "hash": "0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e"
    }
}

Get account info

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

Copied!
{
    "id": "4",
    "data": {
        "address": "0xba98D6a5ac827632E3457De7512d211e4ff7e8bD",
        "balance": "0",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 0,
        "nonce": "0"
    }
}

On EVM chains the response carries the account nonce.

Get account UTXO

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{
  "id": "5",
  "method": "getAccountUtxo",
  "params": {
    "descriptor": "0xba98d6a5ac827632e3457de7512d211e4ff7e8bd"
  }
}

Response: 200

Copied!
{
    "id": "5",
    "data": {
        "error": {
            "message": "Not supported"
        }
    }
}

UTXO-based chains only. Polygon is account-based, so this method is not usable on this coin.

Get balance history

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

Copied!
{
    "id": "6",
    "data": []
}

An address without activity in the requested window returns an empty array. With currencies set to an empty string, rates on each point lists all available currencies.

Get transaction

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"7","method":"getTransaction","params":{"txid":"0xdc18ac078e20f5ce8ee72004c89400ffa4bee67e8aa292dce69f5978dce84532"}}

Response: 200

Copied!
{
    "id": "7",
    "data": {
        "error": {
            "message": "Transaction '0xdc18ac078e20f5ce8ee72004c89400ffa4bee67e8aa292dce69f5978dce84532' not found"
        }
    }
}

On this chain a found transaction has one vin and one vout, with tokenTransfers and ethereumSpecific execution data.

Get transaction specific

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"8","method":"getTransactionSpecific","params":{"txid":"0xdc18ac078e20f5ce8ee72004c89400ffa4bee67e8aa292dce69f5978dce84532"}}

Response: 200

Copied!
{
    "id": "8",
    "data": {
        "error": {
            "message": "Tx not found"
        }
    }
}

On success returns the backend-native transaction payload.

Estimate fee

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

Copied!
{
    "id": "9",
    "data": [
        {
            "feePerTx": "426083335548084",
            "feePerUnit": "7920795188",
            "feeLimit": "53793"
        },
        {
            "feePerTx": "22920300869138082612",
            "feePerUnit": "426083335548084",
            "feeLimit": "53793"
        },
        {
            "feePerTx": "1232951744653544877947316",
            "feePerUnit": "22920300869138082612",
            "feeLimit": "53793"
        },
        {
            "feePerTx": "66324173200148139619419969588",
            "feePerUnit": "1232951744653544877947316",
            "feeLimit": "53793"
        }
    ]
}

Values are in wei; feeLimit is the gas limit for the target. One object is returned per requested target, in order.

Get long term fee rate

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"10","method":"longTermFeeRate","params":{}}

Response: 200

Copied!
{
    "id": "10",
    "data": {
        "error": {
            "message": "Not supported"
        }
    }
}

Bitcoin-backend long-term mempool statistic; not applicable to the bor backend.

Get block filter

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{
  "id": "11",
  "method": "getBlockFilter",
  "params": {
    "scriptType": "",
    "blockHash": "0x8e38b4dbf6b11fcc3b9dee84fb7986e29ca0a02cecd8977c161ff7333329681e"
  }
}

Response: 200

Copied!
{
    "id": "11",
    "data": {
        "P": 0,
        "M": 1,
        "zeroedKey": false,
        "blockFilter": ""
    }
}

Compact block filters are not built on this endpoint, so blockFilter comes back empty and P is 0. Send scriptType empty, as no script type is configured.

Get mempool filters

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"12","method":"getMempoolFilters","params":{"scriptType":"","mempool":true}}

Response: 200

Copied!
{
    "id": "12",
    "data": {
        "P": 0,
        "M": 1,
        "zeroedKey": false,
        "entries": {}
    }
}

Mempool filters are not built on this endpoint, so entries comes back empty.

Send transaction

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"13","method":"sendTransaction","params":{"hex":"010000000001019d64f0c72a0d206001decbffaa722eb1044534c74eee7a5df8318e42a4323ec10000000017160014550da1f5d25a9dae2eafd6902b4194c4c6500af6ffffffff02809698000000000017a914cd668d781ece600efa4b2404dc91fd26b8b8aed8870553d7360000000017a914246655bdbd54c7e477d0ea2375e86e0db2b8f80a8702473044022076aba4ad559616905fa51d4ddd357fc1fdb428d40cb388e042cdd1da4a1b7357022011916f90c712ead9a66d5f058252efd280439ad8956a967e95d437d246710bc9012102a80a5964c5612bb769ef73147b2cf3c149bc0fd4ecb02f8097629c94ab013ffd00000000"}}

Response: 200

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

On EVM chains the broadcast hex must be a 0x-prefixed signed RLP transaction; a payload without the prefix fails hexutil parsing.

Get fiat rates for timestamps

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"14","method":"getFiatRatesForTimestamps","params":{"timestamps":[1575288000],"currencies":[""]}}

Response: 200

Copied!
{
    "id": "14",
    "data": {
        "tickers": [
            {
                "ts": 1575331200,
                "rates": {
                    "aed": 546.8193,
                    "ars": 8914.723,
                    "aud": 218.34764,
                    "bdt": 12641.244,
                    "bhd": 56.129955,
                    "bmd": 148.86726,
                    "brl": 628.7558,
                    "btc": 0.020375907,
                    "cad": 198.08994,
                    "chf": 147.59683,
                    "clp": 119659.3,
                    "cny": 1047.9214,
                    "czk": 3433.6606,
                    "dkk": 1004.145,
                    "eth": 1,
                    "eur": 134.39647,
                    "gbp": 115.050285,
                    "hkd": 1165.4148,
                    "huf": 44648.62,
                    "idr": 2103165.2,
                    "ils": 517.0309,
                    "inr": 10664.122,
                    "jpy": 16230.488,
                    "krw": 176377.94,
                    "kwd": 45.268154,
                    "lkr": 26996.39,
                    "mmk": 224323.94,
                    "mxn": 2915.0295,
                    "myr": 622.08655,
                    "ngn": 53982.49,
                    "nok": 1365.1716,
                    "nzd": 229.10062,
                    "php": 7596.697,
                    "pkr": 23114.906,
                    "pln": 576.2125,
                    "rub": 9558.217,
                    "sar": 558.2506,
                    "sek": 1420.7402,
                    "sgd": 203.45586,
                    "thb": 4505.457,
                    "try": 854.8554,
                    "twd": 4532.7104,
                    "uah": 3567.19,
                    "usd": 148.86726,
                    "vef": 36991676,
                    "vnd": 3428883,
                    "zar": 2165.7656
                }
            }
        ]
    }
}

Rates resolve to the closest available daily snapshot: ts is the actual rate timestamp and can differ from the requested one.

Get fiat rates for tickers list

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

Copied!
{
    "id": "15",
    "data": {
        "ts": 1676592000,
        "available_currencies": [
            "aed",
            "ars",
            "aud",
            "bdt",
            "bhd",
            "bmd",
            "brl",
            "btc",
            "cad",
            "chf",
            "clp",
            "cny",
            "czk",
            "dkk",
            "eth",
            "eur",
            "gbp",
            "hkd",
            "huf",
            "idr",
            "ils",
            "inr",
            "jpy",
            "krw",
            "kwd",
            "lkr",
            "mmk",
            "mxn",
            "myr",
            "ngn",
            "nok",
            "nzd",
            "php",
            "pkr",
            "pln",
            "rub",
            "sar",
            "sek",
            "sgd",
            "thb",
            "try",
            "twd",
            "uah",
            "usd",
            "vef",
            "vnd",
            "zar"
        ]
    }
}

Get current fiat rates

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"16","method":"getCurrentFiatRates","params":{"currencies":[""]}}

Response: 200

Copied!
{
    "id": "16",
    "data": {
        "ts": 1714124526,
        "rates": {
            "aed": 11578.76,
            "ars": 2754471,
            "aud": 4821.05,
            "bdt": 345886,
            "bhd": 1188.35,
            "bmd": 3152.49,
            "brl": 16264.46,
            "btc": 0.04887087,
            "cad": 4303.69,
            "chf": 2875.59,
            "clp": 2990132,
            "cny": 22846,
            "czk": 73905,
            "dkk": 21905,
            "eth": 1,
            "eur": 2937.24,
            "gbp": 2519.91,
            "hkd": 24678,
            "huf": 1154543,
            "idr": 51266030,
            "ils": 12005.23,
            "inr": 262738,
            "jpy": 493543,
            "krw": 4339333,
            "kwd": 970.4,
            "lkr": 936066,
            "mmk": 6618563,
            "mxn": 54401,
            "myr": 15035.78,
            "ngn": 4117840,
            "nok": 34627,
            "nzd": 5294.62,
            "php": 181917,
            "pkr": 877746,
            "pln": 12708.14,
            "rub": 290552,
            "sar": 11823.6,
            "sek": 34306,
            "sgd": 4289.26,
            "thb": 116453,
            "try": 102702,
            "twd": 102737,
            "uah": 124920,
            "usd": 3152.49,
            "vef": 315.66,
            "vnd": 79900800,
            "zar": 59867
        }
    }
}

With currencies set to an empty string all available currencies are returned.

Subscribe new block

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"17","method":"subscribeNewBlock","params":{}}

Response: 200

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

Unsubscribe new block

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"18","method":"unsubscribeNewBlock","params":{}}

Response: 200

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

Subscribe new transaction

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"19","method":"subscribeNewTransaction","params":{}}

Response: 200

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

Unsubscribe new transaction

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"20","method":"unsubscribeNewTransaction","params":{}}

Response: 200

Copied!
{
    "id": "20",
    "data": {
        "subscribed": false
    }
}

Subscribe address

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{
  "id": "21",
  "method": "subscribeAddresses",
  "params": {
    "addresses": [
      "0x109b12abF3FB6396a0E90894E86a640870b7c1ad"
    ],
    "newBlockTxs": true
  }
}

Response: 200

Copied!
{
    "id": "21",
    "data": {
        "subscribed": true
    }
}

Optional parameter newBlockTxs (boolean, default false): when true, the subscription also publishes confirmed transactions for the subscribed addresses as new blocks are connected. Without it only mempool transactions are delivered, so transactions that land straight in a block are never announced.

Unsubscribe address

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"22","method":"unsubscribeAddresses","params":{}}

Response: 200

Copied!
{
    "id": "22",
    "data": {
        "subscribed": false
    }
}

Subscribe new fiat rates

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"23","method":"subscribeFiatRates","params":{"currency":"usd"}}

Response: 200

Copied!
{
    "id": "23",
    "data": {
        "subscribed": true
    }
}

Unsubscribe new fiat rates

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"24","method":"unsubscribeFiatRates","params":{}}

Response: 200

Copied!
{
    "id": "24",
    "data": {
        "subscribed": false
    }
}

Get block

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"25","method":"getBlock","params":{"id":"1000000","page":1}}

Response: 200

Copied!
{
    "id": "25",
    "data": {
        "error": {
            "message": "Not supported"
        }
    }
}

Not supported on this endpoint. This method requires the extended index, which is not enabled.

Get block filters batch

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{
  "id": "26",
  "method": "getBlockFiltersBatch",
  "params": {
    "scriptType": "",
    "bestKnownBlockHash": "0x3c67aa0c53d27a99ebcd1c7cc2edfe313a345b978306d901030144d17776610e",
    "pageSize": 2
  }
}

Response: 200

Copied!
{
    "id": "26",
    "data": {
        "error": {
            "message": "Not supported"
        }
    }
}

Not supported on this endpoint. Compact block filters are not built.

Get contract info

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{
  "id": "27",
  "method": "getContractInfo",
  "params": {
    "contract": "0x0000000000000000000000000000000000000001"
  }
}

Response: 200

Copied!
{
    "id": "27",
    "data": {
        "type": "ERC20",
        "standard": "ERC20",
        "contract": "0x0000000000000000000000000000000000000001",
        "name": "Vault Share",
        "symbol": "vETH",
        "decimals": 18,
        "rates": {
            "baseRate": 0.000523,
            "currency": "usd",
            "secondaryRate": 1.24
        },
        "protocols": {
            "erc4626": {
                "asset": {
                    "contract": "0x0000000000000000000000000000000000000002",
                    "name": "Wrapped Ether",
                    "symbol": "WETH",
                    "decimals": 18
                },
                "share": {
                    "contract": "0x0000000000000000000000000000000000000001",
                    "name": "Vault Share",
                    "symbol": "vETH",
                    "decimals": 18
                },
                "totalAssets": "123456789",
                "convertToAssets1Share": "1000000000000000000",
                "convertToShares1Asset": "1000000000000000000",
                "previewDeposit1Asset": "999999999999999999",
                "previewRedeem1Share": "1000000000000000000"
            }
        },
        "blockHeight": 12345678
    }
}

EVM chains only. The ERC-4626 values are pinned to blockHeight; if the vault is detected but its asset metadata cannot be resolved, protocols.erc4626 carries error and omits asset.

RPC call

Copied!
wss://maticbook.nownodes.io/wss/{{api_key}}

Body

Copied!
{"id":"28","method":"rpcCall","params":{"method":"eth_blockNumber","params":[]}}

Response: 200

Copied!
{
    "id": "28",
    "data": {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "0x49856be"
    }
}

Whitelisted backend JSON-RPC passthrough, available on Ethereum-type networks only; the backend reply is returned as-is.