@firmachain/firma-js 0.2.15 → 0.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sdk/FirmaBankService.js +3 -3
- package/dist/sdk/FirmaContractService.js +8 -8
- package/dist/sdk/FirmaDistributionService.d.ts +4 -0
- package/dist/sdk/FirmaDistributionService.js +140 -66
- package/dist/sdk/FirmaFeeGrantService.js +6 -6
- package/dist/sdk/FirmaGovService.js +15 -15
- package/dist/sdk/FirmaNftService.js +6 -6
- package/dist/sdk/FirmaStakingService.js +10 -10
- package/dist/sdk/FirmaTokenService.js +8 -8
- package/dist/sdk/FirmaUtil.d.ts +3 -0
- package/dist/sdk/FirmaUtil.js +56 -6
- package/dist/sdk/FirmaWalletService.d.ts +9 -1
- package/dist/sdk/FirmaWalletService.js +39 -5
- package/dist/sdk/firmachain/amino/addresses.d.ts +5 -0
- package/dist/sdk/firmachain/amino/addresses.js +46 -0
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +281 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +77 -0
- package/dist/sdk/firmachain/amino/aminotypes.d.ts +22 -0
- package/dist/sdk/firmachain/amino/aminotypes.js +521 -0
- package/dist/sdk/firmachain/amino/coins.d.ts +30 -0
- package/dist/sdk/firmachain/amino/coins.js +69 -0
- package/dist/sdk/firmachain/amino/encoding.d.ts +24 -0
- package/dist/sdk/firmachain/amino/encoding.js +234 -0
- package/dist/sdk/firmachain/amino/multisig.d.ts +10 -0
- package/dist/sdk/firmachain/amino/multisig.js +42 -0
- package/dist/sdk/firmachain/amino/paths.d.ts +6 -0
- package/dist/sdk/firmachain/amino/paths.js +18 -0
- package/dist/sdk/firmachain/amino/pubkeys.d.ts +47 -0
- package/dist/sdk/firmachain/amino/pubkeys.js +29 -0
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +94 -0
- package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +437 -0
- package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +23 -0
- package/dist/sdk/firmachain/amino/secp256k1wallet.js +141 -0
- package/dist/sdk/firmachain/amino/signature.d.ts +16 -0
- package/dist/sdk/firmachain/amino/signature.js +36 -0
- package/dist/sdk/firmachain/amino/signdoc.d.ts +26 -0
- package/dist/sdk/firmachain/amino/signdoc.js +42 -0
- package/dist/sdk/firmachain/amino/signer.d.ts +33 -0
- package/dist/sdk/firmachain/amino/signer.js +2 -0
- package/dist/sdk/firmachain/amino/stdtx.d.ts +15 -0
- package/dist/sdk/firmachain/amino/stdtx.js +17 -0
- package/dist/sdk/firmachain/amino/wallet.d.ts +32 -0
- package/dist/sdk/firmachain/amino/wallet.js +132 -0
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/common/ITxClient.d.ts +4 -2
- package/dist/sdk/firmachain/common/ITxClient.js +10 -6
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +27 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +165 -0
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +14 -0
- package/dist/sdk/firmachain/common/LedgerWallet.js +147 -0
- package/dist/sdk/firmachain/common/signing.js +17 -1
- package/dist/sdk/firmachain/common/signingstargateclient.js +19 -3
- package/dist/sdk/firmachain/common/stargateclient.js +5 -2
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +50 -9
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/distribution/index.js +0 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +63 -13
- package/dist/sdk/firmachain/google/protobuf/any.js +3 -2
- package/dist/sdk/firmachain/google/protobuf/descriptor.js +1364 -324
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/gov/index.js +0 -1
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +3 -2
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +3 -2
- package/package.json +1 -1
|
@@ -224,7 +224,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
224
224
|
switch (_a.label) {
|
|
225
225
|
case 0:
|
|
226
226
|
_a.trys.push([0, 3, , 4]);
|
|
227
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
227
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
228
228
|
sendAmount = { denom: this.config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT) };
|
|
229
229
|
proposal = gov_2.TextProposal.fromPartial({
|
|
230
230
|
title: title,
|
|
@@ -257,7 +257,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
257
257
|
switch (_a.label) {
|
|
258
258
|
case 0:
|
|
259
259
|
_a.trys.push([0, 3, , 4]);
|
|
260
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
260
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
261
261
|
initialDepositAmount = {
|
|
262
262
|
denom: this.config.denom,
|
|
263
263
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -297,7 +297,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
297
297
|
switch (_a.label) {
|
|
298
298
|
case 0:
|
|
299
299
|
_a.trys.push([0, 3, , 4]);
|
|
300
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
300
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
301
301
|
initialDepositAmount = {
|
|
302
302
|
denom: this.config.denom,
|
|
303
303
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -338,7 +338,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
338
338
|
switch (_a.label) {
|
|
339
339
|
case 0:
|
|
340
340
|
_a.trys.push([0, 3, , 4]);
|
|
341
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
341
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
342
342
|
initialDepositAmount = {
|
|
343
343
|
denom: this.config.denom,
|
|
344
344
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -379,7 +379,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
379
379
|
switch (_a.label) {
|
|
380
380
|
case 0:
|
|
381
381
|
_a.trys.push([0, 3, , 4]);
|
|
382
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
382
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
383
383
|
initialDepositAmount = {
|
|
384
384
|
denom: this.config.denom,
|
|
385
385
|
amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(initialDepositFCT)
|
|
@@ -425,7 +425,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
425
425
|
return [4 /*yield*/, this.getSignedTxSubmitCancelSoftwareUpgradeProposal(wallet, title, description, initialDeposit, txMisc)];
|
|
426
426
|
case 1:
|
|
427
427
|
txRaw = _a.sent();
|
|
428
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
428
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
429
429
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
430
430
|
case 2: return [2 /*return*/, _a.sent()];
|
|
431
431
|
case 3:
|
|
@@ -456,7 +456,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
456
456
|
return [4 /*yield*/, this.getSignedTxSubmitSoftwareUpgradeProposal(wallet, title, description, initialDeposit, plan, txMisc)];
|
|
457
457
|
case 1:
|
|
458
458
|
txRaw = _a.sent();
|
|
459
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
459
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
460
460
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
461
461
|
case 2: return [2 /*return*/, _a.sent()];
|
|
462
462
|
case 3:
|
|
@@ -486,7 +486,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
486
486
|
return [4 /*yield*/, this.getSignedTxSubmitSoftwareUpgradeProposal(wallet, title, description, initialDeposit, plan, txMisc)];
|
|
487
487
|
case 1:
|
|
488
488
|
txRaw = _a.sent();
|
|
489
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
489
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
490
490
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
491
491
|
case 2: return [2 /*return*/, _a.sent()];
|
|
492
492
|
case 3:
|
|
@@ -509,7 +509,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
509
509
|
return [4 /*yield*/, this.getSignedTxSubmitParameterChangeProposal(wallet, title, description, initialDeposit, paramList, txMisc)];
|
|
510
510
|
case 1:
|
|
511
511
|
txRaw = _a.sent();
|
|
512
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
512
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
513
513
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
514
514
|
case 2: return [2 /*return*/, _a.sent()];
|
|
515
515
|
case 3:
|
|
@@ -532,7 +532,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
532
532
|
return [4 /*yield*/, this.getSignedTxSubmitCommunityPoolSpendProposal(wallet, title, description, initialDeposit, amount, recipient, txMisc)];
|
|
533
533
|
case 1:
|
|
534
534
|
txRaw = _a.sent();
|
|
535
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
535
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
536
536
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
537
537
|
case 2: return [2 /*return*/, _a.sent()];
|
|
538
538
|
case 3:
|
|
@@ -555,7 +555,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
555
555
|
return [4 /*yield*/, this.getSignedTxSubmitTextProposal(wallet, title, description, initialDeposit, txMisc)];
|
|
556
556
|
case 1:
|
|
557
557
|
txRaw = _a.sent();
|
|
558
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
558
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
559
559
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
560
560
|
case 2: return [2 /*return*/, _a.sent()];
|
|
561
561
|
case 3:
|
|
@@ -578,7 +578,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
578
578
|
return [4 /*yield*/, wallet.getAddress()];
|
|
579
579
|
case 1:
|
|
580
580
|
voter = _a.sent();
|
|
581
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
581
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
582
582
|
message = txClient.msgVote({ proposalId: proposalId, voter: voter, option: option });
|
|
583
583
|
return [4 /*yield*/, txClient.sign([message], gov_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
584
584
|
case 2: return [2 /*return*/, _a.sent()];
|
|
@@ -603,7 +603,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
603
603
|
return [4 /*yield*/, this.getSignedTxVote(wallet, longId, option, txMisc)];
|
|
604
604
|
case 1:
|
|
605
605
|
txRaw = _a.sent();
|
|
606
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
606
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
607
607
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
608
608
|
case 2: return [2 /*return*/, _a.sent()];
|
|
609
609
|
case 3:
|
|
@@ -623,7 +623,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
623
623
|
switch (_a.label) {
|
|
624
624
|
case 0:
|
|
625
625
|
_a.trys.push([0, 3, , 4]);
|
|
626
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
626
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
627
627
|
return [4 /*yield*/, wallet.getAddress()];
|
|
628
628
|
case 1:
|
|
629
629
|
depositor = _a.sent();
|
|
@@ -652,7 +652,7 @@ var FirmaGovService = /** @class */ (function () {
|
|
|
652
652
|
return [4 /*yield*/, this.getSignedTxDeposit(wallet, longId, amount, txMisc)];
|
|
653
653
|
case 1:
|
|
654
654
|
txRaw = _a.sent();
|
|
655
|
-
txClient = new gov_1.GovTxClient(wallet
|
|
655
|
+
txClient = new gov_1.GovTxClient(wallet, this.config.rpcAddress);
|
|
656
656
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
657
657
|
case 2: return [2 /*return*/, _a.sent()];
|
|
658
658
|
case 3:
|
|
@@ -211,7 +211,7 @@ var NftService = /** @class */ (function () {
|
|
|
211
211
|
return [4 /*yield*/, wallet.getAddress()];
|
|
212
212
|
case 1:
|
|
213
213
|
address = _a.sent();
|
|
214
|
-
nftTxClient = new nft_1.NftTxClient(wallet
|
|
214
|
+
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
215
215
|
message = nftTxClient.msgTransfer({ owner: address, toAddress: toAddress, nftId: parseInt(nftID) });
|
|
216
216
|
return [4 /*yield*/, nftTxClient.sign([message], nft_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
217
217
|
case 2: return [2 /*return*/, _a.sent()];
|
|
@@ -235,7 +235,7 @@ var NftService = /** @class */ (function () {
|
|
|
235
235
|
return [4 /*yield*/, this.getSignedTxTransfer(wallet, toAddress, nftID, txMisc)];
|
|
236
236
|
case 1:
|
|
237
237
|
txRaw = _a.sent();
|
|
238
|
-
nftTxClient = new nft_1.NftTxClient(wallet
|
|
238
|
+
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
239
239
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
240
240
|
case 2: return [2 /*return*/, _a.sent()];
|
|
241
241
|
case 3:
|
|
@@ -280,7 +280,7 @@ var NftService = /** @class */ (function () {
|
|
|
280
280
|
return [4 /*yield*/, wallet.getAddress()];
|
|
281
281
|
case 1:
|
|
282
282
|
address = _a.sent();
|
|
283
|
-
nftTxClient = new nft_1.NftTxClient(wallet
|
|
283
|
+
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
284
284
|
message = nftTxClient.msgBurn({ owner: address, nftId: parseInt(nftID) });
|
|
285
285
|
return [4 /*yield*/, nftTxClient.sign([message], nft_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
286
286
|
case 2: return [2 /*return*/, _a.sent()];
|
|
@@ -304,7 +304,7 @@ var NftService = /** @class */ (function () {
|
|
|
304
304
|
return [4 /*yield*/, this.getSignedTxBurn(wallet, nftID, txMisc)];
|
|
305
305
|
case 1:
|
|
306
306
|
txRaw = _a.sent();
|
|
307
|
-
nftTxClient = new nft_1.NftTxClient(wallet
|
|
307
|
+
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
308
308
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
309
309
|
case 2: return [2 /*return*/, _a.sent()];
|
|
310
310
|
case 3:
|
|
@@ -349,7 +349,7 @@ var NftService = /** @class */ (function () {
|
|
|
349
349
|
return [4 /*yield*/, wallet.getAddress()];
|
|
350
350
|
case 1:
|
|
351
351
|
address = _a.sent();
|
|
352
|
-
nftTxClient = new nft_1.NftTxClient(wallet
|
|
352
|
+
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
353
353
|
message = nftTxClient.msgMint({ owner: address, tokenURI: tokenURI });
|
|
354
354
|
return [4 /*yield*/, nftTxClient.sign([message], nft_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
|
|
355
355
|
case 2: return [2 /*return*/, _a.sent()];
|
|
@@ -373,7 +373,7 @@ var NftService = /** @class */ (function () {
|
|
|
373
373
|
return [4 /*yield*/, this.getSignedTxMint(wallet, tokenURI, txMisc)];
|
|
374
374
|
case 1:
|
|
375
375
|
txRaw = _a.sent();
|
|
376
|
-
nftTxClient = new nft_1.NftTxClient(wallet
|
|
376
|
+
nftTxClient = new nft_1.NftTxClient(wallet, this.config.rpcAddress);
|
|
377
377
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
378
378
|
case 2: return [2 /*return*/, _a.sent()];
|
|
379
379
|
case 3:
|
|
@@ -117,7 +117,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
117
117
|
switch (_a.label) {
|
|
118
118
|
case 0:
|
|
119
119
|
_a.trys.push([0, 3, , 4]);
|
|
120
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
120
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
121
121
|
return [4 /*yield*/, wallet.getAddress()];
|
|
122
122
|
case 1:
|
|
123
123
|
address = _a.sent();
|
|
@@ -146,7 +146,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
146
146
|
switch (_a.label) {
|
|
147
147
|
case 0:
|
|
148
148
|
_a.trys.push([0, 3, , 4]);
|
|
149
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
149
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
150
150
|
return [4 /*yield*/, wallet.getAddress()];
|
|
151
151
|
case 1:
|
|
152
152
|
address = _a.sent();
|
|
@@ -175,7 +175,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
175
175
|
switch (_a.label) {
|
|
176
176
|
case 0:
|
|
177
177
|
_a.trys.push([0, 3, , 4]);
|
|
178
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
178
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
179
179
|
return [4 /*yield*/, wallet.getAddress()];
|
|
180
180
|
case 1:
|
|
181
181
|
address = _a.sent();
|
|
@@ -205,7 +205,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
205
205
|
switch (_a.label) {
|
|
206
206
|
case 0:
|
|
207
207
|
_a.trys.push([0, 2, , 3]);
|
|
208
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
208
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
209
209
|
message = txClient.msgCreateValidator({
|
|
210
210
|
description: validatorInfo.description,
|
|
211
211
|
commission: validatorInfo.commission,
|
|
@@ -234,7 +234,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
234
234
|
switch (_a.label) {
|
|
235
235
|
case 0:
|
|
236
236
|
_a.trys.push([0, 2, , 3]);
|
|
237
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
237
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
238
238
|
message = txClient.msgEditValidator({
|
|
239
239
|
validatorAddress: validatorAddress,
|
|
240
240
|
description: description,
|
|
@@ -263,7 +263,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
263
263
|
return [4 /*yield*/, this.getSignedTxCreateValidator(wallet, validatorInfo, txMisc)];
|
|
264
264
|
case 1:
|
|
265
265
|
txRaw = _a.sent();
|
|
266
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
266
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
267
267
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
268
268
|
case 2: return [2 /*return*/, _a.sent()];
|
|
269
269
|
case 3:
|
|
@@ -286,7 +286,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
286
286
|
return [4 /*yield*/, this.getSignedTxEditValidator(wallet, validatorAddress, description, commissionRate, minSelfDelegation, txMisc)];
|
|
287
287
|
case 1:
|
|
288
288
|
txRaw = _a.sent();
|
|
289
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
289
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
290
290
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
291
291
|
case 2: return [2 /*return*/, _a.sent()];
|
|
292
292
|
case 3:
|
|
@@ -309,7 +309,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
309
309
|
return [4 /*yield*/, this.getSignedTxRedelegate(wallet, validatorSrcAddress, validatorDstAddress, amount, txMisc)];
|
|
310
310
|
case 1:
|
|
311
311
|
txRaw = _a.sent();
|
|
312
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
312
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
313
313
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
314
314
|
case 2: return [2 /*return*/, _a.sent()];
|
|
315
315
|
case 3:
|
|
@@ -332,7 +332,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
332
332
|
return [4 /*yield*/, this.getSignedTxUndelegate(wallet, targetAddress, amount, txMisc)];
|
|
333
333
|
case 1:
|
|
334
334
|
txRaw = _a.sent();
|
|
335
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
335
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
336
336
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
337
337
|
case 2: return [2 /*return*/, _a.sent()];
|
|
338
338
|
case 3:
|
|
@@ -355,7 +355,7 @@ var FirmaStakingService = /** @class */ (function () {
|
|
|
355
355
|
return [4 /*yield*/, this.getSignedTxDelegate(wallet, targetAddress, amount, txMisc)];
|
|
356
356
|
case 1:
|
|
357
357
|
txRaw = _a.sent();
|
|
358
|
-
txClient = new staking_1.StakingTxClient(wallet
|
|
358
|
+
txClient = new staking_1.StakingTxClient(wallet, this.config.rpcAddress);
|
|
359
359
|
return [4 /*yield*/, txClient.broadcast(txRaw)];
|
|
360
360
|
case 2: return [2 /*return*/, _a.sent()];
|
|
361
361
|
case 3:
|
|
@@ -145,7 +145,7 @@ var TokenService = /** @class */ (function () {
|
|
|
145
145
|
return [4 /*yield*/, wallet.getAddress()];
|
|
146
146
|
case 1:
|
|
147
147
|
address = _a.sent();
|
|
148
|
-
txClient = new token_1.TokenTxClient(wallet
|
|
148
|
+
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
149
149
|
message = txClient.msgUpdateTokenURI({
|
|
150
150
|
owner: address,
|
|
151
151
|
tokenID: tokenID,
|
|
@@ -173,7 +173,7 @@ var TokenService = /** @class */ (function () {
|
|
|
173
173
|
return [4 /*yield*/, wallet.getAddress()];
|
|
174
174
|
case 1:
|
|
175
175
|
address = _a.sent();
|
|
176
|
-
txClient = new token_1.TokenTxClient(wallet
|
|
176
|
+
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
177
177
|
message = txClient.msgBurn({
|
|
178
178
|
owner: address,
|
|
179
179
|
tokenID: tokenID,
|
|
@@ -201,7 +201,7 @@ var TokenService = /** @class */ (function () {
|
|
|
201
201
|
return [4 /*yield*/, wallet.getAddress()];
|
|
202
202
|
case 1:
|
|
203
203
|
address = _a.sent();
|
|
204
|
-
txClient = new token_1.TokenTxClient(wallet
|
|
204
|
+
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
205
205
|
message = txClient.msgMint({
|
|
206
206
|
owner: address,
|
|
207
207
|
tokenID: tokenID,
|
|
@@ -230,7 +230,7 @@ var TokenService = /** @class */ (function () {
|
|
|
230
230
|
return [4 /*yield*/, wallet.getAddress()];
|
|
231
231
|
case 1:
|
|
232
232
|
address = _a.sent();
|
|
233
|
-
txClient = new token_1.TokenTxClient(wallet
|
|
233
|
+
txClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
234
234
|
message = txClient.msgCreateToken({
|
|
235
235
|
owner: address,
|
|
236
236
|
name: tokenName,
|
|
@@ -265,7 +265,7 @@ var TokenService = /** @class */ (function () {
|
|
|
265
265
|
return [4 /*yield*/, this.getSignedTxCreateToken(wallet, tokenName, tokenSymbol, tokenURI, newTotalSupply, decimal, isMintable, isBurnable, txMisc)];
|
|
266
266
|
case 1:
|
|
267
267
|
txRaw = _a.sent();
|
|
268
|
-
nftTxClient = new token_1.TokenTxClient(wallet
|
|
268
|
+
nftTxClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
269
269
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
270
270
|
case 2: return [2 /*return*/, _a.sent()];
|
|
271
271
|
case 3:
|
|
@@ -289,7 +289,7 @@ var TokenService = /** @class */ (function () {
|
|
|
289
289
|
return [4 /*yield*/, this.getSignedTxMint(wallet, tokenID, newAmount, toAddress, txMisc)];
|
|
290
290
|
case 1:
|
|
291
291
|
txRaw = _a.sent();
|
|
292
|
-
nftTxClient = new token_1.TokenTxClient(wallet
|
|
292
|
+
nftTxClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
293
293
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
294
294
|
case 2: return [2 /*return*/, _a.sent()];
|
|
295
295
|
case 3:
|
|
@@ -313,7 +313,7 @@ var TokenService = /** @class */ (function () {
|
|
|
313
313
|
return [4 /*yield*/, this.getSignedTxBurn(wallet, tokenID, newAmount, txMisc)];
|
|
314
314
|
case 1:
|
|
315
315
|
txRaw = _a.sent();
|
|
316
|
-
nftTxClient = new token_1.TokenTxClient(wallet
|
|
316
|
+
nftTxClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
317
317
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
318
318
|
case 2: return [2 /*return*/, _a.sent()];
|
|
319
319
|
case 3:
|
|
@@ -336,7 +336,7 @@ var TokenService = /** @class */ (function () {
|
|
|
336
336
|
return [4 /*yield*/, this.getSignedTxUpdateTokenURI(wallet, tokenID, tokenURI, txMisc)];
|
|
337
337
|
case 1:
|
|
338
338
|
txRaw = _a.sent();
|
|
339
|
-
nftTxClient = new token_1.TokenTxClient(wallet
|
|
339
|
+
nftTxClient = new token_1.TokenTxClient(wallet, this.config.rpcAddress);
|
|
340
340
|
return [4 /*yield*/, nftTxClient.broadcast(txRaw)];
|
|
341
341
|
case 2: return [2 /*return*/, _a.sent()];
|
|
342
342
|
case 3:
|
package/dist/sdk/FirmaUtil.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
2
2
|
import { FirmaConfig } from "./FirmaConfig";
|
|
3
|
+
import { SignerData } from "./firmachain/common/LedgerSigningStargateClient";
|
|
3
4
|
export declare class FirmaUtil {
|
|
4
5
|
static config: FirmaConfig;
|
|
5
6
|
static readonly FctDecimal: number;
|
|
@@ -17,6 +18,8 @@ export declare class FirmaUtil {
|
|
|
17
18
|
static isValidAddress(address: string): boolean;
|
|
18
19
|
static getValOperAddressFromAccAddress(address: string): string;
|
|
19
20
|
static getAccAddressFromValOperAddress(address: string): string;
|
|
21
|
+
static getSignerDataForLedger(address: string): Promise<SignerData>;
|
|
20
22
|
static estimateGas(txRaw: TxRaw): Promise<number>;
|
|
23
|
+
static estimateGasRaw(txRaw: Uint8Array): Promise<number>;
|
|
21
24
|
static printLog(log: any): void;
|
|
22
25
|
}
|
package/dist/sdk/FirmaUtil.js
CHANGED
|
@@ -40,10 +40,11 @@ exports.FirmaUtil = void 0;
|
|
|
40
40
|
var fs_1 = require("fs");
|
|
41
41
|
var tx_1 = require("cosmjs-types/cosmos/tx/v1beta1/tx");
|
|
42
42
|
var TendermintQueryClient_1 = require("./firmachain/common/TendermintQueryClient");
|
|
43
|
+
var encoding_1 = require("@cosmjs/encoding");
|
|
44
|
+
var LedgerSigningStargateClient_1 = require("./firmachain/common/LedgerSigningStargateClient");
|
|
43
45
|
var CryptoJS = require("crypto-js");
|
|
44
46
|
var sha256 = require("crypto-js/sha256");
|
|
45
47
|
var encHex = require("crypto-js/enc-hex");
|
|
46
|
-
var encoding_1 = require("@cosmjs/encoding");
|
|
47
48
|
var FirmaUtil = /** @class */ (function () {
|
|
48
49
|
function FirmaUtil(firmaConfig) {
|
|
49
50
|
FirmaUtil.config = firmaConfig;
|
|
@@ -101,7 +102,8 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
101
102
|
};
|
|
102
103
|
FirmaUtil.isValidAddress = function (address) {
|
|
103
104
|
try {
|
|
104
|
-
|
|
105
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
106
|
+
encoding_1.Bech32.decode(address).data;
|
|
105
107
|
return true;
|
|
106
108
|
}
|
|
107
109
|
catch (e) {
|
|
@@ -116,9 +118,32 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
116
118
|
var data = encoding_1.Bech32.decode(address).data;
|
|
117
119
|
return encoding_1.Bech32.encode(FirmaUtil.config.prefix, data);
|
|
118
120
|
};
|
|
121
|
+
FirmaUtil.getSignerDataForLedger = function (address) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
123
|
+
var signingClient, sequence, error_1;
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
switch (_a.label) {
|
|
126
|
+
case 0:
|
|
127
|
+
_a.trys.push([0, 3, , 4]);
|
|
128
|
+
return [4 /*yield*/, LedgerSigningStargateClient_1.LedgerSigningStargateClient.connectWithSigner(FirmaUtil.config.rpcAddress)];
|
|
129
|
+
case 1:
|
|
130
|
+
signingClient = _a.sent();
|
|
131
|
+
return [4 /*yield*/, signingClient.getSignerData(address)];
|
|
132
|
+
case 2:
|
|
133
|
+
sequence = _a.sent();
|
|
134
|
+
return [2 /*return*/, sequence];
|
|
135
|
+
case 3:
|
|
136
|
+
error_1 = _a.sent();
|
|
137
|
+
FirmaUtil.printLog(error_1);
|
|
138
|
+
throw error_1;
|
|
139
|
+
case 4: return [2 /*return*/];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
};
|
|
119
144
|
FirmaUtil.estimateGas = function (txRaw) {
|
|
120
145
|
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
-
var encodedTx, hexTx, queryClient, gas, multiplier,
|
|
146
|
+
var encodedTx, hexTx, queryClient, gas, multiplier, error_2;
|
|
122
147
|
return __generator(this, function (_a) {
|
|
123
148
|
switch (_a.label) {
|
|
124
149
|
case 0:
|
|
@@ -132,9 +157,34 @@ var FirmaUtil = /** @class */ (function () {
|
|
|
132
157
|
multiplier = 1.25;
|
|
133
158
|
return [2 /*return*/, Math.ceil(gas * multiplier)];
|
|
134
159
|
case 2:
|
|
135
|
-
|
|
136
|
-
FirmaUtil.printLog(
|
|
137
|
-
throw
|
|
160
|
+
error_2 = _a.sent();
|
|
161
|
+
FirmaUtil.printLog(error_2);
|
|
162
|
+
throw error_2;
|
|
163
|
+
case 3: return [2 /*return*/];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
};
|
|
168
|
+
FirmaUtil.estimateGasRaw = function (txRaw) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
170
|
+
var encodedTx, hexTx, queryClient, gas, multiplier, error_3;
|
|
171
|
+
return __generator(this, function (_a) {
|
|
172
|
+
switch (_a.label) {
|
|
173
|
+
case 0:
|
|
174
|
+
_a.trys.push([0, 2, , 3]);
|
|
175
|
+
encodedTx = Uint8Array.from(txRaw);
|
|
176
|
+
hexTx = "0x" + Buffer.from(encodedTx).toString("hex");
|
|
177
|
+
console.log("hexTx:" + hexTx);
|
|
178
|
+
queryClient = new TendermintQueryClient_1.TendermintQueryClient(FirmaUtil.config.rpcAddress);
|
|
179
|
+
return [4 /*yield*/, queryClient.queryEstimateGas(hexTx)];
|
|
180
|
+
case 1:
|
|
181
|
+
gas = _a.sent();
|
|
182
|
+
multiplier = 1.25;
|
|
183
|
+
return [2 /*return*/, Math.ceil(gas * multiplier)];
|
|
184
|
+
case 2:
|
|
185
|
+
error_3 = _a.sent();
|
|
186
|
+
FirmaUtil.printLog(error_3);
|
|
187
|
+
throw error_3;
|
|
138
188
|
case 3: return [2 /*return*/];
|
|
139
189
|
}
|
|
140
190
|
});
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import { DirectSecp256k1Wallet } from "@cosmjs/proto-signing";
|
|
1
|
+
import { DirectSecp256k1Wallet, Registry } from "@cosmjs/proto-signing";
|
|
2
|
+
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
2
3
|
import { FirmaConfig } from "./FirmaConfig";
|
|
4
|
+
import { SignAndBroadcastOptions } from "./firmachain/common";
|
|
5
|
+
import { LedgerWalletInterface } from "./firmachain/common/LedgerWallet";
|
|
6
|
+
import { TxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
3
7
|
export declare class FirmaWalletService {
|
|
4
8
|
private readonly config;
|
|
5
9
|
private mnemonic;
|
|
6
10
|
private privateKey;
|
|
7
11
|
private accountIndex;
|
|
8
12
|
private wallet;
|
|
13
|
+
private ledger;
|
|
9
14
|
getHdPath(): string;
|
|
10
15
|
getPrefix(): string;
|
|
11
16
|
getRawWallet(): DirectSecp256k1Wallet;
|
|
12
17
|
getPrivateKey(): string;
|
|
13
18
|
getMnemonic(): string;
|
|
19
|
+
isLedger(): boolean;
|
|
20
|
+
initFromLedger(ledger: LedgerWalletInterface): Promise<FirmaWalletService>;
|
|
21
|
+
signLedger(messages: EncodeObject[], option: SignAndBroadcastOptions, registry: Registry): Promise<TxRaw>;
|
|
14
22
|
getAddress(): Promise<string>;
|
|
15
23
|
constructor(config: FirmaConfig);
|
|
16
24
|
private static getHdPath;
|
|
@@ -40,6 +40,7 @@ exports.FirmaWalletService = void 0;
|
|
|
40
40
|
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
41
41
|
var crypto_1 = require("@cosmjs/crypto");
|
|
42
42
|
var FirmaUtil_1 = require("./FirmaUtil");
|
|
43
|
+
var LedgerWallet_1 = require("./firmachain/common/LedgerWallet");
|
|
43
44
|
var CryptoJS = require("crypto-js");
|
|
44
45
|
var FirmaWalletService = /** @class */ (function () {
|
|
45
46
|
function FirmaWalletService(config) {
|
|
@@ -63,22 +64,55 @@ var FirmaWalletService = /** @class */ (function () {
|
|
|
63
64
|
FirmaWalletService.prototype.getMnemonic = function () {
|
|
64
65
|
return this.mnemonic;
|
|
65
66
|
};
|
|
67
|
+
FirmaWalletService.prototype.isLedger = function () {
|
|
68
|
+
return (this.ledger != null);
|
|
69
|
+
};
|
|
70
|
+
FirmaWalletService.prototype.initFromLedger = function (ledger) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
var wallet;
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
try {
|
|
75
|
+
wallet = new FirmaWalletService(this.config);
|
|
76
|
+
wallet.ledger = ledger;
|
|
77
|
+
return [2 /*return*/, wallet];
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
FirmaUtil_1.FirmaUtil.printLog(error);
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
return [2 /*return*/];
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
FirmaWalletService.prototype.signLedger = function (messages, option, registry) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
switch (_a.label) {
|
|
91
|
+
case 0: return [4 /*yield*/, LedgerWallet_1.signFromLedger(this.ledger, messages, option, registry)];
|
|
92
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
};
|
|
66
97
|
FirmaWalletService.prototype.getAddress = function () {
|
|
67
98
|
return __awaiter(this, void 0, void 0, function () {
|
|
68
99
|
var accounts, error_1;
|
|
69
100
|
return __generator(this, function (_a) {
|
|
70
101
|
switch (_a.label) {
|
|
71
102
|
case 0:
|
|
72
|
-
_a.trys.push([0,
|
|
73
|
-
return [
|
|
74
|
-
|
|
103
|
+
_a.trys.push([0, 4, , 5]);
|
|
104
|
+
if (!(this.ledger != null)) return [3 /*break*/, 2];
|
|
105
|
+
return [4 /*yield*/, this.ledger.getAddress()];
|
|
106
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
107
|
+
case 2: return [4 /*yield*/, this.wallet.getAccounts()];
|
|
108
|
+
case 3:
|
|
75
109
|
accounts = _a.sent();
|
|
76
110
|
return [2 /*return*/, accounts[0].address];
|
|
77
|
-
case
|
|
111
|
+
case 4:
|
|
78
112
|
error_1 = _a.sent();
|
|
79
113
|
FirmaUtil_1.FirmaUtil.printLog(error_1);
|
|
80
114
|
throw error_1;
|
|
81
|
-
case
|
|
115
|
+
case 5: return [2 /*return*/];
|
|
82
116
|
}
|
|
83
117
|
});
|
|
84
118
|
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Pubkey } from "./pubkeys";
|
|
2
|
+
export declare function rawEd25519PubkeyToRawAddress(pubkeyData: Uint8Array): Uint8Array;
|
|
3
|
+
export declare function rawSecp256k1PubkeyToRawAddress(pubkeyData: Uint8Array): Uint8Array;
|
|
4
|
+
export declare function pubkeyToRawAddress(pubkey: Pubkey): Uint8Array;
|
|
5
|
+
export declare function pubkeyToAddress(pubkey: Pubkey, prefix: string): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// See https://github.com/tendermint/tendermint/blob/f2ada0a604b4c0763bda2f64fac53d506d3beca7/docs/spec/blockchain/encoding.md#public-key-cryptography
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.pubkeyToAddress = exports.pubkeyToRawAddress = exports.rawSecp256k1PubkeyToRawAddress = exports.rawEd25519PubkeyToRawAddress = void 0;
|
|
5
|
+
var crypto_1 = require("@cosmjs/crypto");
|
|
6
|
+
var encoding_1 = require("@cosmjs/encoding");
|
|
7
|
+
var encoding_2 = require("./encoding");
|
|
8
|
+
var pubkeys_1 = require("./pubkeys");
|
|
9
|
+
function rawEd25519PubkeyToRawAddress(pubkeyData) {
|
|
10
|
+
if (pubkeyData.length !== 32) {
|
|
11
|
+
throw new Error("Invalid Ed25519 pubkey length: " + pubkeyData.length);
|
|
12
|
+
}
|
|
13
|
+
return crypto_1.sha256(pubkeyData).slice(0, 20);
|
|
14
|
+
}
|
|
15
|
+
exports.rawEd25519PubkeyToRawAddress = rawEd25519PubkeyToRawAddress;
|
|
16
|
+
function rawSecp256k1PubkeyToRawAddress(pubkeyData) {
|
|
17
|
+
if (pubkeyData.length !== 33) {
|
|
18
|
+
throw new Error("Invalid Secp256k1 pubkey length (compressed): " + pubkeyData.length);
|
|
19
|
+
}
|
|
20
|
+
return crypto_1.ripemd160(crypto_1.sha256(pubkeyData));
|
|
21
|
+
}
|
|
22
|
+
exports.rawSecp256k1PubkeyToRawAddress = rawSecp256k1PubkeyToRawAddress;
|
|
23
|
+
// For secp256k1 this assumes we already have a compressed pubkey.
|
|
24
|
+
function pubkeyToRawAddress(pubkey) {
|
|
25
|
+
if (pubkeys_1.isSecp256k1Pubkey(pubkey)) {
|
|
26
|
+
var pubkeyData = encoding_1.fromBase64(pubkey.value);
|
|
27
|
+
return rawSecp256k1PubkeyToRawAddress(pubkeyData);
|
|
28
|
+
}
|
|
29
|
+
else if (pubkeys_1.isEd25519Pubkey(pubkey)) {
|
|
30
|
+
var pubkeyData = encoding_1.fromBase64(pubkey.value);
|
|
31
|
+
return rawEd25519PubkeyToRawAddress(pubkeyData);
|
|
32
|
+
}
|
|
33
|
+
else if (pubkeys_1.isMultisigThresholdPubkey(pubkey)) {
|
|
34
|
+
// https://github.com/tendermint/tendermint/blob/38b401657e4ad7a7eeb3c30a3cbf512037df3740/crypto/multisig/threshold_pubkey.go#L71-L74
|
|
35
|
+
var pubkeyData = encoding_2.encodeAminoPubkey(pubkey);
|
|
36
|
+
return crypto_1.sha256(pubkeyData).slice(0, 20);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
throw new Error("Unsupported public key type");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.pubkeyToRawAddress = pubkeyToRawAddress;
|
|
43
|
+
function pubkeyToAddress(pubkey, prefix) {
|
|
44
|
+
return encoding_1.Bech32.encode(prefix, pubkeyToRawAddress(pubkey));
|
|
45
|
+
}
|
|
46
|
+
exports.pubkeyToAddress = pubkeyToAddress;
|