@firmachain/firma-js 0.2.17 → 0.2.18

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.
Files changed (155) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +16 -0
  3. package/dist/sdk/FirmaBankService.d.ts +15 -0
  4. package/dist/sdk/FirmaBankService.js +211 -0
  5. package/dist/sdk/FirmaChainService.d.ts +8 -0
  6. package/dist/sdk/FirmaChainService.js +86 -0
  7. package/dist/sdk/FirmaConfig.d.ts +16 -0
  8. package/dist/sdk/FirmaConfig.js +55 -0
  9. package/dist/sdk/FirmaContractService.d.ts +30 -0
  10. package/dist/sdk/FirmaContractService.js +394 -0
  11. package/dist/sdk/FirmaDistributionService.d.ts +31 -0
  12. package/dist/sdk/FirmaDistributionService.js +524 -0
  13. package/dist/sdk/FirmaFeeGrantService.d.ts +21 -0
  14. package/dist/sdk/FirmaFeeGrantService.js +341 -0
  15. package/dist/sdk/FirmaGovService.d.ts +35 -0
  16. package/dist/sdk/FirmaGovService.js +775 -0
  17. package/dist/sdk/FirmaIpfsService.d.ts +12 -0
  18. package/dist/sdk/FirmaIpfsService.js +185 -0
  19. package/dist/sdk/FirmaMobileSDK.d.ts +27 -0
  20. package/dist/sdk/FirmaMobileSDK.js +45 -0
  21. package/dist/sdk/FirmaNftService.d.ts +28 -0
  22. package/dist/sdk/FirmaNftService.js +390 -0
  23. package/dist/sdk/FirmaSDK.d.ts +29 -0
  24. package/dist/sdk/FirmaSDK.js +48 -0
  25. package/dist/sdk/FirmaSlashingService.d.ts +9 -0
  26. package/dist/sdk/FirmaSlashingService.js +105 -0
  27. package/dist/sdk/FirmaStakingService.d.ts +34 -0
  28. package/dist/sdk/FirmaStakingService.js +604 -0
  29. package/dist/sdk/FirmaTokenService.d.ts +26 -0
  30. package/dist/sdk/FirmaTokenService.js +416 -0
  31. package/dist/sdk/FirmaUtil.d.ts +25 -0
  32. package/dist/sdk/FirmaUtil.js +201 -0
  33. package/dist/sdk/FirmaWalletService.d.ts +40 -0
  34. package/dist/sdk/FirmaWalletService.js +309 -0
  35. package/dist/sdk/firmachain/amino/addresses.d.ts +5 -0
  36. package/dist/sdk/firmachain/amino/addresses.js +46 -0
  37. package/dist/sdk/firmachain/amino/aminomsgs.d.ts +281 -0
  38. package/dist/sdk/firmachain/amino/aminomsgs.js +77 -0
  39. package/dist/sdk/firmachain/amino/aminotypes.d.ts +22 -0
  40. package/dist/sdk/firmachain/amino/aminotypes.js +521 -0
  41. package/dist/sdk/firmachain/amino/coins.d.ts +30 -0
  42. package/dist/sdk/firmachain/amino/coins.js +69 -0
  43. package/dist/sdk/firmachain/amino/encoding.d.ts +24 -0
  44. package/dist/sdk/firmachain/amino/encoding.js +234 -0
  45. package/dist/sdk/firmachain/amino/multisig.d.ts +10 -0
  46. package/dist/sdk/firmachain/amino/multisig.js +42 -0
  47. package/dist/sdk/firmachain/amino/paths.d.ts +6 -0
  48. package/dist/sdk/firmachain/amino/paths.js +18 -0
  49. package/dist/sdk/firmachain/amino/pubkeys.d.ts +47 -0
  50. package/dist/sdk/firmachain/amino/pubkeys.js +29 -0
  51. package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +94 -0
  52. package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +437 -0
  53. package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +23 -0
  54. package/dist/sdk/firmachain/amino/secp256k1wallet.js +141 -0
  55. package/dist/sdk/firmachain/amino/signature.d.ts +16 -0
  56. package/dist/sdk/firmachain/amino/signature.js +36 -0
  57. package/dist/sdk/firmachain/amino/signdoc.d.ts +26 -0
  58. package/dist/sdk/firmachain/amino/signdoc.js +42 -0
  59. package/dist/sdk/firmachain/amino/signer.d.ts +33 -0
  60. package/dist/sdk/firmachain/amino/signer.js +2 -0
  61. package/dist/sdk/firmachain/amino/stdtx.d.ts +15 -0
  62. package/dist/sdk/firmachain/amino/stdtx.js +17 -0
  63. package/dist/sdk/firmachain/amino/wallet.d.ts +32 -0
  64. package/dist/sdk/firmachain/amino/wallet.js +132 -0
  65. package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +12 -0
  66. package/dist/sdk/firmachain/bank/BankQueryClient.js +116 -0
  67. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +17 -0
  68. package/dist/sdk/firmachain/bank/BankTxClient.js +40 -0
  69. package/dist/sdk/firmachain/bank/index.d.ts +3 -0
  70. package/dist/sdk/firmachain/bank/index.js +15 -0
  71. package/dist/sdk/firmachain/common/ITxClient.d.ts +15 -0
  72. package/dist/sdk/firmachain/common/ITxClient.js +102 -0
  73. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +27 -0
  74. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +165 -0
  75. package/dist/sdk/firmachain/common/LedgerWallet.d.ts +9 -0
  76. package/dist/sdk/firmachain/common/LedgerWallet.js +150 -0
  77. package/dist/sdk/firmachain/common/QueryCommon.d.ts +4 -0
  78. package/dist/sdk/firmachain/common/QueryCommon.js +2 -0
  79. package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +42 -0
  80. package/dist/sdk/firmachain/common/TendermintQueryClient.js +108 -0
  81. package/dist/sdk/firmachain/common/TxCommon.d.ts +94 -0
  82. package/dist/sdk/firmachain/common/TxCommon.js +34 -0
  83. package/dist/sdk/firmachain/common/accounts.d.ts +16 -0
  84. package/dist/sdk/firmachain/common/accounts.js +64 -0
  85. package/dist/sdk/firmachain/common/index.d.ts +2 -0
  86. package/dist/sdk/firmachain/common/index.js +14 -0
  87. package/dist/sdk/firmachain/common/signing.d.ts +10 -0
  88. package/dist/sdk/firmachain/common/signing.js +75 -0
  89. package/dist/sdk/firmachain/common/signingstargateclient.d.ts +37 -0
  90. package/dist/sdk/firmachain/common/signingstargateclient.js +298 -0
  91. package/dist/sdk/firmachain/common/stargateclient.d.ts +46 -0
  92. package/dist/sdk/firmachain/common/stargateclient.js +211 -0
  93. package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +31 -0
  94. package/dist/sdk/firmachain/contract/ContractQueryClient.js +141 -0
  95. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +17 -0
  96. package/dist/sdk/firmachain/contract/ContractTxClient.js +40 -0
  97. package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +69 -0
  98. package/dist/sdk/firmachain/contract/ContractTxTypes.js +483 -0
  99. package/dist/sdk/firmachain/contract/index.d.ts +3 -0
  100. package/dist/sdk/firmachain/contract/index.js +15 -0
  101. package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +18 -0
  102. package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +167 -0
  103. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +27 -0
  104. package/dist/sdk/firmachain/distribution/DistributionTxClient.js +48 -0
  105. package/dist/sdk/firmachain/distribution/index.d.ts +3 -0
  106. package/dist/sdk/firmachain/distribution/index.js +15 -0
  107. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +17 -0
  108. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +86 -0
  109. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +17 -0
  110. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +40 -0
  111. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +76 -0
  112. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +194 -0
  113. package/dist/sdk/firmachain/feegrant/index.d.ts +2 -0
  114. package/dist/sdk/firmachain/feegrant/index.js +15 -0
  115. package/dist/sdk/firmachain/google/protobuf/any.d.ts +128 -0
  116. package/dist/sdk/firmachain/google/protobuf/any.js +106 -0
  117. package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +996 -0
  118. package/dist/sdk/firmachain/google/protobuf/descriptor.js +5329 -0
  119. package/dist/sdk/firmachain/google/protobuf/duration.d.ts +91 -0
  120. package/dist/sdk/firmachain/google/protobuf/duration.js +107 -0
  121. package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +109 -0
  122. package/dist/sdk/firmachain/google/protobuf/timestamp.js +107 -0
  123. package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +61 -0
  124. package/dist/sdk/firmachain/gov/GovQueryClient.js +152 -0
  125. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +22 -0
  126. package/dist/sdk/firmachain/gov/GovTxClient.js +44 -0
  127. package/dist/sdk/firmachain/gov/index.d.ts +3 -0
  128. package/dist/sdk/firmachain/gov/index.js +15 -0
  129. package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +17 -0
  130. package/dist/sdk/firmachain/nft/NftQueryClient.js +121 -0
  131. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +22 -0
  132. package/dist/sdk/firmachain/nft/NftTxClient.js +44 -0
  133. package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +86 -0
  134. package/dist/sdk/firmachain/nft/NftTxTypes.js +424 -0
  135. package/dist/sdk/firmachain/nft/index.d.ts +3 -0
  136. package/dist/sdk/firmachain/nft/index.js +15 -0
  137. package/dist/sdk/firmachain/slashing/SlashingQueryClient.d.ts +22 -0
  138. package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +101 -0
  139. package/dist/sdk/firmachain/slashing/index.d.ts +2 -0
  140. package/dist/sdk/firmachain/slashing/index.js +14 -0
  141. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +93 -0
  142. package/dist/sdk/firmachain/staking/StakingQueryClient.js +223 -0
  143. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +32 -0
  144. package/dist/sdk/firmachain/staking/StakingTxClient.js +52 -0
  145. package/dist/sdk/firmachain/staking/index.d.ts +3 -0
  146. package/dist/sdk/firmachain/staking/index.js +15 -0
  147. package/dist/sdk/firmachain/token/TokenQueryClient.d.ts +24 -0
  148. package/dist/sdk/firmachain/token/TokenQueryClient.js +106 -0
  149. package/dist/sdk/firmachain/token/TokenTxClient.d.ts +27 -0
  150. package/dist/sdk/firmachain/token/TokenTxClient.js +48 -0
  151. package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +116 -0
  152. package/dist/sdk/firmachain/token/TokenTxTypes.js +685 -0
  153. package/dist/sdk/firmachain/token/index.d.ts +3 -0
  154. package/dist/sdk/firmachain/token/index.js +15 -0
  155. package/package.json +1 -1
@@ -0,0 +1,775 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.FirmaGovService = void 0;
43
+ var gov_1 = require("./firmachain/gov");
44
+ var FirmaUtil_1 = require("./FirmaUtil");
45
+ var any_1 = require("./firmachain/google/protobuf/any");
46
+ var gov_2 = require("cosmjs-types/cosmos/gov/v1beta1/gov");
47
+ var distribution_1 = require("cosmjs-types/cosmos/distribution/v1beta1/distribution");
48
+ var params_1 = require("cosmjs-types/cosmos/params/v1beta1/params");
49
+ var upgrade_1 = require("cosmjs-types/cosmos/upgrade/v1beta1/upgrade");
50
+ var long_1 = __importDefault(require("long"));
51
+ var FirmaGovService = /** @class */ (function () {
52
+ function FirmaGovService(config) {
53
+ this.config = config;
54
+ }
55
+ FirmaGovService.prototype.getGasEstimationVote = function (wallet, proposalId, option, txMisc) {
56
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
57
+ return __awaiter(this, void 0, void 0, function () {
58
+ var longId, txRaw, error_1;
59
+ return __generator(this, function (_a) {
60
+ switch (_a.label) {
61
+ case 0:
62
+ _a.trys.push([0, 3, , 4]);
63
+ longId = long_1.default.fromInt(proposalId);
64
+ return [4 /*yield*/, this.getSignedTxVote(wallet, longId, option, txMisc)];
65
+ case 1:
66
+ txRaw = _a.sent();
67
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
68
+ case 2: return [2 /*return*/, _a.sent()];
69
+ case 3:
70
+ error_1 = _a.sent();
71
+ FirmaUtil_1.FirmaUtil.printLog(error_1);
72
+ throw error_1;
73
+ case 4: return [2 /*return*/];
74
+ }
75
+ });
76
+ });
77
+ };
78
+ FirmaGovService.prototype.getGasEstimationDeposit = function (wallet, proposalId, amount, txMisc) {
79
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ var longId, txRaw, error_2;
82
+ return __generator(this, function (_a) {
83
+ switch (_a.label) {
84
+ case 0:
85
+ _a.trys.push([0, 3, , 4]);
86
+ longId = long_1.default.fromInt(proposalId);
87
+ return [4 /*yield*/, this.getSignedTxDeposit(wallet, longId, amount, txMisc)];
88
+ case 1:
89
+ txRaw = _a.sent();
90
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
91
+ case 2: return [2 /*return*/, _a.sent()];
92
+ case 3:
93
+ error_2 = _a.sent();
94
+ FirmaUtil_1.FirmaUtil.printLog(error_2);
95
+ throw error_2;
96
+ case 4: return [2 /*return*/];
97
+ }
98
+ });
99
+ });
100
+ };
101
+ FirmaGovService.prototype.getGasEstimationSubmitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
102
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
103
+ return __awaiter(this, void 0, void 0, function () {
104
+ var txRaw, error_3;
105
+ return __generator(this, function (_a) {
106
+ switch (_a.label) {
107
+ case 0:
108
+ _a.trys.push([0, 3, , 4]);
109
+ return [4 /*yield*/, this.getSignedTxSubmitCancelSoftwareUpgradeProposal(wallet, title, description, initialDepositFCT, txMisc)];
110
+ case 1:
111
+ txRaw = _a.sent();
112
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
113
+ case 2: return [2 /*return*/, _a.sent()];
114
+ case 3:
115
+ error_3 = _a.sent();
116
+ FirmaUtil_1.FirmaUtil.printLog(error_3);
117
+ throw error_3;
118
+ case 4: return [2 /*return*/];
119
+ }
120
+ });
121
+ });
122
+ };
123
+ FirmaGovService.prototype.getGasEstimationSubmitSoftwareUpgradeProposalByHeight = function (wallet, title, description, initialDepositFCT, upgradeName, height, txMisc) {
124
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ var upgradeHeight, plan, txRaw, error_4;
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0:
130
+ _a.trys.push([0, 3, , 4]);
131
+ upgradeHeight = long_1.default.fromInt(height);
132
+ plan = {
133
+ name: upgradeName,
134
+ time: undefined,
135
+ height: upgradeHeight,
136
+ info: undefined,
137
+ upgradedClientState: undefined
138
+ };
139
+ return [4 /*yield*/, this.getSignedTxSubmitSoftwareUpgradeProposal(wallet, title, description, initialDepositFCT, plan, txMisc)];
140
+ case 1:
141
+ txRaw = _a.sent();
142
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
143
+ case 2: return [2 /*return*/, _a.sent()];
144
+ case 3:
145
+ error_4 = _a.sent();
146
+ FirmaUtil_1.FirmaUtil.printLog(error_4);
147
+ throw error_4;
148
+ case 4: return [2 /*return*/];
149
+ }
150
+ });
151
+ });
152
+ };
153
+ FirmaGovService.prototype.getGasEstimationSubmitParameterChangeProposal = function (wallet, title, description, initialDepositFCT, paramList, txMisc) {
154
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
155
+ return __awaiter(this, void 0, void 0, function () {
156
+ var txRaw, error_5;
157
+ return __generator(this, function (_a) {
158
+ switch (_a.label) {
159
+ case 0:
160
+ _a.trys.push([0, 3, , 4]);
161
+ return [4 /*yield*/, this.getSignedTxSubmitParameterChangeProposal(wallet, title, description, initialDepositFCT, paramList, txMisc)];
162
+ case 1:
163
+ txRaw = _a.sent();
164
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
165
+ case 2: return [2 /*return*/, _a.sent()];
166
+ case 3:
167
+ error_5 = _a.sent();
168
+ FirmaUtil_1.FirmaUtil.printLog(error_5);
169
+ throw error_5;
170
+ case 4: return [2 /*return*/];
171
+ }
172
+ });
173
+ });
174
+ };
175
+ FirmaGovService.prototype.getGasEstimationSubmitCommunityPoolSpendProposal = function (wallet, title, description, initialDepositFCT, amount, recipient, txMisc) {
176
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
177
+ return __awaiter(this, void 0, void 0, function () {
178
+ var txRaw, error_6;
179
+ return __generator(this, function (_a) {
180
+ switch (_a.label) {
181
+ case 0:
182
+ _a.trys.push([0, 3, , 4]);
183
+ return [4 /*yield*/, this.getSignedTxSubmitCommunityPoolSpendProposal(wallet, title, description, initialDepositFCT, amount, recipient, txMisc)];
184
+ case 1:
185
+ txRaw = _a.sent();
186
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
187
+ case 2: return [2 /*return*/, _a.sent()];
188
+ case 3:
189
+ error_6 = _a.sent();
190
+ FirmaUtil_1.FirmaUtil.printLog(error_6);
191
+ throw error_6;
192
+ case 4: return [2 /*return*/];
193
+ }
194
+ });
195
+ });
196
+ };
197
+ FirmaGovService.prototype.getGasEstimationSubmitTextProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
198
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
199
+ return __awaiter(this, void 0, void 0, function () {
200
+ var txRaw, error_7;
201
+ return __generator(this, function (_a) {
202
+ switch (_a.label) {
203
+ case 0:
204
+ _a.trys.push([0, 3, , 4]);
205
+ return [4 /*yield*/, this.getSignedTxSubmitTextProposal(wallet, title, description, initialDepositFCT, txMisc)];
206
+ case 1:
207
+ txRaw = _a.sent();
208
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
209
+ case 2: return [2 /*return*/, _a.sent()];
210
+ case 3:
211
+ error_7 = _a.sent();
212
+ FirmaUtil_1.FirmaUtil.printLog(error_7);
213
+ throw error_7;
214
+ case 4: return [2 /*return*/];
215
+ }
216
+ });
217
+ });
218
+ };
219
+ FirmaGovService.prototype.getSignedTxSubmitTextProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
220
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
221
+ return __awaiter(this, void 0, void 0, function () {
222
+ var txClient, sendAmount, proposal, content, proposer, message, error_8;
223
+ return __generator(this, function (_a) {
224
+ switch (_a.label) {
225
+ case 0:
226
+ _a.trys.push([0, 3, , 4]);
227
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
228
+ sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT) };
229
+ proposal = gov_2.TextProposal.fromPartial({
230
+ title: title,
231
+ description: description,
232
+ });
233
+ content = any_1.Any.fromPartial({
234
+ typeUrl: "/cosmos.gov.v1beta1.TextProposal",
235
+ value: Uint8Array.from(gov_2.TextProposal.encode(proposal).finish()),
236
+ });
237
+ return [4 /*yield*/, wallet.getAddress()];
238
+ case 1:
239
+ proposer = _a.sent();
240
+ message = txClient.msgSubmitProposal({ content: content, initialDeposit: [sendAmount], proposer: proposer });
241
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
242
+ case 2: return [2 /*return*/, _a.sent()];
243
+ case 3:
244
+ error_8 = _a.sent();
245
+ FirmaUtil_1.FirmaUtil.printLog(error_8);
246
+ throw error_8;
247
+ case 4: return [2 /*return*/];
248
+ }
249
+ });
250
+ });
251
+ };
252
+ FirmaGovService.prototype.getSignedTxSubmitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
253
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
254
+ return __awaiter(this, void 0, void 0, function () {
255
+ var txClient, initialDepositAmount, proposal, content, proposer, message, error_9;
256
+ return __generator(this, function (_a) {
257
+ switch (_a.label) {
258
+ case 0:
259
+ _a.trys.push([0, 3, , 4]);
260
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
261
+ initialDepositAmount = {
262
+ denom: this.config.denom,
263
+ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
264
+ };
265
+ proposal = upgrade_1.CancelSoftwareUpgradeProposal.fromPartial({
266
+ title: title,
267
+ description: description,
268
+ });
269
+ content = any_1.Any.fromPartial({
270
+ typeUrl: "/cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal",
271
+ value: Uint8Array.from(upgrade_1.SoftwareUpgradeProposal.encode(proposal).finish()),
272
+ });
273
+ return [4 /*yield*/, wallet.getAddress()];
274
+ case 1:
275
+ proposer = _a.sent();
276
+ message = txClient.msgSubmitProposal({
277
+ content: content,
278
+ initialDeposit: [initialDepositAmount],
279
+ proposer: proposer
280
+ });
281
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
282
+ case 2: return [2 /*return*/, _a.sent()];
283
+ case 3:
284
+ error_9 = _a.sent();
285
+ FirmaUtil_1.FirmaUtil.printLog(error_9);
286
+ throw error_9;
287
+ case 4: return [2 /*return*/];
288
+ }
289
+ });
290
+ });
291
+ };
292
+ FirmaGovService.prototype.getSignedTxSubmitSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, plan, txMisc) {
293
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
294
+ return __awaiter(this, void 0, void 0, function () {
295
+ var txClient, initialDepositAmount, proposal, content, proposer, message, error_10;
296
+ return __generator(this, function (_a) {
297
+ switch (_a.label) {
298
+ case 0:
299
+ _a.trys.push([0, 3, , 4]);
300
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
301
+ initialDepositAmount = {
302
+ denom: this.config.denom,
303
+ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
304
+ };
305
+ proposal = upgrade_1.SoftwareUpgradeProposal.fromPartial({
306
+ title: title,
307
+ description: description,
308
+ plan: plan,
309
+ });
310
+ content = any_1.Any.fromPartial({
311
+ typeUrl: "/cosmos.upgrade.v1beta1.SoftwareUpgradeProposal",
312
+ value: Uint8Array.from(upgrade_1.SoftwareUpgradeProposal.encode(proposal).finish()),
313
+ });
314
+ return [4 /*yield*/, wallet.getAddress()];
315
+ case 1:
316
+ proposer = _a.sent();
317
+ message = txClient.msgSubmitProposal({
318
+ content: content,
319
+ initialDeposit: [initialDepositAmount],
320
+ proposer: proposer
321
+ });
322
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
323
+ case 2: return [2 /*return*/, _a.sent()];
324
+ case 3:
325
+ error_10 = _a.sent();
326
+ FirmaUtil_1.FirmaUtil.printLog(error_10);
327
+ throw error_10;
328
+ case 4: return [2 /*return*/];
329
+ }
330
+ });
331
+ });
332
+ };
333
+ FirmaGovService.prototype.getSignedTxSubmitParameterChangeProposal = function (wallet, title, description, initialDepositFCT, paramList, txMisc) {
334
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
335
+ return __awaiter(this, void 0, void 0, function () {
336
+ var txClient, initialDepositAmount, proposal, content, proposer, message, error_11;
337
+ return __generator(this, function (_a) {
338
+ switch (_a.label) {
339
+ case 0:
340
+ _a.trys.push([0, 3, , 4]);
341
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
342
+ initialDepositAmount = {
343
+ denom: this.config.denom,
344
+ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
345
+ };
346
+ proposal = params_1.ParameterChangeProposal.fromPartial({
347
+ title: title,
348
+ description: description,
349
+ changes: paramList,
350
+ });
351
+ content = any_1.Any.fromPartial({
352
+ typeUrl: "/cosmos.params.v1beta1.ParameterChangeProposal",
353
+ value: Uint8Array.from(params_1.ParameterChangeProposal.encode(proposal).finish()),
354
+ });
355
+ return [4 /*yield*/, wallet.getAddress()];
356
+ case 1:
357
+ proposer = _a.sent();
358
+ message = txClient.msgSubmitProposal({
359
+ content: content,
360
+ initialDeposit: [initialDepositAmount],
361
+ proposer: proposer
362
+ });
363
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
364
+ case 2: return [2 /*return*/, _a.sent()];
365
+ case 3:
366
+ error_11 = _a.sent();
367
+ FirmaUtil_1.FirmaUtil.printLog(error_11);
368
+ throw error_11;
369
+ case 4: return [2 /*return*/];
370
+ }
371
+ });
372
+ });
373
+ };
374
+ FirmaGovService.prototype.getSignedTxSubmitCommunityPoolSpendProposal = function (wallet, title, description, initialDepositFCT, amount, recipient, txMisc) {
375
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
376
+ return __awaiter(this, void 0, void 0, function () {
377
+ var txClient, initialDepositAmount, sendAmount, proposal, content, proposer, message, error_12;
378
+ return __generator(this, function (_a) {
379
+ switch (_a.label) {
380
+ case 0:
381
+ _a.trys.push([0, 3, , 4]);
382
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
383
+ initialDepositAmount = {
384
+ denom: this.config.denom,
385
+ amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
386
+ };
387
+ sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
388
+ proposal = distribution_1.CommunityPoolSpendProposal.fromPartial({
389
+ title: title,
390
+ description: description,
391
+ recipient: recipient,
392
+ amount: [sendAmount]
393
+ });
394
+ content = any_1.Any.fromPartial({
395
+ typeUrl: "/cosmos.distribution.v1beta1.CommunityPoolSpendProposal",
396
+ value: Uint8Array.from(distribution_1.CommunityPoolSpendProposal.encode(proposal).finish()),
397
+ });
398
+ return [4 /*yield*/, wallet.getAddress()];
399
+ case 1:
400
+ proposer = _a.sent();
401
+ message = txClient.msgSubmitProposal({
402
+ content: content,
403
+ initialDeposit: [initialDepositAmount],
404
+ proposer: proposer
405
+ });
406
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
407
+ case 2: return [2 /*return*/, _a.sent()];
408
+ case 3:
409
+ error_12 = _a.sent();
410
+ FirmaUtil_1.FirmaUtil.printLog(error_12);
411
+ throw error_12;
412
+ case 4: return [2 /*return*/];
413
+ }
414
+ });
415
+ });
416
+ };
417
+ FirmaGovService.prototype.submitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDeposit, txMisc) {
418
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
419
+ return __awaiter(this, void 0, void 0, function () {
420
+ var txRaw, txClient, error_13;
421
+ return __generator(this, function (_a) {
422
+ switch (_a.label) {
423
+ case 0:
424
+ _a.trys.push([0, 3, , 4]);
425
+ return [4 /*yield*/, this.getSignedTxSubmitCancelSoftwareUpgradeProposal(wallet, title, description, initialDeposit, txMisc)];
426
+ case 1:
427
+ txRaw = _a.sent();
428
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
429
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
430
+ case 2: return [2 /*return*/, _a.sent()];
431
+ case 3:
432
+ error_13 = _a.sent();
433
+ FirmaUtil_1.FirmaUtil.printLog(error_13);
434
+ throw error_13;
435
+ case 4: return [2 /*return*/];
436
+ }
437
+ });
438
+ });
439
+ };
440
+ FirmaGovService.prototype.submitSoftwareUpgradeProposalByHeight = function (wallet, title, description, initialDeposit, upgradeName, height, txMisc) {
441
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
442
+ return __awaiter(this, void 0, void 0, function () {
443
+ var upgradeHeight, plan, txRaw, txClient, error_14;
444
+ return __generator(this, function (_a) {
445
+ switch (_a.label) {
446
+ case 0:
447
+ _a.trys.push([0, 3, , 4]);
448
+ upgradeHeight = long_1.default.fromInt(height);
449
+ plan = {
450
+ name: upgradeName,
451
+ time: undefined,
452
+ height: upgradeHeight,
453
+ info: undefined,
454
+ upgradedClientState: undefined
455
+ };
456
+ return [4 /*yield*/, this.getSignedTxSubmitSoftwareUpgradeProposal(wallet, title, description, initialDeposit, plan, txMisc)];
457
+ case 1:
458
+ txRaw = _a.sent();
459
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
460
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
461
+ case 2: return [2 /*return*/, _a.sent()];
462
+ case 3:
463
+ error_14 = _a.sent();
464
+ FirmaUtil_1.FirmaUtil.printLog(error_14);
465
+ throw error_14;
466
+ case 4: return [2 /*return*/];
467
+ }
468
+ });
469
+ });
470
+ };
471
+ FirmaGovService.prototype.submitSoftwareUpgradeProposalByTime = function (wallet, title, description, initialDeposit, upgradeName, upgradeTime, txMisc) {
472
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
473
+ return __awaiter(this, void 0, void 0, function () {
474
+ var plan, txRaw, txClient, error_15;
475
+ return __generator(this, function (_a) {
476
+ switch (_a.label) {
477
+ case 0:
478
+ _a.trys.push([0, 3, , 4]);
479
+ plan = {
480
+ name: upgradeName,
481
+ time: upgradeTime,
482
+ height: undefined,
483
+ info: undefined,
484
+ upgradedClientState: undefined
485
+ };
486
+ return [4 /*yield*/, this.getSignedTxSubmitSoftwareUpgradeProposal(wallet, title, description, initialDeposit, plan, txMisc)];
487
+ case 1:
488
+ txRaw = _a.sent();
489
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
490
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
491
+ case 2: return [2 /*return*/, _a.sent()];
492
+ case 3:
493
+ error_15 = _a.sent();
494
+ FirmaUtil_1.FirmaUtil.printLog(error_15);
495
+ throw error_15;
496
+ case 4: return [2 /*return*/];
497
+ }
498
+ });
499
+ });
500
+ };
501
+ FirmaGovService.prototype.submitParameterChangeProposal = function (wallet, title, description, initialDeposit, paramList, txMisc) {
502
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
503
+ return __awaiter(this, void 0, void 0, function () {
504
+ var txRaw, txClient, error_16;
505
+ return __generator(this, function (_a) {
506
+ switch (_a.label) {
507
+ case 0:
508
+ _a.trys.push([0, 3, , 4]);
509
+ return [4 /*yield*/, this.getSignedTxSubmitParameterChangeProposal(wallet, title, description, initialDeposit, paramList, txMisc)];
510
+ case 1:
511
+ txRaw = _a.sent();
512
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
513
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
514
+ case 2: return [2 /*return*/, _a.sent()];
515
+ case 3:
516
+ error_16 = _a.sent();
517
+ FirmaUtil_1.FirmaUtil.printLog(error_16);
518
+ throw error_16;
519
+ case 4: return [2 /*return*/];
520
+ }
521
+ });
522
+ });
523
+ };
524
+ FirmaGovService.prototype.submitCommunityPoolSpendProposal = function (wallet, title, description, initialDeposit, amount, recipient, txMisc) {
525
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
526
+ return __awaiter(this, void 0, void 0, function () {
527
+ var txRaw, txClient, error_17;
528
+ return __generator(this, function (_a) {
529
+ switch (_a.label) {
530
+ case 0:
531
+ _a.trys.push([0, 3, , 4]);
532
+ return [4 /*yield*/, this.getSignedTxSubmitCommunityPoolSpendProposal(wallet, title, description, initialDeposit, amount, recipient, txMisc)];
533
+ case 1:
534
+ txRaw = _a.sent();
535
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
536
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
537
+ case 2: return [2 /*return*/, _a.sent()];
538
+ case 3:
539
+ error_17 = _a.sent();
540
+ FirmaUtil_1.FirmaUtil.printLog(error_17);
541
+ throw error_17;
542
+ case 4: return [2 /*return*/];
543
+ }
544
+ });
545
+ });
546
+ };
547
+ FirmaGovService.prototype.submitTextProposal = function (wallet, title, description, initialDeposit, txMisc) {
548
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
549
+ return __awaiter(this, void 0, void 0, function () {
550
+ var txRaw, txClient, error_18;
551
+ return __generator(this, function (_a) {
552
+ switch (_a.label) {
553
+ case 0:
554
+ _a.trys.push([0, 3, , 4]);
555
+ return [4 /*yield*/, this.getSignedTxSubmitTextProposal(wallet, title, description, initialDeposit, txMisc)];
556
+ case 1:
557
+ txRaw = _a.sent();
558
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
559
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
560
+ case 2: return [2 /*return*/, _a.sent()];
561
+ case 3:
562
+ error_18 = _a.sent();
563
+ FirmaUtil_1.FirmaUtil.printLog(error_18);
564
+ throw error_18;
565
+ case 4: return [2 /*return*/];
566
+ }
567
+ });
568
+ });
569
+ };
570
+ FirmaGovService.prototype.getSignedTxVote = function (wallet, proposalId, option, txMisc) {
571
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
572
+ return __awaiter(this, void 0, void 0, function () {
573
+ var voter, txClient, message, error_19;
574
+ return __generator(this, function (_a) {
575
+ switch (_a.label) {
576
+ case 0:
577
+ _a.trys.push([0, 3, , 4]);
578
+ return [4 /*yield*/, wallet.getAddress()];
579
+ case 1:
580
+ voter = _a.sent();
581
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
582
+ message = txClient.msgVote({ proposalId: proposalId, voter: voter, option: option });
583
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
584
+ case 2: return [2 /*return*/, _a.sent()];
585
+ case 3:
586
+ error_19 = _a.sent();
587
+ FirmaUtil_1.FirmaUtil.printLog(error_19);
588
+ throw error_19;
589
+ case 4: return [2 /*return*/];
590
+ }
591
+ });
592
+ });
593
+ };
594
+ FirmaGovService.prototype.vote = function (wallet, proposalId, option, txMisc) {
595
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
596
+ return __awaiter(this, void 0, void 0, function () {
597
+ var longId, txRaw, txClient, error_20;
598
+ return __generator(this, function (_a) {
599
+ switch (_a.label) {
600
+ case 0:
601
+ _a.trys.push([0, 3, , 4]);
602
+ longId = long_1.default.fromInt(proposalId);
603
+ return [4 /*yield*/, this.getSignedTxVote(wallet, longId, option, txMisc)];
604
+ case 1:
605
+ txRaw = _a.sent();
606
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
607
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
608
+ case 2: return [2 /*return*/, _a.sent()];
609
+ case 3:
610
+ error_20 = _a.sent();
611
+ FirmaUtil_1.FirmaUtil.printLog(error_20);
612
+ throw error_20;
613
+ case 4: return [2 /*return*/];
614
+ }
615
+ });
616
+ });
617
+ };
618
+ FirmaGovService.prototype.getSignedTxDeposit = function (wallet, proposalId, amount, txMisc) {
619
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
620
+ return __awaiter(this, void 0, void 0, function () {
621
+ var txClient, depositor, sendAmount, message, error_21;
622
+ return __generator(this, function (_a) {
623
+ switch (_a.label) {
624
+ case 0:
625
+ _a.trys.push([0, 3, , 4]);
626
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
627
+ return [4 /*yield*/, wallet.getAddress()];
628
+ case 1:
629
+ depositor = _a.sent();
630
+ sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
631
+ message = txClient.msgDeposit({ proposalId: proposalId, depositor: depositor, amount: [sendAmount] });
632
+ return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
633
+ case 2: return [2 /*return*/, _a.sent()];
634
+ case 3:
635
+ error_21 = _a.sent();
636
+ FirmaUtil_1.FirmaUtil.printLog(error_21);
637
+ throw error_21;
638
+ case 4: return [2 /*return*/];
639
+ }
640
+ });
641
+ });
642
+ };
643
+ FirmaGovService.prototype.deposit = function (wallet, proposalId, amount, txMisc) {
644
+ if (txMisc === void 0) { txMisc = gov_1.DefaultTxMisc; }
645
+ return __awaiter(this, void 0, void 0, function () {
646
+ var longId, txRaw, txClient, error_22;
647
+ return __generator(this, function (_a) {
648
+ switch (_a.label) {
649
+ case 0:
650
+ _a.trys.push([0, 3, , 4]);
651
+ longId = long_1.default.fromInt(proposalId);
652
+ return [4 /*yield*/, this.getSignedTxDeposit(wallet, longId, amount, txMisc)];
653
+ case 1:
654
+ txRaw = _a.sent();
655
+ txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
656
+ return [4 /*yield*/, txClient.broadcast(txRaw)];
657
+ case 2: return [2 /*return*/, _a.sent()];
658
+ case 3:
659
+ error_22 = _a.sent();
660
+ FirmaUtil_1.FirmaUtil.printLog(error_22);
661
+ throw error_22;
662
+ case 4: return [2 /*return*/];
663
+ }
664
+ });
665
+ });
666
+ };
667
+ //query
668
+ FirmaGovService.prototype.getCurrentVoteInfo = function (id) {
669
+ return __awaiter(this, void 0, void 0, function () {
670
+ var queryClient, result, error_23;
671
+ return __generator(this, function (_a) {
672
+ switch (_a.label) {
673
+ case 0:
674
+ _a.trys.push([0, 2, , 3]);
675
+ queryClient = new gov_1.GovQueryClient(this.config.restApiAddress);
676
+ return [4 /*yield*/, queryClient.queryGetCurrentVoteInfo(id)];
677
+ case 1:
678
+ result = _a.sent();
679
+ return [2 /*return*/, result];
680
+ case 2:
681
+ error_23 = _a.sent();
682
+ FirmaUtil_1.FirmaUtil.printLog(error_23);
683
+ throw error_23;
684
+ case 3: return [2 /*return*/];
685
+ }
686
+ });
687
+ });
688
+ };
689
+ FirmaGovService.prototype.getParam = function () {
690
+ return __awaiter(this, void 0, void 0, function () {
691
+ var queryClient, result, error_24;
692
+ return __generator(this, function (_a) {
693
+ switch (_a.label) {
694
+ case 0:
695
+ _a.trys.push([0, 2, , 3]);
696
+ queryClient = new gov_1.GovQueryClient(this.config.restApiAddress);
697
+ return [4 /*yield*/, queryClient.queryGetParam()];
698
+ case 1:
699
+ result = _a.sent();
700
+ return [2 /*return*/, result];
701
+ case 2:
702
+ error_24 = _a.sent();
703
+ FirmaUtil_1.FirmaUtil.printLog(error_24);
704
+ throw error_24;
705
+ case 3: return [2 /*return*/];
706
+ }
707
+ });
708
+ });
709
+ };
710
+ FirmaGovService.prototype.getProposal = function (id) {
711
+ return __awaiter(this, void 0, void 0, function () {
712
+ var queryClient, result, error_25;
713
+ return __generator(this, function (_a) {
714
+ switch (_a.label) {
715
+ case 0:
716
+ _a.trys.push([0, 2, , 3]);
717
+ queryClient = new gov_1.GovQueryClient(this.config.restApiAddress);
718
+ return [4 /*yield*/, queryClient.queryGetProposal(id)];
719
+ case 1:
720
+ result = _a.sent();
721
+ return [2 /*return*/, result];
722
+ case 2:
723
+ error_25 = _a.sent();
724
+ FirmaUtil_1.FirmaUtil.printLog(error_25);
725
+ throw error_25;
726
+ case 3: return [2 /*return*/];
727
+ }
728
+ });
729
+ });
730
+ };
731
+ FirmaGovService.prototype.getProposalListByStatus = function (status) {
732
+ return __awaiter(this, void 0, void 0, function () {
733
+ var queryClient, result, error_26;
734
+ return __generator(this, function (_a) {
735
+ switch (_a.label) {
736
+ case 0:
737
+ _a.trys.push([0, 2, , 3]);
738
+ queryClient = new gov_1.GovQueryClient(this.config.restApiAddress);
739
+ return [4 /*yield*/, queryClient.queryGetProposalListByStatus(status)];
740
+ case 1:
741
+ result = _a.sent();
742
+ return [2 /*return*/, result];
743
+ case 2:
744
+ error_26 = _a.sent();
745
+ FirmaUtil_1.FirmaUtil.printLog(error_26);
746
+ throw error_26;
747
+ case 3: return [2 /*return*/];
748
+ }
749
+ });
750
+ });
751
+ };
752
+ FirmaGovService.prototype.getProposalList = function () {
753
+ return __awaiter(this, void 0, void 0, function () {
754
+ var queryClient, result, error_27;
755
+ return __generator(this, function (_a) {
756
+ switch (_a.label) {
757
+ case 0:
758
+ _a.trys.push([0, 2, , 3]);
759
+ queryClient = new gov_1.GovQueryClient(this.config.restApiAddress);
760
+ return [4 /*yield*/, queryClient.queryGetProposalList()];
761
+ case 1:
762
+ result = _a.sent();
763
+ return [2 /*return*/, result];
764
+ case 2:
765
+ error_27 = _a.sent();
766
+ FirmaUtil_1.FirmaUtil.printLog(error_27);
767
+ throw error_27;
768
+ case 3: return [2 /*return*/];
769
+ }
770
+ });
771
+ });
772
+ };
773
+ return FirmaGovService;
774
+ }());
775
+ exports.FirmaGovService = FirmaGovService;