Skip to content
docs

zeroExKnownSpenders

zeroExKnownSpenders(source, chainId, label?): Promise<Record<string, string>>

Defined in: protocol-swap2-0x/src/remote.ts:285

The 0x Settlers a signing policy should know as Permit2 spenders on chainId, labelled — the knownSpenders of wallet-evm’s describeTypedData, and the addresses a kit allowlist needs next to Permit2 and the token. Pass the provider the app swaps through (zeroExRemoteProvider / zeroExProvider, or its settlerResolver): the set is the one that resolver read from the registry, cached for its max age and read again after it. Empty when the registry cannot be read: the permit is then described as a grant to an unknown spender, never silently trusted.

const zeroex = zeroExRemoteProvider({baseUrl, rpcUrls});
describeTypedData(typed, {chainId: 8453, account, knownSpenders: await zeroExKnownSpenders(zeroex, 8453)});

SettlerResolver | { settlerResolver: SettlerResolver; }

number

string = "0x Settler"

Promise<Record<string, string>>