Subscribe to events generated by vechain smart contracts. Events are created using the LOG
opcode in the Ethereum Virtual Machine (EVM).
Example:
// Filter the events by 'Transfer(address,address,uint256)'
const ws = new WebSocket('ws://localhost:8669/subscriptions/event?t0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef')
ws.onmessage = (event) => {
console.log(event.data)
}
A saved block ID for resuming the subscription. If omitted, the best block ID is assumed.
Note: If the provided position is too far behind the best block, a 403 error will be thrown. The allowable difference depends on the configuration of each node.
See the argument api-backtrace-limit
when starting a node.
^(0x)?[0-9a-fA-F]{64}$
The address of the contract that emits the event.
0x0000000000000000000000000000456E65726779
The keccak256 hash representing the event signature.
For example, the signature for the Transfer
event is keccak256("Transfer(address,address,uint256)")
.
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
Filters events based on the 1st parameter in the event.
Note: The parameter must be padded to 32 bytes.
For example, for the event MySolidityEvent(address,uint256)
, use t1
to match the address
parameter.
0x0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa
Filters events based on the 2nd parameter in the event.
Note: The parameter must be padded to 32 bytes.
For example, for the event MySolidityEvent(address,uint256)
, use t2
to match the uint256
parameter.
0x0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa
Filters events based on the 3rd parameter in the event.
Note: The parameter must be padded to 32 bytes.
For example, for the event MySolidityEvent(address,address,uint256)
, use t3
to match the uint256
parameter.
0x0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa