Skip to content
docs

RelayProviderConfig

Defined in: protocol-swap2-relay/src/provider.ts:41

optional apiKey?: string

Defined in: protocol-swap2-relay/src/provider.ts:52

Sent as x-api-key when set. Relay’s /quote/v3 refuses a quote without one (401), so either this or a baseUrl proxy that adds it is needed. Prefer the proxy — a key shipped in an app is public.


optional baseUrl?: string

Defined in: protocol-swap2-relay/src/provider.ts:47

Relay’s API (default https://api.relay.link) or the app’s own proxy in front of it. Untrusted either way: every answer is verified on the device.


optional clearedStore?: RelayClearedStore

Defined in: protocol-swap2-relay/src/provider.ts:61

Where cleared order ids are also kept, so that “one deposit per order” survives an app restart (the built-in record lives in memory). has is asked and add awaited right before a signature; either throwing refuses.


optional enabled?: boolean

Defined in: protocol-swap2-relay/src/provider.ts:42


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

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

Injectable for tests and for runtimes that bring their own.

(input, init?): Promise<Response>

MDN Reference

RequestInfo | URL

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | Request | URL

RequestInit

Promise<Response>


optional quoteTtlMs?: number

Defined in: protocol-swap2-relay/src/provider.ts:54

Local lifetime of a quote (default 60 s, at most 5 min). The order itself is refused once older than 10 min.