everyTransactionPlanResult
Checks if every transaction plan result in the tree satisfies the given predicate.
This function performs a depth-first traversal through the transaction plan result tree,
returning true only if the predicate returns true for every result in the tree
(including the root result and all nested results).
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TContext extends TransactionPlanResultContext | TransactionPlanResultContext | The type of the context object that may be passed along with results |
TTransactionMessage extends TransactionMessage & TransactionMessageWithFeePayer<string> | TransactionMessage & TransactionMessageWithFeePayer<string> | The type of the transaction message |
TSingle extends SingleTransactionPlanResult<TContext, TTransactionMessage> | SingleTransactionPlanResult<TContext, TTransactionMessage> | The type of single transaction plan results in this tree |
Parameters
| Parameter | Type | Description |
|---|---|---|
transactionPlanResult | TransactionPlanResult<TContext, TTransactionMessage, TSingle> | The transaction plan result tree to check. |
predicate | (plan) => boolean | A function that returns true if the result satisfies the condition. |
Returns
boolean
true if every result in the tree satisfies the predicate, false otherwise.
Examples
Checking if all transactions were successful.
Checking if no transactions were canceled.