@vultisig/core-chain 2.28.0 → 2.29.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/dist/chains/cosmos/cosmosGasLimitRecord.js +3 -3
  3. package/dist/chains/cosmos/cosmosGasLimitRecord.js.map +1 -1
  4. package/dist/chains/cosmos/gas.d.ts +28 -1
  5. package/dist/chains/cosmos/gas.d.ts.map +1 -1
  6. package/dist/chains/cosmos/gas.js +37 -5
  7. package/dist/chains/cosmos/gas.js.map +1 -1
  8. package/dist/chains/cosmos/resolveCosmosGasLimit.d.ts +82 -0
  9. package/dist/chains/cosmos/resolveCosmosGasLimit.d.ts.map +1 -0
  10. package/dist/chains/cosmos/resolveCosmosGasLimit.js +71 -0
  11. package/dist/chains/cosmos/resolveCosmosGasLimit.js.map +1 -0
  12. package/dist/chains/cosmos/terraClassicTax.d.ts +68 -0
  13. package/dist/chains/cosmos/terraClassicTax.d.ts.map +1 -1
  14. package/dist/chains/cosmos/terraClassicTax.js +85 -0
  15. package/dist/chains/cosmos/terraClassicTax.js.map +1 -1
  16. package/dist/chains/sui/client.d.ts +11 -2
  17. package/dist/chains/sui/client.d.ts.map +1 -1
  18. package/dist/chains/sui/client.js +5 -4
  19. package/dist/chains/sui/client.js.map +1 -1
  20. package/dist/chains/sui/config.d.ts +28 -0
  21. package/dist/chains/sui/config.d.ts.map +1 -1
  22. package/dist/chains/sui/config.js +27 -0
  23. package/dist/chains/sui/config.js.map +1 -1
  24. package/dist/chains/sui/listAllCoins.d.ts +44 -0
  25. package/dist/chains/sui/listAllCoins.d.ts.map +1 -0
  26. package/dist/chains/sui/listAllCoins.js +43 -0
  27. package/dist/chains/sui/listAllCoins.js.map +1 -0
  28. package/dist/chains/sui/transactionResult.d.ts +59 -0
  29. package/dist/chains/sui/transactionResult.d.ts.map +1 -0
  30. package/dist/chains/sui/transactionResult.js +43 -0
  31. package/dist/chains/sui/transactionResult.js.map +1 -0
  32. package/dist/coin/balance/resolvers/sui.d.ts.map +1 -1
  33. package/dist/coin/balance/resolvers/sui.js +6 -3
  34. package/dist/coin/balance/resolvers/sui.js.map +1 -1
  35. package/dist/coin/token/metadata/resolvers/sui.d.ts +1 -1
  36. package/dist/coin/token/metadata/resolvers/sui.d.ts.map +1 -1
  37. package/dist/coin/token/metadata/resolvers/sui.js +6 -3
  38. package/dist/coin/token/metadata/resolvers/sui.js.map +1 -1
  39. package/dist/swap/general/jupiter/api/getJupiterSwapQuote.d.ts.map +1 -1
  40. package/dist/swap/general/jupiter/api/getJupiterSwapQuote.js +2 -1
  41. package/dist/swap/general/jupiter/api/getJupiterSwapQuote.js.map +1 -1
  42. package/dist/swap/native/limitSwapMemo.d.ts +35 -5
  43. package/dist/swap/native/limitSwapMemo.d.ts.map +1 -1
  44. package/dist/swap/native/limitSwapMemo.js +32 -7
  45. package/dist/swap/native/limitSwapMemo.js.map +1 -1
  46. package/dist/tx/broadcast/resolvers/sui.d.ts +2 -8
  47. package/dist/tx/broadcast/resolvers/sui.d.ts.map +1 -1
  48. package/dist/tx/broadcast/resolvers/sui.js +18 -17
  49. package/dist/tx/broadcast/resolvers/sui.js.map +1 -1
  50. package/dist/tx/broadcast/transientRetry.d.ts.map +1 -1
  51. package/dist/tx/broadcast/transientRetry.js +30 -2
  52. package/dist/tx/broadcast/transientRetry.js.map +1 -1
  53. package/dist/tx/hash/resolvers/sui.d.ts.map +1 -1
  54. package/dist/tx/hash/resolvers/sui.js +13 -3
  55. package/dist/tx/hash/resolvers/sui.js.map +1 -1
  56. package/dist/tx/status/resolvers/sui.d.ts.map +1 -1
  57. package/dist/tx/status/resolvers/sui.js +15 -6
  58. package/dist/tx/status/resolvers/sui.js.map +1 -1
  59. package/package.json +17 -7
  60. package/dist/chains/cosmos/resolveCosmosGasFee.d.ts +0 -49
  61. package/dist/chains/cosmos/resolveCosmosGasFee.d.ts.map +0 -1
  62. package/dist/chains/cosmos/resolveCosmosGasFee.js +0 -35
  63. package/dist/chains/cosmos/resolveCosmosGasFee.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,116 @@
1
1
  # @vultisig/core-chain
2
2
 
3
+ ## 2.29.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1475](https://github.com/vultisig/vultisig-sdk/pull/1475) [`4b14790`](https://github.com/vultisig/vultisig-sdk/commit/4b14790fb5f0fa5b9a58f6fe5575ad4c2bab3867) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Expose canonical Cosmos native-send fee metadata so first-party consumers can stop maintaining local tables: IBC chains use their shared/default floors, MayaChain exposes its fixed fee, and THORChain remains explicitly unresolved because its fee comes from live network data.
8
+
9
+ - [#1614](https://github.com/vultisig/vultisig-sdk/pull/1614) [`bb5b62c`](https://github.com/vultisig/vultisig-sdk/commit/bb5b62c60ca298d0aa98614e8c2b01eeef0d8bdb) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - Let joining devices review a THORChain limit order instead of approving it as a generic send.
10
+
11
+ The limit-order builder attaches a swap payload only for ERC20 sources, so RUNE and native-gas-asset orders reached a co-signer as a transfer to an opaque address with an opaque memo — no buy asset, payout destination, or minimum received.
12
+
13
+ `getKeysignLimitSwapOrder` decodes those terms from `keysignPayload.memo`, which is present on every source branch. Reading the memo also makes the review trustworthy rather than merely present: the memo is the exact string THORChain executes, so terms derived from it cannot disagree with what gets signed, whereas a display field supplied by the initiating device can.
14
+
15
+ `parseLimitSwapMemo` is the underlying decoder, and `assertLimitSwapMemo` now delegates to it so the grammar has one implementation.
16
+
17
+ `buildLimitSwapKeysignPayload` now derives the ERC20 branch's `toAmountDecimal` from the memo's LIM rather than from the caller's `expectedToAmount`. That argument is now an optional cross-check: supplying a value that disagrees with the memo throws, which catches a caller that rescaled the LIM into the target coin's own decimals — a mistake that signs a correct order while showing a co-signer a wrong figure.
18
+
19
+ - [#1583](https://github.com/vultisig/vultisig-sdk/pull/1583) [`028b3ce`](https://github.com/vultisig/vultisig-sdk/commit/028b3cec5e56e5ab41de5eeb66f6837af9e1dd27) Thanks [@Toby1009](https://github.com/Toby1009)! - Move every Sui read, simulation and broadcast off JSON-RPC.
20
+
21
+ Sui is retiring JSON-RPC: shutdown on Foundation mainnet full nodes began the
22
+ week of 2026-07-27 and full decommission (code removal) lands mid-October 2026,
23
+ after which no provider can serve it. This is a scheduled migration ahead of
24
+ that date, NOT a fix for a live outage — as of 2026-07-27 both
25
+ `sui-rpc.publicnode.com` and `fullnode.mainnet.sui.io` still answer JSON-RPC.
26
+
27
+ - `getSuiClient()` now returns a `SuiGrpcClient` pointed at
28
+ `https://fullnode.mainnet.sui.io:443` (gRPC-web over HTTPS).
29
+ - React Native uses `SuiGraphQLClient` against
30
+ `https://graphql.mainnet.sui.io/graphql` instead: grpc-web needs
31
+ `Response.body` streaming, which Hermes' fetch does not provide. Both clients
32
+ implement the same unified transport interface, so callsites are identical.
33
+ - Balance, coin metadata, coin listing, tx hash, tx status, broadcast and
34
+ keysign gas refinement moved to `getBalance` / `getCoinMetadata` / `listCoins`
35
+ / `simulateTransaction` / `getTransaction` / `executeTransaction`.
36
+ - The dependency-free `@vultisig/sdk` balance tools (`getSuiBalance`,
37
+ `getSuiTokenBalance`, `getSuiAllBalances`) now POST Sui GraphQL and follow the
38
+ paginated `balances` connection to completion, returning `tokens_unavailable`
39
+ rather than a silently truncated portfolio.
40
+
41
+ Broadcast-error classification follows the transport. A gRPC failure carries the
42
+ grpc-status NAME in `code` (not a JSON-RPC number) and a percent-encoded message,
43
+ so both classifiers were re-pointed:
44
+
45
+ - `isTransientBroadcastError` retries `UNAVAILABLE` / `DEADLINE_EXCEEDED` /
46
+ `RESOURCE_EXHAUSTED` and decodes the message before pattern-matching. A
47
+ grpc-web response is HTTP 200 with the real status in the trailer, so the
48
+ existing 5xx branch never saw a busy or restarting node.
49
+ - The CLI's permanent-vs-retryable gate matches `INVALID_ARGUMENT` instead of
50
+ the numeric `-32002`. Left unchanged, that gate would have gone dead and every
51
+ permanent Sui rejection would have been re-broadcast as if transient.
52
+
53
+ Breaking for direct consumers: `assertSuiTxSucceeded` now takes the unified
54
+ client's transaction result (`{ $kind, Transaction | FailedTransaction }`)
55
+ instead of a JSON-RPC effects object.
56
+
57
+ ### Patch Changes
58
+
59
+ - [#1555](https://github.com/vultisig/vultisig-sdk/pull/1555) [`70f4583`](https://github.com/vultisig/vultisig-sdk/commit/70f4583a359f988460633b44046bf5811c9c0f74) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - fix(cosmos): sign `CosmosSpecific.gas` verbatim so co-signing matches iOS/Android
60
+
61
+ `CosmosSpecific.gas` (proto field 3) is the fee AMOUNT — commondata#93 documents
62
+ it as such and every other client signs it verbatim. The signing-inputs and
63
+ fee-display resolvers were instead re-deriving it as
64
+ `ceil(gas × relayedGasLimit / staticGasLimit)`, and doubling it for IBC
65
+ transfers. That silently redefined a shared wire field in one client: on a
66
+ TerraClassic LUNC send with a simulated gas limit of 321,979 the extension
67
+ signed a 21.465267 LUNC fee while the iOS co-signer signed the payload's
68
+ 20 LUNC, the SignDocs diverged, and the MPC keysign never completed.
69
+
70
+ Both read paths now use `gas` as-is and only resolve the gas LIMIT from field 7.
71
+ Fee headroom moved to the initiator, which prices `gas` against the limit it
72
+ relays — matching iOS `CosmosGasPricedFee.scaled` and Android
73
+ `TerraClassicTax.baseGas`. The COSMOS-02 IBC source-leg headroom is preserved by
74
+ relaying the widened limit in `gas_limit` instead of applying a multiplier that
75
+ no other client can reproduce.
76
+
77
+ `resolveCosmosGasFee` is replaced by `resolveCosmosGasLimit` (limit resolution)
78
+ and `scaleCosmosFeeAmount` (initiator-only pricing).
79
+
80
+ - [#1582](https://github.com/vultisig/vultisig-sdk/pull/1582) [`d7fd8fd`](https://github.com/vultisig/vultisig-sdk/commit/d7fd8fd891d2bb9f007b3feff5b31cc961bae497) Thanks [@rcoderdev](https://github.com/rcoderdev)! - Apply the Jupiter affiliate fee by deriving and prepending its ATA, while
81
+ normalizing zero-fee quotes before unsigned transaction construction.
82
+
83
+ - [#1555](https://github.com/vultisig/vultisig-sdk/pull/1555) [`70f4583`](https://github.com/vultisig/vultisig-sdk/commit/70f4583a359f988460633b44046bf5811c9c0f74) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - fix(terraclassic): price the LUNC fee from the chain's gas price and add the burn tax explicitly
84
+
85
+ `cosmosGasRecord[TerraClassic]` was a hand-tuned flat 20 LUNC (itself already
86
+ lowered from 100 LUNC). Terra Classic's actual `uluna` gas price is 28.325
87
+ uluna/gas, so a send at the static 300k limit costs 8,497,500 uluna — the flat
88
+ constant overcharged every send by ~2.35× before any gas-limit scaling.
89
+
90
+ It was also implicitly absorbing the `x/tax` burn tax (0.5% of the transfer),
91
+ which scales with the amount while a flat constant does not. So it overcharged
92
+ small sends and under-covered anything above ~2,300 LUNC, where 0.5% outgrows
93
+ the slack.
94
+
95
+ Both halves are now explicit:
96
+
97
+ - `cosmosGasRecord[TerraClassic]` = `8_497_500n` (`300_000 × 28.325`), matching
98
+ iOS `TerraClassicTax.ulunaBaseGas` and Android `ULUNA_BASE_GAS`. It still
99
+ scales with a relayed `gas_limit`.
100
+ - The initiator adds `applyTerraClassicBurnTax(amount, rate)` to `gas` for
101
+ native LUNC sends, after the gas scaling — the tax tracks the transfer
102
+ amount, not the gas limit.
103
+
104
+ Adds `getTerraClassicBurnTaxRate`, which reads `x/tax` `burn_tax_rate` (live
105
+ 0.5%) and fails closed to 0.5% on any LCD error. This is a different tax from
106
+ the existing `x/treasury` `tax_rate`, which governance has held at 0 since the
107
+ UST collapse and which exempts `uluna` — reading it for a LUNC send always
108
+ returned 0. `applyTerraClassicBurnTax` is separate from `applyTerraClassicTax`
109
+ for the same reason: the burn tax exempts nothing and is uncapped.
110
+
111
+ A 300 LUNC send at a simulated 321,979 gas limit now costs 10.620056 LUNC
112
+ (9.120056 gas + 1.5 tax) instead of 21.465267.
113
+
3
114
  ## 2.28.0
4
115
 
5
116
  ### Minor Changes
@@ -38,8 +38,8 @@ export const getCosmosGasLimit = (coin) => {
38
38
  * That fee is supplied by the CONSUMER's separate per-msg staking fee
39
39
  * (mcp-ts COSMOS_STAKING_FEE_PER_MSG_BASE_UNITS[TerraClassic] = 100 LUNC/msg,
40
40
  * written into the signAmino / signDirect fee) — NOT by
41
- * `cosmosGasRecord[TerraClassic]`, which is the native MsgSend fee floor
42
- * (20 LUNC) and never governs staking. The msgCount scaling is disabled for
41
+ * `cosmosGasRecord[TerraClassic]`, which is the native MsgSend gas fee
42
+ * (8.4975 LUNC = 300k × 28.325) and never governs staking. The msgCount scaling is disabled for
43
43
  * TerraClassic: at msgCount>=2, scaled gasWanted would push the required fee
44
44
  * above the 100 LUNC per-msg staking fee, causing node rejection. Columbus-5
45
45
  * callers must split multi-validator claims into separate txs.
@@ -72,7 +72,7 @@ export const getCosmosStakingGasLimit = ({ chain, msgCount = 1 }) => {
72
72
  // TerraClassic: staking-fee cap (see comment on cosmosStakingGasLimitRecord).
73
73
  // Scaling would push the required fee above the consumer's 100 LUNC per-msg
74
74
  // staking fee at msgCount>=2; single-msg policy keeps the tx within that fee
75
- // for columbus-5 (independent of the 20 LUNC cosmosGasRecord send floor).
75
+ // for columbus-5 (independent of the cosmosGasRecord native-send gas fee).
76
76
  if (chain === Chain.TerraClassic)
77
77
  return base;
78
78
  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,I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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,8EAA8E;IAC9E,4EAA4E;IAC5E,6EAA6E;IAC7E,0EAA0E;IAC1E,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"}
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,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,QAAQ,CAAC,CAAC,CAAA;IACvC,OAAO,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AACtC,CAAC,CAAA"}
@@ -1,8 +1,35 @@
1
- import { IbcEnabledCosmosChain } from '../../Chain.js';
1
+ import { CosmosChain, IbcEnabledCosmosChain } from '../../Chain.js';
2
2
  import type { CoinKey } from '../../coin/Coin.js';
3
3
  import { type ParsedDecimal } from './cosmosDecimal.js';
4
4
  export { getFeeAmountFromGasPrice } from './cosmosDecimal.js';
5
+ /** Canonical signable send-fee floor for IBC-enabled Cosmos chains without a chain-specific override. */
6
+ export declare const COSMOS_SEND_FEE_DEFAULT = 7500n;
7
+ /** Canonical fixed MayaChain native-send fee in CACAO base units. */
8
+ export declare const MAYA_SEND_FEE_BASE_UNITS = 2000000000n;
9
+ /**
10
+ * Terra Classic's `uluna` fee at the static 300k gas limit:
11
+ * `300_000 × 28.325 uluna/gas`. 28.325 is the chain's own minimum gas price,
12
+ * live-verifiable at `/terra/tax/v1beta1/params` (`gas_prices[uluna]`), and
13
+ * real columbus-5 sends pay exactly `gas_wanted × 28.325`.
14
+ *
15
+ * This is a derived price, NOT a hand-tuned floor. It previously sat at
16
+ * 20_000_000 (20 LUNC) — 2.35× the chain's requirement — which overcharged
17
+ * every send while ALSO under-covering large ones, because the burn tax it
18
+ * was implicitly absorbing scales with the transfer amount and this constant
19
+ * does not. The burn tax is now added explicitly by the initiator (see
20
+ * `applyTerraClassicBurnTax`), so this is purely the gas component.
21
+ *
22
+ * Matches iOS `TerraClassicTax.ulunaBaseGas` and Android
23
+ * `TerraClassicTax.ULUNA_BASE_GAS`.
24
+ */
25
+ export declare const TERRA_CLASSIC_ULUNA_BASE_GAS = 8497500n;
5
26
  export declare const cosmosGasRecord: Record<IbcEnabledCosmosChain, bigint>;
27
+ /**
28
+ * Returns the canonical static native-send fee in base units.
29
+ * THORChain returns `undefined` because its fee must be read from live
30
+ * `native_tx_fee_rune` network data rather than a static fallback.
31
+ */
32
+ export declare const getCosmosSendFeeBaseUnits: (chain: CosmosChain) => bigint | undefined;
6
33
  type FetchOpts = {
7
34
  fetchImpl?: typeof fetch;
8
35
  signal?: AbortSignal;
@@ -1 +1 @@
1
- {"version":3,"file":"gas.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/gas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAC1D,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;AAI1D,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CASjE,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,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"}
@@ -5,17 +5,49 @@ import { getCosmosGasLimit } from './cosmosGasLimitRecord.js';
5
5
  import { getCosmosRpcUrl } from './getCosmosRpcUrl.js';
6
6
  import { getOsmosisDynamicFeeFloor } from './osmosisDynamicFee.js';
7
7
  export { getFeeAmountFromGasPrice } from './cosmosDecimal.js';
8
- const defaultGas = 7500n;
8
+ /** Canonical signable send-fee floor for IBC-enabled Cosmos chains without a chain-specific override. */
9
+ export const COSMOS_SEND_FEE_DEFAULT = 7500n;
10
+ /** Canonical fixed MayaChain native-send fee in CACAO base units. */
11
+ export const MAYA_SEND_FEE_BASE_UNITS = 2000000000n;
12
+ /**
13
+ * Terra Classic's `uluna` fee at the static 300k gas limit:
14
+ * `300_000 × 28.325 uluna/gas`. 28.325 is the chain's own minimum gas price,
15
+ * live-verifiable at `/terra/tax/v1beta1/params` (`gas_prices[uluna]`), and
16
+ * real columbus-5 sends pay exactly `gas_wanted × 28.325`.
17
+ *
18
+ * This is a derived price, NOT a hand-tuned floor. It previously sat at
19
+ * 20_000_000 (20 LUNC) — 2.35× the chain's requirement — which overcharged
20
+ * every send while ALSO under-covering large ones, because the burn tax it
21
+ * was implicitly absorbing scales with the transfer amount and this constant
22
+ * does not. The burn tax is now added explicitly by the initiator (see
23
+ * `applyTerraClassicBurnTax`), so this is purely the gas component.
24
+ *
25
+ * Matches iOS `TerraClassicTax.ulunaBaseGas` and Android
26
+ * `TerraClassicTax.ULUNA_BASE_GAS`.
27
+ */
28
+ export const TERRA_CLASSIC_ULUNA_BASE_GAS = 8497500n;
9
29
  export const cosmosGasRecord = {
10
- [Chain.Cosmos]: defaultGas,
30
+ [Chain.Cosmos]: COSMOS_SEND_FEE_DEFAULT,
11
31
  [Chain.Osmosis]: 9000n,
12
- [Chain.Kujira]: defaultGas,
13
- [Chain.Terra]: defaultGas,
32
+ [Chain.Kujira]: COSMOS_SEND_FEE_DEFAULT,
33
+ [Chain.Terra]: COSMOS_SEND_FEE_DEFAULT,
14
34
  [Chain.Dydx]: 2500000000000000n,
15
- [Chain.TerraClassic]: 20000000n,
35
+ [Chain.TerraClassic]: TERRA_CLASSIC_ULUNA_BASE_GAS,
16
36
  [Chain.Noble]: 30000n,
17
37
  [Chain.Akash]: 200000n,
18
38
  };
39
+ /**
40
+ * Returns the canonical static native-send fee in base units.
41
+ * THORChain returns `undefined` because its fee must be read from live
42
+ * `native_tx_fee_rune` network data rather than a static fallback.
43
+ */
44
+ export const getCosmosSendFeeBaseUnits = (chain) => {
45
+ if (chain === Chain.THORChain)
46
+ return undefined;
47
+ if (chain === Chain.MayaChain)
48
+ return MAYA_SEND_FEE_BASE_UNITS;
49
+ return cosmosGasRecord[chain];
50
+ };
19
51
  const minGasPriceConfigPath = '/cosmos/base/node/v1beta1/config';
20
52
  const minGasPriceFetchTimeoutMs = 3_000;
21
53
  const maxLiveFeeMultiplier = 10n;
@@ -1 +1 @@
1
- {"version":3,"file":"gas.js","sourceRoot":"","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2
+ * Cosmos gas-limit resolution, and the initiator-side helper that prices a fee
3
+ * amount against a chosen limit.
4
+ *
5
+ * WIRE CONTRACT (commondata `CosmosSpecific`, vultisig/commondata#93):
6
+ * - field 3 `gas` — the fee AMOUNT. Signed VERBATIM by every co-signer.
7
+ * - field 7 `gas_limit` — the per-tx gas limit. When unset, peers fall back
8
+ * to the static per-chain limit.
9
+ *
10
+ * Both fields are part of the SignDoc, so every co-signing device MUST derive
11
+ * them identically or the MPC signature fails. The only way to guarantee that
12
+ * across independent implementations is for the read side to do NO arithmetic:
13
+ * whatever the initiator wrote is what gets signed. iOS (`TerraHelperStruct` /
14
+ * `CosmosHelperStruct.defaultFee`), Android (`TerraHelper`) and this SDK's own
15
+ * QBTC builder (`QBTCHelper`) all follow that rule.
16
+ *
17
+ * A previous version of this module rescaled `gas` on the READ side by
18
+ * `relayedGasLimit / staticGasLimit`. That silently redefined field 3 in one
19
+ * client: on a TerraClassic send the extension signed a fee of 21.465267 LUNC
20
+ * while iOS signed the payload's 20 LUNC, the two SignDocs diverged, and the
21
+ * keysign never completed. Any fee headroom must therefore be applied by the
22
+ * INITIATOR (see `scaleCosmosFeeAmount`) before it is written to `gas`.
23
+ */
24
+ /**
25
+ * COSMOS-02: an IBC transfer (ICS-20 `MsgTransfer`, optionally PFM-forwarded
26
+ * via memo) does measurably more work on the source leg than a plain bank
27
+ * send — channel-state writes plus a relayer event — so the flat per-chain
28
+ * limit (calibrated for `MsgSend`) is undersized and can run out of gas
29
+ * mid-execution: the fee is spent, the transfer fails, and funds don't move
30
+ * but the fee is still burned. PFM hops are budgeted by each forwarding
31
+ * chain, not the source leg here, so ×2 headroom on the source leg is
32
+ * sufficient.
33
+ *
34
+ * Applied by the initiator, which relays the widened limit in `gas_limit` and
35
+ * prices `gas` for it — never by the read side, which has no proto field to
36
+ * carry a multiplier and so could not stay in lockstep with iOS / Android.
37
+ */
38
+ export declare const IBC_GAS_MULTIPLIER = 2n;
39
+ type ResolveCosmosGasLimitInput = {
40
+ /** relayed `CosmosSpecific.gas_limit` (undefined / 0 → use the static limit) */
41
+ relayedGasLimit: bigint | undefined;
42
+ /** static per-chain gas limit (`getCosmosGasLimit`) */
43
+ staticGasLimit: bigint;
44
+ };
45
+ /**
46
+ * The gas limit to sign: the relayed per-tx limit when an initiator set one,
47
+ * else the static per-chain limit.
48
+ *
49
+ * `0n` is treated as unset. Proto field 7 is `optional uint64`, but a producer
50
+ * can still relay a nonsensical 0, and signing `gas_wanted = 0` would be
51
+ * rejected on-chain. Mirrors iOS `relayedGasLimit ?? config.gasLimit` and the
52
+ * same guard in `buildQBTCAuthInfo`.
53
+ */
54
+ export declare const resolveCosmosGasLimit: ({ relayedGasLimit, staticGasLimit }: ResolveCosmosGasLimitInput) => bigint;
55
+ type ScaleCosmosFeeAmountInput = {
56
+ /** fee amount priced at `fromGasLimit` */
57
+ feeAmount: bigint;
58
+ /** the gas limit `feeAmount` was calibrated for (the static per-chain limit) */
59
+ fromGasLimit: bigint;
60
+ /** the gas limit that will actually be signed */
61
+ toGasLimit: bigint;
62
+ };
63
+ /**
64
+ * `ceil(feeAmount × toGasLimit / fromGasLimit)` in exact integer arithmetic.
65
+ *
66
+ * INITIATOR-ONLY. Chains that price their fee per unit of gas (Terra Classic,
67
+ * dYdX) set the static amount to exactly `staticGasLimit × minGasPrice`, so a
68
+ * widened gas limit needs a proportionally widened fee or the ante handler
69
+ * rejects the tx with "insufficient fee". Scaling the known-good static amount
70
+ * by the limit ratio yields `ceil(toGasLimit × minGasPrice)` without hardcoding
71
+ * each chain's price — the price is implicit in the static amount.
72
+ *
73
+ * Runs once, on the device that builds the payload; the result is written to
74
+ * `CosmosSpecific.gas` and every co-signer reads it verbatim. Mirrors iOS
75
+ * `CosmosGasPricedFee.scaled` and Android `TerraClassicTax.baseGas`.
76
+ *
77
+ * Returns `feeAmount` unchanged when the limit is unchanged or `fromGasLimit`
78
+ * is 0, so the non-dynamic path stays byte-identical.
79
+ */
80
+ export declare const scaleCosmosFeeAmount: ({ feeAmount, fromGasLimit, toGasLimit }: ScaleCosmosFeeAmountInput) => bigint;
81
+ export {};
82
+ //# sourceMappingURL=resolveCosmosGasLimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveCosmosGasLimit.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasLimit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC,KAAK,0BAA0B,GAAG;IAChC,gFAAgF;IAChF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,qCAAqC,0BAA0B,KAAG,MAC5B,CAAA;AAE5E,KAAK,yBAAyB,GAAG;IAC/B,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAA;IACjB,gFAAgF;IAChF,YAAY,EAAE,MAAM,CAAA;IACpB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB,GAAI,yCAAyC,yBAAyB,KAAG,MAIzG,CAAA"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Cosmos gas-limit resolution, and the initiator-side helper that prices a fee
3
+ * amount against a chosen limit.
4
+ *
5
+ * WIRE CONTRACT (commondata `CosmosSpecific`, vultisig/commondata#93):
6
+ * - field 3 `gas` — the fee AMOUNT. Signed VERBATIM by every co-signer.
7
+ * - field 7 `gas_limit` — the per-tx gas limit. When unset, peers fall back
8
+ * to the static per-chain limit.
9
+ *
10
+ * Both fields are part of the SignDoc, so every co-signing device MUST derive
11
+ * them identically or the MPC signature fails. The only way to guarantee that
12
+ * across independent implementations is for the read side to do NO arithmetic:
13
+ * whatever the initiator wrote is what gets signed. iOS (`TerraHelperStruct` /
14
+ * `CosmosHelperStruct.defaultFee`), Android (`TerraHelper`) and this SDK's own
15
+ * QBTC builder (`QBTCHelper`) all follow that rule.
16
+ *
17
+ * A previous version of this module rescaled `gas` on the READ side by
18
+ * `relayedGasLimit / staticGasLimit`. That silently redefined field 3 in one
19
+ * client: on a TerraClassic send the extension signed a fee of 21.465267 LUNC
20
+ * while iOS signed the payload's 20 LUNC, the two SignDocs diverged, and the
21
+ * keysign never completed. Any fee headroom must therefore be applied by the
22
+ * INITIATOR (see `scaleCosmosFeeAmount`) before it is written to `gas`.
23
+ */
24
+ /**
25
+ * COSMOS-02: an IBC transfer (ICS-20 `MsgTransfer`, optionally PFM-forwarded
26
+ * via memo) does measurably more work on the source leg than a plain bank
27
+ * send — channel-state writes plus a relayer event — so the flat per-chain
28
+ * limit (calibrated for `MsgSend`) is undersized and can run out of gas
29
+ * mid-execution: the fee is spent, the transfer fails, and funds don't move
30
+ * but the fee is still burned. PFM hops are budgeted by each forwarding
31
+ * chain, not the source leg here, so ×2 headroom on the source leg is
32
+ * sufficient.
33
+ *
34
+ * Applied by the initiator, which relays the widened limit in `gas_limit` and
35
+ * prices `gas` for it — never by the read side, which has no proto field to
36
+ * carry a multiplier and so could not stay in lockstep with iOS / Android.
37
+ */
38
+ export const IBC_GAS_MULTIPLIER = 2n;
39
+ /**
40
+ * The gas limit to sign: the relayed per-tx limit when an initiator set one,
41
+ * else the static per-chain limit.
42
+ *
43
+ * `0n` is treated as unset. Proto field 7 is `optional uint64`, but a producer
44
+ * can still relay a nonsensical 0, and signing `gas_wanted = 0` would be
45
+ * rejected on-chain. Mirrors iOS `relayedGasLimit ?? config.gasLimit` and the
46
+ * same guard in `buildQBTCAuthInfo`.
47
+ */
48
+ export const resolveCosmosGasLimit = ({ relayedGasLimit, staticGasLimit }) => relayedGasLimit && relayedGasLimit > 0n ? relayedGasLimit : staticGasLimit;
49
+ /**
50
+ * `ceil(feeAmount × toGasLimit / fromGasLimit)` in exact integer arithmetic.
51
+ *
52
+ * INITIATOR-ONLY. Chains that price their fee per unit of gas (Terra Classic,
53
+ * dYdX) set the static amount to exactly `staticGasLimit × minGasPrice`, so a
54
+ * widened gas limit needs a proportionally widened fee or the ante handler
55
+ * rejects the tx with "insufficient fee". Scaling the known-good static amount
56
+ * by the limit ratio yields `ceil(toGasLimit × minGasPrice)` without hardcoding
57
+ * each chain's price — the price is implicit in the static amount.
58
+ *
59
+ * Runs once, on the device that builds the payload; the result is written to
60
+ * `CosmosSpecific.gas` and every co-signer reads it verbatim. Mirrors iOS
61
+ * `CosmosGasPricedFee.scaled` and Android `TerraClassicTax.baseGas`.
62
+ *
63
+ * Returns `feeAmount` unchanged when the limit is unchanged or `fromGasLimit`
64
+ * is 0, so the non-dynamic path stays byte-identical.
65
+ */
66
+ export const scaleCosmosFeeAmount = ({ feeAmount, fromGasLimit, toGasLimit }) => {
67
+ if (fromGasLimit <= 0n || toGasLimit === fromGasLimit)
68
+ return feeAmount;
69
+ return (feeAmount * toGasLimit + fromGasLimit - 1n) / fromGasLimit;
70
+ };
71
+ //# sourceMappingURL=resolveCosmosGasLimit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveCosmosGasLimit.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasLimit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AASpC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,eAAe,EAAE,cAAc,EAA8B,EAAU,EAAE,CAC/G,eAAe,IAAI,eAAe,GAAG,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAA;AAW5E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAA6B,EAAU,EAAE;IACjH,IAAI,YAAY,IAAI,EAAE,IAAI,UAAU,KAAK,YAAY;QAAE,OAAO,SAAS,CAAA;IAEvE,OAAO,CAAC,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,EAAE,CAAC,GAAG,YAAY,CAAA;AACpE,CAAC,CAAA"}
@@ -34,6 +34,23 @@
34
34
  * Reference: terra-money/classic-core, x/treasury REST routes.
35
35
  */
36
36
  export declare const getTerraClassicTaxRateUrl: () => string;
37
+ /**
38
+ * The `x/tax` module params, which carry `burn_tax_rate` — a DIFFERENT tax
39
+ * from the `x/treasury` `tax_rate` above, and the one that is actually live.
40
+ *
41
+ * | module | field | live value | exempts uluna? |
42
+ * |--------------|-----------------|------------|----------------|
43
+ * | `x/treasury` | `tax_rate` | 0 | yes |
44
+ * | `x/tax` | `burn_tax_rate` | 0.005 | NO |
45
+ *
46
+ * The treasury stability tax has been paused by governance since the UST
47
+ * collapse; the burn tax replaced it and applies to `uluna` transfers too —
48
+ * burning LUNC is its entire purpose. Reading the treasury endpoint for a
49
+ * LUNC send therefore always yields 0 and undercharges the fee.
50
+ *
51
+ * Same endpoint iOS (`CosmosAPI.terraClassicTaxParams`) and Android read.
52
+ */
53
+ export declare const getTerraClassicBurnTaxParamsUrl: () => string;
37
54
  export declare const getTerraClassicTaxCapsUrl: (denom: string) => string;
38
55
  /**
39
56
  * cosmos-sdk `Dec` is fixed-point with 18 decimals — the on-the-wire
@@ -42,6 +59,24 @@ export declare const getTerraClassicTaxCapsUrl: (denom: string) => string;
42
59
  * tax in base units of the same denom.
43
60
  */
44
61
  export declare const TERRA_CLASSIC_TAX_DEC_SCALE: bigint;
62
+ /**
63
+ * Conservative fallback burn-tax rate (0.5%) used when the live `x/tax`
64
+ * params can't be fetched or parsed. Failing CLOSED (taxing) rather than open
65
+ * (0%) avoids signing a tx the chain then rejects at broadcast — an overpaid
66
+ * fee is recoverable, a rejected transfer wastes the gas and moves nothing.
67
+ *
68
+ * Mirrors iOS / Android `TerraClassicTax.fallbackBurnTaxRate`.
69
+ */
70
+ export declare const TERRA_CLASSIC_FALLBACK_BURN_TAX_RATE = 5000000000000000n;
71
+ /**
72
+ * Sanity ceiling (10%) for a parsed burn-tax rate. The rate is
73
+ * governance-controlled and has historically been ≤ 1.2%, so anything above
74
+ * this is treated as garbage — a malformed `"5"` meaning 500% would otherwise
75
+ * be applied literally and drain the account into the fee. Keeps the fail-safe
76
+ * symmetric with the lower bound, so a bad endpoint can neither under- nor
77
+ * massively over-charge. Mirrors iOS / Android `maxBurnTaxRate`.
78
+ */
79
+ export declare const TERRA_CLASSIC_MAX_BURN_TAX_RATE = 100000000000000000n;
45
80
  type FetchOpts = {
46
81
  fetchImpl?: typeof fetch;
47
82
  signal?: AbortSignal;
@@ -55,6 +90,39 @@ type FetchOpts = {
55
90
  * un-pauses the tax (causing post-sign "insufficient fee" rejections).
56
91
  */
57
92
  export declare function getTerraClassicTaxRate(opts?: FetchOpts): Promise<bigint>;
93
+ /**
94
+ * Parses an `x/tax` `burn_tax_rate` Dec string into an 18-decimal fixed-point
95
+ * bigint, falling back to {@link TERRA_CLASSIC_FALLBACK_BURN_TAX_RATE} on a
96
+ * missing, malformed, negative, or implausibly large value.
97
+ *
98
+ * Never throws. Unlike the treasury `tax_rate` — where a missing field means
99
+ * "the LCD is broken, refuse to guess" — a missing burn rate has a known-safe
100
+ * answer (the current governance rate), and the initiator is the only device
101
+ * that computes this. Mirrors iOS / Android `TerraClassicTax.parseRate`.
102
+ */
103
+ export declare const parseTerraClassicBurnTaxRate: (raw: string | null | undefined) => bigint;
104
+ /**
105
+ * Fetches the live `x/tax` burn-tax rate as an 18-decimal fixed-point bigint
106
+ * (`5_000_000_000_000_000n` for the current 0.5%).
107
+ *
108
+ * Fails closed to {@link TERRA_CLASSIC_FALLBACK_BURN_TAX_RATE} on any LCD
109
+ * error, so a network blip produces a slightly overpaid fee rather than a tx
110
+ * the ante handler rejects.
111
+ */
112
+ export declare function getTerraClassicBurnTaxRate(opts?: FetchOpts): Promise<bigint>;
113
+ /**
114
+ * Burn tax on a `amount` of the send denom, at an 18-decimal fixed-point
115
+ * `rate`, rounded UP so the signed fee never lands a base unit below the
116
+ * chain's check.
117
+ *
118
+ * Deliberately NOT {@link applyTerraClassicTax}: that models the treasury
119
+ * stability tax, which exempts `uluna` and applies per-denom caps. The burn
120
+ * tax exempts nothing and is uncapped — feeding a LUNC send through the
121
+ * treasury helper silently returns `0n`.
122
+ *
123
+ * Mirrors iOS / Android `TerraClassicTax.burnTax` (both round up).
124
+ */
125
+ export declare const applyTerraClassicBurnTax: (amount: bigint, rate: bigint) => bigint;
58
126
  /**
59
127
  * Fetches the per-denom tax cap as a base-unit bigint (e.g.
60
128
  * `60_000_000_000_000_000n` for `uluna`). The cap is the maximum tax that
@@ -1 +1 @@
1
- {"version":3,"file":"terraClassicTax.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/terraClassicTax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AASH;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,QAAO,MAC0B,CAAA;AAEvE,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,KAAG,MAK0C,CAAA;AAMpG;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,QAAa,CAAA;AAMrD,KAAK,SAAS,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAiDnE;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,GAAE,SAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAOlF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,SAAc,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI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