Alias: addresses:functions
Subscribes/Unsubscribes to functions, or specific function signature, pertaining to the specified address.
Make sure you're connected.
Request
{"jsonrpc":"2.0","id":1,"method":"subscribe","params":["address:internal_messages",{"address":"0x06012c8cf97bead5deae237070f9587f8e7a266d","signature":"0x88c2a0bf"}]}
Param | Type | Description |
---|---|---|
address* | string | The address of the account. |
signature | string | The four byte hexadecimal function signature. |
*required
Response
"result": {
"blockchainId": "1c9c969065fcd1cf",
"blockNumber": 7446960,
"code": "",
"contractCodeAddress": "",
"depth": 0,
"error": "",
"from": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
"gasUsed": 0,
"initialGas": 29000,
"input": "0x",
"leftOverGas": 29000,
"messageIndex": 0,
"opcode": "CALL",
"returnValue": "0x",
"timestamp": 1553640678000,
"timestampNanoseconds": null,
"to": "0x50aeab19173154418df840f6c4eb849688b112e8",
"transactionHash": "0x1b39aa3a6410e109142cae6b8c101a40f0143a37e336669772d6e48881d7ee0b",
"transactionTypeId": 0,
"value": 200204598170742050,
"optionalProperties": null
}
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:internal_messages', {address: '0x06012c8cf97bead5deae237070f9587f8e7a266d', signature: '0x88c2a0bf' }],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});
Supported Blockchains
Blockchain | Network | Slug (x-amberdata-blockchain-id) |
---|---|---|
Ethereum | Mainnet | ethereum-mainnet |