carbon-js-sdk 0.2.9-dev.1 → 0.2.9-dev.2

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 (47) hide show
  1. package/lib/clients/CarbonQueryClient.js +1 -1
  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/cosmos/gov/v1beta1/query.js +2 -2
  7. package/lib/codec/cosmos/gov/v1beta1/tx.js +2 -2
  8. package/lib/codec/cosmos/tx/v1beta1/tx.js +2 -2
  9. package/lib/constant/generic.js +1 -1
  10. package/lib/modules/gov.js +14 -14
  11. package/lib/modules/liquiditypool.js +1 -1
  12. package/lib/provider/account/EthLedgerAccount/EthLedgerAccount.js +1 -1
  13. package/lib/provider/account/NeoLedgerAccount/N3Ledger/ErrorCode.js +1 -1
  14. package/lib/provider/account/NeoLedgerAccount/N3Ledger/main.js +8 -8
  15. package/lib/provider/account/NeoLedgerAccount/NeoLedgerAccount.js +3 -3
  16. package/lib/provider/account/NeoLedgerAccount/NeonLedger.js +1 -1
  17. package/lib/provider/amino/types/admin.js +27 -27
  18. package/lib/provider/amino/types/bank.js +1 -1
  19. package/lib/provider/amino/types/broker.js +1 -1
  20. package/lib/provider/amino/types/cdp.js +12 -12
  21. package/lib/provider/amino/types/coin.js +2 -2
  22. package/lib/provider/amino/types/gov.js +4 -4
  23. package/lib/provider/amino/types/ibc.js +1 -1
  24. package/lib/provider/amino/types/leverage.js +1 -1
  25. package/lib/provider/amino/types/liquidityPool.js +7 -7
  26. package/lib/provider/amino/types/market.js +1 -1
  27. package/lib/provider/amino/types/oracle.js +1 -1
  28. package/lib/provider/amino/types/order.js +4 -4
  29. package/lib/provider/amino/types/position.js +1 -1
  30. package/lib/provider/amino/types/profile.js +1 -1
  31. package/lib/provider/amino/types/staking.js +4 -4
  32. package/lib/provider/amino/types/subaccount.js +3 -3
  33. package/lib/provider/amino/utils.js +11 -11
  34. package/lib/provider/keplr/KeplrStore.js +1 -1
  35. package/lib/provider/ledger/ledger.js +2 -2
  36. package/lib/provider/metamask/MetaMask.js +1 -1
  37. package/lib/provider/o3/O3Wallet.js +2 -2
  38. package/lib/util/address.js +13 -13
  39. package/lib/util/api.js +4 -4
  40. package/lib/util/fetch.js +1 -1
  41. package/lib/util/generic.js +3 -3
  42. package/lib/util/number.js +5 -5
  43. package/lib/wallet/CarbonSigner.js +2 -2
  44. package/lib/wallet/CarbonSigningClient.js +8 -8
  45. package/lib/wallet/CarbonWallet.js +6 -6
  46. package/lib/websocket/connector.js +3 -3
  47. package/package.json +2 -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
  console.error(response);
172
172
  throw new Error(`[${response.code}] ${response.rawLog}`);
@@ -206,9 +206,9 @@ class CarbonWallet {
206
206
  try {
207
207
  if (!this.accountInfo || this.sequenceInvalidated)
208
208
  yield this.reloadAccountSequence();
209
- const heightResponse = yield (0, fetch_1.fetch)(`${this.networkConfig.tmRpcUrl}/blockchain?cache=${new Date().getTime()}`);
209
+ const heightResponse = yield fetch_1.fetch(`${this.networkConfig.tmRpcUrl}/blockchain?cache=${new Date().getTime()}`);
210
210
  const heightRes = yield heightResponse.json();
211
- const height = (0, number_1.bnOrZero)((_a = heightRes.result) === null || _a === void 0 ? void 0 : _a.last_height);
211
+ const height = number_1.bnOrZero((_a = heightRes.result) === null || _a === void 0 ? void 0 : _a.last_height);
212
212
  const timeoutHeight = height.isZero() ? undefined : height.toNumber() + this.defaultTimeoutBlocks;
213
213
  const sequence = this.accountInfo.sequence;
214
214
  this.accountInfo = Object.assign(Object.assign({}, this.accountInfo), { sequence: sequence + 1 });
@@ -342,12 +342,12 @@ class CarbonWallet {
342
342
  const queryClient = this.getQueryClient();
343
343
  const { msgGasCosts } = yield queryClient.fee.MsgGasCostAll({});
344
344
  this.txGasCosts = msgGasCosts.reduce((result, item) => {
345
- result[item.msgType] = (0, number_1.bnOrZero)(item.gasCost);
345
+ result[item.msgType] = number_1.bnOrZero(item.gasCost);
346
346
  return result;
347
347
  }, {});
348
348
  const { minGasPrices } = yield queryClient.fee.MinGasPriceAll({});
349
349
  this.txGasPrices = minGasPrices.reduce((result, item) => {
350
- result[item.denom] = (0, number_1.bnOrZero)(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
350
+ result[item.denom] = number_1.bnOrZero(item.gasPrice).shiftedBy(-18); // sdk.Dec shifting
351
351
  return result;
352
352
  }, {});
353
353
  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.9-dev.1",
3
+ "version": "0.2.9-dev.2",
4
4
  "description": "TypeScript SDK for Carbon blockchain",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -39,6 +39,7 @@
39
39
  "@cityofzion/neon-api": "^4.9.0",
40
40
  "@cityofzion/neon-core": "^4.9.0",
41
41
  "@cityofzion/neon-core-next": "npm:@cityofzion/neon-core@^5.0.0",
42
+ "@cityofzion/neon-js": "^4.9.0",
42
43
  "@cosmjs/proto-signing": "^0.28.10",
43
44
  "@cosmjs/stargate": "^0.28.10",
44
45
  "@grpc/grpc-js": "^1.3.2",