@xchainjs/xchain-thorchain 1.1.1 → 2.0.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.
@@ -1,15 +1,19 @@
1
- import { Tx, TxParams } from '@xchainjs/xchain-client';
2
- import { Asset, BaseAmount } from '@xchainjs/xchain-util';
1
+ import { CompatibleAsset, Tx, TxParams as BaseTxParams } from '@xchainjs/xchain-cosmos-sdk';
2
+ import { BaseAmount } from '@xchainjs/xchain-util';
3
3
  import { BigNumber } from 'bignumber.js';
4
4
  export type DepositParam = {
5
5
  walletIndex?: number;
6
- asset?: Asset;
6
+ asset?: CompatibleAsset;
7
7
  amount: BaseAmount;
8
8
  memo: string;
9
9
  gasLimit?: BigNumber;
10
10
  sequence?: number;
11
11
  };
12
12
  export type DepositTx = Omit<Tx, 'date'>;
13
+ export type TxParams = BaseTxParams & {
14
+ asset?: CompatibleAsset;
15
+ };
13
16
  export type TxOfflineParams = TxParams & {
14
17
  gasLimit?: BigNumber;
15
18
  };
19
+ export { CompatibleAsset };
package/lib/utils.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Network, RootDerivationPaths, TxHash } from '@xchainjs/xchain-client';
2
- import { Address, Asset } from '@xchainjs/xchain-util';
2
+ import { Address } from '@xchainjs/xchain-util';
3
+ import { CompatibleAsset } from './types';
3
4
  /**
4
5
  * Function to retrieve default client URLs based on network configuration.
5
6
  */
@@ -23,17 +24,17 @@ export declare const getExplorerTxUrl: (tx: TxHash) => Record<Network, string>;
23
24
  /**
24
25
  * Checks whether an asset is the native RUNE asset
25
26
  *
26
- * @param {Asset} asset
27
+ * @param {CompatibleAsset} asset
27
28
  * @returns {boolean} `true` or `false`
28
29
  */
29
- export declare const isAssetRuneNative: (asset: Asset) => boolean;
30
+ export declare const isAssetRuneNative: (asset: CompatibleAsset) => boolean;
30
31
  /**
31
32
  * Get denomination from Asset
32
33
  *
33
- * @param {Asset} asset
34
+ * @param {CompatibleAsset} asset
34
35
  * @returns {string} The denomination of the given asset
35
36
  */
36
- export declare const getDenom: (asset: Asset) => string;
37
+ export declare const getDenom: (asset: CompatibleAsset) => string;
37
38
  /**
38
39
  * Get chain id from node url
39
40
  *
@@ -63,3 +64,13 @@ export declare function sortedObject(obj: any): any;
63
64
  * Returns a JSON string with objects sorted by key
64
65
  * */
65
66
  export declare function sortAndStringifyJson(obj: any): string;
67
+ /**
68
+ * Parse XChainJS asset to Thornode asset
69
+ */
70
+ export declare const parseAssetToTHORNodeAsset: (asset: CompatibleAsset) => {
71
+ chain: string;
72
+ symbol: string;
73
+ ticker: string;
74
+ synth: boolean;
75
+ trade: boolean;
76
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain",
3
- "version": "1.1.1",
3
+ "version": "2.0.1",
4
4
  "description": "Custom Thorchain client and utilities used by XChainJS clients",
5
5
  "keywords": [
6
6
  "THORChain",
@@ -40,10 +40,10 @@
40
40
  "@cosmjs/proto-signing": "0.31.1",
41
41
  "@ledgerhq/hw-transport": "6.30.6",
42
42
  "@xchainjs/ledger-thorchain": "0.2.0",
43
- "@xchainjs/xchain-client": "0.16.8",
44
- "@xchainjs/xchain-cosmos-sdk": "0.2.13",
45
- "@xchainjs/xchain-util": "0.13.7",
46
- "axios": "1.3.6",
43
+ "@xchainjs/xchain-client": "1.0.1",
44
+ "@xchainjs/xchain-cosmos-sdk": "1.0.1",
45
+ "@xchainjs/xchain-util": "1.0.0",
46
+ "axios": "1.7.4",
47
47
  "bech32": "^1.1.3",
48
48
  "bignumber.js": "9.0.0",
49
49
  "bip32": "^2.0.6",