@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
|
@@ -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(
|
|
47
|
-
this.
|
|
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,
|
|
74
|
+
var address, feeGrantTxClient, message, error_2;
|
|
53
75
|
return __generator(this, function (_a) {
|
|
54
76
|
switch (_a.label) {
|
|
55
77
|
case 0:
|
|
@@ -57,14 +79,14 @@ 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.
|
|
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.
|
|
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
|
-
|
|
66
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
67
|
-
throw
|
|
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
|
});
|
|
@@ -73,7 +95,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
73
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,
|
|
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.
|
|
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
|
-
|
|
89
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
90
|
-
throw
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
120
|
-
periodCanSpend: [{ denom: this.
|
|
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({
|
|
129
|
-
|
|
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
|
-
|
|
133
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
134
|
-
throw
|
|
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,
|
|
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.
|
|
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,13 +230,17 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
159
230
|
typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance",
|
|
160
231
|
value: bytes
|
|
161
232
|
};
|
|
162
|
-
message = feeGrantTxClient.msgGrantAllowance({
|
|
163
|
-
|
|
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
|
-
|
|
167
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
168
|
-
throw
|
|
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
|
});
|
|
@@ -174,7 +249,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
174
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,
|
|
252
|
+
var txRaw, feeGrantTxClient, error_8;
|
|
178
253
|
return __generator(this, function (_a) {
|
|
179
254
|
switch (_a.label) {
|
|
180
255
|
case 0:
|
|
@@ -182,13 +257,13 @@ 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.
|
|
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
|
-
|
|
190
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
191
|
-
throw
|
|
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
|
});
|
|
@@ -198,7 +273,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
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,
|
|
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.
|
|
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
|
-
|
|
214
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
215
|
-
throw
|
|
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,
|
|
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.
|
|
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
|
-
|
|
236
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
237
|
-
throw
|
|
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,
|
|
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.
|
|
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
|
-
|
|
257
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
258
|
-
throw
|
|
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,17 +1,23 @@
|
|
|
1
|
-
import { TxMisc, ParamChangeOption, VotingOption, ProposalInfo, ProposalStatus, ProposalParam } from
|
|
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
|
|
5
|
-
import Long from
|
|
4
|
+
import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
|
|
5
|
+
import Long from "long";
|
|
6
6
|
export declare class FirmaGovService {
|
|
7
|
-
private
|
|
8
|
-
constructor(
|
|
9
|
-
|
|
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
|
|
12
|
-
private
|
|
13
|
-
private
|
|
14
|
-
private
|
|
17
|
+
private getSignedTxSubmitCancelSoftwareUpgradeProposal;
|
|
18
|
+
private getSignedTxSubmitSoftwareUpgradeProposal;
|
|
19
|
+
private getSignedTxSubmitParameterChangeProposal;
|
|
20
|
+
private getSignedTxSubmitCommunityPoolSpendProposal;
|
|
15
21
|
submitCancelSoftwareUpgradeProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
|
|
16
22
|
submitSoftwareUpgradeProposalByHeight(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, upgradeName: string, height: Long, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
|
|
17
23
|
submitSoftwareUpgradeProposalByTime(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, upgradeName: string, upgradeTime: Date, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
|