@firmachain/firma-js 0.2.16 → 0.2.20

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.
Files changed (66) hide show
  1. package/dist/sdk/FirmaBankService.js +3 -3
  2. package/dist/sdk/FirmaContractService.js +8 -8
  3. package/dist/sdk/FirmaDistributionService.js +10 -10
  4. package/dist/sdk/FirmaFeeGrantService.js +6 -6
  5. package/dist/sdk/FirmaGovService.js +15 -15
  6. package/dist/sdk/FirmaNftService.js +6 -6
  7. package/dist/sdk/FirmaStakingService.js +10 -10
  8. package/dist/sdk/FirmaTokenService.js +8 -8
  9. package/dist/sdk/FirmaUtil.d.ts +4 -0
  10. package/dist/sdk/FirmaUtil.js +65 -6
  11. package/dist/sdk/FirmaWalletService.d.ts +9 -1
  12. package/dist/sdk/FirmaWalletService.js +39 -5
  13. package/dist/sdk/firmachain/amino/addresses.d.ts +5 -0
  14. package/dist/sdk/firmachain/amino/addresses.js +46 -0
  15. package/dist/sdk/firmachain/amino/aminomsgs.d.ts +281 -0
  16. package/dist/sdk/firmachain/amino/aminomsgs.js +77 -0
  17. package/dist/sdk/firmachain/amino/aminotypes.d.ts +22 -0
  18. package/dist/sdk/firmachain/amino/aminotypes.js +521 -0
  19. package/dist/sdk/firmachain/amino/coins.d.ts +30 -0
  20. package/dist/sdk/firmachain/amino/coins.js +69 -0
  21. package/dist/sdk/firmachain/amino/encoding.d.ts +24 -0
  22. package/dist/sdk/firmachain/amino/encoding.js +234 -0
  23. package/dist/sdk/firmachain/amino/multisig.d.ts +10 -0
  24. package/dist/sdk/firmachain/amino/multisig.js +42 -0
  25. package/dist/sdk/firmachain/amino/paths.d.ts +6 -0
  26. package/dist/sdk/firmachain/amino/paths.js +18 -0
  27. package/dist/sdk/firmachain/amino/pubkeys.d.ts +47 -0
  28. package/dist/sdk/firmachain/amino/pubkeys.js +29 -0
  29. package/dist/sdk/firmachain/amino/secp256k1hdwallet.d.ts +94 -0
  30. package/dist/sdk/firmachain/amino/secp256k1hdwallet.js +437 -0
  31. package/dist/sdk/firmachain/amino/secp256k1wallet.d.ts +23 -0
  32. package/dist/sdk/firmachain/amino/secp256k1wallet.js +141 -0
  33. package/dist/sdk/firmachain/amino/signature.d.ts +16 -0
  34. package/dist/sdk/firmachain/amino/signature.js +36 -0
  35. package/dist/sdk/firmachain/amino/signdoc.d.ts +26 -0
  36. package/dist/sdk/firmachain/amino/signdoc.js +42 -0
  37. package/dist/sdk/firmachain/amino/signer.d.ts +33 -0
  38. package/dist/sdk/firmachain/amino/signer.js +2 -0
  39. package/dist/sdk/firmachain/amino/stdtx.d.ts +15 -0
  40. package/dist/sdk/firmachain/amino/stdtx.js +17 -0
  41. package/dist/sdk/firmachain/amino/wallet.d.ts +32 -0
  42. package/dist/sdk/firmachain/amino/wallet.js +132 -0
  43. package/dist/sdk/firmachain/bank/BankTxClient.d.ts +3 -2
  44. package/dist/sdk/firmachain/common/ITxClient.d.ts +4 -2
  45. package/dist/sdk/firmachain/common/ITxClient.js +10 -6
  46. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +27 -0
  47. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +165 -0
  48. package/dist/sdk/firmachain/common/LedgerWallet.d.ts +14 -0
  49. package/dist/sdk/firmachain/common/LedgerWallet.js +147 -0
  50. package/dist/sdk/firmachain/common/signing.js +17 -1
  51. package/dist/sdk/firmachain/common/signingstargateclient.js +19 -3
  52. package/dist/sdk/firmachain/common/stargateclient.js +5 -2
  53. package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +3 -2
  54. package/dist/sdk/firmachain/contract/ContractTxTypes.js +50 -9
  55. package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +3 -2
  56. package/dist/sdk/firmachain/distribution/index.js +0 -1
  57. package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +3 -2
  58. package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +63 -13
  59. package/dist/sdk/firmachain/google/protobuf/any.js +3 -2
  60. package/dist/sdk/firmachain/google/protobuf/descriptor.js +1364 -324
  61. package/dist/sdk/firmachain/gov/GovTxClient.d.ts +3 -2
  62. package/dist/sdk/firmachain/gov/index.js +0 -1
  63. package/dist/sdk/firmachain/nft/NftTxClient.d.ts +3 -2
  64. package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +3 -2
  65. package/dist/sdk/firmachain/token/TokenTxClient.d.ts +3 -2
  66. package/package.json +1 -1
@@ -76,7 +76,7 @@ var FirmaBankService = /** @class */ (function () {
76
76
  return [4 /*yield*/, this.getSignedTxSend(wallet, targetAddress, tokenID, FirmaUtil_1.FirmaUtil.getUTokenStringFromToken(amount, decimal), txMisc)];
77
77
  case 1:
78
78
  txRaw = _a.sent();
79
- bankTxClient = new bank_1.BankTxClient(wallet.getRawWallet(), this.config.rpcAddress);
79
+ bankTxClient = new bank_1.BankTxClient(wallet, this.config.rpcAddress);
80
80
  return [4 /*yield*/, bankTxClient.broadcast(txRaw)];
81
81
  case 2: return [2 /*return*/, _a.sent()];
82
82
  case 3:
@@ -99,7 +99,7 @@ var FirmaBankService = /** @class */ (function () {
99
99
  return [4 /*yield*/, this.getSignedTxSend(wallet, targetAddress, this.config.denom, FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amount), txMisc)];
100
100
  case 1:
101
101
  txRaw = _a.sent();
102
- bankTxClient = new bank_1.BankTxClient(wallet.getRawWallet(), this.config.rpcAddress);
102
+ bankTxClient = new bank_1.BankTxClient(wallet, this.config.rpcAddress);
103
103
  return [4 /*yield*/, bankTxClient.broadcast(txRaw)];
104
104
  case 2: return [2 /*return*/, _a.sent()];
105
105
  case 3:
@@ -189,7 +189,7 @@ var FirmaBankService = /** @class */ (function () {
189
189
  switch (_a.label) {
190
190
  case 0:
191
191
  _a.trys.push([0, 3, , 4]);
192
- bankTxClient = new bank_1.BankTxClient(wallet.getRawWallet(), this.config.rpcAddress);
192
+ bankTxClient = new bank_1.BankTxClient(wallet, this.config.rpcAddress);
193
193
  return [4 /*yield*/, wallet.getAddress()];
194
194
  case 1:
195
195
  address = _a.sent();
@@ -148,7 +148,7 @@ var ContractService = /** @class */ (function () {
148
148
  switch (_a.label) {
149
149
  case 0:
150
150
  _a.trys.push([0, 3, , 4]);
151
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
151
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
152
152
  return [4 /*yield*/, contractTxClient.sign(txList, contract_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
153
153
  case 1:
154
154
  txRaw = _a.sent();
@@ -195,7 +195,7 @@ var ContractService = /** @class */ (function () {
195
195
  return [4 /*yield*/, wallet.getAddress()];
196
196
  case 1:
197
197
  address = _a.sent();
198
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
198
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
199
199
  return [2 /*return*/, contractTxClient.msgCreateContractFile({
200
200
  creator: address,
201
201
  fileHash: fileHash,
@@ -223,7 +223,7 @@ var ContractService = /** @class */ (function () {
223
223
  return [4 /*yield*/, wallet.getAddress()];
224
224
  case 1:
225
225
  address = _a.sent();
226
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
226
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
227
227
  message = contractTxClient.msgCreateContractFile({
228
228
  creator: address,
229
229
  fileHash: fileHash,
@@ -253,7 +253,7 @@ var ContractService = /** @class */ (function () {
253
253
  return [4 /*yield*/, this.getSignedTxCreateContractFile(wallet, fileHash, timeStamp, ownerList, metaDataJsonString, txMisc)];
254
254
  case 1:
255
255
  txRaw = _a.sent();
256
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
256
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
257
257
  return [4 /*yield*/, contractTxClient.broadcast(txRaw)];
258
258
  case 2: return [2 /*return*/, _a.sent()];
259
259
  case 3:
@@ -298,7 +298,7 @@ var ContractService = /** @class */ (function () {
298
298
  return [4 /*yield*/, wallet.getAddress()];
299
299
  case 1:
300
300
  address = _a.sent();
301
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
301
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
302
302
  message = contractTxClient.msgAddContractLog({
303
303
  creator: address,
304
304
  contractHash: contractHash,
@@ -329,7 +329,7 @@ var ContractService = /** @class */ (function () {
329
329
  return [4 /*yield*/, this.getSignedTxAddContractLog(wallet, contractHash, timeStamp, eventName, ownerAddress, jsonString, txMisc)];
330
330
  case 1:
331
331
  txRaw = _a.sent();
332
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
332
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
333
333
  return [4 /*yield*/, contractTxClient.broadcast(txRaw)];
334
334
  case 2: return [2 /*return*/, _a.sent()];
335
335
  case 3:
@@ -351,7 +351,7 @@ var ContractService = /** @class */ (function () {
351
351
  return [4 /*yield*/, wallet.getAddress()];
352
352
  case 1:
353
353
  address = _a.sent();
354
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
354
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
355
355
  return [2 /*return*/, contractTxClient.msgAddContractLog({
356
356
  creator: address,
357
357
  contractHash: contractHash,
@@ -377,7 +377,7 @@ var ContractService = /** @class */ (function () {
377
377
  switch (_a.label) {
378
378
  case 0:
379
379
  _a.trys.push([0, 2, , 3]);
380
- contractTxClient = new contract_1.ContractTxClient(wallet.getRawWallet(), this.config.rpcAddress);
380
+ contractTxClient = new contract_1.ContractTxClient(wallet, this.config.rpcAddress);
381
381
  return [4 /*yield*/, contractTxClient.signAndBroadcast(msgList, contract_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
382
382
  case 1: return [2 /*return*/, _a.sent()];
383
383
  case 2:
@@ -161,7 +161,7 @@ var FirmaDistributionService = /** @class */ (function () {
161
161
  switch (_a.label) {
162
162
  case 0:
163
163
  _a.trys.push([0, 3, , 4]);
164
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
164
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
165
165
  return [4 /*yield*/, wallet.getAddress()];
166
166
  case 1:
167
167
  address = _a.sent();
@@ -185,7 +185,7 @@ var FirmaDistributionService = /** @class */ (function () {
185
185
  switch (_a.label) {
186
186
  case 0:
187
187
  _a.trys.push([0, 3, , 4]);
188
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
188
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
189
189
  return [4 /*yield*/, wallet.getAddress()];
190
190
  case 1:
191
191
  address = _a.sent();
@@ -209,7 +209,7 @@ var FirmaDistributionService = /** @class */ (function () {
209
209
  switch (_a.label) {
210
210
  case 0:
211
211
  _a.trys.push([0, 3, , 4]);
212
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
212
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
213
213
  return [4 /*yield*/, wallet.getAddress()];
214
214
  case 1:
215
215
  address = _a.sent();
@@ -234,7 +234,7 @@ var FirmaDistributionService = /** @class */ (function () {
234
234
  switch (_a.label) {
235
235
  case 0:
236
236
  _a.trys.push([0, 2, , 3]);
237
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
237
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
238
238
  message = txClient.msgWithdrawValidatorCommission({ validatorAddress: validatorAddres });
239
239
  return [4 /*yield*/, txClient.sign([message], distribution_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
240
240
  case 1: return [2 /*return*/, _a.sent()];
@@ -258,7 +258,7 @@ var FirmaDistributionService = /** @class */ (function () {
258
258
  return [4 /*yield*/, this.getSignedTxSetWithdrawAddress(wallet, withdrawAddress, txMisc)];
259
259
  case 1:
260
260
  txRaw = _a.sent();
261
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
261
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
262
262
  return [4 /*yield*/, txClient.broadcast(txRaw)];
263
263
  case 2: return [2 /*return*/, _a.sent()];
264
264
  case 3:
@@ -281,7 +281,7 @@ var FirmaDistributionService = /** @class */ (function () {
281
281
  return [4 /*yield*/, this.getSignedTxFundCommunityPool(wallet, amount, txMisc)];
282
282
  case 1:
283
283
  txRaw = _a.sent();
284
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
284
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
285
285
  return [4 /*yield*/, txClient.broadcast(txRaw)];
286
286
  case 2: return [2 /*return*/, _a.sent()];
287
287
  case 3:
@@ -304,7 +304,7 @@ var FirmaDistributionService = /** @class */ (function () {
304
304
  return [4 /*yield*/, this.getSignedTxWithdrawValidatorCommission(wallet, validatorAddres, txMisc)];
305
305
  case 1:
306
306
  txRaw = _a.sent();
307
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
307
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
308
308
  return [4 /*yield*/, txClient.broadcast(txRaw)];
309
309
  case 2: return [2 /*return*/, _a.sent()];
310
310
  case 3:
@@ -327,7 +327,7 @@ var FirmaDistributionService = /** @class */ (function () {
327
327
  return [4 /*yield*/, wallet.getAddress()];
328
328
  case 1:
329
329
  address = _a.sent();
330
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
330
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
331
331
  messageList = [];
332
332
  for (i = 0; i < delegationList.length; i++) {
333
333
  validatorAddress = delegationList[i].delegation.validator_address;
@@ -356,7 +356,7 @@ var FirmaDistributionService = /** @class */ (function () {
356
356
  return [4 /*yield*/, this.getSignedTxwithdrawAllRewardsFromAllValidator(wallet, delegationList, txMisc)];
357
357
  case 1:
358
358
  txRaw = _a.sent();
359
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
359
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
360
360
  return [4 /*yield*/, txClient.broadcast(txRaw)];
361
361
  case 2: return [2 /*return*/, _a.sent()];
362
362
  case 3:
@@ -379,7 +379,7 @@ var FirmaDistributionService = /** @class */ (function () {
379
379
  return [4 /*yield*/, this.getSignedTxWithdrawAllRewards(wallet, validatorAddress, txMisc)];
380
380
  case 1:
381
381
  txRaw = _a.sent();
382
- txClient = new distribution_1.DistributionTxClient(wallet.getRawWallet(), this.config.rpcAddress);
382
+ txClient = new distribution_1.DistributionTxClient(wallet, this.config.rpcAddress);
383
383
  return [4 /*yield*/, txClient.broadcast(txRaw)];
384
384
  case 2: return [2 /*return*/, _a.sent()];
385
385
  case 3:
@@ -79,7 +79,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
79
79
  return [4 /*yield*/, wallet.getAddress()];
80
80
  case 1:
81
81
  address = _a.sent();
82
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
82
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
83
83
  message = feeGrantTxClient.msgRevokeAllowance({ granter: address, grantee: granteeAddress });
84
84
  return [4 /*yield*/, feeGrantTxClient.sign([message], feegrant_1.getSignAndBroadcastOption(this.config.denom, txMisc))];
85
85
  case 2: return [2 /*return*/, _a.sent()];
@@ -103,7 +103,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
103
103
  return [4 /*yield*/, this.getSignedTxRevokeAllowance(wallet, granteeAddress, txMisc)];
104
104
  case 1:
105
105
  txRaw = _a.sent();
106
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
106
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
107
107
  return [4 /*yield*/, feeGrantTxClient.broadcast(txRaw)];
108
108
  case 2: return [2 /*return*/, _a.sent()];
109
109
  case 3:
@@ -153,7 +153,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
153
153
  return [4 /*yield*/, wallet.getAddress()];
154
154
  case 1:
155
155
  address = _a.sent();
156
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
156
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
157
157
  periodicAllowanceData = {
158
158
  basic: {
159
159
  spendLimit: this.getCoinType(feegrantOption.basicSpendLimit),
@@ -217,7 +217,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
217
217
  switch (_a.label) {
218
218
  case 0:
219
219
  _a.trys.push([0, 3, , 4]);
220
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
220
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
221
221
  return [4 /*yield*/, wallet.getAddress()];
222
222
  case 1:
223
223
  address = _a.sent();
@@ -257,7 +257,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
257
257
  return [4 /*yield*/, this.getSignedTxGrantPeriodicAllowance(wallet, granteeAddress, feegrantOption, txMisc)];
258
258
  case 1:
259
259
  txRaw = _a.sent();
260
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
260
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
261
261
  return [4 /*yield*/, feeGrantTxClient.broadcast(txRaw)];
262
262
  case 2: return [2 /*return*/, _a.sent()];
263
263
  case 3:
@@ -281,7 +281,7 @@ var FirmaFeeGrantService = /** @class */ (function () {
281
281
  return [4 /*yield*/, this.getSignedTxGrantBasicAllowance(wallet, granteeAddress, feegrantOption, txMisc)];
282
282
  case 1:
283
283
  txRaw = _a.sent();
284
- feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet.getRawWallet(), this.config.rpcAddress);
284
+ feeGrantTxClient = new feegrant_1.FeeGrantTxClient(wallet, this.config.rpcAddress);
285
285
  return [4 /*yield*/, feeGrantTxClient.broadcast(txRaw)];
286
286
  case 2: return [2 /*return*/, _a.sent()];
287
287
  case 3:
@@ -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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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.getRawWallet(), this.config.rpcAddress);
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:
@@ -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;
@@ -14,9 +15,12 @@ export declare class FirmaUtil {
14
15
  static getUFCTStringFromFCT(fctAmount: number): string;
15
16
  static getFCTStringFromUFCT(uFctAmount: number): string;
16
17
  static getFileHash(filePath: string): Promise<string>;
18
+ static getFileHashFromBuffer(buffer: Uint8Array): Promise<string>;
17
19
  static isValidAddress(address: string): boolean;
18
20
  static getValOperAddressFromAccAddress(address: string): string;
19
21
  static getAccAddressFromValOperAddress(address: string): string;
22
+ static getSignerDataForLedger(address: string): Promise<SignerData>;
20
23
  static estimateGas(txRaw: TxRaw): Promise<number>;
24
+ static estimateGasRaw(txRaw: Uint8Array): Promise<number>;
21
25
  static printLog(log: any): void;
22
26
  }