RemoteProviderOptions
Defined in: protocol-swap2-core/src/remote.ts:26
HTTP-proxied CrossChainProvider: forwards every provider call to a backend
that runs the real provider. This is how a BROWSER context (e.g. a wallet’s
signing worker) executes the full swap2 layer — account binding,
approvals, cell-body guards, id/status lifecycle — while provider secrets
(API JWTs, affiliate config) and non-CORS REST endpoints stay server-side.
Wire protocol: POST {baseUrl}/{action} with a JSON body, one action per provider method: quote {provider, params: QuoteParams} → Quote | null build {provider, quote: Quote} → UnsignedTx preflight {provider, quote: Quote, tx: UnsignedTx} → {} track {provider, ref: IntentRef} → IntentStatus notify {provider, intentId, txHash} → {} register {provider, intentId, signature} → {} claim {provider, ref: IntentRef} → UnsignedTx | null supports {provider, from, to} → {supported: boolean}
supportsRoute/enabled need a SYNC answer, so they are config: pass the
routes the backend advertises via supports, or leave the default
allow-and-let-quote-decide behavior (a null quote is a clean miss).
Properties
Section titled “Properties”allowInsecureBaseUrl?
Section titled “allowInsecureBaseUrl?”
optionalallowInsecureBaseUrl?:boolean
Defined in: protocol-swap2-core/src/remote.ts:77
Allow a non-https absolute baseUrl (local development only). Quotes, builds and typed orders travel this
channel; over plain http anyone on the path can rewrite them (scan 2026-10-27 modules, F4).
baseUrl
Section titled “baseUrl”baseUrl:
string
Defined in: protocol-swap2-core/src/remote.ts:30
Endpoint prefix, e.g. “/api/v2/swap2” (same-origin) or absolute URL.
callTargets?
Section titled “callTargets?”
optionalcallTargets?: (chain) => readonlystring[]
Defined in: protocol-swap2-core/src/remote.ts:53
The contracts this provider’s EVM swaps may call, and the spenders they may be approved for,
per chain — the provider package’s pins (lifiPins, fyndPins, uniswapPins…, spread into
these options). The app’s lists, not the server’s: without them the engine refuses this stub’s
EVM calldata routes and approvals, so a compromised backend cannot name its own contract or
spender (scan 2026-10-27 modules, F8/F9/F16). Deposit-address routes need depositAddressRoutes.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly string[]
claimTargets?
Section titled “claimTargets?”
optionalclaimTargets?: (chain) => readonlystring[]
Defined in: protocol-swap2-core/src/remote.ts:45
The contracts this provider’s claims may call, per chain (e.g. cctpClaimTargets from
@anywalletkit/protocol-swap2-cctp). The app’s list, not the server’s: without it the engine
refuses claims from this stub (round 3, M24).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly string[]
depositAddressRoutes?
Section titled “depositAddressRoutes?”
optionaldepositAddressRoutes?:boolean
Defined in: protocol-swap2-core/src/remote.ts:72
Let this stub’s routes send the input to an address the backend names: a deposit address (NEAR Intents, a
THORChain or Chainflip Tron vault) or a plain value send. Off by default: such a route bypasses callTargets, so
a compromised backend could name its own address (scan 2026-10-28, F9). Opt in only for a provider whose deposit
addresses cannot be pinned, or whose verifyQuote / verifyBuild checks them (thorchainPins, chainflipPins).
enabled?
Section titled “enabled?”
optionalenabled?: () =>boolean
Defined in: protocol-swap2-core/src/remote.ts:34
Optional synchronous dark flag for accurate client-side discovery.
Returns
Section titled “Returns”boolean
fetchImpl?
Section titled “fetchImpl?”
optionalfetchImpl?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: protocol-swap2-core/src/remote.ts:79
Defaults to globalThis.fetch — injectable for tests.
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”URL | RequestInfo
RequestInit
Returns
Section titled “Returns”Promise<Response>
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: protocol-swap2-core/src/remote.ts:81
Extra headers (e.g. auth) attached to every call.
name:
string
Defined in: protocol-swap2-core/src/remote.ts:28
Provider name the backend multiplexes on (e.g. “near-intents”).
spenders?
Section titled “spenders?”
optionalspenders?: (chain) => readonlystring[]
Defined in: protocol-swap2-core/src/remote.ts:54
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly string[]
supportsChain?
Section titled “supportsChain?”
optionalsupportsChain?: (caip2) =>boolean
Defined in: protocol-swap2-core/src/remote.ts:36
Optional chain-level discovery hooks mirrored from the backend.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
supportsChainPair?
Section titled “supportsChainPair?”
optionalsupportsChainPair?: (fromChain,toChain) =>boolean
Defined in: protocol-swap2-core/src/remote.ts:37
Parameters
Section titled “Parameters”fromChain
Section titled “fromChain”string
toChain
Section titled “toChain”string
Returns
Section titled “Returns”boolean
supportsRoute?
Section titled “supportsRoute?”
optionalsupportsRoute?: (from,to) =>boolean
Defined in: protocol-swap2-core/src/remote.ts:32
Sync capability gate; defaults to true (the backend quote decides).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
supportsSameChain?
Section titled “supportsSameChain?”
optionalsupportsSameChain?:boolean
Defined in: protocol-swap2-core/src/remote.ts:39
Explicit opt-in when the backend can execute same-chain swaps.
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?:number
Defined in: protocol-swap2-core/src/remote.ts:83
Per-request fail-closed timeout. Defaults to 12 seconds.
verifyBuild?
Section titled “verifyBuild?”
optionalverifyBuild?: (quote,tx,params?) =>string|Promise<string|null> |null
Defined in: protocol-swap2-core/src/remote.ts:65
The provider’s own check of a build on the client — a typed order, a cell body — against the quote it was built for: the reason it fails, or null. A build it refuses is never approved or signed.
Parameters
Section titled “Parameters”params?
Section titled “params?”Returns
Section titled “Returns”string | Promise<string | null> | null
verifyQuote?
Section titled “verifyQuote?”
optionalverifyQuote?: (params,quote) =>string|null
Defined in: protocol-swap2-core/src/remote.ts:60
The provider’s own check of a quote’s transaction, run here on the client against the request
the app sent (shipped with the pins, e.g. fyndPins): a quote it refuses never reaches the
auction. The backend runs the same check, but the backend is what this guards against.
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”string | null