Event

(Websocket) Events

get

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)
}
Query parameters
posstringOptional

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.

Pattern: ^(0x)?[0-9a-fA-F]{64}$
addrstringOptional

The address of the contract that emits the event.

Example: 0x0000000000000000000000000000456E65726779
t0stringOptional

The keccak256 hash representing the event signature. For example, the signature for the Transfer event is keccak256("Transfer(address,address,uint256)").

Example: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
t1stringOptional

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.

Example: 0x0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa
t2stringOptional

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.

Example: 0x0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa
t3stringOptional

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.

Example: 0x0000000000000000000000006d95e6dca01d109882fe1726a2fb9865fa41e7aa
Responses
200
OK
application/json
Responseall of
and
and
get
GET /subscriptions/event HTTP/1.1
Host: vet.nownodes.io
Accept: */*
{
  "address": "0x0000000000000000000000000000456e65726779",
  "topics": [
    "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
    "0x000000000000000000000000435933c8064b4ae76be665428e0307ef2ccfbd68"
  ],
  "data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8",
  "obsolete": false,
  "meta": {
    "blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
    "blockNumber": 325324,
    "blockTimestamp": 1533267900,
    "txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
    "txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
    "clauseIndex": 0
  }
}