Skip to content
docs

OmnistonProviderOptions

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

optional apiUrl?: string

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

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


optional client?: OmnistonClientLike

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

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


optional closeInjectedClient?: boolean

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

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


optional enabled?: boolean

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

Explicit constructor configuration; no deployment environment is read.


optional integratorAddress?: string

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


optional integratorFeePips?: number

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


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>


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>


optional maxHtlcExecutions?: number

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

Maximum number of HTLC execution attempts covered by generated secrets.


optional maxTonExecutionNano?: string

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

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


optional maxUsd?: string | number

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

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


optional quoteSettleMs?: number

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

Resolver competition window; primarily useful for deterministic tests.


optional quoteStore?: OmnistonQuoteStore

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

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


optional secretStore?: HtlcSecretStore

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

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


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.


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


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.


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.


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>


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>


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>


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>


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>


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>


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>