CrossChainProvider
Defined in: protocol-swap2-core/src/types.ts:220
Pluggable cross-chain provider. Adding a provider is “add a module”; the rest of the app references only this interface (never a specific provider).
Properties
Section titled “Properties”depositAddressRoutes?
Section titled “depositAddressRoutes?”
readonlyoptionaldepositAddressRoutes?:boolean
Defined in: protocol-swap2-core/src/types.ts:279
Set by remoteProvider when the app opted in (depositAddressRoutes): this stub may send the input to an address
its backend names. Without it the engine refuses a remote stub’s deposit-address and plain-value builds.
readonlyname:string
Defined in: protocol-swap2-core/src/types.ts:222
Provider name, unique in a router.
remote?
Section titled “remote?”
readonlyoptionalremote?:boolean
Defined in: protocol-swap2-core/src/types.ts:267
Set by remoteProvider: the quotes and builds come from a backend, not from code the app
ships. The engine then takes the addresses an EVM transaction may call or approve only from
callTargets / spenders — the app’s pins — and refuses a calldata route or an
approval it has no pin for (scan 2026-10-27 modules, F8/F9/F16).
supportsSameChain?
Section titled “supportsSameChain?”
optionalsupportsSameChain?:boolean
Defined in: protocol-swap2-core/src/types.ts:290
Explicit opt-in: provider can execute a same-chain swap.
verifiesBuilds?
Section titled “verifiesBuilds?”
readonlyoptionalverifiesBuilds?:boolean
Defined in: protocol-swap2-core/src/types.ts:269
Set by remoteProvider when the app gave it verifyBuild: its builds are checked on the client.
verifiesQuotes?
Section titled “verifiesQuotes?”
readonlyoptionalverifiesQuotes?:boolean
Defined in: protocol-swap2-core/src/types.ts:274
Set by remoteProvider when the app gave it verifyQuote: its quotes’ transactions are checked on the client.
A remote stub’s EVM calldata route needs this or verifiesBuilds (scan 2026-10-30, F3).
Methods
Section titled “Methods”buildClaim()?
Section titled “buildClaim()?”
optionalbuildClaim(ref):Promise<UnsignedTx|null>
Defined in: protocol-swap2-core/src/types.ts:253
Two-phase routes: the destination-chain transaction that completes the
delivery (CCTP receiveMessage(message, attestation)), or null while
the attestation is not available yet. The engine executes it through a
destination-chain account (claimSwap2); tx.chain names that chain.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<UnsignedTx | null>
buildDeposit()
Section titled “buildDeposit()”buildDeposit(
quote):Promise<UnsignedTx>
Defined in: protocol-swap2-core/src/types.ts:230
The source-leg transaction for a quote.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<UnsignedTx>
callTargets()?
Section titled “callTargets()?”
optionalcallTargets(chain): readonlystring[]
Defined in: protocol-swap2-core/src/types.ts:281
Remote stubs: the contracts this provider’s EVM swaps may call on chain (the app’s list, e.g. lifiPins).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly string[]
claimTargets()?
Section titled “claimTargets()?”
optionalclaimTargets(chain): readonlystring[]
Defined in: protocol-swap2-core/src/types.ts:260
The contracts a claim from buildClaim may call on chain (CAIP-2) — CCTP’s
MessageTransmitter. claimSwap2 refuses a claim to anything else, and a provider with a claim
step must declare them (round 3, M24). Kept on the client: for a remote provider this is the
app’s list, never the server’s.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly string[]
close()?
Section titled “close()?”
optionalclose():void
Defined in: protocol-swap2-core/src/types.ts:284
Returns
Section titled “Returns”void
describeActivity()?
Section titled “describeActivity()?”
optionaldescribeActivity(tx,ctx):ActivityItem|null
Defined in: protocol-swap2-core/src/types.ts:298
Recognize one of this provider’s own transactions in an address’s history
(contract + selector on EVM, settlement counterparty elsewhere) and
describe it for the activity feed; null when it is not this provider’s.
Pure and synchronous. The single-provider protocol classes and the router
delegate describeActivity here.
Parameters
Section titled “Parameters”ChainTx
DescribeActivityContext
Returns
Section titled “Returns”ActivityItem | null
enabled()
Section titled “enabled()”enabled():
boolean
Defined in: protocol-swap2-core/src/types.ts:224
Master flag — providers ship “dark” (off) until validated with real funds.
Returns
Section titled “Returns”boolean
getQuote()
Section titled “getQuote()”getQuote(
params,signal?):Promise<Quote|null>
Defined in: protocol-swap2-core/src/types.ts:228
A quote, or null with the reason passed to params.onRefusal.
Parameters
Section titled “Parameters”params
Section titled “params”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<Quote | null>
notifyDeposit()?
Section titled “notifyDeposit()?”
optionalnotifyDeposit(intentId,txHash):Promise<void>
Defined in: protocol-swap2-core/src/types.ts:244
Tell the provider the source funds were sent (tx hash / BoC). Required for NEAR Intents TON deposits — the HOT-bridge oracle can’t observe SIMPLE-mode deposits on uninitialized addresses without it. Best-effort elsewhere.
Parameters
Section titled “Parameters”intentId
Section titled “intentId”string
txHash
Section titled “txHash”string
Returns
Section titled “Returns”Promise<void>
preflightDeposit()?
Section titled “preflightDeposit()?”
optionalpreflightDeposit(quote,tx):Promise<void>
Defined in: protocol-swap2-core/src/types.ts:236
Last fail-closed check after any approval and immediately before the wallet signs/broadcasts the source leg. Providers whose execution target can rotate or halt (THORChain vaults/routers) must revalidate it here.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
registerSignedOrder()?
Section titled “registerSignedOrder()?”
optionalregisterSignedOrder(intentId,signature):Promise<void>
Defined in: protocol-swap2-core/src/types.ts:246
Gasless typed-order providers: register the wallet’s EIP-712 signature.
Parameters
Section titled “Parameters”intentId
Section titled “intentId”string
signature
Section titled “signature”string
Returns
Section titled “Returns”Promise<void>
spenders()?
Section titled “spenders()?”
optionalspenders(chain): readonlystring[]
Defined in: protocol-swap2-core/src/types.ts:283
Remote stubs: the spenders this provider’s EVM swaps may be approved for on chain (the app’s list).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”readonly string[]
supportsChain()?
Section titled “supportsChain()?”
optionalsupportsChain(caip2):boolean
Defined in: protocol-swap2-core/src/types.ts:286
Optional discovery hook for custom providers.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”boolean
supportsChainPair()?
Section titled “supportsChainPair()?”
optionalsupportsChainPair(fromChain,toChain):boolean
Defined in: protocol-swap2-core/src/types.ts:288
Optional pair-level discovery for aggregators.
Parameters
Section titled “Parameters”fromChain
Section titled “fromChain”string
toChain
Section titled “toChain”string
Returns
Section titled “Returns”boolean
supportsRoute()
Section titled “supportsRoute()”supportsRoute(
from,to):boolean
Defined in: protocol-swap2-core/src/types.ts:226
Cheap synchronous check: can this provider route from to to? No I/O.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
trackIntent()
Section titled “trackIntent()”trackIntent(
ref):Promise<IntentStatus>
Defined in: protocol-swap2-core/src/types.ts:238
Current status of a swap.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<IntentStatus>