@vultisig/core-chain 2.24.0 → 2.24.2
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 +20 -0
- package/dist/amount/fromChainAmountExact.d.ts +28 -0
- package/dist/amount/fromChainAmountExact.d.ts.map +1 -0
- package/dist/amount/fromChainAmountExact.js +47 -0
- package/dist/amount/fromChainAmountExact.js.map +1 -0
- package/dist/amount/toChainAmount.d.ts.map +1 -1
- package/dist/amount/toChainAmount.js +21 -3
- package/dist/amount/toChainAmount.js.map +1 -1
- package/dist/chains/cosmos/cosmosDecimal.d.ts +15 -0
- package/dist/chains/cosmos/cosmosDecimal.d.ts.map +1 -0
- package/dist/chains/cosmos/cosmosDecimal.js +15 -0
- package/dist/chains/cosmos/cosmosDecimal.js.map +1 -0
- package/dist/chains/cosmos/gas.d.ts +2 -6
- package/dist/chains/cosmos/gas.d.ts.map +1 -1
- package/dist/chains/cosmos/gas.js +20 -13
- package/dist/chains/cosmos/gas.js.map +1 -1
- package/dist/chains/cosmos/osmosisDynamicFee.d.ts +13 -0
- package/dist/chains/cosmos/osmosisDynamicFee.d.ts.map +1 -0
- package/dist/chains/cosmos/osmosisDynamicFee.js +108 -0
- package/dist/chains/cosmos/osmosisDynamicFee.js.map +1 -0
- package/dist/chains/cosmos/resolveCosmosGasFee.d.ts +22 -1
- package/dist/chains/cosmos/resolveCosmosGasFee.d.ts.map +1 -1
- package/dist/chains/cosmos/resolveCosmosGasFee.js +32 -3
- package/dist/chains/cosmos/resolveCosmosGasFee.js.map +1 -1
- package/dist/chains/utxo/minUtxo.d.ts.map +1 -1
- package/dist/chains/utxo/minUtxo.js +7 -1
- package/dist/chains/utxo/minUtxo.js.map +1 -1
- package/dist/coin/utils/findByTicker.d.ts.map +1 -1
- package/dist/coin/utils/findByTicker.js +15 -1
- package/dist/coin/utils/findByTicker.js.map +1 -1
- package/dist/swap/general/cowswap/api/getCowSwapQuote.d.ts.map +1 -1
- package/dist/swap/general/cowswap/api/getCowSwapQuote.js +68 -3
- package/dist/swap/general/cowswap/api/getCowSwapQuote.js.map +1 -1
- package/dist/swap/general/jupiter/api/getJupiterSwapQuote.d.ts.map +1 -1
- package/dist/swap/general/jupiter/api/getJupiterSwapQuote.js +7 -0
- package/dist/swap/general/jupiter/api/getJupiterSwapQuote.js.map +1 -1
- package/dist/swap/general/knownAggregatorRouters.d.ts +14 -0
- package/dist/swap/general/knownAggregatorRouters.d.ts.map +1 -0
- package/dist/swap/general/knownAggregatorRouters.js +83 -0
- package/dist/swap/general/knownAggregatorRouters.js.map +1 -0
- package/dist/swap/general/kyber/api/tx.d.ts.map +1 -1
- package/dist/swap/general/kyber/api/tx.js +19 -2
- package/dist/swap/general/kyber/api/tx.js.map +1 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.d.ts.map +1 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.js +8 -1
- package/dist/swap/general/lifi/api/getLifiSwapQuote.js.map +1 -1
- package/dist/swap/general/oneInch/api/getOneInchSwapQuote.d.ts +6 -1
- package/dist/swap/general/oneInch/api/getOneInchSwapQuote.d.ts.map +1 -1
- package/dist/swap/general/oneInch/api/getOneInchSwapQuote.js +24 -1
- package/dist/swap/general/oneInch/api/getOneInchSwapQuote.js.map +1 -1
- package/dist/swap/general/priceImpactGuard.d.ts +73 -0
- package/dist/swap/general/priceImpactGuard.d.ts.map +1 -0
- package/dist/swap/general/priceImpactGuard.js +89 -0
- package/dist/swap/general/priceImpactGuard.js.map +1 -0
- package/dist/swap/general/swapkit/api/getSwapKitQuote.d.ts.map +1 -1
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js +5 -0
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js.map +1 -1
- package/dist/swap/native/NativeSwapChain.d.ts +1 -0
- package/dist/swap/native/NativeSwapChain.d.ts.map +1 -1
- package/dist/swap/native/NativeSwapChain.js +1 -1
- package/dist/swap/native/NativeSwapChain.js.map +1 -1
- package/dist/swap/native/limitSwapMemo.d.ts.map +1 -1
- package/dist/swap/native/limitSwapMemo.js +51 -3
- package/dist/swap/native/limitSwapMemo.js.map +1 -1
- package/dist/swap/native/thorchainDepositMemo.d.ts +19 -0
- package/dist/swap/native/thorchainDepositMemo.d.ts.map +1 -0
- package/dist/swap/native/thorchainDepositMemo.js +75 -0
- package/dist/swap/native/thorchainDepositMemo.js.map +1 -0
- package/dist/swap/quote/findSwapQuote.d.ts +16 -3
- package/dist/swap/quote/findSwapQuote.d.ts.map +1 -1
- package/dist/swap/quote/findSwapQuote.js +52 -6
- package/dist/swap/quote/findSwapQuote.js.map +1 -1
- package/dist/tx/broadcast/resolvers/cardano.d.ts.map +1 -1
- package/dist/tx/broadcast/resolvers/cardano.js +4 -4
- package/dist/tx/broadcast/resolvers/cardano.js.map +1 -1
- package/dist/tx/broadcast/resolvers/utxo.d.ts.map +1 -1
- package/dist/tx/broadcast/resolvers/utxo.js +4 -4
- package/dist/tx/broadcast/resolvers/utxo.js.map +1 -1
- package/dist/tx/fee/evm/clampEvmPriorityFee.d.ts +8 -0
- package/dist/tx/fee/evm/clampEvmPriorityFee.d.ts.map +1 -0
- package/dist/tx/fee/evm/clampEvmPriorityFee.js +50 -0
- package/dist/tx/fee/evm/clampEvmPriorityFee.js.map +1 -0
- package/dist/tx/status/resolvers/utxo.d.ts.map +1 -1
- package/dist/tx/status/resolvers/utxo.js +12 -2
- package/dist/tx/status/resolvers/utxo.js.map +1 -1
- package/package.json +36 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @vultisig/core-chain
|
|
2
2
|
|
|
3
|
+
## 2.24.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1018](https://github.com/vultisig/vultisig-sdk/pull/1018) [`90070f3`](https://github.com/vultisig/vultisig-sdk/commit/90070f39be011821f7508c7ff094025861dce040) Thanks [@gomesalexandre](https://github.com/gomesalexandre)! - fix(swap): accept returned quote provider ids in `findSwapQuote.excludeProviders`
|
|
8
|
+
|
|
9
|
+
`findSwapQuote.excludeProviders` now accepts both display names (`CowSwap`, `KyberSwap`, `LiFi`) and returned quote provider ids (`cowswap`, `kyber`, `li.fi`) for general providers. Unknown exclude tokens now fail closed instead of silently leaving the provider eligible.
|
|
10
|
+
|
|
11
|
+
- [#1112](https://github.com/vultisig/vultisig-sdk/pull/1112) [`2c9d34e`](https://github.com/vultisig/vultisig-sdk/commit/2c9d34e0837f68d92769c7aefa566ffb1c0c52c7) Thanks [@gomesalexandre](https://github.com/gomesalexandre)! - fix(swap): resolve THORChain limit-swap destination chains via the swap-eligible chain set, not the LP-position map (THOR-04) — `getSupportedThorchainAssetChain` (`limitSwapMemo.ts`) resolved a THORChain asset-prefix (e.g. `SOL`, `NOBLE`) to a `Chain` via `lpChainMap`, a map scoped to the wallet's LP-position-display feature (`chains/cosmos/thor/lp/lpChainMap.ts`), not swap eligibility. Since neither Solana nor Noble has a THORChain LP pool, both were missing from that map, so a limit swap (`LIM=` memo) targeting either failed closed with "unsupported THORChain asset prefix" even though both are valid THORChain market-swap destinations (per THORChain's memo docs, `=` vs `=<` only changes execution behavior — price/queue/TTL — not the destination-chain universe). Fixed by unioning `lpChainMap` with `thorChainSwapEnabledChains` (`swap/native/NativeSwapChain.ts`, now exported) — the same THORChain-specific chain list regular market swaps already use to gate eligibility — rather than replacing `lpChainMap` outright or switching to the broader `nativeSwapChainIds`, which also carries MayaChain-only entries (e.g. `Chain.MayaChain`, `Chain.Cardano`) that aren't valid THORChain limit-swap destinations.
|
|
12
|
+
|
|
13
|
+
- [#1097](https://github.com/vultisig/vultisig-sdk/pull/1097) [`ffc75a6`](https://github.com/vultisig/vultisig-sdk/commit/ffc75a6e76af699a78b0fc3411ab052ce5000c91) Thanks [@gomesalexandre](https://github.com/gomesalexandre)! - fix(swap): exact bigint decimal conversion for the displayed swap output (`toAmountDecimal`) — the float64 `fromChainAmount(...).toFixed()` path silently drifted above 2^53 raw units (e.g. `999999999999999999999999` @18dp rendered as `1000000.000000000000000000`), so the amount the user confirmed could differ from the quoted one. Non-integer provider amount strings keep the legacy fallback instead of throwing mid-build.
|
|
14
|
+
|
|
15
|
+
## 2.24.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#1107](https://github.com/vultisig/vultisig-sdk/pull/1107) [`c5e89cb`](https://github.com/vultisig/vultisig-sdk/commit/c5e89cb317ae6f4ca00eb6c628ad6bac636e4821) Thanks [@gomesalexandre](https://github.com/gomesalexandre)! - fix(swap): populate 1inch affiliateFee for display (AGG-05) — 1inch general-swap quotes never populated `affiliateFee` on the returned `GeneralSwapQuote`, unlike Kyber and LI.FI, leaving the fee-transparency row blank for 1inch even though a real affiliate cut is taken via its `fee`/`referrer` params. `getOneInchSwapQuote` now grosses the post-fee `dstAmount` back up (same bps-based calc `getKyberSwapAffiliateFee` uses) to compute and attach a display-only `affiliateFee`.
|
|
20
|
+
|
|
21
|
+
- [#1101](https://github.com/vultisig/vultisig-sdk/pull/1101) [`9a1fc02`](https://github.com/vultisig/vultisig-sdk/commit/9a1fc0276ddc8fc905fab392875499d39011520d) Thanks [@gomesalexandre](https://github.com/gomesalexandre)! - fix(swap): surface non-integer dstAmount drops + validate THORChain/MayaChain MsgDeposit memos (SDK-CORRECTNESS-04/06/08) — a drifted provider's non-integer `dstAmount` used to silently drop that quote from ranking with no signal it was a parse failure; `findSwapQuote` now `console.warn`s the provider + raw value before rethrowing. `prepareThorchainMsgDepositTxFromKeys` accepted an arbitrary memo string with no structural validation, unlike the fully-validated limit-swap memo path; it now fails closed on non-printable/oversized memos and unrecognized THORChain/MayaChain deposit actions (and, for the two documented LP actions, a malformed pool id), while still accepting non-LP operator-style memos (BOND, UNBOND, etc.) verbatim. Also replaced an `as any` cast on the deposit's chain-specific proto binding with per-chain branches so the `case`/`value` pairing is statically checked instead of bypassed.
|
|
22
|
+
|
|
3
23
|
## 2.24.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact base-units → human decimal-string conversion.
|
|
3
|
+
*
|
|
4
|
+
* `fromChainAmount` round-trips through float64 (`Number(amount) / 10**decimals`),
|
|
5
|
+
* which silently loses precision once the raw amount exceeds 2^53 (~0.009 tokens
|
|
6
|
+
* at 18 decimals) — `.toFixed(decimals)` then fabricates digits, so the displayed
|
|
7
|
+
* amount can differ from the quoted one (e.g. `999999999999999999999999` raw at
|
|
8
|
+
* 18dp renders as `1000000.000000000000000000`). This variant is pure bigint
|
|
9
|
+
* string arithmetic — no precision loss for any magnitude.
|
|
10
|
+
*
|
|
11
|
+
* Output format matches `fromChainAmount(x, d).toFixed(d)`: an unsigned decimal
|
|
12
|
+
* with exactly `decimals` fraction digits (no fraction part when `decimals` is 0),
|
|
13
|
+
* so it is a drop-in replacement for display fields like `toAmountDecimal`.
|
|
14
|
+
*
|
|
15
|
+
* Accepts the integer base-unit shapes quote APIs return: bigint, or a base-10
|
|
16
|
+
* integer string. Throws on anything else — a non-integer quote amount must be
|
|
17
|
+
* handled by the caller, never silently floated.
|
|
18
|
+
*/
|
|
19
|
+
export declare const fromChainAmountExact: (amount: bigint | string, decimals: number) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Display-oriented variant with a legacy fallback: exact conversion for the
|
|
22
|
+
* integer base-unit strings quote APIs are contracted to return, and the old
|
|
23
|
+
* float64 `.toFixed(decimals)` behaviour for anything else (some aggregators
|
|
24
|
+
* have been observed returning non-integer `dstAmount` strings — see
|
|
25
|
+
* SDK-CORRECTNESS-04; a display field must not throw mid-build over one).
|
|
26
|
+
*/
|
|
27
|
+
export declare const fromChainAmountDisplay: (amount: bigint | string, decimals: number) => string;
|
|
28
|
+
//# sourceMappingURL=fromChainAmountExact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromChainAmountExact.d.ts","sourceRoot":"","sources":["../../../../../packages/core/chain/amount/fromChainAmountExact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,GAAG,MAAM,EAAE,UAAU,MAAM,KAAG,MAkBhF,CAAA;AAID;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,GAAG,MAAM,EAAE,UAAU,MAAM,KAAG,MAMlF,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact base-units → human decimal-string conversion.
|
|
3
|
+
*
|
|
4
|
+
* `fromChainAmount` round-trips through float64 (`Number(amount) / 10**decimals`),
|
|
5
|
+
* which silently loses precision once the raw amount exceeds 2^53 (~0.009 tokens
|
|
6
|
+
* at 18 decimals) — `.toFixed(decimals)` then fabricates digits, so the displayed
|
|
7
|
+
* amount can differ from the quoted one (e.g. `999999999999999999999999` raw at
|
|
8
|
+
* 18dp renders as `1000000.000000000000000000`). This variant is pure bigint
|
|
9
|
+
* string arithmetic — no precision loss for any magnitude.
|
|
10
|
+
*
|
|
11
|
+
* Output format matches `fromChainAmount(x, d).toFixed(d)`: an unsigned decimal
|
|
12
|
+
* with exactly `decimals` fraction digits (no fraction part when `decimals` is 0),
|
|
13
|
+
* so it is a drop-in replacement for display fields like `toAmountDecimal`.
|
|
14
|
+
*
|
|
15
|
+
* Accepts the integer base-unit shapes quote APIs return: bigint, or a base-10
|
|
16
|
+
* integer string. Throws on anything else — a non-integer quote amount must be
|
|
17
|
+
* handled by the caller, never silently floated.
|
|
18
|
+
*/
|
|
19
|
+
export const fromChainAmountExact = (amount, decimals) => {
|
|
20
|
+
if (!Number.isInteger(decimals) || decimals < 0) {
|
|
21
|
+
throw new Error(`fromChainAmountExact: invalid decimals ${decimals}`);
|
|
22
|
+
}
|
|
23
|
+
const raw = typeof amount === 'bigint' ? amount : BigInt(amount.trim());
|
|
24
|
+
if (raw < 0n) {
|
|
25
|
+
throw new Error('fromChainAmountExact: negative amounts are not supported');
|
|
26
|
+
}
|
|
27
|
+
const s = raw.toString().padStart(decimals + 1, '0');
|
|
28
|
+
if (decimals === 0) {
|
|
29
|
+
return s;
|
|
30
|
+
}
|
|
31
|
+
return `${s.slice(0, -decimals)}.${s.slice(-decimals)}`;
|
|
32
|
+
};
|
|
33
|
+
const isIntegerString = (value) => /^\d+$/.test(value.trim());
|
|
34
|
+
/**
|
|
35
|
+
* Display-oriented variant with a legacy fallback: exact conversion for the
|
|
36
|
+
* integer base-unit strings quote APIs are contracted to return, and the old
|
|
37
|
+
* float64 `.toFixed(decimals)` behaviour for anything else (some aggregators
|
|
38
|
+
* have been observed returning non-integer `dstAmount` strings — see
|
|
39
|
+
* SDK-CORRECTNESS-04; a display field must not throw mid-build over one).
|
|
40
|
+
*/
|
|
41
|
+
export const fromChainAmountDisplay = (amount, decimals) => {
|
|
42
|
+
if (typeof amount === 'bigint' || isIntegerString(amount)) {
|
|
43
|
+
return fromChainAmountExact(amount, decimals);
|
|
44
|
+
}
|
|
45
|
+
return (Number(amount) / Math.pow(10, decimals)).toFixed(decimals);
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=fromChainAmountExact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fromChainAmountExact.js","sourceRoot":"","sources":["../../../../../packages/core/chain/amount/fromChainAmountExact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAuB,EAAE,QAAgB,EAAU,EAAE;IACxF,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,0CAA0C,QAAQ,EAAE,CAAC,CAAA;IACvE,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CA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gBAEpC,OAAO,EAAE,MAAM;CAG5B;AA+
|
|
1
|
+
{"version":3,"file":"toChainAmount.d.ts","sourceRoot":"","sources":["../../../../../packages/core/chain/amount/toChainAmount.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,SAAkB,IAAI,2BAA0B;gBAEpC,OAAO,EAAE,MAAM;CAG5B;AA+FD,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,GAAG,MAAM,EAAE,UAAU,MAAM,WAetE,CAAA"}
|
|
@@ -75,6 +75,24 @@ const expandScientificNotationToDecimalString = (s) => {
|
|
|
75
75
|
}
|
|
76
76
|
return absResult;
|
|
77
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Truncate a plain decimal string to at most `decimals` fractional digits so
|
|
80
|
+
* parseUnits cannot round up. viem's parseUnits rounds half-up at decimals=0
|
|
81
|
+
* (e.g. "0.6" → 1n, "1.5" → 2n), while the signed amount must never exceed
|
|
82
|
+
* the stated human amount — truncation is the safe direction.
|
|
83
|
+
* Only called after scientific notation has already been expanded.
|
|
84
|
+
*/
|
|
85
|
+
const truncateToDecimals = (s, decimals) => {
|
|
86
|
+
const dotIdx = s.indexOf('.');
|
|
87
|
+
if (dotIdx === -1)
|
|
88
|
+
return s;
|
|
89
|
+
if (decimals === 0)
|
|
90
|
+
return s.slice(0, dotIdx);
|
|
91
|
+
const fracPart = s.slice(dotIdx + 1);
|
|
92
|
+
if (fracPart.length <= decimals)
|
|
93
|
+
return s;
|
|
94
|
+
return `${s.slice(0, dotIdx + 1)}${fracPart.slice(0, decimals)}`;
|
|
95
|
+
};
|
|
78
96
|
export const toChainAmount = (amount, decimals) => {
|
|
79
97
|
if (typeof amount === 'string') {
|
|
80
98
|
const trimmed = amount.trim();
|
|
@@ -83,12 +101,12 @@ export const toChainAmount = (amount, decimals) => {
|
|
|
83
101
|
}
|
|
84
102
|
if (/[eE]/.test(trimmed)) {
|
|
85
103
|
const expanded = expandScientificNotationToDecimalString(trimmed);
|
|
86
|
-
return parseUnits(expanded, decimals);
|
|
104
|
+
return parseUnits(truncateToDecimals(expanded, decimals), decimals);
|
|
87
105
|
}
|
|
88
|
-
return parseUnits(trimmed, decimals);
|
|
106
|
+
return parseUnits(truncateToDecimals(trimmed, decimals), decimals);
|
|
89
107
|
}
|
|
90
108
|
const str = amount.toString();
|
|
91
109
|
const value = /[eE]/.test(str) ? amount.toFixed(decimals) : str;
|
|
92
|
-
return parseUnits(value, decimals);
|
|
110
|
+
return parseUnits(truncateToDecimals(value, decimals), decimals);
|
|
93
111
|
};
|
|
94
112
|
//# sourceMappingURL=toChainAmount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toChainAmount.js","sourceRoot":"","sources":["../../../../../packages/core/chain/amount/toChainAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AAEjC,iFAAiF;AACjF,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5B,IAAI,GAAG,uBAAuB,CAAA;IAEhD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;IAChB,CAAC;CACF;AAED,MAAM,kBAAkB,GAAG,mDAAmD,CAAA;AAE9E,iFAAiF;AACjF,MAAM,aAAa,GAAG,MAAO,CAAA;AAE7B,MAAM,iBAAiB,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAU,EAAE;IACnE,MAAM,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC3C,IAAI,IAAI,IAAI,EAAE,EAAE,CAAC;QACf,OAAO,IAAI,CAAA;IACb,CAAC;IACD,IAAI,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,CAAC;QAC5C,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,CAAA;IAC7C,CAA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QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAA;QACrE,CAAC;QACD,OAAO,UAAU,CAAC,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAA;IACpE,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAC/D,OAAO,UAAU,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAA;AAClE,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Exact-rational decimal parsing/fee math shared by every cosmos gas-price
|
|
3
|
+
* resolver (the generic node-config path and Osmosis's dynamic EIP-1559
|
|
4
|
+
* path). Kept in its own module so both can depend on it without a circular
|
|
5
|
+
* import between them.
|
|
6
|
+
*/
|
|
7
|
+
export type ParsedDecimal = {
|
|
8
|
+
numerator: bigint;
|
|
9
|
+
denominator: bigint;
|
|
10
|
+
};
|
|
11
|
+
/** Parses a non-negative decimal string (e.g. "0.030000000000000000") into an exact fraction. */
|
|
12
|
+
export declare const parseDecimal: (value: string) => ParsedDecimal | undefined;
|
|
13
|
+
/** ceil(gasLimit * gasPrice), computed as an exact fraction - never loses precision to IEEE-754 rounding. */
|
|
14
|
+
export declare const getFeeAmountFromGasPrice: (gasLimit: bigint, gasPrice: ParsedDecimal) => bigint;
|
|
15
|
+
//# sourceMappingURL=cosmosDecimal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosDecimal.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosDecimal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,iGAAiG;AACjG,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,aAAa,GAAG,SAQ5D,CAAA;AAED,6GAA6G;AAC7G,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,UAAU,aAAa,KAAG,MAIpF,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Parses a non-negative decimal string (e.g. "0.030000000000000000") into an exact fraction. */
|
|
2
|
+
export const parseDecimal = (value) => {
|
|
3
|
+
if (!/^\d+(?:\.\d+)?$/.test(value))
|
|
4
|
+
return undefined;
|
|
5
|
+
const [whole, fraction = ''] = value.split('.');
|
|
6
|
+
const denominator = 10n ** BigInt(fraction.length);
|
|
7
|
+
const numerator = BigInt(`${whole}${fraction}`);
|
|
8
|
+
return { numerator, denominator };
|
|
9
|
+
};
|
|
10
|
+
/** ceil(gasLimit * gasPrice), computed as an exact fraction - never loses precision to IEEE-754 rounding. */
|
|
11
|
+
export const getFeeAmountFromGasPrice = (gasLimit, gasPrice) => {
|
|
12
|
+
const total = gasLimit * gasPrice.numerator;
|
|
13
|
+
return (total + gasPrice.denominator - 1n) / gasPrice.denominator;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=cosmosDecimal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosDecimal.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosDecimal.ts"],"names":[],"mappings":"AAWA,iGAAiG;AACjG,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAa,EAA6B,EAAE;IACvE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAEpD,MAAM,CAAC,KAAK,EAAE,QAAQ,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/C,MAAM,WAAW,GAAG,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAClD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,KAAK,GAAG,QAAQ,EAAE,CAAC,CAAA;IAE/C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAA;AACnC,CAAC,CAAA;AAED,6GAA6G;AAC7G,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,QAAuB,EAAU,EAAE;IAC5F,MAAM,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,SAAS,CAAA;IAE3C,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,WAAW,GAAG,EAAE,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAA;AACnE,CAAC,CAAA"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { IbcEnabledCosmosChain } from '../../Chain.js';
|
|
2
2
|
import type { CoinKey } from '../../coin/Coin.js';
|
|
3
|
+
import { type ParsedDecimal } from './cosmosDecimal.js';
|
|
4
|
+
export { getFeeAmountFromGasPrice } from './cosmosDecimal.js';
|
|
3
5
|
export declare const cosmosGasRecord: Record<IbcEnabledCosmosChain, bigint>;
|
|
4
6
|
type FetchOpts = {
|
|
5
7
|
fetchImpl?: typeof fetch;
|
|
6
8
|
signal?: AbortSignal;
|
|
7
9
|
};
|
|
8
|
-
type ParsedDecimal = {
|
|
9
|
-
numerator: bigint;
|
|
10
|
-
denominator: bigint;
|
|
11
|
-
};
|
|
12
|
-
export declare const getFeeAmountFromGasPrice: (gasLimit: bigint, gasPrice: ParsedDecimal) => bigint;
|
|
13
10
|
export declare const getMinGasPriceForDenom: (minimumGasPrice: string, targetDenom: string) => ParsedDecimal | undefined;
|
|
14
11
|
export declare const getCosmosFeeAmount: (coin: CoinKey<IbcEnabledCosmosChain>, opts?: FetchOpts) => Promise<bigint>;
|
|
15
|
-
export {};
|
|
16
12
|
//# sourceMappingURL=gas.d.ts.map
|
|
@@ -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;
|
|
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,7 +1,10 @@
|
|
|
1
1
|
import { Chain } from '../../Chain.js';
|
|
2
|
+
import { getFeeAmountFromGasPrice, parseDecimal } from './cosmosDecimal.js';
|
|
2
3
|
import { cosmosFeeCoinDenom } from './cosmosFeeCoinDenom.js';
|
|
3
4
|
import { getCosmosGasLimit } from './cosmosGasLimitRecord.js';
|
|
4
5
|
import { getCosmosRpcUrl } from './getCosmosRpcUrl.js';
|
|
6
|
+
import { getOsmosisDynamicFeeFloor } from './osmosisDynamicFee.js';
|
|
7
|
+
export { getFeeAmountFromGasPrice } from './cosmosDecimal.js';
|
|
5
8
|
const defaultGas = 7500n;
|
|
6
9
|
export const cosmosGasRecord = {
|
|
7
10
|
[Chain.Cosmos]: defaultGas,
|
|
@@ -16,14 +19,6 @@ export const cosmosGasRecord = {
|
|
|
16
19
|
const minGasPriceConfigPath = '/cosmos/base/node/v1beta1/config';
|
|
17
20
|
const minGasPriceFetchTimeoutMs = 3_000;
|
|
18
21
|
const maxLiveFeeMultiplier = 10n;
|
|
19
|
-
const parseDecimal = (value) => {
|
|
20
|
-
if (!/^\d+(?:\.\d+)?$/.test(value))
|
|
21
|
-
return undefined;
|
|
22
|
-
const [whole, fraction = ''] = value.split('.');
|
|
23
|
-
const denominator = 10n ** BigInt(fraction.length);
|
|
24
|
-
const numerator = BigInt(`${whole}${fraction}`);
|
|
25
|
-
return { numerator, denominator };
|
|
26
|
-
};
|
|
27
22
|
const parseMinGasPriceEntry = (entry) => {
|
|
28
23
|
const match = entry.trim().match(/^(\d+(?:\.\d+)?)([a-zA-Z][a-zA-Z0-9/._:-]*)$/);
|
|
29
24
|
if (!match)
|
|
@@ -34,10 +29,6 @@ const parseMinGasPriceEntry = (entry) => {
|
|
|
34
29
|
return undefined;
|
|
35
30
|
return { ...decimal, denom };
|
|
36
31
|
};
|
|
37
|
-
export const getFeeAmountFromGasPrice = (gasLimit, gasPrice) => {
|
|
38
|
-
const total = gasLimit * gasPrice.numerator;
|
|
39
|
-
return (total + gasPrice.denominator - 1n) / gasPrice.denominator;
|
|
40
|
-
};
|
|
41
32
|
export const getMinGasPriceForDenom = (minimumGasPrice, targetDenom) => {
|
|
42
33
|
for (const entry of minimumGasPrice.split(',')) {
|
|
43
34
|
const parsed = parseMinGasPriceEntry(entry);
|
|
@@ -97,7 +88,7 @@ const fetchMinGasPrice = async (chain, { fetchImpl = fetch, signal } = {}) => {
|
|
|
97
88
|
timeoutController.cleanup();
|
|
98
89
|
}
|
|
99
90
|
};
|
|
100
|
-
|
|
91
|
+
const getGenericCosmosFeeAmount = async (coin, opts) => {
|
|
101
92
|
const floor = cosmosGasRecord[coin.chain];
|
|
102
93
|
try {
|
|
103
94
|
const minimumGasPrice = await fetchMinGasPrice(coin.chain, opts);
|
|
@@ -113,4 +104,20 @@ export const getCosmosFeeAmount = async (coin, opts = {}) => {
|
|
|
113
104
|
return floor;
|
|
114
105
|
}
|
|
115
106
|
};
|
|
107
|
+
export const getCosmosFeeAmount = async (coin, opts = {}) => {
|
|
108
|
+
if (coin.chain !== Chain.Osmosis)
|
|
109
|
+
return getGenericCosmosFeeAmount(coin, opts);
|
|
110
|
+
// Osmosis's real fee floor is enforced by its EIP-1559 `x/txfees` module,
|
|
111
|
+
// NOT the generic node-config `minimum-gas-price` (a per-node/operator-
|
|
112
|
+
// configurable value that doesn't track the live protocol floor, and can
|
|
113
|
+
// be clamped away by the anomaly guard above when it legitimately spikes).
|
|
114
|
+
// Run both lookups concurrently (each has its own timeout budget) rather
|
|
115
|
+
// than sequentially, and never pay less than the higher of the two -
|
|
116
|
+
// see osmosisDynamicFee.ts.
|
|
117
|
+
const [genericFee, dynamicFloor] = await Promise.all([
|
|
118
|
+
getGenericCosmosFeeAmount(coin, opts),
|
|
119
|
+
getOsmosisDynamicFeeFloor(getCosmosGasLimit(coin), opts),
|
|
120
|
+
]);
|
|
121
|
+
return dynamicFloor !== null && dynamicFloor > genericFee ? dynamicFloor : genericFee;
|
|
122
|
+
};
|
|
116
123
|
//# sourceMappingURL=gas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/gas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAyB,MAAM,aAAa,CAAA;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;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,OAAO;QAAE,OAAO,yBAAyB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAE9E,0EAA0E;IAC1E,wEAAwE;IACxE,yEAAyE;IACzE,2EAA2E;IAC3E,yEAAyE;IACzE,qEAAqE;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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type FetchOpts = {
|
|
2
|
+
fetchImpl?: typeof fetch;
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Live fee floor for Osmosis (base-denom units for `gasLimit`), or null when
|
|
7
|
+
* the lookup failed OR the computed floor exceeds the sanity ceiling
|
|
8
|
+
* (fail-open in both cases - caller should fall back to its own static or
|
|
9
|
+
* generically-derived fee).
|
|
10
|
+
*/
|
|
11
|
+
export declare function getOsmosisDynamicFeeFloor(gasLimit: bigint, opts?: FetchOpts): Promise<bigint | null>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=osmosisDynamicFee.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osmosisDynamicFee.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/osmosisDynamicFee.ts"],"names":[],"mappings":"AAiDA,KAAK,SAAS,GAAG;IACf,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;IACxB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AA8CD;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,SAAc,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAa9G"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Chain } from '../../Chain.js';
|
|
2
|
+
import { getFeeAmountFromGasPrice, parseDecimal } from './cosmosDecimal.js';
|
|
3
|
+
import { getCosmosRpcUrl } from './getCosmosRpcUrl.js';
|
|
4
|
+
/**
|
|
5
|
+
* Osmosis runs an EIP-1559-style dynamic base fee (`x/txfees` module): the
|
|
6
|
+
* real minimum required fee floats and is enforced at the protocol/consensus
|
|
7
|
+
* level, separate from a node's own locally-configured `minimum-gas-prices`
|
|
8
|
+
* (the generic `/cosmos/base/node/v1beta1/config` value `getCosmosFeeAmount`
|
|
9
|
+
* otherwise queries for every ibc-enabled chain). A tx priced against only
|
|
10
|
+
* the generic node config can still be rejected at broadcast with sdk error
|
|
11
|
+
* code 13 ("insufficient fees") when the live EIP-1559 base fee has risen
|
|
12
|
+
* above it.
|
|
13
|
+
*
|
|
14
|
+
* Live-verified in production (vultiagent-app): a broadcast failed with
|
|
15
|
+
* "base fee was 0.03 -> required 12000uosmo" - the generic min-gas-price
|
|
16
|
+
* mechanism did not reflect the real floor.
|
|
17
|
+
*
|
|
18
|
+
* Query Osmosis's own `cur_eip_base_fee` endpoint directly and apply
|
|
19
|
+
* headroom, rather than relying on the generic node-config value.
|
|
20
|
+
*
|
|
21
|
+
* Trust boundary (review finding, 2026-07-08): this floor feeds directly
|
|
22
|
+
* into the SIGNABLE fee, so a compromised/malfunctioning/MITM'd LCD (this
|
|
23
|
+
* endpoint honors a user-configured RPC override) returning a pathological
|
|
24
|
+
* `base_fee` must never (a) inflate the signable fee unboundedly, or (b)
|
|
25
|
+
* crash fee resolution outright (violating the fail-open contract every
|
|
26
|
+
* other error path here honors). Both are closed by computing the floor
|
|
27
|
+
* with exact rational arithmetic (no IEEE-754 `Number`, so no
|
|
28
|
+
* overflow-to-Infinity path) and clamping the result to a generous sanity
|
|
29
|
+
* ceiling before returning it.
|
|
30
|
+
*/
|
|
31
|
+
const OSMOSIS_BASE_FEE_HEADROOM = { numerator: 5n, denominator: 4n }; // 1.25x, exact
|
|
32
|
+
// Hard ceiling on the base-fee lookup: fail-open only covers ERRORS - a
|
|
33
|
+
// stalled txfees LCD (TCP up, no bytes) would otherwise hang the fee
|
|
34
|
+
// resolution indefinitely.
|
|
35
|
+
const OSMOSIS_BASE_FEE_TIMEOUT_MS = 5_000;
|
|
36
|
+
// Sanity backstop on the computed floor itself, independent of the fetch
|
|
37
|
+
// succeeding: the live-verified real incident this guards against needed
|
|
38
|
+
// ~12_000 uosmo against a 9_000n static floor (~1.3x) - 1000x is enormous
|
|
39
|
+
// headroom above any realistic base-fee spike while still bounding a
|
|
40
|
+
// pathological/malicious LCD response (e.g. a `base_fee` of "1000" would
|
|
41
|
+
// otherwise compute a ~375 OSMO fee for a standard send).
|
|
42
|
+
const OSMOSIS_DYNAMIC_FLOOR_MAX_MULTIPLIER = 1000n;
|
|
43
|
+
const OSMOSIS_STATIC_FLOOR = 9000n; // must match cosmosGasRecord[Chain.Osmosis] in gas.ts
|
|
44
|
+
async function fetchOsmosisBaseFeePerGas({ fetchImpl = fetch, signal } = {}) {
|
|
45
|
+
const controller = new AbortController();
|
|
46
|
+
const onAbort = () => controller.abort();
|
|
47
|
+
if (signal?.aborted) {
|
|
48
|
+
controller.abort();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
52
|
+
}
|
|
53
|
+
const timeout = setTimeout(() => controller.abort(), OSMOSIS_BASE_FEE_TIMEOUT_MS);
|
|
54
|
+
const timeoutPromise = new Promise((_resolve, reject) => {
|
|
55
|
+
const rejectTimeout = () => reject(new Error('Osmosis base-fee request timed out'));
|
|
56
|
+
if (controller.signal.aborted) {
|
|
57
|
+
rejectTimeout();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
controller.signal.addEventListener('abort', rejectTimeout, { once: true });
|
|
61
|
+
});
|
|
62
|
+
try {
|
|
63
|
+
const body = await Promise.race([
|
|
64
|
+
(async () => {
|
|
65
|
+
const res = await fetchImpl(`${getCosmosRpcUrl(Chain.Osmosis)}/osmosis/txfees/v1beta1/cur_eip_base_fee`, {
|
|
66
|
+
signal: controller.signal,
|
|
67
|
+
});
|
|
68
|
+
if (!res.ok)
|
|
69
|
+
throw new Error(`Osmosis base-fee request failed: ${res.status}`);
|
|
70
|
+
return (await res.json());
|
|
71
|
+
})(),
|
|
72
|
+
timeoutPromise,
|
|
73
|
+
]);
|
|
74
|
+
const baseFee = body?.base_fee;
|
|
75
|
+
if (typeof baseFee !== 'string')
|
|
76
|
+
return null;
|
|
77
|
+
// Exact rational parse - no `Number()` coercion, so no path to
|
|
78
|
+
// overflow-to-Infinity on a pathologically long-but-regex-valid string.
|
|
79
|
+
return parseDecimal(baseFee) ?? null;
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
clearTimeout(timeout);
|
|
86
|
+
signal?.removeEventListener('abort', onAbort);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Live fee floor for Osmosis (base-denom units for `gasLimit`), or null when
|
|
91
|
+
* the lookup failed OR the computed floor exceeds the sanity ceiling
|
|
92
|
+
* (fail-open in both cases - caller should fall back to its own static or
|
|
93
|
+
* generically-derived fee).
|
|
94
|
+
*/
|
|
95
|
+
export async function getOsmosisDynamicFeeFloor(gasLimit, opts = {}) {
|
|
96
|
+
const baseFee = await fetchOsmosisBaseFeePerGas(opts);
|
|
97
|
+
if (baseFee === null)
|
|
98
|
+
return null;
|
|
99
|
+
const withHeadroom = {
|
|
100
|
+
numerator: baseFee.numerator * OSMOSIS_BASE_FEE_HEADROOM.numerator,
|
|
101
|
+
denominator: baseFee.denominator * OSMOSIS_BASE_FEE_HEADROOM.denominator,
|
|
102
|
+
};
|
|
103
|
+
const fee = getFeeAmountFromGasPrice(gasLimit, withHeadroom);
|
|
104
|
+
if (fee > OSMOSIS_STATIC_FLOOR * OSMOSIS_DYNAMIC_FLOOR_MAX_MULTIPLIER)
|
|
105
|
+
return null;
|
|
106
|
+
return fee;
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=osmosisDynamicFee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osmosisDynamicFee.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/osmosisDynamicFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,wBAAwB,EAAsB,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,yBAAyB,GAAkB,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAA,CAAC,eAAe;AACnG,wEAAwE;AACxE,qEAAqE;AACrE,2BAA2B;AAC3B,MAAM,2BAA2B,GAAG,KAAK,CAAA;AACzC,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,qEAAqE;AACrE,yEAAyE;AACzE,0DAA0D;AAC1D,MAAM,oCAAoC,GAAG,KAAM,CAAA;AACnD,MAAM,oBAAoB,GAAG,KAAM,CAAA,CAAC,sDAAsD;AAW1F,KAAK,UAAU,yBAAyB,CAAC,EAAE,SAAS,GAAG,KAAK,EAAE,MAAM,KAAgB,EAAE;IACpF,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IACxC,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAA;IACxC,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,UAAU,C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,OAAO,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAA;QAE5C,+DAA+D;QAC/D,wEAAwE;QACxE,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,IAAI,CAAA;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAA;IACb,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,OAAO,CAAC,CAAA;QACrB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,QAAgB,EAAE,OAAkB,EAAE;IACpF,MAAM,OAAO,GAAG,MAAM,yBAAyB,CAAC,IAAI,CAAC,CAAA;IACrD,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IAEjC,MAAM,YAAY,GAAkB;QAClC,SAAS,EAAE,OAAO,CAAC,SAAS,GAAG,yBAAyB,CAAC,SAAS;QAClE,WAAW,EAAE,OAAO,CAAC,WAAW,GAAG,yBAAyB,CAAC,WAAW;KACzE,CAAA;IACD,MAAM,GAAG,GAAG,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;IAE5D,IAAI,GAAG,GAAG,oBAAoB,GAAG,oCAAoC;QAAE,OAAO,IAAI,CAAA;IAElF,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -11,6 +11,18 @@
|
|
|
11
11
|
* the extra gas. Below or equal to the static limit, both values are left
|
|
12
12
|
* untouched, keeping the non-dynamic path byte-identical.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* COSMOS-02: an IBC transfer (ICS-20 `MsgTransfer`, optionally PFM-forwarded
|
|
16
|
+
* via memo) does measurably more work on the source leg than a plain bank
|
|
17
|
+
* send — channel-state writes plus a relayer event — so the flat per-chain
|
|
18
|
+
* limit (calibrated for `MsgSend`) is undersized and can run out of gas
|
|
19
|
+
* mid-execution: the fee is spent, the transfer fails, and funds don't move
|
|
20
|
+
* but the fee is still burned. PFM hops are budgeted by each forwarding
|
|
21
|
+
* chain, not the source leg here, so ×2 headroom on the source leg is
|
|
22
|
+
* sufficient. Mirrors the app's own `IBC_GAS_MULTIPLIER`
|
|
23
|
+
* (vultiagent-app/src/services/cosmosTx.ts).
|
|
24
|
+
*/
|
|
25
|
+
export declare const IBC_GAS_MULTIPLIER = 2n;
|
|
14
26
|
type ResolveCosmosGasFeeInput = {
|
|
15
27
|
/** static per-chain fee amount already stored in `CosmosSpecific.gas` */
|
|
16
28
|
gas: bigint;
|
|
@@ -18,11 +30,20 @@ type ResolveCosmosGasFeeInput = {
|
|
|
18
30
|
relayedGasLimit: bigint | undefined;
|
|
19
31
|
/** static per-chain gas limit (`getCosmosGasLimit`) */
|
|
20
32
|
staticGasLimit: bigint;
|
|
33
|
+
/**
|
|
34
|
+
* Whether this tx is an IBC transfer (`MsgTransfer`, optionally
|
|
35
|
+
* PFM-forwarded). Applies `IBC_GAS_MULTIPLIER` to both the static gas
|
|
36
|
+
* limit and its matching fee before resolving against a relayed limit.
|
|
37
|
+
* Defaults to `false` so every other Cosmos message (plain sends, wasm
|
|
38
|
+
* executes, staking) keeps paying the calibrated flat fee — a blanket
|
|
39
|
+
* multiplier on all Cosmos messages would overpay non-IBC sends.
|
|
40
|
+
*/
|
|
41
|
+
isIbcTransfer?: boolean;
|
|
21
42
|
};
|
|
22
43
|
type ResolveCosmosGasFeeResult = {
|
|
23
44
|
resolvedGasLimit: bigint;
|
|
24
45
|
feeAmount: bigint;
|
|
25
46
|
};
|
|
26
|
-
export declare const resolveCosmosGasFee: ({ gas, relayedGasLimit, staticGasLimit, }: ResolveCosmosGasFeeInput) => ResolveCosmosGasFeeResult;
|
|
47
|
+
export declare const resolveCosmosGasFee: ({ gas, relayedGasLimit, staticGasLimit, isIbcTransfer, }: ResolveCosmosGasFeeInput) => ResolveCosmosGasFeeResult;
|
|
27
48
|
export {};
|
|
28
49
|
//# sourceMappingURL=resolveCosmosGasFee.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveCosmosGasFee.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasFee.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,KAAK,wBAAwB,GAAG;IAC9B,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"resolveCosmosGasFee.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasFee.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC,KAAK,wBAAwB,GAAG;IAC9B,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAA;IACtB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,0DAKjC,wBAAwB,KAAG,yBAY7B,CAAA"}
|
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the effective Cosmos gas limit and fee amount for a native send,
|
|
3
|
+
* honoring a relayed dynamic `gas_limit` when present.
|
|
4
|
+
*
|
|
5
|
+
* Shared by the signing-inputs resolver (what gets signed) and the fee-display
|
|
6
|
+
* resolver (what the user sees) so the shown and signed fee can never drift —
|
|
7
|
+
* the gas limit is part of the SignDoc, so both sides MUST agree.
|
|
8
|
+
*
|
|
9
|
+
* When the relayed limit exceeds the static per-chain limit, the fee amount is
|
|
10
|
+
* scaled proportionally with a ceiling (exact integer math) so the tx pays for
|
|
11
|
+
* the extra gas. Below or equal to the static limit, both values are left
|
|
12
|
+
* untouched, keeping the non-dynamic path byte-identical.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* COSMOS-02: an IBC transfer (ICS-20 `MsgTransfer`, optionally PFM-forwarded
|
|
16
|
+
* via memo) does measurably more work on the source leg than a plain bank
|
|
17
|
+
* send — channel-state writes plus a relayer event — so the flat per-chain
|
|
18
|
+
* limit (calibrated for `MsgSend`) is undersized and can run out of gas
|
|
19
|
+
* mid-execution: the fee is spent, the transfer fails, and funds don't move
|
|
20
|
+
* but the fee is still burned. PFM hops are budgeted by each forwarding
|
|
21
|
+
* chain, not the source leg here, so ×2 headroom on the source leg is
|
|
22
|
+
* sufficient. Mirrors the app's own `IBC_GAS_MULTIPLIER`
|
|
23
|
+
* (vultiagent-app/src/services/cosmosTx.ts).
|
|
24
|
+
*/
|
|
25
|
+
export const IBC_GAS_MULTIPLIER = 2n;
|
|
26
|
+
export const resolveCosmosGasFee = ({ gas, relayedGasLimit, staticGasLimit, isIbcTransfer = false, }) => {
|
|
27
|
+
const effectiveStaticGasLimit = isIbcTransfer ? staticGasLimit * IBC_GAS_MULTIPLIER : staticGasLimit;
|
|
28
|
+
const effectiveGas = isIbcTransfer ? gas * IBC_GAS_MULTIPLIER : gas;
|
|
29
|
+
const resolvedGasLimit = relayedGasLimit && relayedGasLimit > 0n ? relayedGasLimit : effectiveStaticGasLimit;
|
|
30
|
+
const feeAmount = resolvedGasLimit > effectiveStaticGasLimit
|
|
31
|
+
? (effectiveGas * resolvedGasLimit + effectiveStaticGasLimit - 1n) / effectiveStaticGasLimit
|
|
32
|
+
: effectiveGas;
|
|
4
33
|
return { resolvedGasLimit, feeAmount };
|
|
5
34
|
};
|
|
6
35
|
//# sourceMappingURL=resolveCosmosGasFee.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveCosmosGasFee.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasFee.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveCosmosGasFee.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasFee.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AAyBpC,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,GAAG,EACH,eAAe,EACf,cAAc,EACd,aAAa,GAAG,KAAK,GACI,EAA6B,EAAE;IACxD,MAAM,uBAAuB,GAAG,aAAa,CAAC,CAAC,CAAC,cAAc,GAAG,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAA;IACpG,MAAM,YAAY,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAA;IAEnE,MAAM,gBAAgB,GAAG,eAAe,IAAI,eAAe,GAAG,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,uBAAuB,CAAA;IAE5G,MAAM,SAAS,GACb,gBAAgB,GAAG,uBAAuB;QACxC,CAAC,CAAC,CAAC,YAAY,GAAG,gBAAgB,GAAG,uBAAuB,GAAG,EAAE,CAAC,GAAG,uBAAuB;QAC5F,CAAC,CAAC,YAAY,CAAA;IAElB,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAA;AACxC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minUtxo.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/utxo/minUtxo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,MAAM,aAAa,CAAA;AAEnD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"minUtxo.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/utxo/minUtxo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,MAAM,aAAa,CAAA;AAEnD,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAclD,CAAA"}
|
|
@@ -3,7 +3,13 @@ export const minUtxo = {
|
|
|
3
3
|
[Chain.Cardano]: 1400000n,
|
|
4
4
|
[Chain.Bitcoin]: 546n,
|
|
5
5
|
[Chain.Dogecoin]: 1000000n,
|
|
6
|
-
|
|
6
|
+
// UTXO-02 (audit r2): Litecoin's DUST_RELAY_TX_FEE is ~10x Bitcoin's, so its real standard dust threshold
|
|
7
|
+
// is ~2_940 litoshi for a P2WPKH output (the scriptType LTC uses), ~5_460 legacy P2PKH — NOT 1_000. At the
|
|
8
|
+
// old 1_000n, a change output of 1_001..2_939 litoshi was treated as spendable but is non-standard dust, so
|
|
9
|
+
// the tx could be rejected by relays / get stuck. Use the P2WPKH standard (2_940). KEEP IN SYNC with the
|
|
10
|
+
// per-chain dustLimit map in packages/sdk/src/chains/utxo/tx.ts (UTXO_SPECS). BCH/Dash/Zcash stay at 1_000n
|
|
11
|
+
// — that's already at/above their real ~546 dust (BTC-like relay fee), so it's conservative, not dangerous.
|
|
12
|
+
[Chain.Litecoin]: 2940n,
|
|
7
13
|
[Chain.BitcoinCash]: 1000n,
|
|
8
14
|
[Chain.Dash]: 1000n,
|
|
9
15
|
[Chain.Zcash]: 1000n,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minUtxo.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/utxo/minUtxo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,aAAa,CAAA;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAmC;IACrD,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,QAAU;IAC3B,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI;IACrB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAU;IAC5B,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAM;IACxB,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAM;IAC3B,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAM;IACpB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAM;CACtB,CAAA"}
|
|
1
|
+
{"version":3,"file":"minUtxo.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/utxo/minUtxo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,aAAa,CAAA;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAmC;IACrD,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,QAAU;IAC3B,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI;IACrB,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,QAAU;IAC5B,0GAA0G;IAC1G,2GAA2G;IAC3G,4GAA4G;IAC5G,yGAAyG;IACzG,4GAA4G;IAC5G,4GAA4G;IAC5G,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAM;IACxB,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAM;IAC3B,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAM;IACpB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAM;CACtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findByTicker.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/coin/utils/findByTicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,KAAK,iBAAiB,CAAC,CAAC,SAAS,IAAI,IAAI;IACvC,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;
|
|
1
|
+
{"version":3,"file":"findByTicker.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/coin/utils/findByTicker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,KAAK,iBAAiB,CAAC,CAAC,SAAS,IAAI,IAAI;IACvC,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAOD,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,IAAI,EAAE,mBAAmB,iBAAiB,CAAC,CAAC,CAAC,KAAG,CAAC,GAAG,IAU1F,CAAA"}
|