Skip to content

Commit

Permalink
Update error.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rouzwelt committed Nov 6, 2024
1 parent 56c5ce7 commit 5453c08
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import {
InvalidInputRpcError,
ExecutionRevertedError,
TransactionRejectedRpcError,
TipAboveFeeCapError,
TransactionTypeNotSupportedError,
IntrinsicGasTooLowError,
IntrinsicGasTooHighError,
InsufficientFundsError,
NonceMaxValueError,
NonceTooLowError,
NonceTooHighError,
FeeCapTooLowError,
FeeCapTooHighError,
} from "viem";

/**
Expand Down Expand Up @@ -47,6 +57,18 @@ export function containsNodeError(err: BaseError) {
return (
err instanceof TransactionRejectedRpcError ||
err instanceof InvalidInputRpcError ||
err instanceof ExecutionRevertedError ||
err instanceof FeeCapTooHighError ||
err instanceof FeeCapTooLowError ||
err instanceof NonceTooHighError ||
err instanceof NonceTooLowError ||
err instanceof NonceMaxValueError ||
err instanceof InsufficientFundsError ||
err instanceof IntrinsicGasTooHighError ||
err instanceof IntrinsicGasTooLowError ||
err instanceof TransactionTypeNotSupportedError ||
err instanceof TipAboveFeeCapError ||
(err instanceof RpcRequestError && err.code === ExecutionRevertedError.code)
// ("code" in err && err.code === ExecutionRevertedError.code)
);
}

0 comments on commit 5453c08

Please sign in to comment.