@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
package/build/account/babylon.js
CHANGED
|
@@ -22,12 +22,8 @@ class BabylonAccountImpl {
|
|
|
22
22
|
}
|
|
23
23
|
makeDelegateTx(amount, validatorAddress) {
|
|
24
24
|
var _a;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
28
|
-
}
|
|
29
|
-
cosmos_1.Bech32Address.validate(validatorAddress, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
30
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
25
|
+
cosmos_1.Bech32Address.validate(validatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
26
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
31
27
|
if (!currency) {
|
|
32
28
|
throw new Error("Stake currency is null");
|
|
33
29
|
}
|
|
@@ -69,12 +65,8 @@ class BabylonAccountImpl {
|
|
|
69
65
|
}
|
|
70
66
|
makeUndelegateTx(amount, validatorAddress) {
|
|
71
67
|
var _a;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
75
|
-
}
|
|
76
|
-
cosmos_1.Bech32Address.validate(validatorAddress, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
77
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
68
|
+
cosmos_1.Bech32Address.validate(validatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
69
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
78
70
|
if (!currency) {
|
|
79
71
|
throw new Error("Stake currency is null");
|
|
80
72
|
}
|
|
@@ -116,13 +108,9 @@ class BabylonAccountImpl {
|
|
|
116
108
|
}
|
|
117
109
|
makeBeginRedelegateTx(amount, srcValidatorAddress, dstValidatorAddress) {
|
|
118
110
|
var _a, _b;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
cosmos_1.Bech32Address.validate(srcValidatorAddress, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
124
|
-
cosmos_1.Bech32Address.validate(dstValidatorAddress, (_b = modularChainInfo.cosmos.bech32Config) === null || _b === void 0 ? void 0 : _b.bech32PrefixValAddr);
|
|
125
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
111
|
+
cosmos_1.Bech32Address.validate(srcValidatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
112
|
+
cosmos_1.Bech32Address.validate(dstValidatorAddress, (_b = this.chainGetter.getChain(this.chainId).bech32Config) === null || _b === void 0 ? void 0 : _b.bech32PrefixValAddr);
|
|
113
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
126
114
|
if (!currency) {
|
|
127
115
|
throw new Error("Stake currency is null");
|
|
128
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babylon.js","sourceRoot":"","sources":["../../src/account/babylon.ts"],"names":[],"mappings":";;;AAUA,6CAAmD;AACnD,yEAI0D;AAC1D,iDAAqD;AAOxC,QAAA,cAAc,GAAG;IAC5B,GAAG,CAAC,OAEH;QAKC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE;YACpC,OAAO;gBACL,OAAO,EAAE,IAAI,kBAAkB,CAC7B,IAAI,EACJ,WAAW,EACX,OAAO,EACP,OAAO,CAAC,YAAY,CACrB;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAa,kBAAkB;IAC7B,YACqB,IAAoC,EACpC,WAAwB,EACxB,OAAe,EACf,YAElB;QALkB,SAAI,GAAJ,IAAI,CAAgC;QACpC,gBAAW,GAAX,WAAW,CAAa;QACxB,YAAO,GAAP,OAAO,CAAQ;QACf,iBAAY,GAAZ,YAAY,CAE9B;IACA,CAAC;IAEJ,cAAc,CAAC,MAAc,EAAE,gBAAwB;;QACrD,
|
|
1
|
+
{"version":3,"file":"babylon.js","sourceRoot":"","sources":["../../src/account/babylon.ts"],"names":[],"mappings":";;;AAUA,6CAAmD;AACnD,yEAI0D;AAC1D,iDAAqD;AAOxC,QAAA,cAAc,GAAG;IAC5B,GAAG,CAAC,OAEH;QAKC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE;YACpC,OAAO;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,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB;4BACjD,mBAAmB,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB;4BACxD,mBAAmB,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,qBAAqB;4BACxD,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM;yBAC7B;qBACF,CAAC,CAAC,MAAM,EAAE;iBACZ;aACF;SACF,EACD,CAAC,EAAE,EAAE,EAAE;YACL,IAAI,EAAE,CAAC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE;gBACpC,sEAAsE;gBACtE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC;aAC5D;QACH,CAAC,CACF,CAAC;IACJ,CAAC;IAED,IAAc,OAAO;QAGnB,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;CACF;AA9LD,gDA8LC"}
|
package/build/account/base.js
CHANGED
|
@@ -247,13 +247,11 @@ class AccountSetBase {
|
|
|
247
247
|
}
|
|
248
248
|
get hasEthereumHexAddress() {
|
|
249
249
|
var _a, _b;
|
|
250
|
-
const chainInfo = this.chainGetter.
|
|
251
|
-
return (
|
|
252
|
-
|
|
253
|
-
(
|
|
254
|
-
|
|
255
|
-
!!((_a = chainInfo.cosmos.features) === null || _a === void 0 ? void 0 : _a.includes("eth-address-gen")) ||
|
|
256
|
-
!!((_b = chainInfo.cosmos.features) === null || _b === void 0 ? void 0 : _b.includes("eth-key-sign")))));
|
|
250
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
251
|
+
return (chainInfo.evm != null ||
|
|
252
|
+
chainInfo.bip44.coinType === 60 ||
|
|
253
|
+
!!((_a = chainInfo.features) === null || _a === void 0 ? void 0 : _a.includes("eth-address-gen")) ||
|
|
254
|
+
!!((_b = chainInfo.features) === null || _b === void 0 ? void 0 : _b.includes("eth-key-sign")));
|
|
257
255
|
}
|
|
258
256
|
get ethereumHexAddress() {
|
|
259
257
|
return this._ethereumHexAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/account/base.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,+BAA0E;AAG1E,iDAAgE;AAIhE,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,qCAAqB,CAAA;AACvB,CAAC,EANW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAMvB;AAgBD,MAAa,cAAc;IA8CzB,YACqB,aAGlB,EACkB,WAAwB,EACxB,OAAe,EACf,aAAmC,EACnC,IAAoB;QAPpB,kBAAa,GAAb,aAAa,CAG/B;QACkB,gBAAW,GAAX,WAAW,CAAa;QACxB,YAAO,GAAP,OAAO,CAAQ;QACf,kBAAa,GAAb,aAAa,CAAsB;QACnC,SAAI,GAAJ,IAAI,CAAgB;QApD/B,mBAAc,GAAuB,SAAS,CAAC;QAG/C,kBAAa,GAAiB,YAAY,CAAC,OAAO,CAAC;QAGnD,qBAAgB,GAAsB,SAAS,CAAC;QAGhD,UAAK,GAAW,EAAE,CAAC;QAGnB,mBAAc,GAAW,EAAE,CAAC;QAE5B,wBAAmB,GAAW,EAAE,CAAC;QAEjC,wBAAmB,GAAW,EAAE,CAAC;QAEjC,oBAAe,GAOT,SAAS,CAAC;QAEhB,kBAAa,GAAY,KAAK,CAAC;QAE/B,gBAAW,GAAY,KAAK,CAAC;QAG7B,sBAAiB,GAAW,EAAE,CAAC;QAI/B,cAAS,GAAG,KAAK,CAAC;QAElB,uBAAkB,GAIS,EAAE,CAAC;QAgEvB,eAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,I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IADT,iBAAU;sDAC2B;AAE5B;IADT,iBAAU;2DACgC;AAEjC;IADT,iBAAU;2DACgC;AAEjC;IADT,iBAAU;uDAQe;AAEhB;IADT,iBAAU;qDAC8B;AAE/B;IADT,iBAAU;mDAC4B;AAG7B;IADT,iBAAU;yDAC8B;AA6EjC;IADP,WAAI;0CA2GJ;AAGM;IADN,aAAM;gDAgBN;AAOD;IADC,eAAQ;qDAKR;AAMD;IADC,eAAQ;uDAKR;AAhQH,wCA4VC;AAED,MAAa,mBAAoB,SAAQ,cAAc;IACrD,YAAY,GAAG,MAAoD;QACjE,KAAK,CAAC,GAAG,MAAM,CAAC,CAAC;QAEjB,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAGD,mBAAmB,CAAC,IAAY;QAC9B,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAChC,CAAC;CACF;AAHC;IADC,aAAM;8DAGN;AAVH,kDAWC"}
|
package/build/account/cosmos.js
CHANGED
|
@@ -108,11 +108,7 @@ class CosmosAccountImpl {
|
|
|
108
108
|
dec = dec.mul(unit_1.DecUtils.getPrecisionDec(currency.coinDecimals));
|
|
109
109
|
return dec.truncate().toString();
|
|
110
110
|
})();
|
|
111
|
-
|
|
112
|
-
if (!("cosmos" in modularChainInfo)) {
|
|
113
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
114
|
-
}
|
|
115
|
-
cosmos_1.Bech32Address.validate(recipient, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixAccAddr);
|
|
111
|
+
cosmos_1.Bech32Address.validate(recipient, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixAccAddr);
|
|
116
112
|
const isThorchain = this.chainId.startsWith("thorchain-");
|
|
117
113
|
const msg = {
|
|
118
114
|
type: this.msgOpts.send.native.type,
|
|
@@ -217,11 +213,7 @@ class CosmosAccountImpl {
|
|
|
217
213
|
if (onBroadcasted) {
|
|
218
214
|
onBroadcasted(txHash);
|
|
219
215
|
}
|
|
220
|
-
const
|
|
221
|
-
if (!("cosmos" in modularChainInfo)) {
|
|
222
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
223
|
-
}
|
|
224
|
-
const txTracer = new cosmos_1.TendermintTxTracer(modularChainInfo.cosmos.rpc, "/websocket", {
|
|
216
|
+
const txTracer = new cosmos_1.TendermintTxTracer(this.chainGetter.getChain(this.chainId).rpc, "/websocket", {
|
|
225
217
|
wsObject: this.txOpts.wsObject,
|
|
226
218
|
});
|
|
227
219
|
txTracer.traceTx(txHash).then((tx) => {
|
|
@@ -281,12 +273,10 @@ class CosmosAccountImpl {
|
|
|
281
273
|
throw new Error("The length of aminoMsgs and protoMsgs are different");
|
|
282
274
|
}
|
|
283
275
|
}
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const account = yield cosmos_1.BaseAccount.fetchFromRest(modularChainInfo.cosmos.rest, this.base.bech32Address, true);
|
|
289
|
-
const useEthereumSign = ((_a = modularChainInfo.cosmos.features) === null || _a === void 0 ? void 0 : _a.includes("eth-key-sign")) === true;
|
|
276
|
+
const account = yield cosmos_1.BaseAccount.fetchFromRest(this.chainGetter.getChain(this.chainId).rest, this.base.bech32Address, true);
|
|
277
|
+
const useEthereumSign = ((_a = this.chainGetter
|
|
278
|
+
.getChain(this.chainId)
|
|
279
|
+
.features) === null || _a === void 0 ? void 0 : _a.includes("eth-key-sign")) === true;
|
|
290
280
|
const eip712Signing = useEthereumSign && this.base.isNanoLedger;
|
|
291
281
|
if (eip712Signing && !msgs.rlpTypes) {
|
|
292
282
|
throw new Error("RLP types information is needed for signing tx for ethermint chain with ledger");
|
|
@@ -297,7 +287,6 @@ class CosmosAccountImpl {
|
|
|
297
287
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
298
288
|
const keplr = (yield this.base.getKeplr());
|
|
299
289
|
const signedTx = yield (() => __awaiter(this, void 0, void 0, function* () {
|
|
300
|
-
var _b;
|
|
301
290
|
if (isDirectSign) {
|
|
302
291
|
return yield this.createSignedTxWithDirectSign(keplr, account, msgs.protoMsgs, fee, memo, signOptions);
|
|
303
292
|
}
|
|
@@ -310,9 +299,11 @@ class CosmosAccountImpl {
|
|
|
310
299
|
msgs: aminoMsgs,
|
|
311
300
|
memo: (0, common_1.escapeHTML)(memo),
|
|
312
301
|
};
|
|
302
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
313
303
|
const chainIsInjective = this.chainId.startsWith("injective");
|
|
314
304
|
const chainIsStratos = this.chainId.startsWith("stratos");
|
|
315
|
-
const ethSignPlainJson =
|
|
305
|
+
const ethSignPlainJson = chainInfo.features &&
|
|
306
|
+
chainInfo.features.includes("evm-ledger-sign-plain-json");
|
|
316
307
|
if (eip712Signing) {
|
|
317
308
|
if (chainIsInjective) {
|
|
318
309
|
// Due to injective's problem, it should exist if injective with ledger.
|
|
@@ -350,7 +341,7 @@ class CosmosAccountImpl {
|
|
|
350
341
|
if (!eip712Signing) {
|
|
351
342
|
return yield signAmino(this.chainId, this.base.bech32Address, signDoc, signOptions);
|
|
352
343
|
}
|
|
353
|
-
return yield experimentalSignEIP712CosmosTx_v0(this.chainId, this.base.bech32Address, (0, utils_1.getEip712TypedDataBasedOnChainInfo)(
|
|
344
|
+
return yield experimentalSignEIP712CosmosTx_v0(this.chainId, this.base.bech32Address, (0, utils_1.getEip712TypedDataBasedOnChainInfo)(this.chainGetter.getChain(this.chainId), msgs), signDoc, signOptions);
|
|
354
345
|
}))();
|
|
355
346
|
return {
|
|
356
347
|
tx: tx_1.TxRaw.encode({
|
|
@@ -362,8 +353,7 @@ class CosmosAccountImpl {
|
|
|
362
353
|
? [
|
|
363
354
|
{
|
|
364
355
|
typeUrl: (() => {
|
|
365
|
-
|
|
366
|
-
if ((_a = modularChainInfo.cosmos.features) === null || _a === void 0 ? void 0 : _a.includes("/cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) {
|
|
356
|
+
if (chainInfo.hasFeature("/cosmos.evm.types.v1.ExtensionOptionsWeb3Tx")) {
|
|
367
357
|
return "/cosmos.evm.types.v1.ExtensionOptionsWeb3Tx";
|
|
368
358
|
}
|
|
369
359
|
if (chainIsInjective) {
|
|
@@ -389,7 +379,6 @@ class CosmosAccountImpl {
|
|
|
389
379
|
{
|
|
390
380
|
publicKey: {
|
|
391
381
|
typeUrl: (() => {
|
|
392
|
-
var _a, _b;
|
|
393
382
|
if (!useEthereumSign) {
|
|
394
383
|
return "/cosmos.crypto.secp256k1.PubKey";
|
|
395
384
|
}
|
|
@@ -399,10 +388,10 @@ class CosmosAccountImpl {
|
|
|
399
388
|
if (chainIsStratos) {
|
|
400
389
|
return "/stratos.crypto.v1.ethsecp256k1.PubKey";
|
|
401
390
|
}
|
|
402
|
-
if (
|
|
391
|
+
if (chainInfo.hasFeature("eth-secp256k1-cosmos")) {
|
|
403
392
|
return "/cosmos.evm.crypto.v1.ethsecp256k1.PubKey";
|
|
404
393
|
}
|
|
405
|
-
if (
|
|
394
|
+
if (chainInfo.hasFeature("eth-secp256k1-initia")) {
|
|
406
395
|
return "/initia.crypto.v1beta1.ethsecp256k1.PubKey";
|
|
407
396
|
}
|
|
408
397
|
return "/ethermint.crypto.v1.ethsecp256k1.PubKey";
|
|
@@ -453,9 +442,11 @@ class CosmosAccountImpl {
|
|
|
453
442
|
});
|
|
454
443
|
}
|
|
455
444
|
createSignedTxWithDirectSign(keplr, account, protoMsgs, fee, memo, signOptions) {
|
|
445
|
+
var _a;
|
|
456
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
457
|
-
const
|
|
458
|
-
|
|
447
|
+
const useEthereumSign = ((_a = this.chainGetter
|
|
448
|
+
.getChain(this.chainId)
|
|
449
|
+
.features) === null || _a === void 0 ? void 0 : _a.includes("eth-key-sign")) === true;
|
|
459
450
|
const chainIsInjective = this.chainId.startsWith("injective");
|
|
460
451
|
const chainIsStratos = this.chainId.startsWith("stratos");
|
|
461
452
|
// Should use bind to avoid "this" problem
|
|
@@ -482,10 +473,14 @@ class CosmosAccountImpl {
|
|
|
482
473
|
if (chainIsStratos) {
|
|
483
474
|
return "/stratos.crypto.v1.ethsecp256k1.PubKey";
|
|
484
475
|
}
|
|
485
|
-
if (
|
|
476
|
+
if (this.chainGetter
|
|
477
|
+
.getChain(this.chainId)
|
|
478
|
+
.hasFeature("eth-secp256k1-cosmos")) {
|
|
486
479
|
return "/cosmos.evm.crypto.v1.ethsecp256k1.PubKey";
|
|
487
480
|
}
|
|
488
|
-
if (
|
|
481
|
+
if (this.chainGetter
|
|
482
|
+
.getChain(this.chainId)
|
|
483
|
+
.hasFeature("eth-secp256k1-initia")) {
|
|
489
484
|
return "/initia.crypto.v1beta1.ethsecp256k1.PubKey";
|
|
490
485
|
}
|
|
491
486
|
return "/ethermint.crypto.v1.ethsecp256k1.PubKey";
|
|
@@ -545,11 +540,7 @@ class CosmosAccountImpl {
|
|
|
545
540
|
*/
|
|
546
541
|
simulateTx(msgs, fee, memo = "") {
|
|
547
542
|
return __awaiter(this, void 0, void 0, function* () {
|
|
548
|
-
const
|
|
549
|
-
if (!("cosmos" in modularChainInfo)) {
|
|
550
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
551
|
-
}
|
|
552
|
-
const account = yield cosmos_1.BaseAccount.fetchFromRest(modularChainInfo.cosmos.rest, this.base.bech32Address, true);
|
|
543
|
+
const account = yield cosmos_1.BaseAccount.fetchFromRest(this.chainGetter.getChain(this.chainId).rest, this.base.bech32Address, true);
|
|
553
544
|
const unsignedTx = tx_1.TxRaw.encode({
|
|
554
545
|
bodyBytes: tx_1.TxBody.encode(tx_1.TxBody.fromPartial({
|
|
555
546
|
messages: msgs,
|
|
@@ -581,7 +572,7 @@ class CosmosAccountImpl {
|
|
|
581
572
|
signatures: [new Uint8Array(64)],
|
|
582
573
|
}).finish();
|
|
583
574
|
// TODO: Add response type
|
|
584
|
-
const result = yield (0, simple_fetch_1.simpleFetch)(
|
|
575
|
+
const result = yield (0, simple_fetch_1.simpleFetch)(this.chainGetter.getChain(this.chainId).rest, "/cosmos/tx/v1beta1/simulate", {
|
|
585
576
|
method: "POST",
|
|
586
577
|
headers: {
|
|
587
578
|
"content-type": "application/json",
|
|
@@ -674,28 +665,22 @@ class CosmosAccountImpl {
|
|
|
674
665
|
throw new Error("No channels");
|
|
675
666
|
}
|
|
676
667
|
const destinationChainId = channels[channels.length - 1].counterpartyChainId;
|
|
677
|
-
const destinationChainInfo = this.chainGetter.
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
}
|
|
681
|
-
cosmos_1.Bech32Address.validate(recipient, (_a = destinationChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixAccAddr);
|
|
682
|
-
const counterpartyChainInfo = this.chainGetter.getModularChain(channels[0].counterpartyChainId);
|
|
683
|
-
if (!("cosmos" in counterpartyChainInfo)) {
|
|
684
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
685
|
-
}
|
|
686
|
-
const counterpartyChainBech32Config = counterpartyChainInfo.cosmos.bech32Config;
|
|
668
|
+
const destinationChainInfo = this.chainGetter.getChain(destinationChainId);
|
|
669
|
+
cosmos_1.Bech32Address.validate(recipient, (_a = destinationChainInfo.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixAccAddr);
|
|
670
|
+
const counterpartyChainBech32Config = this.chainGetter.getChain(channels[0].counterpartyChainId).bech32Config;
|
|
687
671
|
if (counterpartyChainBech32Config == null) {
|
|
688
672
|
throw new Error("Counterparty chain bech32 config is not set");
|
|
689
673
|
}
|
|
690
674
|
return this.makeIBCTransferTxWithAsyncMemoConstructor(channels[0], amount, currency, () => __awaiter(this, void 0, void 0, function* () {
|
|
691
675
|
if (channels.length === 1) {
|
|
692
|
-
|
|
676
|
+
const chainInfo = this.chainGetter.getChain(channels[0].counterpartyChainId);
|
|
677
|
+
if (!chainInfo.bech32Config) {
|
|
693
678
|
throw new Error("Bech32 config is not set");
|
|
694
679
|
}
|
|
695
|
-
return cosmos_1.Bech32Address.fromBech32(recipient).toBech32(
|
|
680
|
+
return cosmos_1.Bech32Address.fromBech32(recipient).toBech32(chainInfo.bech32Config.bech32PrefixAccAddr);
|
|
696
681
|
}
|
|
697
682
|
const channel = channels[0];
|
|
698
|
-
const destChainInfo = this.chainGetter.
|
|
683
|
+
const destChainInfo = this.chainGetter.getChain(channel.counterpartyChainId);
|
|
699
684
|
const account = accountStore.getAccount(destChainInfo.chainId);
|
|
700
685
|
if (account.walletStatus !== base_1.WalletStatus.Loaded) {
|
|
701
686
|
account.init();
|
|
@@ -727,14 +712,11 @@ class CosmosAccountImpl {
|
|
|
727
712
|
for (let i = 0; i < loopChannels.length; i++) {
|
|
728
713
|
const channel = loopChannels[i];
|
|
729
714
|
if (i === loopChannels.length - 1) {
|
|
730
|
-
const chainInfo = this.chainGetter.
|
|
731
|
-
if (!
|
|
732
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
733
|
-
}
|
|
734
|
-
if (!chainInfo.cosmos.bech32Config) {
|
|
715
|
+
const chainInfo = this.chainGetter.getChain(channel.counterpartyChainId);
|
|
716
|
+
if (!chainInfo.bech32Config) {
|
|
735
717
|
throw new Error("Bech32 config is not set");
|
|
736
718
|
}
|
|
737
|
-
cosmos_1.Bech32Address.validate(recipient, chainInfo.
|
|
719
|
+
cosmos_1.Bech32Address.validate(recipient, chainInfo.bech32Config.bech32PrefixAccAddr);
|
|
738
720
|
const forward = {
|
|
739
721
|
receiver: recipient,
|
|
740
722
|
port: channel.portId,
|
|
@@ -752,7 +734,7 @@ class CosmosAccountImpl {
|
|
|
752
734
|
lastForward = forward;
|
|
753
735
|
}
|
|
754
736
|
else {
|
|
755
|
-
const destChainInfo = this.chainGetter.
|
|
737
|
+
const destChainInfo = this.chainGetter.getChain(channel.counterpartyChainId);
|
|
756
738
|
const account = accountStore.getAccount(destChainInfo.chainId);
|
|
757
739
|
if (account.walletStatus !== base_1.WalletStatus.Loaded) {
|
|
758
740
|
account.init();
|
|
@@ -811,6 +793,7 @@ class CosmosAccountImpl {
|
|
|
811
793
|
const destinationInfo = this.queriesStore.get(channel.counterpartyChainId)
|
|
812
794
|
.cosmos.queryRPCStatus;
|
|
813
795
|
return this.makeTx("ibcTransfer", () => __awaiter(this, void 0, void 0, function* () {
|
|
796
|
+
var _a;
|
|
814
797
|
// Wait until fetching complete.
|
|
815
798
|
yield destinationInfo.waitFreshResponse();
|
|
816
799
|
if (!destinationInfo.network) {
|
|
@@ -824,9 +807,9 @@ class CosmosAccountImpl {
|
|
|
824
807
|
destinationInfo.latestBlockHeight.equals(new unit_1.Int("0"))) {
|
|
825
808
|
throw new Error(`Failed to fetch the latest block of ${channel.counterpartyChainId}`);
|
|
826
809
|
}
|
|
827
|
-
const useEthereumSign = this.chainGetter
|
|
828
|
-
.
|
|
829
|
-
.
|
|
810
|
+
const useEthereumSign = ((_a = this.chainGetter
|
|
811
|
+
.getChain(this.chainId)
|
|
812
|
+
.features) === null || _a === void 0 ? void 0 : _a.includes("eth-key-sign")) === true;
|
|
830
813
|
const eip712Signing = useEthereumSign && this.base.isNanoLedger;
|
|
831
814
|
const chainIsInjective = this.chainId.startsWith("injective");
|
|
832
815
|
let memo = yield memoConstructor();
|
|
@@ -878,7 +861,7 @@ class CosmosAccountImpl {
|
|
|
878
861
|
if (this.chainId.startsWith("injective") ||
|
|
879
862
|
this.chainId.startsWith("stride") ||
|
|
880
863
|
this.chainGetter
|
|
881
|
-
.
|
|
864
|
+
.getChain(this.chainId)
|
|
882
865
|
.hasFeature("ibc-go-v7-hot-fix")) {
|
|
883
866
|
return true;
|
|
884
867
|
}
|
|
@@ -1043,13 +1026,10 @@ class CosmosAccountImpl {
|
|
|
1043
1026
|
}
|
|
1044
1027
|
makeRevokeMsg(grantee, messageType) {
|
|
1045
1028
|
var _a;
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
cosmos_1.Bech32Address.validate(grantee, (_a = modularChainInfoImpl.embedded.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixAccAddr);
|
|
1051
|
-
const msg = cosmos_1.ChainIdHelper.parse(this.chainId).identifier === "osmosis" ||
|
|
1052
|
-
modularChainInfoImpl.hasFeature("authz-msg-revoke-fixed")
|
|
1029
|
+
cosmos_1.Bech32Address.validate(grantee, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixAccAddr);
|
|
1030
|
+
const chainInfo = this.chainGetter.getChain(this.chainId);
|
|
1031
|
+
const msg = chainInfo.chainIdentifier === "osmosis" ||
|
|
1032
|
+
chainInfo.hasFeature("authz-msg-revoke-fixed")
|
|
1053
1033
|
? {
|
|
1054
1034
|
type: "cosmos-sdk/MsgRevoke",
|
|
1055
1035
|
value: {
|
|
@@ -1085,12 +1065,8 @@ class CosmosAccountImpl {
|
|
|
1085
1065
|
}
|
|
1086
1066
|
makeDelegateTx(amount, validatorAddress) {
|
|
1087
1067
|
var _a;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
1091
|
-
}
|
|
1092
|
-
cosmos_1.Bech32Address.validate(validatorAddress, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1093
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
1068
|
+
cosmos_1.Bech32Address.validate(validatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1069
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
1094
1070
|
if (!currency) {
|
|
1095
1071
|
throw new Error("Stake currency is null");
|
|
1096
1072
|
}
|
|
@@ -1179,11 +1155,7 @@ class CosmosAccountImpl {
|
|
|
1179
1155
|
sendDelegateMsg(amount, validatorAddress, memo = "", stdFee = {}, signOptions, onTxEvents) {
|
|
1180
1156
|
var _a, _b;
|
|
1181
1157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1182
|
-
const
|
|
1183
|
-
if (!("cosmos" in modularChainInfo)) {
|
|
1184
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
1185
|
-
}
|
|
1186
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
1158
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
1187
1159
|
if (!currency) {
|
|
1188
1160
|
throw new Error("Stake currency is null");
|
|
1189
1161
|
}
|
|
@@ -1233,12 +1205,8 @@ class CosmosAccountImpl {
|
|
|
1233
1205
|
}
|
|
1234
1206
|
makeUndelegateTx(amount, validatorAddress) {
|
|
1235
1207
|
var _a;
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
1239
|
-
}
|
|
1240
|
-
cosmos_1.Bech32Address.validate(validatorAddress, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1241
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
1208
|
+
cosmos_1.Bech32Address.validate(validatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1209
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
1242
1210
|
if (!currency) {
|
|
1243
1211
|
throw new Error("Stake currency is null");
|
|
1244
1212
|
}
|
|
@@ -1364,13 +1332,9 @@ class CosmosAccountImpl {
|
|
|
1364
1332
|
}
|
|
1365
1333
|
makeBeginRedelegateTx(amount, srcValidatorAddress, dstValidatorAddress) {
|
|
1366
1334
|
var _a, _b;
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
}
|
|
1371
|
-
cosmos_1.Bech32Address.validate(srcValidatorAddress, (_a = modularChainInfo.cosmos.bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1372
|
-
cosmos_1.Bech32Address.validate(dstValidatorAddress, (_b = modularChainInfo.cosmos.bech32Config) === null || _b === void 0 ? void 0 : _b.bech32PrefixValAddr);
|
|
1373
|
-
const currency = modularChainInfo.cosmos.stakeCurrency;
|
|
1335
|
+
cosmos_1.Bech32Address.validate(srcValidatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1336
|
+
cosmos_1.Bech32Address.validate(dstValidatorAddress, (_b = this.chainGetter.getChain(this.chainId).bech32Config) === null || _b === void 0 ? void 0 : _b.bech32PrefixValAddr);
|
|
1337
|
+
const currency = this.chainGetter.getChain(this.chainId).stakeCurrency;
|
|
1374
1338
|
if (!currency) {
|
|
1375
1339
|
throw new Error("Stake currency is null");
|
|
1376
1340
|
}
|
|
@@ -1493,12 +1457,8 @@ class CosmosAccountImpl {
|
|
|
1493
1457
|
}
|
|
1494
1458
|
makeWithdrawDelegationRewardTx(validatorAddresses) {
|
|
1495
1459
|
var _a;
|
|
1496
|
-
const modularChainInfo = this.chainGetter.getModularChain(this.chainId);
|
|
1497
|
-
if (!("cosmos" in modularChainInfo)) {
|
|
1498
|
-
throw new Error("cosmos module is not supported on this chain");
|
|
1499
|
-
}
|
|
1500
1460
|
for (const validatorAddress of validatorAddresses) {
|
|
1501
|
-
cosmos_1.Bech32Address.validate(validatorAddress, (_a =
|
|
1461
|
+
cosmos_1.Bech32Address.validate(validatorAddress, (_a = this.chainGetter.getChain(this.chainId).bech32Config) === null || _a === void 0 ? void 0 : _a.bech32PrefixValAddr);
|
|
1502
1462
|
}
|
|
1503
1463
|
return this.makeTx("withdrawRewards", () => __awaiter(this, void 0, void 0, function* () {
|
|
1504
1464
|
let msgs = validatorAddresses.map((validatorAddress) => {
|