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)});Parameters
Section titled “Parameters”source
Section titled “source”SettlerResolver | { settlerResolver: SettlerResolver; }
chainId
Section titled “chainId”number
label?
Section titled “label?”string = "0x Settler"
Returns
Section titled “Returns”Promise<Record<string, string>>