SwapClientOptions
Properties
Section titled “Properties”relayUrl
Section titled “relayUrl”relayUrl:
string
Relay origin, e.g. http://localhost:4000 (the API is under /api/v2).
appId:
string
The integrating app (si-web is the operator's public front-end, no key).
apiKey?
Section titled “apiKey?”
optionalapiKey?:string
x-si-app-key, for apps other than the operator's.
referrer?
Section titled “referrer?”
optionalreferrer?:string
An app that referred the user to this front-end (attribution, channel share).
pollMs?
Section titled “pollMs?”
optionalpollMs?:number
Status polling interval without a WebSocket (default 1 s); 5× that alongside one.
fetch?
Section titled “fetch?”
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
URL | RequestInfo |
init? |
RequestInit |
Returns
Section titled “Returns”Promise<Response>
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
string | URL | Request |
init? |
RequestInit |
Returns
Section titled “Returns”Promise<Response>
WebSocket?
Section titled “WebSocket?”
optionalWebSocket?: ({new (url,protocols?):WebSocket;prototype:WebSocket;CONNECTING:0;OPEN:1;CLOSING:2;CLOSED:3; }) |null
The global one by default; null polls only.
maxOfferTtlMs?
Section titled “maxOfferTtlMs?”
optionalmaxOfferTtlMs?:number
The longest TTL the SDK lets a user_offer the wallet signs carry (default 15 min):
whoever holds the offer can complete it until then.
relayPublicKey?
Section titled “relayPublicKey?”
optionalrelayPublicKey?:string
The relay's verifying key, which every response's attestation is checked against.
Configure it for a relay you do not operate. Left out, the key the relay publishes at
/network is fetched once, before the first quote, and held from then on: it is never
taken from a response being checked.
network?
Section titled “network?”
optionalnetwork?:string
The Midnight network the swaps are on (mainnet, preprod…). Left out: the relay's (/network).
checkLeg?
Section titled “checkLeg?”
optionalcheckLeg?:LegChecker
Checks a solver_offer leg before the wallet balances it (LegChecker). Without it
the client asks for user_offer quotes only: balancing a leg nobody on the user's side
has checked would pay whatever that leg is short of.