@anywalletkit/protocol-swap2-omniston 0.5.3 → 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.
- 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 +125 -12
- package/dist/validators.cjs.map +1 -1
- package/dist/validators.d.cts +41 -4
- package/dist/validators.d.ts +41 -4
- package/dist/validators.js +88 -12
- package/dist/validators.js.map +1 -1
- package/package.json +6 -6
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anywalletkit/protocol-swap2-omniston",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"description": "STON.fi Omniston for Any Wallet Kit: TON swaps on the STON.fi DEX and TON ↔ EVM / EVM ↔ EVM stable orders through HTLC escrows, over the Omniston RFQ; standalone or as a provider of the swap2 router.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://docs.anywallet.tech",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
"@ton/crypto": "^3.3.0",
|
|
69
69
|
"buffer": "^6.0.3",
|
|
70
70
|
"viem": "^2.45.0",
|
|
71
|
-
"@anywalletkit/protocol-swap2-core": "0.10.
|
|
72
|
-
"@anywalletkit/swap2-assets": "0.
|
|
71
|
+
"@anywalletkit/protocol-swap2-core": "0.10.3",
|
|
72
|
+
"@anywalletkit/swap2-assets": "0.3.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@anywalletkit/core": "0.8.0"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/node": "^22",
|
|
79
|
-
"vitest": "^5.0
|
|
80
|
-
"@anywalletkit/
|
|
81
|
-
"@anywalletkit/
|
|
79
|
+
"vitest": "^5.1.0",
|
|
80
|
+
"@anywalletkit/conformance": "0.5.1",
|
|
81
|
+
"@anywalletkit/core": "0.8.0"
|
|
82
82
|
},
|
|
83
83
|
"keywords": [
|
|
84
84
|
"swap2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/activity.ts"],"sourcesContent":["/**\n * Activity recognition for Omniston on TON.\n *\n * Same-chain swaps settle through the STON.fi DEX router (the wallet pays TON /\n * a jetton to the router and the output jetton or TON comes back) → `swap`.\n * TON → EVM orders lock the input in the Omniston HTLC escrow (\"Omniston Escrow\n * Minter\", the `srcProtocolContractAddress` of every live quote) → `bridge`;\n * the EVM leg is paid by the resolver and is not recognizable offline.\n * Addresses are compared in raw form, so friendly (EQ…/UQ…) and raw (0:…)\n * notations all match.\n */\nimport {Address} from \"@ton/core\";\nimport type {ActivityItem, ChainTx, DescribeActivityContext} from \"@anywalletkit/core\";\nimport {describeSwapLike} from \"@anywalletkit/protocol-swap2-core/activity\";\n\nexport const OMNISTON_MODULE = \"@anywalletkit/protocol-swap2-omniston\";\n\n/** STON.fi DEX routers (tonapi \"STON.fi DEX\"; v2.2 observed in the test wallet's swaps, v1 kept for older history). */\nexport const STONFI_ROUTERS: readonly string[] = [\n \"EQCS4UEa5UaJLzOyyKieqQOQ2P9M-7kXpkO5HnP3Bv250cN3\",\n \"EQB3ncyBUTjZUA5EnFKR5_EnOMI9V1tTEAAPaiU71gc4TiUt\",\n];\n/** Omniston HTLC escrow on TON (Omniston Escrow Minter) — the `srcProtocolContractAddress` of TON→EVM orders. */\nexport const OMNISTON_ESCROWS: readonly string[] = [\"EQAbWJ3Y1HgIIvcMq1prG1anlDC0T3cZlAU7luPT6LmTpmrZ\"];\n\nfunction raw(address: string | null | undefined): string | null {\n if (!address) return null;\n try {\n return Address.parse(address).toRawString();\n } catch {\n return null;\n }\n}\n\nconst ROUTER_RAW = new Set(STONFI_ROUTERS.map((a) => raw(a)!));\nconst ESCROW_RAW = new Set(OMNISTON_ESCROWS.map((a) => raw(a)!));\n\n/** Every non-own party of the transaction in raw form: the destination contract and each transfer's other side. */\nfunction counterparties(tx: ChainTx, own: Set<string>): string[] {\n const ownRaw = new Set<string>();\n for (const a of own) {\n const r = raw(a);\n if (r) ownRaw.add(r);\n }\n const out = new Set<string>();\n const add = (a: string | null | undefined) => {\n const r = raw(a);\n if (r && !ownRaw.has(r)) out.add(r);\n };\n add(tx.call?.to);\n add(tx.to);\n for (const t of tx.transfers) {\n add(t.from);\n add(t.to);\n }\n return [...out];\n}\n\nexport function describeOmnistonActivity(tx: ChainTx, ctx: DescribeActivityContext): ActivityItem | null {\n if (!tx.chain.startsWith(\"ton:\")) return null;\n const parties = counterparties(tx, ctx.own);\n const escrow = parties.find((p) => ESCROW_RAW.has(p));\n if (escrow) {\n return describeSwapLike(tx, ctx, {protocol: OMNISTON_MODULE, subtitle: \"Omniston · STON.fi\", kind: \"bridge\", counterparty: tx.call?.to ?? tx.to ?? escrow});\n }\n const router = parties.find((p) => ROUTER_RAW.has(p));\n if (router) {\n return describeSwapLike(tx, ctx, {protocol: OMNISTON_MODULE, subtitle: \"STON.fi · TON\", kind: \"swap\", counterparty: tx.call?.to ?? tx.to ?? router});\n }\n return null;\n}\n"],"mappings":";AAWA,SAAQ,eAAc;AAEtB,SAAQ,wBAAuB;AAExB,IAAM,kBAAkB;AAGxB,IAAM,iBAAoC;AAAA,EAC/C;AAAA,EACA;AACF;AAEO,IAAM,mBAAsC,CAAC,kDAAkD;AAEtG,SAAS,IAAI,SAAmD;AAC9D,MAAI,CAAC,QAAS,QAAO;AACrB,MAAI;AACF,WAAO,QAAQ,MAAM,OAAO,EAAE,YAAY;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,IAAM,aAAa,IAAI,IAAI,eAAe,IAAI,CAAC,MAAM,IAAI,CAAC,CAAE,CAAC;AAC7D,IAAM,aAAa,IAAI,IAAI,iBAAiB,IAAI,CAAC,MAAM,IAAI,CAAC,CAAE,CAAC;AAG/D,SAAS,eAAe,IAAa,KAA4B;AAC/D,QAAM,SAAS,oBAAI,IAAY;AAC/B,aAAW,KAAK,KAAK;AACnB,UAAM,IAAI,IAAI,CAAC;AACf,QAAI,EAAG,QAAO,IAAI,CAAC;AAAA,EACrB;AACA,QAAM,MAAM,oBAAI,IAAY;AAC5B,QAAM,MAAM,CAAC,MAAiC;AAC5C,UAAM,IAAI,IAAI,CAAC;AACf,QAAI,KAAK,CAAC,OAAO,IAAI,CAAC,EAAG,KAAI,IAAI,CAAC;AAAA,EACpC;AACA,MAAI,GAAG,MAAM,EAAE;AACf,MAAI,GAAG,EAAE;AACT,aAAW,KAAK,GAAG,WAAW;AAC5B,QAAI,EAAE,IAAI;AACV,QAAI,EAAE,EAAE;AAAA,EACV;AACA,SAAO,CAAC,GAAG,GAAG;AAChB;AAEO,SAAS,yBAAyB,IAAa,KAAmD;AACvG,MAAI,CAAC,GAAG,MAAM,WAAW,MAAM,EAAG,QAAO;AACzC,QAAM,UAAU,eAAe,IAAI,IAAI,GAAG;AAC1C,QAAM,SAAS,QAAQ,KAAK,CAAC,MAAM,WAAW,IAAI,CAAC,CAAC;AACpD,MAAI,QAAQ;AACV,WAAO,iBAAiB,IAAI,KAAK,EAAC,UAAU,iBAAiB,UAAU,yBAAsB,MAAM,UAAU,cAAc,GAAG,MAAM,MAAM,GAAG,MAAM,OAAM,CAAC;AAAA,EAC5J;AACA,QAAM,SAAS,QAAQ,KAAK,CAAC,MAAM,WAAW,IAAI,CAAC,CAAC;AACpD,MAAI,QAAQ;AACV,WAAO,iBAAiB,IAAI,KAAK,EAAC,UAAU,iBAAiB,UAAU,oBAAiB,MAAM,QAAQ,cAAc,GAAG,MAAM,MAAM,GAAG,MAAM,OAAM,CAAC;AAAA,EACrJ;AACA,SAAO;AACT;","names":[]}
|
package/dist/chunk-JWYDIW4V.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/validators/settlement.ts
|
|
2
|
-
var AUDITED_OMNISTON_SETTLEMENT_CONTRACTS = {
|
|
3
|
-
"ton:-239": ["EQAbWJ3Y1HgIIvcMq1prG1anlDC0T3cZlAU7luPT6LmTpmrZ"],
|
|
4
|
-
"eip155:1": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
5
|
-
"eip155:56": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
6
|
-
"eip155:137": ["0x41A392062A4307a6961d48e30FF20bF6823715B8"],
|
|
7
|
-
"eip155:4663": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
8
|
-
"eip155:8453": ["0xACa3E2F9b61a44892926bC6c3e104192E7D1c3cd"],
|
|
9
|
-
"eip155:42161": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
10
|
-
"eip155:43114": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
11
|
-
// 2026-10-20: one factory address on X Layer, HyperEVM and Plasma. Runtime
|
|
12
|
-
// bytecode equals Ethereum's 0xafCF… byte for byte except the immutable slots
|
|
13
|
-
// (escrow implementations, its order protocol, domain hash); it references
|
|
14
|
-
// the order protocol trusted below on the same chain.
|
|
15
|
-
"eip155:196": ["0xd602079AFa5c38F550510a2a988CbFa698Fa0189"],
|
|
16
|
-
"eip155:999": ["0xd602079AFa5c38F550510a2a988CbFa698Fa0189"],
|
|
17
|
-
"eip155:9745": ["0xd602079AFa5c38F550510a2a988CbFa698Fa0189"]
|
|
18
|
-
};
|
|
19
|
-
var AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS = {
|
|
20
|
-
"eip155:1": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
21
|
-
"eip155:56": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
22
|
-
"eip155:137": ["0xafCF681272AF10959736f45616eeCBC22D7095E2"],
|
|
23
|
-
"eip155:8453": ["0xe7405fAcDEDB2512e91F2886BDff13231343aF5E"],
|
|
24
|
-
"eip155:42161": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
25
|
-
"eip155:43114": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
26
|
-
// 2026-10-20: bytecode equals Ethereum's 0xb581… except immutables (wrapped
|
|
27
|
-
// native, own address, chain id 196 / 9745 / 999 at the chain-id slot).
|
|
28
|
-
"eip155:196": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
29
|
-
"eip155:9745": ["0xb5810aCfD45D85Eaa938bF90a5857295513DA7E9"],
|
|
30
|
-
"eip155:999": ["0xD84778bbeEC5D2a8d17c6424249C438EC0b1ABE3"]
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export {
|
|
34
|
-
AUDITED_OMNISTON_SETTLEMENT_CONTRACTS,
|
|
35
|
-
AUDITED_OMNISTON_EVM_ORDER_PROTOCOLS
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=chunk-JWYDIW4V.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 \"ton:-239\": [\"EQAbWJ3Y1HgIIvcMq1prG1anlDC0T3cZlAU7luPT6LmTpmrZ\"],\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,EAC7E,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":[]}
|
|
File without changes
|