Event

Query smart contract events

Query event logs generated by vechain smart contracts. Events are created using the LOG opcode in the Ethereum Virtual Machine (EVM).

Event logs provide a way to track specific occurrences and state changes within a smart contract. By querying these logs, you can gain insights into the history of events emitted by a particular contract.

POSThttps://vet.nownodes.io/logs/event
Body
rangeFilterRange

Defines the range for filtering. Setting values to null indicates the entire range.

Note: If omitted or set to null, a timeout may occur if there is a large amount of data to query.

Example:

{
  "range": {
    "unit": "block",
    "from": 10,
    "to": 1000
  }
}

This refers to the range from block 10 to block 1000.

optionsFilterOptions

Include these parameters to receive filtered results in a paged format.

Note: If omitted, a timeout may occur if there is a large amount of data to query. If there is a small amount of data you can omit to receive all results in a single response.

Example:

{
  "options": {
    "offset": 0,
    "limit": 10
  }
}

In this example, the page offset is 0, and the page size is 10.

criteriaSetnullable array of EventCriteria
ordernullable enum

Specifies the order of the results. Use asc for ascending order, and desc for descending order.

Default value: asc

ascdesc
Response

OK

Body
addressstring

The address of the contract that produces the event (bytes20).

Example: "0x0000000000000000000000000000456e65726779"
Pattern: ^0x[0-9a-f]{40}$
topicsarray of string

Topics are indexed parameters to an event. The first topic is always the event signature.

datastring

The data associated with the event.

Example: "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
Pattern: ^0x[0-9a-f]*$
metaLogMeta

The event or transfer log metadata such as block number, block timestamp, etc.

Request
const response = await fetch('https://vet.nownodes.io/logs/event', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({}),
});
const data = await response.json();
Response
[
  {
    "address": "0x0000000000000000000000000000456e65726779",
    "topics": [
      "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
      "0x000000000000000000000000435933c8064b4ae76be665428e0307ef2ccfbd68"
    ],
    "data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8",
    "meta": {
      "blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
      "blockNumber": 325324,
      "blockTimestamp": 1533267900,
      "txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
      "txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
      "clauseIndex": 0
    }
  }
]