Skip to content

SignedAuthorization

SignedAuthorization<TMessage> = object & { r: Hex; s: Hex; v: number; } | { r?: undefined; s?: undefined; v?: undefined; }

Defined in: src/tokens/eip3009.ts:79

A signed EIP-3009 authorization.

An EOA’s signature (65 bytes) also comes split into (v, r, s), for the token’s *WithAuthorization(..., v, r, s) entrypoint. Any other signature — a deployed smart account’s ERC-1271 signature, for instance — comes whole in signature, with no v / r / s: only a token that checks ERC-1271 accepts it, through its bytes signature overload (USDC v2.2 does; JPYC checks with ecrecover only). Narrowing on v settles r and s too.

Type Declaration

domain

readonly domain: Eip3009Domain

message

readonly message: TMessage

signature

readonly signature: Hex

Type Parameters

TMessage

TMessage

Example

const signed = await signTransferWithAuthorization(account, domain, message);
if (signed.v !== undefined) {
// EOA: transferWithAuthorization(..., signed.v, signed.r, signed.s)
} else {
// smart account: transferWithAuthorization(..., signed.signature) on an ERC-1271 token
}