Skip to content

DecodeOptions

Defined in: packages/sdk/src/decode/types.ts:355

Per-call decode settings. Omitted trust means officialOnlyPolicy. Omitted registry is whatever the caller passed; clearSign fills the pinned registry.

optional builtins?: boolean

Defined in: packages/sdk/src/decode/types.ts:371

ERC-20, ERC-721, and WETH builtins after registry and trustedTokens. WETH matches only its deployments. Default true. officialOnlyPolicy() rejects this source, so confidence stays "low". officialOrLocalPolicy() accepts it at "medium". Never "high".


optional externalDataProvider?: ExternalDataProvider

Defined in: packages/sdk/src/decode/types.ts:359

Injected token, name, NFT, and chain reads. No network inside the SDK.


optional fromBlock?: bigint | LogBlockTag

Defined in: packages/sdk/src/decode/types.ts:416

Factory getLogs range forwarded to matchContext. Factory matching is skipped (FACTORY_RANGE_UNBOUNDED) unless fromBlock is a block number or a tag other than earliest. An unset toBlock becomes latest.


optional loadVerifiedAbi?: (chainId, address) => Promise<VerifiedContractAbi | null>

Defined in: packages/sdk/src/decode/types.ts:399

Verified-ABI loader used when useSourcifyFallback is true. Import it from @erc7730/sdk/sourcify and call the factory. There is no process-wide loader. The root entry does not include the client.

number

`0x${string}`

Promise<VerifiedContractAbi | null>


optional locale?: string

Defined in: packages/sdk/src/decode/types.ts:405

BCP-47 locale for dates / amounts only. Descriptor intent strings are never translated — string form, else en, else the first string value.

"en"

optional now?: number | (() => number)

Defined in: packages/sdk/src/decode/types.ts:410

Unix time in seconds for expired_deadline. Tests inject a frozen clock.

Math.floor(Date.now() / 1000)


optional onEvent?: (event) => void

Defined in: packages/sdk/src/decode/types.ts:422

Observability hook. Nested decodes emit their own events with the same callback. Does not open a network connection.

ClearSignEvent

void


optional provider?: Provider | null

Defined in: packages/sdk/src/decode/types.ts:356


optional registry?: OfficialRegistry | DecodeRegistry

Defined in: packages/sdk/src/decode/types.ts:357


optional signatures?: Record<string, string>

Defined in: packages/sdk/src/decode/types.ts:388

Selector → Solidity declaration for this call only. Overrides COMMON_SIGNATURES on a match. There is no process-wide signature map.


optional spenderAllowlist?: `0x${string}`[]

Defined in: packages/sdk/src/decode/types.ts:383

Wallet-known spenders / operators. Suppresses untrusted_spender when the approve / permit / setApprovalForAll target is on this list (case-insensitive).


optional toBlock?: bigint | LogBlockTag

Defined in: packages/sdk/src/decode/types.ts:417


optional trust?: TrustPolicy

Defined in: packages/sdk/src/decode/types.ts:378

Wallet-supplied policy. When omitted, decode uses officialOnlyPolicy(): official-registry and attested are accepted; local overrides, Sourcify, generated, inferred, and basic are rejected. Pass officialOrLocalPolicy() to accept app extend() overrides.


optional trustedTokens?: TrustedTokens

Defined in: packages/sdk/src/decode/types.ts:364

Bundled ERC-20 / ERC-721 templates when no registry descriptor matches. Never confidence: "high" under officialOnlyPolicy().


optional useSourcifyFallback?: boolean

Defined in: packages/sdk/src/decode/types.ts:393

Opt-in Sourcify ABI fallback. Default false: decode does not touch the network. Also requires loadVerifiedAbi on this call. Never confidence: "high".