Skip to main content

Try it Live

Run Authorization examples in the interactive playground

Constructors

Type guards and construction helpers for Authorization.

Type Guards

isItem

Check if value is signed Authorization.Item.
Returns: true if value has all Authorization.Item fields Example:
Type Guard Details: Checks for presence of all required fields:
  • chainId (bigint)
  • address (Address)
  • nonce (bigint)
  • yParity (number)
  • r (bigint)
  • s (bigint)
Implementation:

isUnsigned

Check if value is Authorization.Unsigned.
Returns: true if value has all Authorization.Unsigned fields Example:
Type Guard Details: Checks for presence of unsigned fields:
  • chainId (bigint)
  • address (Address)
  • nonce (bigint)
Implementation:

Creating Unsigned Authorizations

Manual Construction

From Account State

Batch Creation

Creating Signed Authorizations

See Signing for details on signing unsigned authorizations.

Type Safety Patterns

Safe Type Narrowing

Union Type Handling

Validation Pipeline

Common Patterns

API Response Handler

Factory Pattern

Builder Pattern

Validation Helpers

Safe Constructor

Array Validator

See Also