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