@xchainjs/xchain-thorchain 0.25.2 → 0.26.0

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/lib/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cosmosclient, proto } from '@cosmos-client/core';
2
- import { Address, Balance, BaseXChainClient, Fees, Network, Tx, TxHash, TxHistoryParams, TxParams, TxsPage, XChainClient, XChainClientParams } from '@xchainjs/xchain-client';
2
+ import { Balance, BaseXChainClient, Fees, Network, Tx, TxHash, TxHistoryParams, TxParams, TxsPage, XChainClient, XChainClientParams } from '@xchainjs/xchain-client';
3
3
  import { CosmosSDKClient, RPCTxResult } from '@xchainjs/xchain-cosmos';
4
- import { Asset } from '@xchainjs/xchain-util';
4
+ import { Address, Asset } from '@xchainjs/xchain-util';
5
5
  import BigNumber from 'bignumber.js';
6
6
  import { ChainId, ClientUrl, DepositParam, ExplorerUrls, NodeUrl, ThorchainClientParams, TxOfflineParams } from './types';
7
7
  /**
package/lib/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cosmosclient, proto, rest } from '@cosmos-client/core';
2
2
  import { Network, TxType, singleFee, FeeType, BaseXChainClient } from '@xchainjs/xchain-client';
3
3
  import { CosmosSDKClient } from '@xchainjs/xchain-cosmos';
4
- import { assetToString, AssetRuneNative, isSynthAsset, assetFromString, baseAmount, assetToBase, assetAmount, Chain } from '@xchainjs/xchain-util';
4
+ import { isAssetRuneNative, isSynthAsset, assetToString, AssetRuneNative, assetFromString, baseAmount, assetToBase, assetAmount, Chain } from '@xchainjs/xchain-util';
5
5
  import axios from 'axios';
6
6
  import { decode } from 'bech32-buffer';
7
7
 
@@ -9604,13 +9604,6 @@ const DEFAULT_GAS_ADJUSTMENT = 2;
9604
9604
  const DEFAULT_GAS_LIMIT_VALUE = '4000000';
9605
9605
  const DEPOSIT_GAS_LIMIT_VALUE = '600000000';
9606
9606
  const MAX_TX_COUNT = 100;
9607
- /**
9608
- * Checks whether an asset is `AssetRuneNative`
9609
- *
9610
- * @param {Asset} asset
9611
- * @returns {boolean} `true` or `false`
9612
- */
9613
- const isAssetRuneNative = (asset) => assetToString(asset) === assetToString(AssetRuneNative);
9614
9607
  const DENOM_RUNE_NATIVE = 'rune';
9615
9608
  /**
9616
9609
  * Get denomination from Asset
@@ -10338,6 +10331,9 @@ class Client extends BaseXChainClient {
10338
10331
  chainId: this.getChainId(),
10339
10332
  });
10340
10333
  const account = yield this.getCosmosClient().getAccount(fromAddressAcc);
10334
+ const { account_number: accountNumber } = account;
10335
+ if (!accountNumber)
10336
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10341
10337
  const txBuilder = buildUnsignedTx({
10342
10338
  cosmosSdk: this.getCosmosClient().sdk,
10343
10339
  txBody: depositTxBody,
@@ -10345,7 +10341,7 @@ class Client extends BaseXChainClient {
10345
10341
  gasLimit: long_1.fromString(gasLimit.toFixed(0)),
10346
10342
  sequence: account.sequence || long_1.ZERO,
10347
10343
  });
10348
- const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, account);
10344
+ const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, accountNumber);
10349
10345
  if (!txHash)
10350
10346
  throw Error(`Invalid transaction hash: ${txHash}`);
10351
10347
  return txHash;
@@ -10394,15 +10390,17 @@ class Client extends BaseXChainClient {
10394
10390
  nodeUrl: this.getClientUrl().node,
10395
10391
  });
10396
10392
  const account = yield this.getCosmosClient().getAccount(accAddress);
10397
- const accountSequence = account.sequence || long_1.ZERO;
10393
+ const { account_number: accountNumber } = account;
10394
+ if (!accountNumber)
10395
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10398
10396
  const txBuilder = buildUnsignedTx({
10399
10397
  cosmosSdk: this.getCosmosClient().sdk,
10400
10398
  txBody: txBody,
10401
10399
  gasLimit: long_1.fromString(gasLimit.toString()),
10402
10400
  signerPubkey: cosmosclient.codec.instanceToProtoAny(signerPubkey),
10403
- sequence: accountSequence,
10401
+ sequence: account.sequence || long_1.ZERO,
10404
10402
  });
10405
- const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, account);
10403
+ const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, accountNumber);
10406
10404
  if (!txHash)
10407
10405
  throw Error(`Invalid transaction hash: ${txHash}`);
10408
10406
  return txHash;
@@ -10489,4 +10487,4 @@ const msgNativeTxFromJson = (value) => {
10489
10487
  return new MsgNativeTx(value.coins, value.memo, cosmosclient.AccAddress.fromString(value.signer));
10490
10488
  };
10491
10489
 
10492
- export { Client, DECIMAL, DEFAULT_GAS_ADJUSTMENT, DEFAULT_GAS_LIMIT_VALUE, DEPOSIT_GAS_LIMIT_VALUE, MAX_TX_COUNT, MsgNativeTx, assetFromDenom, buildDepositTx, buildTransferTx, buildUnsignedTx, getBalance, getChainId, getChainIds, getDefaultClientUrl, getDefaultExplorerUrls, getDefaultFees, getDenom, getDepositTxDataFromLogs, getEstimatedGas, getExplorerAddressUrl, getExplorerTxUrl, getExplorerUrl, getPrefix, getTxType, isAssetRuneNative, isBroadcastSuccess, msgNativeTxFromJson, registerDepositCodecs, registerSendCodecs };
10490
+ export { Client, DECIMAL, DEFAULT_GAS_ADJUSTMENT, DEFAULT_GAS_LIMIT_VALUE, DEPOSIT_GAS_LIMIT_VALUE, MAX_TX_COUNT, MsgNativeTx, assetFromDenom, buildDepositTx, buildTransferTx, buildUnsignedTx, getBalance, getChainId, getChainIds, getDefaultClientUrl, getDefaultExplorerUrls, getDefaultFees, getDenom, getDepositTxDataFromLogs, getEstimatedGas, getExplorerAddressUrl, getExplorerTxUrl, getExplorerUrl, getPrefix, getTxType, isBroadcastSuccess, msgNativeTxFromJson, registerDepositCodecs, registerSendCodecs };
package/lib/index.js CHANGED
@@ -9612,13 +9612,6 @@ const DEFAULT_GAS_ADJUSTMENT = 2;
9612
9612
  const DEFAULT_GAS_LIMIT_VALUE = '4000000';
9613
9613
  const DEPOSIT_GAS_LIMIT_VALUE = '600000000';
9614
9614
  const MAX_TX_COUNT = 100;
9615
- /**
9616
- * Checks whether an asset is `AssetRuneNative`
9617
- *
9618
- * @param {Asset} asset
9619
- * @returns {boolean} `true` or `false`
9620
- */
9621
- const isAssetRuneNative = (asset) => xchainUtil.assetToString(asset) === xchainUtil.assetToString(xchainUtil.AssetRuneNative);
9622
9615
  const DENOM_RUNE_NATIVE = 'rune';
9623
9616
  /**
9624
9617
  * Get denomination from Asset
@@ -9627,7 +9620,7 @@ const DENOM_RUNE_NATIVE = 'rune';
9627
9620
  * @returns {string} The denomination of the given asset.
9628
9621
  */
9629
9622
  const getDenom = (asset) => {
9630
- if (isAssetRuneNative(asset))
9623
+ if (xchainUtil.isAssetRuneNative(asset))
9631
9624
  return DENOM_RUNE_NATIVE;
9632
9625
  if (xchainUtil.isSynthAsset(asset))
9633
9626
  return xchainUtil.assetToString(asset).toLowerCase();
@@ -10312,10 +10305,10 @@ class Client extends xchainClient.BaseXChainClient {
10312
10305
  var _a, _b, _c, _d;
10313
10306
  return __awaiter(this, void 0, void 0, function* () {
10314
10307
  const balances = yield this.getBalance(this.getAddress(walletIndex));
10315
- const runeBalance = (_b = (_a = balances.filter(({ asset }) => isAssetRuneNative(asset))[0]) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : xchainUtil.baseAmount(0, DECIMAL);
10308
+ const runeBalance = (_b = (_a = balances.filter(({ asset }) => xchainUtil.isAssetRuneNative(asset))[0]) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : xchainUtil.baseAmount(0, DECIMAL);
10316
10309
  const assetBalance = (_d = (_c = balances.filter(({ asset: assetInList }) => xchainUtil.assetToString(assetInList) === xchainUtil.assetToString(asset))[0]) === null || _c === void 0 ? void 0 : _c.amount) !== null && _d !== void 0 ? _d : xchainUtil.baseAmount(0, DECIMAL);
10317
10310
  const { average: fee } = yield this.getFees();
10318
- if (isAssetRuneNative(asset)) {
10311
+ if (xchainUtil.isAssetRuneNative(asset)) {
10319
10312
  // amount + fee < runeBalance
10320
10313
  if (runeBalance.lt(amount.plus(fee))) {
10321
10314
  throw new Error('insufficient funds');
@@ -10346,6 +10339,9 @@ class Client extends xchainClient.BaseXChainClient {
10346
10339
  chainId: this.getChainId(),
10347
10340
  });
10348
10341
  const account = yield this.getCosmosClient().getAccount(fromAddressAcc);
10342
+ const { account_number: accountNumber } = account;
10343
+ if (!accountNumber)
10344
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10349
10345
  const txBuilder = buildUnsignedTx({
10350
10346
  cosmosSdk: this.getCosmosClient().sdk,
10351
10347
  txBody: depositTxBody,
@@ -10353,7 +10349,7 @@ class Client extends xchainClient.BaseXChainClient {
10353
10349
  gasLimit: long_1.fromString(gasLimit.toFixed(0)),
10354
10350
  sequence: account.sequence || long_1.ZERO,
10355
10351
  });
10356
- const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, account);
10352
+ const txHash = yield this.getCosmosClient().signAndBroadcast(txBuilder, privKey, accountNumber);
10357
10353
  if (!txHash)
10358
10354
  throw Error(`Invalid transaction hash: ${txHash}`);
10359
10355
  return txHash;
@@ -10372,10 +10368,10 @@ class Client extends xchainClient.BaseXChainClient {
10372
10368
  var _a, _b, _c, _d;
10373
10369
  return __awaiter(this, void 0, void 0, function* () {
10374
10370
  const balances = yield this.getBalance(this.getAddress(walletIndex));
10375
- const runeBalance = (_b = (_a = balances.filter(({ asset }) => isAssetRuneNative(asset))[0]) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : xchainUtil.baseAmount(0, DECIMAL);
10371
+ const runeBalance = (_b = (_a = balances.filter(({ asset }) => xchainUtil.isAssetRuneNative(asset))[0]) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : xchainUtil.baseAmount(0, DECIMAL);
10376
10372
  const assetBalance = (_d = (_c = balances.filter(({ asset: assetInList }) => xchainUtil.assetToString(assetInList) === xchainUtil.assetToString(asset))[0]) === null || _c === void 0 ? void 0 : _c.amount) !== null && _d !== void 0 ? _d : xchainUtil.baseAmount(0, DECIMAL);
10377
10373
  const fee = (yield this.getFees()).average;
10378
- if (isAssetRuneNative(asset)) {
10374
+ if (xchainUtil.isAssetRuneNative(asset)) {
10379
10375
  // amount + fee < runeBalance
10380
10376
  if (runeBalance.lt(amount.plus(fee))) {
10381
10377
  throw new Error('insufficient funds');
@@ -10402,15 +10398,17 @@ class Client extends xchainClient.BaseXChainClient {
10402
10398
  nodeUrl: this.getClientUrl().node,
10403
10399
  });
10404
10400
  const account = yield this.getCosmosClient().getAccount(accAddress);
10405
- const accountSequence = account.sequence || long_1.ZERO;
10401
+ const { account_number: accountNumber } = account;
10402
+ if (!accountNumber)
10403
+ throw Error(`Deposit failed - could not get account number ${accountNumber}`);
10406
10404
  const txBuilder = buildUnsignedTx({
10407
10405
  cosmosSdk: this.getCosmosClient().sdk,
10408
10406
  txBody: txBody,
10409
10407
  gasLimit: long_1.fromString(gasLimit.toString()),
10410
10408
  signerPubkey: core.cosmosclient.codec.instanceToProtoAny(signerPubkey),
10411
- sequence: accountSequence,
10409
+ sequence: account.sequence || long_1.ZERO,
10412
10410
  });
10413
- const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, account);
10411
+ const txHash = yield this.cosmosClient.signAndBroadcast(txBuilder, privKey, accountNumber);
10414
10412
  if (!txHash)
10415
10413
  throw Error(`Invalid transaction hash: ${txHash}`);
10416
10414
  return txHash;
@@ -10425,7 +10423,7 @@ class Client extends xchainClient.BaseXChainClient {
10425
10423
  transferOffline({ walletIndex = 0, asset = xchainUtil.AssetRuneNative, amount, recipient, memo, fromRuneBalance: from_rune_balance, fromAssetBalance: from_asset_balance = xchainUtil.baseAmount(0, DECIMAL), fromAccountNumber = long_1.ZERO, fromSequence = long_1.ZERO, gasLimit = new bignumber(DEFAULT_GAS_LIMIT_VALUE), }) {
10426
10424
  return __awaiter(this, void 0, void 0, function* () {
10427
10425
  const fee = (yield this.getFees()).average;
10428
- if (isAssetRuneNative(asset)) {
10426
+ if (xchainUtil.isAssetRuneNative(asset)) {
10429
10427
  // amount + fee < runeBalance
10430
10428
  if (from_rune_balance.lt(amount.plus(fee))) {
10431
10429
  throw new Error('insufficient funds');
@@ -10522,7 +10520,6 @@ exports.getExplorerTxUrl = getExplorerTxUrl;
10522
10520
  exports.getExplorerUrl = getExplorerUrl;
10523
10521
  exports.getPrefix = getPrefix;
10524
10522
  exports.getTxType = getTxType;
10525
- exports.isAssetRuneNative = isAssetRuneNative;
10526
10523
  exports.isBroadcastSuccess = isBroadcastSuccess;
10527
10524
  exports.msgNativeTxFromJson = msgNativeTxFromJson;
10528
10525
  exports.registerDepositCodecs = registerDepositCodecs;
package/lib/util.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cosmosclient, proto } from '@cosmos-client/core';
2
- import { Address, Balance, Fees, Network, TxHash } from '@xchainjs/xchain-client';
2
+ import { Balance, Fees, Network, TxHash } from '@xchainjs/xchain-client';
3
3
  import { CosmosSDKClient, TxLog } from '@xchainjs/xchain-cosmos';
4
- import { Asset, BaseAmount } from '@xchainjs/xchain-util';
4
+ import { Address, Asset, BaseAmount } from '@xchainjs/xchain-util';
5
5
  import Long from 'long';
6
6
  import { ChainId, ChainIds, ClientUrl, ExplorerUrls, TxData } from './types';
7
7
  import { MsgNativeTx } from './types/messages';
@@ -10,13 +10,6 @@ export declare const DEFAULT_GAS_ADJUSTMENT = 2;
10
10
  export declare const DEFAULT_GAS_LIMIT_VALUE = "4000000";
11
11
  export declare const DEPOSIT_GAS_LIMIT_VALUE = "600000000";
12
12
  export declare const MAX_TX_COUNT = 100;
13
- /**
14
- * Checks whether an asset is `AssetRuneNative`
15
- *
16
- * @param {Asset} asset
17
- * @returns {boolean} `true` or `false`
18
- */
19
- export declare const isAssetRuneNative: (asset: Asset) => boolean;
20
13
  /**
21
14
  * Get denomination from Asset
22
15
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain",
3
- "version": "0.25.2",
3
+ "version": "0.26.0",
4
4
  "description": "Custom Thorchain client and utilities used by XChainJS clients",
5
5
  "keywords": [
6
6
  "THORChain",
@@ -34,12 +34,12 @@
34
34
  "generate:ThorchainMsgs": "./genMsgs.sh"
35
35
  },
36
36
  "devDependencies": {
37
- "@cosmos-client/core": "^0.45.10",
37
+ "@cosmos-client/core": "0.45.13",
38
38
  "@types/big.js": "^6.0.0",
39
- "@xchainjs/xchain-client": "^0.11.1",
40
- "@xchainjs/xchain-cosmos": "^0.18.0-alpha.2",
41
- "@xchainjs/xchain-crypto": "^0.2.4",
42
- "@xchainjs/xchain-util": "^0.5.1",
39
+ "@xchainjs/xchain-client": "^0.13.0",
40
+ "@xchainjs/xchain-cosmos": "^0.20.0",
41
+ "@xchainjs/xchain-crypto": "^0.2.6",
42
+ "@xchainjs/xchain-util": "^0.9.0",
43
43
  "axios": "^0.25.0",
44
44
  "bech32-buffer": "^0.2.0",
45
45
  "nock": "^13.0.5"
@@ -48,11 +48,11 @@
48
48
  "access": "public"
49
49
  },
50
50
  "peerDependencies": {
51
- "@cosmos-client/core": "^0.45.10",
52
- "@xchainjs/xchain-client": "^0.11.1",
53
- "@xchainjs/xchain-cosmos": "^0.18.0",
54
- "@xchainjs/xchain-crypto": "^0.2.4",
55
- "@xchainjs/xchain-util": "^0.5.1",
51
+ "@cosmos-client/core": "0.45.13",
52
+ "@xchainjs/xchain-client": "^0.13.0",
53
+ "@xchainjs/xchain-cosmos": "^0.19.0",
54
+ "@xchainjs/xchain-crypto": "^0.2.6",
55
+ "@xchainjs/xchain-util": "^0.9.0",
56
56
  "axios": "^0.25.0",
57
57
  "bech32-buffer": "^0.2.0"
58
58
  }
package/CHANGELOG.md DELETED
@@ -1,508 +0,0 @@
1
- # v0.25.2 (2022-06-22)
2
-
3
- ## Update
4
-
5
- - Latest `@cosmos-client/core@0.45.10`
6
- - Latest "xchain-cosmos@0.18.0"
7
-
8
- ## Fix
9
-
10
- - Fix `setNetwork` to create new instance of SDK client
11
-
12
- # v0.25.1 (2022-06-17)
13
-
14
- ## Fix
15
-
16
- - Remove estimation of gas in `transfer` and `deposit` (introduced by #564) in favour of using `DEFAULT_GAS_LIMIT_VALUE` or `DEPOSIT_GAS_LIMIT_VALUE` (both can be overridden by users in `transfer` or `deposit`)
17
- - Increase `DEPOSIT_GAS_LIMIT_VALUE` to `600000000` (before `500000000`)
18
-
19
- # v0.25.0 (2022-06-16)
20
-
21
- ## Fix
22
-
23
- - Before sending a transaction, gas limits are estimated
24
- - Helper `getEstimatedGas`
25
-
26
- ## Breaking changes
27
-
28
- - Client's `transferOffline` requires `fromAccountNumber` and `fromSequence`
29
- - Rename parameters in `transferOffline` to keep names in camel case (not snake case)
30
- - Rename `DEFAULT_GAS_VALUE` to `DEFAULT_GAS_LIMIT_VALUE`
31
- - Rename `DEPOSIT_GAS_VALUE` to `DEPOSIT_GAS_LIMIT_VALUE`
32
-
33
- # v0.24.1 (2022-04-23)
34
-
35
- ## Fix
36
-
37
- - Increase `DEFAULT_GAS_VALUE` to `4000000` (before `3000000`)
38
-
39
- # v0.24.0 (2022-03-23)
40
-
41
- ## Update
42
-
43
- - upgraded to "@cosmos-client/core": "0.45.1"
44
- - client now extend BaseXChainClient
45
-
46
- ## Breaking Changes
47
-
48
- - `buildDepositTx` now returns `proto.cosmos.tx.v1beta1.TxBody` from `@cosmos-client/core`
49
-
50
- # v0.23.0 (2022-03-08)
51
-
52
- ## Add
53
-
54
- - Helpers `getChainId` + `getChainIds`
55
-
56
- ## Breaking change
57
-
58
- - `chainIds: ChainIds` is required to initialize `Client`
59
-
60
- ## Fix
61
-
62
- - Request fees from THORChain and use `defaultFees` in case of server errors only
63
- - Fix `defaultFees` to be 0.02 RUNE
64
-
65
- # v0.22.2 (2022-02-17)
66
-
67
- ## Fix
68
-
69
- - Request fees from THORChain and use `defaultFees` in case of server errors only
70
- - Fix `defaultFees` to be 0.02 RUNE
71
-
72
- # v0.22.1 (2022-02-16)
73
-
74
- ## Fix
75
-
76
- - Increase limit for `DEFAULT_GAS_VALUE` from 2000000 to 3000000 to accommodate recent increases in gas used that go above the old limit
77
-
78
- # v0.22.0 (2022-02-06)
79
-
80
- ## Add
81
-
82
- - Option to pass `ChainIds` into constructor
83
- - getter / setter for `chainId` in `Client`
84
-
85
- ## Breaking change
86
-
87
- - `buildDepositTx` needs `chainId` to be passed - all params are set as object
88
- - Remove `enum ChainId` + `getChainId` + `isChainId` from `utils`
89
-
90
- # v0.21.2 (2022-02-04)
91
-
92
- ## Fix
93
-
94
- - Use latest axios@0.25.0
95
- - xchain-client@0.11.1
96
- - @xchainjs/xchain-util@0.5.1
97
- - @xchainjs/xchain-cosmos@0.16.1
98
-
99
- # v.0.21.1 (2022-02-04)
100
-
101
- ## Fix
102
-
103
- - Fix chain id for `testnet` #477
104
-
105
- ## Add
106
-
107
- - Helper `isChainId`
108
- - `enum ChainId`
109
-
110
- # v.0.21.0 (2022-02-02)
111
-
112
- ## Breaking change
113
-
114
- - Remove `getDenomWithChain`
115
- - Rename `getAsset` -> `assetFromDenom` (incl. fix to get synth asset properly)
116
-
117
- ## Update
118
-
119
- - xchain-util@0.5.0
120
- - xchain-cosmos@0.16.0
121
-
122
- ## Add
123
-
124
- - `isAssetNativeRune` helper
125
- - Add `TxOfflineParams` type
126
-
127
- ## Fix
128
-
129
- - Fix synth notation in `transfer|transferOffline|deposit` #473
130
-
131
- # v0.20.1 (2022-01-11)
132
-
133
- ## Fix
134
-
135
- - Get chain ID from THORNode before posting to deposit handler.
136
-
137
- # v.0.20.0 (2021-12-29)
138
-
139
- ## Breaking change
140
-
141
- - Add stagenet environment handling for `Network` and `BaseXChainClient` to client
142
-
143
- # v.0.19.5 (2021-11-22)
144
-
145
- ## Add
146
-
147
- - Provide `transferOffline` method
148
-
149
- # v.0.19.4 (2021-11-22)
150
-
151
- ## Add
152
-
153
- - Provide `getPubKey` method to access public key
154
-
155
- ## Change
156
-
157
- - Make `getPrivKey` method `public` to access private key
158
-
159
- # v.0.19.3 (2021-10-31)
160
-
161
- ## Update
162
-
163
- - Use latest `xchain-cosmos@0.13.8` to use `sync` mode for broadcasting txs
164
-
165
- # v.0.19.2 (2021-09-27)
166
-
167
- ## Fix
168
-
169
- - Increase `gas` to `500,000,000` (five hundred million)
170
-
171
- # v.0.19.1 (2021-09-26)
172
-
173
- ## Fix
174
-
175
- - Increase `gas` to `30,000,000` (thirty million)
176
-
177
- # v.0.19.0 (2021-09-10)
178
-
179
- ## Breaking change
180
-
181
- - Extract `buildDepositTx` from `Client` into `utils`
182
-
183
- ## Add
184
-
185
- - Add `getBalance` to `utils`
186
-
187
- # v.0.18.0 (2021-09-08)
188
-
189
- ## Add
190
-
191
- - Make `buildDepositTx` public and overrides its fee
192
- - Add `DEPOSIT_GAS_VALUE`
193
-
194
- ## Breaking change
195
-
196
- - Remove `AssetRune` in favour of using `AssetRuneNative` of `xchain-util` only
197
- - Extract `getChainId` into `util` module
198
-
199
- # v.0.17.7 (2021-07-20)
200
-
201
- ## Fix
202
-
203
- - cosmos 0.42.x has too many breaking changes that wren't caught in the last version, downgrade "cosmos-client": "0.39.2"
204
-
205
- # v.0.17.6 (2021-07-19)
206
-
207
- ## Update
208
-
209
- - bumping peer dependency "cosmos-client": "0.39.2" -> "cosmos-client": "^0.42.7"
210
-
211
- # v.0.17.5 (2021-07-18)
212
-
213
- ## Update
214
-
215
- - Updated rollupjs to include axios to enlable usage on node
216
-
217
- # v.0.17.4 (2021-07-14)
218
-
219
- ### Fix
220
-
221
- - Bump `fee.gas to `25000000` (twenty five million) to try to avoid failing withdraw txs
222
-
223
- # v.0.17.3 (2021-07-07)
224
-
225
- ## Update
226
-
227
- - Use latest `xchain-client@0.10.1` + `xchain-util@0.3.0`
228
-
229
- # v.0.17.2 (2021-07-05)
230
-
231
- ## Fix
232
-
233
- - refactored client methods to use regular method syntax (not fat arrow) in order for bcall to super.xxx() to work properly
234
-
235
- # v.0.17.1 (2021-06-29)
236
-
237
- ### Fix
238
-
239
- - Stick with `cosmos-client@0.39.2`
240
-
241
- ### Add
242
-
243
- - Add examples to README
244
-
245
- # v.0.17.0 (2021-06-21)
246
-
247
- ### Fix
248
-
249
- - Fix `to` / `from` addresses by parsing tx data from event logs
250
-
251
- ### Breaking change
252
-
253
- - Remove deprecated `getTxDataFromResponse` helper
254
-
255
- # v.0.16.1 (2021-06-14)
256
-
257
- ### Fix
258
-
259
- - Double `fee.gas to `20000000` (twenty million) to avoid failing withdraw transactions
260
-
261
- # v.0.16.0 (2021-06-08)
262
-
263
- ### Breaking change
264
-
265
- - Use `viewblock` as default explorer
266
- - [types] Refactored structure of explorer urls (via `type ExplorerUrls`)
267
- - [types] Refactored `ExplorerUrl`
268
- - [client] Constructor accepts `ExplorerUrls`
269
- - [client] Removed `getExplorerNodeUrl` (use `getExplorerAddressUrl` instead)
270
- - [client] Extract `getDefaultClientUrl` into `utils`
271
- - [utils] Renamed `getDefaultExplorerUrlByNetwork` -> `getDefaultExplorerUrl`
272
- - [utils] Removed `getDefaultExplorerAddressUrl`, `getDefaultExplorerNodeUrl`, `getDefaultExplorerTxUrl`
273
- - [utils] Added `getExplorerTxUrl`, `getExplorerAddressUrl`, `getExplorerUrl` helpers
274
-
275
- # v.0.15.2 (2021-06-01)
276
-
277
- ### Update
278
-
279
- - updated peer deps
280
-
281
- # v.0.15.0 (2021-05-17)
282
-
283
- ### Breaking change
284
-
285
- - added support for HD wallets
286
-
287
- # v.0.14.0 (2021-05-05)
288
-
289
- ### Breaking change
290
-
291
- - Latest @xchainjs/xchain-client@0.8.0
292
- - Latest @xchainjs/xchain-util@0.2.7
293
-
294
- # v.0.13.7 (2021-04-21)
295
-
296
- ### Update
297
-
298
- - Export `MSG_SEND` `MSG_DEPOSIT` `MAX_COUNT`
299
- - Added `getCosmosClient()`
300
- - Extend `getTransactions` parameters with an optional `filterFn`
301
-
302
- # v.0.13.6 (2021-04-16)
303
-
304
- ### Update
305
-
306
- - Set `fee.gas` to `10000000` (ten million) in `deposit` due to failing withdraw transactions
307
-
308
- # v.0.13.5 (2021-04-16)
309
-
310
- ### Update
311
-
312
- - Set `fee.gas` to `1000000` (one million) in `deposit`
313
-
314
- # v.0.13.4 (2021-04-16)
315
-
316
- ### Update
317
-
318
- - Set `fee.gas` to `auto` in `deposit`
319
- - Try sending `deposit` tx up to 3x
320
- - Updates `DEFAULT_GAS_VALUE` to `2000000`
321
-
322
- # v.0.13.3 (2021-04-12)
323
-
324
- ### Breaking changes
325
-
326
- - Change `/addresses` to `/address` for explorer url.
327
-
328
- ### Update
329
-
330
- - Add util helpers for explorer urls.
331
-
332
- # v.0.13.2 (2021-04-01)
333
-
334
- ### Update
335
-
336
- - Updates `getDefaultClientUrl` to use new mainnet endpoints
337
-
338
- # v.0.13.1 (2021-03-18)
339
-
340
- ### Fix
341
-
342
- - Changed `getDefaultExplorerUrl` to return valid urls
343
-
344
- # v.0.13.0 (2021-03-02)
345
-
346
- ### Breaking change
347
-
348
- - replace `find`, `findIndex`
349
- - Update @xchainjs/xchain-client package to 0.7.0
350
- - Update @xchainjs/xchain-cosmos package to 0.11.0
351
-
352
- # v.0.12.0 (2021-02-24)
353
-
354
- ### Breaking change
355
-
356
- - Update @xchainjs/xchain-client package to 0.6.0
357
- - Update @xchainjs/xchain-cosmos package to 0.10.0
358
- - Update `getBalance`
359
-
360
- # v.0.11.1 (2021-02-24)
361
-
362
- ### Breaking change
363
-
364
- - Update @xchainjs/xchain-cosmos package to 0.9.0
365
-
366
- ### Fix
367
-
368
- - Fix `getTransactions` - sort transactions from latest
369
- - Fix `DECIMAL`
370
-
371
- # v.0.11.0 (2021-02-19)
372
-
373
- ### Breaking change
374
-
375
- - Update @xchainjs/xchain-client package to 0.5.0
376
-
377
- ### Update
378
-
379
- - Add `Service Providers` section in README.md
380
-
381
- ### Fix
382
-
383
- - Fix `peerDependencies`
384
-
385
- # v.0.10.1 (2021-02-05)
386
-
387
- ### Update
388
-
389
- - Update `getTransactions` to support incoming transactions
390
-
391
- ### Breaking change
392
-
393
- - Update @xchainjs/xchain-client package to 0.4.0
394
- - Update @xchainjs/xchain-crypto package to 0.2.3
395
-
396
- # v.0.10.0 (2021-02-03)
397
-
398
- ### Breaking changes
399
-
400
- - Change `getTransactions` to use tendermint rpc. (transaction query from the latest ones.)
401
-
402
- # v.0.9.3 (2021-02-02)
403
-
404
- ### Update
405
-
406
- - Add `getExplorerNodeUrl`
407
-
408
- # v.0.9.2 (2021-01-30)
409
-
410
- - Clear lib folder on build
411
-
412
- # v.0.9.1 (2021-01-26)
413
-
414
- ### Fix
415
-
416
- - Fix `deposit`. Use `/thorchain/deposit` to build a deposit transaction.
417
-
418
- # v.0.9.0 (2021-01-15)
419
-
420
- ### Breaking change
421
-
422
- - Move `getPrefix` to util
423
-
424
- # v.0.8.0 (2021-01-13)
425
-
426
- ### Breaking change
427
-
428
- - change MsgNativeTx.fromJson
429
-
430
- # v.0.7.1 (2021-01-06)
431
-
432
- ### Fix
433
-
434
- - Fix getTransactions pagination issue #168
435
-
436
- ### Update
437
-
438
- - Update comments for documentation
439
-
440
- # v.0.7.0 (2020-12-28)
441
-
442
- ### Breaking change
443
-
444
- - Extract `getDefaultFees` from `Client` to `utils` #157
445
-
446
- # v.0.6.2 (2020-12-23)
447
-
448
- ### Update
449
-
450
- - Use latest xchain-client@0.2.1
451
-
452
- ### Fix
453
-
454
- - Fix invalid assets comparison #151
455
-
456
- ### Breaking change
457
-
458
- - Remove `validateAddress` from `ThorchainClient` #149
459
-
460
- # v.0.6.1 (2020-12-18)
461
-
462
- ### Update
463
-
464
- - Add `setClientUrl`
465
- - Add `getDefaultClientUrl`
466
- - Add `getClientUrlByNetwork`
467
-
468
- ### Fix
469
-
470
- - Fix client url for multichain testnet (`https://testnet.thornode.thorchain.info`)
471
-
472
- # v.0.6.0 (2020-12-16)
473
-
474
- ### Update
475
-
476
- - Set the latest multi-chain node
477
- - Update `getTransactionData`, `getTransactions`
478
- - Update `transfer` (for `MsgSend`)
479
- - Update `deposit` (for `MsgNativeTx`)
480
-
481
- # v.0.5.0 (2020-12-11)
482
-
483
- ### Update
484
-
485
- - Update dependencies
486
- - Add `getDefaultFees`
487
-
488
- # v.0.4.2 (2020-11-23)
489
-
490
- ### Fix
491
-
492
- - Fix import of `cosmos/codec`
493
-
494
- ### Update
495
-
496
- - Use latest `@xchainjs/cosmos@0.4.2`
497
-
498
- # v.0.4.1 (2020-11-23)
499
-
500
- ### Update
501
-
502
- - Update to latest `@xchainjs/*` packages and other dependencies
503
-
504
- # v.0.4.0 (2020-11-20)
505
-
506
- ### Breaking change
507
-
508
- - Update @xchainjs/xchain-crypto package to 0.2.0, deprecating old keystores