@firmachain/firma-js 0.2.64 → 0.3.1
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/README.md +1 -1
- package/dist/sdk/FirmaAuthzService.d.ts +8 -8
- package/dist/sdk/FirmaAuthzService.js +12 -6
- package/dist/sdk/FirmaBankService.d.ts +4 -4
- package/dist/sdk/FirmaContractService.d.ts +4 -4
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCw721.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +9 -9
- package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.js +2 -3
- package/dist/sdk/FirmaDistributionService.d.ts +6 -6
- package/dist/sdk/FirmaFeeGrantService.d.ts +4 -4
- package/dist/sdk/FirmaGovService.d.ts +27 -16
- package/dist/sdk/FirmaGovService.js +305 -195
- package/dist/sdk/FirmaIbcService.d.ts +3 -4
- package/dist/sdk/FirmaIbcService.js +5 -2
- package/dist/sdk/FirmaNftService.d.ts +5 -5
- package/dist/sdk/FirmaStakingService.d.ts +6 -6
- package/dist/sdk/FirmaTokenService.d.ts +5 -5
- package/dist/sdk/FirmaUtil.d.ts +1 -1
- package/dist/sdk/FirmaUtil.js +12 -14
- package/dist/sdk/firmachain/amino/addresses.js +1 -1
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +10 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +5 -1
- package/dist/sdk/firmachain/amino/aminotypes.js +27 -10
- package/dist/sdk/firmachain/amino/coins.d.ts +14 -2
- package/dist/sdk/firmachain/amino/coins.js +26 -5
- package/dist/sdk/firmachain/amino/encoding.d.ts +10 -1
- package/dist/sdk/firmachain/amino/encoding.js +21 -3
- package/dist/sdk/firmachain/amino/signdoc.d.ts +21 -3
- package/dist/sdk/firmachain/amino/signdoc.js +37 -11
- package/dist/sdk/firmachain/amino/signer.d.ts +2 -1
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +7 -6
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +7 -6
- package/dist/sdk/firmachain/bank/BankQueryClient.js +1 -1
- package/dist/sdk/firmachain/common/CommonTxClient.js +11 -9
- package/dist/sdk/firmachain/common/ITxClient.d.ts +6 -6
- package/dist/sdk/firmachain/common/ITxClient.js +82 -24
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +4 -9
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +37 -32
- package/dist/sdk/firmachain/common/LedgerWallet.js +4 -8
- package/dist/sdk/firmachain/common/TxCommon.d.ts +1 -2
- package/dist/sdk/firmachain/common/accounts.d.ts +7 -3
- package/dist/sdk/firmachain/common/accounts.js +28 -33
- package/dist/sdk/firmachain/common/aminotypes.d.ts +19 -0
- package/dist/sdk/firmachain/common/aminotypes.js +74 -0
- package/dist/sdk/firmachain/common/events.d.ts +32 -0
- package/dist/sdk/firmachain/common/events.js +18 -0
- package/dist/sdk/firmachain/common/fee.d.ts +26 -0
- package/dist/sdk/firmachain/common/fee.js +83 -0
- package/dist/sdk/firmachain/common/index.d.ts +1 -0
- package/dist/sdk/firmachain/common/index.js +3 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.js +64 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +15 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.js +9 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +35 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +85 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.js +12 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.js +128 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +14 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +44 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +113 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.js +15 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.js +171 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +18 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +14 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.js +8 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +9 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.js +81 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +79 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +152 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +29 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.js +38 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +19 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.js +160 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.js +8 -0
- package/dist/sdk/firmachain/common/modules/group/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/messages.js +28 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +38 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +55 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.js +32 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +58 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.js +576 -0
- package/dist/sdk/firmachain/common/modules/index.d.ts +32 -0
- package/dist/sdk/firmachain/common/modules/index.js +101 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +21 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.js +95 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +12 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +112 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +234 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +33 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.js +37 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +23 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.js +242 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +11 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.js +103 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +56 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.js +7 -0
- package/dist/sdk/firmachain/common/queryclient/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/queryclient/index.js +10 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +75 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.js +157 -0
- package/dist/sdk/firmachain/common/queryclient/utils.d.ts +33 -0
- package/dist/sdk/firmachain/common/queryclient/utils.js +101 -0
- package/dist/sdk/firmachain/common/search.d.ts +10 -0
- package/dist/sdk/firmachain/common/search.js +7 -0
- package/dist/sdk/firmachain/common/signing.d.ts +8 -3
- package/dist/sdk/firmachain/common/signing.js +24 -12
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +107 -30
- package/dist/sdk/firmachain/common/signingstargateclient.js +445 -128
- package/dist/sdk/firmachain/common/stargateclient.d.ts +184 -20
- package/dist/sdk/firmachain/common/stargateclient.js +351 -35
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +2 -2
- package/dist/sdk/firmachain/contract/ContractTxClient.js +4 -4
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +3 -3
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +1 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +5 -5
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +10 -8
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/any.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/duration.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +2 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +13 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +9 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +12 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +11 -1
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +3 -3
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -6
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/nft/NftTxTypes.js +4 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +1 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +0 -1
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +4 -4
- package/dist/sdk/firmachain/token/TokenTxClient.js +8 -8
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/token/TokenTxTypes.js +5 -5
- package/dist/test/00.wallet.test.js +15 -9
- package/dist/test/01.contract_tx.test.js +53 -45
- package/dist/test/02.contract_query.test.js +54 -31
- package/dist/test/03.contract_scenario.test.js +170 -326
- package/dist/test/04.bank_tx.test.js +58 -59
- package/dist/test/05.bank_query.test.js +51 -56
- package/dist/test/06.feegrant_tx.test.js +74 -89
- package/dist/test/07.feegrant_query.test.js +69 -27
- package/dist/test/08.gas_estimate.test.js +422 -392
- package/dist/test/09.ipfs.test.js +3 -3
- package/dist/test/10.nft_tx.test.js +108 -76
- package/dist/test/11.nft_query.test.js +41 -46
- package/dist/test/12.staking_tx.test.js +81 -98
- package/dist/test/13.staking_query.test.js +66 -12
- package/dist/test/14.distribution_tx.test.js +69 -78
- package/dist/test/15.distribution_query.test.js +81 -57
- package/dist/test/16.gov_tx.test.js +247 -107
- package/dist/test/17.gov_query.test.js +48 -9
- package/dist/test/18.util.test.js +6 -1
- package/dist/test/19.chain.test.js +50 -4
- package/dist/test/20.slashing_query.test.js +31 -1
- package/dist/test/21.token_tx.test.js +48 -56
- package/dist/test/22.token_query.test.js +24 -20
- package/dist/test/23.authz_tx.test.js +119 -240
- package/dist/test/24.authz_query.test.js +116 -56
- package/dist/test/25.cosmwasm_tx.test.js +95 -57
- package/dist/test/26.cosmwasm_query.test.js +66 -26
- package/dist/test/27.arbitary_sign.test.js +59 -67
- package/dist/test/28.ibc_tx.test.js +29 -17
- package/dist/test/29.mint_query.test.js +2 -0
- package/dist/test/30.cw20_tx.test.js +161 -226
- package/dist/test/31.cw20_query.test.js +183 -37
- package/dist/test/32.cw721_tx.test.js +147 -149
- package/dist/test/33.cw721_query.test.js +188 -36
- package/dist/test/34.cw_bridge_tx.test.js +266 -155
- package/dist/test/35.cw_bridge_tx_low.test.js +221 -81
- package/dist/test/36.cw_bridge_query.test.js +157 -21
- package/dist/test/37.cw_marketplace_tx.test.js +22 -22
- package/dist/test/38.cw_marketplace_query.test.js +9 -9
- package/dist/test/config_test.d.ts +10 -4
- package/dist/test/config_test.js +16 -9
- package/dist/test/config_test.sample.d.ts +11 -0
- package/dist/test/config_test.sample.js +14 -0
- package/package.json +9 -7
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +0 -50
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +0 -267
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.createStakingAminoConverters = exports.isAminoMsgCancelUnbondingDelegation = exports.isAminoMsgUndelegate = exports.isAminoMsgBeginRedelegate = exports.isAminoMsgDelegate = exports.isAminoMsgEditValidator = exports.isAminoMsgCreateValidator = exports.protoDecimalToJson = void 0;
|
|
20
|
+
var math_1 = require("@cosmjs/math");
|
|
21
|
+
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
22
|
+
var utils_1 = require("@cosmjs/utils");
|
|
23
|
+
function protoDecimalToJson(decimal) {
|
|
24
|
+
var parsed = math_1.Decimal.fromAtomics(decimal, 18);
|
|
25
|
+
var _a = __read(parsed.toString().split("."), 2), whole = _a[0], fractional = _a[1];
|
|
26
|
+
return whole + "." + (fractional !== null && fractional !== void 0 ? fractional : "").padEnd(18, "0");
|
|
27
|
+
}
|
|
28
|
+
exports.protoDecimalToJson = protoDecimalToJson;
|
|
29
|
+
function jsonDecimalToProto(decimal) {
|
|
30
|
+
var parsed = math_1.Decimal.fromUserInput(decimal, 18);
|
|
31
|
+
return parsed.atomics;
|
|
32
|
+
}
|
|
33
|
+
function isAminoMsgCreateValidator(msg) {
|
|
34
|
+
return msg.type === "cosmos-sdk/MsgCreateValidator";
|
|
35
|
+
}
|
|
36
|
+
exports.isAminoMsgCreateValidator = isAminoMsgCreateValidator;
|
|
37
|
+
function isAminoMsgEditValidator(msg) {
|
|
38
|
+
return msg.type === "cosmos-sdk/MsgEditValidator";
|
|
39
|
+
}
|
|
40
|
+
exports.isAminoMsgEditValidator = isAminoMsgEditValidator;
|
|
41
|
+
function isAminoMsgDelegate(msg) {
|
|
42
|
+
return msg.type === "cosmos-sdk/MsgDelegate";
|
|
43
|
+
}
|
|
44
|
+
exports.isAminoMsgDelegate = isAminoMsgDelegate;
|
|
45
|
+
function isAminoMsgBeginRedelegate(msg) {
|
|
46
|
+
return msg.type === "cosmos-sdk/MsgBeginRedelegate";
|
|
47
|
+
}
|
|
48
|
+
exports.isAminoMsgBeginRedelegate = isAminoMsgBeginRedelegate;
|
|
49
|
+
function isAminoMsgUndelegate(msg) {
|
|
50
|
+
return msg.type === "cosmos-sdk/MsgUndelegate";
|
|
51
|
+
}
|
|
52
|
+
exports.isAminoMsgUndelegate = isAminoMsgUndelegate;
|
|
53
|
+
function isAminoMsgCancelUnbondingDelegation(msg) {
|
|
54
|
+
return msg.type === "cosmos-sdk/MsgCancelUnbondingDelegation";
|
|
55
|
+
}
|
|
56
|
+
exports.isAminoMsgCancelUnbondingDelegation = isAminoMsgCancelUnbondingDelegation;
|
|
57
|
+
function createStakingAminoConverters() {
|
|
58
|
+
return {
|
|
59
|
+
"/cosmos.staking.v1beta1.MsgBeginRedelegate": {
|
|
60
|
+
aminoType: "cosmos-sdk/MsgBeginRedelegate",
|
|
61
|
+
toAmino: function (_a) {
|
|
62
|
+
var delegatorAddress = _a.delegatorAddress, validatorSrcAddress = _a.validatorSrcAddress, validatorDstAddress = _a.validatorDstAddress, amount = _a.amount;
|
|
63
|
+
utils_1.assertDefinedAndNotNull(amount, "missing amount");
|
|
64
|
+
return {
|
|
65
|
+
delegator_address: delegatorAddress,
|
|
66
|
+
validator_src_address: validatorSrcAddress,
|
|
67
|
+
validator_dst_address: validatorDstAddress,
|
|
68
|
+
amount: amount,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
fromAmino: function (_a) {
|
|
72
|
+
var delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;
|
|
73
|
+
return ({
|
|
74
|
+
delegatorAddress: delegator_address,
|
|
75
|
+
validatorSrcAddress: validator_src_address,
|
|
76
|
+
validatorDstAddress: validator_dst_address,
|
|
77
|
+
amount: amount,
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
"/cosmos.staking.v1beta1.MsgCreateValidator": {
|
|
82
|
+
aminoType: "cosmos-sdk/MsgCreateValidator",
|
|
83
|
+
toAmino: function (_a) {
|
|
84
|
+
var description = _a.description, commission = _a.commission, minSelfDelegation = _a.minSelfDelegation, delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, pubkey = _a.pubkey, value = _a.value;
|
|
85
|
+
utils_1.assertDefinedAndNotNull(description, "missing description");
|
|
86
|
+
utils_1.assertDefinedAndNotNull(commission, "missing commission");
|
|
87
|
+
utils_1.assertDefinedAndNotNull(pubkey, "missing pubkey");
|
|
88
|
+
utils_1.assertDefinedAndNotNull(value, "missing value");
|
|
89
|
+
return {
|
|
90
|
+
description: {
|
|
91
|
+
moniker: description.moniker,
|
|
92
|
+
identity: description.identity,
|
|
93
|
+
website: description.website,
|
|
94
|
+
security_contact: description.securityContact,
|
|
95
|
+
details: description.details,
|
|
96
|
+
},
|
|
97
|
+
commission: {
|
|
98
|
+
rate: protoDecimalToJson(commission.rate),
|
|
99
|
+
max_rate: protoDecimalToJson(commission.maxRate),
|
|
100
|
+
max_change_rate: protoDecimalToJson(commission.maxChangeRate),
|
|
101
|
+
},
|
|
102
|
+
min_self_delegation: minSelfDelegation,
|
|
103
|
+
delegator_address: delegatorAddress,
|
|
104
|
+
validator_address: validatorAddress,
|
|
105
|
+
pubkey: proto_signing_1.decodePubkey(pubkey),
|
|
106
|
+
value: value,
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
fromAmino: function (_a) {
|
|
110
|
+
var description = _a.description, commission = _a.commission, min_self_delegation = _a.min_self_delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, value = _a.value;
|
|
111
|
+
return {
|
|
112
|
+
description: {
|
|
113
|
+
moniker: description.moniker,
|
|
114
|
+
identity: description.identity,
|
|
115
|
+
website: description.website,
|
|
116
|
+
securityContact: description.security_contact,
|
|
117
|
+
details: description.details,
|
|
118
|
+
},
|
|
119
|
+
commission: {
|
|
120
|
+
rate: jsonDecimalToProto(commission.rate),
|
|
121
|
+
maxRate: jsonDecimalToProto(commission.max_rate),
|
|
122
|
+
maxChangeRate: jsonDecimalToProto(commission.max_change_rate),
|
|
123
|
+
},
|
|
124
|
+
minSelfDelegation: min_self_delegation,
|
|
125
|
+
delegatorAddress: delegator_address,
|
|
126
|
+
validatorAddress: validator_address,
|
|
127
|
+
pubkey: proto_signing_1.encodePubkey(pubkey),
|
|
128
|
+
value: value,
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
"/cosmos.staking.v1beta1.MsgDelegate": {
|
|
133
|
+
aminoType: "cosmos-sdk/MsgDelegate",
|
|
134
|
+
toAmino: function (_a) {
|
|
135
|
+
var delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, amount = _a.amount;
|
|
136
|
+
utils_1.assertDefinedAndNotNull(amount, "missing amount");
|
|
137
|
+
return {
|
|
138
|
+
delegator_address: delegatorAddress,
|
|
139
|
+
validator_address: validatorAddress,
|
|
140
|
+
amount: amount,
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
fromAmino: function (_a) {
|
|
144
|
+
var delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
145
|
+
return ({
|
|
146
|
+
delegatorAddress: delegator_address,
|
|
147
|
+
validatorAddress: validator_address,
|
|
148
|
+
amount: amount,
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
"/cosmos.staking.v1beta1.MsgEditValidator": {
|
|
153
|
+
aminoType: "cosmos-sdk/MsgEditValidator",
|
|
154
|
+
toAmino: function (_a) {
|
|
155
|
+
var description = _a.description, commissionRate = _a.commissionRate, minSelfDelegation = _a.minSelfDelegation, validatorAddress = _a.validatorAddress;
|
|
156
|
+
utils_1.assertDefinedAndNotNull(description, "missing description");
|
|
157
|
+
return {
|
|
158
|
+
description: {
|
|
159
|
+
moniker: description.moniker,
|
|
160
|
+
identity: description.identity,
|
|
161
|
+
website: description.website,
|
|
162
|
+
security_contact: description.securityContact,
|
|
163
|
+
details: description.details,
|
|
164
|
+
},
|
|
165
|
+
// empty string in the protobuf document means "do not change"
|
|
166
|
+
commission_rate: commissionRate ? protoDecimalToJson(commissionRate) : undefined,
|
|
167
|
+
// empty string in the protobuf document means "do not change"
|
|
168
|
+
min_self_delegation: minSelfDelegation ? minSelfDelegation : undefined,
|
|
169
|
+
validator_address: validatorAddress,
|
|
170
|
+
};
|
|
171
|
+
},
|
|
172
|
+
fromAmino: function (_a) {
|
|
173
|
+
var description = _a.description, commission_rate = _a.commission_rate, min_self_delegation = _a.min_self_delegation, validator_address = _a.validator_address;
|
|
174
|
+
return ({
|
|
175
|
+
description: {
|
|
176
|
+
moniker: description.moniker,
|
|
177
|
+
identity: description.identity,
|
|
178
|
+
website: description.website,
|
|
179
|
+
securityContact: description.security_contact,
|
|
180
|
+
details: description.details,
|
|
181
|
+
},
|
|
182
|
+
// empty string in the protobuf document means "do not change"
|
|
183
|
+
commissionRate: commission_rate ? jsonDecimalToProto(commission_rate) : "",
|
|
184
|
+
// empty string in the protobuf document means "do not change"
|
|
185
|
+
minSelfDelegation: min_self_delegation !== null && min_self_delegation !== void 0 ? min_self_delegation : "",
|
|
186
|
+
validatorAddress: validator_address,
|
|
187
|
+
});
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
"/cosmos.staking.v1beta1.MsgUndelegate": {
|
|
191
|
+
aminoType: "cosmos-sdk/MsgUndelegate",
|
|
192
|
+
toAmino: function (_a) {
|
|
193
|
+
var delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, amount = _a.amount;
|
|
194
|
+
utils_1.assertDefinedAndNotNull(amount, "missing amount");
|
|
195
|
+
return {
|
|
196
|
+
delegator_address: delegatorAddress,
|
|
197
|
+
validator_address: validatorAddress,
|
|
198
|
+
amount: amount,
|
|
199
|
+
};
|
|
200
|
+
},
|
|
201
|
+
fromAmino: function (_a) {
|
|
202
|
+
var delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
203
|
+
return ({
|
|
204
|
+
delegatorAddress: delegator_address,
|
|
205
|
+
validatorAddress: validator_address,
|
|
206
|
+
amount: amount,
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation": {
|
|
211
|
+
aminoType: "cosmos-sdk/MsgCancelUnbondingDelegation",
|
|
212
|
+
toAmino: function (_a) {
|
|
213
|
+
var delegatorAddress = _a.delegatorAddress, validatorAddress = _a.validatorAddress, amount = _a.amount, creationHeight = _a.creationHeight;
|
|
214
|
+
utils_1.assertDefinedAndNotNull(amount, "missing amount");
|
|
215
|
+
return {
|
|
216
|
+
delegator_address: delegatorAddress,
|
|
217
|
+
validator_address: validatorAddress,
|
|
218
|
+
amount: amount,
|
|
219
|
+
creation_height: creationHeight.toString(),
|
|
220
|
+
};
|
|
221
|
+
},
|
|
222
|
+
fromAmino: function (_a) {
|
|
223
|
+
var delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount, creation_height = _a.creation_height;
|
|
224
|
+
return ({
|
|
225
|
+
delegatorAddress: delegator_address,
|
|
226
|
+
validatorAddress: validator_address,
|
|
227
|
+
amount: amount,
|
|
228
|
+
creationHeight: BigInt(creation_height),
|
|
229
|
+
});
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
exports.createStakingAminoConverters = createStakingAminoConverters;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EncodeObject, GeneratedType } from "@cosmjs/proto-signing";
|
|
2
|
+
import { MsgBeginRedelegate, MsgCancelUnbondingDelegation, MsgCreateValidator, MsgDelegate, MsgEditValidator, MsgUndelegate } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
|
3
|
+
export declare const stakingTypes: ReadonlyArray<[string, GeneratedType]>;
|
|
4
|
+
export interface MsgBeginRedelegateEncodeObject extends EncodeObject {
|
|
5
|
+
readonly typeUrl: "/cosmos.staking.v1beta1.MsgBeginRedelegate";
|
|
6
|
+
readonly value: Partial<MsgBeginRedelegate>;
|
|
7
|
+
}
|
|
8
|
+
export declare function isMsgBeginRedelegateEncodeObject(o: EncodeObject): o is MsgBeginRedelegateEncodeObject;
|
|
9
|
+
export interface MsgCreateValidatorEncodeObject extends EncodeObject {
|
|
10
|
+
readonly typeUrl: "/cosmos.staking.v1beta1.MsgCreateValidator";
|
|
11
|
+
readonly value: Partial<MsgCreateValidator>;
|
|
12
|
+
}
|
|
13
|
+
export declare function isMsgCreateValidatorEncodeObject(o: EncodeObject): o is MsgCreateValidatorEncodeObject;
|
|
14
|
+
export interface MsgDelegateEncodeObject extends EncodeObject {
|
|
15
|
+
readonly typeUrl: "/cosmos.staking.v1beta1.MsgDelegate";
|
|
16
|
+
readonly value: Partial<MsgDelegate>;
|
|
17
|
+
}
|
|
18
|
+
export declare function isMsgDelegateEncodeObject(object: EncodeObject): object is MsgDelegateEncodeObject;
|
|
19
|
+
export interface MsgEditValidatorEncodeObject extends EncodeObject {
|
|
20
|
+
readonly typeUrl: "/cosmos.staking.v1beta1.MsgEditValidator";
|
|
21
|
+
readonly value: Partial<MsgEditValidator>;
|
|
22
|
+
}
|
|
23
|
+
export declare function isMsgEditValidatorEncodeObject(o: EncodeObject): o is MsgEditValidatorEncodeObject;
|
|
24
|
+
export interface MsgUndelegateEncodeObject extends EncodeObject {
|
|
25
|
+
readonly typeUrl: "/cosmos.staking.v1beta1.MsgUndelegate";
|
|
26
|
+
readonly value: Partial<MsgUndelegate>;
|
|
27
|
+
}
|
|
28
|
+
export declare function isMsgUndelegateEncodeObject(object: EncodeObject): object is MsgUndelegateEncodeObject;
|
|
29
|
+
export interface MsgCancelUnbondingDelegationEncodeObject extends EncodeObject {
|
|
30
|
+
readonly typeUrl: "/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation";
|
|
31
|
+
readonly value: Partial<MsgCancelUnbondingDelegation>;
|
|
32
|
+
}
|
|
33
|
+
export declare function isMsgCancelUnbondingDelegationEncodeObject(object: EncodeObject): object is MsgCancelUnbondingDelegationEncodeObject;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMsgCancelUnbondingDelegationEncodeObject = exports.isMsgUndelegateEncodeObject = exports.isMsgEditValidatorEncodeObject = exports.isMsgDelegateEncodeObject = exports.isMsgCreateValidatorEncodeObject = exports.isMsgBeginRedelegateEncodeObject = exports.stakingTypes = void 0;
|
|
4
|
+
var tx_1 = require("cosmjs-types/cosmos/staking/v1beta1/tx");
|
|
5
|
+
exports.stakingTypes = [
|
|
6
|
+
["/cosmos.staking.v1beta1.MsgBeginRedelegate", tx_1.MsgBeginRedelegate],
|
|
7
|
+
["/cosmos.staking.v1beta1.MsgCreateValidator", tx_1.MsgCreateValidator],
|
|
8
|
+
["/cosmos.staking.v1beta1.MsgDelegate", tx_1.MsgDelegate],
|
|
9
|
+
["/cosmos.staking.v1beta1.MsgEditValidator", tx_1.MsgEditValidator],
|
|
10
|
+
["/cosmos.staking.v1beta1.MsgUndelegate", tx_1.MsgUndelegate],
|
|
11
|
+
["/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation", tx_1.MsgCancelUnbondingDelegation],
|
|
12
|
+
];
|
|
13
|
+
function isMsgBeginRedelegateEncodeObject(o) {
|
|
14
|
+
return o.typeUrl === "/cosmos.staking.v1beta1.MsgBeginRedelegate";
|
|
15
|
+
}
|
|
16
|
+
exports.isMsgBeginRedelegateEncodeObject = isMsgBeginRedelegateEncodeObject;
|
|
17
|
+
function isMsgCreateValidatorEncodeObject(o) {
|
|
18
|
+
return o.typeUrl === "/cosmos.staking.v1beta1.MsgCreateValidator";
|
|
19
|
+
}
|
|
20
|
+
exports.isMsgCreateValidatorEncodeObject = isMsgCreateValidatorEncodeObject;
|
|
21
|
+
function isMsgDelegateEncodeObject(object) {
|
|
22
|
+
return object.typeUrl === "/cosmos.staking.v1beta1.MsgDelegate";
|
|
23
|
+
}
|
|
24
|
+
exports.isMsgDelegateEncodeObject = isMsgDelegateEncodeObject;
|
|
25
|
+
function isMsgEditValidatorEncodeObject(o) {
|
|
26
|
+
return o.typeUrl === "/cosmos.staking.v1beta1.MsgEditValidator";
|
|
27
|
+
}
|
|
28
|
+
exports.isMsgEditValidatorEncodeObject = isMsgEditValidatorEncodeObject;
|
|
29
|
+
function isMsgUndelegateEncodeObject(object) {
|
|
30
|
+
return object.typeUrl === "/cosmos.staking.v1beta1.MsgUndelegate";
|
|
31
|
+
}
|
|
32
|
+
exports.isMsgUndelegateEncodeObject = isMsgUndelegateEncodeObject;
|
|
33
|
+
function isMsgCancelUnbondingDelegationEncodeObject(object) {
|
|
34
|
+
return (object.typeUrl ===
|
|
35
|
+
"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation");
|
|
36
|
+
}
|
|
37
|
+
exports.isMsgCancelUnbondingDelegationEncodeObject = isMsgCancelUnbondingDelegationEncodeObject;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { QueryDelegationResponse, QueryDelegatorDelegationsResponse, QueryDelegatorUnbondingDelegationsResponse, QueryDelegatorValidatorResponse, QueryDelegatorValidatorsResponse, QueryHistoricalInfoResponse, QueryParamsResponse, QueryPoolResponse, QueryRedelegationsResponse, QueryUnbondingDelegationResponse, QueryValidatorDelegationsResponse, QueryValidatorResponse, QueryValidatorsResponse, QueryValidatorUnbondingDelegationsResponse } from "cosmjs-types/cosmos/staking/v1beta1/query";
|
|
2
|
+
import { BondStatus } from "cosmjs-types/cosmos/staking/v1beta1/staking";
|
|
3
|
+
import { QueryClient } from "../../queryclient";
|
|
4
|
+
export declare type BondStatusString = keyof Pick<typeof BondStatus, "BOND_STATUS_BONDED" | "BOND_STATUS_UNBONDED" | "BOND_STATUS_UNBONDING"> | "";
|
|
5
|
+
export interface StakingExtension {
|
|
6
|
+
readonly staking: {
|
|
7
|
+
delegation: (delegatorAddress: string, validatorAddress: string) => Promise<QueryDelegationResponse>;
|
|
8
|
+
delegatorDelegations: (delegatorAddress: string, paginationKey?: Uint8Array) => Promise<QueryDelegatorDelegationsResponse>;
|
|
9
|
+
delegatorUnbondingDelegations: (delegatorAddress: string, paginationKey?: Uint8Array) => Promise<QueryDelegatorUnbondingDelegationsResponse>;
|
|
10
|
+
delegatorValidator: (delegatorAddress: string, validatorAddress: string) => Promise<QueryDelegatorValidatorResponse>;
|
|
11
|
+
delegatorValidators: (delegatorAddress: string, paginationKey?: Uint8Array) => Promise<QueryDelegatorValidatorsResponse>;
|
|
12
|
+
historicalInfo: (height: number) => Promise<QueryHistoricalInfoResponse>;
|
|
13
|
+
params: () => Promise<QueryParamsResponse>;
|
|
14
|
+
pool: () => Promise<QueryPoolResponse>;
|
|
15
|
+
redelegations: (delegatorAddress: string, sourceValidatorAddress: string, destinationValidatorAddress: string, paginationKey?: Uint8Array) => Promise<QueryRedelegationsResponse>;
|
|
16
|
+
unbondingDelegation: (delegatorAddress: string, validatorAddress: string) => Promise<QueryUnbondingDelegationResponse>;
|
|
17
|
+
validator: (validatorAddress: string) => Promise<QueryValidatorResponse>;
|
|
18
|
+
validatorDelegations: (validatorAddress: string, paginationKey?: Uint8Array) => Promise<QueryValidatorDelegationsResponse>;
|
|
19
|
+
validators: (status: BondStatusString, paginationKey?: Uint8Array) => Promise<QueryValidatorsResponse>;
|
|
20
|
+
validatorUnbondingDelegations: (validatorAddress: string, paginationKey?: Uint8Array) => Promise<QueryValidatorUnbondingDelegationsResponse>;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function setupStakingExtension(base: QueryClient): StakingExtension;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.setupStakingExtension = void 0;
|
|
40
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
41
|
+
var query_1 = require("cosmjs-types/cosmos/staking/v1beta1/query");
|
|
42
|
+
var queryclient_1 = require("../../queryclient");
|
|
43
|
+
function setupStakingExtension(base) {
|
|
44
|
+
var _this = this;
|
|
45
|
+
// Use this service to get easy typed access to query methods
|
|
46
|
+
// This cannot be used for proof verification
|
|
47
|
+
var rpc = queryclient_1.createProtobufRpcClient(base);
|
|
48
|
+
var queryService = new query_1.QueryClientImpl(rpc);
|
|
49
|
+
return {
|
|
50
|
+
staking: {
|
|
51
|
+
delegation: function (delegatorAddress, validatorAddress) { return __awaiter(_this, void 0, void 0, function () {
|
|
52
|
+
var response;
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
switch (_a.label) {
|
|
55
|
+
case 0: return [4 /*yield*/, queryService.Delegation({
|
|
56
|
+
delegatorAddr: delegatorAddress,
|
|
57
|
+
validatorAddr: validatorAddress,
|
|
58
|
+
})];
|
|
59
|
+
case 1:
|
|
60
|
+
response = _a.sent();
|
|
61
|
+
return [2 /*return*/, response];
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}); },
|
|
65
|
+
delegatorDelegations: function (delegatorAddress, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
66
|
+
var response;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
69
|
+
case 0: return [4 /*yield*/, queryService.DelegatorDelegations({
|
|
70
|
+
delegatorAddr: delegatorAddress,
|
|
71
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
72
|
+
})];
|
|
73
|
+
case 1:
|
|
74
|
+
response = _a.sent();
|
|
75
|
+
return [2 /*return*/, response];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}); },
|
|
79
|
+
delegatorUnbondingDelegations: function (delegatorAddress, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
80
|
+
var response;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0: return [4 /*yield*/, queryService.DelegatorUnbondingDelegations({
|
|
84
|
+
delegatorAddr: delegatorAddress,
|
|
85
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
86
|
+
})];
|
|
87
|
+
case 1:
|
|
88
|
+
response = _a.sent();
|
|
89
|
+
return [2 /*return*/, response];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}); },
|
|
93
|
+
delegatorValidator: function (delegatorAddress, validatorAddress) { return __awaiter(_this, void 0, void 0, function () {
|
|
94
|
+
var response;
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
switch (_a.label) {
|
|
97
|
+
case 0: return [4 /*yield*/, queryService.DelegatorValidator({
|
|
98
|
+
delegatorAddr: delegatorAddress,
|
|
99
|
+
validatorAddr: validatorAddress,
|
|
100
|
+
})];
|
|
101
|
+
case 1:
|
|
102
|
+
response = _a.sent();
|
|
103
|
+
return [2 /*return*/, response];
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}); },
|
|
107
|
+
delegatorValidators: function (delegatorAddress, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
108
|
+
var response;
|
|
109
|
+
return __generator(this, function (_a) {
|
|
110
|
+
switch (_a.label) {
|
|
111
|
+
case 0: return [4 /*yield*/, queryService.DelegatorValidators({
|
|
112
|
+
delegatorAddr: delegatorAddress,
|
|
113
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
114
|
+
})];
|
|
115
|
+
case 1:
|
|
116
|
+
response = _a.sent();
|
|
117
|
+
return [2 /*return*/, response];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}); },
|
|
121
|
+
historicalInfo: function (height) { return __awaiter(_this, void 0, void 0, function () {
|
|
122
|
+
var response;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (_a.label) {
|
|
125
|
+
case 0: return [4 /*yield*/, queryService.HistoricalInfo({
|
|
126
|
+
height: BigInt(height),
|
|
127
|
+
})];
|
|
128
|
+
case 1:
|
|
129
|
+
response = _a.sent();
|
|
130
|
+
return [2 /*return*/, response];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}); },
|
|
134
|
+
params: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
135
|
+
var response;
|
|
136
|
+
return __generator(this, function (_a) {
|
|
137
|
+
switch (_a.label) {
|
|
138
|
+
case 0: return [4 /*yield*/, queryService.Params({})];
|
|
139
|
+
case 1:
|
|
140
|
+
response = _a.sent();
|
|
141
|
+
return [2 /*return*/, response];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
}); },
|
|
145
|
+
pool: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
146
|
+
var response;
|
|
147
|
+
return __generator(this, function (_a) {
|
|
148
|
+
switch (_a.label) {
|
|
149
|
+
case 0: return [4 /*yield*/, queryService.Pool({})];
|
|
150
|
+
case 1:
|
|
151
|
+
response = _a.sent();
|
|
152
|
+
return [2 /*return*/, response];
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}); },
|
|
156
|
+
redelegations: function (delegatorAddress, sourceValidatorAddress, destinationValidatorAddress, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
157
|
+
var response;
|
|
158
|
+
return __generator(this, function (_a) {
|
|
159
|
+
switch (_a.label) {
|
|
160
|
+
case 0: return [4 /*yield*/, queryService.Redelegations({
|
|
161
|
+
delegatorAddr: delegatorAddress,
|
|
162
|
+
srcValidatorAddr: sourceValidatorAddress,
|
|
163
|
+
dstValidatorAddr: destinationValidatorAddress,
|
|
164
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
165
|
+
})];
|
|
166
|
+
case 1:
|
|
167
|
+
response = _a.sent();
|
|
168
|
+
return [2 /*return*/, response];
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
}); },
|
|
172
|
+
unbondingDelegation: function (delegatorAddress, validatorAddress) { return __awaiter(_this, void 0, void 0, function () {
|
|
173
|
+
var response;
|
|
174
|
+
return __generator(this, function (_a) {
|
|
175
|
+
switch (_a.label) {
|
|
176
|
+
case 0: return [4 /*yield*/, queryService.UnbondingDelegation({
|
|
177
|
+
delegatorAddr: delegatorAddress,
|
|
178
|
+
validatorAddr: validatorAddress,
|
|
179
|
+
})];
|
|
180
|
+
case 1:
|
|
181
|
+
response = _a.sent();
|
|
182
|
+
return [2 /*return*/, response];
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}); },
|
|
186
|
+
validator: function (validatorAddress) { return __awaiter(_this, void 0, void 0, function () {
|
|
187
|
+
var response;
|
|
188
|
+
return __generator(this, function (_a) {
|
|
189
|
+
switch (_a.label) {
|
|
190
|
+
case 0: return [4 /*yield*/, queryService.Validator({ validatorAddr: validatorAddress })];
|
|
191
|
+
case 1:
|
|
192
|
+
response = _a.sent();
|
|
193
|
+
return [2 /*return*/, response];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
}); },
|
|
197
|
+
validatorDelegations: function (validatorAddress, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
198
|
+
var response;
|
|
199
|
+
return __generator(this, function (_a) {
|
|
200
|
+
switch (_a.label) {
|
|
201
|
+
case 0: return [4 /*yield*/, queryService.ValidatorDelegations({
|
|
202
|
+
validatorAddr: validatorAddress,
|
|
203
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
204
|
+
})];
|
|
205
|
+
case 1:
|
|
206
|
+
response = _a.sent();
|
|
207
|
+
return [2 /*return*/, response];
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
}); },
|
|
211
|
+
validators: function (status, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
212
|
+
var response;
|
|
213
|
+
return __generator(this, function (_a) {
|
|
214
|
+
switch (_a.label) {
|
|
215
|
+
case 0: return [4 /*yield*/, queryService.Validators({
|
|
216
|
+
status: status,
|
|
217
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
218
|
+
})];
|
|
219
|
+
case 1:
|
|
220
|
+
response = _a.sent();
|
|
221
|
+
return [2 /*return*/, response];
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}); },
|
|
225
|
+
validatorUnbondingDelegations: function (validatorAddress, paginationKey) { return __awaiter(_this, void 0, void 0, function () {
|
|
226
|
+
var response;
|
|
227
|
+
return __generator(this, function (_a) {
|
|
228
|
+
switch (_a.label) {
|
|
229
|
+
case 0: return [4 /*yield*/, queryService.ValidatorUnbondingDelegations({
|
|
230
|
+
validatorAddr: validatorAddress,
|
|
231
|
+
pagination: queryclient_1.createPagination(paginationKey),
|
|
232
|
+
})];
|
|
233
|
+
case 1:
|
|
234
|
+
response = _a.sent();
|
|
235
|
+
return [2 /*return*/, response];
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}); },
|
|
239
|
+
},
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
exports.setupStakingExtension = setupStakingExtension;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Pubkey } from "@cosmjs/amino";
|
|
2
|
+
import { GetTxResponse, SimulateResponse } from "cosmjs-types/cosmos/tx/v1beta1/service";
|
|
3
|
+
import { Any } from "cosmjs-types/google/protobuf/any";
|
|
4
|
+
import { QueryClient } from "../../queryclient";
|
|
5
|
+
export interface TxExtension {
|
|
6
|
+
readonly tx: {
|
|
7
|
+
getTx: (txId: string) => Promise<GetTxResponse>;
|
|
8
|
+
simulate: (messages: readonly Any[], memo: string | undefined, signer: Pubkey, sequence: number) => Promise<SimulateResponse>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function setupTxExtension(base: QueryClient): TxExtension;
|