@anywalletkit/protocol-swap2-omniston 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import * as _anywalletkit_protocol_swap2_core_types from '@anywalletkit/protocol-swap2-core/types';
2
2
  import { SingleProviderSwap2 } from '@anywalletkit/protocol-swap2-core/swap2/single';
3
3
  import { Swap2EngineConfig, Swap2Account } from '@anywalletkit/protocol-swap2-core/swap2/base';
4
- import { b as OmnistonProviderOptions } from './provider-BBG2zhpu.cjs';
4
+ import { b as OmnistonProviderOptions } from './provider-CcCZB-Cj.cjs';
5
5
 
6
6
  interface OmnistonSwap2Config extends Swap2EngineConfig, OmnistonProviderOptions {
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import * as _anywalletkit_protocol_swap2_core_types from '@anywalletkit/protocol-swap2-core/types';
2
2
  import { SingleProviderSwap2 } from '@anywalletkit/protocol-swap2-core/swap2/single';
3
3
  import { Swap2EngineConfig, Swap2Account } from '@anywalletkit/protocol-swap2-core/swap2/base';
4
- import { b as OmnistonProviderOptions } from './provider-BBG2zhpu.js';
4
+ import { b as OmnistonProviderOptions } from './provider-CcCZB-Cj.js';
5
5
 
6
6
  interface OmnistonSwap2Config extends Swap2EngineConfig, OmnistonProviderOptions {
7
7
  }
package/dist/protocol.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  OmnistonSwap2Protocol
3
- } from "./chunk-RW4XZWNC.js";
4
- import "./chunk-HOTFZYSW.js";
3
+ } from "./chunk-4MKR2SUZ.js";
4
+ import "./chunk-2DGCZD5K.js";
5
5
  import "./chunk-QDXFC6BC.js";
6
6
  import "./chunk-AIWAM7BS.js";
7
+ import "./chunk-JWYDIW4V.js";
7
8
  export {
8
9
  OmnistonSwap2Protocol
9
10
  };
@@ -530,10 +530,12 @@ interface OmnistonProviderOptions {
530
530
  * swap body depends on — that a STON.fi hop's ask wallet is its router's
531
531
  * wallet of the quoted output (and, for native input, that the pTON wallet
532
532
  * the message pays belongs to that router), or that a DeDust pool trades the
533
- * quoted pair. `createOmnistonTonValidators` supplies it. When absent the
534
- * decoded-body rules still apply and each skipped leg is traced as
535
- * `ton-swap-payload legs-unverified`; STON.fi v1 native input (pTON v1) is
536
- * refused without it.
533
+ * quoted pair. `createOmnistonTonValidators` supplies it. Required, with
534
+ * `validateTonSwapTarget`, to advertise same-chain TON swaps (scan
535
+ * 2026-10-30 F8: without it a genuine DEX body can pay out a token other
536
+ * than the quoted one). Only `tonSwapPayloadCheck: "report"` lets a host run
537
+ * without it — each unverified leg is then traced as `ton-swap-payload
538
+ * legs-unverified`; STON.fi v1 native input (pTON v1) is refused regardless.
537
539
  */
538
540
  validateTonSwapLeg?: (leg: TonSwapLeg) => Promise<boolean> | boolean;
539
541
  /**
@@ -751,13 +753,17 @@ declare function omnistonPins(trustedEvmOrderProtocols: Readonly<Record<string,
751
753
  * validators (`validateTonSwapTarget`, `validateTonSwapLeg`);
752
754
  * - a TON → EVM escrow body (an Omniston order from TON) goes to `verifyTonEscrowBuild` with what the app knows: the
753
755
  * input, the trader's TON address, the destination chain, address and token, and the quote's minimum delivery.
754
- * EVM typed orders pass through to the engine's own order checks. The reason it fails, or null.
756
+ * - an EVM typed order (EVM → TON, EVM → EVM) is opened with the order extension the build carries: price, receiver,
757
+ * traits, salt and the escrow terms are checked against the app's request and the audited contracts
758
+ * (`trustedEvmOrderProtocols`, `trustedSettlementContracts`; default the audited tables), scan 2026-10-28 F6.
759
+ * The reason it fails, or null.
755
760
  */
756
761
  declare function omnistonVerifyBuild(hooks: {
757
762
  validateTonSwapTarget: (input: {
758
763
  address: string;
759
764
  protocols: readonly string[];
760
765
  }) => Promise<boolean> | boolean;
766
+ /** The DEX pays out the quoted token (`createOmnistonTonValidators().validateTonSwapLeg`). Without it a TON swap body is refused. */
761
767
  validateTonSwapLeg?: (leg: TonSwapLeg) => Promise<boolean> | boolean;
762
768
  /**
763
769
  * The app's check of a TON → EVM escrow body (`createOmnistonTonValidators().verifyTonEscrowBuild`). Without it a
@@ -766,6 +772,10 @@ declare function omnistonVerifyBuild(hooks: {
766
772
  verifyTonEscrowBuild?: (input: TonEscrowBuildExpectation) => string | null | Promise<string | null>;
767
773
  /** The integrator your backend's Omniston provider uses: the only referral a body may name. */
768
774
  integratorAddress?: string | null;
775
+ /** EVM order protocols an EVM typed order may name, per chain. Default `AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS`. */
776
+ trustedEvmOrderProtocols?: Readonly<Record<string, readonly string[]>>;
777
+ /** Escrow factories an EVM order's extension may target, per chain. Default `AUDITED_OMNISTON_SETTLEMENT_CONTRACTS`. */
778
+ trustedSettlementContracts?: Readonly<Record<string, readonly string[]>>;
769
779
  }): (quote: Quote, tx: UnsignedTx, params?: QuoteParams) => Promise<string | null>;
770
780
  declare function omnistonProvider(opts?: OmnistonProviderOptions): CrossChainProvider;
771
781
 
@@ -530,10 +530,12 @@ interface OmnistonProviderOptions {
530
530
  * swap body depends on — that a STON.fi hop's ask wallet is its router's
531
531
  * wallet of the quoted output (and, for native input, that the pTON wallet
532
532
  * the message pays belongs to that router), or that a DeDust pool trades the
533
- * quoted pair. `createOmnistonTonValidators` supplies it. When absent the
534
- * decoded-body rules still apply and each skipped leg is traced as
535
- * `ton-swap-payload legs-unverified`; STON.fi v1 native input (pTON v1) is
536
- * refused without it.
533
+ * quoted pair. `createOmnistonTonValidators` supplies it. Required, with
534
+ * `validateTonSwapTarget`, to advertise same-chain TON swaps (scan
535
+ * 2026-10-30 F8: without it a genuine DEX body can pay out a token other
536
+ * than the quoted one). Only `tonSwapPayloadCheck: "report"` lets a host run
537
+ * without it — each unverified leg is then traced as `ton-swap-payload
538
+ * legs-unverified`; STON.fi v1 native input (pTON v1) is refused regardless.
537
539
  */
538
540
  validateTonSwapLeg?: (leg: TonSwapLeg) => Promise<boolean> | boolean;
539
541
  /**
@@ -751,13 +753,17 @@ declare function omnistonPins(trustedEvmOrderProtocols: Readonly<Record<string,
751
753
  * validators (`validateTonSwapTarget`, `validateTonSwapLeg`);
752
754
  * - a TON → EVM escrow body (an Omniston order from TON) goes to `verifyTonEscrowBuild` with what the app knows: the
753
755
  * input, the trader's TON address, the destination chain, address and token, and the quote's minimum delivery.
754
- * EVM typed orders pass through to the engine's own order checks. The reason it fails, or null.
756
+ * - an EVM typed order (EVM → TON, EVM → EVM) is opened with the order extension the build carries: price, receiver,
757
+ * traits, salt and the escrow terms are checked against the app's request and the audited contracts
758
+ * (`trustedEvmOrderProtocols`, `trustedSettlementContracts`; default the audited tables), scan 2026-10-28 F6.
759
+ * The reason it fails, or null.
755
760
  */
756
761
  declare function omnistonVerifyBuild(hooks: {
757
762
  validateTonSwapTarget: (input: {
758
763
  address: string;
759
764
  protocols: readonly string[];
760
765
  }) => Promise<boolean> | boolean;
766
+ /** The DEX pays out the quoted token (`createOmnistonTonValidators().validateTonSwapLeg`). Without it a TON swap body is refused. */
761
767
  validateTonSwapLeg?: (leg: TonSwapLeg) => Promise<boolean> | boolean;
762
768
  /**
763
769
  * The app's check of a TON → EVM escrow body (`createOmnistonTonValidators().verifyTonEscrowBuild`). Without it a
@@ -766,6 +772,10 @@ declare function omnistonVerifyBuild(hooks: {
766
772
  verifyTonEscrowBuild?: (input: TonEscrowBuildExpectation) => string | null | Promise<string | null>;
767
773
  /** The integrator your backend's Omniston provider uses: the only referral a body may name. */
768
774
  integratorAddress?: string | null;
775
+ /** EVM order protocols an EVM typed order may name, per chain. Default `AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS`. */
776
+ trustedEvmOrderProtocols?: Readonly<Record<string, readonly string[]>>;
777
+ /** Escrow factories an EVM order's extension may target, per chain. Default `AUDITED_OMNISTON_SETTLEMENT_CONTRACTS`. */
778
+ trustedSettlementContracts?: Readonly<Record<string, readonly string[]>>;
769
779
  }): (quote: Quote, tx: UnsignedTx, params?: QuoteParams) => Promise<string | null>;
770
780
  declare function omnistonProvider(opts?: OmnistonProviderOptions): CrossChainProvider;
771
781