OP index WSS

Get Info

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "2",
    "data": {
        "name": "Optimism",
        "shortcut": "ETH",
        "decimals": 18,
        "version": "devel",
        "bestHeight": 132708214,
        "bestHash": "0xdfa5e9f50124cd1bb3d2992e2cf0e3000be59745fbcdc55a52f8f52f45a67b57",
        "block0Hash": "0x7ca38a1916c42007829c55e69d3e9a73265554b586a499015373241b8a3fa48b",
        "testnet": false,
        "backend": {
            "version": "Geth/vuntagged/linux-amd64/go1.22.7"
        }
    }
}

Ping

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Get block hash

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Get account info

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "5",
    "data": {
        "address": "0xD8bAe3205348480b3F87f42E1B181Ee09C402655",
        "balance": "258958296274977",
        "unconfirmedBalance": "0",
        "unconfirmedTxs": 0,
        "txs": 332,
        "nonTokenTxs": 285,
        "nonce": "252"
    }
}

Get balance history

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "7",
    "data": [
        {
            "time": 1714863600,
            "txs": 1,
            "received": "0",
            "sent": "0",
            "sentToSelf": "0",
            "rates": {
                "aed": 11441.169,
                "ars": 2735745.2,
...

Get transaction

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "9",
    "data": {
        "txid": "0x2087939d8f606604ae0be19d0ed4e4d76d30008174f3e54521480ccef47d08fe",
        "vin": [
            {
                "n": 0,
                "addresses": [
                    "0xca34DB76CedFb2FE91346fe05CccfC362DB25b97"
                ],
                "isAddress": true
            }
        ],
        "vout": [
            {
                "value": "0",
                "n": 0,
                "addresses": [
                    "0xC09F9452F0d33254C60641B0094387F79cA6d775"
                ],
                "isAddress": true
            }
        ],
        "blockHash": "0xc79dde0643e4f561a9e7d709492ad405e0b01b09540c4f69f7d8c82124cf8313",
        "blockHeight": 132709037,
        "confirmations": 7,
        "blockTime": 1741016851,
        "value": "0",
        "fees": "1807487321199",
        "ethereumSpecific": {
            "status": 1,
            "nonce": 195911,
            "gasLimit": 8000000,
            "gasUsed": 521939,
            "gasPrice": "4408",
            "l1Fee": 1805186614087,
            "l1GasPrice": "1405147339",
            "l1GasUsed": 1600,
            "data": "0x",
            "parsedData": {
                "methodId": "",
                "name": "Transfer"
            }
        }
    }
}

Get transaction specific

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "10",
    "data": {
        "tx": {
            "nonce": "0x2fd47",
            "gasPrice": "0x1138",
            "gas": "0x7a1200",
            "to": "0xC09F9452F0d33254C60641B0094387F79cA6d775",
            "value": "0x0",
            "input": "0x",
            "hash": "0x2087939d8f606604ae0be19d0ed4e4d76d30008174f3e54521480ccef47d08fe",
            "blockNumber": "0x7e8faad",
            "blockHash": "0xc79dde0643e4f561a9e7d709492ad405e0b01b09540c4f69f7d8c82124cf8313",
            "from": "0xca34DB76CedFb2FE91346fe05CccfC362DB25b97",
            "transactionIndex": "0x12"
        },
        "receipt": {
            "gasUsed": "0x7f6d3",
            "status": "0x1",
            "logs": [],
            "l1Fee": "0x1a44d81c347",
            "l1GasPrice": "0x53c0d8cb",
            "l1GasUsed": "0x640"
        }
    }
}

Estimate fee

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "11",
    "data": [
        {
            "feePerTx": "54019952667",
            "feePerUnit": "1004219",
            "feeLimit": "53793"
        },
        {
            "feePerTx": "2905895313815931",
            "feePerUnit": "54019952667",
            "feeLimit": "53793"
        },
        {
            "feePerTx": "156316826616100376283",
            "feePerUnit": "2905895313815931",
            "feeLimit": "53793"
        },
        {
            "feePerTx": "8408751054159887541391419",
            "feePerUnit": "156316826616100376283",
            "feeLimit": "53793"
        }
    ]
}

Send transaction

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

Body

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

Response: 200

{
    "id": "13",
    "data": {
        "tickers": [
            {
                "ts": 1575331200,
                "rates": {
                    "aed": 546.8193,
                    "ars": 8914.723,
                    "aud": 218.34764,
                    "bch": 0.6966367,
...

Get fiat rates for tickers list

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "15",
    "data": {
        "ts": 1676592000,
        "available_currencies": [
            "aed",
            "ars",
            "aud",
            "bch",
            "bdt",
            "bhd",
            "bits",
            "bmd",
            "brl",
            "btc",
            "cad",
            "chf",
            "clp",
            "cny",
            "dkk",
            "dot",
            "eos",
            "eth",
            "eur",
            "gbp",
            "gel",
            "huf",
            "idr",
            "ils",
            "inr",
            "jpy",
            "krw",
            "kwd",
            "link",
            "ltc",
            "mxn",
            "ngn",
            "nok",
            "nzd",
            "php",
            "pkr",
            "pln",
            "rub",
            "sar",
...

Get current fiat rates

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

{
    "id": "6",
    "data": {
        "ts": 1741017001,
        "rates": {
            "aed": 8432.88,
            "ars": 2442568,
            "aud": 3676.41,
            "bch": 6.623511,
            "bdt": 278601,
            "bhd": 865.33,
            "bits": 25332,
...

Subscribe new block

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Unsubscribe new block

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Subscribe new transaction

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Unsubscribe new transaction

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Subscribe address

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Unsubscribe address

wss://optimism-index.nownodes.io/wss/{{api_key}}

Body

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

Response: 200

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

Subscribe new fiat rates

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

Body

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

Response: 200

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

Last updated