Drizzle Actions¶
Drizzle emits many different actions that we can hook into with Middlewares. For more information about writing middlewares for Drizzle, see the Drizzle and Contract Events tutorial.
The main categories of actions pertain to: * Accounts * Blocks * Drizzle * Contract Events * Transactions
Accounts¶
ACCOUNTS_FETCHING
¶
Fired when Drizzle begins fetching accounts.
ACCOUNTS_FETCHED
¶
Fired once Drizzle has successfully fetched accounts.
{
accounts
}
accounts
(array): An array of account addresses. ACCOUNT_BALANCE_FETCHED
¶
Fired when an account balance has been successfully fetched.
{
address: balance
}
balance
(int): The account balance, indexed by account address
(string) in gwei. ACCOUNTS_POLLING
¶
Fired when Drizzle begins polling for account changes.
Blocks¶
BLOCK_PROCESSING
¶
{
block
}
block
(object): The block object returned by web3. See the web3 getBlock documentation for the block object's structure. Drizzle¶
DRIZZLE_INITIALIZED
¶
Fire when drizzle has finished initializing. Once this has fired, web3 and accounts have been intialized.
Contract Events¶
EVENT_FIRED
¶
Fired when a contract event has been fired.
{
name,
event
}
name
(string): The name of the event. event
(object): The event object returned by web3. See the web3 Contract Event documentation for the event object's structure.
Transactions¶
TX_BROADCASTED
¶
{
txHash,
stackId
}
txHash
(string): The transaction hash. stackId
(int): An integer representing an index in the transactionStack
.
TX_CONFIRMATION
¶
{
confirmationReceipt,
txHash
}
confirmationReceipt
(object): The confirmation receipt returned by web3. See the web3 getTransactionReceipt documentation for the receipt object's structure. txHash
(string): The transaction hash.
TX_SUCCESSFUL
¶
{
receipt,
txHash
}
receipt
(object): The transaction receipt returned by web3. See the web3 getTransactionReceipt documentation for the receipt object's structure. txHash
(string): The transaction hash.
TX_ERROR
¶
{
error,
stackTempKey
}
error
(object): An error object, containig a message
, if provided. Empty object if the transaction failed as a result of user rejection via their wallet. stackTempKey
(string): If the transaction experienced an erorr before broadcasting (such as a rejection), this key will be filled on the transactionStack
rather than a transaction hash to prevent stack index collisions.