Skip to content
docs

CrossChainProvider

Defined in: protocol-swap2-core/dist/types.d.ts:217

Pluggable cross-chain provider. Adding a provider is “add a module”; the rest of the app references only this interface (never a specific provider).

readonly optional depositAddressRoutes?: boolean

Defined in: protocol-swap2-core/dist/types.d.ts:276

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.


readonly name: string

Defined in: protocol-swap2-core/dist/types.d.ts:219

Provider name, unique in a router.


readonly optional remote?: boolean

Defined in: protocol-swap2-core/dist/types.d.ts:264

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).


optional supportsSameChain?: boolean

Defined in: protocol-swap2-core/dist/types.d.ts:287

Explicit opt-in: provider can execute a same-chain swap.


readonly optional verifiesBuilds?: boolean

Defined in: protocol-swap2-core/dist/types.d.ts:266

Set by remoteProvider when the app gave it verifyBuild: its builds are checked on the client.


readonly optional verifiesQuotes?: boolean

Defined in: protocol-swap2-core/dist/types.d.ts:271

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).

optional buildClaim(ref): Promise<UnsignedTx | null>

Defined in: protocol-swap2-core/dist/types.d.ts:250

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.

IntentRef

Promise<UnsignedTx | null>


buildDeposit(quote): Promise<UnsignedTx>

Defined in: protocol-swap2-core/dist/types.d.ts:227

The source-leg transaction for a quote.

Quote

Promise<UnsignedTx>


optional callTargets(chain): readonly string[]

Defined in: protocol-swap2-core/dist/types.d.ts:278

Remote stubs: the contracts this provider’s EVM swaps may call on chain (the app’s list, e.g. lifiPins).

string

readonly string[]


optional claimTargets(chain): readonly string[]

Defined in: protocol-swap2-core/dist/types.d.ts:257

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.

string

readonly string[]


optional close(): void

Defined in: protocol-swap2-core/dist/types.d.ts:281

void


optional describeActivity(tx, ctx): ActivityItem | null

Defined in: protocol-swap2-core/dist/types.d.ts:295

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.

ChainTx

DescribeActivityContext

ActivityItem | null


enabled(): boolean

Defined in: protocol-swap2-core/dist/types.d.ts:221

Master flag — providers ship “dark” (off) until validated with real funds.

boolean


getQuote(params, signal?): Promise<Quote | null>

Defined in: protocol-swap2-core/dist/types.d.ts:225

A quote, or null with the reason passed to params.onRefusal.

QuoteParams

AbortSignal

Promise<Quote | null>


optional notifyDeposit(intentId, txHash): Promise<void>

Defined in: protocol-swap2-core/dist/types.d.ts:241

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.

string

string

Promise<void>


optional preflightDeposit(quote, tx): Promise<void>

Defined in: protocol-swap2-core/dist/types.d.ts:233

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.

Quote

UnsignedTx

Promise<void>


optional registerSignedOrder(intentId, signature): Promise<void>

Defined in: protocol-swap2-core/dist/types.d.ts:243

Gasless typed-order providers: register the wallet’s EIP-712 signature.

string

string

Promise<void>


optional spenders(chain): readonly string[]

Defined in: protocol-swap2-core/dist/types.d.ts:280

Remote stubs: the spenders this provider’s EVM swaps may be approved for on chain (the app’s list).

string

readonly string[]


optional supportsChain(caip2): boolean

Defined in: protocol-swap2-core/dist/types.d.ts:283

Optional discovery hook for custom providers.

string

boolean


optional supportsChainPair(fromChain, toChain): boolean

Defined in: protocol-swap2-core/dist/types.d.ts:285

Optional pair-level discovery for aggregators.

string

string

boolean


supportsRoute(from, to): boolean

Defined in: protocol-swap2-core/dist/types.d.ts:223

Cheap synchronous check: can this provider route from to to? No I/O.

Asset

Asset

boolean


trackIntent(ref): Promise<IntentStatus>

Defined in: protocol-swap2-core/dist/types.d.ts:235

Current status of a swap.

IntentRef

Promise<IntentStatus>