@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.
Files changed (57) hide show
  1. package/dist/sdk/FirmaBankService.d.ts +5 -5
  2. package/dist/sdk/FirmaBankService.js +30 -30
  3. package/dist/sdk/FirmaConfig.d.ts +3 -3
  4. package/dist/sdk/FirmaContractService.d.ts +5 -5
  5. package/dist/sdk/FirmaContractService.js +19 -19
  6. package/dist/sdk/FirmaDistributionService.d.ts +10 -6
  7. package/dist/sdk/FirmaDistributionService.js +159 -75
  8. package/dist/sdk/FirmaFeeGrantService.d.ts +8 -5
  9. package/dist/sdk/FirmaFeeGrantService.js +125 -50
  10. package/dist/sdk/FirmaGovService.d.ts +16 -10
  11. package/dist/sdk/FirmaGovService.js +296 -127
  12. package/dist/sdk/FirmaIpfsService.d.ts +4 -4
  13. package/dist/sdk/FirmaIpfsService.js +14 -14
  14. package/dist/sdk/FirmaNftService.d.ts +4 -4
  15. package/dist/sdk/FirmaNftService.js +18 -20
  16. package/dist/sdk/FirmaSDK.js +2 -1
  17. package/dist/sdk/FirmaStakingService.d.ts +7 -6
  18. package/dist/sdk/FirmaStakingService.js +141 -103
  19. package/dist/sdk/FirmaUtil.d.ts +3 -2
  20. package/dist/sdk/FirmaUtil.js +16 -11
  21. package/dist/sdk/FirmaWalletService.d.ts +6 -6
  22. package/dist/sdk/FirmaWalletService.js +22 -22
  23. package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +1 -1
  24. package/dist/sdk/firmachain/bank/BankQueryClient.js +4 -4
  25. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +3 -4
  26. package/dist/sdk/firmachain/bank/BankTxClient.js +2 -2
  27. package/dist/sdk/firmachain/common/ITxClient.d.ts +5 -5
  28. package/dist/sdk/firmachain/common/ITxClient.js +7 -7
  29. package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +1 -1
  30. package/dist/sdk/firmachain/common/TendermintQueryClient.js +5 -4
  31. package/dist/sdk/firmachain/common/accounts.js +25 -20
  32. package/dist/sdk/firmachain/common/signingstargateclient.js +3 -3
  33. package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +2 -2
  34. package/dist/sdk/firmachain/contract/ContractQueryClient.js +17 -11
  35. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +3 -4
  36. package/dist/sdk/firmachain/contract/ContractTxClient.js +3 -3
  37. package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +2 -1
  38. package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +30 -15
  39. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +5 -6
  40. package/dist/sdk/firmachain/distribution/DistributionTxClient.js +3 -3
  41. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +2 -2
  42. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +4 -4
  43. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +3 -4
  44. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +2 -2
  45. package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +1 -1
  46. package/dist/sdk/firmachain/gov/GovQueryClient.js +8 -8
  47. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +4 -5
  48. package/dist/sdk/firmachain/gov/GovTxClient.js +3 -3
  49. package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +2 -2
  50. package/dist/sdk/firmachain/nft/NftQueryClient.js +11 -8
  51. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +4 -5
  52. package/dist/sdk/firmachain/nft/NftTxClient.js +3 -3
  53. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +1 -1
  54. package/dist/sdk/firmachain/staking/StakingQueryClient.js +20 -20
  55. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +6 -7
  56. package/dist/sdk/firmachain/staking/StakingTxClient.js +2 -2
  57. package/package.json +1 -1
@@ -40,10 +40,10 @@ exports.FirmaDistributionService = void 0;
40
40
  var distribution_1 = require("./firmachain/distribution");
41
41
  var FirmaUtil_1 = require("./FirmaUtil");
42
42
  var FirmaDistributionService = /** @class */ (function () {
43
- function FirmaDistributionService(_config) {
44
- this._config = _config;
43
+ function FirmaDistributionService(config) {
44
+ this.config = config;
45
45
  }
46
- FirmaDistributionService.prototype.getGasEstimationDelegate = function (wallet, validatorAddres, txMisc) {
46
+ FirmaDistributionService.prototype.getGasEstimationSetWithdrawAddress = function (wallet, withdrawAddress, txMisc) {
47
47
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
48
48
  return __awaiter(this, void 0, void 0, function () {
49
49
  var txRaw, error_1;
@@ -51,7 +51,7 @@ var FirmaDistributionService = /** @class */ (function () {
51
51
  switch (_a.label) {
52
52
  case 0:
53
53
  _a.trys.push([0, 3, , 4]);
54
- return [4 /*yield*/, this.getSignedTxWithdrawAllRewards(wallet, validatorAddres, txMisc)];
54
+ return [4 /*yield*/, this.getSignedTxSetWithdrawAddress(wallet, withdrawAddress, txMisc)];
55
55
  case 1:
56
56
  txRaw = _a.sent();
57
57
  return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
@@ -65,20 +65,18 @@ var FirmaDistributionService = /** @class */ (function () {
65
65
  });
66
66
  });
67
67
  };
68
- FirmaDistributionService.prototype.getSignedTxWithdrawAllRewards = function (wallet, validatorAddress, txMisc) {
68
+ FirmaDistributionService.prototype.getGasEstimationFundCommunityPool = function (wallet, amount, txMisc) {
69
69
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
70
70
  return __awaiter(this, void 0, void 0, function () {
71
- var txClient, address, message, error_2;
71
+ var txRaw, error_2;
72
72
  return __generator(this, function (_a) {
73
73
  switch (_a.label) {
74
74
  case 0:
75
75
  _a.trys.push([0, 3, , 4]);
76
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
77
- return [4 /*yield*/, wallet.getAddress()];
76
+ return [4 /*yield*/, this.getSignedTxFundCommunityPool(wallet, amount, txMisc)];
78
77
  case 1:
79
- address = _a.sent();
80
- message = txClient.msgWithdrawDelegatorReward({ delegatorAddress: address, validatorAddress: validatorAddress });
81
- return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
78
+ txRaw = _a.sent();
79
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
82
80
  case 2: return [2 /*return*/, _a.sent()];
83
81
  case 3:
84
82
  error_2 = _a.sent();
@@ -89,20 +87,18 @@ var FirmaDistributionService = /** @class */ (function () {
89
87
  });
90
88
  });
91
89
  };
92
- FirmaDistributionService.prototype.getSignedTxSetWithdrawAddress = function (wallet, withdrawAddress, txMisc) {
90
+ FirmaDistributionService.prototype.getGasEstimationWithdrawValidatorCommission = function (wallet, validatorAddress, txMisc) {
93
91
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
94
92
  return __awaiter(this, void 0, void 0, function () {
95
- var txClient, address, message, error_3;
93
+ var txRaw, error_3;
96
94
  return __generator(this, function (_a) {
97
95
  switch (_a.label) {
98
96
  case 0:
99
97
  _a.trys.push([0, 3, , 4]);
100
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
101
- return [4 /*yield*/, wallet.getAddress()];
98
+ return [4 /*yield*/, this.getSignedTxWithdrawValidatorCommission(wallet, validatorAddress, txMisc)];
102
99
  case 1:
103
- address = _a.sent();
104
- message = txClient.msgSetWithdrawAddress({ delegatorAddress: address, withdrawAddress: withdrawAddress });
105
- return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
100
+ txRaw = _a.sent();
101
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
106
102
  case 2: return [2 /*return*/, _a.sent()];
107
103
  case 3:
108
104
  error_3 = _a.sent();
@@ -113,21 +109,18 @@ var FirmaDistributionService = /** @class */ (function () {
113
109
  });
114
110
  });
115
111
  };
116
- FirmaDistributionService.prototype.getSignedTxFundCommunityPool = function (wallet, amount, txMisc) {
112
+ FirmaDistributionService.prototype.getGasEstimationWithdrawAllRewards = function (wallet, validatorAddress, txMisc) {
117
113
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
118
114
  return __awaiter(this, void 0, void 0, function () {
119
- var txClient, address, sendAmount, message, error_4;
115
+ var txRaw, error_4;
120
116
  return __generator(this, function (_a) {
121
117
  switch (_a.label) {
122
118
  case 0:
123
119
  _a.trys.push([0, 3, , 4]);
124
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
125
- return [4 /*yield*/, wallet.getAddress()];
120
+ return [4 /*yield*/, this.getSignedTxWithdrawAllRewards(wallet, validatorAddress, txMisc)];
126
121
  case 1:
127
- address = _a.sent();
128
- sendAmount = { denom: this._config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
129
- message = txClient.msgFundCommunityPool({ depositor: address, amount: [sendAmount] });
130
- return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
122
+ txRaw = _a.sent();
123
+ return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
131
124
  case 2: return [2 /*return*/, _a.sent()];
132
125
  case 3:
133
126
  error_4 = _a.sent();
@@ -138,7 +131,7 @@ var FirmaDistributionService = /** @class */ (function () {
138
131
  });
139
132
  });
140
133
  };
141
- FirmaDistributionService.prototype.getSignedTxWithdrawValidatorCommission = function (wallet, validatorAddres, txMisc) {
134
+ FirmaDistributionService.prototype.getSignedTxWithdrawAllRewards = function (wallet, validatorAddress, txMisc) {
142
135
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
143
136
  return __awaiter(this, void 0, void 0, function () {
144
137
  var txClient, address, message, error_5;
@@ -146,12 +139,12 @@ var FirmaDistributionService = /** @class */ (function () {
146
139
  switch (_a.label) {
147
140
  case 0:
148
141
  _a.trys.push([0, 3, , 4]);
149
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
142
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
150
143
  return [4 /*yield*/, wallet.getAddress()];
151
144
  case 1:
152
145
  address = _a.sent();
153
- message = txClient.msgWithdrawValidatorCommission({ validatorAddress: validatorAddres });
154
- return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this._config.denom, txMisc))];
146
+ message = txClient.msgWithdrawDelegatorReward({ delegatorAddress: address, validatorAddress: validatorAddress });
147
+ return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
155
148
  case 2: return [2 /*return*/, _a.sent()];
156
149
  case 3:
157
150
  error_5 = _a.sent();
@@ -162,10 +155,80 @@ var FirmaDistributionService = /** @class */ (function () {
162
155
  });
163
156
  });
164
157
  };
158
+ FirmaDistributionService.prototype.getSignedTxSetWithdrawAddress = function (wallet, withdrawAddress, txMisc) {
159
+ if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
160
+ return __awaiter(this, void 0, void 0, function () {
161
+ var txClient, address, message, error_6;
162
+ return __generator(this, function (_a) {
163
+ switch (_a.label) {
164
+ case 0:
165
+ _a.trys.push([0, 3, , 4]);
166
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
167
+ return [4 /*yield*/, wallet.getAddress()];
168
+ case 1:
169
+ address = _a.sent();
170
+ message = txClient.msgSetWithdrawAddress({ delegatorAddress: address, withdrawAddress: withdrawAddress });
171
+ return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
172
+ case 2: return [2 /*return*/, _a.sent()];
173
+ case 3:
174
+ error_6 = _a.sent();
175
+ FirmaUtil_1.FirmaUtil.printLog(error_6);
176
+ throw error_6;
177
+ case 4: return [2 /*return*/];
178
+ }
179
+ });
180
+ });
181
+ };
182
+ FirmaDistributionService.prototype.getSignedTxFundCommunityPool = function (wallet, amount, txMisc) {
183
+ if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
184
+ return __awaiter(this, void 0, void 0, function () {
185
+ var txClient, address, sendAmount, message, error_7;
186
+ return __generator(this, function (_a) {
187
+ switch (_a.label) {
188
+ case 0:
189
+ _a.trys.push([0, 3, , 4]);
190
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
191
+ return [4 /*yield*/, wallet.getAddress()];
192
+ case 1:
193
+ address = _a.sent();
194
+ sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
195
+ message = txClient.msgFundCommunityPool({ depositor: address, amount: [sendAmount] });
196
+ return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
197
+ case 2: return [2 /*return*/, _a.sent()];
198
+ case 3:
199
+ error_7 = _a.sent();
200
+ FirmaUtil_1.FirmaUtil.printLog(error_7);
201
+ throw error_7;
202
+ case 4: return [2 /*return*/];
203
+ }
204
+ });
205
+ });
206
+ };
207
+ FirmaDistributionService.prototype.getSignedTxWithdrawValidatorCommission = function (wallet, validatorAddres, txMisc) {
208
+ if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
209
+ return __awaiter(this, void 0, void 0, function () {
210
+ var txClient, message, error_8;
211
+ return __generator(this, function (_a) {
212
+ switch (_a.label) {
213
+ case 0:
214
+ _a.trys.push([0, 2, , 3]);
215
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
216
+ message = txClient.msgWithdrawValidatorCommission({ validatorAddress: validatorAddres });
217
+ return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
218
+ case 1: return [2 /*return*/, _a.sent()];
219
+ case 2:
220
+ error_8 = _a.sent();
221
+ FirmaUtil_1.FirmaUtil.printLog(error_8);
222
+ throw error_8;
223
+ case 3: return [2 /*return*/];
224
+ }
225
+ });
226
+ });
227
+ };
165
228
  FirmaDistributionService.prototype.setWithdrawAddress = function (wallet, withdrawAddress, txMisc) {
166
229
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
167
230
  return __awaiter(this, void 0, void 0, function () {
168
- var txRaw, txClient, error_6;
231
+ var txRaw, txClient, error_9;
169
232
  return __generator(this, function (_a) {
170
233
  switch (_a.label) {
171
234
  case 0:
@@ -173,13 +236,13 @@ var FirmaDistributionService = /** @class */ (function () {
173
236
  return [4 /*yield*/, this.getSignedTxSetWithdrawAddress(wallet, withdrawAddress, txMisc)];
174
237
  case 1:
175
238
  txRaw = _a.sent();
176
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
239
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
177
240
  return [4 /*yield*/, txClient.broadcast(txRaw)];
178
241
  case 2: return [2 /*return*/, _a.sent()];
179
242
  case 3:
180
- error_6 = _a.sent();
181
- FirmaUtil_1.FirmaUtil.printLog(error_6);
182
- throw error_6;
243
+ error_9 = _a.sent();
244
+ FirmaUtil_1.FirmaUtil.printLog(error_9);
245
+ throw error_9;
183
246
  case 4: return [2 /*return*/];
184
247
  }
185
248
  });
@@ -188,7 +251,7 @@ var FirmaDistributionService = /** @class */ (function () {
188
251
  FirmaDistributionService.prototype.fundCommunityPool = function (wallet, amount, txMisc) {
189
252
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
190
253
  return __awaiter(this, void 0, void 0, function () {
191
- var txRaw, txClient, error_7;
254
+ var txRaw, txClient, error_10;
192
255
  return __generator(this, function (_a) {
193
256
  switch (_a.label) {
194
257
  case 0:
@@ -196,13 +259,13 @@ var FirmaDistributionService = /** @class */ (function () {
196
259
  return [4 /*yield*/, this.getSignedTxFundCommunityPool(wallet, amount, txMisc)];
197
260
  case 1:
198
261
  txRaw = _a.sent();
199
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
262
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
200
263
  return [4 /*yield*/, txClient.broadcast(txRaw)];
201
264
  case 2: return [2 /*return*/, _a.sent()];
202
265
  case 3:
203
- error_7 = _a.sent();
204
- FirmaUtil_1.FirmaUtil.printLog(error_7);
205
- throw error_7;
266
+ error_10 = _a.sent();
267
+ FirmaUtil_1.FirmaUtil.printLog(error_10);
268
+ throw error_10;
206
269
  case 4: return [2 /*return*/];
207
270
  }
208
271
  });
@@ -211,7 +274,7 @@ var FirmaDistributionService = /** @class */ (function () {
211
274
  FirmaDistributionService.prototype.withdrawValidatorCommission = function (wallet, validatorAddres, txMisc) {
212
275
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
213
276
  return __awaiter(this, void 0, void 0, function () {
214
- var txRaw, txClient, error_8;
277
+ var txRaw, txClient, error_11;
215
278
  return __generator(this, function (_a) {
216
279
  switch (_a.label) {
217
280
  case 0:
@@ -219,13 +282,13 @@ var FirmaDistributionService = /** @class */ (function () {
219
282
  return [4 /*yield*/, this.getSignedTxWithdrawValidatorCommission(wallet, validatorAddres, txMisc)];
220
283
  case 1:
221
284
  txRaw = _a.sent();
222
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
285
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
223
286
  return [4 /*yield*/, txClient.broadcast(txRaw)];
224
287
  case 2: return [2 /*return*/, _a.sent()];
225
288
  case 3:
226
- error_8 = _a.sent();
227
- FirmaUtil_1.FirmaUtil.printLog(error_8);
228
- throw error_8;
289
+ error_11 = _a.sent();
290
+ FirmaUtil_1.FirmaUtil.printLog(error_11);
291
+ throw error_11;
229
292
  case 4: return [2 /*return*/];
230
293
  }
231
294
  });
@@ -234,7 +297,7 @@ var FirmaDistributionService = /** @class */ (function () {
234
297
  FirmaDistributionService.prototype.withdrawAllRewards = function (wallet, validatorAddress, txMisc) {
235
298
  if (txMisc === void 0) { txMisc = distribution_1.DefaultTxMisc; }
236
299
  return __awaiter(this, void 0, void 0, function () {
237
- var txRaw, txClient, error_9;
300
+ var txRaw, txClient, error_12;
238
301
  return __generator(this, function (_a) {
239
302
  switch (_a.label) {
240
303
  case 0:
@@ -242,13 +305,13 @@ var FirmaDistributionService = /** @class */ (function () {
242
305
  return [4 /*yield*/, this.getSignedTxWithdrawAllRewards(wallet, validatorAddress, txMisc)];
243
306
  case 1:
244
307
  txRaw = _a.sent();
245
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this._config.rpcAddress);
308
+ txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
246
309
  return [4 /*yield*/, txClient.broadcast(txRaw)];
247
310
  case 2: return [2 /*return*/, _a.sent()];
248
311
  case 3:
249
- error_9 = _a.sent();
250
- FirmaUtil_1.FirmaUtil.printLog(error_9);
251
- throw error_9;
312
+ error_12 = _a.sent();
313
+ FirmaUtil_1.FirmaUtil.printLog(error_12);
314
+ throw error_12;
252
315
  case 4: return [2 /*return*/];
253
316
  }
254
317
  });
@@ -258,20 +321,20 @@ var FirmaDistributionService = /** @class */ (function () {
258
321
  //
259
322
  FirmaDistributionService.prototype.getRewardInfo = function (address, validatorAddress) {
260
323
  return __awaiter(this, void 0, void 0, function () {
261
- var queryClient, result, error_10;
324
+ var queryClient, result, error_13;
262
325
  return __generator(this, function (_a) {
263
326
  switch (_a.label) {
264
327
  case 0:
265
328
  _a.trys.push([0, 2, , 3]);
266
- queryClient = new distribution_1.DistributionQueryClient(this._config.restApiAddress);
329
+ queryClient = new distribution_1.DistributionQueryClient(this.config.restApiAddress);
267
330
  return [4 /*yield*/, queryClient.queryGetRewardInfo(address, validatorAddress)];
268
331
  case 1:
269
332
  result = _a.sent();
270
333
  return [2 /*return*/, result];
271
334
  case 2:
272
- error_10 = _a.sent();
273
- FirmaUtil_1.FirmaUtil.printLog(error_10);
274
- throw error_10;
335
+ error_13 = _a.sent();
336
+ FirmaUtil_1.FirmaUtil.printLog(error_13);
337
+ throw error_13;
275
338
  case 3: return [2 /*return*/];
276
339
  }
277
340
  });
@@ -279,20 +342,20 @@ var FirmaDistributionService = /** @class */ (function () {
279
342
  };
280
343
  FirmaDistributionService.prototype.getValidatorOutStandingReward = function (validatorAddress) {
281
344
  return __awaiter(this, void 0, void 0, function () {
282
- var queryClient, result, error_11;
345
+ var queryClient, result, error_14;
283
346
  return __generator(this, function (_a) {
284
347
  switch (_a.label) {
285
348
  case 0:
286
349
  _a.trys.push([0, 2, , 3]);
287
- queryClient = new distribution_1.DistributionQueryClient(this._config.restApiAddress);
350
+ queryClient = new distribution_1.DistributionQueryClient(this.config.restApiAddress);
288
351
  return [4 /*yield*/, queryClient.queryGetValidatorOutStandingReward(validatorAddress)];
289
352
  case 1:
290
353
  result = _a.sent();
291
354
  return [2 /*return*/, result];
292
355
  case 2:
293
- error_11 = _a.sent();
294
- FirmaUtil_1.FirmaUtil.printLog(error_11);
295
- throw error_11;
356
+ error_14 = _a.sent();
357
+ FirmaUtil_1.FirmaUtil.printLog(error_14);
358
+ throw error_14;
296
359
  case 3: return [2 /*return*/];
297
360
  }
298
361
  });
@@ -300,20 +363,20 @@ var FirmaDistributionService = /** @class */ (function () {
300
363
  };
301
364
  FirmaDistributionService.prototype.getValidatorCommission = function (validatorAddress) {
302
365
  return __awaiter(this, void 0, void 0, function () {
303
- var queryClient, result, error_12;
366
+ var queryClient, result, error_15;
304
367
  return __generator(this, function (_a) {
305
368
  switch (_a.label) {
306
369
  case 0:
307
370
  _a.trys.push([0, 2, , 3]);
308
- queryClient = new distribution_1.DistributionQueryClient(this._config.restApiAddress);
371
+ queryClient = new distribution_1.DistributionQueryClient(this.config.restApiAddress);
309
372
  return [4 /*yield*/, queryClient.queryGetValidatorCommission(validatorAddress)];
310
373
  case 1:
311
374
  result = _a.sent();
312
375
  return [2 /*return*/, result];
313
376
  case 2:
314
- error_12 = _a.sent();
315
- FirmaUtil_1.FirmaUtil.printLog(error_12);
316
- throw error_12;
377
+ error_15 = _a.sent();
378
+ FirmaUtil_1.FirmaUtil.printLog(error_15);
379
+ throw error_15;
317
380
  case 3: return [2 /*return*/];
318
381
  }
319
382
  });
@@ -321,20 +384,20 @@ var FirmaDistributionService = /** @class */ (function () {
321
384
  };
322
385
  FirmaDistributionService.prototype.getTotalRewardInfo = function (address) {
323
386
  return __awaiter(this, void 0, void 0, function () {
324
- var queryClient, result, error_13;
387
+ var queryClient, result, error_16;
325
388
  return __generator(this, function (_a) {
326
389
  switch (_a.label) {
327
390
  case 0:
328
391
  _a.trys.push([0, 2, , 3]);
329
- queryClient = new distribution_1.DistributionQueryClient(this._config.restApiAddress);
392
+ queryClient = new distribution_1.DistributionQueryClient(this.config.restApiAddress);
330
393
  return [4 /*yield*/, queryClient.queryGetTotalRewardInfo(address)];
331
394
  case 1:
332
395
  result = _a.sent();
333
396
  return [2 /*return*/, result];
334
397
  case 2:
335
- error_13 = _a.sent();
336
- FirmaUtil_1.FirmaUtil.printLog(error_13);
337
- throw error_13;
398
+ error_16 = _a.sent();
399
+ FirmaUtil_1.FirmaUtil.printLog(error_16);
400
+ throw error_16;
338
401
  case 3: return [2 /*return*/];
339
402
  }
340
403
  });
@@ -342,20 +405,41 @@ var FirmaDistributionService = /** @class */ (function () {
342
405
  };
343
406
  FirmaDistributionService.prototype.getCommunityPool = function () {
344
407
  return __awaiter(this, void 0, void 0, function () {
345
- var queryClient, result, error_14;
408
+ var queryClient, result, error_17;
346
409
  return __generator(this, function (_a) {
347
410
  switch (_a.label) {
348
411
  case 0:
349
412
  _a.trys.push([0, 2, , 3]);
350
- queryClient = new distribution_1.DistributionQueryClient(this._config.restApiAddress);
413
+ queryClient = new distribution_1.DistributionQueryClient(this.config.restApiAddress);
351
414
  return [4 /*yield*/, queryClient.queryGetCommunityPool()];
352
415
  case 1:
353
416
  result = _a.sent();
354
417
  return [2 /*return*/, result];
355
418
  case 2:
356
- error_14 = _a.sent();
357
- FirmaUtil_1.FirmaUtil.printLog(error_14);
358
- throw error_14;
419
+ error_17 = _a.sent();
420
+ FirmaUtil_1.FirmaUtil.printLog(error_17);
421
+ throw error_17;
422
+ case 3: return [2 /*return*/];
423
+ }
424
+ });
425
+ });
426
+ };
427
+ FirmaDistributionService.prototype.getWithdrawAddress = function (address) {
428
+ return __awaiter(this, void 0, void 0, function () {
429
+ var queryClient, result, error_18;
430
+ return __generator(this, function (_a) {
431
+ switch (_a.label) {
432
+ case 0:
433
+ _a.trys.push([0, 2, , 3]);
434
+ queryClient = new distribution_1.DistributionQueryClient(this.config.restApiAddress);
435
+ return [4 /*yield*/, queryClient.queryGetWithdrawAddress(address)];
436
+ case 1:
437
+ result = _a.sent();
438
+ return [2 /*return*/, result];
439
+ case 2:
440
+ error_18 = _a.sent();
441
+ FirmaUtil_1.FirmaUtil.printLog(error_18);
442
+ throw error_18;
359
443
  case 3: return [2 /*return*/];
360
444
  }
361
445
  });
@@ -1,15 +1,18 @@
1
- import { TxMisc, BasicFeeGrantOption, PeriodicFeeGrantOption } from './firmachain/feegrant';
1
+ import { TxMisc, BasicFeeGrantOption, PeriodicFeeGrantOption } from "./firmachain/feegrant";
2
2
  import { FirmaWalletService } from "./FirmaWalletService";
3
3
  import { FirmaConfig } from "./FirmaConfig";
4
- import { FeeAllowanceType, FeeAllowanceType1 } from './firmachain/feegrant/FeeGrantQueryClient';
5
- import { BroadcastTxResponse } from './firmachain/common/stargateclient';
4
+ import { FeeAllowanceType, FeeAllowanceType1 } from "./firmachain/feegrant/FeeGrantQueryClient";
5
+ import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
6
6
  export declare class FirmaFeeGrantService {
7
- private _config;
8
- constructor(_config: FirmaConfig);
7
+ private readonly config;
8
+ constructor(config: FirmaConfig);
9
+ getGasEstimationRevokeAllowance(wallet: FirmaWalletService, granteeAddress: string, txMisc?: TxMisc): Promise<number>;
9
10
  private getSignedTxRevokeAllowance;
10
11
  revokeAllowance(wallet: FirmaWalletService, granteeAddress: string, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
11
12
  private getCoinType;
13
+ getGasEstimationGrantPeriodicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption: PeriodicFeeGrantOption, txMisc?: TxMisc): Promise<number>;
12
14
  private getSignedTxGrantPeriodicAllowance;
15
+ getGasEstimationGrantBasicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption?: BasicFeeGrantOption, txMisc?: TxMisc): Promise<number>;
13
16
  private getSignedTxGrantBasicAllowance;
14
17
  grantPeriodicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption: PeriodicFeeGrantOption, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
15
18
  grantBasicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption?: BasicFeeGrantOption, txMisc?: TxMisc): Promise<BroadcastTxResponse>;