@firmachain/firma-js 0.3.8 → 0.4.0-beta2
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/sdk/FirmaAuthzService.js +20 -15
- package/dist/sdk/FirmaBankService.d.ts +1 -1
- package/dist/sdk/FirmaBankService.js +5 -4
- package/dist/sdk/FirmaConfig.js +4 -4
- package/dist/sdk/FirmaContractService.js +10 -8
- package/dist/sdk/FirmaDistributionService.js +20 -15
- package/dist/sdk/FirmaFeeGrantService.d.ts +0 -1
- package/dist/sdk/FirmaFeeGrantService.js +12 -14
- package/dist/sdk/FirmaGovService.d.ts +14 -0
- package/dist/sdk/FirmaGovService.js +58 -37
- package/dist/sdk/FirmaIbcService.js +4 -3
- package/dist/sdk/FirmaNftService.d.ts +3 -3
- package/dist/sdk/FirmaNftService.js +13 -10
- package/dist/sdk/FirmaStakingService.d.ts +4 -0
- package/dist/sdk/FirmaStakingService.js +58 -33
- package/dist/sdk/FirmaTokenService.js +17 -14
- package/dist/sdk/FirmaUtil.js +1 -1
- package/dist/sdk/FirmaWalletService.d.ts +1 -1
- package/dist/sdk/FirmaWalletService.js +11 -23
- package/dist/sdk/firmachain/authz/AuthzTxClient.js +2 -0
- package/dist/sdk/firmachain/bank/BankTxClient.js +1 -1
- package/dist/sdk/firmachain/common/CommonTxClient.js +3 -1
- package/dist/sdk/firmachain/common/FirmaLedger.d.ts +49 -0
- package/dist/sdk/firmachain/common/FirmaLedger.js +301 -0
- package/dist/sdk/firmachain/common/ITxClient.d.ts +1 -1
- package/dist/sdk/firmachain/common/ITxClient.js +6 -4
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +5 -13
- package/dist/sdk/firmachain/common/LedgerWallet.js +1266 -124
- package/dist/sdk/firmachain/common/SigningProtobufStargateClient.js +3 -4
- package/dist/sdk/firmachain/common/SigningStargateClient.d.ts +2 -3
- package/dist/sdk/firmachain/common/SigningStargateClient.js +7 -10
- package/dist/sdk/firmachain/common/index.d.ts +1 -0
- package/dist/sdk/firmachain/common/index.js +1 -0
- package/dist/sdk/firmachain/common/signing.d.ts +4 -10
- package/dist/sdk/firmachain/common/signing.js +13 -60
- package/dist/sdk/firmachain/contract/ContractTxClient.js +1 -1
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +54 -8
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +1 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +3 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +1 -2
- package/dist/sdk/firmachain/google/protobuf/any.js +0 -12
- package/dist/sdk/firmachain/gov/GovTxClient.js +3 -0
- package/dist/sdk/firmachain/nft/NftTxClient.js +1 -1
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +15 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +109 -0
- package/dist/sdk/firmachain/token/TokenTxClient.js +1 -1
- package/package.json +18 -9
- package/dist/test/00.wallet.test.d.ts +0 -1
- package/dist/test/00.wallet.test.js +0 -96
- package/dist/test/01.contract_tx.test.d.ts +0 -1
- package/dist/test/01.contract_tx.test.js +0 -157
- package/dist/test/02.contract_query.test.d.ts +0 -1
- package/dist/test/02.contract_query.test.js +0 -245
- package/dist/test/03.contract_scenario.test.d.ts +0 -1
- package/dist/test/03.contract_scenario.test.js +0 -406
- package/dist/test/04.bank_tx.test.d.ts +0 -1
- package/dist/test/04.bank_tx.test.js +0 -126
- package/dist/test/05.bank_query.test.d.ts +0 -1
- package/dist/test/05.bank_query.test.js +0 -162
- package/dist/test/06.feegrant_tx.test.d.ts +0 -1
- package/dist/test/06.feegrant_tx.test.js +0 -185
- package/dist/test/07.feegrant_query.test.d.ts +0 -1
- package/dist/test/07.feegrant_query.test.js +0 -129
- package/dist/test/08.gas_estimate.test.d.ts +0 -1
- package/dist/test/08.gas_estimate.test.js +0 -728
- package/dist/test/09.ipfs.test.d.ts +0 -1
- package/dist/test/09.ipfs.test.js +0 -72
- package/dist/test/10.nft_tx.test.d.ts +0 -1
- package/dist/test/10.nft_tx.test.js +0 -209
- package/dist/test/11.nft_query.test.d.ts +0 -1
- package/dist/test/11.nft_query.test.js +0 -165
- package/dist/test/12.staking_tx.test.d.ts +0 -1
- package/dist/test/12.staking_tx.test.js +0 -211
- package/dist/test/13.staking_query.test.d.ts +0 -1
- package/dist/test/13.staking_query.test.js +0 -275
- package/dist/test/14.distribution_tx.test.d.ts +0 -1
- package/dist/test/14.distribution_tx.test.js +0 -170
- package/dist/test/15.distribution_query.test.d.ts +0 -1
- package/dist/test/15.distribution_query.test.js +0 -243
- package/dist/test/16.gov_tx.test.d.ts +0 -1
- package/dist/test/16.gov_tx.test.js +0 -394
- package/dist/test/17.gov_query.test.d.ts +0 -1
- package/dist/test/17.gov_query.test.js +0 -181
- package/dist/test/18.util.test.d.ts +0 -1
- package/dist/test/18.util.test.js +0 -354
- package/dist/test/19.chain.test.d.ts +0 -1
- package/dist/test/19.chain.test.js +0 -127
- package/dist/test/20.slashing_query.test.d.ts +0 -1
- package/dist/test/20.slashing_query.test.js +0 -111
- package/dist/test/21.token_tx.test.d.ts +0 -1
- package/dist/test/21.token_tx.test.js +0 -149
- package/dist/test/22.token_query.test.d.ts +0 -1
- package/dist/test/22.token_query.test.js +0 -103
- package/dist/test/23.authz_tx.test.d.ts +0 -1
- package/dist/test/23.authz_tx.test.js +0 -380
- package/dist/test/24.authz_query.test.d.ts +0 -1
- package/dist/test/24.authz_query.test.js +0 -202
- package/dist/test/25.cosmwasm_tx.test.d.ts +0 -1
- package/dist/test/25.cosmwasm_tx.test.js +0 -229
- package/dist/test/26.cosmwasm_query.test.d.ts +0 -1
- package/dist/test/26.cosmwasm_query.test.js +0 -275
- package/dist/test/27.arbitrary_sign.test.d.ts +0 -1
- package/dist/test/27.arbitrary_sign.test.js +0 -162
- package/dist/test/28.ibc_tx.test.d.ts +0 -1
- package/dist/test/28.ibc_tx.test.js +0 -98
- package/dist/test/29.mint_query.test.d.ts +0 -1
- package/dist/test/29.mint_query.test.js +0 -59
- package/dist/test/30.cw20_tx.test.d.ts +0 -1
- package/dist/test/30.cw20_tx.test.js +0 -450
- package/dist/test/31.cw20_query.test.d.ts +0 -1
- package/dist/test/31.cw20_query.test.js +0 -333
- package/dist/test/32.cw721_tx.test.d.ts +0 -1
- package/dist/test/32.cw721_tx.test.js +0 -431
- package/dist/test/33.cw721_query.test.d.ts +0 -1
- package/dist/test/33.cw721_query.test.js +0 -371
- package/dist/test/34.cw_bridge_tx.test.d.ts +0 -1
- package/dist/test/34.cw_bridge_tx.test.js +0 -476
- package/dist/test/35.cw_bridge_tx_low.test.d.ts +0 -1
- package/dist/test/35.cw_bridge_tx_low.test.js +0 -398
- package/dist/test/36.cw_bridge_query.test.d.ts +0 -1
- package/dist/test/36.cw_bridge_query.test.js +0 -318
- package/dist/test/37.cw_marketplace_tx.test.d.ts +0 -1
- package/dist/test/37.cw_marketplace_tx.test.js +0 -794
- package/dist/test/38.cw_marketplace_query.test.d.ts +0 -1
- package/dist/test/38.cw_marketplace_query.test.js +0 -128
- package/dist/test/config_test.d.ts +0 -11
- package/dist/test/config_test.js +0 -26
- package/dist/test/config_test.sample.d.ts +0 -11
- package/dist/test/config_test.sample.js +0 -14
|
@@ -61,7 +61,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
61
61
|
switch (_a.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
_a.trys.push([0, 3, , 4]);
|
|
64
|
-
return [4 /*yield*/, this.getSignedTxDelegate(wallet, validatorAddres, amount, txMisc)];
|
|
64
|
+
return [4 /*yield*/, this.getSignedTxDelegate(wallet, validatorAddres, amount, txMisc, true)];
|
|
65
65
|
case 1:
|
|
66
66
|
txRaw = _a.sent();
|
|
67
67
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -83,7 +83,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
83
83
|
switch (_a.label) {
|
|
84
84
|
case 0:
|
|
85
85
|
_a.trys.push([0, 3, , 4]);
|
|
86
|
-
return [4 /*yield*/, this.getSignedTxUndelegate(wallet, validatorAddres, amount, txMisc)];
|
|
86
|
+
return [4 /*yield*/, this.getSignedTxUndelegate(wallet, validatorAddres, amount, txMisc, true)];
|
|
87
87
|
case 1:
|
|
88
88
|
txRaw = _a.sent();
|
|
89
89
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -105,7 +105,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
105
105
|
switch (_a.label) {
|
|
106
106
|
case 0:
|
|
107
107
|
_a.trys.push([0, 3, , 4]);
|
|
108
|
-
return [4 /*yield*/, this.getSignedTxRedelegate(wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc)];
|
|
108
|
+
return [4 /*yield*/, this.getSignedTxRedelegate(wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc, true)];
|
|
109
109
|
case 1:
|
|
110
110
|
txRaw = _a.sent();
|
|
111
111
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -119,8 +119,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
119
119
|
});
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
|
-
FirmaStakingService.prototype.getSignedTxDelegate = function (wallet, validatorAddres, amount, txMisc) {
|
|
122
|
+
FirmaStakingService.prototype.getSignedTxDelegate = function (wallet, validatorAddres, amount, txMisc, simulate) {
|
|
123
123
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
124
|
+
if (simulate === void 0) { simulate = false; }
|
|
124
125
|
return __awaiter(this, void 0, void 0, function () {
|
|
125
126
|
var txClient, address, sendAmount, message, error_4;
|
|
126
127
|
return __generator(this, function (_a) {
|
|
@@ -137,7 +138,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
137
138
|
validatorAddress: validatorAddres,
|
|
138
139
|
amount: sendAmount
|
|
139
140
|
});
|
|
140
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
141
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
141
142
|
case 2: return [2 /*return*/, _a.sent()];
|
|
142
143
|
case 3:
|
|
143
144
|
error_4 = _a.sent();
|
|
@@ -148,8 +149,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
148
149
|
});
|
|
149
150
|
});
|
|
150
151
|
};
|
|
151
|
-
FirmaStakingService.prototype.getSignedTxUndelegate = function (wallet, validatorAddres, amount, txMisc) {
|
|
152
|
+
FirmaStakingService.prototype.getSignedTxUndelegate = function (wallet, validatorAddres, amount, txMisc, simulate) {
|
|
152
153
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
154
|
+
if (simulate === void 0) { simulate = false; }
|
|
153
155
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
156
|
var txClient, address, sendAmount, message, error_5;
|
|
155
157
|
return __generator(this, function (_a) {
|
|
@@ -166,7 +168,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
166
168
|
validatorAddress: validatorAddres,
|
|
167
169
|
amount: sendAmount
|
|
168
170
|
});
|
|
169
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
171
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
170
172
|
case 2: return [2 /*return*/, _a.sent()];
|
|
171
173
|
case 3:
|
|
172
174
|
error_5 = _a.sent();
|
|
@@ -177,8 +179,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
177
179
|
});
|
|
178
180
|
});
|
|
179
181
|
};
|
|
180
|
-
FirmaStakingService.prototype.getSignedTxRedelegate = function (wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc) {
|
|
182
|
+
FirmaStakingService.prototype.getSignedTxRedelegate = function (wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc, simulate) {
|
|
181
183
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
184
|
+
if (simulate === void 0) { simulate = false; }
|
|
182
185
|
return __awaiter(this, void 0, void 0, function () {
|
|
183
186
|
var txClient, address, sendAmount, message, error_6;
|
|
184
187
|
return __generator(this, function (_a) {
|
|
@@ -196,7 +199,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
196
199
|
validatorDstAddress: validatorDstAddress,
|
|
197
200
|
amount: sendAmount
|
|
198
201
|
});
|
|
199
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
202
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
200
203
|
case 2: return [2 /*return*/, _a.sent()];
|
|
201
204
|
case 3:
|
|
202
205
|
error_6 = _a.sent();
|
|
@@ -462,7 +465,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
462
465
|
});
|
|
463
466
|
});
|
|
464
467
|
};
|
|
465
|
-
FirmaStakingService.prototype.
|
|
468
|
+
FirmaStakingService.prototype.getRedelegationListFromValidator = function (valoperAddress, paginationKey) {
|
|
466
469
|
if (paginationKey === void 0) { paginationKey = ""; }
|
|
467
470
|
return __awaiter(this, void 0, void 0, function () {
|
|
468
471
|
var queryClient, result, error_18;
|
|
@@ -471,7 +474,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
471
474
|
case 0:
|
|
472
475
|
_a.trys.push([0, 2, , 3]);
|
|
473
476
|
queryClient = new staking_1.StakingQueryClient(this.config.restApiAddress);
|
|
474
|
-
return [4 /*yield*/, queryClient.
|
|
477
|
+
return [4 /*yield*/, queryClient.queryGetRedelegationListFromValidator(valoperAddress, paginationKey)];
|
|
475
478
|
case 1:
|
|
476
479
|
result = _a.sent();
|
|
477
480
|
return [2 /*return*/, result];
|
|
@@ -484,7 +487,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
484
487
|
});
|
|
485
488
|
});
|
|
486
489
|
};
|
|
487
|
-
FirmaStakingService.prototype.
|
|
490
|
+
FirmaStakingService.prototype.getUndelegationListFromValidator = function (valoperAddress, paginationKey) {
|
|
488
491
|
if (paginationKey === void 0) { paginationKey = ""; }
|
|
489
492
|
return __awaiter(this, void 0, void 0, function () {
|
|
490
493
|
var queryClient, result, error_19;
|
|
@@ -493,7 +496,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
493
496
|
case 0:
|
|
494
497
|
_a.trys.push([0, 2, , 3]);
|
|
495
498
|
queryClient = new staking_1.StakingQueryClient(this.config.restApiAddress);
|
|
496
|
-
return [4 /*yield*/, queryClient.
|
|
499
|
+
return [4 /*yield*/, queryClient.queryGetUndelegationListFromValidator(valoperAddress, paginationKey)];
|
|
497
500
|
case 1:
|
|
498
501
|
result = _a.sent();
|
|
499
502
|
return [2 /*return*/, result];
|
|
@@ -506,7 +509,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
506
509
|
});
|
|
507
510
|
});
|
|
508
511
|
};
|
|
509
|
-
FirmaStakingService.prototype.
|
|
512
|
+
FirmaStakingService.prototype.getDelegationListFromValidator = function (valoperAddress, paginationKey) {
|
|
510
513
|
if (paginationKey === void 0) { paginationKey = ""; }
|
|
511
514
|
return __awaiter(this, void 0, void 0, function () {
|
|
512
515
|
var queryClient, result, error_20;
|
|
@@ -515,7 +518,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
515
518
|
case 0:
|
|
516
519
|
_a.trys.push([0, 2, , 3]);
|
|
517
520
|
queryClient = new staking_1.StakingQueryClient(this.config.restApiAddress);
|
|
518
|
-
return [4 /*yield*/, queryClient.
|
|
521
|
+
return [4 /*yield*/, queryClient.queryGetDelegateListFromValidator(valoperAddress, paginationKey)];
|
|
519
522
|
case 1:
|
|
520
523
|
result = _a.sent();
|
|
521
524
|
return [2 /*return*/, result];
|
|
@@ -528,7 +531,8 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
528
531
|
});
|
|
529
532
|
});
|
|
530
533
|
};
|
|
531
|
-
FirmaStakingService.prototype.
|
|
534
|
+
FirmaStakingService.prototype.getTotalDelegationInfo = function (address, paginationKey) {
|
|
535
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
532
536
|
return __awaiter(this, void 0, void 0, function () {
|
|
533
537
|
var queryClient, result, error_21;
|
|
534
538
|
return __generator(this, function (_a) {
|
|
@@ -536,7 +540,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
536
540
|
case 0:
|
|
537
541
|
_a.trys.push([0, 2, , 3]);
|
|
538
542
|
queryClient = new staking_1.StakingQueryClient(this.config.restApiAddress);
|
|
539
|
-
return [4 /*yield*/, queryClient.
|
|
543
|
+
return [4 /*yield*/, queryClient.queryGetTotalDelegationInfo(address, paginationKey)];
|
|
540
544
|
case 1:
|
|
541
545
|
result = _a.sent();
|
|
542
546
|
return [2 /*return*/, result];
|
|
@@ -549,9 +553,30 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
549
553
|
});
|
|
550
554
|
});
|
|
551
555
|
};
|
|
552
|
-
FirmaStakingService.prototype.
|
|
556
|
+
FirmaStakingService.prototype.getParams = function () {
|
|
553
557
|
return __awaiter(this, void 0, void 0, function () {
|
|
554
558
|
var queryClient, result, error_22;
|
|
559
|
+
return __generator(this, function (_a) {
|
|
560
|
+
switch (_a.label) {
|
|
561
|
+
case 0:
|
|
562
|
+
_a.trys.push([0, 2, , 3]);
|
|
563
|
+
queryClient = new staking_1.StakingQueryClient(this.config.restApiAddress);
|
|
564
|
+
return [4 /*yield*/, queryClient.queryGetParams()];
|
|
565
|
+
case 1:
|
|
566
|
+
result = _a.sent();
|
|
567
|
+
return [2 /*return*/, result];
|
|
568
|
+
case 2:
|
|
569
|
+
error_22 = _a.sent();
|
|
570
|
+
FirmaUtil_1.FirmaUtil.printLog(error_22);
|
|
571
|
+
throw error_22;
|
|
572
|
+
case 3: return [2 /*return*/];
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
});
|
|
576
|
+
};
|
|
577
|
+
FirmaStakingService.prototype.getParamsAsStakingParams = function () {
|
|
578
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
579
|
+
var queryClient, result, error_23;
|
|
555
580
|
return __generator(this, function (_a) {
|
|
556
581
|
switch (_a.label) {
|
|
557
582
|
case 0:
|
|
@@ -569,9 +594,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
569
594
|
minCommissionRate: result.min_commission_rate
|
|
570
595
|
}];
|
|
571
596
|
case 2:
|
|
572
|
-
|
|
573
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
574
|
-
throw
|
|
597
|
+
error_23 = _a.sent();
|
|
598
|
+
FirmaUtil_1.FirmaUtil.printLog(error_23);
|
|
599
|
+
throw error_23;
|
|
575
600
|
case 3: return [2 /*return*/];
|
|
576
601
|
}
|
|
577
602
|
});
|
|
@@ -579,7 +604,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
579
604
|
};
|
|
580
605
|
FirmaStakingService.prototype.getPool = function () {
|
|
581
606
|
return __awaiter(this, void 0, void 0, function () {
|
|
582
|
-
var queryClient, result,
|
|
607
|
+
var queryClient, result, error_24;
|
|
583
608
|
return __generator(this, function (_a) {
|
|
584
609
|
switch (_a.label) {
|
|
585
610
|
case 0:
|
|
@@ -590,9 +615,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
590
615
|
result = _a.sent();
|
|
591
616
|
return [2 /*return*/, result];
|
|
592
617
|
case 2:
|
|
593
|
-
|
|
594
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
595
|
-
throw
|
|
618
|
+
error_24 = _a.sent();
|
|
619
|
+
FirmaUtil_1.FirmaUtil.printLog(error_24);
|
|
620
|
+
throw error_24;
|
|
596
621
|
case 3: return [2 /*return*/];
|
|
597
622
|
}
|
|
598
623
|
});
|
|
@@ -600,7 +625,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
600
625
|
};
|
|
601
626
|
FirmaStakingService.prototype.getValidator = function (valoperAddress) {
|
|
602
627
|
return __awaiter(this, void 0, void 0, function () {
|
|
603
|
-
var queryClient, result,
|
|
628
|
+
var queryClient, result, error_25;
|
|
604
629
|
return __generator(this, function (_a) {
|
|
605
630
|
switch (_a.label) {
|
|
606
631
|
case 0:
|
|
@@ -611,9 +636,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
611
636
|
result = _a.sent();
|
|
612
637
|
return [2 /*return*/, result];
|
|
613
638
|
case 2:
|
|
614
|
-
|
|
615
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
616
|
-
throw
|
|
639
|
+
error_25 = _a.sent();
|
|
640
|
+
FirmaUtil_1.FirmaUtil.printLog(error_25);
|
|
641
|
+
throw error_25;
|
|
617
642
|
case 3: return [2 /*return*/];
|
|
618
643
|
}
|
|
619
644
|
});
|
|
@@ -623,7 +648,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
623
648
|
if (status === void 0) { status = StakingValidatorStatus.ALL; }
|
|
624
649
|
if (paginationKey === void 0) { paginationKey = ""; }
|
|
625
650
|
return __awaiter(this, void 0, void 0, function () {
|
|
626
|
-
var queryClient, result,
|
|
651
|
+
var queryClient, result, error_26;
|
|
627
652
|
return __generator(this, function (_a) {
|
|
628
653
|
switch (_a.label) {
|
|
629
654
|
case 0:
|
|
@@ -634,9 +659,9 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
634
659
|
result = _a.sent();
|
|
635
660
|
return [2 /*return*/, result];
|
|
636
661
|
case 2:
|
|
637
|
-
|
|
638
|
-
FirmaUtil_1.FirmaUtil.printLog(
|
|
639
|
-
throw
|
|
662
|
+
error_26 = _a.sent();
|
|
663
|
+
FirmaUtil_1.FirmaUtil.printLog(error_26);
|
|
664
|
+
throw error_26;
|
|
640
665
|
case 3: return [2 /*return*/];
|
|
641
666
|
}
|
|
642
667
|
});
|
|
@@ -52,7 +52,7 @@ var TokenService = /** @class */ (function () {
|
|
|
52
52
|
case 0:
|
|
53
53
|
_a.trys.push([0, 3, , 4]);
|
|
54
54
|
newTotalSupply = FirmaUtil_1.FirmaUtil.getUTokenFromToken(totalSupply, decimal);
|
|
55
|
-
return [4 /*yield*/, this.getSignedTxCreateToken(wallet, tokenName, tokenSymbol, tokenURI, newTotalSupply, decimal, isMintable, isBurnable, txMisc)];
|
|
55
|
+
return [4 /*yield*/, this.getSignedTxCreateToken(wallet, tokenName, tokenSymbol, tokenURI, newTotalSupply, decimal, isMintable, isBurnable, txMisc, true)];
|
|
56
56
|
case 1:
|
|
57
57
|
txRaw = _a.sent();
|
|
58
58
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -69,13 +69,12 @@ var TokenService = /** @class */ (function () {
|
|
|
69
69
|
TokenService.prototype.getGasEstimationMint = function (wallet, tokenID, amount, decimal, toAddress, txMisc) {
|
|
70
70
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
71
71
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
-
var
|
|
72
|
+
var txRaw, error_2;
|
|
73
73
|
return __generator(this, function (_a) {
|
|
74
74
|
switch (_a.label) {
|
|
75
75
|
case 0:
|
|
76
76
|
_a.trys.push([0, 3, , 4]);
|
|
77
|
-
|
|
78
|
-
return [4 /*yield*/, this.getSignedTxMint(wallet, tokenID, amount, toAddress, txMisc)];
|
|
77
|
+
return [4 /*yield*/, this.getSignedTxMint(wallet, tokenID, amount, toAddress, txMisc, true)];
|
|
79
78
|
case 1:
|
|
80
79
|
txRaw = _a.sent();
|
|
81
80
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -98,7 +97,7 @@ var TokenService = /** @class */ (function () {
|
|
|
98
97
|
case 0:
|
|
99
98
|
_a.trys.push([0, 3, , 4]);
|
|
100
99
|
newAmount = FirmaUtil_1.FirmaUtil.getUTokenFromToken(amount, decimal);
|
|
101
|
-
return [4 /*yield*/, this.getSignedTxBurn(wallet, tokenID, newAmount, txMisc)];
|
|
100
|
+
return [4 /*yield*/, this.getSignedTxBurn(wallet, tokenID, newAmount, txMisc, true)];
|
|
102
101
|
case 1:
|
|
103
102
|
txRaw = _a.sent();
|
|
104
103
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -120,7 +119,7 @@ var TokenService = /** @class */ (function () {
|
|
|
120
119
|
switch (_a.label) {
|
|
121
120
|
case 0:
|
|
122
121
|
_a.trys.push([0, 3, , 4]);
|
|
123
|
-
return [4 /*yield*/, this.getSignedTxUpdateTokenURI(wallet, tokenID, tokenURI, txMisc)];
|
|
122
|
+
return [4 /*yield*/, this.getSignedTxUpdateTokenURI(wallet, tokenID, tokenURI, txMisc, true)];
|
|
124
123
|
case 1:
|
|
125
124
|
txRaw = _a.sent();
|
|
126
125
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.estimateGas(txRaw)];
|
|
@@ -134,8 +133,9 @@ var TokenService = /** @class */ (function () {
|
|
|
134
133
|
});
|
|
135
134
|
});
|
|
136
135
|
};
|
|
137
|
-
TokenService.prototype.getSignedTxUpdateTokenURI = function (wallet, tokenID, tokenURI, txMisc) {
|
|
136
|
+
TokenService.prototype.getSignedTxUpdateTokenURI = function (wallet, tokenID, tokenURI, txMisc, simulate) {
|
|
138
137
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
138
|
+
if (simulate === void 0) { simulate = false; }
|
|
139
139
|
return __awaiter(this, void 0, void 0, function () {
|
|
140
140
|
var address, message, txClient, error_5;
|
|
141
141
|
return __generator(this, function (_a) {
|
|
@@ -151,7 +151,7 @@ var TokenService = /** @class */ (function () {
|
|
|
151
151
|
tokenURI: tokenURI
|
|
152
152
|
});
|
|
153
153
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
154
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
154
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
155
155
|
case 2: return [2 /*return*/, _a.sent()];
|
|
156
156
|
case 3:
|
|
157
157
|
error_5 = _a.sent();
|
|
@@ -162,8 +162,9 @@ var TokenService = /** @class */ (function () {
|
|
|
162
162
|
});
|
|
163
163
|
});
|
|
164
164
|
};
|
|
165
|
-
TokenService.prototype.getSignedTxBurn = function (wallet, tokenID, amount, txMisc) {
|
|
165
|
+
TokenService.prototype.getSignedTxBurn = function (wallet, tokenID, amount, txMisc, simulate) {
|
|
166
166
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
167
|
+
if (simulate === void 0) { simulate = false; }
|
|
167
168
|
return __awaiter(this, void 0, void 0, function () {
|
|
168
169
|
var address, message, txClient, error_6;
|
|
169
170
|
return __generator(this, function (_a) {
|
|
@@ -179,7 +180,7 @@ var TokenService = /** @class */ (function () {
|
|
|
179
180
|
amount: amount
|
|
180
181
|
});
|
|
181
182
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
182
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
183
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
183
184
|
case 2: return [2 /*return*/, _a.sent()];
|
|
184
185
|
case 3:
|
|
185
186
|
error_6 = _a.sent();
|
|
@@ -190,8 +191,9 @@ var TokenService = /** @class */ (function () {
|
|
|
190
191
|
});
|
|
191
192
|
});
|
|
192
193
|
};
|
|
193
|
-
TokenService.prototype.getSignedTxMint = function (wallet, tokenID, amount, toAddress, txMisc) {
|
|
194
|
+
TokenService.prototype.getSignedTxMint = function (wallet, tokenID, amount, toAddress, txMisc, simulate) {
|
|
194
195
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
196
|
+
if (simulate === void 0) { simulate = false; }
|
|
195
197
|
return __awaiter(this, void 0, void 0, function () {
|
|
196
198
|
var address, message, txClient, error_7;
|
|
197
199
|
return __generator(this, function (_a) {
|
|
@@ -208,7 +210,7 @@ var TokenService = /** @class */ (function () {
|
|
|
208
210
|
toAddress: toAddress
|
|
209
211
|
});
|
|
210
212
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
211
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
213
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
212
214
|
case 2: return [2 /*return*/, _a.sent()];
|
|
213
215
|
case 3:
|
|
214
216
|
error_7 = _a.sent();
|
|
@@ -219,8 +221,9 @@ var TokenService = /** @class */ (function () {
|
|
|
219
221
|
});
|
|
220
222
|
});
|
|
221
223
|
};
|
|
222
|
-
TokenService.prototype.getSignedTxCreateToken = function (wallet, tokenName, tokenSymbol, tokenURI, totalSupply, decimal, isMintable, isBurnable, txMisc) {
|
|
224
|
+
TokenService.prototype.getSignedTxCreateToken = function (wallet, tokenName, tokenSymbol, tokenURI, totalSupply, decimal, isMintable, isBurnable, txMisc, simulate) {
|
|
223
225
|
if (txMisc === void 0) { txMisc = FirmaUtil_1.DefaultTxMisc; }
|
|
226
|
+
if (simulate === void 0) { simulate = false; }
|
|
224
227
|
return __awaiter(this, void 0, void 0, function () {
|
|
225
228
|
var address, message, txClient, error_8;
|
|
226
229
|
return __generator(this, function (_a) {
|
|
@@ -241,7 +244,7 @@ var TokenService = /** @class */ (function () {
|
|
|
241
244
|
burnable: isBurnable
|
|
242
245
|
});
|
|
243
246
|
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
244
|
-
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc))];
|
|
247
|
+
return [4 /*yield*/, txClient.sign([message], (0, FirmaUtil_1.getSignAndBroadcastOption)(this.config.denom, txMisc), simulate)];
|
|
245
248
|
case 2: return [2 /*return*/, _a.sent()];
|
|
246
249
|
case 3:
|
|
247
250
|
error_8 = _a.sent();
|
package/dist/sdk/FirmaUtil.js
CHANGED
|
@@ -343,7 +343,7 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
343
343
|
return [4 /*yield*/, wallet.getAddress()];
|
|
344
344
|
case 2:
|
|
345
345
|
address = _a.sent();
|
|
346
|
-
dataBytes =
|
|
346
|
+
dataBytes = new TextEncoder().encode(data);
|
|
347
347
|
return [4 /*yield*/, client.experimentalAdr36Sign(address, dataBytes)];
|
|
348
348
|
case 3: return [2 /*return*/, _a.sent()];
|
|
349
349
|
case 4:
|
|
@@ -32,5 +32,5 @@ export declare class FirmaWalletService {
|
|
|
32
32
|
generateMnemonic(): Promise<string>;
|
|
33
33
|
isLedger(): boolean;
|
|
34
34
|
initFromLedger(ledger: LedgerWalletInterface): Promise<FirmaWalletService>;
|
|
35
|
-
signLedger(messages: EncodeObject[], option: SignAndBroadcastOptions, registry: Registry): Promise<TxRaw>;
|
|
35
|
+
signLedger(messages: EncodeObject[], option: SignAndBroadcastOptions, registry: Registry, simulate?: boolean): Promise<TxRaw>;
|
|
36
36
|
}
|
|
@@ -177,7 +177,7 @@ var FirmaWalletService = /** @class */ (function () {
|
|
|
177
177
|
switch (_b.label) {
|
|
178
178
|
case 0:
|
|
179
179
|
_b.trys.push([0, 2, , 3]);
|
|
180
|
-
tempPrivateKey = Buffer.from(privateKey.replace("0x", ""), "hex");
|
|
180
|
+
tempPrivateKey = new Uint8Array(Buffer.from(privateKey.replace("0x", ""), "hex"));
|
|
181
181
|
_a = this;
|
|
182
182
|
return [4 /*yield*/, proto_signing_1.DirectSecp256k1Wallet.fromKey(tempPrivateKey, this.getPrefix())];
|
|
183
183
|
case 1:
|
|
@@ -319,9 +319,10 @@ var FirmaWalletService = /** @class */ (function () {
|
|
|
319
319
|
});
|
|
320
320
|
});
|
|
321
321
|
};
|
|
322
|
-
FirmaWalletService.prototype.signLedger = function (messages, option, registry) {
|
|
322
|
+
FirmaWalletService.prototype.signLedger = function (messages, option, registry, simulate) {
|
|
323
|
+
if (simulate === void 0) { simulate = false; }
|
|
323
324
|
return __awaiter(this, void 0, void 0, function () {
|
|
324
|
-
var address, addressAndPubkey,
|
|
325
|
+
var address, addressAndPubkey, error_10, errorMessage, accountInfo, chainId, signerData;
|
|
325
326
|
return __generator(this, function (_a) {
|
|
326
327
|
switch (_a.label) {
|
|
327
328
|
case 0:
|
|
@@ -330,42 +331,29 @@ var FirmaWalletService = /** @class */ (function () {
|
|
|
330
331
|
}
|
|
331
332
|
_a.label = 1;
|
|
332
333
|
case 1:
|
|
333
|
-
_a.trys.push([1,
|
|
334
|
+
_a.trys.push([1, 3, , 4]);
|
|
334
335
|
return [4 /*yield*/, this.ledger.getAddressAndPublicKey()];
|
|
335
336
|
case 2:
|
|
336
337
|
addressAndPubkey = _a.sent();
|
|
337
338
|
address = addressAndPubkey.address;
|
|
338
|
-
|
|
339
|
-
_a.label = 3;
|
|
339
|
+
return [3 /*break*/, 4];
|
|
340
340
|
case 3:
|
|
341
|
-
_a.trys.push([3, 5, , 6]);
|
|
342
|
-
return [4 /*yield*/, this.ledger.showAddressOnDevice()];
|
|
343
|
-
case 4:
|
|
344
|
-
_a.sent();
|
|
345
|
-
return [3 /*break*/, 6];
|
|
346
|
-
case 5:
|
|
347
|
-
displayError_1 = _a.sent();
|
|
348
|
-
return [3 /*break*/, 6];
|
|
349
|
-
case 6: return [3 /*break*/, 8];
|
|
350
|
-
case 7:
|
|
351
341
|
error_10 = _a.sent();
|
|
352
342
|
errorMessage = error_10 instanceof Error ? error_10.message : String(error_10);
|
|
353
343
|
throw new Error("Failed to connect to Ledger: ".concat(errorMessage, ". Please make sure your Ledger is connected and the FirmaChain app is open."));
|
|
354
|
-
case
|
|
355
|
-
case
|
|
344
|
+
case 4: return [4 /*yield*/, FirmaUtil_1.FirmaUtil.getAccountInfo(address)];
|
|
345
|
+
case 5:
|
|
356
346
|
accountInfo = _a.sent();
|
|
357
347
|
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.getChainId()];
|
|
358
|
-
case
|
|
348
|
+
case 6:
|
|
359
349
|
chainId = _a.sent();
|
|
360
350
|
signerData = {
|
|
361
351
|
account_number: parseInt(accountInfo.account_number, 10),
|
|
362
352
|
sequence: parseInt(accountInfo.sequence, 10),
|
|
363
353
|
chain_id: chainId,
|
|
364
354
|
};
|
|
365
|
-
return [4 /*yield*/, (0, LedgerWallet_1.
|
|
366
|
-
case
|
|
367
|
-
// Use protobuf signing with FirmaChain Ledger app
|
|
368
|
-
return [2 /*return*/, _a.sent()];
|
|
355
|
+
return [4 /*yield*/, (0, LedgerWallet_1.signWithSignerAuto)(this.ledger, messages, signerData, option, registry, this.config.restApiAddress, simulate)];
|
|
356
|
+
case 7: return [2 /*return*/, _a.sent()];
|
|
369
357
|
}
|
|
370
358
|
});
|
|
371
359
|
});
|
|
@@ -19,6 +19,8 @@ exports.AuthzTxClient = void 0;
|
|
|
19
19
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
20
|
var AuthzTxTypes_1 = require("./AuthzTxTypes");
|
|
21
21
|
var ITxClient_1 = require("../common/ITxClient");
|
|
22
|
+
// AuthzTxTypes are protobufjs-generated without a `decode` method, so they
|
|
23
|
+
// cannot satisfy GeneratedType directly.
|
|
22
24
|
var types = [
|
|
23
25
|
["/cosmos.authz.v1beta1.MsgExec", AuthzTxTypes_1.MsgExec],
|
|
24
26
|
["/cosmos.authz.v1beta1.MsgGrant", AuthzTxTypes_1.MsgGrant],
|
|
@@ -21,7 +21,7 @@ var tx_1 = require("cosmjs-types/cosmos/bank/v1beta1/tx");
|
|
|
21
21
|
var ITxClient_1 = require("../common/ITxClient");
|
|
22
22
|
var types = [
|
|
23
23
|
["/cosmos.bank.v1beta1.MsgSend", tx_1.MsgSend],
|
|
24
|
-
["/cosmos.bank.v1beta1.MsgMultiSend", tx_1.MsgMultiSend]
|
|
24
|
+
["/cosmos.bank.v1beta1.MsgMultiSend", tx_1.MsgMultiSend],
|
|
25
25
|
];
|
|
26
26
|
var registry = new proto_signing_1.Registry(types);
|
|
27
27
|
var BankTxClient = /** @class */ (function (_super) {
|
|
@@ -31,6 +31,8 @@ var FeeGrantTxTypes_1 = require("../feegrant/FeeGrantTxTypes");
|
|
|
31
31
|
var NftTxTypes_1 = require("../nft/NftTxTypes");
|
|
32
32
|
var TokenTxTypes_1 = require("../token/TokenTxTypes");
|
|
33
33
|
var ITxClient_1 = require("./ITxClient");
|
|
34
|
+
// Some entries use protobufjs-generated types (no `decode`) or types from
|
|
35
|
+
// @kintsugi-tech/cosmjs-types (different BinaryWriter), so a cast is required.
|
|
34
36
|
var types = [
|
|
35
37
|
["/cosmos.authz.v1beta1.MsgExec", AuthzTxTypes_1.MsgExec],
|
|
36
38
|
["/cosmos.authz.v1beta1.MsgGrant", AuthzTxTypes_1.MsgGrant],
|
|
@@ -73,7 +75,7 @@ var types = [
|
|
|
73
75
|
["/firmachain.token.MsgCreateToken", TokenTxTypes_1.MsgCreateToken],
|
|
74
76
|
["/firmachain.token.MsgUpdateTokenURI", TokenTxTypes_1.MsgUpdateTokenURI],
|
|
75
77
|
["/firmachain.token.MsgMint", NftTxTypes_1.MsgMint],
|
|
76
|
-
["/firmachain.token.MsgBurn", NftTxTypes_1.MsgBurn]
|
|
78
|
+
["/firmachain.token.MsgBurn", NftTxTypes_1.MsgBurn],
|
|
77
79
|
];
|
|
78
80
|
var registry = new proto_signing_1.Registry(types);
|
|
79
81
|
var CommonTxClient = /** @class */ (function (_super) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { LedgerWalletInterface } from './LedgerWallet';
|
|
2
|
+
export type { LedgerWalletInterface };
|
|
3
|
+
export interface LedgerTransportClass {
|
|
4
|
+
create(): Promise<any>;
|
|
5
|
+
}
|
|
6
|
+
export declare class FirmaCosmosLedgerWallet implements LedgerWalletInterface {
|
|
7
|
+
private transportHID;
|
|
8
|
+
private cosmosApp;
|
|
9
|
+
private isOpen;
|
|
10
|
+
constructor(transportHID: LedgerTransportClass);
|
|
11
|
+
private connect;
|
|
12
|
+
private close;
|
|
13
|
+
getAddress(): Promise<string>;
|
|
14
|
+
getAddressAndPublicKey(): Promise<{
|
|
15
|
+
address: string;
|
|
16
|
+
publicKey: Uint8Array;
|
|
17
|
+
}>;
|
|
18
|
+
getPublicKey(): Promise<Uint8Array>;
|
|
19
|
+
showAddressOnDevice(): Promise<void>;
|
|
20
|
+
sign(message: string | Uint8Array, txtype?: number): Promise<Uint8Array>;
|
|
21
|
+
}
|
|
22
|
+
type GetAddressAndPublicKeyCallback = () => Promise<{
|
|
23
|
+
address: string;
|
|
24
|
+
publicKey: Uint8Array;
|
|
25
|
+
}>;
|
|
26
|
+
type GetAddressCallback = () => Promise<string>;
|
|
27
|
+
type SignCallback = (message: string | Uint8Array, txtype?: number) => Promise<Uint8Array>;
|
|
28
|
+
type GetPublicKeyCallback = () => Promise<Uint8Array>;
|
|
29
|
+
type ShowAddressOnDeviceCallback = () => void;
|
|
30
|
+
export declare class FirmaBridgeLedgerWallet implements LedgerWalletInterface {
|
|
31
|
+
private getAddressAndPublicKeyCallback;
|
|
32
|
+
private getAddressCallback;
|
|
33
|
+
private signCallback;
|
|
34
|
+
private getPublicKeyCallback;
|
|
35
|
+
private showAddressOnDeviceCallback;
|
|
36
|
+
registerGetAddressAndPublicKeyCallback(cb: GetAddressAndPublicKeyCallback): void;
|
|
37
|
+
registerGetAddressCallback(cb: GetAddressCallback): void;
|
|
38
|
+
registerGetSignCallback(cb: SignCallback): void;
|
|
39
|
+
registerGetPublicKeyCallback(cb: GetPublicKeyCallback): void;
|
|
40
|
+
registerShowAddressOnDevice(cb: ShowAddressOnDeviceCallback): void;
|
|
41
|
+
showAddressOnDevice(): Promise<void>;
|
|
42
|
+
getPublicKey(): Promise<Uint8Array>;
|
|
43
|
+
getAddressAndPublicKey(): Promise<{
|
|
44
|
+
address: string;
|
|
45
|
+
publicKey: Uint8Array;
|
|
46
|
+
}>;
|
|
47
|
+
getAddress(): Promise<string>;
|
|
48
|
+
sign(message: string | Uint8Array, txtype?: number): Promise<Uint8Array>;
|
|
49
|
+
}
|