Skip to content
docs

AcrossProviderConfig

Defined in: protocol-swap2-across/src/provider.ts:44

optional apiKey?: string | (() => string | undefined)

Defined in: protocol-swap2-across/src/provider.ts:56

The Across API V5 key (dashboard.across.to) — server only; the app convention is ACROSS_API_KEY. Best as a getter read on every request, so the key lives where you keep secrets; a string is accepted too. It is sent only as the Authorization: Bearer header to baseUrl, never put in a URL, a refusal or a quote, and an answer that came through a redirect is refused. Without one (or one that is not printable ASCII) the provider quotes nothing and reports itself disabled — it still builds, verifies and tracks. Under React Native a key is refused outright (the constructor throws): use acrossRemoteProvider in the app. Across’s older integrator id and V4 key are not used by this module.


optional baseUrl?: string

Defined in: protocol-swap2-across/src/provider.ts:58

V5 origin. Default https://api.across.to. Must be https (http only for localhost): the key rides on it.


optional enabled?: boolean

Defined in: protocol-swap2-across/src/provider.ts:46

Dark flag (the app convention is ACROSS_ENABLED). Default true; without an apiKey the provider is disabled anyway.


optional fetchImpl?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: protocol-swap2-across/src/provider.ts:76

Injectable for tests and for runtimes that bring their own.

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional maxFeeBps?: number

Defined in: protocol-swap2-across/src/provider.ts:70

Fee cap in bps of the input that a deposit may leave to relayers (default 1000 = 10 %, at most 5000).


optional quoteTtlMs?: number

Defined in: protocol-swap2-across/src/provider.ts:72

Local lifetime of a quote (default 60 s, at most 5 min).


optional rpcUrls?: Readonly<Record<string, string>>

Defined in: protocol-swap2-across/src/provider.ts:68

JSON-RPC URLs per CAIP-2 chain: status (the source chain’s to read the deposit, the destination’s to read its fill), and the quote time when /suggested-fees does not answer (Ethereum’s and the source chain’s latest block).


optional suggestedFeesUrl?: string | null

Defined in: protocol-swap2-across/src/provider.ts:63

Across’s keyless relayer-fee quote (default ACROSS_SUGGESTED_FEES_URL); null turns it off and prices every quote with the pinned floor (which needs rpcUrls for Ethereum and the source chain, for the quote time).


optional timeoutMs?: number

Defined in: protocol-swap2-across/src/provider.ts:74

Per API request, ms (default 10 000).