@vultisig/core-chain 2.23.1 → 2.23.3
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 +33 -0
- package/dist/chains/cardano/client/getCardanoAddressAssets.d.ts.map +1 -1
- package/dist/chains/cardano/client/getCardanoAddressAssets.js +32 -7
- package/dist/chains/cardano/client/getCardanoAddressAssets.js.map +1 -1
- package/dist/chains/cosmos/account/getAllCosmosBalances.d.ts +19 -0
- package/dist/chains/cosmos/account/getAllCosmosBalances.d.ts.map +1 -0
- package/dist/chains/cosmos/account/getAllCosmosBalances.js +36 -0
- package/dist/chains/cosmos/account/getAllCosmosBalances.js.map +1 -0
- package/dist/chains/cosmos/cosmosFeeDenomAllowlist.d.ts +15 -0
- package/dist/chains/cosmos/cosmosFeeDenomAllowlist.d.ts.map +1 -0
- package/dist/chains/cosmos/cosmosFeeDenomAllowlist.js +48 -0
- package/dist/chains/cosmos/cosmosFeeDenomAllowlist.js.map +1 -0
- package/dist/chains/cosmos/cosmosMemoCap.d.ts +31 -0
- package/dist/chains/cosmos/cosmosMemoCap.d.ts.map +1 -0
- package/dist/chains/cosmos/cosmosMemoCap.js +49 -0
- package/dist/chains/cosmos/cosmosMemoCap.js.map +1 -0
- package/dist/chains/cosmos/resolveCosmosGasFee.d.ts +28 -0
- package/dist/chains/cosmos/resolveCosmosGasFee.d.ts.map +1 -0
- package/dist/chains/cosmos/resolveCosmosGasFee.js +6 -0
- package/dist/chains/cosmos/resolveCosmosGasFee.js.map +1 -0
- package/dist/chains/solana/spl/getSplAccounts.d.ts.map +1 -1
- package/dist/chains/solana/spl/getSplAccounts.js +15 -4
- package/dist/chains/solana/spl/getSplAccounts.js.map +1 -1
- package/dist/chains/ton/account/getTonAccountInfo.d.ts +1 -1
- package/dist/chains/ton/account/getTonAccountInfo.d.ts.map +1 -1
- package/dist/chains/ton/account/getTonAccountInfo.js +14 -2
- package/dist/chains/ton/account/getTonAccountInfo.js.map +1 -1
- package/dist/coin/balance/resolvers/cosmos.d.ts.map +1 -1
- package/dist/coin/balance/resolvers/cosmos.js +3 -0
- package/dist/coin/balance/resolvers/cosmos.js.map +1 -1
- package/dist/coin/find/resolvers/cosmos.d.ts.map +1 -1
- package/dist/coin/find/resolvers/cosmos.js +9 -2
- package/dist/coin/find/resolvers/cosmos.js.map +1 -1
- package/dist/coin/find/resolvers/evm/index.d.ts.map +1 -1
- package/dist/coin/find/resolvers/evm/index.js +38 -10
- package/dist/coin/find/resolvers/evm/index.js.map +1 -1
- package/dist/coin/token/metadata/resolvers/cosmos.d.ts.map +1 -1
- package/dist/coin/token/metadata/resolvers/cosmos.js +4 -0
- package/dist/coin/token/metadata/resolvers/cosmos.js.map +1 -1
- package/dist/publicKey/getPublicKey.d.ts.map +1 -1
- package/dist/publicKey/getPublicKey.js +3 -0
- package/dist/publicKey/getPublicKey.js.map +1 -1
- package/dist/swap/general/swapkit/SwapKitEnabledChains.d.ts +2 -2
- package/dist/swap/general/swapkit/SwapKitEnabledChains.d.ts.map +1 -1
- package/dist/swap/general/swapkit/SwapKitEnabledChains.js +11 -2
- package/dist/swap/general/swapkit/SwapKitEnabledChains.js.map +1 -1
- package/dist/swap/general/swapkit/api/getSwapKitQuote.d.ts.map +1 -1
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js +21 -0
- package/dist/swap/general/swapkit/api/getSwapKitQuote.js.map +1 -1
- package/dist/swap/native/NativeSwapChain.d.ts +2 -1
- package/dist/swap/native/NativeSwapChain.d.ts.map +1 -1
- package/dist/swap/native/NativeSwapChain.js +13 -0
- package/dist/swap/native/NativeSwapChain.js.map +1 -1
- package/dist/swap/native/api/getNativeSwapQuote.d.ts.map +1 -1
- package/dist/swap/native/api/getNativeSwapQuote.js +17 -0
- package/dist/swap/native/api/getNativeSwapQuote.js.map +1 -1
- package/dist/swap/quote/findSwapQuote.d.ts.map +1 -1
- package/dist/swap/quote/findSwapQuote.js +119 -29
- package/dist/swap/quote/findSwapQuote.js.map +1 -1
- package/dist/swap/skip/skipRouting.d.ts +28 -0
- package/dist/swap/skip/skipRouting.d.ts.map +1 -0
- package/dist/swap/skip/skipRouting.js +79 -0
- package/dist/swap/skip/skipRouting.js.map +1 -0
- package/dist/swap/swapEnabledChains.d.ts +1 -1
- package/dist/swap/swapEnabledChains.d.ts.map +1 -1
- package/dist/tx/isValidTxHash.d.ts +8 -0
- package/dist/tx/isValidTxHash.d.ts.map +1 -0
- package/dist/tx/isValidTxHash.js +41 -0
- package/dist/tx/isValidTxHash.js.map +1 -0
- package/dist/tx/status/resolver.d.ts +1 -1
- package/dist/tx/status/resolver.d.ts.map +1 -1
- package/dist/tx/status/resolvers/evm.d.ts.map +1 -1
- package/dist/tx/status/resolvers/evm.js +33 -13
- package/dist/tx/status/resolvers/evm.js.map +1 -1
- package/package.json +32 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @vultisig/core-chain
|
|
2
2
|
|
|
3
|
+
## 2.23.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1024](https://github.com/vultisig/vultisig-sdk/pull/1024) [`3bc7904`](https://github.com/vultisig/vultisig-sdk/commit/3bc790403483dd7e90dac2efc33d7bc64c18b921) Thanks [@neavra](https://github.com/neavra)! - Stop `tx-status` from reporting malformed or never-seen transaction hashes as `pending` forever.
|
|
8
|
+
|
|
9
|
+
- The EVM status resolver now distinguishes a genuinely-pending tx (the node knows the hash, receipt still lagging) from one the node has never seen, returning a new terminal `not_found` status for the latter instead of an indefinite `pending`.
|
|
10
|
+
- New `isValidTxHash(chain, hash)` helper validates a hash's shape per chain-kind; the CLI `tx-status` command validates `--tx-hash` before any RPC and fails fast with `INVALID_INPUT` (exit 4) on a malformed hash.
|
|
11
|
+
- CLI `tx-status` polling is now bounded by a total wait budget (`--timeout <seconds>`, default 120) and exits non-zero on give-up — `TX_NOT_FOUND` (exit 5) when the node has no record of the hash, `TX_STATUS_TIMEOUT` (exit 3, retryable) when it is still pending.
|
|
12
|
+
- The poll loop now caps each sleep at the remaining wait budget instead of always sleeping the full poll interval, so a small `--timeout` gives up promptly instead of overshooting by up to one poll interval.
|
|
13
|
+
|
|
14
|
+
## 2.23.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#1014](https://github.com/vultisig/vultisig-sdk/pull/1014) [`c41a219`](https://github.com/vultisig/vultisig-sdk/commit/c41a21950c4cccf70c8298b8e595acf64c276d8c) Thanks [@Ehsan-saradar](https://github.com/Ehsan-saradar)! - feat(cosmos): initiator-side dynamic gas — simulate native sends and relay `CosmosSpecific.gas_limit`
|
|
19
|
+
|
|
20
|
+
`getCosmosChainSpecific` now simulates native Cosmos bank sends via
|
|
21
|
+
`/cosmos/tx/v1beta1/simulate` and relays the padded (`× 1.3`) `gas_used` to
|
|
22
|
+
co-signers in `CosmosSpecific.gas_limit`. The signing-inputs resolver already
|
|
23
|
+
honors this field (scaling the fee amount accordingly) and falls back to the
|
|
24
|
+
static per-chain gas limit when it is absent or zero, so:
|
|
25
|
+
|
|
26
|
+
- Only native bank sends are simulated (a relayed dapp `signData`, token / IBC /
|
|
27
|
+
contract / staking txs, and vault-based chains keep the static limit).
|
|
28
|
+
- Estimation fails closed: any simulate/build error leaves the field unset, so
|
|
29
|
+
simulation never blocks signing and peers converge on the static limit.
|
|
30
|
+
- The relayed limit is part of the SignDoc every device hashes; because it is
|
|
31
|
+
computed with exact integer math (ceil of `gas_used × 13 / 10`) and honored
|
|
32
|
+
identically across peers, cross-device co-signing stays byte-identical.
|
|
33
|
+
|
|
34
|
+
Mirrors the iOS `CosmosGasEstimator` implementation.
|
|
35
|
+
|
|
3
36
|
## 2.23.1
|
|
4
37
|
|
|
5
38
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCardanoAddressAssets.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cardano/client/getCardanoAddressAssets.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;
|
|
1
|
+
{"version":3,"file":"getCardanoAddressAssets.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cardano/client/getCardanoAddressAssets.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AA6BD,mGAAmG;AACnG,eAAO,MAAM,uBAAuB,GAAU,SAAS,MAAM,KAAG,OAAO,CAAC,mBAAmB,EAAE,CA0B5F,CAAA"}
|
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
import { queryUrl } from '@vultisig/lib-utils/query/queryUrl';
|
|
2
2
|
import { cardanoApiUrl } from './config.js';
|
|
3
|
+
// Koios caps every response at 1000 rows (confirmed live: an unbounded
|
|
4
|
+
// address_assets query returns exactly 1000) and paginates via offset/limit.
|
|
5
|
+
// A single unbounded call therefore truncates any wallet holding >1000 native
|
|
6
|
+
// assets - realistic on Cardano since every NFT is its own native asset, so an
|
|
7
|
+
// NFT-heavy wallet blows past 1000 easily. That truncation is silent and hits
|
|
8
|
+
// BOTH callers: the discovery resolver drops tokens past row 1000 entirely, and
|
|
9
|
+
// the per-token balance resolver's `.find()` returns 0 for a token the user
|
|
10
|
+
// actually holds. Page through offsets until a short page proves the end,
|
|
11
|
+
// mirroring getUtxoAddressInfo's blockchair pagination.
|
|
12
|
+
const KOIOS_PAGE_SIZE = 1000;
|
|
13
|
+
// Runaway guard: the loop only stops on a short page, so a misbehaving or
|
|
14
|
+
// offset-ignoring Koios that keeps returning a full 1000-row page would loop
|
|
15
|
+
// forever and grow `rows` unboundedly. Cap the walk far past any real wallet
|
|
16
|
+
// (100 * 1000 = 100k native assets), mirroring the MAX_PAGES guard in the
|
|
17
|
+
// sibling sui/cosmos pagination fixes (#965/#968). The cap is a safety valve,
|
|
18
|
+
// not a truncation limit — no real Cardano wallet holds 100k native assets.
|
|
19
|
+
const MAX_PAGES = 100;
|
|
3
20
|
/** Fetches all native tokens held at a Cardano address via the Koios `address_assets` endpoint. */
|
|
4
21
|
export const getCardanoAddressAssets = async (address) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
const rows = [];
|
|
23
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
24
|
+
const offset = page * KOIOS_PAGE_SIZE;
|
|
25
|
+
const url = `${cardanoApiUrl}/address_assets?limit=${KOIOS_PAGE_SIZE}&offset=${offset}`;
|
|
26
|
+
const pageRows = await queryUrl(url, {
|
|
27
|
+
body: {
|
|
28
|
+
_addresses: [address],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
rows.push(...pageRows);
|
|
32
|
+
if (pageRows.length < KOIOS_PAGE_SIZE) {
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return rows.map(({ policy_id, asset_name, fingerprint, decimals, quantity }) => ({
|
|
12
37
|
policy_id,
|
|
13
38
|
asset_name,
|
|
14
39
|
fingerprint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCardanoAddressAssets.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cardano/client/getCardanoAddressAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAmBxC,mGAAmG;AACnG,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAAE,OAAe,EAAkC,EAAE;IAC/F,MAAM,GAAG,GAAG,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"getCardanoAddressAssets.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cardano/client/getCardanoAddressAssets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAmBxC,uEAAuE;AACvE,6EAA6E;AAC7E,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,4EAA4E;AAC5E,0EAA0E;AAC1E,wDAAwD;AACxD,MAAM,eAAe,GAAG,IAAI,CAAA;AAC5B,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,0EAA0E;AAC1E,8EAA8E;AAC9E,4EAA4E;AAC5E,MAAM,SAAS,GAAG,GAAG,CAAA;AAErB,mGAAmG;AACnG,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAAE,OAAe,EAAkC,EAAE;IAC/F,MAAM,IAAI,GAAgC,EAAE,CAAA;IAE5C,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,GAAG,eAAe,CAAA;QACrC,MAAM,GAAG,GAAG,GAAG,aAAa,yBAAyB,eAAe,WAAW,MAAM,EAAE,CAAA;QACvF,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAA8B,GAAG,EAAE;YAChE,IAAI,EAAE;gBACJ,UAAU,EAAE,CAAC,OAAO,CAAC;aACtB;SACF,CAAC,CAAA;QAEF,IAAI,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA;QAEtB,IAAI,QAAQ,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;YACtC,MAAK;QACP,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/E,SAAS;QACT,UAAU;QACV,WAAW;QACX,QAAQ,EAAE,QAAQ,IAAI,CAAC;QACvB,QAAQ;KACT,CAAC,CAAC,CAAA;AACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CosmosChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
export type CosmosBalanceEntry = {
|
|
3
|
+
denom: string;
|
|
4
|
+
amount: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Fetches EVERY bank balance denom held at a Cosmos address via the LCD REST
|
|
8
|
+
* endpoint, following `pagination.next_key` to completion.
|
|
9
|
+
*
|
|
10
|
+
* cosmjs's `StargateClient.getAllBalances` issues a single unpaginated
|
|
11
|
+
* `QueryAllBalances`, so the node applies its default page limit (100 on most
|
|
12
|
+
* Cosmos SDK chains) and silently truncates. An IBC-heavy wallet (e.g. an
|
|
13
|
+
* active Osmosis DeFi user holding >100 IBC tokens + LP shares) would have
|
|
14
|
+
* every denom past the first 100 dropped from token discovery. This walks the
|
|
15
|
+
* pages so discovery sees the full set. LCD is already the trusted data source
|
|
16
|
+
* for cosmos staking reads and the balance-resolver fallback in this package.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAllCosmosBalances: (chain: CosmosChain, address: string) => Promise<CosmosBalanceEntry[]>;
|
|
19
|
+
//# sourceMappingURL=getAllCosmosBalances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllCosmosBalances.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/account/getAllCosmosBalances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAIxD,MAAM,MAAM,kBAAkB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAA;AAYlE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAU,OAAO,WAAW,EAAE,SAAS,MAAM,KAAG,OAAO,CAAC,kBAAkB,EAAE,CAqB5G,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getCosmosRpcUrl } from '@vultisig/core-chain/chains/cosmos/getCosmosRpcUrl';
|
|
2
|
+
import { queryUrl } from '@vultisig/lib-utils/query/queryUrl';
|
|
3
|
+
const PAGE_LIMIT = 1000;
|
|
4
|
+
// Safety valve against a misbehaving LCD that never returns a null next_key.
|
|
5
|
+
// 1000 denoms/page * 20 pages = 20k denoms, far past any real wallet.
|
|
6
|
+
const MAX_PAGES = 20;
|
|
7
|
+
/**
|
|
8
|
+
* Fetches EVERY bank balance denom held at a Cosmos address via the LCD REST
|
|
9
|
+
* endpoint, following `pagination.next_key` to completion.
|
|
10
|
+
*
|
|
11
|
+
* cosmjs's `StargateClient.getAllBalances` issues a single unpaginated
|
|
12
|
+
* `QueryAllBalances`, so the node applies its default page limit (100 on most
|
|
13
|
+
* Cosmos SDK chains) and silently truncates. An IBC-heavy wallet (e.g. an
|
|
14
|
+
* active Osmosis DeFi user holding >100 IBC tokens + LP shares) would have
|
|
15
|
+
* every denom past the first 100 dropped from token discovery. This walks the
|
|
16
|
+
* pages so discovery sees the full set. LCD is already the trusted data source
|
|
17
|
+
* for cosmos staking reads and the balance-resolver fallback in this package.
|
|
18
|
+
*/
|
|
19
|
+
export const getAllCosmosBalances = async (chain, address) => {
|
|
20
|
+
const base = getCosmosRpcUrl(chain);
|
|
21
|
+
const balances = [];
|
|
22
|
+
let nextKey;
|
|
23
|
+
for (let page = 0; page < MAX_PAGES; page++) {
|
|
24
|
+
const params = new URLSearchParams({ 'pagination.limit': String(PAGE_LIMIT) });
|
|
25
|
+
if (nextKey)
|
|
26
|
+
params.set('pagination.key', nextKey);
|
|
27
|
+
const resp = await queryUrl(`${base}/cosmos/bank/v1beta1/balances/${address}?${params.toString()}`);
|
|
28
|
+
balances.push(...(resp.balances ?? []));
|
|
29
|
+
const key = resp.pagination?.next_key;
|
|
30
|
+
if (!key)
|
|
31
|
+
return balances;
|
|
32
|
+
nextKey = key;
|
|
33
|
+
}
|
|
34
|
+
return balances;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=getAllCosmosBalances.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllCosmosBalances.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/cosmos/account/getAllCosmosBalances.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAS7D,MAAM,UAAU,GAAG,IAAI,CAAA;AACvB,6EAA6E;AAC7E,sEAAsE;AACtE,MAAM,SAAS,GAAG,EAAE,CAAA;AAEpB;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAAkB,EAAE,OAAe,EAAiC,EAAE;IAC/G,MAAM,IAAI,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IACnC,MAAM,QAAQ,GAAyB,EAAE,CAAA;IACzC,IAAI,OAA2B,CAAA;IAE/B,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,kBAAkB,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;QAC9E,IAAI,OAAO;YAAE,MAAM,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;QAElD,MAAM,IAAI,GAAG,MAAM,QAAQ,CACzB,GAAG,IAAI,iCAAiC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,CACvE,CAAA;QAED,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAA;QAEvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAA;QACrC,IAAI,CAAC,GAAG;YAAE,OAAO,QAAQ,CAAA;QACzB,OAAO,GAAG,GAAG,CAAA;IACf,CAAC;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CosmosChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
/**
|
|
3
|
+
* Denoms this SDK will build a tx fee in for `chain`: the chain's own native
|
|
4
|
+
* denom plus the curated alternates above. This is NOT the exhaustive list of
|
|
5
|
+
* every denom the chain's ante handler would accept (Osmosis's real
|
|
6
|
+
* `/osmosis/txfees/v1beta1/fee_tokens` whitelist has 173+ entries) — it's the
|
|
7
|
+
* deliberately-curated subset we support without a live LCD query. Rejecting
|
|
8
|
+
* a `fee_denom` outside this list is a fail-closed product choice (ask the
|
|
9
|
+
* user to pick a supported denom), not a claim that the chain itself would
|
|
10
|
+
* reject it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getCosmosAllowedFeeDenoms: (chain: CosmosChain) => readonly string[];
|
|
13
|
+
/** True when `feeDenom` is one of this SDK's supported gas-fee denoms for `chain` (see {@link getCosmosAllowedFeeDenoms}). */
|
|
14
|
+
export declare const isCosmosFeeDenomAllowed: (chain: CosmosChain, feeDenom: string) => boolean;
|
|
15
|
+
//# sourceMappingURL=cosmosFeeDenomAllowlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosFeeDenomAllowlist.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosFeeDenomAllowlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAkCxD;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,GAAI,OAAO,WAAW,KAAG,SAAS,MAAM,EAG7E,CAAA;AAED,8HAA8H;AAC9H,eAAO,MAAM,uBAAuB,GAAI,OAAO,WAAW,EAAE,UAAU,MAAM,KAAG,OAC1B,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { CosmosChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
import { cosmosFeeCoinDenom } from './cosmosFeeCoinDenom.js';
|
|
3
|
+
/**
|
|
4
|
+
* Non-native denoms a chain's ante handler additionally accepts as a gas fee,
|
|
5
|
+
* beyond its own native `cosmosFeeCoinDenom`. A chain absent here (or with no
|
|
6
|
+
* entry) accepts ONLY its native denom.
|
|
7
|
+
*
|
|
8
|
+
* TerraClassic (columbus-5): live-verified 2026-05-28 deep spike — 3.6% of
|
|
9
|
+
* recent columbus-5 txs paid fee in `uusd` (USTC), all succeeded
|
|
10
|
+
* (tx_response.code: 0), confirmed for MsgWithdrawDelegatorReward /
|
|
11
|
+
* MsgDelegate / MsgBeginRedelegate at heights 28810338 / 28810677 / 28810409.
|
|
12
|
+
* Minimum gas price for uusd = 0.75 uusd/gas (network floor, pinned across
|
|
13
|
+
* all 9 observed minimum-fee txs).
|
|
14
|
+
*
|
|
15
|
+
* Osmosis: the x/txfees module whitelists IBC tokens for fee payment
|
|
16
|
+
* (/osmosis/txfees/v1beta1/fee_tokens has 173+ entries) — hardcoding the
|
|
17
|
+
* top-3 stable/common ones (ATOM, Noble USDC, Axelar USDC) rather than a live
|
|
18
|
+
* LCD query on every fee-denom validation. IBC hashes verified against
|
|
19
|
+
* osmosis-rest.publicnode.com chain-registry 2026-05-31.
|
|
20
|
+
*/
|
|
21
|
+
const COSMOS_ALTERNATE_FEE_DENOMS = {
|
|
22
|
+
[CosmosChain.TerraClassic]: ['uusd'],
|
|
23
|
+
[CosmosChain.Osmosis]: [
|
|
24
|
+
// ATOM from Cosmos Hub (pool 1 - highest liquidity osmosis IBC pair)
|
|
25
|
+
'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
|
|
26
|
+
// USDC from Noble (pool 1464 - primary USDC venue on Osmosis)
|
|
27
|
+
'ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4',
|
|
28
|
+
// axlUSDC from Axelar (pool 678 - legacy USDC before Noble)
|
|
29
|
+
'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858',
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Denoms this SDK will build a tx fee in for `chain`: the chain's own native
|
|
34
|
+
* denom plus the curated alternates above. This is NOT the exhaustive list of
|
|
35
|
+
* every denom the chain's ante handler would accept (Osmosis's real
|
|
36
|
+
* `/osmosis/txfees/v1beta1/fee_tokens` whitelist has 173+ entries) — it's the
|
|
37
|
+
* deliberately-curated subset we support without a live LCD query. Rejecting
|
|
38
|
+
* a `fee_denom` outside this list is a fail-closed product choice (ask the
|
|
39
|
+
* user to pick a supported denom), not a claim that the chain itself would
|
|
40
|
+
* reject it.
|
|
41
|
+
*/
|
|
42
|
+
export const getCosmosAllowedFeeDenoms = (chain) => [
|
|
43
|
+
cosmosFeeCoinDenom[chain],
|
|
44
|
+
...(COSMOS_ALTERNATE_FEE_DENOMS[chain] ?? []),
|
|
45
|
+
];
|
|
46
|
+
/** True when `feeDenom` is one of this SDK's supported gas-fee denoms for `chain` (see {@link getCosmosAllowedFeeDenoms}). */
|
|
47
|
+
export const isCosmosFeeDenomAllowed = (chain, feeDenom) => getCosmosAllowedFeeDenoms(chain).includes(feeDenom);
|
|
48
|
+
//# sourceMappingURL=cosmosFeeDenomAllowlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosFeeDenomAllowlist.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosFeeDenomAllowlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,2BAA2B,GAAoD;IACnF,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,CAAC,MAAM,CAAC;IACpC,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QACrB,qEAAqE;QACrE,sEAAsE;QACtE,8DAA8D;QAC9D,sEAAsE;QACtE,4DAA4D;QAC5D,sEAAsE;KACvE;CACF,CAAA;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAkB,EAAqB,EAAE,CAAC;IAClF,kBAAkB,CAAC,KAAK,CAAC;IACzB,GAAG,CAAC,2BAA2B,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;CAC9C,CAAA;AAED,8HAA8H;AAC9H,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAkB,EAAE,QAAgB,EAAW,EAAE,CACvF,yBAAyB,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CosmosChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
/**
|
|
3
|
+
* cosmos-sdk `x/auth.MaxMemoCharacters` default. Every cosmos chain we have
|
|
4
|
+
* live-verified (against its own `/cosmos/auth/v1beta1/params` endpoint) either
|
|
5
|
+
* uses this default or a gov-raised override below — do not add a new override
|
|
6
|
+
* on assumption alone, curl the chain's own auth params first (different
|
|
7
|
+
* chains pick different caps and they can change via governance).
|
|
8
|
+
*/
|
|
9
|
+
export declare const COSMOS_MEMO_DEFAULT_MAX_BYTES = 256;
|
|
10
|
+
/**
|
|
11
|
+
* The `x/auth.MaxMemoCharacters` byte cap for a cosmos chain's outer
|
|
12
|
+
* `TxBody.memo` field. A tx whose memo exceeds this is rejected at broadcast
|
|
13
|
+
* with sdk error code 12 ("memo too long") - AFTER the user has already signed,
|
|
14
|
+
* burning the signing ceremony for nothing. Check this before building any
|
|
15
|
+
* cosmos tx with a caller-supplied memo.
|
|
16
|
+
*/
|
|
17
|
+
export declare const getCosmosMemoMaxBytes: (chain: CosmosChain) => number;
|
|
18
|
+
/**
|
|
19
|
+
* Same as {@link getCosmosMemoMaxBytes}, keyed by the chain's live chain-id
|
|
20
|
+
* string (e.g. Skip Go route responses identify chains this way, not by the
|
|
21
|
+
* SDK's `CosmosChain` enum). Falls back to the sdk default for an unrecognized
|
|
22
|
+
* chain-id rather than skipping the check.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getCosmosMemoMaxBytesByChainId: (chainId: string) => number;
|
|
25
|
+
/**
|
|
26
|
+
* True when `memo`'s UTF-8 byte length fits within `chain`'s live
|
|
27
|
+
* `MaxMemoCharacters` cap. Uses `TextEncoder` (not Node's `Buffer`) so this
|
|
28
|
+
* is safe to call from the RN bridge too.
|
|
29
|
+
*/
|
|
30
|
+
export declare const isCosmosMemoWithinCap: (chain: CosmosChain, memo: string) => boolean;
|
|
31
|
+
//# sourceMappingURL=cosmosMemoCap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosMemoCap.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosMemoCap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAIxD;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,MAAM,CAAA;AAiBhD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,WAAW,KAAG,MACc,CAAA;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,GAAI,SAAS,MAAM,KAAG,MAGhE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,OAAO,WAAW,EAAE,MAAM,MAAM,KAAG,OACF,CAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CosmosChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
import { getCosmosChainByChainId } from './chainInfo.js';
|
|
3
|
+
/**
|
|
4
|
+
* cosmos-sdk `x/auth.MaxMemoCharacters` default. Every cosmos chain we have
|
|
5
|
+
* live-verified (against its own `/cosmos/auth/v1beta1/params` endpoint) either
|
|
6
|
+
* uses this default or a gov-raised override below — do not add a new override
|
|
7
|
+
* on assumption alone, curl the chain's own auth params first (different
|
|
8
|
+
* chains pick different caps and they can change via governance).
|
|
9
|
+
*/
|
|
10
|
+
export const COSMOS_MEMO_DEFAULT_MAX_BYTES = 256;
|
|
11
|
+
/**
|
|
12
|
+
* Chains whose gov-set `MaxMemoCharacters` differs from the cosmos-sdk default.
|
|
13
|
+
* A chain absent here uses `COSMOS_MEMO_DEFAULT_MAX_BYTES` (256), not "no cap" -
|
|
14
|
+
* that default closes the fail-open gap of an unmapped chain never getting
|
|
15
|
+
* checked, which fails on virtually every cosmos chain in practice.
|
|
16
|
+
*/
|
|
17
|
+
const COSMOS_MEMO_MAX_BYTES_OVERRIDES = {
|
|
18
|
+
// Terra v2 (phoenix-1): live-verified 512 (2026-06-22, /cosmos/auth params) -
|
|
19
|
+
// Terra raised MaxMemoCharacters above the sdk default.
|
|
20
|
+
[CosmosChain.Terra]: 512,
|
|
21
|
+
// Cosmos Hub (cosmoshub-4): live-verified 512 (2026-06-22, /cosmos/auth params) -
|
|
22
|
+
// gov-raised above the sdk default.
|
|
23
|
+
[CosmosChain.Cosmos]: 512,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The `x/auth.MaxMemoCharacters` byte cap for a cosmos chain's outer
|
|
27
|
+
* `TxBody.memo` field. A tx whose memo exceeds this is rejected at broadcast
|
|
28
|
+
* with sdk error code 12 ("memo too long") - AFTER the user has already signed,
|
|
29
|
+
* burning the signing ceremony for nothing. Check this before building any
|
|
30
|
+
* cosmos tx with a caller-supplied memo.
|
|
31
|
+
*/
|
|
32
|
+
export const getCosmosMemoMaxBytes = (chain) => COSMOS_MEMO_MAX_BYTES_OVERRIDES[chain] ?? COSMOS_MEMO_DEFAULT_MAX_BYTES;
|
|
33
|
+
/**
|
|
34
|
+
* Same as {@link getCosmosMemoMaxBytes}, keyed by the chain's live chain-id
|
|
35
|
+
* string (e.g. Skip Go route responses identify chains this way, not by the
|
|
36
|
+
* SDK's `CosmosChain` enum). Falls back to the sdk default for an unrecognized
|
|
37
|
+
* chain-id rather than skipping the check.
|
|
38
|
+
*/
|
|
39
|
+
export const getCosmosMemoMaxBytesByChainId = (chainId) => {
|
|
40
|
+
const chain = getCosmosChainByChainId(chainId);
|
|
41
|
+
return chain !== undefined ? getCosmosMemoMaxBytes(chain) : COSMOS_MEMO_DEFAULT_MAX_BYTES;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* True when `memo`'s UTF-8 byte length fits within `chain`'s live
|
|
45
|
+
* `MaxMemoCharacters` cap. Uses `TextEncoder` (not Node's `Buffer`) so this
|
|
46
|
+
* is safe to call from the RN bridge too.
|
|
47
|
+
*/
|
|
48
|
+
export const isCosmosMemoWithinCap = (chain, memo) => new TextEncoder().encode(memo).length <= getCosmosMemoMaxBytes(chain);
|
|
49
|
+
//# sourceMappingURL=cosmosMemoCap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmosMemoCap.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/cosmosMemoCap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAExD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAErD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,+BAA+B,GAAyC;IAC5E,8EAA8E;IAC9E,wDAAwD;IACxD,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,GAAG;IACxB,kFAAkF;IAClF,oCAAoC;IACpC,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,GAAG;CAC1B,CAAA;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAkB,EAAU,EAAE,CAClE,+BAA+B,CAAC,KAAK,CAAC,IAAI,6BAA6B,CAAA;AAEzE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,OAAe,EAAU,EAAE;IACxE,MAAM,KAAK,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAA;IAC9C,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAA;AAC3F,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAkB,EAAE,IAAY,EAAW,EAAE,CACjF,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,qBAAqB,CAAC,KAAK,CAAC,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
type ResolveCosmosGasFeeInput = {
|
|
15
|
+
/** static per-chain fee amount already stored in `CosmosSpecific.gas` */
|
|
16
|
+
gas: bigint;
|
|
17
|
+
/** relayed `CosmosSpecific.gas_limit` (undefined / 0 → use the static limit) */
|
|
18
|
+
relayedGasLimit: bigint | undefined;
|
|
19
|
+
/** static per-chain gas limit (`getCosmosGasLimit`) */
|
|
20
|
+
staticGasLimit: bigint;
|
|
21
|
+
};
|
|
22
|
+
type ResolveCosmosGasFeeResult = {
|
|
23
|
+
resolvedGasLimit: bigint;
|
|
24
|
+
feeAmount: bigint;
|
|
25
|
+
};
|
|
26
|
+
export declare const resolveCosmosGasFee: ({ gas, relayedGasLimit, staticGasLimit, }: ResolveCosmosGasFeeInput) => ResolveCosmosGasFeeResult;
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=resolveCosmosGasFee.d.ts.map
|
|
@@ -0,0 +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;CACvB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,gBAAgB,EAAE,MAAM,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,2CAIjC,wBAAwB,KAAG,yBAO7B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const resolveCosmosGasFee = ({ gas, relayedGasLimit, staticGasLimit, }) => {
|
|
2
|
+
const resolvedGasLimit = relayedGasLimit && relayedGasLimit > 0n ? relayedGasLimit : staticGasLimit;
|
|
3
|
+
const feeAmount = resolvedGasLimit > staticGasLimit ? (gas * resolvedGasLimit + staticGasLimit - 1n) / staticGasLimit : gas;
|
|
4
|
+
return { resolvedGasLimit, feeAmount };
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=resolveCosmosGasFee.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveCosmosGasFee.js","sourceRoot":"","sources":["../../../../../../packages/core/chain/chains/cosmos/resolveCosmosGasFee.ts"],"names":[],"mappings":"AA2BA,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,GAAG,EACH,eAAe,EACf,cAAc,GACW,EAA6B,EAAE;IACxD,MAAM,gBAAgB,GAAG,eAAe,IAAI,eAAe,GAAG,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,cAAc,CAAA;IAEnG,MAAM,SAAS,GACb,gBAAgB,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,gBAAgB,GAAG,cAAc,GAAG,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,CAAA;IAE3G,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,CAAA;AACxC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplAccounts.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/solana/spl/getSplAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAK3C,eAAO,MAAM,cAAc,GAAU,SAAS,MAAM;;;
|
|
1
|
+
{"version":3,"file":"getSplAccounts.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/solana/spl/getSplAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAK3C,eAAO,MAAM,cAAc,GAAU,SAAS,MAAM;;;IA2BnD,CAAA"}
|
|
@@ -4,9 +4,20 @@ import { splTokenProgramId, token2022ProgramId } from '../config.js';
|
|
|
4
4
|
export const getSplAccounts = async (address) => {
|
|
5
5
|
const client = getSolanaClient();
|
|
6
6
|
const programs = [splTokenProgramId, token2022ProgramId];
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const owner = new PublicKey(address);
|
|
8
|
+
// Query the SPL Token and Token-2022 programs independently. Previously this
|
|
9
|
+
// used Promise.all, so a transient RPC failure on EITHER program's query
|
|
10
|
+
// rejected the whole call and hid the other program's holdings entirely (a
|
|
11
|
+
// user with normal SPL tokens would see nothing if only the token-2022 query
|
|
12
|
+
// hiccuped). Use allSettled: return whatever succeeded, and only throw when
|
|
13
|
+
// BOTH fail (so a real outage surfaces an error rather than a false-empty
|
|
14
|
+
// "you have no tokens").
|
|
15
|
+
const responses = await Promise.allSettled(programs.map(programId => client.getParsedTokenAccountsByOwner(owner, { programId: new PublicKey(programId) })));
|
|
16
|
+
const fulfilled = responses.filter((r) => r.status === 'fulfilled');
|
|
17
|
+
if (fulfilled.length === 0) {
|
|
18
|
+
const firstRejection = responses.find((r) => r.status === 'rejected');
|
|
19
|
+
throw firstRejection?.reason ?? new Error('getSplAccounts: all token-program queries failed');
|
|
20
|
+
}
|
|
21
|
+
return fulfilled.flatMap(response => response.value.value);
|
|
11
22
|
};
|
|
12
23
|
//# sourceMappingURL=getSplAccounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSplAccounts.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/solana/spl/getSplAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEjE,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,E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CAAC,MAAM,KAAK,UAAU,CAAC,CAAA;QACjG,MAAM,cAAc,EAAE,MAAM,IAAI,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;IAC/F,CAAC;IAED,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTonAccountInfo.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/ton/account/getTonAccountInfo.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTonAccountInfo.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/ton/account/getTonAccountInfo.ts"],"names":[],"mappings":"AAkCA,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM;aA5B1C;QACP,eAAe,EAAE,MAAM,CAAA;KACxB;aACQ,MAAM;yBACM;QACnB,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,MAAM,CAAA;KACb;cACS;QACR,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,EAAE,MAAM,CAAA;QACb,SAAS,EAAE,MAAM,CAAA;QACjB,SAAS,EAAE,MAAM,CAAA;KAClB;gBACW,MAAM;oBAIF;QACd,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;KACd;cACS,MAAM;cACN,MAAM;GAsBnB"}
|
|
@@ -2,7 +2,19 @@ import { rootApiUrl } from '@vultisig/core-config';
|
|
|
2
2
|
import { queryUrl } from '@vultisig/lib-utils/query/queryUrl';
|
|
3
3
|
export async function getTonAccountInfo(address) {
|
|
4
4
|
const url = `${rootApiUrl}/ton/v2/getExtendedAddressInformation?address=${address}`;
|
|
5
|
-
const
|
|
6
|
-
|
|
5
|
+
const response = await queryUrl(url);
|
|
6
|
+
// `assertFetchResponse` only checks the HTTP status, not the toncenter-style
|
|
7
|
+
// `{ "ok": false, "result": null }` body shape, so a transient RPC failure
|
|
8
|
+
// slips through as a 200 with a null `result`. Returning that null lets the
|
|
9
|
+
// caller crash on a destructure (`const { account_state } = undefined`) with a
|
|
10
|
+
// cryptic TypeError that aborts the whole keysign chain-specific step. Fail
|
|
11
|
+
// closed with a descriptive error instead — a genuinely uninitialized wallet
|
|
12
|
+
// still returns `ok: true` with an `uninited.accountState` result, so this only
|
|
13
|
+
// trips on a real fetch/RPC failure where signing with a guessed seqno would be
|
|
14
|
+
// wrong anyway.
|
|
15
|
+
if (!response?.ok || !response.result) {
|
|
16
|
+
throw new Error(`TON getExtendedAddressInformation returned no result for ${address}`);
|
|
17
|
+
}
|
|
18
|
+
return response.result;
|
|
7
19
|
}
|
|
8
20
|
//# sourceMappingURL=getTonAccountInfo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTonAccountInfo.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/ton/account/getTonAccountInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"getTonAccountInfo.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/chains/ton/account/getTonAccountInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAA;AAiC7D,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAe;IACrD,MAAM,GAAG,GAAG,GAAG,UAAU,iDAAiD,OAAO,EAAE,CAAA;IACnF,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAyB,GAAG,CAAC,CAAA;IAE5D,6EAA6E;IAC7E,2EAA2E;IAC3E,4EAA4E;IAC5E,+EAA+E;IAC/E,4EAA4E;IAC5E,6EAA6E;IAC7E,gFAAgF;IAChF,gFAAgF;IAChF,gBAAgB;IAChB,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,4DAA4D,OAAO,EAAE,CAAC,CAAA;IACxF,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,CAAA;AACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/coin/balance/resolvers/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAOxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAuCjD,eAAO,MAAM,oBAAoB,EAAE,mBAAmB,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/coin/balance/resolvers/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAOxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAuCjD,eAAO,MAAM,oBAAoB,EAAE,mBAAmB,CAAC,WAAW,CA6BjE,CAAA"}
|
|
@@ -35,6 +35,9 @@ const fetchBalanceViaLcd = async (chain, address, denom) => {
|
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
export const getCosmosCoinBalance = async (input) => {
|
|
38
|
+
if (input.id !== undefined && !input.id) {
|
|
39
|
+
throw new Error('getCosmosCoinBalance: coin id must be non-empty when provided');
|
|
40
|
+
}
|
|
38
41
|
if (isCosmosWasmTokenId(input.id)) {
|
|
39
42
|
const url = getCosmosWasmTokenBalanceUrl(input);
|
|
40
43
|
const { data } = await queryUrl(url);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.js","sour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,CAAC,CAAA;QAC/C,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAoB,GAAG,CAAC,CAAA;QACvD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;IAClC,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAEjD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE7B,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC7D,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;IAExC,wEAAwE;IACxE,wEAAwE;IACxE,iEAAiE;IACjE,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;QACrB,MAAM,SAAS,GAAG,MAAM,kBAAkB,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC7E,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,GAAG,EAAE,EAAE,CAAC;YACzC,OAAO,SAAS,CAAA;QAClB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/coin/find/resolvers/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/chain/coin/find/resolvers/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAOxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AA0D3E,eAAO,MAAM,eAAe,EAAE,iBAAiB,CAAC,WAAW,CAyC1D,CAAA"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { CosmosChain } from '@vultisig/core-chain/Chain';
|
|
2
|
+
import { getAllCosmosBalances } from '@vultisig/core-chain/chains/cosmos/account/getAllCosmosBalances';
|
|
2
3
|
import { getCosmosClient } from '@vultisig/core-chain/chains/cosmos/client';
|
|
3
4
|
import { cosmosFeeCoinDenom } from '@vultisig/core-chain/chains/cosmos/cosmosFeeCoinDenom';
|
|
4
5
|
import { tcyAutoCompounderConfig } from '@vultisig/core-chain/chains/cosmos/thor/tcy-autocompound/config';
|
|
5
6
|
import { chainFeeCoin } from '@vultisig/core-chain/coin/chainFeeCoin';
|
|
6
7
|
import { getCosmosTokenMetadata } from '@vultisig/core-chain/coin/token/metadata/resolvers/cosmos';
|
|
7
8
|
import { without } from '@vultisig/lib-utils/array/without';
|
|
9
|
+
import { attempt } from '@vultisig/lib-utils/attempt';
|
|
8
10
|
const AUTO_DISCOVERY_CHAINS = new Set([
|
|
9
11
|
CosmosChain.THORChain,
|
|
10
12
|
CosmosChain.Terra,
|
|
@@ -50,8 +52,13 @@ const getDiscoveredDenom = async (chain, denom) => getCosmosTokenMetadata({ chai
|
|
|
50
52
|
export const findCosmosCoins = async ({ address, chain }) => {
|
|
51
53
|
if (!AUTO_DISCOVERY_CHAINS.has(chain))
|
|
52
54
|
return [];
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
// Prefer the LCD path, which paginates over every denom. cosmjs's
|
|
56
|
+
// getAllBalances issues a single unpaginated query capped at the node's
|
|
57
|
+
// default page limit (100), silently dropping tokens past 100 on IBC-heavy
|
|
58
|
+
// wallets. Fall back to cosmjs on any LCD failure so we never regress below
|
|
59
|
+
// today's behavior.
|
|
60
|
+
const { data: lcdBalances } = await attempt(getAllCosmosBalances(chain, address));
|
|
61
|
+
const balances = lcdBalances ?? (await (await getCosmosClient(chain)).getAllBalances(address));
|
|
55
62
|
const coins = await Promise.all(without(balances.map(({ denom }) => denom), cosmosFeeCoinDenom[chain], tcyAutoCompounderConfig.shareDenom).map(denom => getDiscoveredDenom(chain, denom)));
|
|
56
63
|
return without(coins.map(({ denom, metadata, isHidden }) => {
|
|
57
64
|
const coinTicker = (metadata?.ticker || getFallbackTicker(denom))?.toUpperCase();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cosmos.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/coin/find/resolvers/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAA;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAA;AACzG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAGrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAA;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"cosmos.js","sourceRoot":"","sources":["../../../../../../../packages/core/chain/coin/find/resolvers/cosmos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAA;AACtG,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAA;AAC1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iEAAiE,CAAA;AACzG,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAGrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAA;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,M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,KAAK,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAA;YACvD,OAAM;QACR,CAAC;QAED,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK;YACL,QAAQ,EAAE,QAAQ,EAAE,QAAQ,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC,QAAQ;YAC5D,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,QAAQ,EAAE,IAAI,IAAI,UAAU,CAAC,WAAW,EAAE;YAChD,GAAG,CAAC,QAAQ,EAAE,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,QAAQ,CAAC,eAAe,EAAE,CAAC;YACjG,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAC;YACjE,OAAO;SACR,CAAA;IACH,CAAC,CAAC,EACF,SAAS,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/coin/find/resolvers/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAKrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/chain/coin/find/resolvers/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAKrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAoE3E,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,QAAQ,CAoGpD,CAAA"}
|