@firmachain/firma-js 0.2.2 → 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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -154
  3. package/dist/sdk/FirmaBankService.d.ts +5 -5
  4. package/dist/sdk/FirmaBankService.js +30 -30
  5. package/dist/sdk/FirmaConfig.d.ts +3 -3
  6. package/dist/sdk/FirmaContractService.d.ts +5 -5
  7. package/dist/sdk/FirmaContractService.js +19 -19
  8. package/dist/sdk/FirmaDistributionService.d.ts +13 -9
  9. package/dist/sdk/FirmaDistributionService.js +162 -78
  10. package/dist/sdk/FirmaFeeGrantService.d.ts +11 -8
  11. package/dist/sdk/FirmaFeeGrantService.js +128 -53
  12. package/dist/sdk/FirmaGovService.d.ts +28 -16
  13. package/dist/sdk/FirmaGovService.js +447 -119
  14. package/dist/sdk/FirmaIpfsService.d.ts +4 -4
  15. package/dist/sdk/FirmaIpfsService.js +14 -14
  16. package/dist/sdk/FirmaNftService.d.ts +4 -4
  17. package/dist/sdk/FirmaNftService.js +18 -20
  18. package/dist/sdk/FirmaSDK.js +2 -1
  19. package/dist/sdk/FirmaStakingService.d.ts +9 -6
  20. package/dist/sdk/FirmaStakingService.js +177 -97
  21. package/dist/sdk/FirmaUtil.d.ts +3 -2
  22. package/dist/sdk/FirmaUtil.js +16 -11
  23. package/dist/sdk/FirmaWalletService.d.ts +6 -6
  24. package/dist/sdk/FirmaWalletService.js +22 -22
  25. package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +1 -1
  26. package/dist/sdk/firmachain/bank/BankQueryClient.js +4 -4
  27. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +3 -4
  28. package/dist/sdk/firmachain/bank/BankTxClient.js +2 -2
  29. package/dist/sdk/firmachain/common/ITxClient.d.ts +5 -5
  30. package/dist/sdk/firmachain/common/ITxClient.js +7 -7
  31. package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +1 -1
  32. package/dist/sdk/firmachain/common/TendermintQueryClient.js +5 -4
  33. package/dist/sdk/firmachain/common/accounts.js +25 -20
  34. package/dist/sdk/firmachain/common/signingstargateclient.js +3 -3
  35. package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +2 -2
  36. package/dist/sdk/firmachain/contract/ContractQueryClient.js +17 -11
  37. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +3 -4
  38. package/dist/sdk/firmachain/contract/ContractTxClient.js +3 -3
  39. package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +2 -1
  40. package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +33 -16
  41. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +5 -6
  42. package/dist/sdk/firmachain/distribution/DistributionTxClient.js +3 -3
  43. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +2 -2
  44. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +4 -4
  45. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +3 -4
  46. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +2 -2
  47. package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +51 -3
  48. package/dist/sdk/firmachain/gov/GovQueryClient.js +62 -11
  49. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +4 -5
  50. package/dist/sdk/firmachain/gov/GovTxClient.js +3 -3
  51. package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +2 -2
  52. package/dist/sdk/firmachain/nft/NftQueryClient.js +11 -8
  53. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +4 -5
  54. package/dist/sdk/firmachain/nft/NftTxClient.js +3 -3
  55. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +3 -1
  56. package/dist/sdk/firmachain/staking/StakingQueryClient.js +48 -16
  57. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +6 -7
  58. package/dist/sdk/firmachain/staking/StakingTxClient.js +2 -2
  59. package/package.json +1 -1
@@ -43,13 +43,35 @@ var FeeGrantTxTypes_1 = require("./firmachain/feegrant/FeeGrantTxTypes");
43
43
  var FeeGrantQueryClient_1 = require("./firmachain/feegrant/FeeGrantQueryClient");
44
44
  var any_1 = require("./firmachain/google/protobuf/any");
45
45
  var FirmaFeeGrantService = /** @class */ (function () {
46
- function FirmaFeeGrantService(_config) {
47
- this._config = _config;
46
+ function FirmaFeeGrantService(config) {
47
+ this.config = config;
48
48
  }
49
+ FirmaFeeGrantService.prototype.getGasEstimationRevokeAllowance = function (wallet, granteeAddress, txMisc) {
50
+ if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
51
+ return __awaiter(this, void 0, void 0, function () {
52
+ var txRaw, error_1;
53
+ return __generator(this, function (_a) {
54
+ switch (_a.label) {
55
+ case 0:
56
+ _a.trys.push([0, 3, , 4]);
57
+ return [4 /*yield*/, this.getSignedTxRevokeAllowance(wallet, granteeAddress, txMisc)];
58
+ case 1:
59
+ txRaw = _a.sent();
60
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
61
+ case 2: return [2 /*return*/, _a.sent()];
62
+ case 3:
63
+ error_1 = _a.sent();
64
+ FirmaUtil_1.FirmaUtil.printLog(error_1);
65
+ throw error_1;
66
+ case 4: return [2 /*return*/];
67
+ }
68
+ });
69
+ });
70
+ };
49
71
  FirmaFeeGrantService.prototype.getSignedTxRevokeAllowance = function (wallet, granteeAddress, txMisc) {
50
72
  if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
51
73
  return __awaiter(this, void 0, void 0, function () {
52
- var address, feeGrantTxClient, message, error_1;
74
+ var address, feeGrantTxClient, message, error_2;
53
75
  return __generator(this, function (_a) {
54
76
  switch (_a.label) {
55
77
  case 0:
@@ -57,23 +79,23 @@ var FirmaFeeGrantService = /** @class */ (function () {
57
79
  return [4 /*yield*/, wallet.getAddress()];
58
80
  case 1:
59
81
  address = _a.sent();
60
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this._config.rpcAddress);
82
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
61
83
  message = feeGrantTxClient.msgRevokeAllowance({ granter: address, grantee: granteeAddress });
62
- return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
84
+ return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
63
85
  case 2: return [2 /*return*/, _a.sent()];
64
86
  case 3:
65
- error_1 = _a.sent();
66
- FirmaUtil_1.FirmaUtil.printLog(error_1);
67
- throw error_1;
87
+ error_2 = _a.sent();
88
+ FirmaUtil_1.FirmaUtil.printLog(error_2);
89
+ throw error_2;
68
90
  case 4: return [2 /*return*/];
69
91
  }
70
92
  });
71
93
  });
72
94
  };
73
- FirmaFeeGrantService.prototype.RevokeAllowance = function (wallet, granteeAddress, txMisc) {
95
+ FirmaFeeGrantService.prototype.revokeAllowance = function (wallet, granteeAddress, txMisc) {
74
96
  if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
75
97
  return __awaiter(this, void 0, void 0, function () {
76
- var txRaw, feeGrantTxClient, error_2;
98
+ var txRaw, feeGrantTxClient, error_3;
77
99
  return __generator(this, function (_a) {
78
100
  switch (_a.label) {
79
101
  case 0:
@@ -81,13 +103,13 @@ var FirmaFeeGrantService = /** @class */ (function () {
81
103
  return [4 /*yield*/, this.getSignedTxRevokeAllowance(wallet, granteeAddress, txMisc)];
82
104
  case 1:
83
105
  txRaw = _a.sent();
84
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this._config.rpcAddress);
106
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
85
107
  return [4 /*yield*/, feeGrantTxClient.broadcast(txRaw)];
86
108
  case 2: return [2 /*return*/, _a.sent()];
87
109
  case 3:
88
- error_2 = _a.sent();
89
- FirmaUtil_1.FirmaUtil.printLog(error_2);
90
- throw error_2;
110
+ error_3 = _a.sent();
111
+ FirmaUtil_1.FirmaUtil.printLog(error_3);
112
+ throw error_3;
91
113
  case 4: return [2 /*return*/];
92
114
  }
93
115
  });
@@ -96,12 +118,34 @@ var FirmaFeeGrantService = /** @class */ (function () {
96
118
  FirmaFeeGrantService.prototype.getCoinType = function (amount) {
97
119
  if (amount == undefined)
98
120
  return [];
99
- return [{ denom: this._config.denom, amount: amount.toString() }];
121
+ return [{ denom: this.config.denom, amount: amount.toString() }];
122
+ };
123
+ FirmaFeeGrantService.prototype.getGasEstimationGrantPeriodicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
124
+ if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
125
+ return __awaiter(this, void 0, void 0, function () {
126
+ var txRaw, error_4;
127
+ return __generator(this, function (_a) {
128
+ switch (_a.label) {
129
+ case 0:
130
+ _a.trys.push([0, 3, , 4]);
131
+ return [4 /*yield*/, this.getSignedTxGrantPeriodicAllowance(wallet, granteeAddress, feegrantOption, txMisc)];
132
+ case 1:
133
+ txRaw = _a.sent();
134
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
135
+ case 2: return [2 /*return*/, _a.sent()];
136
+ case 3:
137
+ error_4 = _a.sent();
138
+ FirmaUtil_1.FirmaUtil.printLog(error_4);
139
+ throw error_4;
140
+ case 4: return [2 /*return*/];
141
+ }
142
+ });
143
+ });
100
144
  };
101
145
  FirmaFeeGrantService.prototype.getSignedTxGrantPeriodicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
102
146
  if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
103
147
  return __awaiter(this, void 0, void 0, function () {
104
- var address, feeGrantTxClient, periodicAllowanceData, bytes, allowanceAnyData, message, error_3;
148
+ var address, feeGrantTxClient, periodicAllowanceData, bytes, allowanceAnyData, message, error_5;
105
149
  return __generator(this, function (_a) {
106
150
  switch (_a.label) {
107
151
  case 0:
@@ -109,15 +153,15 @@ var FirmaFeeGrantService = /** @class */ (function () {
109
153
  return [4 /*yield*/, wallet.getAddress()];
110
154
  case 1:
111
155
  address = _a.sent();
112
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this._config.rpcAddress);
156
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
113
157
  periodicAllowanceData = {
114
158
  basic: {
115
159
  spendLimit: this.getCoinType(feegrantOption.basicSpendLimit),
116
160
  expiration: feegrantOption.basicExpiration
117
161
  },
118
162
  period: { seconds: feegrantOption.periodSeconds, nanos: 0 },
119
- periodSpendLimit: [{ denom: this._config.denom, amount: feegrantOption.periodSpendLimit.toString() }],
120
- periodCanSpend: [{ denom: this._config.denom, amount: feegrantOption.periodCanSpend.toString() }],
163
+ periodSpendLimit: [{ denom: this.config.denom, amount: feegrantOption.periodSpendLimit.toString() }],
164
+ periodCanSpend: [{ denom: this.config.denom, amount: feegrantOption.periodCanSpend.toString() }],
121
165
  periodReset: feegrantOption.periodReset
122
166
  };
123
167
  bytes = FeeGrantTxTypes_1.PeriodicAllowance.encode(periodicAllowanceData).finish();
@@ -125,13 +169,40 @@ var FirmaFeeGrantService = /** @class */ (function () {
125
169
  typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance",
126
170
  value: bytes
127
171
  };
128
- message = feeGrantTxClient.msgGrantAllowance({ granter: address, grantee: granteeAddress, allowance: any_1.Any.fromJSON(allowanceAnyData) });
129
- return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
172
+ message = feeGrantTxClient.msgGrantAllowance({
173
+ granter: address,
174
+ grantee: granteeAddress,
175
+ allowance: any_1.Any.fromJSON(allowanceAnyData)
176
+ });
177
+ return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
130
178
  case 2: return [2 /*return*/, _a.sent()];
131
179
  case 3:
132
- error_3 = _a.sent();
133
- FirmaUtil_1.FirmaUtil.printLog(error_3);
134
- throw error_3;
180
+ error_5 = _a.sent();
181
+ FirmaUtil_1.FirmaUtil.printLog(error_5);
182
+ throw error_5;
183
+ case 4: return [2 /*return*/];
184
+ }
185
+ });
186
+ });
187
+ };
188
+ FirmaFeeGrantService.prototype.getGasEstimationGrantBasicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
189
+ if (feegrantOption === void 0) { feegrantOption = feegrant_1.DefaultBasicFeeGrantOption; }
190
+ if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
191
+ return __awaiter(this, void 0, void 0, function () {
192
+ var txRaw, error_6;
193
+ return __generator(this, function (_a) {
194
+ switch (_a.label) {
195
+ case 0:
196
+ _a.trys.push([0, 3, , 4]);
197
+ return [4 /*yield*/, this.getSignedTxGrantBasicAllowance(wallet, granteeAddress, feegrantOption, txMisc)];
198
+ case 1:
199
+ txRaw = _a.sent();
200
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
201
+ case 2: return [2 /*return*/, _a.sent()];
202
+ case 3:
203
+ error_6 = _a.sent();
204
+ FirmaUtil_1.FirmaUtil.printLog(error_6);
205
+ throw error_6;
135
206
  case 4: return [2 /*return*/];
136
207
  }
137
208
  });
@@ -141,12 +212,12 @@ var FirmaFeeGrantService = /** @class */ (function () {
141
212
  if (feegrantOption === void 0) { feegrantOption = feegrant_1.DefaultBasicFeeGrantOption; }
142
213
  if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
143
214
  return __awaiter(this, void 0, void 0, function () {
144
- var feeGrantTxClient, address, basicAllowanceData, bytes, allowanceAnyData, message, error_4;
215
+ var feeGrantTxClient, address, basicAllowanceData, bytes, allowanceAnyData, message, error_7;
145
216
  return __generator(this, function (_a) {
146
217
  switch (_a.label) {
147
218
  case 0:
148
219
  _a.trys.push([0, 3, , 4]);
149
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this._config.rpcAddress);
220
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
150
221
  return [4 /*yield*/, wallet.getAddress()];
151
222
  case 1:
152
223
  address = _a.sent();
@@ -159,22 +230,26 @@ var FirmaFeeGrantService = /** @class */ (function () {
159
230
  typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance",
160
231
  value: bytes
161
232
  };
162
- message = feeGrantTxClient.msgGrantAllowance({ granter: address, grantee: granteeAddress, allowance: any_1.Any.fromJSON(allowanceAnyData) });
163
- return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
233
+ message = feeGrantTxClient.msgGrantAllowance({
234
+ granter: address,
235
+ grantee: granteeAddress,
236
+ allowance: any_1.Any.fromJSON(allowanceAnyData)
237
+ });
238
+ return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
164
239
  case 2: return [2 /*return*/, _a.sent()];
165
240
  case 3:
166
- error_4 = _a.sent();
167
- FirmaUtil_1.FirmaUtil.printLog(error_4);
168
- throw error_4;
241
+ error_7 = _a.sent();
242
+ FirmaUtil_1.FirmaUtil.printLog(error_7);
243
+ throw error_7;
169
244
  case 4: return [2 /*return*/];
170
245
  }
171
246
  });
172
247
  });
173
248
  };
174
- FirmaFeeGrantService.prototype.GrantPeriodicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
249
+ FirmaFeeGrantService.prototype.grantPeriodicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
175
250
  if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
176
251
  return __awaiter(this, void 0, void 0, function () {
177
- var txRaw, feeGrantTxClient, error_5;
252
+ var txRaw, feeGrantTxClient, error_8;
178
253
  return __generator(this, function (_a) {
179
254
  switch (_a.label) {
180
255
  case 0:
@@ -182,23 +257,23 @@ var FirmaFeeGrantService = /** @class */ (function () {
182
257
  return [4 /*yield*/, this.getSignedTxGrantPeriodicAllowance(wallet, granteeAddress, feegrantOption, txMisc)];
183
258
  case 1:
184
259
  txRaw = _a.sent();
185
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this._config.rpcAddress);
260
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
186
261
  return [4 /*yield*/, feeGrantTxClient.broadcast(txRaw)];
187
262
  case 2: return [2 /*return*/, _a.sent()];
188
263
  case 3:
189
- error_5 = _a.sent();
190
- FirmaUtil_1.FirmaUtil.printLog(error_5);
191
- throw error_5;
264
+ error_8 = _a.sent();
265
+ FirmaUtil_1.FirmaUtil.printLog(error_8);
266
+ throw error_8;
192
267
  case 4: return [2 /*return*/];
193
268
  }
194
269
  });
195
270
  });
196
271
  };
197
- FirmaFeeGrantService.prototype.GrantBasicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
272
+ FirmaFeeGrantService.prototype.grantBasicAllowance = function (wallet, granteeAddress, feegrantOption, txMisc) {
198
273
  if (feegrantOption === void 0) { feegrantOption = feegrant_1.DefaultBasicFeeGrantOption; }
199
274
  if (txMisc === void 0) { txMisc = feegrant_1.DefaultTxMisc; }
200
275
  return __awaiter(this, void 0, void 0, function () {
201
- var txRaw, feeGrantTxClient, error_6;
276
+ var txRaw, feeGrantTxClient, error_9;
202
277
  return __generator(this, function (_a) {
203
278
  switch (_a.label) {
204
279
  case 0:
@@ -206,13 +281,13 @@ var FirmaFeeGrantService = /** @class */ (function () {
206
281
  return [4 /*yield*/, this.getSignedTxGrantBasicAllowance(wallet, granteeAddress, feegrantOption, txMisc)];
207
282
  case 1:
208
283
  txRaw = _a.sent();
209
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this._config.rpcAddress);
284
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
210
285
  return [4 /*yield*/, feeGrantTxClient.broadcast(txRaw)];
211
286
  case 2: return [2 /*return*/, _a.sent()];
212
287
  case 3:
213
- error_6 = _a.sent();
214
- FirmaUtil_1.FirmaUtil.printLog(error_6);
215
- throw error_6;
288
+ error_9 = _a.sent();
289
+ FirmaUtil_1.FirmaUtil.printLog(error_9);
290
+ throw error_9;
216
291
  case 4: return [2 /*return*/];
217
292
  }
218
293
  });
@@ -221,20 +296,20 @@ var FirmaFeeGrantService = /** @class */ (function () {
221
296
  // query
222
297
  FirmaFeeGrantService.prototype.getGranteeAllowance = function (granterAddress, granteeAddress) {
223
298
  return __awaiter(this, void 0, void 0, function () {
224
- var queryClient, result, error_7;
299
+ var queryClient, result, error_10;
225
300
  return __generator(this, function (_a) {
226
301
  switch (_a.label) {
227
302
  case 0:
228
303
  _a.trys.push([0, 2, , 3]);
229
- queryClient = new FeeGrantQueryClient_1.FeeGrantQueryClient(this._config.restApiAddress);
304
+ queryClient = new FeeGrantQueryClient_1.FeeGrantQueryClient(this.config.restApiAddress);
230
305
  return [4 /*yield*/, queryClient.getGranteeAllowance(granterAddress, granteeAddress)];
231
306
  case 1:
232
307
  result = _a.sent();
233
308
  return [2 /*return*/, result];
234
309
  case 2:
235
- error_7 = _a.sent();
236
- FirmaUtil_1.FirmaUtil.printLog(error_7);
237
- throw error_7;
310
+ error_10 = _a.sent();
311
+ FirmaUtil_1.FirmaUtil.printLog(error_10);
312
+ throw error_10;
238
313
  case 3: return [2 /*return*/];
239
314
  }
240
315
  });
@@ -242,20 +317,20 @@ var FirmaFeeGrantService = /** @class */ (function () {
242
317
  };
243
318
  FirmaFeeGrantService.prototype.getGranteeAllowanceAll = function (granteeAddress) {
244
319
  return __awaiter(this, void 0, void 0, function () {
245
- var queryClient, result, error_8;
320
+ var queryClient, result, error_11;
246
321
  return __generator(this, function (_a) {
247
322
  switch (_a.label) {
248
323
  case 0:
249
324
  _a.trys.push([0, 2, , 3]);
250
- queryClient = new FeeGrantQueryClient_1.FeeGrantQueryClient(this._config.restApiAddress);
325
+ queryClient = new FeeGrantQueryClient_1.FeeGrantQueryClient(this.config.restApiAddress);
251
326
  return [4 /*yield*/, queryClient.getGranteeAllowanceAll(granteeAddress)];
252
327
  case 1:
253
328
  result = _a.sent();
254
329
  return [2 /*return*/, result];
255
330
  case 2:
256
- error_8 = _a.sent();
257
- FirmaUtil_1.FirmaUtil.printLog(error_8);
258
- throw error_8;
331
+ error_11 = _a.sent();
332
+ FirmaUtil_1.FirmaUtil.printLog(error_11);
333
+ throw error_11;
259
334
  case 3: return [2 /*return*/];
260
335
  }
261
336
  });
@@ -1,23 +1,35 @@
1
- import { TxMisc, ParamChangeOption, VotingOption } from './firmachain/gov';
1
+ import { TxMisc, ParamChangeOption, VotingOption, ProposalInfo, ProposalStatus, ProposalParam } from "./firmachain/gov";
2
2
  import { FirmaWalletService } from "./FirmaWalletService";
3
3
  import { FirmaConfig } from "./FirmaConfig";
4
- import { BroadcastTxResponse } from './firmachain/common/stargateclient';
5
- import Long from 'long';
4
+ import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
5
+ import Long from "long";
6
6
  export declare class FirmaGovService {
7
- private _config;
8
- constructor(_config: FirmaConfig);
9
- getGasEstimationDeposit(wallet: FirmaWalletService, proposalId: Long, amount: number, txMisc?: TxMisc): Promise<number>;
7
+ private readonly config;
8
+ constructor(config: FirmaConfig);
9
+ getGasEstimationVote(wallet: FirmaWalletService, proposalId: number, option: VotingOption, txMisc?: TxMisc): Promise<number>;
10
+ getGasEstimationDeposit(wallet: FirmaWalletService, proposalId: number, amount: number, txMisc?: TxMisc): Promise<number>;
11
+ getGasEstimationSubmitCancelSoftwareUpgradeProposal(wallet: FirmaWalletService, title: string, description: string, initialDepositFCT: number, txMisc?: TxMisc): Promise<number>;
12
+ getGasEstimationSubmitSoftwareUpgradeProposalByHeight(wallet: FirmaWalletService, title: string, description: string, initialDepositFCT: number, upgradeName: string, height: Long, txMisc?: TxMisc): Promise<number>;
13
+ getGasEstimationSubmitParameterChangeProposal(wallet: FirmaWalletService, title: string, description: string, initialDepositFCT: number, paramList: ParamChangeOption[], txMisc?: TxMisc): Promise<number>;
14
+ getGasEstimationSubmitCommunityPoolSpendProposal(wallet: FirmaWalletService, title: string, description: string, initialDepositFCT: number, amount: number, recipient: string, txMisc?: TxMisc): Promise<number>;
15
+ getGasEstimationSubmitTextProposal(wallet: FirmaWalletService, title: string, description: string, initialDepositFCT: number, txMisc?: TxMisc): Promise<number>;
10
16
  private getSignedTxSubmitTextProposal;
11
- private getSignedTxSoftwareUpgradeProposal;
12
- private getSignedTxParameterChangeProposal;
13
- private getSignedTxCommunityPoolSpendProposal;
14
- SubmitSoftwareUpgradeProposalByHeight(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, upgradeName: string, height: Long, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
15
- SubmitSoftwareUpgradeProposalByTime(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, upgradeName: string, upgradeTime: Date, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
16
- SubmitParameterChangeProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, paramList: ParamChangeOption[], txMisc?: TxMisc): Promise<BroadcastTxResponse>;
17
- SubmitCommunityPoolSpendProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, amount: number, recipient: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
18
- SubmitTextProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
17
+ private getSignedTxSubmitCancelSoftwareUpgradeProposal;
18
+ private getSignedTxSubmitSoftwareUpgradeProposal;
19
+ private getSignedTxSubmitParameterChangeProposal;
20
+ private getSignedTxSubmitCommunityPoolSpendProposal;
21
+ submitCancelSoftwareUpgradeProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
22
+ submitSoftwareUpgradeProposalByHeight(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, upgradeName: string, height: Long, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
23
+ submitSoftwareUpgradeProposalByTime(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, upgradeName: string, upgradeTime: Date, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
24
+ submitParameterChangeProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, paramList: ParamChangeOption[], txMisc?: TxMisc): Promise<BroadcastTxResponse>;
25
+ submitCommunityPoolSpendProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, amount: number, recipient: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
26
+ submitTextProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
19
27
  private getSignedTxVote;
20
- Vote(wallet: FirmaWalletService, proposalId: Long, option: VotingOption, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
28
+ vote(wallet: FirmaWalletService, proposalId: number, option: VotingOption, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
21
29
  private getSignedTxDeposit;
22
- Deposit(wallet: FirmaWalletService, proposalId: Long, amount: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
30
+ deposit(wallet: FirmaWalletService, proposalId: number, amount: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
31
+ getParam(): Promise<ProposalParam>;
32
+ getProposal(id: string): Promise<ProposalInfo>;
33
+ getProposalListByStatus(status: ProposalStatus): Promise<ProposalInfo[]>;
34
+ getProposalList(): Promise<ProposalInfo[]>;
23
35
  }