ethereumare supported. Defaults to
ethereumif no value is passed in.
3Ropsten Test Network
4Rinkeby Test Network
5Goerli Test Network
42Kovan Test Network
56Binance Smart Chan Main Network
100xDai POA Network
137Polygon Matic Mainnet Network
sdkin a server environment, there won't be a native WebSocket instance available for the
sdkto use, so you will need to pass one in. You can use any WebSocket library that you prefer as long as it correctly implements the WebSocket specifications. We recommend ws.
sdkon the same client, passing in a name property allows the
sdkto properly manage persistent state.
String- The error message, describing what went wrong
ErrorObject- An error object if ine exist (for instance a WebSocket error)
txidpassed to the call to
transactionthat caused the error
addresspassed to the call to
accountthat caused the error
detailsobject contains the initial transaction details which are useful for internal tracking.
accountwill include an event
emitterthat you can use to listen for those events and a details object which includes the
addressthat is being watched.
dappId. To log an event, simple call
eventCode, both of which can be any
Stringthat you like:
transactionand is used to listen to status updates via callbacks registered for specific event codes.
transactionemitters will be included in the object that the global
transactionHandlersare called with under the
offmethod on the emitter to remove your callback listener:
transactionHandlersarray will be called with the following transaction object:
confirmednotifications when a
watchedAddressis detected in the internal transactions of a contract call. In this case, the
confirmedtransaction object will include details of the internal transactions and balance changes resulting from those internal transactions. Fields are not ordered.
internalTransactionsarray contains details on each internal transaction executed by the contract call of the parent (main) transaction. Fields are not ordered.
0x. For contract calls, this value contains the contract method signature and params as a hex string.
toaddress from parent (main) transaction
contractCallobject will include an additional field,
contractAliaswith the symbol of the token transferred.
netBalanceChangesobject contains details of all the balance changes resulting from the internal transactions details in the
<address>. Outgoing value is represented as a negative balance change and incoming value is represented as a positive balance change
<address>for the current
all: Will be called for all events that are associated with that emitter. If a more specific listener exists for that event, then that will be called instead. This is useful to catch any remaining events that you haven't specified a handler for
txSent: Transaction has been sent to the network
txPool: Transaction was detected in the "pending" area of the mempool and is eligible for inclusion in a block
txPoolSimulation: Transaction was detected in the "pending" area of the mempool and is eligible for inclusion in a block and has been simulated against the latest block
txStuck: Transaction was detected in the "queued" area of the mempool and is not eligible for inclusion in a block
txConfirmed: Transaction has been mined
txFailed: Transaction has failed
txSpeedUp: A new transaction has been submitted with the same nonce and a higher gas price, replacing the original transaction
txCancel: A new transaction has been submitted with the same nonce, a higher gas price, a value of zero and sent to an external address (not a contract)
txDropped: Transaction was dropped from the mempool without being added to a block
configurationfunction can be used to send a configuration that will be scoped globally or to a particular address:
'global'configuration so that you can filter all events for all addresses that you are watching or a valid Ethereum address to scope the configuration to events that occur only on that address.
scopeis an Ethereum address, then
watchAddresscan be set to true so that the Blocknative server can automatically watch the address in scope, rather than needing to send an extra call to
sdk-setup.js) downloaded, drop them in to your project directory. They can then be imported and setup with the SDK: