@firmachain/firma-js 0.2.46 → 0.2.48

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 (132) hide show
  1. package/dist/index.js +1 -5
  2. package/dist/sdk/FirmaAuthzService.js +5 -5
  3. package/dist/sdk/FirmaBankService.js +1 -1
  4. package/dist/sdk/FirmaChainService.d.ts +5 -0
  5. package/dist/sdk/FirmaChainService.js +44 -0
  6. package/dist/sdk/FirmaContractService.js +5 -5
  7. package/dist/sdk/FirmaCosmWasmCw20.d.ts +17 -0
  8. package/dist/sdk/FirmaCosmWasmCw20.js +269 -0
  9. package/dist/sdk/FirmaCosmWasmService.js +9 -9
  10. package/dist/sdk/FirmaDistributionService.js +5 -5
  11. package/dist/sdk/FirmaFeeGrantService.js +3 -3
  12. package/dist/sdk/FirmaGovService.js +7 -7
  13. package/dist/sdk/FirmaIbcService.js +1 -1
  14. package/dist/sdk/FirmaNftService.js +5 -5
  15. package/dist/sdk/FirmaSDK.d.ts +3 -1
  16. package/dist/sdk/FirmaSDK.js +4 -1
  17. package/dist/sdk/FirmaStakingService.js +5 -5
  18. package/dist/sdk/FirmaTokenService.js +4 -4
  19. package/dist/sdk/FirmaUtil.js +16 -20
  20. package/dist/sdk/FirmaWalletService.js +3 -3
  21. package/dist/sdk/firmachain/amino/addresses.js +11 -11
  22. package/dist/sdk/firmachain/amino/aminotypes.js +32 -36
  23. package/dist/sdk/firmachain/amino/encoding.js +26 -30
  24. package/dist/sdk/firmachain/amino/multisig.js +5 -5
  25. package/dist/sdk/firmachain/amino/signature.js +4 -4
  26. package/dist/sdk/firmachain/amino/signdoc.js +1 -1
  27. package/dist/sdk/firmachain/amino/wallet.js +10 -14
  28. package/dist/sdk/firmachain/authz/AuthzQueryClient.js +3 -3
  29. package/dist/sdk/firmachain/authz/index.js +1 -5
  30. package/dist/sdk/firmachain/bank/BankQueryClient.js +4 -4
  31. package/dist/sdk/firmachain/bank/index.js +1 -5
  32. package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +2 -2
  33. package/dist/sdk/firmachain/common/LedgerWallet.js +10 -14
  34. package/dist/sdk/firmachain/common/accounts.js +2 -2
  35. package/dist/sdk/firmachain/common/index.js +1 -5
  36. package/dist/sdk/firmachain/common/signing.js +5 -9
  37. package/dist/sdk/firmachain/common/signingaminostargateclient.js +16 -16
  38. package/dist/sdk/firmachain/common/signingstargateclient.js +14 -18
  39. package/dist/sdk/firmachain/common/stargateclient.js +6 -6
  40. package/dist/sdk/firmachain/contract/ContractQueryClient.js +2 -2
  41. package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +4 -4
  42. package/dist/sdk/firmachain/contract/index.js +1 -5
  43. package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +8 -8
  44. package/dist/sdk/firmachain/cosmwasm/index.js +1 -5
  45. package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +5 -5
  46. package/dist/sdk/firmachain/distribution/index.js +1 -5
  47. package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +2 -2
  48. package/dist/sdk/firmachain/feegrant/index.js +1 -5
  49. package/dist/sdk/firmachain/google/protobuf/any.d.ts +1 -1
  50. package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +27 -27
  51. package/dist/sdk/firmachain/google/protobuf/duration.d.ts +1 -1
  52. package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +1 -1
  53. package/dist/sdk/firmachain/gov/GovQueryClient.js +2 -2
  54. package/dist/sdk/firmachain/gov/index.js +1 -5
  55. package/dist/sdk/firmachain/ibc/IbcQueryClient.js +1 -1
  56. package/dist/sdk/firmachain/ibc/index.js +1 -5
  57. package/dist/sdk/firmachain/mint/index.js +1 -5
  58. package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +6 -6
  59. package/dist/sdk/firmachain/nft/index.js +1 -5
  60. package/dist/sdk/firmachain/slashing/index.js +1 -5
  61. package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +2 -2
  62. package/dist/sdk/firmachain/staking/StakingQueryClient.js +8 -8
  63. package/dist/sdk/firmachain/staking/index.js +1 -5
  64. package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +8 -8
  65. package/dist/sdk/firmachain/token/index.js +1 -5
  66. package/package.json +24 -24
  67. package/dist/test/00.wallet.test.d.ts +0 -1
  68. package/dist/test/00.wallet.test.js +0 -87
  69. package/dist/test/000./354/227/220/354/226/264/353/223/234/353/236/215_/353/246/254/354/212/244/355/205/214/354/235/264/355/201/254.test.d.ts +0 -1
  70. package/dist/test/000./354/227/220/354/226/264/353/223/234/353/236/215_/353/246/254/354/212/244/355/205/214/354/235/264/355/201/254.test.js +0 -302
  71. package/dist/test/000./354/236/254/353/213/250/352/264/200/353/240/250.test.d.ts +0 -1
  72. package/dist/test/000./354/236/254/353/213/250/352/264/200/353/240/250.test.js +0 -436
  73. package/dist/test/01.contract_tx.test.d.ts +0 -1
  74. package/dist/test/01.contract_tx.test.js +0 -146
  75. package/dist/test/02.contract_query.test.d.ts +0 -1
  76. package/dist/test/02.contract_query.test.js +0 -219
  77. package/dist/test/03.contract_scenario.test.d.ts +0 -1
  78. package/dist/test/03.contract_scenario.test.js +0 -559
  79. package/dist/test/04.bank_tx.test.d.ts +0 -1
  80. package/dist/test/04.bank_tx.test.js +0 -124
  81. package/dist/test/05.bank_query.test.d.ts +0 -1
  82. package/dist/test/05.bank_query.test.js +0 -164
  83. package/dist/test/06.feegrant_tx.test.d.ts +0 -1
  84. package/dist/test/06.feegrant_tx.test.js +0 -173
  85. package/dist/test/07.feegrant_query.test.d.ts +0 -1
  86. package/dist/test/07.feegrant_query.test.js +0 -81
  87. package/dist/test/08.gas_estimate.test.d.ts +0 -1
  88. package/dist/test/08.gas_estimate.test.js +0 -702
  89. package/dist/test/09.ipfs.test.d.ts +0 -1
  90. package/dist/test/09.ipfs.test.js +0 -69
  91. package/dist/test/10.nft_tx.test.d.ts +0 -1
  92. package/dist/test/10.nft_tx.test.js +0 -137
  93. package/dist/test/11.nft_query.test.d.ts +0 -1
  94. package/dist/test/11.nft_query.test.js +0 -167
  95. package/dist/test/12.staking_tx.test.d.ts +0 -1
  96. package/dist/test/12.staking_tx.test.js +0 -213
  97. package/dist/test/13.staking_query.test.d.ts +0 -1
  98. package/dist/test/13.staking_query.test.js +0 -206
  99. package/dist/test/14.distribution_tx.test.d.ts +0 -1
  100. package/dist/test/14.distribution_tx.test.js +0 -176
  101. package/dist/test/15.distribution_query.test.d.ts +0 -1
  102. package/dist/test/15.distribution_query.test.js +0 -216
  103. package/dist/test/16.gov_tx.test.d.ts +0 -1
  104. package/dist/test/16.gov_tx.test.js +0 -237
  105. package/dist/test/17.gov_query.test.d.ts +0 -1
  106. package/dist/test/17.gov_query.test.js +0 -115
  107. package/dist/test/18.util.test.d.ts +0 -1
  108. package/dist/test/18.util.test.js +0 -246
  109. package/dist/test/19.chain.test.d.ts +0 -1
  110. package/dist/test/19.chain.test.js +0 -67
  111. package/dist/test/20.slashing_query.test.d.ts +0 -1
  112. package/dist/test/20.slashing_query.test.js +0 -82
  113. package/dist/test/21.token_tx.test.d.ts +0 -1
  114. package/dist/test/21.token_tx.test.js +0 -154
  115. package/dist/test/22.token_query.test.d.ts +0 -1
  116. package/dist/test/22.token_query.test.js +0 -96
  117. package/dist/test/23.authz_tx.test.d.ts +0 -1
  118. package/dist/test/23.authz_tx.test.js +0 -468
  119. package/dist/test/24.authz_query.test.d.ts +0 -1
  120. package/dist/test/24.authz_query.test.js +0 -140
  121. package/dist/test/25.cosmwasm_tx.test.d.ts +0 -1
  122. package/dist/test/25.cosmwasm_tx.test.js +0 -188
  123. package/dist/test/26.cosmwasm_query.test.d.ts +0 -1
  124. package/dist/test/26.cosmwasm_query.test.js +0 -167
  125. package/dist/test/27.arbitary_sign.test.d.ts +0 -1
  126. package/dist/test/27.arbitary_sign.test.js +0 -164
  127. package/dist/test/28.ibc_tx.test.d.ts +0 -1
  128. package/dist/test/28.ibc_tx.test.js +0 -83
  129. package/dist/test/29.mint_query.copy.d.ts +0 -1
  130. package/dist/test/29.mint_query.copy.js +0 -54
  131. package/dist/test/config_test.d.ts +0 -5
  132. package/dist/test/config_test.js +0 -27
@@ -51,14 +51,10 @@ var __read = (this && this.__read) || function (o, n) {
51
51
  }
52
52
  return ar;
53
53
  };
54
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
55
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
56
- if (ar || !(i in from)) {
57
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
58
- ar[i] = from[i];
59
- }
60
- }
61
- return to.concat(ar || Array.prototype.slice.call(from));
54
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
55
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
56
+ to[j] = from[i];
57
+ return to;
62
58
  };
63
59
  var __importDefault = (this && this.__importDefault) || function (mod) {
64
60
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -95,7 +91,7 @@ function makeAuthInfoBytes(signers, feeAmount, gasLimit, granter, signMode) {
95
91
  var authInfo = {
96
92
  signerInfos: makeSignerInfos(signers, signMode),
97
93
  fee: {
98
- amount: __spreadArray([], __read(feeAmount), false),
94
+ amount: __spreadArray([], __read(feeAmount)),
99
95
  gasLimit: long_1.default.fromNumber(gasLimit),
100
96
  granter: granter,
101
97
  },
@@ -113,7 +109,7 @@ function signFromLedger(ledger, messages, option, registry) {
113
109
  return [4 /*yield*/, FirmaUtil_1.FirmaUtil.getSignerDataForLedger(address)];
114
110
  case 2:
115
111
  signerData = _b.sent();
116
- pubkey = (0, proto_signing_1.encodePubkey)((0, encoding_2.encodeSecp256k1Pubkey)(publicKey));
112
+ pubkey = proto_signing_1.encodePubkey(encoding_2.encodeSecp256k1Pubkey(publicKey));
117
113
  aminoTypes = new aminotypes_1.AminoTypes({});
118
114
  msgs = messages.map(function (msg) { return aminoTypes.toAmino(msg); });
119
115
  chainId = signerData.chain_id;
@@ -121,9 +117,9 @@ function signFromLedger(ledger, messages, option, registry) {
121
117
  sequence = Number.parseInt(signerData.sequence);
122
118
  memo = option.memo;
123
119
  fee = { amount: option.fee.amount, gas: option.fee.gas };
124
- signDoc = (0, signdoc_2.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence);
125
- signMessage = (0, signdoc_1.serializeSignDoc)(signDoc);
126
- return [4 /*yield*/, ledger.sign((0, encoding_3.fromUtf8)(signMessage))];
120
+ signDoc = signdoc_2.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence);
121
+ signMessage = signdoc_1.serializeSignDoc(signDoc);
122
+ return [4 /*yield*/, ledger.sign(encoding_3.fromUtf8(signMessage))];
127
123
  case 3:
128
124
  ledgerSignature = _b.sent();
129
125
  ;
@@ -141,7 +137,7 @@ function signFromLedger(ledger, messages, option, registry) {
141
137
  txRaw = tx_2.TxRaw.fromPartial({
142
138
  bodyBytes: signedTxBodyBytes,
143
139
  authInfoBytes: signedAuthInfoBytes,
144
- signatures: [(0, encoding_1.fromBase64)(Buffer.from(ledgerSignature).toString('base64'))],
140
+ signatures: [encoding_1.fromBase64(Buffer.from(ledgerSignature).toString('base64'))],
145
141
  });
146
142
  return [2 /*return*/, txRaw];
147
143
  }
@@ -10,7 +10,7 @@ function uint64FromProto(input) {
10
10
  }
11
11
  function accountFromBaseAccount(input) {
12
12
  var address = input.address, pubKey = input.pubKey, accountNumber = input.accountNumber, sequence = input.sequence;
13
- var pubkey = (0, proto_signing_1.decodePubkey)(pubKey);
13
+ var pubkey = proto_signing_1.decodePubkey(pubKey);
14
14
  return {
15
15
  address: address,
16
16
  pubkey: pubkey,
@@ -58,7 +58,7 @@ function accountFromAny(input) {
58
58
  return accountFromBaseAccount(baseAccount);
59
59
  }
60
60
  default:
61
- throw new Error("Unsupported type: '".concat(typeUrl, "'"));
61
+ throw new Error("Unsupported type: '" + typeUrl + "'");
62
62
  }
63
63
  }
64
64
  exports.accountFromAny = accountFromAny;
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -15,14 +15,10 @@ var __read = (this && this.__read) || function (o, n) {
15
15
  }
16
16
  return ar;
17
17
  };
18
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20
- if (ar || !(i in from)) {
21
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
22
- ar[i] = from[i];
23
- }
24
- }
25
- return to.concat(ar || Array.prototype.slice.call(from));
18
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
19
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
20
+ to[j] = from[i];
21
+ return to;
26
22
  };
27
23
  var __importDefault = (this && this.__importDefault) || function (mod) {
28
24
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -49,7 +45,7 @@ function makeAuthInfoBytes(signers, feeAmount, gasLimit, granter, signMode) {
49
45
  var authInfo = {
50
46
  signerInfos: makeSignerInfos(signers, signMode),
51
47
  fee: {
52
- amount: __spreadArray([], __read(feeAmount), false),
48
+ amount: __spreadArray([], __read(feeAmount)),
53
49
  gasLimit: long_1.default.fromNumber(gasLimit),
54
50
  granter: granter,
55
51
  },
@@ -77,7 +77,7 @@ function isMsgSignData(msg) {
77
77
  var castedMsg = msg;
78
78
  if (castedMsg.type !== "sign/MsgSignData")
79
79
  return false;
80
- if (!(0, utils_1.isNonNullObject)(castedMsg.value))
80
+ if (!utils_1.isNonNullObject(castedMsg.value))
81
81
  return false;
82
82
  if (typeof castedMsg.value.signer !== "string")
83
83
  return false;
@@ -128,7 +128,7 @@ var SigningAminoStargateClient = /** @class */ (function (_super) {
128
128
  type: "sign/MsgSignData",
129
129
  value: {
130
130
  signer: signerAddress,
131
- data: (0, encoding_1.toBase64)(d),
131
+ data: encoding_1.toBase64(d),
132
132
  },
133
133
  }); });
134
134
  return [4 /*yield*/, this.signer.getAccounts()];
@@ -137,15 +137,15 @@ var SigningAminoStargateClient = /** @class */ (function (_super) {
137
137
  if (!accountFromSigner) {
138
138
  throw new Error("Failed to retrieve account from signer");
139
139
  }
140
- signDoc = (0, amino_1.makeSignDoc)(msgs, fee, chainId, memo, accountNumber, sequence);
140
+ signDoc = amino_1.makeSignDoc(msgs, fee, chainId, memo, accountNumber, sequence);
141
141
  return [4 /*yield*/, this.signer.signAmino(signerAddress, signDoc)];
142
142
  case 2:
143
143
  _a = _b.sent(), signature = _a.signature, signed = _a.signed;
144
- if (!(0, fast_deep_equal_1.default)(signDoc, signed)) {
144
+ if (!fast_deep_equal_1.default(signDoc, signed)) {
145
145
  throw new Error("The signed document differs from the signing instruction. This is not supported for ADR-036.");
146
146
  }
147
- signatureResult = (0, tx_1.makeStdTx)(signDoc, signature);
148
- decodeData = (0, amino_1.decodeSignature)(signatureResult.signatures[0]);
147
+ signatureResult = tx_1.makeStdTx(signDoc, signature);
148
+ decodeData = amino_1.decodeSignature(signatureResult.signatures[0]);
149
149
  jsonData = {
150
150
  type: "sign/MsgSignData",
151
151
  signer: signatureResult.msg[0].value.signer,
@@ -164,7 +164,7 @@ var SigningAminoStargateClient = /** @class */ (function (_super) {
164
164
  return __generator(this, function (_a) {
165
165
  switch (_a.label) {
166
166
  case 0:
167
- newSignature = (0, amino_1.encodeSecp256k1Signature)(FirmaUtil_1.FirmaUtil.base64ToArrayBuffer(data.pubkey), FirmaUtil_1.FirmaUtil.base64ToArrayBuffer(data.signature));
167
+ newSignature = amino_1.encodeSecp256k1Signature(FirmaUtil_1.FirmaUtil.base64ToArrayBuffer(data.pubkey), FirmaUtil_1.FirmaUtil.base64ToArrayBuffer(data.signature));
168
168
  signed = {
169
169
  fee: {
170
170
  gas: "0",
@@ -202,15 +202,15 @@ var SigningAminoStargateClient = /** @class */ (function (_super) {
202
202
  if (signatures.length !== 1)
203
203
  throw new Error("Must have exactly one signature to be supported.");
204
204
  signature = signatures[0];
205
- if (!(0, amino_2.isSecp256k1Pubkey)(signature.pub_key)) {
205
+ if (!amino_2.isSecp256k1Pubkey(signature.pub_key)) {
206
206
  throw new Error("Only secp256k1 signatures are supported.");
207
207
  }
208
- signBytes = (0, amino_2.serializeSignDoc)((0, amino_1.makeSignDoc)(signed.msg, signed.fee, chainId, signed.memo, accountNumber, sequence));
209
- prehashed = (0, crypto_1.sha256)(signBytes);
210
- secpSignature = crypto_2.Secp256k1Signature.fromFixedLength((0, encoding_2.fromBase64)(signature.signature));
211
- rawSecp256k1Pubkey = (0, encoding_2.fromBase64)(signature.pub_key.value);
212
- rawSignerAddress = (0, amino_3.rawSecp256k1PubkeyToRawAddress)(rawSecp256k1Pubkey);
213
- if (signedMessages.some(function (msg) { return !(0, utils_2.arrayContentEquals)(encoding_1.Bech32.decode(msg.value.signer).data, rawSignerAddress); })) {
208
+ signBytes = amino_2.serializeSignDoc(amino_1.makeSignDoc(signed.msg, signed.fee, chainId, signed.memo, accountNumber, sequence));
209
+ prehashed = crypto_1.sha256(signBytes);
210
+ secpSignature = crypto_2.Secp256k1Signature.fromFixedLength(encoding_2.fromBase64(signature.signature));
211
+ rawSecp256k1Pubkey = encoding_2.fromBase64(signature.pub_key.value);
212
+ rawSignerAddress = amino_3.rawSecp256k1PubkeyToRawAddress(rawSecp256k1Pubkey);
213
+ if (signedMessages.some(function (msg) { return !utils_2.arrayContentEquals(encoding_1.Bech32.decode(msg.value.signer).data, rawSignerAddress); })) {
214
214
  throw new Error("Found mismatch between signer in message and public key");
215
215
  }
216
216
  return [4 /*yield*/, crypto_2.Secp256k1.verifySignature(secpSignature, prehashed, rawSecp256k1Pubkey)];
@@ -237,7 +237,7 @@ var SigningAminoStargateClient = /** @class */ (function (_super) {
237
237
  case 0:
238
238
  _a.trys.push([0, 2, , 3]);
239
239
  accAddress = this.toAccAddress(address);
240
- hexAccAddress = "0x01".concat(Buffer.from(accAddress).toString("hex"));
240
+ hexAccAddress = "0x01" + Buffer.from(accAddress).toString("hex");
241
241
  axios = axios_1.default.create({
242
242
  baseURL: SigningAminoStargateClient._endpoint,
243
243
  headers: {
@@ -251,7 +251,7 @@ var SigningAminoStargateClient = /** @class */ (function (_super) {
251
251
  result = _a.sent();
252
252
  finalData = result.data.result.response.value;
253
253
  account = any_1.Any.decode(Buffer.from(finalData, "base64"));
254
- finalAccount = (0, accounts_1.accountFromAny)(account);
254
+ finalAccount = accounts_1.accountFromAny(account);
255
255
  return [2 /*return*/, finalAccount];
256
256
  case 2:
257
257
  error_1 = _a.sent();
@@ -66,14 +66,10 @@ var __read = (this && this.__read) || function (o, n) {
66
66
  }
67
67
  return ar;
68
68
  };
69
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
70
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
71
- if (ar || !(i in from)) {
72
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
73
- ar[i] = from[i];
74
- }
75
- }
76
- return to.concat(ar || Array.prototype.slice.call(from));
69
+ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
70
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
71
+ to[j] = from[i];
72
+ return to;
77
73
  };
78
74
  var __importDefault = (this && this.__importDefault) || function (mod) {
79
75
  return (mod && mod.__esModule) ? mod : { "default": mod };
@@ -149,8 +145,8 @@ var SigningStargateClient = /** @class */ (function (_super) {
149
145
  account = _b.sent();
150
146
  if (account == null)
151
147
  throw new Error("Failed to retrieve account from signer");
152
- rawSecp256k1Pubkey = (0, encoding_1.fromBase64)(pubkeyStr);
153
- pubkey = (0, proto_signing_1.encodePubkey)((0, encoding_3.encodeSecp256k1Pubkey)(rawSecp256k1Pubkey));
148
+ rawSecp256k1Pubkey = encoding_1.fromBase64(pubkeyStr);
149
+ pubkey = proto_signing_1.encodePubkey(encoding_3.encodeSecp256k1Pubkey(rawSecp256k1Pubkey));
154
150
  txBodyEncodeObject = {
155
151
  typeUrl: "/cosmos.tx.v1beta1.TxBody",
156
152
  value: {
@@ -161,7 +157,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
161
157
  txBodyBytes = registry.encode(txBodyEncodeObject);
162
158
  gasLimit = math_1.Int53.fromString(fee.gas).toNumber();
163
159
  authInfoBytes = this.makeAuthInfoBytes([{ pubkey: pubkey, sequence: sequence }], fee.amount, gasLimit, fee.granter);
164
- return [2 /*return*/, (0, proto_signing_1.makeSignDoc)(txBodyBytes, authInfoBytes, chainId, accountNumber)];
160
+ return [2 /*return*/, proto_signing_1.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber)];
165
161
  }
166
162
  });
167
163
  });
@@ -228,7 +224,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
228
224
  case 0:
229
225
  _a.trys.push([0, 2, , 3]);
230
226
  accAddress = this.toAccAddress(address);
231
- hexAccAddress = "0x01".concat(Buffer.from(accAddress).toString("hex"));
227
+ hexAccAddress = "0x01" + Buffer.from(accAddress).toString("hex");
232
228
  axios = axios_1.default.create({
233
229
  baseURL: SigningStargateClient._endpoint,
234
230
  headers: {
@@ -242,7 +238,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
242
238
  result = _a.sent();
243
239
  finalData = result.data.result.response.value;
244
240
  account = any_1.Any.decode(Buffer.from(finalData, "base64"));
245
- finalAccount = (0, accounts_1.accountFromAny)(account);
241
+ finalAccount = accounts_1.accountFromAny(account);
246
242
  return [2 /*return*/, finalAccount];
247
243
  case 2:
248
244
  error_1 = _a.sent();
@@ -288,7 +284,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
288
284
  var authInfo = {
289
285
  signerInfos: this.makeSignerInfos(signers, signMode),
290
286
  fee: {
291
- amount: __spreadArray([], __read(feeAmount), false),
287
+ amount: __spreadArray([], __read(feeAmount)),
292
288
  gasLimit: long_1.default.fromNumber(gasLimit),
293
289
  granter: granter,
294
290
  },
@@ -307,7 +303,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
307
303
  if (!accountFromSigner) {
308
304
  throw new Error("Failed to retrieve account from signer");
309
305
  }
310
- pubkey = (0, proto_signing_1.encodePubkey)((0, encoding_3.encodeSecp256k1Pubkey)(accountFromSigner.pubkey));
306
+ pubkey = proto_signing_1.encodePubkey(encoding_3.encodeSecp256k1Pubkey(accountFromSigner.pubkey));
311
307
  txBodyEncodeObject = {
312
308
  typeUrl: "/cosmos.tx.v1beta1.TxBody",
313
309
  value: {
@@ -318,14 +314,14 @@ var SigningStargateClient = /** @class */ (function (_super) {
318
314
  txBodyBytes = this.registry.encode(txBodyEncodeObject);
319
315
  gasLimit = math_1.Int53.fromString(fee.gas).toNumber();
320
316
  authInfoBytes = SigningStargateClient.makeAuthInfoBytes([{ pubkey: pubkey, sequence: sequence }], fee.amount, gasLimit, fee.granter);
321
- signDoc = (0, proto_signing_1.makeSignDoc)(txBodyBytes, authInfoBytes, chainId, accountNumber);
317
+ signDoc = proto_signing_1.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
322
318
  return [4 /*yield*/, this.getSigner().signDirect(signerAddress, signDoc)];
323
319
  case 2:
324
320
  _b = _c.sent(), signature = _b.signature, signed = _b.signed;
325
321
  return [2 /*return*/, tx_1.TxRaw.fromPartial({
326
322
  bodyBytes: signed.bodyBytes,
327
323
  authInfoBytes: signed.authInfoBytes,
328
- signatures: [(0, encoding_1.fromBase64)(signature.signature)],
324
+ signatures: [encoding_1.fromBase64(signature.signature)],
329
325
  })];
330
326
  }
331
327
  });
@@ -348,7 +344,7 @@ var SigningStargateClient = /** @class */ (function (_super) {
348
344
  txRaw = tx_1.TxRaw.fromPartial({
349
345
  bodyBytes: signed.bodyBytes,
350
346
  authInfoBytes: signed.authInfoBytes,
351
- signatures: [(0, encoding_1.fromBase64)(signature.signature)],
347
+ signatures: [encoding_1.fromBase64(signature.signature)],
352
348
  });
353
349
  return [2 /*return*/, { txRaw: txRaw, signature: signature.signature }];
354
350
  }
@@ -108,7 +108,7 @@ var StargateClient = /** @class */ (function () {
108
108
  var results;
109
109
  return __generator(this, function (_b) {
110
110
  switch (_b.label) {
111
- case 0: return [4 /*yield*/, this.txsQuery("tx.hash='".concat(id, "'"))];
111
+ case 0: return [4 /*yield*/, this.txsQuery("tx.hash='" + id + "'")];
112
112
  case 1:
113
113
  results = _b.sent();
114
114
  return [2 /*return*/, (_a = results[0]) !== null && _a !== void 0 ? _a : null];
@@ -139,9 +139,9 @@ var StargateClient = /** @class */ (function () {
139
139
  switch (_a.label) {
140
140
  case 0:
141
141
  if (timedOut) {
142
- throw new TimeoutError("Transaction with ID ".concat(txId, " was submitted but was not yet found on the chain. You might want to check later."), txId);
142
+ throw new TimeoutError("Transaction with ID " + txId + " was submitted but was not yet found on the chain. You might want to check later.", txId);
143
143
  }
144
- return [4 /*yield*/, (0, utils_1.sleep)(pollIntervalMs)];
144
+ return [4 /*yield*/, utils_1.sleep(pollIntervalMs)];
145
145
  case 1:
146
146
  _a.sent();
147
147
  return [4 /*yield*/, this.getTx(txId)];
@@ -167,9 +167,9 @@ var StargateClient = /** @class */ (function () {
167
167
  case 2:
168
168
  broadcasted = _a.sent();
169
169
  if (broadcasted.code) {
170
- throw new Error("Broadcasting transaction failed with code ".concat(broadcasted.code, " (codespace: ").concat(broadcasted.codeSpace, "). Log: ").concat(broadcasted.log));
170
+ throw new Error("Broadcasting transaction failed with code " + broadcasted.code + " (codespace: " + broadcasted.codeSpace + "). Log: " + broadcasted.log);
171
171
  }
172
- transactionId = (0, encoding_1.toHex)(broadcasted.hash).toUpperCase();
172
+ transactionId = encoding_1.toHex(broadcasted.hash).toUpperCase();
173
173
  return [2 /*return*/, new Promise(function (resolve, reject) {
174
174
  return pollForTx(transactionId).then(function (value) {
175
175
  clearTimeout(txPollTimeout);
@@ -194,7 +194,7 @@ var StargateClient = /** @class */ (function () {
194
194
  return [2 /*return*/, results.txs.map(function (tx) {
195
195
  return {
196
196
  height: tx.height,
197
- hash: (0, encoding_1.toHex)(tx.hash).toUpperCase(),
197
+ hash: encoding_1.toHex(tx.hash).toUpperCase(),
198
198
  code: tx.result.code,
199
199
  rawLog: tx.result.log || "",
200
200
  tx: tx.tx,
@@ -87,7 +87,7 @@ var ContractQueryClient = /** @class */ (function () {
87
87
  return __generator(this, function (_a) {
88
88
  switch (_a.label) {
89
89
  case 0:
90
- path = "/firmachain/firmachain/contract/contractFile/".concat(fileHash);
90
+ path = "/firmachain/firmachain/contract/contractFile/" + fileHash;
91
91
  return [4 /*yield*/, this.axios.get(path)];
92
92
  case 1:
93
93
  result = _a.sent();
@@ -122,7 +122,7 @@ var ContractQueryClient = /** @class */ (function () {
122
122
  return __generator(this, function (_a) {
123
123
  switch (_a.label) {
124
124
  case 0:
125
- path = "/firmachain/firmachain/contract/contractLog/".concat(logId);
125
+ path = "/firmachain/firmachain/contract/contractLog/" + logId;
126
126
  return [4 /*yield*/, this.axios.get(path)];
127
127
  case 1:
128
128
  result = _a.sent();
@@ -22,28 +22,28 @@ export interface MsgAddContractLogResponse {
22
22
  }
23
23
  export declare const MsgCreateContractFile: {
24
24
  encode(message: MsgCreateContractFile, writer?: Writer): Writer;
25
- decode(input: Reader | Uint8Array, length?: number): MsgCreateContractFile;
25
+ decode(input: Reader | Uint8Array, length?: number | undefined): MsgCreateContractFile;
26
26
  fromJSON(object: any): MsgCreateContractFile;
27
27
  toJSON(message: MsgCreateContractFile): unknown;
28
28
  fromPartial(object: DeepPartial<MsgCreateContractFile>): MsgCreateContractFile;
29
29
  };
30
30
  export declare const MsgCreateContractFileResponse: {
31
31
  encode(_: MsgCreateContractFileResponse, writer?: Writer): Writer;
32
- decode(input: Reader | Uint8Array, length?: number): MsgCreateContractFileResponse;
32
+ decode(input: Reader | Uint8Array, length?: number | undefined): MsgCreateContractFileResponse;
33
33
  fromJSON(_: any): MsgCreateContractFileResponse;
34
34
  toJSON(_: MsgCreateContractFileResponse): unknown;
35
35
  fromPartial(_: DeepPartial<MsgCreateContractFileResponse>): MsgCreateContractFileResponse;
36
36
  };
37
37
  export declare const MsgAddContractLog: {
38
38
  encode(message: MsgAddContractLog, writer?: Writer): Writer;
39
- decode(input: Reader | Uint8Array, length?: number): MsgAddContractLog;
39
+ decode(input: Reader | Uint8Array, length?: number | undefined): MsgAddContractLog;
40
40
  fromJSON(object: any): MsgAddContractLog;
41
41
  toJSON(message: MsgAddContractLog): unknown;
42
42
  fromPartial(object: DeepPartial<MsgAddContractLog>): MsgAddContractLog;
43
43
  };
44
44
  export declare const MsgAddContractLogResponse: {
45
45
  encode(message: MsgAddContractLogResponse, writer?: Writer): Writer;
46
- decode(input: Reader | Uint8Array, length?: number): MsgAddContractLogResponse;
46
+ decode(input: Reader | Uint8Array, length?: number | undefined): MsgAddContractLogResponse;
47
47
  fromJSON(object: any): MsgAddContractLogResponse;
48
48
  toJSON(message: MsgAddContractLogResponse): unknown;
49
49
  fromPartial(object: DeepPartial<MsgAddContractLogResponse>): MsgAddContractLogResponse;
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -72,7 +72,7 @@ var CosmWasmQueryClient = /** @class */ (function () {
72
72
  return __generator(this, function (_a) {
73
73
  switch (_a.label) {
74
74
  case 0:
75
- path = "/cosmwasm/wasm/v1/code/".concat(codeId);
75
+ path = "/cosmwasm/wasm/v1/code/" + codeId;
76
76
  return [4 /*yield*/, this.axios.get(path)];
77
77
  case 1:
78
78
  result = _a.sent();
@@ -87,7 +87,7 @@ var CosmWasmQueryClient = /** @class */ (function () {
87
87
  return __generator(this, function (_a) {
88
88
  switch (_a.label) {
89
89
  case 0:
90
- path = "/cosmwasm/wasm/v1/code/".concat(codeId, "/contracts");
90
+ path = "/cosmwasm/wasm/v1/code/" + codeId + "/contracts";
91
91
  return [4 /*yield*/, this.axios.get(path)];
92
92
  case 1:
93
93
  result = _a.sent();
@@ -102,7 +102,7 @@ var CosmWasmQueryClient = /** @class */ (function () {
102
102
  return __generator(this, function (_a) {
103
103
  switch (_a.label) {
104
104
  case 0:
105
- path = "/cosmwasm/wasm/v1/contract/".concat(contractAddress);
105
+ path = "/cosmwasm/wasm/v1/contract/" + contractAddress;
106
106
  return [4 /*yield*/, this.axios.get(path)];
107
107
  case 1:
108
108
  result = _a.sent();
@@ -117,7 +117,7 @@ var CosmWasmQueryClient = /** @class */ (function () {
117
117
  return __generator(this, function (_a) {
118
118
  switch (_a.label) {
119
119
  case 0:
120
- path = "/cosmwasm/wasm/v1/contract/".concat(contractAddress, "/history");
120
+ path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/history";
121
121
  return [4 /*yield*/, this.axios.get(path)];
122
122
  case 1:
123
123
  result = _a.sent();
@@ -133,7 +133,7 @@ var CosmWasmQueryClient = /** @class */ (function () {
133
133
  switch (_a.label) {
134
134
  case 0:
135
135
  hexStringBase64 = Buffer.from(hexString, 'hex').toString('base64');
136
- path = "/cosmwasm/wasm/v1/contract/".concat(contractAddress, "/raw/").concat(hexStringBase64);
136
+ path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/raw/" + hexStringBase64;
137
137
  return [4 /*yield*/, this.axios.get(path)];
138
138
  case 1:
139
139
  result = _a.sent();
@@ -149,11 +149,11 @@ var CosmWasmQueryClient = /** @class */ (function () {
149
149
  switch (_a.label) {
150
150
  case 0:
151
151
  queryBase64 = Buffer.from(query, 'binary').toString('base64');
152
- path = "/cosmwasm/wasm/v1/contract/".concat(contractAddress, "/smart/").concat(queryBase64);
152
+ path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/smart/" + queryBase64;
153
153
  return [4 /*yield*/, this.axios.get(path)];
154
154
  case 1:
155
155
  result = _a.sent();
156
- return [2 /*return*/, result.data.data];
156
+ return [2 /*return*/, JSON.stringify(result.data.data)];
157
157
  }
158
158
  });
159
159
  });
@@ -164,7 +164,7 @@ var CosmWasmQueryClient = /** @class */ (function () {
164
164
  return __generator(this, function (_a) {
165
165
  switch (_a.label) {
166
166
  case 0:
167
- path = "/cosmwasm/wasm/v1/contract/".concat(contractAddress, "/state");
167
+ path = "/cosmwasm/wasm/v1/contract/" + contractAddress + "/state";
168
168
  return [4 /*yield*/, this.axios.get(path)];
169
169
  case 1:
170
170
  result = _a.sent();
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -57,7 +57,7 @@ var DistributionQueryClient = /** @class */ (function () {
57
57
  return __generator(this, function (_a) {
58
58
  switch (_a.label) {
59
59
  case 0:
60
- path = "/cosmos/distribution/v1beta1/delegators/".concat(address, "/rewards/").concat(validatorAddress);
60
+ path = "/cosmos/distribution/v1beta1/delegators/" + address + "/rewards/" + validatorAddress;
61
61
  return [4 /*yield*/, this.axios.get(path)];
62
62
  case 1:
63
63
  result = _a.sent();
@@ -76,7 +76,7 @@ var DistributionQueryClient = /** @class */ (function () {
76
76
  return __generator(this, function (_a) {
77
77
  switch (_a.label) {
78
78
  case 0:
79
- path = "/cosmos/distribution/v1beta1/validators/".concat(address, "/outstanding_rewards");
79
+ path = "/cosmos/distribution/v1beta1/validators/" + address + "/outstanding_rewards";
80
80
  return [4 /*yield*/, this.axios.get(path)];
81
81
  case 1:
82
82
  result = _a.sent();
@@ -91,7 +91,7 @@ var DistributionQueryClient = /** @class */ (function () {
91
91
  return __generator(this, function (_a) {
92
92
  switch (_a.label) {
93
93
  case 0:
94
- path = "/cosmos/distribution/v1beta1/validators/".concat(address, "/commission");
94
+ path = "/cosmos/distribution/v1beta1/validators/" + address + "/commission";
95
95
  return [4 /*yield*/, this.axios.get(path)];
96
96
  case 1:
97
97
  result = _a.sent();
@@ -106,7 +106,7 @@ var DistributionQueryClient = /** @class */ (function () {
106
106
  return __generator(this, function (_a) {
107
107
  switch (_a.label) {
108
108
  case 0:
109
- path = "/cosmos/distribution/v1beta1/delegators/".concat(address, "/rewards");
109
+ path = "/cosmos/distribution/v1beta1/delegators/" + address + "/rewards";
110
110
  return [4 /*yield*/, this.axios.get(path)];
111
111
  case 1:
112
112
  result = _a.sent();
@@ -153,7 +153,7 @@ var DistributionQueryClient = /** @class */ (function () {
153
153
  return __generator(this, function (_a) {
154
154
  switch (_a.label) {
155
155
  case 0:
156
- path = "/cosmos/distribution/v1beta1/delegators/".concat(address, "/withdraw_address");
156
+ path = "/cosmos/distribution/v1beta1/delegators/" + address + "/withdraw_address";
157
157
  return [4 /*yield*/, this.axios.get(path)];
158
158
  case 1:
159
159
  result = _a.sent();
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -57,7 +57,7 @@ var FeeGrantQueryClient = /** @class */ (function () {
57
57
  return __generator(this, function (_a) {
58
58
  switch (_a.label) {
59
59
  case 0:
60
- path = "/cosmos/feegrant/v1beta1/allowance/".concat(granterAddress, "/").concat(granteeAddress);
60
+ path = "/cosmos/feegrant/v1beta1/allowance/" + granterAddress + "/" + granteeAddress;
61
61
  return [4 /*yield*/, this.axios.get(path)];
62
62
  case 1:
63
63
  result = _a.sent();
@@ -72,7 +72,7 @@ var FeeGrantQueryClient = /** @class */ (function () {
72
72
  return __generator(this, function (_a) {
73
73
  switch (_a.label) {
74
74
  case 0:
75
- path = "/cosmos/feegrant/v1beta1/allowances/".concat(granteeAddress);
75
+ path = "/cosmos/feegrant/v1beta1/allowances/" + granteeAddress;
76
76
  return [4 /*yield*/, this.axios.get(path)];
77
77
  case 1:
78
78
  result = _a.sent();
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -117,7 +117,7 @@ export interface Any {
117
117
  }
118
118
  export declare const Any: {
119
119
  encode(message: Any, writer?: Writer): Writer;
120
- decode(input: Reader | Uint8Array, length?: number): Any;
120
+ decode(input: Reader | Uint8Array, length?: number | undefined): Any;
121
121
  fromJSON(object: any): Any;
122
122
  fromPartial(object: DeepPartial<Any>): Any;
123
123
  };