carbon-js-sdk 0.2.16-dev.3 → 0.2.16-dev.4

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 (50) hide show
  1. package/lib/clients/CarbonQueryClient.js +2 -2
  2. package/lib/clients/ETHClient.js +15 -15
  3. package/lib/clients/HydrogenClient.js +1 -1
  4. package/lib/clients/NEOClient.js +6 -6
  5. package/lib/clients/ZILClient.js +16 -16
  6. package/lib/codec/bank/tx.d.ts +64 -0
  7. package/lib/codec/bank/tx.js +236 -0
  8. package/lib/codec/cosmos/gov/v1beta1/query.js +2 -2
  9. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  10. package/lib/codec/cosmos/tx/v1beta1/tx.js +2 -2
  11. package/lib/constant/generic.js +1 -1
  12. package/lib/modules/cdp.js +52 -48
  13. package/lib/modules/gov.js +14 -14
  14. package/lib/modules/liquiditypool.js +1 -1
  15. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  16. package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
  17. package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
  18. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
  19. package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
  20. package/lib/provider/amino/types/admin.js +30 -30
  21. package/lib/provider/amino/types/bank.js +1 -1
  22. package/lib/provider/amino/types/broker.js +1 -1
  23. package/lib/provider/amino/types/cdp.js +22 -22
  24. package/lib/provider/amino/types/coin.js +2 -2
  25. package/lib/provider/amino/types/gov.js +4 -4
  26. package/lib/provider/amino/types/ibc.js +1 -1
  27. package/lib/provider/amino/types/leverage.js +1 -1
  28. package/lib/provider/amino/types/liquidityPool.js +7 -7
  29. package/lib/provider/amino/types/market.js +1 -1
  30. package/lib/provider/amino/types/oracle.js +1 -1
  31. package/lib/provider/amino/types/order.js +4 -4
  32. package/lib/provider/amino/types/position.js +1 -1
  33. package/lib/provider/amino/types/profile.js +1 -1
  34. package/lib/provider/amino/types/staking.js +4 -4
  35. package/lib/provider/amino/types/subaccount.js +3 -3
  36. package/lib/provider/amino/utils.js +11 -11
  37. package/lib/provider/keplr/KeplrStore.js +1 -1
  38. package/lib/provider/ledger/ledger.js +2 -2
  39. package/lib/provider/metamask/MetaMask.js +1 -1
  40. package/lib/provider/o3/O3Wallet.js +2 -2
  41. package/lib/util/address.js +13 -13
  42. package/lib/util/api.js +4 -4
  43. package/lib/util/fetch.js +1 -1
  44. package/lib/util/generic.js +3 -3
  45. package/lib/util/number.js +5 -5
  46. package/lib/wallet/CarbonSigner.js +2 -2
  47. package/lib/wallet/CarbonSigningClient.js +8 -8
  48. package/lib/wallet/CarbonWallet.js +6 -6
  49. package/lib/websocket/connector.js +3 -3
  50. package/package.json +1 -1
@@ -148,7 +148,7 @@ class CarbonWallet {
148
148
  const signerData = Object.assign({ accountNumber: this.accountInfo.accountNumber, chainId: this.getChainId(), sequence }, explicitSignerData);
149
149
  const fee = (_a = opts === null || opts === void 0 ? void 0 : opts.fee) !== null && _a !== void 0 ? _a : this.estimateTxFee(messages, feeDenom);
150
150
  const txRaw = yield signingClient.sign(signerAddress, messages, fee, memo, signerData);
151
- signature = (0, amino_1.encodeSecp256k1Signature)(account.pubkey, txRaw.signatures[0]);
151
+ signature = amino_1.encodeSecp256k1Signature(account.pubkey, txRaw.signatures[0]);
152
152
  return txRaw;
153
153
  }
154
154
  finally {
@@ -166,7 +166,7 @@ class CarbonWallet {
166
166
  const tx = CarbonWallet.TxRaw.encode(txRaw).finish();
167
167
  const carbonClient = this.getSigningClient();
168
168
  const response = yield carbonClient.broadcastTx(tx, timeoutMs, pollIntervalMs);
169
- if ((0, stargate_1.isDeliverTxFailure)(response)) {
169
+ if (stargate_1.isDeliverTxFailure(response)) {
170
170
  // tx failed
171
171
  throw new Error(`[${response.code}] ${response.rawLog}`);
172
172
  }
@@ -205,9 +205,9 @@ class CarbonWallet {
205
205
  try {
206
206
  if (!this.accountInfo || this.sequenceInvalidated)
207
207
  yield this.reloadAccountSequence();
208
- const heightResponse = yield (0, fetch_1.fetch)(`${this.networkConfig.tmRpcUrl}/blockchain?cache=${new Date().getTime()}`);
208
+ const heightResponse = yield fetch_1.fetch(`${this.networkConfig.tmRpcUrl}/blockchain?cache=${new Date().getTime()}`);
209
209
  const heightRes = yield heightResponse.json();
210
- const height = (0, number_1.bnOrZero)((_a = heightRes.result) === null || _a === void 0 ? void 0 : _a.last_height);
210
+ const height = number_1.bnOrZero((_a = heightRes.result) === null || _a === void 0 ? void 0 : _a.last_height);
211
211
  const timeoutHeight = height.isZero() ? undefined : height.toNumber() + this.defaultTimeoutBlocks;
212
212
  const sequence = this.accountInfo.sequence;
213
213
  this.accountInfo = Object.assign(Object.assign({}, this.accountInfo), { sequence: sequence + 1 });
@@ -341,12 +341,12 @@ class CarbonWallet {
341
341
  const queryClient = this.getQueryClient();
342
342
  const { msgGasCosts } = yield queryClient.fee.MsgGasCostAll({});
343
343
  this.txGasCosts = msgGasCosts.reduce((result, item) => {
344
- result[item.msgType] = (0, number_1.bnOrZero)(item.gasCost);
344
+ result[item.msgType] = number_1.bnOrZero(item.gasCost);
345
345
  return result;
346
346
  }, {});
347
347
  const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({});
348
348
  this.txGasPrices = minGasPrices.reduce((result, item) => {
349
- result[item.denom] = (0, number_1.bnOrZero)(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
349
+ result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
350
350
  return result;
351
351
  }, {});
352
352
  if (!this.txGasPrices[this.defaultFeeDenom]) {
@@ -171,7 +171,7 @@ class WSConnector {
171
171
  params = [params]; // eslint-disable-line no-param-reassign
172
172
  }
173
173
  for (const param of params) {
174
- const channelId = (0, channel_1.generateChannelId)(param);
174
+ const channelId = channel_1.generateChannelId(param);
175
175
  const shouldSubscribe = this.channelHandlers[channelId] === undefined;
176
176
  this.channelHandlers[channelId] = handler;
177
177
  if (shouldSubscribe) {
@@ -193,7 +193,7 @@ class WSConnector {
193
193
  }
194
194
  const channelIds = [];
195
195
  for (const param of params) {
196
- const channelId = (0, channel_1.generateChannelId)(param);
196
+ const channelId = channel_1.generateChannelId(param);
197
197
  delete this.channelHandlers[channelId];
198
198
  }
199
199
  this.send('unsubscribe', {
@@ -279,7 +279,7 @@ class WSConnector {
279
279
  if (!channelHandler) {
280
280
  this.debugLog(`handler not found for channel: ${message.channel}`);
281
281
  try {
282
- const params = (0, channel_1.parseChannelId)(message.channel);
282
+ const params = channel_1.parseChannelId(message.channel);
283
283
  this.unsubscribe({ channel: params.channel });
284
284
  }
285
285
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-js-sdk",
3
- "version": "0.2.16-dev.3+0ee377d97a11",
3
+ "version": "0.2.16-dev.4+0ee377d97a11",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",