@xchainjs/xchain-thorchain 0.25.2 → 0.25.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v0.25.3 (2022-xx-xx)
2
+
3
+ ## Update
4
+
5
+ - Latest "xchain-cosmos@0.19.0"
6
+
1
7
  # v0.25.2 (2022-06-22)
2
8
 
3
9
  ## Update
package/lib/index.esm.js CHANGED
@@ -10338,6 +10338,9 @@ class Client extends BaseXChainClient {
10338
10338
  chainId: this.getChainId(),
10339
10339
  });
10340
10340
  const account = yield this.getCosmosClient().getAccount(fromAddressAcc);
10341
+ const { account_number: accountNumber } = account;
10342
+ if (!accountNumber)
10343
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10341
10344
  const txBuilder = buildUnsignedTx({
10342
10345
  cosmosSdk: this.getCosmosClient().sdk,
10343
10346
  txBody: depositTxBody,
@@ -10345,7 +10348,7 @@ class Client extends BaseXChainClient {
10345
10348
  gasLimit: long_1.fromString(gasLimit.toFixed(0)),
10346
10349
  sequence: account.sequence || long_1.ZERO,
10347
10350
  });
10348
- const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, account);
10351
+ const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, accountNumber);
10349
10352
  if (!txHash)
10350
10353
  throw Error(`Invalid transaction hash: ${txHash}`);
10351
10354
  return txHash;
@@ -10394,15 +10397,17 @@ class Client extends BaseXChainClient {
10394
10397
  nodeUrl: this.getClientUrl().node,
10395
10398
  });
10396
10399
  const account = yield this.getCosmosClient().getAccount(accAddress);
10397
- const accountSequence = account.sequence || long_1.ZERO;
10400
+ const { account_number: accountNumber } = account;
10401
+ if (!accountNumber)
10402
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10398
10403
  const txBuilder = buildUnsignedTx({
10399
10404
  cosmosSdk: this.getCosmosClient().sdk,
10400
10405
  txBody: txBody,
10401
10406
  gasLimit: long_1.fromString(gasLimit.toString()),
10402
10407
  signerPubkey: cosmosclient.codec.instanceToProtoAny(signerPubkey),
10403
- sequence: accountSequence,
10408
+ sequence: account.sequence || long_1.ZERO,
10404
10409
  });
10405
- const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, account);
10410
+ const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, accountNumber);
10406
10411
  if (!txHash)
10407
10412
  throw Error(`Invalid transaction hash: ${txHash}`);
10408
10413
  return txHash;
package/lib/index.js CHANGED
@@ -10346,6 +10346,9 @@ class Client extends xchainClient.BaseXChainClient {
10346
10346
  chainId: this.getChainId(),
10347
10347
  });
10348
10348
  const account = yield this.getCosmosClient().getAccount(fromAddressAcc);
10349
+ const { account_number: accountNumber } = account;
10350
+ if (!accountNumber)
10351
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10349
10352
  const txBuilder = buildUnsignedTx({
10350
10353
  cosmosSdk: this.getCosmosClient().sdk,
10351
10354
  txBody: depositTxBody,
@@ -10353,7 +10356,7 @@ class Client extends xchainClient.BaseXChainClient {
10353
10356
  gasLimit: long_1.fromString(gasLimit.toFixed(0)),
10354
10357
  sequence: account.sequence || long_1.ZERO,
10355
10358
  });
10356
- const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, account);
10359
+ const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, accountNumber);
10357
10360
  if (!txHash)
10358
10361
  throw Error(`Invalid transaction hash: ${txHash}`);
10359
10362
  return txHash;
@@ -10402,15 +10405,17 @@ class Client extends xchainClient.BaseXChainClient {
10402
10405
  nodeUrl: this.getClientUrl().node,
10403
10406
  });
10404
10407
  const account = yield this.getCosmosClient().getAccount(accAddress);
10405
- const accountSequence = account.sequence || long_1.ZERO;
10408
+ const { account_number: accountNumber } = account;
10409
+ if (!accountNumber)
10410
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10406
10411
  const txBuilder = buildUnsignedTx({
10407
10412
  cosmosSdk: this.getCosmosClient().sdk,
10408
10413
  txBody: txBody,
10409
10414
  gasLimit: long_1.fromString(gasLimit.toString()),
10410
10415
  signerPubkey: core.cosmosclient.codec.instanceToProtoAny(signerPubkey),
10411
- sequence: accountSequence,
10416
+ sequence: account.sequence || long_1.ZERO,
10412
10417
  });
10413
- const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, account);
10418
+ const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, accountNumber);
10414
10419
  if (!txHash)
10415
10420
  throw Error(`Invalid transaction hash: ${txHash}`);
10416
10421
  return txHash;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain",
3
- "version": "0.25.2",
3
+ "version": "0.25.3-alpha.1",
4
4
  "description": "Custom Thorchain client and utilities used by XChainJS clients",
5
5
  "keywords": [
6
6
  "THORChain",
@@ -37,7 +37,7 @@
37
37
  "@cosmos-client/core": "^0.45.10",
38
38
  "@types/big.js": "^6.0.0",
39
39
  "@xchainjs/xchain-client": "^0.11.1",
40
- "@xchainjs/xchain-cosmos": "^0.18.0-alpha.2",
40
+ "@xchainjs/xchain-cosmos": "^0.19.0-alpha.1",
41
41
  "@xchainjs/xchain-crypto": "^0.2.4",
42
42
  "@xchainjs/xchain-util": "^0.5.1",
43
43
  "axios": "^0.25.0",
@@ -50,7 +50,7 @@
50
50
  "peerDependencies": {
51
51
  "@cosmos-client/core": "^0.45.10",
52
52
  "@xchainjs/xchain-client": "^0.11.1",
53
- "@xchainjs/xchain-cosmos": "^0.18.0",
53
+ "@xchainjs/xchain-cosmos": "^0.19.0-alpha.1",
54
54
  "@xchainjs/xchain-crypto": "^0.2.4",
55
55
  "@xchainjs/xchain-util": "^0.5.1",
56
56
  "axios": "^0.25.0",