getEventResult

Returns all events matching the filters.

Usage

visionWeb.getEventResult(contractAddress,options,callback);

Parameters

ParameterDescriptionTypeDefault
contractAddresscontractAddressstring-
optionsOptions refers to an object that contains 8 parameters whose values can be customized The 8 parameters and their descriptions are belowobject-
callbackcallbackfunction-

options parameters

ParameterDescriptionTypeDefault
sinceTimestampFilter for events since certain timestamp. The sequence of the result is according to the 'sort' field.timestamp-
eventNameName of the event to filter by.string-
blockNumberSpecific block number to querynumber-
sizemaximum number returnednumber-
fingerprintThe fingerprint field appears in the last data of the previous query. After specifying the corresponding field content this time, subsequent data will be returned. If there is no this field in the last data of the query, it means that there is no more datastring-
onlyComfiredIf set to true, only returns confirmed transactions.booleanfalse
onlyUncomfiredIf set to true, only returns unconfirmed transactions.booleanfalse
sortCan be 'block_timestamp' for time sequence or '-block_timestamp' for the reverse. Default is '-block_timestamp'.block_timestamp | -block_timestamp-block_timestamp

Returns

Promise Object(Array)

Example

visionWeb.getEventResult(contractAddress,{eventName: "Transfer",size: 1});
> [
  {
    block: 842273,
    timestamp: 1607866557000,
    contract: 'VUzCDX3TQccMCDhvwyo3V5CaC1zbEEmMwf',
    name: 'Transfer',
    transaction: '831a121b1d62626f80b381308750be95898a47eb90fb457a99ba72aa58d6422a',
    result: {
      dst: '0x934a8d6e5c47f83ae9742a1cdd94fd681fce3ef5',
      src: '0x401a8da8a7fc86f0087f8c62e630d10df10a963b',
      wad: '100'
    },
    resourceNode: 'fullNode',
    unconfirmed: true,
    fingerprint: 'zYNYgMegNFFTqTTeFYxbMTgNDNeJIYFJ'
  }
]