address:transactions [OND]

Subscribes/Unsubscribes to transactions pertaining to the specified address.

Make sure you're connected.

Request

{"jsonrpc":"2.0","id":1,"method":"subscribe","params":["address:transactions",{"address":"0x06012c8cf97bead5deae237070f9587f8e7a266d"}]}

Param

Type

Description

address*

string

The address of the account.

*required

Response

"result": {
  "blockchainId": "1c9c969065fcd1cf",
  "hash": "0x4bc4a8767f66e74b6932c238fbf42cfd153ec91bb7e4dff51821753bc0810b47",
  "nonce": 32294,
  "blockHash": "0x4e7257a3c2282bb17280e391a8413a88b36169cbdc6820ddb4a247bf1bca83f2",
  "blockNumber": 7575336,
  "transactionIndex": 157,
  "from": "0xd387a6e4e84a6c86bd90c158c6028a58cc8ac459",
  "functionCalls": null,
  "numFunctionCalls": null,
  "to": "0x06012c8cf97bead5deae237070f9587f8e7a266d",
  "tos": null,
  "value": 0,
  "input": "0x095ea7b300000000000000000000000057831a0c76ba6b4fdcbadd6cb48cb26e8fc15e930000000000000000000000000000000000000000000000000000000000081ccf",
  "gasPrice": 1000000000,
  "gas": 69423,
  "cumulativeGasUsed": 7911217,
  "gasUsed": 46282,
  "contractAddress": null,
  "status": "0x1",
  "numLogs": 1,
  "timestamp": 1555369047000,
  "timestampNanoseconds": 0,
  "optionalProperties": {
    "logsBloom": "0x000000...",
    "r": "0xb6d8d15af1b76ee04e57f10cdf9bd39fe4a7c30c1db79dc3eeeeba1dda913420",
    "s": "0x677d51b258ec8b0de99d00f4f62ac0d30124f3b7c1a685ff04898ca7d49e0330",
    "v": 38
  }
}

Example

const WebSocket = require('ws');
const ws = new WebSocket('wss://ws.web3api.io', {headers: {x-api-key:'<api_key>'}});

ws.on('open', () => {
  ws.send(JSON.stringify({
      jsonrpc: '2.0',
      method: 'subscribe',
      params: ['address:transactions', {address: '0x06012c8cf97bead5deae237070f9587f8e7a266d'}],
      id: 1,
    }));
});

ws.on('message', data => {
  console.log(JSON.stringify(JSON.parse(data), null, 2));
});