ZeroExProviderConfig
Defined in: protocol-swap2-0x/src/provider.ts:47
Extended by
Section titled “Extended by”Properties
Section titled “Properties”apiKey?
Section titled “apiKey?”
optionalapiKey?:string| (() =>string|undefined)
Defined in: protocol-swap2-0x/src/provider.ts:57
The 0x API key — server only. Best as a getter, read on every request, so the key lives where you keep secrets
(server env, a vault) and never in this config object; a string is accepted too (an env value read once). It is
sent only as the 0x-api-key header to baseUrl; it is never put in a URL, a refusal, an error or a quote, and an
answer that came through a redirect is refused. Without a key (or with one that is not printable ASCII without
spaces) the provider serves no route. Under React Native a key is refused outright (the constructor throws): use
zeroExRemoteProvider in the app.
baseUrl?
Section titled “baseUrl?”
optionalbaseUrl?:string
Defined in: protocol-swap2-0x/src/provider.ts:59
API origin. Default ZEROEX_DEFAULT_BASE_URL. Must be https (http only for localhost), or the key would travel in clear.
chains?
Section titled “chains?”
optionalchains?:Readonly<Record<number,ZeroExChain|null>>
Defined in: protocol-swap2-0x/src/provider.ts:61
Chain table entries merged over the defaults (EVM chain id → entry, null removes a chain).
defaultSlippageBps?
Section titled “defaultSlippageBps?”
optionaldefaultSlippageBps?:number
Defined in: protocol-swap2-0x/src/provider.ts:65
Slippage when the request names none, bps. Default 50.
enabled?
Section titled “enabled?”
optionalenabled?:boolean
Defined in: protocol-swap2-0x/src/provider.ts:48
excludedSources?
Section titled “excludedSources?”
optionalexcludedSources?: readonlystring[]
Defined in: protocol-swap2-0x/src/provider.ts:70
Liquidity sources 0x must not route through (its excludedSources names).
quoteTtlMs?
Section titled “quoteTtlMs?”
optionalquoteTtlMs?:number
Defined in: protocol-swap2-0x/src/provider.ts:67
How long a quote is offered, ms. Default 120 s; never past the Permit2 deadline, and a native-coin sale’s never past ZEROEX_MAX_NATIVE_QUOTE_SECONDS.
rpcUrls?
Section titled “rpcUrls?”
optionalrpcUrls?:Readonly<Record<number, readonlystring[]>>
Defined in: protocol-swap2-0x/src/provider.ts:63
JSON-RPC endpoints per EVM chain id: the Settler registry read (needed for every executable quote) and receipts.
settlerMaxAgeMs?
Section titled “settlerMaxAgeMs?”
optionalsettlerMaxAgeMs?:number
Defined in: protocol-swap2-0x/src/provider.ts:72
How long a Settler registry read is reused, ms. Default 5 minutes.
settlerResolver?
Section titled “settlerResolver?”
optionalsettlerResolver?:SettlerResolver
Defined in: protocol-swap2-0x/src/provider.ts:74
Share a resolver (e.g. with zeroExRemoteProvider); built from chains / rpcUrls when absent.
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?:number
Defined in: protocol-swap2-0x/src/provider.ts:68