@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / asExecuteError

Function: asExecuteError()

asExecuteError(caught, operation, context?): ExecutorExecuteError

Defined in: packages/sdk/src/executor/boundary.ts:26

Normalize a failure raised while executing calls to ExecutorExecuteError: a member of that union passes through as itself, a revert with data decodes to ContractRevertError, anything else becomes RpcError naming operation, the original as cause.

A TransactionOutcomeUnknownError passes through with its chainId, operation and hash unchanged, so a wrapper over an inner executor (a safe, a smart account) reports the hash of the outer transaction it sent. This function never creates one: only the code that sent the transaction knows that the bytes may have left.

Parameters

caught

unknown

operation

string

context?

RevertContext = {}

Returns

ExecutorExecuteError