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