Skip to main content
The deposit authorization system uses discriminated unions to represent the three possible authorization methods. Type guards are provided for TypeScript narrowing.

Import

DepositAuthMethod Enum

Result Types

DepositAuthorizationResult (Discriminated Union)

PermitAuthorizationResult

Returned when the token supports EIP-2612 permit signatures.

ApprovalAuthorizationResult

Returned when an ERC20 approval transaction is needed.

AlreadyApprovedAuthorizationResult

Returned when existing allowance is sufficient.

Type Guards

Use type guards for TypeScript narrowing:

Using Switch Statements

You can also use switch statements with the method discriminant: