@keplr-wallet/stores 0.12.300-rc.0 → 0.12.304
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/build/account/babylon.js +7 -19
- package/build/account/babylon.js.map +1 -1
- package/build/account/base.js +5 -7
- package/build/account/base.js.map +1 -1
- package/build/account/cosmos.js +54 -94
- package/build/account/cosmos.js.map +1 -1
- package/build/account/cosmwasm.js +2 -10
- package/build/account/cosmwasm.js.map +1 -1
- package/build/account/secret.js +2 -10
- package/build/account/secret.js.map +1 -1
- package/build/account/store.js +4 -4
- package/build/account/store.js.map +1 -1
- package/build/chain/base.d.ts +1 -122
- package/build/chain/base.js +40 -601
- package/build/chain/base.js.map +1 -1
- package/build/chain/types.d.ts +1 -27
- package/build/common/utils/index.d.ts +2 -2
- package/build/common/utils/index.js.map +1 -1
- package/build/lsm/currency-registrar.js +7 -7
- package/build/lsm/currency-registrar.js.map +1 -1
- package/build/query/balances.js +11 -24
- package/build/query/balances.js.map +1 -1
- package/build/query/chain-query.js +2 -2
- package/build/query/chain-query.js.map +1 -1
- package/build/query/chain-rpc-query.js +2 -2
- package/build/query/chain-rpc-query.js.map +1 -1
- package/build/query/cosmos/balance/balances.js +4 -8
- package/build/query/cosmos/balance/balances.js.map +1 -1
- package/build/query/cosmos/balance/spendable.js +2 -3
- package/build/query/cosmos/balance/spendable.js.map +1 -1
- package/build/query/cosmos/ibc/channel.js +2 -3
- package/build/query/cosmos/ibc/channel.js.map +1 -1
- package/build/query/cosmos/ibc/client-state.js +2 -2
- package/build/query/cosmos/ibc/client-state.js.map +1 -1
- package/build/query/cosmos/ibc/denom-trace.js +8 -6
- package/build/query/cosmos/ibc/denom-trace.js.map +1 -1
- package/build/query/cosmos/staking/babylon-btc-delegation-reward.js +2 -3
- package/build/query/cosmos/staking/babylon-btc-delegation-reward.js.map +1 -1
- package/build/query/cosmos/staking/delegations.js +4 -5
- package/build/query/cosmos/staking/delegations.js.map +1 -1
- package/build/query/cosmos/staking/initia-delegations.js +6 -8
- package/build/query/cosmos/staking/initia-delegations.js.map +1 -1
- package/build/query/cosmos/staking/initia-unbonding-delegations.js +5 -6
- package/build/query/cosmos/staking/initia-unbonding-delegations.js.map +1 -1
- package/build/query/cosmos/staking/initia-validators.js +3 -3
- package/build/query/cosmos/staking/initia-validators.js.map +1 -1
- package/build/query/cosmos/staking/pool.js +3 -3
- package/build/query/cosmos/staking/pool.js.map +1 -1
- package/build/query/cosmos/staking/rewards.js +10 -13
- package/build/query/cosmos/staking/rewards.js.map +1 -1
- package/build/query/cosmos/staking/unbonding-delegations.js +3 -3
- package/build/query/cosmos/staking/unbonding-delegations.js.map +1 -1
- package/build/query/cosmos/staking/validators.js +3 -2
- package/build/query/cosmos/staking/validators.js.map +1 -1
- package/build/query/cosmwasm/contract-query.js +2 -2
- package/build/query/cosmwasm/contract-query.js.map +1 -1
- package/build/query/cosmwasm/cw20-balance.js +4 -7
- package/build/query/cosmwasm/cw20-balance.js.map +1 -1
- package/build/query/cosmwasm/neutron/staking-rewards.js +8 -10
- package/build/query/cosmwasm/neutron/staking-rewards.js.map +1 -1
- package/build/query/noble/swap/simulate-swap.js +1 -1
- package/build/query/noble/swap/simulate-swap.js.map +1 -1
- package/build/query/osmosis/txfees/fee-tokens/index.js +4 -8
- package/build/query/osmosis/txfees/fee-tokens/index.js.map +1 -1
- package/build/query/secret-wasm/secret20-balance.js +5 -7
- package/build/query/secret-wasm/secret20-balance.js.map +1 -1
- package/build/token-factory/currency-registrar.js +1 -1
- package/build/token-factory/currency-registrar.js.map +1 -1
- package/package.json +15 -11
- package/src/account/babylon.ts +7 -21
- package/src/account/base.ts +5 -7
- package/src/account/cosmos.ts +66 -121
- package/src/account/cosmwasm.ts +3 -12
- package/src/account/secret.ts +3 -12
- package/src/account/store.ts +4 -4
- package/src/chain/base.ts +34 -816
- package/src/chain/types.ts +1 -27
- package/src/common/utils/index.ts +2 -2
- package/src/lsm/currency-registrar.ts +7 -9
- package/src/query/balances.ts +13 -30
- package/src/query/chain-query.ts +2 -6
- package/src/query/chain-rpc-query.ts +2 -6
- package/src/query/cosmos/balance/balances.ts +4 -8
- package/src/query/cosmos/balance/spendable.ts +3 -3
- package/src/query/cosmos/ibc/channel.ts +2 -5
- package/src/query/cosmos/ibc/client-state.ts +2 -2
- package/src/query/cosmos/ibc/denom-trace.ts +7 -7
- package/src/query/cosmos/staking/babylon-btc-delegation-reward.ts +2 -5
- package/src/query/cosmos/staking/delegations.ts +4 -9
- package/src/query/cosmos/staking/initia-delegations.ts +7 -14
- package/src/query/cosmos/staking/initia-unbonding-delegations.ts +6 -12
- package/src/query/cosmos/staking/initia-validators.ts +3 -5
- package/src/query/cosmos/staking/pool.ts +3 -3
- package/src/query/cosmos/staking/rewards.ts +10 -13
- package/src/query/cosmos/staking/unbonding-delegations.ts +3 -7
- package/src/query/cosmos/staking/validators.ts +3 -4
- package/src/query/cosmwasm/contract-query.ts +2 -4
- package/src/query/cosmwasm/cw20-balance.ts +5 -8
- package/src/query/cosmwasm/neutron/staking-rewards.ts +8 -10
- package/src/query/noble/swap/simulate-swap.ts +1 -1
- package/src/query/osmosis/txfees/fee-tokens/index.ts +4 -8
- package/src/query/secret-wasm/secret20-balance.ts +5 -7
- package/src/token-factory/currency-registrar.ts +1 -1
|
@@ -96,7 +96,7 @@ export class ObservableQueryValidatorsInner extends ObservableChainQuery<Validat
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
protected override canFetch(): boolean {
|
|
99
|
-
if (!this.chainGetter.
|
|
99
|
+
if (!this.chainGetter.getChain(this.chainId).stakeCurrency) {
|
|
100
100
|
return false;
|
|
101
101
|
}
|
|
102
102
|
return super.canFetch();
|
|
@@ -185,9 +185,8 @@ export class ObservableQueryValidatorsInner extends ObservableChainQuery<Validat
|
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
).stakeCurrency;
|
|
188
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
189
|
+
const stakeCurrency = chainInfo.stakeCurrency;
|
|
191
190
|
|
|
192
191
|
if (!stakeCurrency) {
|
|
193
192
|
return;
|
|
@@ -30,10 +30,8 @@ export class ObservableCosmwasmContractChainQuery<
|
|
|
30
30
|
super.onStart();
|
|
31
31
|
|
|
32
32
|
this.disposer = autorun(() => {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
);
|
|
36
|
-
if (modularChainInfoImpl.hasFeature("wasmd_0.24+")) {
|
|
33
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
34
|
+
if (chainInfo.features && chainInfo.features.includes("wasmd_0.24+")) {
|
|
37
35
|
if (this.url.startsWith("/wasm/v1/")) {
|
|
38
36
|
this.setUrl(`/cosmwasm${this.url}`);
|
|
39
37
|
}
|
|
@@ -35,12 +35,10 @@ export class ObservableQueryCw20BalanceImpl
|
|
|
35
35
|
get balance(): CoinPretty {
|
|
36
36
|
const denom = this.denomHelper.denom;
|
|
37
37
|
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
39
|
+
const currency = chainInfo.currencies.find(
|
|
40
|
+
(cur) => cur.coinMinimalDenom === denom
|
|
40
41
|
);
|
|
41
|
-
const currency = modularChainInfoImpl
|
|
42
|
-
.getCurrencies()
|
|
43
|
-
.find((cur) => cur.coinMinimalDenom === denom);
|
|
44
42
|
|
|
45
43
|
// TODO: Infer the currency according to its denom (such if denom is `uatom` -> `Atom` with decimal 6)?
|
|
46
44
|
if (!currency) {
|
|
@@ -58,9 +56,8 @@ export class ObservableQueryCw20BalanceImpl
|
|
|
58
56
|
get currency(): AppCurrency {
|
|
59
57
|
const denom = this.denomHelper.denom;
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
.forceFindCurrency(denom);
|
|
59
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
60
|
+
return chainInfo.forceFindCurrency(denom);
|
|
64
61
|
}
|
|
65
62
|
}
|
|
66
63
|
|
|
@@ -41,24 +41,23 @@ class ObservableQueryNeutronStakingRewardsInner extends ObservableCosmwasmContra
|
|
|
41
41
|
@computed
|
|
42
42
|
get pendingReward(): CoinPretty {
|
|
43
43
|
if (!this.response?.data?.pending_rewards) {
|
|
44
|
-
const chainInfo = this.chainGetter.
|
|
44
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
45
45
|
const defaultCurrency =
|
|
46
|
-
chainInfo.stakeCurrency || chainInfo.
|
|
46
|
+
chainInfo.stakeCurrency || chainInfo.currencies[0];
|
|
47
47
|
|
|
48
48
|
return new CoinPretty(defaultCurrency, new Int(0)).ready(false);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const reward = this.response.data.pending_rewards;
|
|
52
52
|
if (!reward.denom || !reward.amount) {
|
|
53
|
-
const chainInfo = this.chainGetter.
|
|
53
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
54
54
|
const defaultCurrency =
|
|
55
|
-
chainInfo.stakeCurrency || chainInfo.
|
|
55
|
+
chainInfo.stakeCurrency || chainInfo.currencies[0];
|
|
56
56
|
|
|
57
57
|
return new CoinPretty(defaultCurrency, new Int(0)).ready(false);
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
.forceFindCurrency(reward.denom);
|
|
59
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
60
|
+
const currency = chainInfo.forceFindCurrency(reward.denom);
|
|
62
61
|
|
|
63
62
|
return new CoinPretty(currency, new Int(reward.amount)).ready(
|
|
64
63
|
!this.isFetching
|
|
@@ -74,9 +73,8 @@ class ObservableQueryNeutronStakingRewardsInner extends ObservableCosmwasmContra
|
|
|
74
73
|
if (!reward.denom || !reward.amount) {
|
|
75
74
|
return undefined;
|
|
76
75
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.findCurrency(reward.denom);
|
|
76
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
77
|
+
return chainInfo.findCurrency(reward.denom);
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
|
|
@@ -72,7 +72,7 @@ export class ObservableQueryNobleSwapSimulateSwapInner extends ObservableChainQu
|
|
|
72
72
|
|
|
73
73
|
return new CoinPretty(
|
|
74
74
|
this.chainGetter
|
|
75
|
-
.
|
|
75
|
+
.getChain(this.chainId)
|
|
76
76
|
.forceFindCurrency(this.response.data.result.denom),
|
|
77
77
|
this.response.data.result.amount
|
|
78
78
|
);
|
|
@@ -27,12 +27,9 @@ export class ObservableQueryTxFeesFeeTokens extends ObservableChainQuery<FeeToke
|
|
|
27
27
|
) {
|
|
28
28
|
super.onReceiveResponse(response);
|
|
29
29
|
|
|
30
|
-
const chainInfo = this.chainGetter.
|
|
30
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
31
31
|
const denoms = response.data.fee_tokens.map((token) => token.denom);
|
|
32
|
-
chainInfo.addUnknownDenoms(
|
|
33
|
-
module: "cosmos",
|
|
34
|
-
coinMinimalDenoms: denoms,
|
|
35
|
-
});
|
|
32
|
+
chainInfo.addUnknownDenoms(...denoms);
|
|
36
33
|
}
|
|
37
34
|
|
|
38
35
|
@computed
|
|
@@ -66,10 +63,9 @@ export class ObservableQueryTxFeesFeeTokens extends ObservableChainQuery<FeeToke
|
|
|
66
63
|
|
|
67
64
|
const res: FeeCurrency[] = [];
|
|
68
65
|
|
|
66
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
69
67
|
for (const token of this.response.data.fee_tokens) {
|
|
70
|
-
const currency =
|
|
71
|
-
.getModularChainInfoImpl(this.chainId)
|
|
72
|
-
.findCurrency(token.denom);
|
|
68
|
+
const currency = chainInfo.findCurrency(token.denom);
|
|
73
69
|
if (currency) {
|
|
74
70
|
res.push(currency);
|
|
75
71
|
}
|
|
@@ -33,7 +33,7 @@ export class ObservableQuerySecret20BalanceImpl
|
|
|
33
33
|
throw new Error(`Denom helper must be secret20: ${denomHelper.denom}`);
|
|
34
34
|
}
|
|
35
35
|
const currency = chainGetter
|
|
36
|
-
.
|
|
36
|
+
.getChain(chainId)
|
|
37
37
|
.forceFindCurrency(denomHelper.denom);
|
|
38
38
|
let viewingKey = "";
|
|
39
39
|
if ("type" in currency && currency.type === "secret20") {
|
|
@@ -92,9 +92,8 @@ export class ObservableQuerySecret20BalanceImpl
|
|
|
92
92
|
get balance(): CoinPretty {
|
|
93
93
|
const denom = this.denomHelper.denom;
|
|
94
94
|
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
.findCurrency(denom);
|
|
95
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
96
|
+
const currency = chainInfo.findCurrency(denom);
|
|
98
97
|
|
|
99
98
|
// TODO: Infer the currency according to its denom (such if denom is `uatom` -> `Atom` with decimal 6)?
|
|
100
99
|
if (!currency) {
|
|
@@ -112,9 +111,8 @@ export class ObservableQuerySecret20BalanceImpl
|
|
|
112
111
|
get currency(): AppCurrency {
|
|
113
112
|
const denom = this.denomHelper.denom;
|
|
114
113
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
.forceFindCurrency(denom);
|
|
114
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
115
|
+
return chainInfo.forceFindCurrency(denom);
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
|