@firmachain/firma-js 0.2.21 → 0.2.25
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/README.md +19 -13
- package/dist/sdk/FirmaBankService.js +5 -5
- package/dist/sdk/FirmaConfig.d.ts +3 -1
- package/dist/sdk/FirmaConfig.js +24 -16
- package/dist/sdk/FirmaContractService.js +12 -12
- package/dist/sdk/FirmaDistributionService.js +20 -20
- package/dist/sdk/FirmaFeeGrantService.js +12 -12
- package/dist/sdk/FirmaGovService.js +29 -29
- package/dist/sdk/FirmaNftService.js +12 -12
- package/dist/sdk/FirmaStakingService.js +18 -18
- package/dist/sdk/FirmaTokenService.js +16 -16
- package/dist/sdk/FirmaUtil.d.ts +12 -1
- package/dist/sdk/FirmaUtil.js +28 -8
- package/dist/sdk/firmachain/common/TxCommon.d.ts +0 -7
- package/dist/sdk/firmachain/common/TxCommon.js +1 -17
- package/package.json +5 -4
|
@@ -53,7 +53,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
53
53
|
this.config = config;
|
|
54
54
|
}
|
|
55
55
|
FirmaGovService.prototype.getGasEstimationVote = function (wallet, proposalId, option, txMisc) {
|
|
56
|
-
if (txMisc === void 0) { txMisc =
|
|
56
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
57
57
|
return __awaiter(this, void 0, void 0, function () {
|
|
58
58
|
var longId, txRaw, error_1;
|
|
59
59
|
return __generator(this, function (_a) {
|
|
@@ -76,7 +76,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
78
|
FirmaGovService.prototype.getGasEstimationDeposit = function (wallet, proposalId, amount, txMisc) {
|
|
79
|
-
if (txMisc === void 0) { txMisc =
|
|
79
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
80
80
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
81
|
var longId, txRaw, error_2;
|
|
82
82
|
return __generator(this, function (_a) {
|
|
@@ -99,7 +99,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
99
99
|
});
|
|
100
100
|
};
|
|
101
101
|
FirmaGovService.prototype.getGasEstimationSubmitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
102
|
-
if (txMisc === void 0) { txMisc =
|
|
102
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
103
103
|
return __awaiter(this, void 0, void 0, function () {
|
|
104
104
|
var txRaw, error_3;
|
|
105
105
|
return __generator(this, function (_a) {
|
|
@@ -121,7 +121,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
121
121
|
});
|
|
122
122
|
};
|
|
123
123
|
FirmaGovService.prototype.getGasEstimationSubmitSoftwareUpgradeProposalByHeight = function (wallet, title, description, initialDepositFCT, upgradeName, height, txMisc) {
|
|
124
|
-
if (txMisc === void 0) { txMisc =
|
|
124
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
125
125
|
return __awaiter(this, void 0, void 0, function () {
|
|
126
126
|
var upgradeHeight, plan, txRaw, error_4;
|
|
127
127
|
return __generator(this, function (_a) {
|
|
@@ -151,7 +151,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
151
151
|
});
|
|
152
152
|
};
|
|
153
153
|
FirmaGovService.prototype.getGasEstimationSubmitParameterChangeProposal = function (wallet, title, description, initialDepositFCT, paramList, txMisc) {
|
|
154
|
-
if (txMisc === void 0) { txMisc =
|
|
154
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
155
155
|
return __awaiter(this, void 0, void 0, function () {
|
|
156
156
|
var txRaw, error_5;
|
|
157
157
|
return __generator(this, function (_a) {
|
|
@@ -173,7 +173,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
173
173
|
});
|
|
174
174
|
};
|
|
175
175
|
FirmaGovService.prototype.getGasEstimationSubmitCommunityPoolSpendProposal = function (wallet, title, description, initialDepositFCT, amount, recipient, txMisc) {
|
|
176
|
-
if (txMisc === void 0) { txMisc =
|
|
176
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
177
177
|
return __awaiter(this, void 0, void 0, function () {
|
|
178
178
|
var txRaw, error_6;
|
|
179
179
|
return __generator(this, function (_a) {
|
|
@@ -195,7 +195,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
195
195
|
});
|
|
196
196
|
};
|
|
197
197
|
FirmaGovService.prototype.getGasEstimationSubmitTextProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
198
|
-
if (txMisc === void 0) { txMisc =
|
|
198
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
199
199
|
return __awaiter(this, void 0, void 0, function () {
|
|
200
200
|
var txRaw, error_7;
|
|
201
201
|
return __generator(this, function (_a) {
|
|
@@ -217,7 +217,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
217
217
|
});
|
|
218
218
|
};
|
|
219
219
|
FirmaGovService.prototype.getSignedTxSubmitTextProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
220
|
-
if (txMisc === void 0) { txMisc =
|
|
220
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
221
221
|
return __awaiter(this, void 0, void 0, function () {
|
|
222
222
|
var txClient, sendAmount, proposal, content, proposer, message, error_8;
|
|
223
223
|
return __generator(this, function (_a) {
|
|
@@ -238,7 +238,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
238
238
|
case 1:
|
|
239
239
|
proposer = _a.sent();
|
|
240
240
|
message = txClient.msgSubmitProposal({ content: content, initialDeposit: [sendAmount], proposer: proposer });
|
|
241
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
241
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
242
242
|
case 2: return [2 /*return*/, _a.sent()];
|
|
243
243
|
case 3:
|
|
244
244
|
error_8 = _a.sent();
|
|
@@ -250,7 +250,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
250
250
|
});
|
|
251
251
|
};
|
|
252
252
|
FirmaGovService.prototype.getSignedTxSubmitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
253
|
-
if (txMisc === void 0) { txMisc =
|
|
253
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
254
254
|
return __awaiter(this, void 0, void 0, function () {
|
|
255
255
|
var txClient, initialDepositAmount, proposal, content, proposer, message, error_9;
|
|
256
256
|
return __generator(this, function (_a) {
|
|
@@ -278,7 +278,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
278
278
|
initialDeposit: [initialDepositAmount],
|
|
279
279
|
proposer: proposer
|
|
280
280
|
});
|
|
281
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
281
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
282
282
|
case 2: return [2 /*return*/, _a.sent()];
|
|
283
283
|
case 3:
|
|
284
284
|
error_9 = _a.sent();
|
|
@@ -290,7 +290,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
290
290
|
});
|
|
291
291
|
};
|
|
292
292
|
FirmaGovService.prototype.getSignedTxSubmitSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, plan, txMisc) {
|
|
293
|
-
if (txMisc === void 0) { txMisc =
|
|
293
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
294
294
|
return __awaiter(this, void 0, void 0, function () {
|
|
295
295
|
var txClient, initialDepositAmount, proposal, content, proposer, message, error_10;
|
|
296
296
|
return __generator(this, function (_a) {
|
|
@@ -319,7 +319,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
319
319
|
initialDeposit: [initialDepositAmount],
|
|
320
320
|
proposer: proposer
|
|
321
321
|
});
|
|
322
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
322
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
323
323
|
case 2: return [2 /*return*/, _a.sent()];
|
|
324
324
|
case 3:
|
|
325
325
|
error_10 = _a.sent();
|
|
@@ -331,7 +331,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
331
331
|
});
|
|
332
332
|
};
|
|
333
333
|
FirmaGovService.prototype.getSignedTxSubmitParameterChangeProposal = function (wallet, title, description, initialDepositFCT, paramList, txMisc) {
|
|
334
|
-
if (txMisc === void 0) { txMisc =
|
|
334
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
335
335
|
return __awaiter(this, void 0, void 0, function () {
|
|
336
336
|
var txClient, initialDepositAmount, proposal, content, proposer, message, error_11;
|
|
337
337
|
return __generator(this, function (_a) {
|
|
@@ -360,7 +360,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
360
360
|
initialDeposit: [initialDepositAmount],
|
|
361
361
|
proposer: proposer
|
|
362
362
|
});
|
|
363
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
363
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
364
364
|
case 2: return [2 /*return*/, _a.sent()];
|
|
365
365
|
case 3:
|
|
366
366
|
error_11 = _a.sent();
|
|
@@ -372,7 +372,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
372
372
|
});
|
|
373
373
|
};
|
|
374
374
|
FirmaGovService.prototype.getSignedTxSubmitCommunityPoolSpendProposal = function (wallet, title, description, initialDepositFCT, amount, recipient, txMisc) {
|
|
375
|
-
if (txMisc === void 0) { txMisc =
|
|
375
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
376
376
|
return __awaiter(this, void 0, void 0, function () {
|
|
377
377
|
var txClient, initialDepositAmount, sendAmount, proposal, content, proposer, message, error_12;
|
|
378
378
|
return __generator(this, function (_a) {
|
|
@@ -403,7 +403,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
403
403
|
initialDeposit: [initialDepositAmount],
|
|
404
404
|
proposer: proposer
|
|
405
405
|
});
|
|
406
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
406
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
407
407
|
case 2: return [2 /*return*/, _a.sent()];
|
|
408
408
|
case 3:
|
|
409
409
|
error_12 = _a.sent();
|
|
@@ -415,7 +415,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
415
415
|
});
|
|
416
416
|
};
|
|
417
417
|
FirmaGovService.prototype.submitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDeposit, txMisc) {
|
|
418
|
-
if (txMisc === void 0) { txMisc =
|
|
418
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
419
419
|
return __awaiter(this, void 0, void 0, function () {
|
|
420
420
|
var txRaw, txClient, error_13;
|
|
421
421
|
return __generator(this, function (_a) {
|
|
@@ -438,7 +438,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
438
438
|
});
|
|
439
439
|
};
|
|
440
440
|
FirmaGovService.prototype.submitSoftwareUpgradeProposalByHeight = function (wallet, title, description, initialDeposit, upgradeName, height, txMisc) {
|
|
441
|
-
if (txMisc === void 0) { txMisc =
|
|
441
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
442
442
|
return __awaiter(this, void 0, void 0, function () {
|
|
443
443
|
var upgradeHeight, plan, txRaw, txClient, error_14;
|
|
444
444
|
return __generator(this, function (_a) {
|
|
@@ -469,7 +469,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
469
469
|
});
|
|
470
470
|
};
|
|
471
471
|
FirmaGovService.prototype.submitSoftwareUpgradeProposalByTime = function (wallet, title, description, initialDeposit, upgradeName, upgradeTime, txMisc) {
|
|
472
|
-
if (txMisc === void 0) { txMisc =
|
|
472
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
473
473
|
return __awaiter(this, void 0, void 0, function () {
|
|
474
474
|
var plan, txRaw, txClient, error_15;
|
|
475
475
|
return __generator(this, function (_a) {
|
|
@@ -499,7 +499,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
499
499
|
});
|
|
500
500
|
};
|
|
501
501
|
FirmaGovService.prototype.submitParameterChangeProposal = function (wallet, title, description, initialDeposit, paramList, txMisc) {
|
|
502
|
-
if (txMisc === void 0) { txMisc =
|
|
502
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
503
503
|
return __awaiter(this, void 0, void 0, function () {
|
|
504
504
|
var txRaw, txClient, error_16;
|
|
505
505
|
return __generator(this, function (_a) {
|
|
@@ -522,7 +522,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
522
522
|
});
|
|
523
523
|
};
|
|
524
524
|
FirmaGovService.prototype.submitCommunityPoolSpendProposal = function (wallet, title, description, initialDeposit, amount, recipient, txMisc) {
|
|
525
|
-
if (txMisc === void 0) { txMisc =
|
|
525
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
526
526
|
return __awaiter(this, void 0, void 0, function () {
|
|
527
527
|
var txRaw, txClient, error_17;
|
|
528
528
|
return __generator(this, function (_a) {
|
|
@@ -545,7 +545,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
545
545
|
});
|
|
546
546
|
};
|
|
547
547
|
FirmaGovService.prototype.submitTextProposal = function (wallet, title, description, initialDeposit, txMisc) {
|
|
548
|
-
if (txMisc === void 0) { txMisc =
|
|
548
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
549
549
|
return __awaiter(this, void 0, void 0, function () {
|
|
550
550
|
var txRaw, txClient, error_18;
|
|
551
551
|
return __generator(this, function (_a) {
|
|
@@ -568,7 +568,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
568
568
|
});
|
|
569
569
|
};
|
|
570
570
|
FirmaGovService.prototype.getSignedTxVote = function (wallet, proposalId, option, txMisc) {
|
|
571
|
-
if (txMisc === void 0) { txMisc =
|
|
571
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
572
572
|
return __awaiter(this, void 0, void 0, function () {
|
|
573
573
|
var voter, txClient, message, error_19;
|
|
574
574
|
return __generator(this, function (_a) {
|
|
@@ -580,7 +580,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
580
580
|
voter = _a.sent();
|
|
581
581
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
582
582
|
message = txClient.msgVote({ proposalId: proposalId, voter: voter, option: option });
|
|
583
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
583
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
584
584
|
case 2: return [2 /*return*/, _a.sent()];
|
|
585
585
|
case 3:
|
|
586
586
|
error_19 = _a.sent();
|
|
@@ -592,7 +592,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
592
592
|
});
|
|
593
593
|
};
|
|
594
594
|
FirmaGovService.prototype.vote = function (wallet, proposalId, option, txMisc) {
|
|
595
|
-
if (txMisc === void 0) { txMisc =
|
|
595
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
596
596
|
return __awaiter(this, void 0, void 0, function () {
|
|
597
597
|
var longId, txRaw, txClient, error_20;
|
|
598
598
|
return __generator(this, function (_a) {
|
|
@@ -616,7 +616,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
616
616
|
});
|
|
617
617
|
};
|
|
618
618
|
FirmaGovService.prototype.getSignedTxDeposit = function (wallet, proposalId, amount, txMisc) {
|
|
619
|
-
if (txMisc === void 0) { txMisc =
|
|
619
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
620
620
|
return __awaiter(this, void 0, void 0, function () {
|
|
621
621
|
var txClient, depositor, sendAmount, message, error_21;
|
|
622
622
|
return __generator(this, function (_a) {
|
|
@@ -629,7 +629,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
629
629
|
depositor = _a.sent();
|
|
630
630
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
631
631
|
message = txClient.msgDeposit({ proposalId: proposalId, depositor: depositor, amount: [sendAmount] });
|
|
632
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
632
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
633
633
|
case 2: return [2 /*return*/, _a.sent()];
|
|
634
634
|
case 3:
|
|
635
635
|
error_21 = _a.sent();
|
|
@@ -641,7 +641,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
641
641
|
});
|
|
642
642
|
};
|
|
643
643
|
FirmaGovService.prototype.deposit = function (wallet, proposalId, amount, txMisc) {
|
|
644
|
-
if (txMisc === void 0) { txMisc =
|
|
644
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
645
645
|
return __awaiter(this, void 0, void 0, function () {
|
|
646
646
|
var longId, txRaw, txClient, error_22;
|
|
647
647
|
return __generator(this, function (_a) {
|
|
@@ -161,7 +161,7 @@ var NftService = /** @class */ (function () {
|
|
|
161
161
|
});
|
|
162
162
|
};
|
|
163
163
|
NftService.prototype.getGasEstimationTransfer = function (wallet, toAddress, nftID, txMisc) {
|
|
164
|
-
if (txMisc === void 0) { txMisc =
|
|
164
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
165
165
|
return __awaiter(this, void 0, void 0, function () {
|
|
166
166
|
var txRaw, error_6;
|
|
167
167
|
return __generator(this, function (_a) {
|
|
@@ -183,7 +183,7 @@ var NftService = /** @class */ (function () {
|
|
|
183
183
|
});
|
|
184
184
|
};
|
|
185
185
|
NftService.prototype.getSignedTxTransfer = function (wallet, toAddress, nftID, txMisc) {
|
|
186
|
-
if (txMisc === void 0) { txMisc =
|
|
186
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
187
187
|
return __awaiter(this, void 0, void 0, function () {
|
|
188
188
|
var address, nftTxClient, message, error_7;
|
|
189
189
|
return __generator(this, function (_a) {
|
|
@@ -195,7 +195,7 @@ var NftService = /** @class */ (function () {
|
|
|
195
195
|
address = _a.sent();
|
|
196
196
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
197
197
|
message = nftTxClient.msgTransfer({ owner: address, toAddress: toAddress, nftId: parseInt(nftID) });
|
|
198
|
-
return [4 /*yield*/, nftTxClient.sign([message],
|
|
198
|
+
return [4 /*yield*/, nftTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
199
199
|
case 2: return [2 /*return*/, _a.sent()];
|
|
200
200
|
case 3:
|
|
201
201
|
error_7 = _a.sent();
|
|
@@ -207,7 +207,7 @@ var NftService = /** @class */ (function () {
|
|
|
207
207
|
});
|
|
208
208
|
};
|
|
209
209
|
NftService.prototype.transfer = function (wallet, toAddress, nftID, txMisc) {
|
|
210
|
-
if (txMisc === void 0) { txMisc =
|
|
210
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
211
211
|
return __awaiter(this, void 0, void 0, function () {
|
|
212
212
|
var txRaw, nftTxClient, error_8;
|
|
213
213
|
return __generator(this, function (_a) {
|
|
@@ -230,7 +230,7 @@ var NftService = /** @class */ (function () {
|
|
|
230
230
|
});
|
|
231
231
|
};
|
|
232
232
|
NftService.prototype.getGasEstimationBurn = function (wallet, nftID, txMisc) {
|
|
233
|
-
if (txMisc === void 0) { txMisc =
|
|
233
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
234
234
|
return __awaiter(this, void 0, void 0, function () {
|
|
235
235
|
var txRaw, error_9;
|
|
236
236
|
return __generator(this, function (_a) {
|
|
@@ -252,7 +252,7 @@ var NftService = /** @class */ (function () {
|
|
|
252
252
|
});
|
|
253
253
|
};
|
|
254
254
|
NftService.prototype.getSignedTxBurn = function (wallet, nftID, txMisc) {
|
|
255
|
-
if (txMisc === void 0) { txMisc =
|
|
255
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
256
256
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
257
|
var address, nftTxClient, message, error_10;
|
|
258
258
|
return __generator(this, function (_a) {
|
|
@@ -264,7 +264,7 @@ var NftService = /** @class */ (function () {
|
|
|
264
264
|
address = _a.sent();
|
|
265
265
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
266
266
|
message = nftTxClient.msgBurn({ owner: address, nftId: parseInt(nftID) });
|
|
267
|
-
return [4 /*yield*/, nftTxClient.sign([message],
|
|
267
|
+
return [4 /*yield*/, nftTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
268
268
|
case 2: return [2 /*return*/, _a.sent()];
|
|
269
269
|
case 3:
|
|
270
270
|
error_10 = _a.sent();
|
|
@@ -276,7 +276,7 @@ var NftService = /** @class */ (function () {
|
|
|
276
276
|
});
|
|
277
277
|
};
|
|
278
278
|
NftService.prototype.burn = function (wallet, nftID, txMisc) {
|
|
279
|
-
if (txMisc === void 0) { txMisc =
|
|
279
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
280
280
|
return __awaiter(this, void 0, void 0, function () {
|
|
281
281
|
var txRaw, nftTxClient, error_11;
|
|
282
282
|
return __generator(this, function (_a) {
|
|
@@ -299,7 +299,7 @@ var NftService = /** @class */ (function () {
|
|
|
299
299
|
});
|
|
300
300
|
};
|
|
301
301
|
NftService.prototype.getGasEstimationMint = function (wallet, tokenURI, txMisc) {
|
|
302
|
-
if (txMisc === void 0) { txMisc =
|
|
302
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
303
303
|
return __awaiter(this, void 0, void 0, function () {
|
|
304
304
|
var txRaw, error_12;
|
|
305
305
|
return __generator(this, function (_a) {
|
|
@@ -321,7 +321,7 @@ var NftService = /** @class */ (function () {
|
|
|
321
321
|
});
|
|
322
322
|
};
|
|
323
323
|
NftService.prototype.getSignedTxMint = function (wallet, tokenURI, txMisc) {
|
|
324
|
-
if (txMisc === void 0) { txMisc =
|
|
324
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
325
325
|
return __awaiter(this, void 0, void 0, function () {
|
|
326
326
|
var address, nftTxClient, message, error_13;
|
|
327
327
|
return __generator(this, function (_a) {
|
|
@@ -333,7 +333,7 @@ var NftService = /** @class */ (function () {
|
|
|
333
333
|
address = _a.sent();
|
|
334
334
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
335
335
|
message = nftTxClient.msgMint({ owner: address, tokenURI: tokenURI });
|
|
336
|
-
return [4 /*yield*/, nftTxClient.sign([message],
|
|
336
|
+
return [4 /*yield*/, nftTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
337
337
|
case 2: return [2 /*return*/, _a.sent()];
|
|
338
338
|
case 3:
|
|
339
339
|
error_13 = _a.sent();
|
|
@@ -345,7 +345,7 @@ var NftService = /** @class */ (function () {
|
|
|
345
345
|
});
|
|
346
346
|
};
|
|
347
347
|
NftService.prototype.mint = function (wallet, tokenURI, txMisc) {
|
|
348
|
-
if (txMisc === void 0) { txMisc =
|
|
348
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
349
349
|
return __awaiter(this, void 0, void 0, function () {
|
|
350
350
|
var txRaw, nftTxClient, error_14;
|
|
351
351
|
return __generator(this, function (_a) {
|
|
@@ -44,7 +44,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
44
44
|
this.config = config;
|
|
45
45
|
}
|
|
46
46
|
FirmaStakingService.prototype.getGasEstimationDelegate = function (wallet, validatorAddres, amount, txMisc) {
|
|
47
|
-
if (txMisc === void 0) { txMisc =
|
|
47
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
48
48
|
return __awaiter(this, void 0, void 0, function () {
|
|
49
49
|
var txRaw, error_1;
|
|
50
50
|
return __generator(this, function (_a) {
|
|
@@ -66,7 +66,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
FirmaStakingService.prototype.getGasEstimationUndelegate = function (wallet, validatorAddres, amount, txMisc) {
|
|
69
|
-
if (txMisc === void 0) { txMisc =
|
|
69
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
70
70
|
return __awaiter(this, void 0, void 0, function () {
|
|
71
71
|
var txRaw, error_2;
|
|
72
72
|
return __generator(this, function (_a) {
|
|
@@ -88,7 +88,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
88
88
|
});
|
|
89
89
|
};
|
|
90
90
|
FirmaStakingService.prototype.getGasEstimationRedelegate = function (wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc) {
|
|
91
|
-
if (txMisc === void 0) { txMisc =
|
|
91
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
92
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
93
93
|
var txRaw, error_3;
|
|
94
94
|
return __generator(this, function (_a) {
|
|
@@ -110,7 +110,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
112
|
FirmaStakingService.prototype.getSignedTxDelegate = function (wallet, validatorAddres, amount, txMisc) {
|
|
113
|
-
if (txMisc === void 0) { txMisc =
|
|
113
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
114
114
|
return __awaiter(this, void 0, void 0, function () {
|
|
115
115
|
var txClient, address, sendAmount, message, error_4;
|
|
116
116
|
return __generator(this, function (_a) {
|
|
@@ -127,7 +127,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
127
127
|
validatorAddress: validatorAddres,
|
|
128
128
|
amount: sendAmount
|
|
129
129
|
});
|
|
130
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
130
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
131
131
|
case 2: return [2 /*return*/, _a.sent()];
|
|
132
132
|
case 3:
|
|
133
133
|
error_4 = _a.sent();
|
|
@@ -139,7 +139,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
139
139
|
});
|
|
140
140
|
};
|
|
141
141
|
FirmaStakingService.prototype.getSignedTxUndelegate = function (wallet, validatorAddres, amount, txMisc) {
|
|
142
|
-
if (txMisc === void 0) { txMisc =
|
|
142
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
143
143
|
return __awaiter(this, void 0, void 0, function () {
|
|
144
144
|
var txClient, address, sendAmount, message, error_5;
|
|
145
145
|
return __generator(this, function (_a) {
|
|
@@ -156,7 +156,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
156
156
|
validatorAddress: validatorAddres,
|
|
157
157
|
amount: sendAmount
|
|
158
158
|
});
|
|
159
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
159
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
160
160
|
case 2: return [2 /*return*/, _a.sent()];
|
|
161
161
|
case 3:
|
|
162
162
|
error_5 = _a.sent();
|
|
@@ -168,7 +168,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
168
168
|
});
|
|
169
169
|
};
|
|
170
170
|
FirmaStakingService.prototype.getSignedTxRedelegate = function (wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc) {
|
|
171
|
-
if (txMisc === void 0) { txMisc =
|
|
171
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
172
172
|
return __awaiter(this, void 0, void 0, function () {
|
|
173
173
|
var txClient, address, sendAmount, message, error_6;
|
|
174
174
|
return __generator(this, function (_a) {
|
|
@@ -186,7 +186,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
186
186
|
validatorDstAddress: validatorDstAddress,
|
|
187
187
|
amount: sendAmount
|
|
188
188
|
});
|
|
189
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
189
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
190
190
|
case 2: return [2 /*return*/, _a.sent()];
|
|
191
191
|
case 3:
|
|
192
192
|
error_6 = _a.sent();
|
|
@@ -198,7 +198,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
198
198
|
});
|
|
199
199
|
};
|
|
200
200
|
FirmaStakingService.prototype.getSignedTxCreateValidator = function (wallet, validatorInfo, txMisc) {
|
|
201
|
-
if (txMisc === void 0) { txMisc =
|
|
201
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
202
202
|
return __awaiter(this, void 0, void 0, function () {
|
|
203
203
|
var txClient, message, error_7;
|
|
204
204
|
return __generator(this, function (_a) {
|
|
@@ -215,7 +215,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
215
215
|
pubkey: validatorInfo.pubkey,
|
|
216
216
|
value: validatorInfo.value
|
|
217
217
|
});
|
|
218
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
218
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
219
219
|
case 1: return [2 /*return*/, _a.sent()];
|
|
220
220
|
case 2:
|
|
221
221
|
error_7 = _a.sent();
|
|
@@ -227,7 +227,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
227
227
|
});
|
|
228
228
|
};
|
|
229
229
|
FirmaStakingService.prototype.getSignedTxEditValidator = function (wallet, validatorAddress, description, commissionRate, minSelfDelegation, txMisc) {
|
|
230
|
-
if (txMisc === void 0) { txMisc =
|
|
230
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
231
231
|
return __awaiter(this, void 0, void 0, function () {
|
|
232
232
|
var txClient, message, error_8;
|
|
233
233
|
return __generator(this, function (_a) {
|
|
@@ -241,7 +241,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
241
241
|
commissionRate: commissionRate,
|
|
242
242
|
minSelfDelegation: minSelfDelegation
|
|
243
243
|
});
|
|
244
|
-
return [4 /*yield*/, txClient.sign([message],
|
|
244
|
+
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
245
245
|
case 1: return [2 /*return*/, _a.sent()];
|
|
246
246
|
case 2:
|
|
247
247
|
error_8 = _a.sent();
|
|
@@ -253,7 +253,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
253
253
|
});
|
|
254
254
|
};
|
|
255
255
|
FirmaStakingService.prototype.createValidator = function (wallet, validatorInfo, txMisc) {
|
|
256
|
-
if (txMisc === void 0) { txMisc =
|
|
256
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
257
257
|
return __awaiter(this, void 0, void 0, function () {
|
|
258
258
|
var txRaw, txClient, error_9;
|
|
259
259
|
return __generator(this, function (_a) {
|
|
@@ -276,7 +276,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
276
276
|
});
|
|
277
277
|
};
|
|
278
278
|
FirmaStakingService.prototype.editValidator = function (wallet, validatorAddress, description, commissionRate, minSelfDelegation, txMisc) {
|
|
279
|
-
if (txMisc === void 0) { txMisc =
|
|
279
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
280
280
|
return __awaiter(this, void 0, void 0, function () {
|
|
281
281
|
var txRaw, txClient, error_10;
|
|
282
282
|
return __generator(this, function (_a) {
|
|
@@ -299,7 +299,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
299
299
|
});
|
|
300
300
|
};
|
|
301
301
|
FirmaStakingService.prototype.redelegate = function (wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc) {
|
|
302
|
-
if (txMisc === void 0) { txMisc =
|
|
302
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
303
303
|
return __awaiter(this, void 0, void 0, function () {
|
|
304
304
|
var txRaw, txClient, error_11;
|
|
305
305
|
return __generator(this, function (_a) {
|
|
@@ -322,7 +322,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
322
322
|
});
|
|
323
323
|
};
|
|
324
324
|
FirmaStakingService.prototype.undelegate = function (wallet, targetAddress, amount, txMisc) {
|
|
325
|
-
if (txMisc === void 0) { txMisc =
|
|
325
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
326
326
|
return __awaiter(this, void 0, void 0, function () {
|
|
327
327
|
var txRaw, txClient, error_12;
|
|
328
328
|
return __generator(this, function (_a) {
|
|
@@ -345,7 +345,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
345
345
|
});
|
|
346
346
|
};
|
|
347
347
|
FirmaStakingService.prototype.delegate = function (wallet, targetAddress, amount, txMisc) {
|
|
348
|
-
if (txMisc === void 0) { txMisc =
|
|
348
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
349
349
|
return __awaiter(this, void 0, void 0, function () {
|
|
350
350
|
var txRaw, txClient, error_13;
|
|
351
351
|
return __generator(this, function (_a) {
|