Returns all events matching the filters.
Usage
visionWeb.getEventResult(contractAddress,options,callback);
Parameters
Parameter | Description | Type | Default |
---|---|---|---|
contractAddress | contractAddress | string | - |
options | Options refers to an object that contains 8 parameters whose values can be customized The 8 parameters and their descriptions are below | object | - |
callback | callback | function | - |
options parameters
Parameter | Description | Type | Default |
---|---|---|---|
sinceTimestamp | Filter for events since certain timestamp. The sequence of the result is according to the 'sort' field. | timestamp | - |
eventName | Name of the event to filter by. | string | - |
blockNumber | Specific block number to query | number | - |
size | maximum number returned | number | - |
fingerprint | The 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 data | string | - |
onlyComfired | If set to true, only returns confirmed transactions. | boolean | false |
onlyUncomfired | If set to true, only returns unconfirmed transactions. | boolean | false |
sort | Can 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'
}
]