Skip to content
docs

OmnistonSwap2Config

Defined in: protocol-swap2-omniston/src/protocol.ts:7

optional accountChain?: string

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:66

Optional account chain identity when the account does not expose a provider.

Swap2EngineConfig.accountChain


optional allowUnlistedTokens?: boolean

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:107

Accept tokens the swap catalog does not list, named by their contract (EVM) or mint (Solana): tokens the user added at their own risk. Off by default. The source token’s decimals are read with the account’s getTokenInfo (a fromTokenDecimals that disagrees is refused); an account without it must be given fromTokenDecimals. Only providers that trade any token (LI.FI, Uniswap, Balancer, Fynd, Jupiter) quote them, and they have no USD value: the router cannot judge their price, so show the user the amounts.

Swap2EngineConfig.allowUnlistedTokens


optional apiUrl?: string

Defined in: protocol-swap2-omniston/src/provider.ts:335

WebSocket API URL; defaults to the public ston.fi endpoint.

OmnistonProviderOptions.apiUrl


optional client?: OmnistonClientLike

Defined in: protocol-swap2-omniston/src/provider.ts:333

Injected SDK client (tests); defaults to a lazy new Omniston({apiUrl}).

OmnistonProviderOptions.client


optional closeInjectedClient?: boolean

Defined in: protocol-swap2-omniston/src/provider.ts:521

Close an injected client when the provider closes (default: caller owns it).

OmnistonProviderOptions.closeInjectedClient


optional decodeTonBody?: (bocBase64) => unknown

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:74

Decodes a base64 BoC into a TON Cell for deposits that carry a cell body (e.g. Omniston escrow payloads). The package deliberately does not depend on @ton/core; the caller supplies e.g. (b) => Cell.fromBase64(b). Without it, cell-body deposits fail closed — a TON account treats a string body as a TEXT COMMENT, which would strand the swap.

string

unknown

Swap2EngineConfig.decodeTonBody


optional enabled?: boolean

Defined in: protocol-swap2-omniston/src/provider.ts:347

Explicit constructor configuration; no deployment environment is read.

OmnistonProviderOptions.enabled


fromChain: string

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:60

CAIP-2 of the chain the bound account lives on (the swap2 source).

Swap2EngineConfig.fromChain


optional integratorAddress?: string

Defined in: protocol-swap2-omniston/src/provider.ts:350

OmnistonProviderOptions.integratorAddress


optional integratorFeePips?: number

Defined in: protocol-swap2-omniston/src/provider.ts:351

OmnistonProviderOptions.integratorFeePips


optional locateEvmDelivery?: (input) => Promise<string | null>

Defined in: protocol-swap2-omniston/src/provider.ts:501

EVM destination: find the delivery transaction — the destination escrow’s payout to the recipient — so a completed order carries destTxHash. Omniston’s tracking feed names the escrow but not that transaction.

string

string

string

string

string

Promise<string | null>

OmnistonProviderOptions.locateEvmDelivery


optional locateTonDelivery?: (input) => Promise<string | null>

Defined in: protocol-swap2-omniston/src/provider.ts:514

TON destination: find the delivery — the output position’s jetton transfer to the recipient — so a completed EVM → TON order carries destTxHash in the form the TON history source uses (tonapi event id). Without it the wallet’s feed cannot pair the TON receive with the swap.

string

string

string

string

Promise<string | null>

OmnistonProviderOptions.locateTonDelivery


optional maxHtlcExecutions?: number

Defined in: protocol-swap2-omniston/src/provider.ts:341

Maximum number of HTLC execution attempts covered by generated secrets.

OmnistonProviderOptions.maxHtlcExecutions


optional maxNetworkFeeBps?: number | bigint

Defined in: core/dist/index-QWdcwE6y.d.ts:429

Maximum acceptable network fee, basis points of the input amount.

Swap2EngineConfig.maxNetworkFeeBps


optional maxProtocolFeeBps?: number | bigint

Defined in: core/dist/index-QWdcwE6y.d.ts:431

Maximum acceptable protocol fee, basis points of the input amount.

Swap2EngineConfig.maxProtocolFeeBps


optional maxTonExecutionNano?: string

Defined in: protocol-swap2-omniston/src/provider.ts:343

Hard cap for resolver-requested TON gas/forward value (default: 2 TON).

OmnistonProviderOptions.maxTonExecutionNano


optional maxUsd?: string | number

Defined in: protocol-swap2-omniston/src/provider.ts:349

Exact decimal USD cap; string form avoids binary-float rounding.

OmnistonProviderOptions.maxUsd


optional onExecutionPhase?: (phase, detail?) => void

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:62

Progress observer, see Swap2ExecutionPhase.

Swap2ExecutionPhase

Swap2ExecutionPhaseDetail

void

Swap2EngineConfig.onExecutionPhase


optional quoteSettleMs?: number

Defined in: protocol-swap2-omniston/src/provider.ts:345

Resolver competition window; primarily useful for deterministic tests.

OmnistonProviderOptions.quoteSettleMs


optional quoteStore?: OmnistonQuoteStore

Defined in: protocol-swap2-omniston/src/provider.ts:339

Quote/build context persistence; defaults to in-memory (NOT serverless-safe).

OmnistonProviderOptions.quoteStore


optional reviewExecution?: (plan) => void | Promise<void>

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:98

Review gate: called once the live quote is built and every payload/value check has passed, BEFORE any approval or signature. It receives a copy of exactly what will be signed; throwing (the user cancelled) aborts with nothing sent. A quote that expires while the gate is open is refused before the first approval. When the quote expires while the engine’s own approval is being mined, the engine re-quotes once; if the fresh quote differs from the reviewed one (payload, gas, a worse output) the gate is called again with requoted: true, and throwing then revokes the allowance.

Swap2ExecutionPlan

void | Promise<void>

Swap2EngineConfig.reviewExecution


optional secretStore?: HtlcSecretStore

Defined in: protocol-swap2-omniston/src/provider.ts:337

HTLC preimage persistence; defaults to in-memory (NOT serverless-safe).

OmnistonProviderOptions.secretStore


optional serializedNativeAllowance?: string | number | bigint

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:81

Provider-SERIALIZED legs (a swap aggregator’s fully built Solana transaction): how much native coin, in base units, the account may lose on top of the swap input — rent for a destination token account, wrapped SOL juggling, priority fees. Default 20 000 000 lamports (0.02 SOL).

Swap2EngineConfig.serializedNativeAllowance


optional skipAccountChainCheck?: boolean

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:64

Explicit escape hatch for adapters that can prove chain binding elsewhere.

Swap2EngineConfig.skipAccountChainCheck


optional tonGasCeiling?: string | number | bigint

Defined in: protocol-swap2-core/dist/swap2/base.d.ts:87

The most nanoTON a TON cell-body deposit may attach as gas: on top of the input for a native source, the whole attached value for a jetton source (default 1 TON; live Omniston swaps attach 0.1–0.4). A build attaching more is refused (scan 2026-10-27 modules, F7).

Swap2EngineConfig.tonGasCeiling


optional tonSwapPayloadCheck?: "report" | "enforce"

Defined in: protocol-swap2-omniston/src/provider.ts:407

TON↔TON swap settlement (scan F11): what a built swap body that fails the decoder (receiver ≠ destination, refund/excess ≠ trader, on-chain minimum below the quote, unknown layout, unverifiable leg) does. “enforce” (default) refuses the build; “report” traces ton-swap-payload <reason> and still builds — a rollout escape hatch, not a steady state.

OmnistonProviderOptions.tonSwapPayloadCheck


optional trace?: (event, details?) => void

Defined in: protocol-swap2-omniston/src/provider.ts:528

Diagnostics: why a poll did not disclose (disclosure-skipped with the gate and its fields, validator-refused, validator-threw) and when it did (secret-disclosed). Never carries secrets. Wire it to your logger: a silent “pending” cost a live order its 2-minute window (2026-10-20).

string

Record<string, unknown>

void

OmnistonProviderOptions.trace


optional trustedEvmOrderProtocols?: Readonly<Record<string, readonly string[]>>

Defined in: protocol-swap2-omniston/src/provider.ts:362

Independently trusted EVM order protocols — the Omniston fork of the 1inch Limit Order Protocol an EVM-source order is signed against and that moves the input token on fill — keyed by CAIP-2 chain. Kept apart from trustedSettlementContracts because one address plays different roles on different chains (0xafCF… is the escrow factory on Ethereum and the order protocol on Polygon). EVM→TON is advertised only for chains listed here.

OmnistonProviderOptions.trustedEvmOrderProtocols


optional trustedSettlementContracts?: Readonly<Record<string, readonly string[]>>

Defined in: protocol-swap2-omniston/src/provider.ts:353

Independently trusted settlement contracts, keyed by CAIP-2 chain.

OmnistonProviderOptions.trustedSettlementContracts


optional validateEvmInputPosition?: (input) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:459

RPC-backed proof of the finalized EVM source position (EVM→TON). The tracking feed only hints at the address; no secret is disclosed until this hook proves — from the trusted factory’s own SrcEscrowCreated event, the deterministic escrow address and the escrow’s balances — that the trader’s FULL input is locked for this hashlock under the quoted terms (owner, token, amount, resolver, deposit, timelocks, TON output amount).

string

number

EVM destination only: the escrow event’s destination complement must name this chain, token and deposit.

string

string

string

string

string

string

string

string

number

string

string

Uint8Array

string

boolean | Promise<boolean>

OmnistonProviderOptions.validateEvmInputPosition


optional validateEvmOutputPosition?: (input) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:431

RPC-backed proof of the destination EVM escrow. The tracking feed is only a discovery hint: no HTLC preimage is disclosed until this hook proves the independently finalized on-chain position matches the signed quote.

string

string

number

string

string

string

string

string

string

string

string

The quote’s settlementData.protocolFeeRecipientAddress (destination chain).

string

number

string

string

Uint8Array

string

boolean | Promise<boolean>

OmnistonProviderOptions.validateEvmOutputPosition


optional validateTonEscrowPayload?: (input) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:408

string

string

number

The quote’s exclusivityTimeout (seconds) the escrow config must carry.

string

string

string

string

string

string

string

string

string

string

readonly Uint8Array<ArrayBufferLike>[]

string

boolean | Promise<boolean>

OmnistonProviderOptions.validateTonEscrowPayload


optional validateTonJettonWallet?: (input) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:368

RPC-backed TON jetton-wallet verification. A TON-source order is rejected when this hook is absent or does not prove that walletAddress belongs to the quoted jetton master for ownerAddress.

string

string

string

boolean | Promise<boolean>

OmnistonProviderOptions.validateTonJettonWallet


optional validateTonOutputPosition?: (input) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:483

Indexer/RPC-backed proof of the TON output position (EVM→TON): deployed by the trusted factory for THIS quote, pinned position/escrow code, hashlock, recipient, amount, security deposit, and a cancellation boundary still far enough away to complete. The tracking feed is only a discovery hint.

string

string

string

string

string

string

string

number

string

string

Uint8Array

boolean | Promise<boolean>

OmnistonProviderOptions.validateTonOutputPosition


optional validateTonSwapLeg?: (leg) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:399

TON↔TON swap settlement (scan F11): confirm one chain fact the decoded swap body depends on — that a STON.fi hop’s ask wallet is its router’s wallet of the quoted output (and, for native input, that the pTON wallet the message pays belongs to that router), or that a DeDust pool trades the quoted pair. createOmnistonTonValidators supplies it. Required, with validateTonSwapTarget, to advertise same-chain TON swaps (scan 2026-10-30 F8: without it a genuine DEX body can pay out a token other than the quoted one). Only tonSwapPayloadCheck: "report" lets a host run without it — each unverified leg is then traced as ton-swap-payload legs-unverified; STON.fi v1 native input (pTON v1) is refused regardless.

TonSwapLeg

boolean | Promise<boolean>

OmnistonProviderOptions.validateTonSwapLeg


optional validateTonSwapTarget?: (input) => boolean | Promise<boolean>

Defined in: protocol-swap2-omniston/src/provider.ts:386

TON↔TON swap settlement: independently confirm that the contract a swap message pays into — directly for native GRAM, as the jetton-transfer destination for jettons — is a DEX contract of a protocol the quote named (e.g. by its code interface on an indexer). Without it, same-chain TON swaps are not advertised.

string

readonly string[]

boolean | Promise<boolean>

OmnistonProviderOptions.validateTonSwapTarget