@vultisig/core-chain 2.35.1 → 2.37.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.
- package/CHANGELOG.md +42 -0
- package/dist/chains/cosmos/cosmosGasLimitRecord.d.ts.map +1 -1
- package/dist/chains/cosmos/cosmosGasLimitRecord.js +13 -14
- package/dist/chains/cosmos/cosmosGasLimitRecord.js.map +1 -1
- package/dist/chains/cosmos/gas.d.ts +16 -0
- package/dist/chains/cosmos/gas.d.ts.map +1 -1
- package/dist/chains/cosmos/gas.js +17 -1
- package/dist/chains/cosmos/gas.js.map +1 -1
- package/dist/chains/sui/listAllCoins.d.ts.map +1 -1
- package/dist/chains/sui/listAllCoins.js +8 -0
- package/dist/chains/sui/listAllCoins.js.map +1 -1
- package/dist/chains/thorchain/ruji/services/fetchMergeableTokenBalances.d.ts +6 -1
- package/dist/chains/thorchain/ruji/services/fetchMergeableTokenBalances.d.ts.map +1 -1
- package/dist/chains/thorchain/ruji/services/fetchMergeableTokenBalances.js +6 -35
- package/dist/chains/thorchain/ruji/services/fetchMergeableTokenBalances.js.map +1 -1
- package/dist/swap/general/knownAggregatorRouters.d.ts +40 -22
- package/dist/swap/general/knownAggregatorRouters.d.ts.map +1 -1
- package/dist/swap/general/knownAggregatorRouters.js +147 -54
- package/dist/swap/general/knownAggregatorRouters.js.map +1 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.d.ts.map +1 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.js +15 -48
- package/dist/swap/general/lifi/api/getLifiSwapQuote.js.map +1 -1
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.d.ts +4 -0
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.d.ts.map +1 -0
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.js +19 -0
- package/dist/swap/general/lifi/api/lifiSwapFeeChain.js.map +1 -0
- package/dist/swap/general/swapkit/api/getSwapKitQuote.d.ts.map +1 -1
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js +24 -44
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js.map +1 -1
- package/dist/swap/quote/SwapQuote.d.ts +12 -0
- package/dist/swap/quote/SwapQuote.d.ts.map +1 -1
- package/dist/swap/quote/findSwapQuote.d.ts +48 -2
- package/dist/swap/quote/findSwapQuote.d.ts.map +1 -1
- package/dist/swap/quote/findSwapQuote.js +64 -3
- package/dist/swap/quote/findSwapQuote.js.map +1 -1
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.d.ts +20 -0
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.d.ts.map +1 -0
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.js +67 -0
- package/dist/swap/quote/getSwapQuoteSafetyFingerprint.js.map +1 -0
- package/dist/tx/broadcast/cosmosSequenceMismatch.d.ts +26 -0
- package/dist/tx/broadcast/cosmosSequenceMismatch.d.ts.map +1 -0
- package/dist/tx/broadcast/cosmosSequenceMismatch.js +79 -0
- package/dist/tx/broadcast/cosmosSequenceMismatch.js.map +1 -0
- package/dist/tx/broadcast/resolvers/cosmos.d.ts +1 -0
- package/dist/tx/broadcast/resolvers/cosmos.d.ts.map +1 -1
- package/dist/tx/broadcast/resolvers/cosmos.js +7 -1
- package/dist/tx/broadcast/resolvers/cosmos.js.map +1 -1
- package/dist/tx/broadcast/transientRetry.d.ts.map +1 -1
- package/dist/tx/broadcast/transientRetry.js +6 -0
- package/dist/tx/broadcast/transientRetry.js.map +1 -1
- package/dist/utils/isValidTokenId.d.ts +6 -3
- package/dist/utils/isValidTokenId.d.ts.map +1 -1
- package/dist/utils/isValidTokenId.js +10 -3
- package/dist/utils/isValidTokenId.js.map +1 -1
- package/package.json +17 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
# @vultisig/core-chain
|
|
2
2
|
|
|
3
|
+
## 2.37.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2011](https://github.com/vultisig/vultisig-sdk/pull/2011) [`687f1ad`](https://github.com/vultisig/vultisig-sdk/commit/687f1adea7c81dde4a5f21520ea1cdbbf34e10fd) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - Add `findSwapQuotes`, returning the full ranked swap-route candidate set (`{ best, ranked }`) alongside the auto-selected winner, so consumers can offer route selection. Each ranked entry carries the fully bound quote (request amount, expiry, safety fingerprint), its provider name, and the comparable net output used for ranking. `findSwapQuote` now delegates to it and its behavior — selection, preference band, and every error path — is unchanged.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#1881](https://github.com/vultisig/vultisig-sdk/pull/1881) [`f7caa39`](https://github.com/vultisig/vultisig-sdk/commit/f7caa39ad2eb3d322031d8ac56ae832a9108e6d4) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Surface Cosmos account-sequence mismatches with direction-aware recovery: stale signed transactions now require rebuilding and a new signing ceremony, while future-sequence transactions may wait for their predecessor and retry. Preserve peer-broadcast hash verification and retry only the recoverable future-sequence case.
|
|
12
|
+
|
|
13
|
+
- [#1839](https://github.com/vultisig/vultisig-sdk/pull/1839) [`50257ad`](https://github.com/vultisig/vultisig-sdk/commit/50257ad213a36952509f3548100334e5f3e44a09) Thanks [@rcoderdev](https://github.com/rcoderdev)! - cosmos/gas: raise the TerraClassic staking gas limit from 3M to 4M
|
|
14
|
+
|
|
15
|
+
`getCosmosStakingGasLimit` now returns 4M for `Chain.TerraClassic` regardless of `msgCount`, giving external SDK consumers headroom over the observed 2,501,503-gas `MsgBeginRedelegate` path.
|
|
16
|
+
|
|
17
|
+
Also exports `TERRA_CLASSIC_STAKING_ULUNA_FEE_BASE_UNITS`, the `uluna` fee correctly priced for this 4M staking gas limit (113.3 LUNC at the chain's 28.325 uluna/gas minimum). The existing `TERRA_CLASSIC_ULUNA_BASE_GAS` / `getCosmosSendFeeBaseUnits` fee is priced for the 300k native-send gas limit and under-pays a 4M-gas staking tx by ~13x, so consumers must pair the staking gas limit with this new constant, not the send fee.
|
|
18
|
+
|
|
19
|
+
- [#1871](https://github.com/vultisig/vultisig-sdk/pull/1871) [`76163b6`](https://github.com/vultisig/vultisig-sdk/commit/76163b6e533cb0178c999e5b6554bddf4517718e) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Make the expired, zero-caller Rujira merge-balance service inert. The KUJI-to-RUJI merge window closed on 2026-04-05, so the compatibility shim now returns an empty result without querying GraphQL.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`69b1c2e`](https://github.com/vultisig/vultisig-sdk/commit/69b1c2e4026e62a83151957a91651eaa982d0a13)]:
|
|
22
|
+
- @vultisig/lib-utils@0.10.5
|
|
23
|
+
|
|
24
|
+
## 2.36.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- [#1830](https://github.com/vultisig/vultisig-sdk/pull/1830) [`1fd27b9`](https://github.com/vultisig/vultisig-sdk/commit/1fd27b9103b75a13191f173ebeed98288d8c16b0) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Fail closed when LI.FI returns a destination outside its official chain-scoped Diamond deployments. Accept that Diamond as LI.FI's deterministic approval-spender fast path, while requiring an independent benign Blockaid verdict for any route-dependent spender that differs from it. Require the same independent verdicts for SwapKit EVM transaction destinations and approval spenders, while retaining response-local target-address binding as defense in depth.
|
|
29
|
+
|
|
30
|
+
**Consumer-visible behavior changes:**
|
|
31
|
+
|
|
32
|
+
- **New runtime throws on the signing path.** A LI.FI destination outside the official Diamond, a distinct LI.FI approval spender that doesn't clear an independent Blockaid check, or a SwapKit destination/approval-spender that doesn't clear the same check now throws during quote construction and co-signer signing-input construction. A consumer on a caret range picks this up automatically.
|
|
33
|
+
- **Dynamic LI.FI approval spenders and SwapKit addresses add a live third-party network call (Blockaid) during MPC signing**, per co-signer. The official LI.FI Diamond remains an offline fast path. A slow or unreachable Blockaid response can stall a signing ceremony for up to the shared `queryUrl` timeout (20s default) before throwing.
|
|
34
|
+
|
|
35
|
+
- [#1811](https://github.com/vultisig/vultisig-sdk/pull/1811) [`003ee98`](https://github.com/vultisig/vultisig-sdk/commit/003ee98728f3318eb2de661209f164b449150810) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Bind raw swap quotes to their exact coin identities, requested source amount, absolute expiry, and returned transaction, then reject missing, stale, mismatched, or mutated quotes in the vault-free swap preparation path before any payload construction. General quotes remain preparation-valid for five minutes while SDK presentation continues to recommend refreshing after 60 seconds, and vault-free callers can catch `SwapQuoteExpiredError` to requote.
|
|
36
|
+
|
|
37
|
+
Consumers must pass the live bound quote returned by `findSwapQuote` or `getSwapQuote` into preparation instead of constructing or persisting an unbound raw quote. Structured cloning is supported; JSON round-tripping is not because it loses required runtime value types such as `bigint`.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [#1883](https://github.com/vultisig/vultisig-sdk/pull/1883) [`44f0ecb`](https://github.com/vultisig/vultisig-sdk/commit/44f0ecbdf10b07789341c0279041d3a1e37d46a0) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Share LI.FI fee-chain fallback logic between the core and React Native quote paths.
|
|
42
|
+
|
|
43
|
+
- [#1886](https://github.com/vultisig/vultisig-sdk/pull/1886) [`eb25508`](https://github.com/vultisig/vultisig-sdk/commit/eb25508eadfde14ee62470e64d8c2b590627fd76) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Fail closed when Sui pagination reports more data without a usable cursor, preventing partial coin sets or portfolios from being returned as complete.
|
|
44
|
+
|
|
3
45
|
## 2.35.1
|
|
4
46
|
|
|
5
47
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosGasLimitRecord.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosGasLimitRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAuBzC,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG,MAE9D,CAAA;
|
|
1
|
+
{"version":3,"file":"cosmosGasLimitRecord.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosGasLimitRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEtF,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAuBzC,eAAO,MAAM,iBAAiB,GAAI,MAAM,OAAO,CAAC,WAAW,CAAC,KAAG,MAE9D,CAAA;AAoCD,KAAK,6BAA6B,GAAG;IACnC,KAAK,EAAE,qBAAqB,CAAA;IAC5B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB,GAAI,qBAAyB,6BAA6B,KAAG,MAajG,CAAA"}
|
|
@@ -34,15 +34,16 @@ export const getCosmosGasLimit = (coin) => {
|
|
|
34
34
|
* writes that the standard SDK gas estimate omits. In practice this adds
|
|
35
35
|
* ~200-800 gas on top of the base delegate cost (~2M), so a 2M limit fails
|
|
36
36
|
* consistently ("out of gas in location: ValuePerByte; gasWanted: 2000000,
|
|
37
|
-
* gasUsed: 200X").
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* `cosmosGasRecord[TerraClassic]
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* callers must split multi-validator claims into separate
|
|
37
|
+
* gasUsed: 200X"). Production telemetry later observed MsgBeginRedelegate
|
|
38
|
+
* consuming 2_501_503 gas. The former 3M limit left little headroom over that
|
|
39
|
+
* observed burn, so TerraClassic uses 4M for the heaviest single-msg staking
|
|
40
|
+
* path. Consumers MUST pair this with `TERRA_CLASSIC_STAKING_ULUNA_FEE_BASE_UNITS`
|
|
41
|
+
* (from `./gas`), NOT `cosmosGasRecord[TerraClassic]` / `TERRA_CLASSIC_ULUNA_BASE_GAS`,
|
|
42
|
+
* since those govern native MsgSend at the much lower 300k send gas limit and
|
|
43
|
+
* under-price a 4M-gas staking tx by ~13x, which the node rejects for
|
|
44
|
+
* insufficient fees. TerraClassic keeps a fixed per-transaction staking
|
|
45
|
+
* budget, so callers must split multi-validator reward claims into separate
|
|
46
|
+
* transactions.
|
|
46
47
|
*/
|
|
47
48
|
const cosmosStakingGasLimitRecord = {
|
|
48
49
|
[Chain.Cosmos]: 350000n,
|
|
@@ -52,7 +53,7 @@ const cosmosStakingGasLimitRecord = {
|
|
|
52
53
|
[Chain.Noble]: 350000n,
|
|
53
54
|
[Chain.Akash]: 350000n,
|
|
54
55
|
[Chain.Terra]: 500000n,
|
|
55
|
-
[Chain.TerraClassic]:
|
|
56
|
+
[Chain.TerraClassic]: 4000000n,
|
|
56
57
|
};
|
|
57
58
|
/**
|
|
58
59
|
* Returns the gas limit a Cosmos staking tx should request for the given
|
|
@@ -69,10 +70,8 @@ export const getCosmosStakingGasLimit = ({ chain, msgCount = 1 }) => {
|
|
|
69
70
|
throw new Error(`getCosmosStakingGasLimit: msgCount must be a non-negative integer, got ${msgCount}`);
|
|
70
71
|
}
|
|
71
72
|
const base = cosmosStakingGasLimitRecord[chain];
|
|
72
|
-
// TerraClassic
|
|
73
|
-
//
|
|
74
|
-
// staking fee at msgCount>=2; single-msg policy keeps the tx within that fee
|
|
75
|
-
// for columbus-5 (independent of the cosmosGasRecord native-send gas fee).
|
|
73
|
+
// TerraClassic uses a fixed single-transaction budget (see the record
|
|
74
|
+
// comment). Multi-validator reward claims must be split by the caller.
|
|
76
75
|
if (chain === Chain.TerraClassic)
|
|
77
76
|
return base;
|
|
78
77
|
const n = BigInt(Math.max(1, msgCount));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmosGasLimitRecord.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosGasLimitRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsC,MAAM,4BAA4B,CAAA;AAItF,MAAM,oBAAoB,GAAgC;IACxD,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO;IACvB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO;IACxB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO;IACvB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO;IACrB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO;IACtB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO;IACtB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO;IACtB,wDAAwD;IACxD,2EAA2E;IAC3E,0EAA0E;IAC1E,sEAAsE;IACtE,uEAAuE;IACvE,wEAAwE;IACxE,yEAAyE;IACzE,gCAAgC;IAChC,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,OAAO;IAC7B,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,SAAS;IAC5B,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,WAAW;CAC/B,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,IAA0B,EAAU,EAAE;IACtE,OAAO,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACzC,CAAC,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"cosmosGasLimitRecord.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosGasLimitRecord.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsC,MAAM,4BAA4B,CAAA;AAItF,MAAM,oBAAoB,GAAgC;IACxD,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO;IACvB,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO;IACxB,CAAC,KAAK,CAAC,MAAM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C,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,0EAA0E,QAAQ,EAAE,CAAC,CAAA;IACvG,CAAC;IAED,MAAM,IAAI,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAA;IAE/C,sEAAsE;IACtE,uEAAuE;IACvE,IAAI,KAAK,KAAK,KAAK,CAAC,YAAY;QAAE,OAAO,IAAI,CAAA;IAE7C,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;IACvC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AACtC,CAAC,CAAA"}
|
|
@@ -23,6 +23,22 @@ export declare const MAYA_SEND_FEE_BASE_UNITS = 2000000000n;
|
|
|
23
23
|
* `TerraClassicTax.ULUNA_BASE_GAS`.
|
|
24
24
|
*/
|
|
25
25
|
export declare const TERRA_CLASSIC_ULUNA_BASE_GAS = 8497500n;
|
|
26
|
+
/**
|
|
27
|
+
* Terra Classic's `uluna` fee paired with the STAKING gas limit
|
|
28
|
+
* (`getCosmosStakingGasLimit({ chain: TerraClassic })`, currently 4M), priced
|
|
29
|
+
* at the same 28.325 uluna/gas chain minimum as `TERRA_CLASSIC_ULUNA_BASE_GAS`.
|
|
30
|
+
*
|
|
31
|
+
* TerraClassic staking runs ~13x hotter than a native send (4M vs 300k gas),
|
|
32
|
+
* so `TERRA_CLASSIC_ULUNA_BASE_GAS` under-prices it by a wide margin, and a
|
|
33
|
+
* consumer pairing the staking gas limit with the send-fee constant (or any
|
|
34
|
+
* other stale hand-picked LUNC figure) gets a SignDoc the node rejects for
|
|
35
|
+
* insufficient fees before delegate / undelegate / redelegate / withdraw-
|
|
36
|
+
* rewards can execute. Computed from `getCosmosStakingGasLimit` rather than
|
|
37
|
+
* hardcoded so a future retune of the staking gas limit can't silently
|
|
38
|
+
* desync the paired fee the way the gas-limit-only bump in vultisig-sdk#1839
|
|
39
|
+
* originally did.
|
|
40
|
+
*/
|
|
41
|
+
export declare const TERRA_CLASSIC_STAKING_ULUNA_FEE_BASE_UNITS: bigint;
|
|
26
42
|
export declare const cosmosGasRecord: Record<IbcEnabledCosmosChain, bigint>;
|
|
27
43
|
/**
|
|
28
44
|
* Returns the canonical static native-send fee in base units.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/gas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAA4B,KAAK,aAAa,EAAgB,MAAM,iBAAiB,CAAA;AAM5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,yGAAyG;AACzG,eAAO,MAAM,uBAAuB,QAAQ,CAAA;AAE5C,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,cAAc,CAAA;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,WAAa,CAAA;AAEtD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CASjE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,WAAW,KAAG,MAAM,GAAG,SAIvE,CAAA;AAED,KAAK,SAAS,GAAG;IACf,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AAqBD,eAAO,MAAM,sBAAsB,GAAI,iBAAiB,MAAM,EAAE,aAAa,MAAM,KAAG,aAAa,GAAG,SAYrG,CAAA;AA0ED,eAAO,MAAM,kBAAkB,GAC7B,MAAM,OAAO,CAAC,qBAAqB,CAAC,EACpC,OAAM,SAAc,KACnB,OAAO,CAAC,MAAM,CAehB,CAAA"}
|
|
1
|
+
{"version":3,"file":"gas.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/gas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAA4B,KAAK,aAAa,EAAgB,MAAM,iBAAiB,CAAA;AAM5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,yGAAyG;AACzG,eAAO,MAAM,uBAAuB,QAAQ,CAAA;AAE5C,qEAAqE;AACrE,eAAO,MAAM,wBAAwB,cAAc,CAAA;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,WAAa,CAAA;AAEtD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0CAA0C,QAGtD,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CASjE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,WAAW,KAAG,MAAM,GAAG,SAIvE,CAAA;AAED,KAAK,SAAS,GAAG;IACf,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AAqBD,eAAO,MAAM,sBAAsB,GAAI,iBAAiB,MAAM,EAAE,aAAa,MAAM,KAAG,aAAa,GAAG,SAYrG,CAAA;AA0ED,eAAO,MAAM,kBAAkB,GAC7B,MAAM,OAAO,CAAC,qBAAqB,CAAC,EACpC,OAAM,SAAc,KACnB,OAAO,CAAC,MAAM,CAehB,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Chain } from '../../Chain.js';
|
|
2
2
|
import { getFeeAmountFromGasPrice, parseDecimal } from './cosmosDecimal.js';
|
|
3
3
|
import { cosmosFeeCoinDenom } from './cosmosFeeCoinDenom.js';
|
|
4
|
-
import { getCosmosGasLimit } from './cosmosGasLimitRecord.js';
|
|
4
|
+
import { getCosmosGasLimit, getCosmosStakingGasLimit } from './cosmosGasLimitRecord.js';
|
|
5
5
|
import { getCosmosRpcUrl } from './getCosmosRpcUrl.js';
|
|
6
6
|
import { getOsmosisDynamicFeeFloor } from './osmosisDynamicFee.js';
|
|
7
7
|
export { getFeeAmountFromGasPrice } from './cosmosDecimal.js';
|
|
@@ -26,6 +26,22 @@ export const MAYA_SEND_FEE_BASE_UNITS = 2000000000n;
|
|
|
26
26
|
* `TerraClassicTax.ULUNA_BASE_GAS`.
|
|
27
27
|
*/
|
|
28
28
|
export const TERRA_CLASSIC_ULUNA_BASE_GAS = 8497500n;
|
|
29
|
+
/**
|
|
30
|
+
* Terra Classic's `uluna` fee paired with the STAKING gas limit
|
|
31
|
+
* (`getCosmosStakingGasLimit({ chain: TerraClassic })`, currently 4M), priced
|
|
32
|
+
* at the same 28.325 uluna/gas chain minimum as `TERRA_CLASSIC_ULUNA_BASE_GAS`.
|
|
33
|
+
*
|
|
34
|
+
* TerraClassic staking runs ~13x hotter than a native send (4M vs 300k gas),
|
|
35
|
+
* so `TERRA_CLASSIC_ULUNA_BASE_GAS` under-prices it by a wide margin, and a
|
|
36
|
+
* consumer pairing the staking gas limit with the send-fee constant (or any
|
|
37
|
+
* other stale hand-picked LUNC figure) gets a SignDoc the node rejects for
|
|
38
|
+
* insufficient fees before delegate / undelegate / redelegate / withdraw-
|
|
39
|
+
* rewards can execute. Computed from `getCosmosStakingGasLimit` rather than
|
|
40
|
+
* hardcoded so a future retune of the staking gas limit can't silently
|
|
41
|
+
* desync the paired fee the way the gas-limit-only bump in vultisig-sdk#1839
|
|
42
|
+
* originally did.
|
|
43
|
+
*/
|
|
44
|
+
export const TERRA_CLASSIC_STAKING_ULUNA_FEE_BASE_UNITS = getFeeAmountFromGasPrice(getCosmosStakingGasLimit({ chain: Chain.TerraClassic }), parseDecimal('28.325'));
|
|
29
45
|
export const cosmosGasRecord = {
|
|
30
46
|
[Chain.Cosmos]: COSMOS_SEND_FEE_DEFAULT,
|
|
31
47
|
[Chain.Osmosis]: 9000n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/gas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsC,MAAM,aAAa,CAAA;AAEvE,OAAO,EAAE,wBAAwB,EAAsB,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/gas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsC,MAAM,aAAa,CAAA;AAEvE,OAAO,EAAE,wBAAwB,EAAsB,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAA;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAE1D,yGAAyG;AACzG,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAA;AAE5C,qEAAqE;AACrE,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAA;AAEnD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,QAAU,CAAA;A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;IACrE,4BAA4B;IAC5B,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnD,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC;QACrC,yBAAyB,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;KACzD,CAAC,CAAA;IACF,OAAO,YAAY,KAAK,IAAI,IAAI,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAA;AACvF,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAllCoins.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/sui/listAllCoins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAIlC,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,MAChC,CAAA;AAErD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAU,6BAA6B,oBAAoB,KAAG,OAAO,CAAC,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"listAllCoins.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/sui/listAllCoins.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAIlC,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,GAAG,SAAS,EAAE,UAAU,MAAM,KAAG,MAChC,CAAA;AAErD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GAAU,6BAA6B,oBAAoB,KAAG,OAAO,CAAC,aAAa,EAAE,CAuChH,CAAA"}
|
|
@@ -33,6 +33,14 @@ export const listAllSuiCoins = async ({ client, owner, coinType }) => {
|
|
|
33
33
|
balance: object.balance,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
// `hasNextPage: true` without a cursor cannot be followed. Treat every
|
|
37
|
+
// falsy cursor as malformed because the gRPC adapter can turn an empty page
|
|
38
|
+
// token into `cursor: ''`, while GraphQL can return a null end cursor.
|
|
39
|
+
// Returning the coins collected so far would make a truncated set look
|
|
40
|
+
// complete and can surface later as a false insufficient-balance error.
|
|
41
|
+
if (page.hasNextPage && !page.cursor) {
|
|
42
|
+
throw new Error(`listAllSuiCoins: page ${pages + 1} for ${owner} (${coinType}) reports hasNextPage with no cursor — refusing to build a send from a truncated coin set`);
|
|
43
|
+
}
|
|
36
44
|
cursor = page.hasNextPage ? page.cursor : null;
|
|
37
45
|
if (++pages >= maxSuiCoinPages && cursor) {
|
|
38
46
|
throw new Error(`listAllSuiCoins: exceeded ${maxSuiCoinPages} pages for ${owner} (${coinType}) — refusing to build a send from a possibly-truncated or looping coin set`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAllCoins.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/sui/listAllCoins.ts"],"names":[],"mappings":"AAmBA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;AAElC,MAAM,eAAe,GAAG,qBAAqB,CAAA;AAE7C,2DAA2D;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,UAA8B,EAAE,QAAgB,EAAU,EAAE,CAC5F,UAAU,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAA;AAQrD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAwB,EAA4B,EAAE;IACnH,MAAM,KAAK,GAAoB,EAAE,CAAA;IACjC,IAAI,MAAM,GAA8B,SAAS,CAAA;IACjD,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,GAAG,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;QAEhE,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC;gBACT,QAAQ,EAAE,iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC;gBAClD,YAAY,EAAE,MAAM,CAAC,QAAQ;gBAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,O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iBAAiB,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC;gBAClD,YAAY,EAAE,MAAM,CAAC,QAAQ;gBAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB,CAAC,CAAA;QACJ,CAAC;QAED,uEAAuE;QACvE,4EAA4E;QAC5E,uEAAuE;QACvE,uEAAuE;QACvE,wEAAwE;QACxE,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CACb,yBAAyB,KAAK,GAAG,CAAC,QAAQ,KAAK,KAAK,QAAQ,2FAA2F,CACxJ,CAAA;QACH,CAAC;QAED,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAA;QAE9C,IAAI,EAAE,KAAK,IAAI,eAAe,IAAI,MAAM,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CACb,6BAA6B,eAAe,cAAc,KAAK,KAAK,QAAQ,4EAA4E,CACzJ,CAAA;QACH,CAAC;IACH,CAAC,QAAQ,MAAM,EAAC;IAEhB,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
|
@@ -3,6 +3,11 @@ type TokenBalance = {
|
|
|
3
3
|
sharesChain: string;
|
|
4
4
|
sizeAmountChain: string;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated The KUJI-to-RUJI merge window closed on 2026-04-05.
|
|
8
|
+
*
|
|
9
|
+
* Kept as an inert compatibility shim for the published package subpath.
|
|
10
|
+
*/
|
|
11
|
+
export declare const fetchMergeableTokenBalances: (_thorAddr: string) => Promise<TokenBalance[]>;
|
|
7
12
|
export {};
|
|
8
13
|
//# sourceMappingURL=fetchMergeableTokenBalances.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchMergeableTokenBalances.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/thorchain/ruji/services/fetchMergeableTokenBalances.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchMergeableTokenBalances.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/thorchain/ruji/services/fetchMergeableTokenBalances.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,EAAE,MAAM,CAAA;CACxB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,YAAY,EAAE,CAAO,CAAA"}
|
|
@@ -1,36 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
query ($id: ID!) {
|
|
8
|
-
node(id: $id) {
|
|
9
|
-
... on Account {
|
|
10
|
-
merge {
|
|
11
|
-
accounts {
|
|
12
|
-
shares
|
|
13
|
-
size { amount }
|
|
14
|
-
pool {
|
|
15
|
-
mergeAsset { metadata { symbol } }
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}}`,
|
|
21
|
-
variables: { id: btoa(`Account:${thorAddr}`) },
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
if (errors) {
|
|
25
|
-
throw new Error(`GraphQL errors: ${JSON.stringify(errors)}`);
|
|
26
|
-
}
|
|
27
|
-
const accounts = data?.node?.merge?.accounts ?? [];
|
|
28
|
-
return accounts.map(account => {
|
|
29
|
-
return {
|
|
30
|
-
symbol: account.pool.mergeAsset.metadata.symbol,
|
|
31
|
-
sharesChain: account.shares,
|
|
32
|
-
sizeAmountChain: account.size.amount,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated The KUJI-to-RUJI merge window closed on 2026-04-05.
|
|
3
|
+
*
|
|
4
|
+
* Kept as an inert compatibility shim for the published package subpath.
|
|
5
|
+
*/
|
|
6
|
+
export const fetchMergeableTokenBalances = async (_thorAddr) => [];
|
|
36
7
|
//# sourceMappingURL=fetchMergeableTokenBalances.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchMergeableTokenBalances.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/thorchain/ruji/services/fetchMergeableTokenBalances.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetchMergeableTokenBalances.js","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/chains/thorchain/ruji/services/fetchMergeableTokenBalances.ts"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAAE,SAAiB,EAA2B,EAAE,CAAC,EAAE,CAAA"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Chain } from '../../Chain.js';
|
|
2
|
-
export type EnforcedRouterProvider = '1inch' | 'kyber' | 'cowswap';
|
|
2
|
+
export type EnforcedRouterProvider = '1inch' | 'kyber' | 'cowswap' | 'li.fi';
|
|
3
3
|
/**
|
|
4
4
|
* Signing-path re-assert (sdk#1358): the same allow-list check as {@link assertKnownAggregatorRouter},
|
|
5
5
|
* but keyed off an arbitrary provider STRING (the value carried in KeysignSwapPayload.general.provider,
|
|
6
|
-
* which is a plain `string`).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* anything else is rejected outright (sdk#1457, see below).
|
|
6
|
+
* which is a plain `string`). Fixed-router providers fail closed against their allowlists, SwapKit
|
|
7
|
+
* fails closed against an independent Blockaid reputation verdict, and only the legacy `''`
|
|
8
|
+
* unattributed provider remains log-only. Anything else is rejected outright (sdk#1457, see below).
|
|
10
9
|
*
|
|
11
10
|
* WHY THIS EXISTS SEPARATELY FROM quote construction: a compromised initiator (or server composing the
|
|
12
11
|
* intent) can hand a co-signer a KeysignPayload whose swapPayload.quote.tx.to was NEVER run through the
|
|
@@ -23,23 +22,35 @@ export type EnforcedRouterProvider = '1inch' | 'kyber' | 'cowswap';
|
|
|
23
22
|
* enforcement) is a real, closable gap - not just a theoretical one.
|
|
24
23
|
*
|
|
25
24
|
* sdk#1457 FIX: two structural improvements that need no proto change. (1) CowSwap is now enforced -
|
|
26
|
-
* unlike
|
|
25
|
+
* unlike swapkit it settles through ONE fixed, deterministic contract (the GPv2VaultRelayer, see
|
|
27
26
|
* assertKnownAggregatorRouter), so its destination is exactly as allow-listable as 1inch/Kyber's; a
|
|
28
27
|
* payload can no longer relabel itself 'cowswap' to dodge a router check the way it previously could. (2)
|
|
29
28
|
* the log-only fallback is now a CLOSED list of the provider values the codebase legitimately produces
|
|
30
|
-
* (li.fi/swapkit, plus the legacy `''` unattributed provider) - a `provider` string outside every known
|
|
29
|
+
* (at that time li.fi/swapkit, plus the legacy `''` unattributed provider) - a `provider` string outside every known
|
|
31
30
|
* value (enforced or unenforced) is unrecognized and REJECTED, not silently passed through. Together
|
|
32
|
-
* these
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* per provider (tracked in sdk#1457, not attempted here: a schema change on the shared commondata proto
|
|
37
|
-
* is a cross-repo, cross-consumer change every native client (iOS/Android/Windows) also builds against).
|
|
31
|
+
* these originally shrank "relabel to escape enforcement" from "any string at all" to that closed set.
|
|
32
|
+
* sdk#1458 subsequently removes li.fi from the residual gap using its official Diamond deployments
|
|
33
|
+
* and applies an independent Blockaid reputation check to SwapKit destinations on both quote and
|
|
34
|
+
* co-signer paths. The legacy unattributed value remains the only log-only compatibility case.
|
|
38
35
|
*
|
|
39
36
|
* This guard remains MONOTONIC beyond that residual gap: it only ever THROWS (rejects) or no-ops - it
|
|
40
37
|
* never makes anything signable that wasn't already.
|
|
41
38
|
*/
|
|
42
39
|
export declare function assertKnownAggregatorRouterOnSigningPath(provider: string, address: string, chain: Chain): void;
|
|
40
|
+
/**
|
|
41
|
+
* Independent trust boundary for dynamic SwapKit EVM addresses. SwapKit's `tx.to`,
|
|
42
|
+
* `targetAddress`, and optional approval transaction all come from the same `/v3/swap`
|
|
43
|
+
* response, so equality between them cannot establish destination safety when that response
|
|
44
|
+
* is compromised.
|
|
45
|
+
*/
|
|
46
|
+
export declare function assertSwapKitAddressReputation(address: string, chain: Chain, role?: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* LI.FI documents `estimate.approvalAddress` as route-dependent and explicitly warns consumers
|
|
49
|
+
* not to hardcode it. The official Diamond is safe without a network dependency; a distinct
|
|
50
|
+
* spender is accepted only after an independent benign Blockaid verdict. This preserves valid
|
|
51
|
+
* inner-executor routes without trusting the quote response to authorize its own spender.
|
|
52
|
+
*/
|
|
53
|
+
export declare function assertLifiApprovalAddress(address: string, chain: Chain): Promise<void>;
|
|
43
54
|
/**
|
|
44
55
|
* Signing-path approval-spender bind (sdk#1358 review follow-up, requested by neavra). The
|
|
45
56
|
* follow-on to {@link assertKnownAggregatorRouterOnSigningPath}: that guard validates the swap-leg
|
|
@@ -49,12 +60,14 @@ export declare function assertKnownAggregatorRouterOnSigningPath(provider: strin
|
|
|
49
60
|
* genuine 1inch/kyber `tx.to` yet still carry an approve granting an ATTACKER an allowance over the
|
|
50
61
|
* user's token (a classic approval-drain the co-signer would otherwise sign blind).
|
|
51
62
|
*
|
|
52
|
-
* On the initiator
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
63
|
+
* On the initiator the fixed-spender providers coincide by construction. LI.FI and SwapKit can
|
|
64
|
+
* instead set an explicit `approvalAddress`, which is why their spender checks are separate.
|
|
65
|
+
* Approval-bound providers (1inch/kyber/cowswap) MUST have `spender === routerDestination`.
|
|
66
|
+
* LI.FI approval spenders can vary by route and are instead checked by
|
|
67
|
+
* {@link assertLifiApprovalAddress}; SwapKit spenders use its corresponding reputation guard.
|
|
68
|
+
* CowSwap's spender IS its `tx.to` (both are the fixed GPv2VaultRelayer - see
|
|
69
|
+
* getSwapDestinationAddress.ts), so it binds the same way 1inch/kyber do. Like its sibling this is
|
|
70
|
+
* a MONOTONIC gate: it only throws or no-ops, never changes the signed bytes.
|
|
58
71
|
*/
|
|
59
72
|
export declare function assertEnforcedSwapApprovalSpenderBound(provider: string, spender: string, routerDestination: string, chain: Chain): void;
|
|
60
73
|
/**
|
|
@@ -63,9 +76,14 @@ export declare function assertEnforcedSwapApprovalSpenderBound(provider: string,
|
|
|
63
76
|
*/
|
|
64
77
|
export declare function assertKnownAggregatorRouter(provider: EnforcedRouterProvider, address: string, chain: Chain): void;
|
|
65
78
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
79
|
+
* SwapKit v3 returns `targetAddress` independently from the ready-to-sign EVM
|
|
80
|
+
* transaction and defines it as the address the transaction must call or transfer to.
|
|
81
|
+
* Bind those fields before constructing a GeneralSwapQuote so a substituted `tx.to`
|
|
82
|
+
* cannot silently become the signed destination (or the approval fallback).
|
|
83
|
+
*/
|
|
84
|
+
export declare function assertSwapKitDestinationMatchesTarget(address: string, targetAddress: string | undefined, chain: Chain): void;
|
|
85
|
+
/**
|
|
86
|
+
* Log-only (never throws) — retained only for legacy unattributed signing payloads.
|
|
69
87
|
*/
|
|
70
88
|
export declare function logUnenforcedAggregatorDestination(provider: string, address: string): void;
|
|
71
89
|
//# sourceMappingURL=knownAggregatorRouters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"knownAggregatorRouters.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/swap/general/knownAggregatorRouters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"knownAggregatorRouters.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/swap/general/knownAggregatorRouters.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAY,MAAM,aAAa,CAAA;AA+F7C,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAA;AAuB5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,wCAAwC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAuB9G;AAsCD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,SAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjH;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sCAAsC,CACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,KAAK,GACX,IAAI,CASN;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CA4BjH;AAED;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,KAAK,EAAE,KAAK,GACX,IAAI,CAYN;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAK1F"}
|