@xchainjs/xchain-thorchain 0.24.1 → 0.25.2-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,35 @@
1
+ # v0.25.2 (2022-xx-xx)
2
+
3
+ ## Update
4
+
5
+ - Latest `@cosmos-client/core@0.45.10`
6
+ - Latest "xchain-cosmos@0.18.0-alpha.2"
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
+
1
33
  # v0.24.1 (2022-04-23)
2
34
 
3
35
  ## Fix
package/lib/client.d.ts CHANGED
@@ -2,6 +2,7 @@ import { cosmosclient, proto } from '@cosmos-client/core';
2
2
  import { Address, 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
4
  import { Asset } from '@xchainjs/xchain-util';
5
+ import BigNumber from 'bignumber.js';
5
6
  import { ChainId, ClientUrl, DepositParam, ExplorerUrls, NodeUrl, ThorchainClientParams, TxOfflineParams } from './types';
6
7
  /**
7
8
  * Interface for custom Thorchain client
@@ -12,6 +13,7 @@ export interface ThorchainClient {
12
13
  setExplorerUrls(explorerUrls: ExplorerUrls): void;
13
14
  getCosmosClient(): CosmosSDKClient;
14
15
  deposit(params: DepositParam): Promise<TxHash>;
16
+ transferOffline(params: TxOfflineParams): Promise<string>;
15
17
  }
16
18
  /**
17
19
  * Custom Thorchain Client
@@ -181,23 +183,28 @@ declare class Client extends BaseXChainClient implements ThorchainClient, XChain
181
183
  * @returns {TxHash} The transaction hash.
182
184
  *
183
185
  * @throws {"insufficient funds"} Thrown if the wallet has insufficient funds.
184
- * @throws {"failed to broadcast transaction"} Thrown if failed to broadcast transaction.
186
+ * @throws {"Invalid transaction hash"} Thrown by missing tx hash
185
187
  */
186
- deposit({ walletIndex, asset, amount, memo }: DepositParam): Promise<TxHash>;
188
+ deposit({ walletIndex, asset, amount, memo, gasLimit, }: DepositParam): Promise<TxHash>;
187
189
  /**
188
190
  * Transfer balances with MsgSend
189
191
  *
190
192
  * @param {TxParams} params The transfer options.
191
193
  * @returns {TxHash} The transaction hash.
194
+ *
195
+ * @throws {"insufficient funds"} Thrown if the wallet has insufficient funds.
196
+ * @throws {"Invalid transaction hash"} Thrown by missing tx hash
192
197
  */
193
- transfer({ walletIndex, asset, amount, recipient, memo }: TxParams): Promise<TxHash>;
198
+ transfer({ walletIndex, asset, amount, recipient, memo, gasLimit, }: TxParams & {
199
+ gasLimit?: BigNumber;
200
+ }): Promise<TxHash>;
194
201
  /**
195
202
  * Transfer without broadcast balances with MsgSend
196
203
  *
197
204
  * @param {TxOfflineParams} params The transfer offline options.
198
205
  * @returns {string} The signed transaction bytes.
199
206
  */
200
- transferOffline({ walletIndex, asset, amount, recipient, memo, from_rune_balance, from_asset_balance, from_account_number, from_sequence, }: TxOfflineParams): Promise<string>;
207
+ transferOffline({ walletIndex, asset, amount, recipient, memo, fromRuneBalance: from_rune_balance, fromAssetBalance: from_asset_balance, fromAccountNumber, fromSequence, gasLimit, }: TxOfflineParams): Promise<string>;
201
208
  /**
202
209
  * Gets fees from Node
203
210
  *