Skip to content

viem adapters

@erc7730/sdk@0.9.0 — entry @erc7730/sdk/viem

viem is an optional peer of @erc7730/sdk. Install it when you use these adapters or pass a viem PublicClient as provider.

import { decodeViemTransaction, decodeViemTypedData } from '@erc7730/sdk/viem';
import { officialOnlyPolicy } from '@erc7730/sdk';
const result = await decodeViemTransaction(txRequest, {
registry,
trust: officialOnlyPolicy(),
provider: publicClient,
});
const typed = await decodeViemTypedData(typedDataDefinition, {
registry,
trust: officialOnlyPolicy(),
});

Both helpers return DecodedOperation and reuse the same trust / matchContext pipeline as decodeTransaction / decodeTypedData. Importing @erc7730/sdk/viem does not register a Sourcify ABI loader. Pass enableSourcifyAbiLoader() or loadVerifiedAbi from @erc7730/sdk when you want that fallback. Sourcify stays opt-in on the root entry. @erc7730/sdk/lite is not how the catalog is dropped.

API details: generated docs for decodeViemTransaction, decodeViemTypedData, and ViemTransactionInput.