@firmachain/firma-js 0.3.6 → 0.3.7-beta1
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/dist/sdk/FirmaGovService.js +44 -58
- package/dist/sdk/firmachain/common/CommonTxClient.js +31 -24
- package/dist/sdk/firmachain/gov/GovQueryClient.js +1 -1
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +37 -12
- package/dist/sdk/firmachain/gov/GovTxClient.js +31 -11
- package/dist/test/17.gov_query.test.js +4 -4
- package/package.json +1 -1
|
@@ -327,7 +327,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
327
327
|
if (metadata === void 0) { metadata = ""; }
|
|
328
328
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
329
329
|
return __awaiter(this, void 0, void 0, function () {
|
|
330
|
-
var proposer, initialDeposit,
|
|
330
|
+
var proposer, initialDeposit, txClient, message, error_10;
|
|
331
331
|
return __generator(this, function (_a) {
|
|
332
332
|
switch (_a.label) {
|
|
333
333
|
case 0:
|
|
@@ -336,18 +336,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
336
336
|
case 1:
|
|
337
337
|
proposer = _a.sent();
|
|
338
338
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
339
|
-
message = {
|
|
340
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
341
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
342
|
-
title: title,
|
|
343
|
-
summary: summary,
|
|
344
|
-
metadata: metadata,
|
|
345
|
-
messages: messages,
|
|
346
|
-
proposer: proposer,
|
|
347
|
-
initialDeposit: initialDeposit
|
|
348
|
-
})
|
|
349
|
-
};
|
|
350
339
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
340
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
341
|
+
title: title,
|
|
342
|
+
summary: summary,
|
|
343
|
+
metadata: metadata,
|
|
344
|
+
messages: messages,
|
|
345
|
+
proposer: proposer,
|
|
346
|
+
initialDeposit: initialDeposit,
|
|
347
|
+
expedited: false
|
|
348
|
+
});
|
|
351
349
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
352
350
|
case 2: return [2 /*return*/, _a.sent()];
|
|
353
351
|
case 3:
|
|
@@ -363,7 +361,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
363
361
|
if (metadata === void 0) { metadata = ""; }
|
|
364
362
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
365
363
|
return __awaiter(this, void 0, void 0, function () {
|
|
366
|
-
var proposer, initialDeposit,
|
|
364
|
+
var proposer, initialDeposit, txClient, message, error_11;
|
|
367
365
|
return __generator(this, function (_a) {
|
|
368
366
|
switch (_a.label) {
|
|
369
367
|
case 0:
|
|
@@ -372,18 +370,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
372
370
|
case 1:
|
|
373
371
|
proposer = _a.sent();
|
|
374
372
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
375
|
-
message = {
|
|
376
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
377
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
378
|
-
title: title,
|
|
379
|
-
summary: summary,
|
|
380
|
-
metadata: metadata,
|
|
381
|
-
messages: messages,
|
|
382
|
-
proposer: proposer,
|
|
383
|
-
initialDeposit: initialDeposit
|
|
384
|
-
})
|
|
385
|
-
};
|
|
386
373
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
374
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
375
|
+
title: title,
|
|
376
|
+
summary: summary,
|
|
377
|
+
metadata: metadata,
|
|
378
|
+
messages: messages,
|
|
379
|
+
proposer: proposer,
|
|
380
|
+
initialDeposit: initialDeposit,
|
|
381
|
+
expedited: false
|
|
382
|
+
});
|
|
387
383
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
388
384
|
case 2: return [2 /*return*/, _a.sent()];
|
|
389
385
|
case 3:
|
|
@@ -399,7 +395,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
399
395
|
if (metadata === void 0) { metadata = ""; }
|
|
400
396
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
401
397
|
return __awaiter(this, void 0, void 0, function () {
|
|
402
|
-
var proposer, initialDeposit,
|
|
398
|
+
var proposer, initialDeposit, txClient, message, error_12;
|
|
403
399
|
return __generator(this, function (_a) {
|
|
404
400
|
switch (_a.label) {
|
|
405
401
|
case 0:
|
|
@@ -408,18 +404,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
408
404
|
case 1:
|
|
409
405
|
proposer = _a.sent();
|
|
410
406
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
411
|
-
message = {
|
|
412
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
413
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
414
|
-
title: title,
|
|
415
|
-
summary: summary,
|
|
416
|
-
metadata: metadata,
|
|
417
|
-
messages: messages,
|
|
418
|
-
proposer: proposer,
|
|
419
|
-
initialDeposit: initialDeposit
|
|
420
|
-
})
|
|
421
|
-
};
|
|
422
407
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
408
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
409
|
+
title: title,
|
|
410
|
+
summary: summary,
|
|
411
|
+
metadata: metadata,
|
|
412
|
+
messages: messages,
|
|
413
|
+
proposer: proposer,
|
|
414
|
+
initialDeposit: initialDeposit,
|
|
415
|
+
expedited: false
|
|
416
|
+
});
|
|
423
417
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
424
418
|
case 2: return [2 /*return*/, _a.sent()];
|
|
425
419
|
case 3:
|
|
@@ -435,7 +429,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
435
429
|
if (metadata === void 0) { metadata = ""; }
|
|
436
430
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
437
431
|
return __awaiter(this, void 0, void 0, function () {
|
|
438
|
-
var proposer, initialDeposit,
|
|
432
|
+
var proposer, initialDeposit, txClient, message, error_13;
|
|
439
433
|
return __generator(this, function (_a) {
|
|
440
434
|
switch (_a.label) {
|
|
441
435
|
case 0:
|
|
@@ -444,18 +438,16 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
444
438
|
case 1:
|
|
445
439
|
proposer = _a.sent();
|
|
446
440
|
initialDeposit = [{ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT), denom: this.config.denom }];
|
|
447
|
-
message = {
|
|
448
|
-
typeUrl: "/cosmos.gov.v1.MsgSubmitProposal",
|
|
449
|
-
value: tx_2.MsgSubmitProposal.fromPartial({
|
|
450
|
-
title: title,
|
|
451
|
-
summary: summary,
|
|
452
|
-
metadata: metadata,
|
|
453
|
-
messages: messages,
|
|
454
|
-
proposer: proposer,
|
|
455
|
-
initialDeposit: initialDeposit,
|
|
456
|
-
})
|
|
457
|
-
};
|
|
458
441
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
442
|
+
message = gov_1.GovTxClient.v1MsgSubmitProposal({
|
|
443
|
+
title: title,
|
|
444
|
+
summary: summary,
|
|
445
|
+
metadata: metadata,
|
|
446
|
+
messages: messages,
|
|
447
|
+
proposer: proposer,
|
|
448
|
+
initialDeposit: initialDeposit,
|
|
449
|
+
expedited: false
|
|
450
|
+
});
|
|
459
451
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
460
452
|
case 2: return [2 /*return*/, _a.sent()];
|
|
461
453
|
case 3:
|
|
@@ -470,20 +462,14 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
470
462
|
FirmaGovService.prototype.getSignedTxCancelProposal = function (wallet, proposalId, txMisc) {
|
|
471
463
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
472
464
|
return __awaiter(this, void 0, void 0, function () {
|
|
473
|
-
var proposer,
|
|
465
|
+
var proposer, txClient, message;
|
|
474
466
|
return __generator(this, function (_a) {
|
|
475
467
|
switch (_a.label) {
|
|
476
468
|
case 0: return [4 /*yield*/, wallet.getAddress()];
|
|
477
469
|
case 1:
|
|
478
470
|
proposer = _a.sent();
|
|
479
|
-
message = {
|
|
480
|
-
typeUrl: "/cosmos.gov.v1.MsgCancelProposal",
|
|
481
|
-
value: tx_2.MsgCancelProposal.fromPartial({
|
|
482
|
-
proposalId: BigInt(proposalId),
|
|
483
|
-
proposer: proposer
|
|
484
|
-
})
|
|
485
|
-
};
|
|
486
471
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
472
|
+
message = gov_1.GovTxClient.v1MsgCancelProposal({ proposalId: BigInt(proposalId), proposer: proposer });
|
|
487
473
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
488
474
|
case 2: return [2 /*return*/, _a.sent()];
|
|
489
475
|
}
|
|
@@ -736,7 +722,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
736
722
|
case 1:
|
|
737
723
|
voter = _a.sent();
|
|
738
724
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
739
|
-
message = gov_1.GovTxClient.
|
|
725
|
+
message = gov_1.GovTxClient.v1MsgVote({ proposalId: proposalId, voter: voter, option: option, metadata: "" });
|
|
740
726
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
741
727
|
case 2: return [2 /*return*/, _a.sent()];
|
|
742
728
|
case 3:
|
|
@@ -784,7 +770,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
784
770
|
case 1:
|
|
785
771
|
depositor = _a.sent();
|
|
786
772
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
787
|
-
message = gov_1.GovTxClient.
|
|
773
|
+
message = gov_1.GovTxClient.v1MsgDeposit({ proposalId: proposalId, depositor: depositor, amount: [sendAmount] });
|
|
788
774
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
789
775
|
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
790
776
|
case 2: return [2 /*return*/, _a.sent()];
|
|
@@ -18,12 +18,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.CommonTxClient = void 0;
|
|
19
19
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
20
|
var tx_1 = require("cosmjs-types/cosmos/bank/v1beta1/tx");
|
|
21
|
-
var tx_2 = require("cosmjs-types/cosmos/
|
|
22
|
-
var tx_3 = require("cosmjs-types/cosmos/
|
|
23
|
-
var tx_4 = require("cosmjs-types/cosmos/
|
|
24
|
-
var tx_5 = require("cosmjs-types/
|
|
21
|
+
var tx_2 = require("cosmjs-types/cosmos/gov/v1/tx");
|
|
22
|
+
var tx_3 = require("cosmjs-types/cosmos/distribution/v1beta1/tx");
|
|
23
|
+
var tx_4 = require("cosmjs-types/cosmos/gov/v1beta1/tx");
|
|
24
|
+
var tx_5 = require("cosmjs-types/cosmos/staking/v1beta1/tx");
|
|
25
|
+
var tx_6 = require("cosmjs-types/cosmwasm/wasm/v1/tx");
|
|
25
26
|
// temporarly using kintsugi-tech/cosmjs-types - this will be returned to original cosmjs-types after the PR is merged
|
|
26
|
-
var
|
|
27
|
+
var tx_7 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
27
28
|
var AuthzTxTypes_1 = require("../authz/AuthzTxTypes");
|
|
28
29
|
var ContractTxTypes_1 = require("../contract/ContractTxTypes");
|
|
29
30
|
var FeeGrantTxTypes_1 = require("../feegrant/FeeGrantTxTypes");
|
|
@@ -38,31 +39,37 @@ var types = [
|
|
|
38
39
|
["/cosmos.bank.v1beta1.MsgMultiSend", tx_1.MsgMultiSend],
|
|
39
40
|
["/firmachain.contract.MsgCreateContractFile", ContractTxTypes_1.MsgCreateContractFile],
|
|
40
41
|
["/firmachain.contract.MsgAddContractLog", ContractTxTypes_1.MsgAddContractLog],
|
|
41
|
-
["/cosmwasm.wasm.v1.MsgStoreCode",
|
|
42
|
-
["/cosmwasm.wasm.v1.MsgInstantiateContract",
|
|
43
|
-
["/cosmwasm.wasm.v1.MsgExecuteContract",
|
|
44
|
-
["/cosmwasm.wasm.v1.MsgUpdateAdmin",
|
|
45
|
-
["/cosmwasm.wasm.v1.MsgClearAdmin",
|
|
46
|
-
["/cosmwasm.wasm.v1.MsgMigrateContract",
|
|
47
|
-
["/cosmos.distribution.v1beta1.MsgFundCommunityPool",
|
|
48
|
-
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
|
|
49
|
-
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
|
|
50
|
-
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",
|
|
42
|
+
["/cosmwasm.wasm.v1.MsgStoreCode", tx_6.MsgStoreCode],
|
|
43
|
+
["/cosmwasm.wasm.v1.MsgInstantiateContract", tx_6.MsgInstantiateContract],
|
|
44
|
+
["/cosmwasm.wasm.v1.MsgExecuteContract", tx_6.MsgExecuteContract],
|
|
45
|
+
["/cosmwasm.wasm.v1.MsgUpdateAdmin", tx_6.MsgUpdateAdmin],
|
|
46
|
+
["/cosmwasm.wasm.v1.MsgClearAdmin", tx_6.MsgClearAdmin],
|
|
47
|
+
["/cosmwasm.wasm.v1.MsgMigrateContract", tx_6.MsgMigrateContract],
|
|
48
|
+
["/cosmos.distribution.v1beta1.MsgFundCommunityPool", tx_3.MsgFundCommunityPool],
|
|
49
|
+
["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress", tx_3.MsgSetWithdrawAddress],
|
|
50
|
+
["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward", tx_3.MsgWithdrawDelegatorReward],
|
|
51
|
+
["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission", tx_3.MsgWithdrawValidatorCommission],
|
|
51
52
|
["/cosmos.feegrant.v1beta1.MsgGrantAllowance", FeeGrantTxTypes_1.MsgGrantAllowance],
|
|
52
53
|
["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", FeeGrantTxTypes_1.MsgRevokeAllowance],
|
|
53
|
-
["/cosmos.gov.
|
|
54
|
-
["/cosmos.gov.
|
|
55
|
-
["/cosmos.gov.
|
|
56
|
-
["/cosmos.gov.v1.
|
|
54
|
+
["/cosmos.gov.v1.MsgDeposit", tx_2.MsgDeposit],
|
|
55
|
+
["/cosmos.gov.v1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
|
|
56
|
+
["/cosmos.gov.v1.MsgUpdateParams", tx_2.MsgUpdateParams],
|
|
57
|
+
["/cosmos.gov.v1.MsgVote", tx_2.MsgVote],
|
|
58
|
+
["/cosmos.gov.v1.MsgVoteWeighted", tx_2.MsgVoteWeighted],
|
|
59
|
+
["/cosmos.gov.v1.MsgCancelProposal", tx_7.MsgCancelProposal],
|
|
60
|
+
["/cosmos.gov.v1beta1.MsgDeposit", tx_4.MsgDeposit],
|
|
61
|
+
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_4.MsgSubmitProposal],
|
|
62
|
+
["/cosmos.gov.v1beta1.MsgVote", tx_4.MsgVote],
|
|
63
|
+
["/cosmos.gov.v1beta1.MsgVoteWeighted", tx_4.MsgVoteWeighted],
|
|
57
64
|
["/ibc.applications.transfer.v1.MsgTransfer", NftTxTypes_1.MsgTransfer],
|
|
58
65
|
["/firmachain.nft.MsgTransfer", NftTxTypes_1.MsgTransfer],
|
|
59
66
|
["/firmachain.nft.MsgMint", NftTxTypes_1.MsgMint],
|
|
60
67
|
["/firmachain.nft.MsgBurn", NftTxTypes_1.MsgBurn],
|
|
61
|
-
["/cosmos.staking.v1beta1.MsgDelegate",
|
|
62
|
-
["/cosmos.staking.v1beta1.MsgUndelegate",
|
|
63
|
-
["/cosmos.staking.v1beta1.MsgBeginRedelegate",
|
|
64
|
-
["/cosmos.staking.v1beta1.MsgEditValidator",
|
|
65
|
-
["/cosmos.staking.v1beta1.MsgCreateValidator",
|
|
68
|
+
["/cosmos.staking.v1beta1.MsgDelegate", tx_5.MsgDelegate],
|
|
69
|
+
["/cosmos.staking.v1beta1.MsgUndelegate", tx_5.MsgUndelegate],
|
|
70
|
+
["/cosmos.staking.v1beta1.MsgBeginRedelegate", tx_5.MsgBeginRedelegate],
|
|
71
|
+
["/cosmos.staking.v1beta1.MsgEditValidator", tx_5.MsgEditValidator],
|
|
72
|
+
["/cosmos.staking.v1beta1.MsgCreateValidator", tx_5.MsgCreateValidator],
|
|
66
73
|
["/firmachain.token.MsgCreateToken", TokenTxTypes_1.MsgCreateToken],
|
|
67
74
|
["/firmachain.token.MsgUpdateTokenURI", TokenTxTypes_1.MsgUpdateTokenURI],
|
|
68
75
|
["/firmachain.token.MsgMint", NftTxTypes_1.MsgMint],
|
|
@@ -77,7 +77,7 @@ var GovQueryClient = /** @class */ (function () {
|
|
|
77
77
|
return __generator(this, function (_a) {
|
|
78
78
|
switch (_a.label) {
|
|
79
79
|
case 0:
|
|
80
|
-
path = "/cosmos/gov/
|
|
80
|
+
path = "/cosmos/gov/v1/proposals/".concat(id, "/tally");
|
|
81
81
|
return [4 /*yield*/, this.axios.get(path)];
|
|
82
82
|
case 1:
|
|
83
83
|
result = _a.sent();
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
|
-
import { MsgDeposit, MsgSubmitProposal, MsgVote } from "cosmjs-types/cosmos/gov/
|
|
3
|
-
import { MsgSubmitProposal
|
|
4
|
-
import { MsgCancelProposal } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
2
|
+
import { MsgDeposit as V1MsgDeposit, MsgSubmitProposal as V1MsgSubmitProposal, MsgUpdateParams as V1MsgUpdateParams, MsgVote as V1MsgVote, MsgVoteWeighted as V1MsgVoteWeighted } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
3
|
+
import { MsgDeposit, MsgSubmitProposal, MsgVote, MsgVoteWeighted } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1beta1/tx";
|
|
4
|
+
import { MsgCancelProposal as V1MsgCancelProposal } from "@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx";
|
|
5
5
|
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
6
6
|
import { ITxClient } from "../common/ITxClient";
|
|
7
|
+
export interface V1MsgDepositEncodeObject extends EncodeObject {
|
|
8
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgDeposit";
|
|
9
|
+
readonly value: Partial<V1MsgDeposit>;
|
|
10
|
+
}
|
|
11
|
+
export interface V1MsgSubmitProposalEncodeObject extends EncodeObject {
|
|
12
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgSubmitProposal";
|
|
13
|
+
readonly value: Partial<V1MsgSubmitProposal>;
|
|
14
|
+
}
|
|
15
|
+
export interface V1MsgUpdateParamsEncodeObject extends EncodeObject {
|
|
16
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgUpdateParams";
|
|
17
|
+
readonly value: Partial<V1MsgUpdateParams>;
|
|
18
|
+
}
|
|
19
|
+
export interface V1MsgVoteWeightedEncodeObject extends EncodeObject {
|
|
20
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgVoteWeighted";
|
|
21
|
+
readonly value: Partial<V1MsgVoteWeighted>;
|
|
22
|
+
}
|
|
23
|
+
export interface V1MsgCancelProposalEncodeObject extends EncodeObject {
|
|
24
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgCancelProposal";
|
|
25
|
+
readonly value: Partial<V1MsgCancelProposal>;
|
|
26
|
+
}
|
|
27
|
+
export interface V1MsgVoteEncodeObject extends EncodeObject {
|
|
28
|
+
readonly typeUrl: "/cosmos.gov.v1.MsgVote";
|
|
29
|
+
readonly value: Partial<V1MsgVote>;
|
|
30
|
+
}
|
|
7
31
|
export interface MsgDepositEncodeObject extends EncodeObject {
|
|
8
32
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgDeposit";
|
|
9
33
|
readonly value: Partial<MsgDeposit>;
|
|
@@ -12,24 +36,25 @@ export interface MsgSubmitProposalEncodeObject extends EncodeObject {
|
|
|
12
36
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal";
|
|
13
37
|
readonly value: Partial<MsgSubmitProposal>;
|
|
14
38
|
}
|
|
15
|
-
export interface MsgSubmitGenericProposalEncodeObject extends EncodeObject {
|
|
16
|
-
readonly typeUrl: "/cosmos.gov.v1.MsgSubmitProposal";
|
|
17
|
-
readonly value: Partial<MsgSubmitGenericProposal>;
|
|
18
|
-
}
|
|
19
39
|
export interface MsgVoteEncodeObject extends EncodeObject {
|
|
20
40
|
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVote";
|
|
21
41
|
readonly value: Partial<MsgVote>;
|
|
22
42
|
}
|
|
23
|
-
export interface
|
|
24
|
-
readonly typeUrl: "/cosmos.gov.
|
|
25
|
-
readonly value: Partial<
|
|
43
|
+
export interface MsgVoteWeightedEncodeObject extends EncodeObject {
|
|
44
|
+
readonly typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted";
|
|
45
|
+
readonly value: Partial<MsgVoteWeighted>;
|
|
26
46
|
}
|
|
27
47
|
export declare class GovTxClient extends ITxClient {
|
|
28
48
|
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
29
49
|
static getRegistry(): Registry;
|
|
50
|
+
static v1MsgDeposit(data: V1MsgDeposit): V1MsgDepositEncodeObject;
|
|
51
|
+
static v1MsgSubmitProposal(data: V1MsgSubmitProposal): V1MsgSubmitProposalEncodeObject;
|
|
52
|
+
static v1MsgUpdateParams(data: V1MsgUpdateParams): V1MsgUpdateParamsEncodeObject;
|
|
53
|
+
static v1MsgVote(data: V1MsgVote): V1MsgVoteEncodeObject;
|
|
54
|
+
static v1MsgVoteWeighted(data: V1MsgVoteWeighted): V1MsgVoteWeightedEncodeObject;
|
|
55
|
+
static v1MsgCancelProposal(data: V1MsgCancelProposal): V1MsgCancelProposalEncodeObject;
|
|
30
56
|
static msgDeposit(data: MsgDeposit): MsgDepositEncodeObject;
|
|
31
57
|
static msgSubmitProposal(data: MsgSubmitProposal): MsgSubmitProposalEncodeObject;
|
|
32
|
-
static msgSubmitGenericProposal(data: MsgSubmitGenericProposal): MsgSubmitGenericProposalEncodeObject;
|
|
33
58
|
static msgVote(data: MsgVote): MsgVoteEncodeObject;
|
|
34
|
-
static
|
|
59
|
+
static msgVoteWeighted(data: MsgVoteWeighted): MsgVoteWeightedEncodeObject;
|
|
35
60
|
}
|
|
@@ -17,17 +17,22 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.GovTxClient = void 0;
|
|
19
19
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
|
-
var tx_1 = require("cosmjs-types/cosmos/gov/
|
|
21
|
-
var tx_2 = require("cosmjs-types/cosmos/gov/
|
|
20
|
+
var tx_1 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
21
|
+
var tx_2 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1beta1/tx");
|
|
22
22
|
// temporarly using kintsugi-tech/cosmjs-types - this will be returned to original cosmjs-types after the PR is merged
|
|
23
23
|
var tx_3 = require("@kintsugi-tech/cosmjs-types/cosmos/gov/v1/tx");
|
|
24
24
|
var ITxClient_1 = require("../common/ITxClient");
|
|
25
25
|
var types = [
|
|
26
|
-
["/cosmos.gov.
|
|
27
|
-
["/cosmos.gov.
|
|
28
|
-
["/cosmos.gov.v1.
|
|
29
|
-
["/cosmos.gov.
|
|
26
|
+
["/cosmos.gov.v1.MsgDeposit", tx_1.MsgDeposit],
|
|
27
|
+
["/cosmos.gov.v1.MsgSubmitProposal", tx_1.MsgSubmitProposal],
|
|
28
|
+
["/cosmos.gov.v1.MsgUpdateParams", tx_1.MsgUpdateParams],
|
|
29
|
+
["/cosmos.gov.v1.MsgVote", tx_1.MsgVote],
|
|
30
|
+
["/cosmos.gov.v1.MsgVoteWeighted", tx_1.MsgVoteWeighted],
|
|
30
31
|
["/cosmos.gov.v1.MsgCancelProposal", tx_3.MsgCancelProposal],
|
|
32
|
+
["/cosmos.gov.v1beta1.MsgDeposit", tx_2.MsgDeposit],
|
|
33
|
+
["/cosmos.gov.v1beta1.MsgSubmitProposal", tx_2.MsgSubmitProposal],
|
|
34
|
+
["/cosmos.gov.v1beta1.MsgVote", tx_2.MsgVote],
|
|
35
|
+
["/cosmos.gov.v1beta1.MsgVoteWeighted", tx_2.MsgVoteWeighted],
|
|
31
36
|
];
|
|
32
37
|
var registry = new proto_signing_1.Registry(types);
|
|
33
38
|
var GovTxClient = /** @class */ (function (_super) {
|
|
@@ -38,20 +43,35 @@ var GovTxClient = /** @class */ (function (_super) {
|
|
|
38
43
|
GovTxClient.getRegistry = function () {
|
|
39
44
|
return registry;
|
|
40
45
|
};
|
|
46
|
+
GovTxClient.v1MsgDeposit = function (data) {
|
|
47
|
+
return { typeUrl: "/cosmos.gov.v1.MsgDeposit", value: data };
|
|
48
|
+
};
|
|
49
|
+
GovTxClient.v1MsgSubmitProposal = function (data) {
|
|
50
|
+
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: data };
|
|
51
|
+
};
|
|
52
|
+
GovTxClient.v1MsgUpdateParams = function (data) {
|
|
53
|
+
return { typeUrl: "/cosmos.gov.v1.MsgUpdateParams", value: data };
|
|
54
|
+
};
|
|
55
|
+
GovTxClient.v1MsgVote = function (data) {
|
|
56
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVote", value: data };
|
|
57
|
+
};
|
|
58
|
+
GovTxClient.v1MsgVoteWeighted = function (data) {
|
|
59
|
+
return { typeUrl: "/cosmos.gov.v1.MsgVoteWeighted", value: data };
|
|
60
|
+
};
|
|
61
|
+
GovTxClient.v1MsgCancelProposal = function (data) {
|
|
62
|
+
return { typeUrl: "/cosmos.gov.v1.MsgCancelProposal", value: data };
|
|
63
|
+
};
|
|
41
64
|
GovTxClient.msgDeposit = function (data) {
|
|
42
65
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgDeposit", value: data };
|
|
43
66
|
};
|
|
44
67
|
GovTxClient.msgSubmitProposal = function (data) {
|
|
45
68
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgSubmitProposal", value: data };
|
|
46
69
|
};
|
|
47
|
-
GovTxClient.msgSubmitGenericProposal = function (data) {
|
|
48
|
-
return { typeUrl: "/cosmos.gov.v1.MsgSubmitProposal", value: data };
|
|
49
|
-
};
|
|
50
70
|
GovTxClient.msgVote = function (data) {
|
|
51
71
|
return { typeUrl: "/cosmos.gov.v1beta1.MsgVote", value: data };
|
|
52
72
|
};
|
|
53
|
-
GovTxClient.
|
|
54
|
-
return { typeUrl: "/cosmos.gov.
|
|
73
|
+
GovTxClient.msgVoteWeighted = function (data) {
|
|
74
|
+
return { typeUrl: "/cosmos.gov.v1beta1.MsgVoteWeighted", value: data };
|
|
55
75
|
};
|
|
56
76
|
return GovTxClient;
|
|
57
77
|
}(ITxClient_1.ITxClient));
|
|
@@ -142,10 +142,10 @@ describe('[17. Gov Query Test]', function () {
|
|
|
142
142
|
case 2:
|
|
143
143
|
param = _a.sent();
|
|
144
144
|
(0, chai_1.expect)(param).to.be.an('object');
|
|
145
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
146
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
147
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
148
|
-
(0, chai_1.expect)(param).to.have.property('
|
|
145
|
+
(0, chai_1.expect)(param).to.have.property('yes_count');
|
|
146
|
+
(0, chai_1.expect)(param).to.have.property('abstain_count');
|
|
147
|
+
(0, chai_1.expect)(param).to.have.property('no_count');
|
|
148
|
+
(0, chai_1.expect)(param).to.have.property('no_with_veto_count');
|
|
149
149
|
return [3 /*break*/, 4];
|
|
150
150
|
case 3:
|
|
151
151
|
(0, chai_1.expect)(proposalList).to.have.lengthOf(0);
|