@anywalletkit/protocol-swap2-omniston 0.5.4 → 0.5.6
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.
- package/README.md +72 -4
- package/dist/activity.cjs +4 -1
- package/dist/activity.cjs.map +1 -1
- package/dist/activity.d.cts +7 -1
- package/dist/activity.d.ts +7 -1
- package/dist/activity.js +1 -1
- package/dist/{chunk-AIWAM7BS.js → chunk-ENAEOF7N.js} +5 -2
- package/dist/chunk-ENAEOF7N.js.map +1 -0
- package/dist/{chunk-4JOTKQOT.js → chunk-FDSTD34Z.js} +10 -3
- package/dist/{chunk-4JOTKQOT.js.map → chunk-FDSTD34Z.js.map} +1 -1
- package/dist/chunk-IDRZHWWL.js +74 -0
- package/dist/chunk-IDRZHWWL.js.map +1 -0
- package/dist/{chunk-2E6CVWD6.js → chunk-IX4NF2J7.js} +2 -2
- package/dist/index.cjs +49 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/protocol.cjs +11 -1
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +1 -1
- package/dist/protocol.d.ts +1 -1
- package/dist/protocol.js +4 -4
- package/dist/{provider-CcCZB-Cj.d.cts → provider-BQzNkVvW.d.cts} +18 -2
- package/dist/{provider-CcCZB-Cj.d.ts → provider-BQzNkVvW.d.ts} +18 -2
- package/dist/provider.cjs +49 -2
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.d.cts +1 -1
- package/dist/provider.d.ts +1 -1
- package/dist/provider.js +3 -3
- package/dist/validators.cjs +56 -3
- package/dist/validators.cjs.map +1 -1
- package/dist/validators.d.cts +1 -1
- package/dist/validators.d.ts +1 -1
- package/dist/validators.js +19 -3
- package/dist/validators.js.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-AIWAM7BS.js.map +0 -1
- package/dist/chunk-JWYDIW4V.js +0 -37
- package/dist/chunk-JWYDIW4V.js.map +0 -1
- /package/dist/{chunk-2E6CVWD6.js.map → chunk-IX4NF2J7.js.map} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/validators/settlement.ts
|
|
2
|
+
var AUDITED_OMNISTON_SETTLEMENT_CONTRACTS = {
|
|
3
|
+
// The TON Escrow Minter a new TON <-> EVM order may name. The provider
|
|
4
|
+
// compares TON addresses as these exact strings, so it is kept in the form
|
|
5
|
+
// Omniston's quotes use.
|
|
6
|
+
// - EQDybO88… (code 9737943f…, "rev2"): Omniston's TON <-> EVM quotes name it
|
|
7
|
+
// since 2026-11-10 ~19:00Z. Reviewed 2026-11-12, read-only:
|
|
8
|
+
// - Deploy tx fkabfHcN8DcrqQyazmlB+UprljBDeEkvFlgaVOi905g=
|
|
9
|
+
// (2026-11-10 18:47:06Z). Code and data still equal that StateInit:
|
|
10
|
+
// no upgrade since, none pending (no pendingCode, upgradeAfter 0).
|
|
11
|
+
// - Same admin (0:408fff62…) as rev1; it is also the admin_address of the
|
|
12
|
+
// STON.fi DEX v2 routers api.ston.fi lists. Deployed from the same
|
|
13
|
+
// wallet as rev1 (a weak signal on TON: anyone can send a StateInit).
|
|
14
|
+
// - The bytecode diff to rev1: escrow / execution code must be in an
|
|
15
|
+
// embedded whitelist (9e77…, f6ed…, d304…, pinned in ton.ts, plus 9fe4…
|
|
16
|
+
// for TON <-> TON, which the SDK does not pin), the escrow sub-VM must
|
|
17
|
+
// return one value, and a failed position deploy now credits the amount
|
|
18
|
+
// back to the same account contract instead of aborting (the only new
|
|
19
|
+
// path that moves value; no real message has used it). Fees, timelocks,
|
|
20
|
+
// payouts, admin and the 7-day upgrade delay are unchanged. Replayed
|
|
21
|
+
// through both codes, the real traffic of both minters (~42k
|
|
22
|
+
// transactions) and of ~1,070 of their positions gave the same outputs.
|
|
23
|
+
// - It deploys positions with code eb503578…, the only code in
|
|
24
|
+
// DEFAULT_OMNISTON_TON_CODE_HASHES.position. The address and that pin
|
|
25
|
+
// go together: without the pin every EVM -> TON order on this minter
|
|
26
|
+
// fills and then fails the disclosure check.
|
|
27
|
+
// - EQAbWJ3Y… (code f91c43d3…, "rev1", deployed 2026-06-09) is no longer
|
|
28
|
+
// trusted by default (2026-11-12). Omniston's quotes moved to rev2 on
|
|
29
|
+
// 2026-11-10 (rev1 still took a few orders on 2026-11-12), and rev1 lacks the escrow-code whitelist rev2 added: on
|
|
30
|
+
// rev1 only the SDK's own pins check the escrow and execution code an
|
|
31
|
+
// order carries. A quote that names rev1 is refused with its address
|
|
32
|
+
// in the reason, and so is building one cached under an older table; its positions (code e4d5115a…) fail
|
|
33
|
+
// position-code-hash. It stays in OMNISTON_ESCROWS (activity.ts), which
|
|
34
|
+
// recognizes history and grants no trust. Old orders need nothing from
|
|
35
|
+
// this table: trackIntent reads no trust table, and every disclosure
|
|
36
|
+
// check refuses a quote older than 6 h, so a rev1 order quoted before
|
|
37
|
+
// the switch cannot be closed by any version. Listing rev1 here or in
|
|
38
|
+
// trustedProtocolAddresses trusts it again for NEW orders; it does not
|
|
39
|
+
// help close an old one.
|
|
40
|
+
"ton:-239": ["EQDybO88l2lrrAmALRUqpmgEE_tuxk510F4Yd4xjbQZxC9IA"],
|
|
41
|
+
"eip155:1": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
42
|
+
"eip155:56": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
43
|
+
"eip155:137": ["0x41A392062A4307a6961d48e30FF20bF6823715B8"],
|
|
44
|
+
"eip155:4663": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
45
|
+
"eip155:8453": ["0xACa3E2F9b61a44892926bC6c3e104192E7D1c3cd"],
|
|
46
|
+
"eip155:42161": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
47
|
+
"eip155:43114": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
48
|
+
// 2026-10-20: one factory address on X Layer, HyperEVM and Plasma. Runtime
|
|
49
|
+
// bytecode equals Ethereum's 0xafCF… byte for byte except the immutable slots
|
|
50
|
+
// (escrow implementations, its order protocol, domain hash); it references
|
|
51
|
+
// the order protocol trusted below on the same chain.
|
|
52
|
+
"eip155:196": ["0xd602079AFa5c38F550510a2a988CbFa698Fa0189"],
|
|
53
|
+
"eip155:999": ["0xd602079AFa5c38F550510a2a988CbFa698Fa0189"],
|
|
54
|
+
"eip155:9745": ["0xd602079AFa5c38F550510a2a988CbFa698Fa0189"]
|
|
55
|
+
};
|
|
56
|
+
var AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS = {
|
|
57
|
+
"eip155:1": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
58
|
+
"eip155:56": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
59
|
+
"eip155:137": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
60
|
+
"eip155:8453": ["0xe7405fAcDEDB2512e91F2886BDff13231343aF5E"],
|
|
61
|
+
"eip155:42161": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
62
|
+
"eip155:43114": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
63
|
+
// 2026-10-20: bytecode equals Ethereum's 0xb581… except immutables (wrapped
|
|
64
|
+
// native, own address, chain id 196 / 9745 / 999 at the chain-id slot).
|
|
65
|
+
"eip155:196": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
66
|
+
"eip155:9745": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
67
|
+
"eip155:999": ["0xD84778bbeEC5D2a8d17c6424249C438EC0b1ABE3"]
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export {
|
|
71
|
+
AUDITED_OMNISTON_SETTLEMENT_CONTRACTS,
|
|
72
|
+
AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=chunk-IDRZHWWL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/validators/settlement.ts"],"sourcesContent":["/**\n * Settlement contracts this deployment trusts for Omniston, per CAIP-2 chain.\n * Audited public addresses — no secret — so both the server wiring and the\n * browser-side provider import them from here.\n * See how-to-project/OMNISTON-NETWORK-ONBOARDING.md before adding a network.\n */\nexport const AUDITED_OMNISTON_SETTLEMENT_CONTRACTS: Record<string, string[]> = {\n // The TON Escrow Minter a new TON <-> EVM order may name. The provider\n // compares TON addresses as these exact strings, so it is kept in the form\n // Omniston's quotes use.\n // - EQDybO88… (code 9737943f…, \"rev2\"): Omniston's TON <-> EVM quotes name it\n // since 2026-11-10 ~19:00Z. Reviewed 2026-11-12, read-only:\n // - Deploy tx fkabfHcN8DcrqQyazmlB+UprljBDeEkvFlgaVOi905g=\n // (2026-11-10 18:47:06Z). Code and data still equal that StateInit:\n // no upgrade since, none pending (no pendingCode, upgradeAfter 0).\n // - Same admin (0:408fff62…) as rev1; it is also the admin_address of the\n // STON.fi DEX v2 routers api.ston.fi lists. Deployed from the same\n // wallet as rev1 (a weak signal on TON: anyone can send a StateInit).\n // - The bytecode diff to rev1: escrow / execution code must be in an\n // embedded whitelist (9e77…, f6ed…, d304…, pinned in ton.ts, plus 9fe4…\n // for TON <-> TON, which the SDK does not pin), the escrow sub-VM must\n // return one value, and a failed position deploy now credits the amount\n // back to the same account contract instead of aborting (the only new\n // path that moves value; no real message has used it). Fees, timelocks,\n // payouts, admin and the 7-day upgrade delay are unchanged. Replayed\n // through both codes, the real traffic of both minters (~42k\n // transactions) and of ~1,070 of their positions gave the same outputs.\n // - It deploys positions with code eb503578…, the only code in\n // DEFAULT_OMNISTON_TON_CODE_HASHES.position. The address and that pin\n // go together: without the pin every EVM -> TON order on this minter\n // fills and then fails the disclosure check.\n // - EQAbWJ3Y… (code f91c43d3…, \"rev1\", deployed 2026-06-09) is no longer\n // trusted by default (2026-11-12). Omniston's quotes moved to rev2 on\n // 2026-11-10 (rev1 still took a few orders on 2026-11-12), and rev1 lacks the escrow-code whitelist rev2 added: on\n // rev1 only the SDK's own pins check the escrow and execution code an\n // order carries. A quote that names rev1 is refused with its address\n // in the reason, and so is building one cached under an older table; its positions (code e4d5115a…) fail\n // position-code-hash. It stays in OMNISTON_ESCROWS (activity.ts), which\n // recognizes history and grants no trust. Old orders need nothing from\n // this table: trackIntent reads no trust table, and every disclosure\n // check refuses a quote older than 6 h, so a rev1 order quoted before\n // the switch cannot be closed by any version. Listing rev1 here or in\n // trustedProtocolAddresses trusts it again for NEW orders; it does not\n // help close an old one.\n \"ton:-239\": [\"EQDybO88l2lrrAmALRUqpmgEE_tuxk510F4Yd4xjbQZxC9IA\"],\n \"eip155:1\": [\"0xafCF681272AF10959736f45616eeCBC22D7095E2\"],\n \"eip155:56\": [\"0xafCF681272AF10959736f45616eeCBC22D7095E2\"],\n \"eip155:137\": [\"0x41A392062A4307a6961d48e30FF20bF6823715B8\"],\n \"eip155:4663\": [\"0xafCF681272AF10959736f45616eeCBC22D7095E2\"],\n \"eip155:8453\": [\"0xACa3E2F9b61a44892926bC6c3e104192E7D1c3cd\"],\n \"eip155:42161\": [\"0xafCF681272AF10959736f45616eeCBC22D7095E2\"],\n \"eip155:43114\": [\"0xafCF681272AF10959736f45616eeCBC22D7095E2\"],\n // 2026-10-20: one factory address on X Layer, HyperEVM and Plasma. Runtime\n // bytecode equals Ethereum's 0xafCF… byte for byte except the immutable slots\n // (escrow implementations, its order protocol, domain hash); it references\n // the order protocol trusted below on the same chain.\n \"eip155:196\": [\"0xd602079AFa5c38F550510a2a988CbFa698Fa0189\"],\n \"eip155:999\": [\"0xd602079AFa5c38F550510a2a988CbFa698Fa0189\"],\n \"eip155:9745\": [\"0xd602079AFa5c38F550510a2a988CbFa698Fa0189\"],\n};\n\n/**\n * EVM order protocols (Omniston's fork of the 1inch Limit Order Protocol v4 —\n * NOT the canonical 1inch deployment) an EVM→TON order is signed against. The\n * wallet approves this contract for the input amount and signs an EIP-712\n * order whose domain names it; on fill it moves the input into the escrow the\n * factory above deploys. One address, different roles per chain (0xafCF… is\n * the factory elsewhere and the order protocol on Polygon), so this table is\n * separate from the factory table and CAIP-scoped. Runtime code hashes are in\n * how-to-project/OMNISTON-NETWORK-ONBOARDING.md (snapshot 2026-10-16).\n */\nexport const AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS: Record<string, string[]> = {\n \"eip155:1\": [\"0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9\"],\n \"eip155:56\": [\"0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9\"],\n \"eip155:137\": [\"0xafCF681272AF10959736f45616eeCBC22D7095E2\"],\n \"eip155:8453\": [\"0xe7405fAcDEDB2512e91F2886BDff13231343aF5E\"],\n \"eip155:42161\": [\"0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9\"],\n \"eip155:43114\": [\"0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9\"],\n // 2026-10-20: bytecode equals Ethereum's 0xb581… except immutables (wrapped\n // native, own address, chain id 196 / 9745 / 999 at the chain-id slot).\n \"eip155:196\": [\"0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9\"],\n \"eip155:9745\": [\"0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9\"],\n \"eip155:999\": [\"0xD84778bbeEC5D2a8d17c6424249C438EC0b1ABE3\"],\n};\n"],"mappings":";AAMO,IAAM,wCAAkE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAsC7E,YAAY,CAAC,kDAAkD;AAAA,EAC/D,YAAY,CAAC,4CAA4C;AAAA,EACzD,aAAa,CAAC,4CAA4C;AAAA,EAC1D,cAAc,CAAC,4CAA4C;AAAA,EAC3D,eAAe,CAAC,4CAA4C;AAAA,EAC5D,eAAe,CAAC,4CAA4C;AAAA,EAC5D,gBAAgB,CAAC,4CAA4C;AAAA,EAC7D,gBAAgB,CAAC,4CAA4C;AAAA;AAAA;AAAA;AAAA;AAAA,EAK7D,cAAc,CAAC,4CAA4C;AAAA,EAC3D,cAAc,CAAC,4CAA4C;AAAA,EAC3D,eAAe,CAAC,4CAA4C;AAC9D;AAYO,IAAM,uCAAiE;AAAA,EAC5E,YAAY,CAAC,4CAA4C;AAAA,EACzD,aAAa,CAAC,4CAA4C;AAAA,EAC1D,cAAc,CAAC,4CAA4C;AAAA,EAC3D,eAAe,CAAC,4CAA4C;AAAA,EAC5D,gBAAgB,CAAC,4CAA4C;AAAA,EAC7D,gBAAgB,CAAC,4CAA4C;AAAA;AAAA;AAAA,EAG7D,cAAc,CAAC,4CAA4C;AAAA,EAC3D,eAAe,CAAC,4CAA4C;AAAA,EAC5D,cAAc,CAAC,4CAA4C;AAC7D;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
omnistonProvider
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FDSTD34Z.js";
|
|
4
4
|
import {
|
|
5
5
|
omniston
|
|
6
6
|
} from "./chunk-QDXFC6BC.js";
|
|
@@ -24,4 +24,4 @@ var OmnistonSwap2Protocol = class extends SingleProviderSwap2 {
|
|
|
24
24
|
export {
|
|
25
25
|
OmnistonSwap2Protocol
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
27
|
+
//# sourceMappingURL=chunk-IX4NF2J7.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -88,7 +88,10 @@ var STONFI_ROUTERS = [
|
|
|
88
88
|
"EQCS4UEa5UaJLzOyyKieqQOQ2P9M-7kXpkO5HnP3Bv250cN3",
|
|
89
89
|
"EQB3ncyBUTjZUA5EnFKR5_EnOMI9V1tTEAAPaiU71gc4TiUt"
|
|
90
90
|
];
|
|
91
|
-
var OMNISTON_ESCROWS = [
|
|
91
|
+
var OMNISTON_ESCROWS = [
|
|
92
|
+
"EQAbWJ3Y1HgIIvcMq1prG1anlDC0T3cZlAU7luPT6LmTpmrZ",
|
|
93
|
+
"EQDybO88l2lrrAmALRUqpmgEE_tuxk510F4Yd4xjbQZxC9IA"
|
|
94
|
+
];
|
|
92
95
|
function raw(address) {
|
|
93
96
|
if (!address) return null;
|
|
94
97
|
try {
|
|
@@ -440,7 +443,44 @@ function sameJetton(a, b) {
|
|
|
440
443
|
|
|
441
444
|
// src/validators/settlement.ts
|
|
442
445
|
var AUDITED_OMNISTON_SETTLEMENT_CONTRACTS = {
|
|
443
|
-
|
|
446
|
+
// The TON Escrow Minter a new TON <-> EVM order may name. The provider
|
|
447
|
+
// compares TON addresses as these exact strings, so it is kept in the form
|
|
448
|
+
// Omniston's quotes use.
|
|
449
|
+
// - EQDybO88… (code 9737943f…, "rev2"): Omniston's TON <-> EVM quotes name it
|
|
450
|
+
// since 2026-11-10 ~19:00Z. Reviewed 2026-11-12, read-only:
|
|
451
|
+
// - Deploy tx fkabfHcN8DcrqQyazmlB+UprljBDeEkvFlgaVOi905g=
|
|
452
|
+
// (2026-11-10 18:47:06Z). Code and data still equal that StateInit:
|
|
453
|
+
// no upgrade since, none pending (no pendingCode, upgradeAfter 0).
|
|
454
|
+
// - Same admin (0:408fff62…) as rev1; it is also the admin_address of the
|
|
455
|
+
// STON.fi DEX v2 routers api.ston.fi lists. Deployed from the same
|
|
456
|
+
// wallet as rev1 (a weak signal on TON: anyone can send a StateInit).
|
|
457
|
+
// - The bytecode diff to rev1: escrow / execution code must be in an
|
|
458
|
+
// embedded whitelist (9e77…, f6ed…, d304…, pinned in ton.ts, plus 9fe4…
|
|
459
|
+
// for TON <-> TON, which the SDK does not pin), the escrow sub-VM must
|
|
460
|
+
// return one value, and a failed position deploy now credits the amount
|
|
461
|
+
// back to the same account contract instead of aborting (the only new
|
|
462
|
+
// path that moves value; no real message has used it). Fees, timelocks,
|
|
463
|
+
// payouts, admin and the 7-day upgrade delay are unchanged. Replayed
|
|
464
|
+
// through both codes, the real traffic of both minters (~42k
|
|
465
|
+
// transactions) and of ~1,070 of their positions gave the same outputs.
|
|
466
|
+
// - It deploys positions with code eb503578…, the only code in
|
|
467
|
+
// DEFAULT_OMNISTON_TON_CODE_HASHES.position. The address and that pin
|
|
468
|
+
// go together: without the pin every EVM -> TON order on this minter
|
|
469
|
+
// fills and then fails the disclosure check.
|
|
470
|
+
// - EQAbWJ3Y… (code f91c43d3…, "rev1", deployed 2026-06-09) is no longer
|
|
471
|
+
// trusted by default (2026-11-12). Omniston's quotes moved to rev2 on
|
|
472
|
+
// 2026-11-10 (rev1 still took a few orders on 2026-11-12), and rev1 lacks the escrow-code whitelist rev2 added: on
|
|
473
|
+
// rev1 only the SDK's own pins check the escrow and execution code an
|
|
474
|
+
// order carries. A quote that names rev1 is refused with its address
|
|
475
|
+
// in the reason, and so is building one cached under an older table; its positions (code e4d5115a…) fail
|
|
476
|
+
// position-code-hash. It stays in OMNISTON_ESCROWS (activity.ts), which
|
|
477
|
+
// recognizes history and grants no trust. Old orders need nothing from
|
|
478
|
+
// this table: trackIntent reads no trust table, and every disclosure
|
|
479
|
+
// check refuses a quote older than 6 h, so a rev1 order quoted before
|
|
480
|
+
// the switch cannot be closed by any version. Listing rev1 here or in
|
|
481
|
+
// trustedProtocolAddresses trusts it again for NEW orders; it does not
|
|
482
|
+
// help close an old one.
|
|
483
|
+
"ton:-239": ["EQDybO88l2lrrAmALRUqpmgEE_tuxk510F4Yd4xjbQZxC9IA"],
|
|
444
484
|
"eip155:1": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
445
485
|
"eip155:56": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
446
486
|
"eip155:137": ["0x41A392062A4307a6961d48e30FF20bF6823715B8"],
|
|
@@ -2007,6 +2047,9 @@ function omnistonProvider(opts = {}) {
|
|
|
2007
2047
|
const inputToken = assetContract(q.inputAsset);
|
|
2008
2048
|
const outputToken = assetContract(q.outputAsset);
|
|
2009
2049
|
const destChainId = tonDest ? null : evmRef2(destChain);
|
|
2050
|
+
if (factory?.chain.$case === destCase && !isTrusted(destChain, factory.chain.value)) {
|
|
2051
|
+
throw new Error(`omniston: untrusted ${destChain} settlement contract ${factory.chain.value}`);
|
|
2052
|
+
}
|
|
2010
2053
|
if (protocol.chain.$case !== srcCase || !isTrustedOrderProtocol(srcChain, protocol.chain.value) || resolver?.chain.$case !== srcCase || !validEvmAddress(resolver.chain.value) || factory?.chain.$case !== destCase || !isTrusted(destChain, factory.chain.value) || !inputToken || !outputToken || !Number.isSafeInteger(settlement.protocolFeePips) || !tonDest && (destChainId === null || !validEvmAddress(outputToken) || !isPositiveInteger(settlement.dstSecurityDepositUnits ?? ""))) throw new Error("omniston: incomplete EVM order settlement binding in quote");
|
|
2011
2054
|
const { secrets, created } = await secretsFor(ref, q, 1);
|
|
2012
2055
|
const hashes = secrets.map((secret) => hashlock(secret, settlement.htlcHashingFunction));
|
|
@@ -2251,6 +2294,10 @@ function omnistonProvider(opts = {}) {
|
|
|
2251
2294
|
const destCase = q.outputAsset.chain.$case;
|
|
2252
2295
|
const traderDst = destCase === "ton" ? null : { chain: { $case: destCase, value: (0, import_viem.getAddress)(ref.dest) } };
|
|
2253
2296
|
if (!traderDst) throw new Error("omniston: TON-destination orders are not supported");
|
|
2297
|
+
const minter = q.settlementData.value.srcProtocolContractAddress;
|
|
2298
|
+
if (minter.chain.$case !== "ton" || !isTrusted(srcChain, minter.chain.value)) {
|
|
2299
|
+
throw new Error(`omniston: untrusted TON settlement contract ${minter.chain.value}`);
|
|
2300
|
+
}
|
|
2254
2301
|
const settlement = q.settlementData;
|
|
2255
2302
|
const hashingFunction = settlement.$case === "order" ? settlement.value.htlcHashingFunction : void 0;
|
|
2256
2303
|
const { secrets, created } = await secretsFor(ref, q, maxExecutions);
|