@anywalletkit/protocol-swap2-omniston 0.5.4 → 0.5.5

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.
Files changed (41) hide show
  1. package/README.md +72 -4
  2. package/dist/activity.cjs +4 -1
  3. package/dist/activity.cjs.map +1 -1
  4. package/dist/activity.d.cts +7 -1
  5. package/dist/activity.d.ts +7 -1
  6. package/dist/activity.js +1 -1
  7. package/dist/{chunk-AIWAM7BS.js → chunk-ENAEOF7N.js} +5 -2
  8. package/dist/chunk-ENAEOF7N.js.map +1 -0
  9. package/dist/{chunk-4JOTKQOT.js → chunk-FDSTD34Z.js} +10 -3
  10. package/dist/{chunk-4JOTKQOT.js.map → chunk-FDSTD34Z.js.map} +1 -1
  11. package/dist/chunk-IDRZHWWL.js +74 -0
  12. package/dist/chunk-IDRZHWWL.js.map +1 -0
  13. package/dist/{chunk-2E6CVWD6.js → chunk-IX4NF2J7.js} +2 -2
  14. package/dist/index.cjs +49 -2
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/index.js +4 -4
  19. package/dist/protocol.cjs +11 -1
  20. package/dist/protocol.cjs.map +1 -1
  21. package/dist/protocol.d.cts +1 -1
  22. package/dist/protocol.d.ts +1 -1
  23. package/dist/protocol.js +4 -4
  24. package/dist/{provider-CcCZB-Cj.d.cts → provider-BQzNkVvW.d.cts} +18 -2
  25. package/dist/{provider-CcCZB-Cj.d.ts → provider-BQzNkVvW.d.ts} +18 -2
  26. package/dist/provider.cjs +49 -2
  27. package/dist/provider.cjs.map +1 -1
  28. package/dist/provider.d.cts +1 -1
  29. package/dist/provider.d.ts +1 -1
  30. package/dist/provider.js +3 -3
  31. package/dist/validators.cjs +56 -3
  32. package/dist/validators.cjs.map +1 -1
  33. package/dist/validators.d.cts +1 -1
  34. package/dist/validators.d.ts +1 -1
  35. package/dist/validators.js +19 -3
  36. package/dist/validators.js.map +1 -1
  37. package/package.json +4 -4
  38. package/dist/chunk-AIWAM7BS.js.map +0 -1
  39. package/dist/chunk-JWYDIW4V.js +0 -37
  40. package/dist/chunk-JWYDIW4V.js.map +0 -1
  41. /package/dist/{chunk-2E6CVWD6.js.map → chunk-IX4NF2J7.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- export { A as AssetId, C as ChainAddress, E as EscrowMessage, H as HtlcSecretStore, O as ObservableLike, a as OmnistonClientLike, b as OmnistonProviderOptions, c as OmnistonQuote, d as OmnistonQuoteStore, e as OrderEvent, f as OrderExecution, g as OrderSettlement, h as OrderSnapshot, Q as QuoteRequest, R as RfqEvent, S as SwapSettlement, i as SwapTrackEvent, T as TON_SWAP_PROTOCOL_LAYOUTS, j as TonSwapCheckInput, k as TonSwapCheckResult, l as TonSwapLeg, m as TonSwapPayloadError, n as checkTonSwapPayload, o as encodeTypedMessage, p as inMemoryQuoteStore, q as inMemorySecretStore, r as omnistonPins, s as omnistonProvider, t as omnistonVerifyBuild, v as validateEvmToTonOrderExtension, u as validateEvmTypedOrder } from './provider-CcCZB-Cj.cjs';
1
+ export { A as AssetId, C as ChainAddress, E as EscrowMessage, H as HtlcSecretStore, O as ObservableLike, a as OmnistonClientLike, b as OmnistonProviderOptions, c as OmnistonQuote, d as OmnistonQuoteStore, e as OrderEvent, f as OrderExecution, g as OrderSettlement, h as OrderSnapshot, Q as QuoteRequest, R as RfqEvent, S as SwapSettlement, i as SwapTrackEvent, T as TON_SWAP_PROTOCOL_LAYOUTS, j as TonSwapCheckInput, k as TonSwapCheckResult, l as TonSwapLeg, m as TonSwapPayloadError, n as checkTonSwapPayload, o as encodeTypedMessage, p as inMemoryQuoteStore, q as inMemorySecretStore, r as omnistonPins, s as omnistonProvider, t as omnistonVerifyBuild, v as validateEvmToTonOrderExtension, u as validateEvmTypedOrder } from './provider-BQzNkVvW.cjs';
2
2
  import '@anywalletkit/protocol-swap2-core/types';
@@ -1,2 +1,2 @@
1
- export { A as AssetId, C as ChainAddress, E as EscrowMessage, H as HtlcSecretStore, O as ObservableLike, a as OmnistonClientLike, b as OmnistonProviderOptions, c as OmnistonQuote, d as OmnistonQuoteStore, e as OrderEvent, f as OrderExecution, g as OrderSettlement, h as OrderSnapshot, Q as QuoteRequest, R as RfqEvent, S as SwapSettlement, i as SwapTrackEvent, T as TON_SWAP_PROTOCOL_LAYOUTS, j as TonSwapCheckInput, k as TonSwapCheckResult, l as TonSwapLeg, m as TonSwapPayloadError, n as checkTonSwapPayload, o as encodeTypedMessage, p as inMemoryQuoteStore, q as inMemorySecretStore, r as omnistonPins, s as omnistonProvider, t as omnistonVerifyBuild, v as validateEvmToTonOrderExtension, u as validateEvmTypedOrder } from './provider-CcCZB-Cj.js';
1
+ export { A as AssetId, C as ChainAddress, E as EscrowMessage, H as HtlcSecretStore, O as ObservableLike, a as OmnistonClientLike, b as OmnistonProviderOptions, c as OmnistonQuote, d as OmnistonQuoteStore, e as OrderEvent, f as OrderExecution, g as OrderSettlement, h as OrderSnapshot, Q as QuoteRequest, R as RfqEvent, S as SwapSettlement, i as SwapTrackEvent, T as TON_SWAP_PROTOCOL_LAYOUTS, j as TonSwapCheckInput, k as TonSwapCheckResult, l as TonSwapLeg, m as TonSwapPayloadError, n as checkTonSwapPayload, o as encodeTypedMessage, p as inMemoryQuoteStore, q as inMemorySecretStore, r as omnistonPins, s as omnistonProvider, t as omnistonVerifyBuild, v as validateEvmToTonOrderExtension, u as validateEvmTypedOrder } from './provider-BQzNkVvW.js';
2
2
  import '@anywalletkit/protocol-swap2-core/types';
package/dist/provider.js CHANGED
@@ -10,10 +10,10 @@ import {
10
10
  omnistonVerifyBuild,
11
11
  validateEvmToTonOrderExtension,
12
12
  validateEvmTypedOrder
13
- } from "./chunk-4JOTKQOT.js";
13
+ } from "./chunk-FDSTD34Z.js";
14
14
  import "./chunk-QDXFC6BC.js";
15
- import "./chunk-AIWAM7BS.js";
16
- import "./chunk-JWYDIW4V.js";
15
+ import "./chunk-ENAEOF7N.js";
16
+ import "./chunk-IDRZHWWL.js";
17
17
  export {
18
18
  TON_SWAP_PROTOCOL_LAYOUTS,
19
19
  TonSwapPayloadError,
@@ -594,7 +594,44 @@ var import_core3 = require("@anywalletkit/core");
594
594
 
595
595
  // src/validators/settlement.ts
596
596
  var AUDITED_OMNISTON_SETTLEMENT_CONTRACTS = {
597
- "ton:-239": ["EQAbWJ3Y1HgIIvcMq1prG1anlDC0T3cZlAU7luPT6LmTpmrZ"],
597
+ // The TON Escrow Minter a new TON <-> EVM order may name. The provider
598
+ // compares TON addresses as these exact strings, so it is kept in the form
599
+ // Omniston's quotes use.
600
+ // - EQDybO88… (code 9737943f…, "rev2"): Omniston's TON <-> EVM quotes name it
601
+ // since 2026-11-10 ~19:00Z. Reviewed 2026-11-12, read-only:
602
+ // - Deploy tx fkabfHcN8DcrqQyazmlB+UprljBDeEkvFlgaVOi905g=
603
+ // (2026-11-10 18:47:06Z). Code and data still equal that StateInit:
604
+ // no upgrade since, none pending (no pendingCode, upgradeAfter 0).
605
+ // - Same admin (0:408fff62…) as rev1; it is also the admin_address of the
606
+ // STON.fi DEX v2 routers api.ston.fi lists. Deployed from the same
607
+ // wallet as rev1 (a weak signal on TON: anyone can send a StateInit).
608
+ // - The bytecode diff to rev1: escrow / execution code must be in an
609
+ // embedded whitelist (9e77…, f6ed…, d304…, pinned in ton.ts, plus 9fe4…
610
+ // for TON <-> TON, which the SDK does not pin), the escrow sub-VM must
611
+ // return one value, and a failed position deploy now credits the amount
612
+ // back to the same account contract instead of aborting (the only new
613
+ // path that moves value; no real message has used it). Fees, timelocks,
614
+ // payouts, admin and the 7-day upgrade delay are unchanged. Replayed
615
+ // through both codes, the real traffic of both minters (~42k
616
+ // transactions) and of ~1,070 of their positions gave the same outputs.
617
+ // - It deploys positions with code eb503578…, the only code in
618
+ // DEFAULT_OMNISTON_TON_CODE_HASHES.position. The address and that pin
619
+ // go together: without the pin every EVM -> TON order on this minter
620
+ // fills and then fails the disclosure check.
621
+ // - EQAbWJ3Y… (code f91c43d3…, "rev1", deployed 2026-06-09) is no longer
622
+ // trusted by default (2026-11-12). Omniston's quotes moved to rev2 on
623
+ // 2026-11-10 (rev1 still took a few orders on 2026-11-12), and rev1 lacks the escrow-code whitelist rev2 added: on
624
+ // rev1 only the SDK's own pins check the escrow and execution code an
625
+ // order carries. A quote that names rev1 is refused with its address
626
+ // in the reason, and so is building one cached under an older table; its positions (code e4d5115a…) fail
627
+ // position-code-hash. It stays in OMNISTON_ESCROWS (activity.ts), which
628
+ // recognizes history and grants no trust. Old orders need nothing from
629
+ // this table: trackIntent reads no trust table, and every disclosure
630
+ // check refuses a quote older than 6 h, so a rev1 order quoted before
631
+ // the switch cannot be closed by any version. Listing rev1 here or in
632
+ // trustedProtocolAddresses trusts it again for NEW orders; it does not
633
+ // help close an old one.
634
+ "ton:-239": ["EQDybO88l2lrrAmALRUqpmgEE_tuxk510F4Yd4xjbQZxC9IA"],
598
635
  "eip155:1": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
599
636
  "eip155:56": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
600
637
  "eip155:137": ["0x41A392062A4307a6961d48e30FF20bF6823715B8"],
@@ -636,8 +673,24 @@ var DEFAULT_OMNISTON_TON_CODE_HASHES = {
636
673
  authorityKeys: ["ed210da12aa96ea42de4f2f61dc172bbaa3da86051a1b2a6f342f69a777d2770"],
637
674
  /** EVM→TON output position: the contract the factory deploys for the
638
675
  * resolver's jetton lock (observed on every resolver-created position,
639
- * 2026-10-15/16), and the escrow code cell it carries in its state. */
640
- position: ["e4d5115a321ade7b827e38fb522c20d2f2cd46e4c6b0b5f7dd8b6b096792d77b"],
676
+ * 2026-10-15/16), and the escrow code cell it carries in its state.
677
+ * A position counts only when a trusted factory itself sent its deploy
678
+ * message, and a minter deploys only the position code stored in its own
679
+ * data, so this list follows the trusted minters in
680
+ * AUDITED_OMNISTON_SETTLEMENT_CONTRACTS["ton:-239"]:
681
+ * - eb503578…: positions of the rev2 Escrow Minter EQDybO88… (the position
682
+ * code stored in its data; reviewed 2026-11-12). The diff to rev1's
683
+ * e4d5115a… is 13 sub-VM calls in another mode (RUNVMX 20 -> 276) and 2
684
+ * escrow-code whitelist checks. The state layout is the same, and live
685
+ * and settled rev2 positions pass every check of
686
+ * validateTonOutputPosition.
687
+ * - e4d5115a… (positions of the rev1 minter EQAbWJ3Y…) left the default
688
+ * with rev1 on 2026-11-12. Only an EVM -> TON order quoted on rev1 less
689
+ * than 6 h before an app upgrades can still need it (positionCodeHashes
690
+ * with both codes, until those 6 h are over). That pin alone trusts no
691
+ * new order: a new quote must name a trusted minter, and a position
692
+ * counts only when the minter its quote named deployed it. */
693
+ position: ["eb503578b4d9cd791c9c0ecd0da6da4064aae2bcb19d3c924d4001c493386bc5"],
641
694
  outputEscrow: ["d30423575384773abaad8d3c6f763898afa3d57a5693005904b7c61e95cee630"]
642
695
  };
643
696
  var POSITION_DEPLOY_OP = "0xf240cd30";