@firmachain/firma-js 0.2.30 → 0.2.33
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/FirmaAuthzService.d.ts +41 -0
- package/dist/sdk/FirmaAuthzService.js +633 -0
- package/dist/sdk/FirmaBankService.d.ts +2 -1
- package/dist/sdk/FirmaBankService.js +4 -1
- package/dist/sdk/FirmaContractService.js +10 -12
- package/dist/sdk/FirmaCosmWasmService.d.ts +38 -0
- package/dist/sdk/FirmaCosmWasmService.js +667 -0
- package/dist/sdk/FirmaDistributionService.d.ts +2 -1
- package/dist/sdk/FirmaDistributionService.js +8 -5
- package/dist/sdk/FirmaFeeGrantService.js +3 -3
- package/dist/sdk/FirmaGovService.js +19 -19
- package/dist/sdk/FirmaIbcService.d.ts +15 -0
- package/dist/sdk/FirmaIbcService.js +144 -0
- package/dist/sdk/FirmaMobileSDK.d.ts +3 -1
- package/dist/sdk/FirmaMobileSDK.js +4 -1
- package/dist/sdk/FirmaNftService.js +6 -6
- package/dist/sdk/FirmaSDK.d.ts +7 -1
- package/dist/sdk/FirmaSDK.js +10 -1
- package/dist/sdk/FirmaStakingService.d.ts +18 -5
- package/dist/sdk/FirmaStakingService.js +20 -13
- package/dist/sdk/FirmaTokenService.js +12 -12
- package/dist/sdk/FirmaUtil.d.ts +18 -1
- package/dist/sdk/FirmaUtil.js +193 -0
- package/dist/sdk/FirmaWalletService.d.ts +3 -0
- package/dist/sdk/FirmaWalletService.js +18 -10
- package/dist/sdk/firmachain/amino/signer.d.ts +1 -2
- package/dist/sdk/firmachain/authz/AuthzQueryClient.d.ts +48 -0
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +142 -0
- package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/authz/AuthzTxClient.js +47 -0
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +147 -0
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +358 -0
- package/dist/sdk/firmachain/authz/index.d.ts +3 -0
- package/dist/sdk/firmachain/authz/index.js +15 -0
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/bank/BankTxClient.js +5 -2
- package/dist/sdk/firmachain/common/ITxClient.d.ts +4 -1
- package/dist/sdk/firmachain/common/ITxClient.js +15 -0
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +50 -0
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +267 -0
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +15 -8
- package/dist/sdk/firmachain/common/signingstargateclient.js +68 -9
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/contract/ContractTxClient.js +5 -2
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.d.ts +52 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +193 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.d.ts +38 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +59 -0
- package/dist/sdk/firmachain/cosmwasm/index.d.ts +3 -0
- package/dist/sdk/firmachain/cosmwasm/index.js +15 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +6 -5
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +7 -4
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +4 -3
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +5 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/gov/GovTxClient.js +6 -3
- package/dist/sdk/firmachain/ibc/IbcQueryClient.d.ts +34 -0
- package/dist/sdk/firmachain/ibc/IbcQueryClient.js +71 -0
- package/dist/sdk/firmachain/ibc/IbcTxClient.d.ts +13 -0
- package/dist/sdk/firmachain/ibc/IbcTxClient.js +39 -0
- package/dist/sdk/firmachain/ibc/index.d.ts +3 -0
- package/dist/sdk/firmachain/ibc/index.js +15 -0
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +5 -4
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -3
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +17 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +38 -18
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +7 -6
- package/dist/sdk/firmachain/staking/StakingTxClient.js +8 -5
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +6 -5
- package/dist/sdk/firmachain/token/TokenTxClient.js +7 -4
- package/package.json +3 -1
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +0 -94
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +0 -437
- package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +0 -23
- package/dist/sdk/firmachain/amino/secp256k1wallet.js +0 -141
|
@@ -43,6 +43,9 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
43
43
|
function FirmaDistributionService(config) {
|
|
44
44
|
this.config = config;
|
|
45
45
|
}
|
|
46
|
+
FirmaDistributionService.prototype.getTxClient = function (wallet) {
|
|
47
|
+
return new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
|
|
48
|
+
};
|
|
46
49
|
FirmaDistributionService.prototype.getGasEstimationSetWithdrawAddress = function (wallet, withdrawAddress, txMisc) {
|
|
47
50
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
48
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -165,7 +168,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
165
168
|
return [4 /*yield*/, wallet.getAddress()];
|
|
166
169
|
case 1:
|
|
167
170
|
address = _a.sent();
|
|
168
|
-
message =
|
|
171
|
+
message = distribution_1.DistributionTxClient.msgWithdrawDelegatorReward({ delegatorAddress: address, validatorAddress: validatorAddress });
|
|
169
172
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
170
173
|
case 2: return [2 /*return*/, _a.sent()];
|
|
171
174
|
case 3:
|
|
@@ -189,7 +192,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
189
192
|
return [4 /*yield*/, wallet.getAddress()];
|
|
190
193
|
case 1:
|
|
191
194
|
address = _a.sent();
|
|
192
|
-
message =
|
|
195
|
+
message = distribution_1.DistributionTxClient.msgSetWithdrawAddress({ delegatorAddress: address, withdrawAddress: withdrawAddress });
|
|
193
196
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
194
197
|
case 2: return [2 /*return*/, _a.sent()];
|
|
195
198
|
case 3:
|
|
@@ -214,7 +217,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
214
217
|
case 1:
|
|
215
218
|
address = _a.sent();
|
|
216
219
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
217
|
-
message =
|
|
220
|
+
message = distribution_1.DistributionTxClient.msgFundCommunityPool({ depositor: address, amount: [sendAmount] });
|
|
218
221
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
219
222
|
case 2: return [2 /*return*/, _a.sent()];
|
|
220
223
|
case 3:
|
|
@@ -235,7 +238,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
235
238
|
case 0:
|
|
236
239
|
_a.trys.push([0, 2, , 3]);
|
|
237
240
|
txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
|
|
238
|
-
message =
|
|
241
|
+
message = distribution_1.DistributionTxClient.msgWithdrawValidatorCommission({ validatorAddress: validatorAddres });
|
|
239
242
|
return [4 /*yield*/, txClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
240
243
|
case 1: return [2 /*return*/, _a.sent()];
|
|
241
244
|
case 2:
|
|
@@ -331,7 +334,7 @@ var FirmaDistributionService = /** @class */ (function () {
|
|
|
331
334
|
messageList = [];
|
|
332
335
|
for (i = 0; i < delegationList.length; i++) {
|
|
333
336
|
validatorAddress = delegationList[i].delegation.validator_address;
|
|
334
|
-
message =
|
|
337
|
+
message = distribution_1.DistributionTxClient.msgWithdrawDelegatorReward({ delegatorAddress: address, validatorAddress: validatorAddress });
|
|
335
338
|
messageList.push(message);
|
|
336
339
|
}
|
|
337
340
|
return [4 /*yield*/, txClient.sign(messageList, FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
@@ -80,7 +80,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
80
80
|
case 1:
|
|
81
81
|
address = _a.sent();
|
|
82
82
|
feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
|
|
83
|
-
message =
|
|
83
|
+
message = feegrant_1.FeeGrantTxClient.msgRevokeAllowance({ granter: address, grantee: granteeAddress });
|
|
84
84
|
return [4 /*yield*/, feeGrantTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
85
85
|
case 2: return [2 /*return*/, _a.sent()];
|
|
86
86
|
case 3:
|
|
@@ -169,7 +169,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
169
169
|
typeUrl: "/cosmos.feegrant.v1beta1.PeriodicAllowance",
|
|
170
170
|
value: bytes
|
|
171
171
|
};
|
|
172
|
-
message =
|
|
172
|
+
message = feegrant_1.FeeGrantTxClient.msgGrantAllowance({
|
|
173
173
|
granter: address,
|
|
174
174
|
grantee: granteeAddress,
|
|
175
175
|
allowance: any_1.Any.fromJSON(allowanceAnyData)
|
|
@@ -230,7 +230,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
|
|
|
230
230
|
typeUrl: "/cosmos.feegrant.v1beta1.BasicAllowance",
|
|
231
231
|
value: bytes
|
|
232
232
|
};
|
|
233
|
-
message =
|
|
233
|
+
message = feegrant_1.FeeGrantTxClient.msgGrantAllowance({
|
|
234
234
|
granter: address,
|
|
235
235
|
grantee: granteeAddress,
|
|
236
236
|
allowance: any_1.Any.fromJSON(allowanceAnyData)
|
|
@@ -219,12 +219,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
219
219
|
FirmaGovService.prototype.getSignedTxSubmitTextProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
220
220
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
221
221
|
return __awaiter(this, void 0, void 0, function () {
|
|
222
|
-
var
|
|
222
|
+
var sendAmount, proposal, content, proposer, message, txClient, error_8;
|
|
223
223
|
return __generator(this, function (_a) {
|
|
224
224
|
switch (_a.label) {
|
|
225
225
|
case 0:
|
|
226
226
|
_a.trys.push([0, 3, , 4]);
|
|
227
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
228
227
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT) };
|
|
229
228
|
proposal = gov_2.TextProposal.fromPartial({
|
|
230
229
|
title: title,
|
|
@@ -237,7 +236,8 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
237
236
|
return [4 /*yield*/, wallet.getAddress()];
|
|
238
237
|
case 1:
|
|
239
238
|
proposer = _a.sent();
|
|
240
|
-
message =
|
|
239
|
+
message = gov_1.GovTxClient.msgSubmitProposal({ content: content, initialDeposit: [sendAmount], proposer: proposer });
|
|
240
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
241
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:
|
|
@@ -252,12 +252,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
252
252
|
FirmaGovService.prototype.getSignedTxSubmitCancelSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, txMisc) {
|
|
253
253
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
254
254
|
return __awaiter(this, void 0, void 0, function () {
|
|
255
|
-
var
|
|
255
|
+
var initialDepositAmount, proposal, content, proposer, message, txClient, error_9;
|
|
256
256
|
return __generator(this, function (_a) {
|
|
257
257
|
switch (_a.label) {
|
|
258
258
|
case 0:
|
|
259
259
|
_a.trys.push([0, 3, , 4]);
|
|
260
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
261
260
|
initialDepositAmount = {
|
|
262
261
|
denom: this.config.denom,
|
|
263
262
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -273,11 +272,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
273
272
|
return [4 /*yield*/, wallet.getAddress()];
|
|
274
273
|
case 1:
|
|
275
274
|
proposer = _a.sent();
|
|
276
|
-
message =
|
|
275
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
277
276
|
content: content,
|
|
278
277
|
initialDeposit: [initialDepositAmount],
|
|
279
278
|
proposer: proposer
|
|
280
279
|
});
|
|
280
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
281
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:
|
|
@@ -292,12 +292,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
292
292
|
FirmaGovService.prototype.getSignedTxSubmitSoftwareUpgradeProposal = function (wallet, title, description, initialDepositFCT, plan, txMisc) {
|
|
293
293
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
294
294
|
return __awaiter(this, void 0, void 0, function () {
|
|
295
|
-
var
|
|
295
|
+
var initialDepositAmount, proposal, content, proposer, message, txClient, error_10;
|
|
296
296
|
return __generator(this, function (_a) {
|
|
297
297
|
switch (_a.label) {
|
|
298
298
|
case 0:
|
|
299
299
|
_a.trys.push([0, 3, , 4]);
|
|
300
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
301
300
|
initialDepositAmount = {
|
|
302
301
|
denom: this.config.denom,
|
|
303
302
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -314,11 +313,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
314
313
|
return [4 /*yield*/, wallet.getAddress()];
|
|
315
314
|
case 1:
|
|
316
315
|
proposer = _a.sent();
|
|
317
|
-
message =
|
|
316
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
318
317
|
content: content,
|
|
319
318
|
initialDeposit: [initialDepositAmount],
|
|
320
319
|
proposer: proposer
|
|
321
320
|
});
|
|
321
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
322
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:
|
|
@@ -333,12 +333,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
333
333
|
FirmaGovService.prototype.getSignedTxSubmitParameterChangeProposal = function (wallet, title, description, initialDepositFCT, paramList, txMisc) {
|
|
334
334
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
335
335
|
return __awaiter(this, void 0, void 0, function () {
|
|
336
|
-
var
|
|
336
|
+
var initialDepositAmount, proposal, content, proposer, message, txClient, error_11;
|
|
337
337
|
return __generator(this, function (_a) {
|
|
338
338
|
switch (_a.label) {
|
|
339
339
|
case 0:
|
|
340
340
|
_a.trys.push([0, 3, , 4]);
|
|
341
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
342
341
|
initialDepositAmount = {
|
|
343
342
|
denom: this.config.denom,
|
|
344
343
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -355,11 +354,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
355
354
|
return [4 /*yield*/, wallet.getAddress()];
|
|
356
355
|
case 1:
|
|
357
356
|
proposer = _a.sent();
|
|
358
|
-
message =
|
|
357
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
359
358
|
content: content,
|
|
360
359
|
initialDeposit: [initialDepositAmount],
|
|
361
360
|
proposer: proposer
|
|
362
361
|
});
|
|
362
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
363
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:
|
|
@@ -374,12 +374,11 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
374
374
|
FirmaGovService.prototype.getSignedTxSubmitCommunityPoolSpendProposal = function (wallet, title, description, initialDepositFCT, amount, recipient, txMisc) {
|
|
375
375
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
376
376
|
return __awaiter(this, void 0, void 0, function () {
|
|
377
|
-
var
|
|
377
|
+
var initialDepositAmount, sendAmount, proposal, content, proposer, message, txClient, error_12;
|
|
378
378
|
return __generator(this, function (_a) {
|
|
379
379
|
switch (_a.label) {
|
|
380
380
|
case 0:
|
|
381
381
|
_a.trys.push([0, 3, , 4]);
|
|
382
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
383
382
|
initialDepositAmount = {
|
|
384
383
|
denom: this.config.denom,
|
|
385
384
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -398,11 +397,12 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
398
397
|
return [4 /*yield*/, wallet.getAddress()];
|
|
399
398
|
case 1:
|
|
400
399
|
proposer = _a.sent();
|
|
401
|
-
message =
|
|
400
|
+
message = gov_1.GovTxClient.msgSubmitProposal({
|
|
402
401
|
content: content,
|
|
403
402
|
initialDeposit: [initialDepositAmount],
|
|
404
403
|
proposer: proposer
|
|
405
404
|
});
|
|
405
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
406
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:
|
|
@@ -579,7 +579,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
579
579
|
case 1:
|
|
580
580
|
voter = _a.sent();
|
|
581
581
|
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
582
|
-
message =
|
|
582
|
+
message = gov_1.GovTxClient.msgVote({ proposalId: proposalId, voter: voter, option: option });
|
|
583
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:
|
|
@@ -618,17 +618,17 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
618
618
|
FirmaGovService.prototype.getSignedTxDeposit = function (wallet, proposalId, amount, txMisc) {
|
|
619
619
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
620
620
|
return __awaiter(this, void 0, void 0, function () {
|
|
621
|
-
var
|
|
621
|
+
var depositor, sendAmount, message, txClient, error_21;
|
|
622
622
|
return __generator(this, function (_a) {
|
|
623
623
|
switch (_a.label) {
|
|
624
624
|
case 0:
|
|
625
625
|
_a.trys.push([0, 3, , 4]);
|
|
626
|
-
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
627
626
|
return [4 /*yield*/, wallet.getAddress()];
|
|
628
627
|
case 1:
|
|
629
628
|
depositor = _a.sent();
|
|
630
629
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount) };
|
|
631
|
-
message =
|
|
630
|
+
message = gov_1.GovTxClient.msgDeposit({ proposalId: proposalId, depositor: depositor, amount: [sendAmount] });
|
|
631
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
632
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:
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FirmaWalletService } from "./FirmaWalletService";
|
|
2
|
+
import { FirmaConfig } from "./FirmaConfig";
|
|
3
|
+
import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
|
|
4
|
+
import { ClientState, IbcTxClient, TxMisc } from "./firmachain/ibc";
|
|
5
|
+
import Long from "long";
|
|
6
|
+
import { Height } from "cosmjs-types/ibc/core/client/v1/client";
|
|
7
|
+
export declare class FirmaIbcService {
|
|
8
|
+
private readonly config;
|
|
9
|
+
constructor(config: FirmaConfig);
|
|
10
|
+
getTxClient(wallet: FirmaWalletService): IbcTxClient;
|
|
11
|
+
getGasEstimationTransfer(wallet: FirmaWalletService, sourcePort: string, sourceChannel: string, denom: string, amount: string, receiver: string, timeoutHeight: Height, timeoutTimestamp: Long, txMisc?: TxMisc): Promise<number>;
|
|
12
|
+
transfer(wallet: FirmaWalletService, sourcePort: string, sourceChannel: string, denom: string, amount: string, receiver: string, timeoutHeight: Height, timeoutTimestamp: Long, txMisc?: TxMisc): Promise<BroadcastTxResponse>;
|
|
13
|
+
private getSignedTxTransfer;
|
|
14
|
+
getClientState(sourceChannel: string, sourcePort: string): Promise<ClientState>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.FirmaIbcService = void 0;
|
|
40
|
+
var FirmaUtil_1 = require("./FirmaUtil");
|
|
41
|
+
var ibc_1 = require("./firmachain/ibc");
|
|
42
|
+
var FirmaIbcService = /** @class */ (function () {
|
|
43
|
+
function FirmaIbcService(config) {
|
|
44
|
+
this.config = config;
|
|
45
|
+
}
|
|
46
|
+
FirmaIbcService.prototype.getTxClient = function (wallet) {
|
|
47
|
+
return new ibc_1.IbcTxClient(wallet, this.config.rpcAddress);
|
|
48
|
+
};
|
|
49
|
+
FirmaIbcService.prototype.getGasEstimationTransfer = function (wallet, sourcePort, sourceChannel, denom, amount, receiver, timeoutHeight, timeoutTimestamp, txMisc) {
|
|
50
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_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.getSignedTxTransfer(wallet, sourcePort, sourceChannel, denom, amount, receiver, timeoutHeight, timeoutTimestamp, 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
|
+
};
|
|
71
|
+
FirmaIbcService.prototype.transfer = function (wallet, sourcePort, sourceChannel, denom, amount, receiver, timeoutHeight, timeoutTimestamp, txMisc) {
|
|
72
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
73
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
var txRaw, bankTxClient, error_2;
|
|
75
|
+
return __generator(this, function (_a) {
|
|
76
|
+
switch (_a.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
_a.trys.push([0, 3, , 4]);
|
|
79
|
+
return [4 /*yield*/, this.getSignedTxTransfer(wallet, sourcePort, sourceChannel, denom, amount, receiver, timeoutHeight, timeoutTimestamp, txMisc)];
|
|
80
|
+
case 1:
|
|
81
|
+
txRaw = _a.sent();
|
|
82
|
+
bankTxClient = new ibc_1.IbcTxClient(wallet, this.config.rpcAddress);
|
|
83
|
+
return [4 /*yield*/, bankTxClient.broadcast(txRaw)];
|
|
84
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
85
|
+
case 3:
|
|
86
|
+
error_2 = _a.sent();
|
|
87
|
+
FirmaUtil_1.FirmaUtil.printLog(error_2);
|
|
88
|
+
throw error_2;
|
|
89
|
+
case 4: return [2 /*return*/];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
FirmaIbcService.prototype.getSignedTxTransfer = function (wallet, sourcePort, sourceChannel, denom, amount, receiver, timeoutHeight, timeoutTimestamp, txMisc) {
|
|
95
|
+
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var address, message, ibcTxClient, error_3;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
_a.trys.push([0, 3, , 4]);
|
|
102
|
+
return [4 /*yield*/, wallet.getAddress()];
|
|
103
|
+
case 1:
|
|
104
|
+
address = _a.sent();
|
|
105
|
+
message = ibc_1.IbcTxClient.msgTransfer({ sourcePort: sourcePort, sourceChannel: sourceChannel, sender: address, receiver: receiver,
|
|
106
|
+
token: { denom: denom, amount: amount },
|
|
107
|
+
timeoutHeight: timeoutHeight, timeoutTimestamp: timeoutTimestamp });
|
|
108
|
+
ibcTxClient = new ibc_1.IbcTxClient(wallet, this.config.rpcAddress);
|
|
109
|
+
return [4 /*yield*/, ibcTxClient.sign([message], FirmaUtil_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
110
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
111
|
+
case 3:
|
|
112
|
+
error_3 = _a.sent();
|
|
113
|
+
FirmaUtil_1.FirmaUtil.printLog(error_3);
|
|
114
|
+
throw error_3;
|
|
115
|
+
case 4: return [2 /*return*/];
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
// query
|
|
121
|
+
FirmaIbcService.prototype.getClientState = function (sourceChannel, sourcePort) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
+
var queryClient, result, error_4;
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
switch (_a.label) {
|
|
126
|
+
case 0:
|
|
127
|
+
_a.trys.push([0, 2, , 3]);
|
|
128
|
+
queryClient = new ibc_1.IbcQueryClient(this.config.restApiAddress);
|
|
129
|
+
return [4 /*yield*/, queryClient.getClientState(sourceChannel, sourcePort)];
|
|
130
|
+
case 1:
|
|
131
|
+
result = _a.sent();
|
|
132
|
+
return [2 /*return*/, result];
|
|
133
|
+
case 2:
|
|
134
|
+
error_4 = _a.sent();
|
|
135
|
+
FirmaUtil_1.FirmaUtil.printLog(error_4);
|
|
136
|
+
throw error_4;
|
|
137
|
+
case 3: return [2 /*return*/];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
return FirmaIbcService;
|
|
143
|
+
}());
|
|
144
|
+
exports.FirmaIbcService = FirmaIbcService;
|
|
@@ -10,6 +10,7 @@ import { FirmaWalletService } from "./FirmaWalletService";
|
|
|
10
10
|
import { FirmaGovService } from "./FirmaGovService";
|
|
11
11
|
import { ChainService } from "./FirmaChainService";
|
|
12
12
|
import { SlashingService } from "./FirmaSlashingService";
|
|
13
|
+
import { FirmaAuthzService } from "./FirmaAuthzService";
|
|
13
14
|
export declare class FirmaMobileSDK {
|
|
14
15
|
Config: FirmaConfig;
|
|
15
16
|
Wallet: FirmaWalletService;
|
|
@@ -23,5 +24,6 @@ export declare class FirmaMobileSDK {
|
|
|
23
24
|
Contract: ContractService;
|
|
24
25
|
BlockChain: ChainService;
|
|
25
26
|
Slashing: SlashingService;
|
|
26
|
-
|
|
27
|
+
Authz: FirmaAuthzService;
|
|
28
|
+
constructor(Config: FirmaConfig, Wallet?: FirmaWalletService, Bank?: FirmaBankService, FeeGrant?: FirmaFeeGrantService, Staking?: FirmaStakingService, Distribution?: FirmaDistributionService, Gov?: FirmaGovService, Nft?: NftService, Token?: TokenService, Contract?: ContractService, BlockChain?: ChainService, Slashing?: SlashingService, Authz?: FirmaAuthzService);
|
|
27
29
|
}
|
|
@@ -13,8 +13,9 @@ var FirmaUtil_1 = require("./FirmaUtil");
|
|
|
13
13
|
var FirmaGovService_1 = require("./FirmaGovService");
|
|
14
14
|
var FirmaChainService_1 = require("./FirmaChainService");
|
|
15
15
|
var FirmaSlashingService_1 = require("./FirmaSlashingService");
|
|
16
|
+
var FirmaAuthzService_1 = require("./FirmaAuthzService");
|
|
16
17
|
var FirmaMobileSDK = /** @class */ (function () {
|
|
17
|
-
function FirmaMobileSDK(Config, Wallet, Bank, FeeGrant, Staking, Distribution, Gov, Nft, Token, Contract, BlockChain, Slashing) {
|
|
18
|
+
function FirmaMobileSDK(Config, Wallet, Bank, FeeGrant, Staking, Distribution, Gov, Nft, Token, Contract, BlockChain, Slashing, Authz) {
|
|
18
19
|
if (Wallet === void 0) { Wallet = new FirmaWalletService_1.FirmaWalletService(Config); }
|
|
19
20
|
if (Bank === void 0) { Bank = new FirmaBankService_1.FirmaBankService(Config); }
|
|
20
21
|
if (FeeGrant === void 0) { FeeGrant = new FirmaFeeGrantService_1.FirmaFeeGrantService(Config); }
|
|
@@ -26,6 +27,7 @@ var FirmaMobileSDK = /** @class */ (function () {
|
|
|
26
27
|
if (Contract === void 0) { Contract = new FirmaContractService_1.ContractService(Config); }
|
|
27
28
|
if (BlockChain === void 0) { BlockChain = new FirmaChainService_1.ChainService(Config); }
|
|
28
29
|
if (Slashing === void 0) { Slashing = new FirmaSlashingService_1.SlashingService(Config); }
|
|
30
|
+
if (Authz === void 0) { Authz = new FirmaAuthzService_1.FirmaAuthzService(Config); }
|
|
29
31
|
this.Config = Config;
|
|
30
32
|
this.Wallet = Wallet;
|
|
31
33
|
this.Bank = Bank;
|
|
@@ -38,6 +40,7 @@ var FirmaMobileSDK = /** @class */ (function () {
|
|
|
38
40
|
this.Contract = Contract;
|
|
39
41
|
this.BlockChain = BlockChain;
|
|
40
42
|
this.Slashing = Slashing;
|
|
43
|
+
this.Authz = Authz;
|
|
41
44
|
FirmaUtil_1.FirmaUtil.config = Config;
|
|
42
45
|
}
|
|
43
46
|
return FirmaMobileSDK;
|
|
@@ -185,7 +185,7 @@ var NftService = /** @class */ (function () {
|
|
|
185
185
|
NftService.prototype.getSignedTxTransfer = function (wallet, toAddress, nftID, txMisc) {
|
|
186
186
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
187
187
|
return __awaiter(this, void 0, void 0, function () {
|
|
188
|
-
var address,
|
|
188
|
+
var address, message, nftTxClient, error_7;
|
|
189
189
|
return __generator(this, function (_a) {
|
|
190
190
|
switch (_a.label) {
|
|
191
191
|
case 0:
|
|
@@ -193,8 +193,8 @@ var NftService = /** @class */ (function () {
|
|
|
193
193
|
return [4 /*yield*/, wallet.getAddress()];
|
|
194
194
|
case 1:
|
|
195
195
|
address = _a.sent();
|
|
196
|
+
message = nft_1.NftTxClient.msgTransfer({ owner: address, toAddress: toAddress, nftId: parseInt(nftID) });
|
|
196
197
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
197
|
-
message = nftTxClient.msgTransfer({ owner: address, toAddress: toAddress, nftId: parseInt(nftID) });
|
|
198
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:
|
|
@@ -254,7 +254,7 @@ var NftService = /** @class */ (function () {
|
|
|
254
254
|
NftService.prototype.getSignedTxBurn = function (wallet, nftID, txMisc) {
|
|
255
255
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
256
256
|
return __awaiter(this, void 0, void 0, function () {
|
|
257
|
-
var address,
|
|
257
|
+
var address, message, nftTxClient, error_10;
|
|
258
258
|
return __generator(this, function (_a) {
|
|
259
259
|
switch (_a.label) {
|
|
260
260
|
case 0:
|
|
@@ -262,8 +262,8 @@ var NftService = /** @class */ (function () {
|
|
|
262
262
|
return [4 /*yield*/, wallet.getAddress()];
|
|
263
263
|
case 1:
|
|
264
264
|
address = _a.sent();
|
|
265
|
+
message = nft_1.NftTxClient.msgBurn({ owner: address, nftId: parseInt(nftID) });
|
|
265
266
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
266
|
-
message = nftTxClient.msgBurn({ owner: address, nftId: parseInt(nftID) });
|
|
267
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:
|
|
@@ -323,7 +323,7 @@ var NftService = /** @class */ (function () {
|
|
|
323
323
|
NftService.prototype.getSignedTxMint = function (wallet, tokenURI, txMisc) {
|
|
324
324
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
325
325
|
return __awaiter(this, void 0, void 0, function () {
|
|
326
|
-
var address,
|
|
326
|
+
var address, message, nftTxClient, error_13;
|
|
327
327
|
return __generator(this, function (_a) {
|
|
328
328
|
switch (_a.label) {
|
|
329
329
|
case 0:
|
|
@@ -331,8 +331,8 @@ var NftService = /** @class */ (function () {
|
|
|
331
331
|
return [4 /*yield*/, wallet.getAddress()];
|
|
332
332
|
case 1:
|
|
333
333
|
address = _a.sent();
|
|
334
|
+
message = nft_1.NftTxClient.msgMint({ owner: address, tokenURI: tokenURI });
|
|
334
335
|
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
335
|
-
message = nftTxClient.msgMint({ owner: address, tokenURI: tokenURI });
|
|
336
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:
|
package/dist/sdk/FirmaSDK.d.ts
CHANGED
|
@@ -11,6 +11,9 @@ import { FirmaWalletService } from "./FirmaWalletService";
|
|
|
11
11
|
import { FirmaGovService } from "./FirmaGovService";
|
|
12
12
|
import { ChainService } from "./FirmaChainService";
|
|
13
13
|
import { SlashingService } from "./FirmaSlashingService";
|
|
14
|
+
import { FirmaAuthzService } from "./FirmaAuthzService";
|
|
15
|
+
import { FirmaCosmWasmService } from "./FirmaCosmWasmService";
|
|
16
|
+
import { FirmaIbcService } from "./FirmaIbcService";
|
|
14
17
|
export declare class FirmaSDK {
|
|
15
18
|
Config: FirmaConfig;
|
|
16
19
|
Wallet: FirmaWalletService;
|
|
@@ -25,5 +28,8 @@ export declare class FirmaSDK {
|
|
|
25
28
|
Ipfs: IpfsService;
|
|
26
29
|
BlockChain: ChainService;
|
|
27
30
|
Slashing: SlashingService;
|
|
28
|
-
|
|
31
|
+
Authz: FirmaAuthzService;
|
|
32
|
+
CosmWasm: FirmaCosmWasmService;
|
|
33
|
+
Ibc: FirmaIbcService;
|
|
34
|
+
constructor(Config: FirmaConfig, Wallet?: FirmaWalletService, Bank?: FirmaBankService, FeeGrant?: FirmaFeeGrantService, Staking?: FirmaStakingService, Distribution?: FirmaDistributionService, Gov?: FirmaGovService, Nft?: NftService, Token?: TokenService, Contract?: ContractService, Ipfs?: IpfsService, BlockChain?: ChainService, Slashing?: SlashingService, Authz?: FirmaAuthzService, CosmWasm?: FirmaCosmWasmService, Ibc?: FirmaIbcService);
|
|
29
35
|
}
|
package/dist/sdk/FirmaSDK.js
CHANGED
|
@@ -14,8 +14,11 @@ var FirmaUtil_1 = require("./FirmaUtil");
|
|
|
14
14
|
var FirmaGovService_1 = require("./FirmaGovService");
|
|
15
15
|
var FirmaChainService_1 = require("./FirmaChainService");
|
|
16
16
|
var FirmaSlashingService_1 = require("./FirmaSlashingService");
|
|
17
|
+
var FirmaAuthzService_1 = require("./FirmaAuthzService");
|
|
18
|
+
var FirmaCosmWasmService_1 = require("./FirmaCosmWasmService");
|
|
19
|
+
var FirmaIbcService_1 = require("./FirmaIbcService");
|
|
17
20
|
var FirmaSDK = /** @class */ (function () {
|
|
18
|
-
function FirmaSDK(Config, Wallet, Bank, FeeGrant, Staking, Distribution, Gov, Nft, Token, Contract, Ipfs, BlockChain, Slashing) {
|
|
21
|
+
function FirmaSDK(Config, Wallet, Bank, FeeGrant, Staking, Distribution, Gov, Nft, Token, Contract, Ipfs, BlockChain, Slashing, Authz, CosmWasm, Ibc) {
|
|
19
22
|
if (Wallet === void 0) { Wallet = new FirmaWalletService_1.FirmaWalletService(Config); }
|
|
20
23
|
if (Bank === void 0) { Bank = new FirmaBankService_1.FirmaBankService(Config); }
|
|
21
24
|
if (FeeGrant === void 0) { FeeGrant = new FirmaFeeGrantService_1.FirmaFeeGrantService(Config); }
|
|
@@ -28,6 +31,9 @@ var FirmaSDK = /** @class */ (function () {
|
|
|
28
31
|
if (Ipfs === void 0) { Ipfs = new FirmaIpfsService_1.IpfsService(Config); }
|
|
29
32
|
if (BlockChain === void 0) { BlockChain = new FirmaChainService_1.ChainService(Config); }
|
|
30
33
|
if (Slashing === void 0) { Slashing = new FirmaSlashingService_1.SlashingService(Config); }
|
|
34
|
+
if (Authz === void 0) { Authz = new FirmaAuthzService_1.FirmaAuthzService(Config); }
|
|
35
|
+
if (CosmWasm === void 0) { CosmWasm = new FirmaCosmWasmService_1.FirmaCosmWasmService(Config); }
|
|
36
|
+
if (Ibc === void 0) { Ibc = new FirmaIbcService_1.FirmaIbcService(Config); }
|
|
31
37
|
this.Config = Config;
|
|
32
38
|
this.Wallet = Wallet;
|
|
33
39
|
this.Bank = Bank;
|
|
@@ -41,6 +47,9 @@ var FirmaSDK = /** @class */ (function () {
|
|
|
41
47
|
this.Ipfs = Ipfs;
|
|
42
48
|
this.BlockChain = BlockChain;
|
|
43
49
|
this.Slashing = Slashing;
|
|
50
|
+
this.Authz = Authz;
|
|
51
|
+
this.CosmWasm = CosmWasm;
|
|
52
|
+
this.Ibc = Ibc;
|
|
44
53
|
FirmaUtil_1.FirmaUtil.config = Config;
|
|
45
54
|
}
|
|
46
55
|
return FirmaSDK;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TxMisc, ValidatorDataType, PoolDataType, ParamsDataType, DelegationInfo, RedelegationInfo, UndelegationInfo } from "./firmachain/staking";
|
|
1
|
+
import { StakingTxClient, TxMisc, ValidatorDataType, PoolDataType, ParamsDataType, DelegationInfo, RedelegationInfo, UndelegationInfo, Pagination } from "./firmachain/staking";
|
|
2
2
|
import { FirmaWalletService } from "./FirmaWalletService";
|
|
3
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
4
|
import { BroadcastTxResponse } from "./firmachain/common/stargateclient";
|
|
@@ -7,6 +7,7 @@ import { MsgCreateValidator } from "cosmjs-types/cosmos/staking/v1beta1/tx";
|
|
|
7
7
|
export declare class FirmaStakingService {
|
|
8
8
|
private readonly config;
|
|
9
9
|
constructor(config: FirmaConfig);
|
|
10
|
+
getTxClient(wallet: FirmaWalletService): StakingTxClient;
|
|
10
11
|
getGasEstimationDelegate(wallet: FirmaWalletService, validatorAddres: string, amount: number, txMisc?: TxMisc): Promise<number>;
|
|
11
12
|
getGasEstimationUndelegate(wallet: FirmaWalletService, validatorAddres: string, amount: number, txMisc?: TxMisc): Promise<number>;
|
|
12
13
|
getGasEstimationRedelegate(wallet: FirmaWalletService, validatorSrcAddress: string, validatorDstAddress: string, amount: number, txMisc?: TxMisc): Promise<number>;
|
|
@@ -24,11 +25,23 @@ export declare class FirmaStakingService {
|
|
|
24
25
|
getDelegationInfoFromValidator(address: string, validatorAddress: string): Promise<DelegationInfo>;
|
|
25
26
|
getTotalUndelegateInfo(address: string): Promise<UndelegationInfo[]>;
|
|
26
27
|
getTotalRedelegationInfo(address: string): Promise<RedelegationInfo[]>;
|
|
27
|
-
getUndelegationListFromValidator(valoperAddress: string): Promise<
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
getUndelegationListFromValidator(valoperAddress: string, paginationKey?: string): Promise<{
|
|
29
|
+
dataList: UndelegationInfo[];
|
|
30
|
+
pagination: Pagination;
|
|
31
|
+
}>;
|
|
32
|
+
getDelegationListFromValidator(valoperAddress: string, paginationKey?: string): Promise<{
|
|
33
|
+
dataList: DelegationInfo[];
|
|
34
|
+
pagination: Pagination;
|
|
35
|
+
}>;
|
|
36
|
+
getTotalDelegationInfo(address: string, paginationKey?: string): Promise<{
|
|
37
|
+
dataList: DelegationInfo[];
|
|
38
|
+
pagination: Pagination;
|
|
39
|
+
}>;
|
|
30
40
|
getParams(): Promise<ParamsDataType>;
|
|
31
41
|
getPool(): Promise<PoolDataType>;
|
|
32
42
|
getValidator(valoperAddress: string): Promise<ValidatorDataType>;
|
|
33
|
-
getValidatorList(): Promise<
|
|
43
|
+
getValidatorList(paginationKey?: string): Promise<{
|
|
44
|
+
dataList: ValidatorDataType[];
|
|
45
|
+
pagination: Pagination;
|
|
46
|
+
}>;
|
|
34
47
|
}
|