Filters and ABI configurations
This release adds a new API method to add configurations that are scoped either globally or to an Ethereum address. A configuration allows adding filters
to filter down which events you would like to receive and also allows adding an abi
so that the Blocknative server can automatically decode contract input data.
await blocknative.configuration({
scope: String, // [required] - either 'global' or valid Ethereum address
filters: Array, // [optional] - array of valid searchjs filter strings
abi: Array, // [optional] - valid contract ABI
watchAddress: Boolean // [optional] - Whether the server should automatically watch the "scope" value if it is an address
})
// returns a promise that resolves once the configuration has been applied
// or rejects if there was a problem with the configuration
The Blocknative server uses jsql
a JavaScript query language to filter events. Documentation for how to create filter queries can be found here
There is a breaking change in this release where the transaction event payload has been changed so that it more closely matches the payloads from our webhook API.
The following parameters have been added to the transaction payload:
serverVersion
- version of the server that sent the payload (String)
timeStamp
- time stamp of when the server sent the payload (String)
system
- system (blockchain) the transaction occurred on (String)
network
- network name the transaction occurred on (String)
The following parameters in the transaction payload have been modified:
originalHash
- has been replaced with replaceHash
status
- speedup and cancel events were both represented with a status of 'pending', in this update they will be represented with values of 'speedup' and 'cancel' respectively
Changelog: