@xchainjs/xchain-thorchain 3.0.0 → 3.0.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.
package/lib/const.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CosmosSdkClientParams } from '@xchainjs/xchain-cosmos-sdk';
2
- import { Asset, BaseAmount } from '@xchainjs/xchain-util';
2
+ import { Asset, BaseAmount, TokenAsset } from '@xchainjs/xchain-util';
3
3
  /**
4
4
  * Explorer Url for THORChain
5
5
  */
@@ -12,10 +12,18 @@ export declare const RUNE_DECIMAL = 8;
12
12
  * Denomination of the RUNE asset
13
13
  */
14
14
  export declare const RUNE_DENOM = "rune";
15
+ /**
16
+ * Denomination of the RUNE asset
17
+ */
18
+ export declare const TCY_DENOM = "tcy";
15
19
  /**
16
20
  * Ticker symbol for the RUNE asset
17
21
  */
18
22
  export declare const RUNE_TICKER = "RUNE";
23
+ /**
24
+ * Ticker symbol for the RUNE asset
25
+ */
26
+ export declare const TCY_TICKER = "TCY";
19
27
  /**
20
28
  * Default fee used by the client to make transactions
21
29
  */
@@ -36,6 +44,10 @@ export declare const THORChain: "THOR";
36
44
  * Native asset representation for RUNE in Thorchain
37
45
  */
38
46
  export declare const AssetRuneNative: Asset;
47
+ /**
48
+ * Native asset representation for RUNE in Thorchain
49
+ */
50
+ export declare const AssetTCY: TokenAsset;
39
51
  /**
40
52
  * Message type URL used to make send transactions
41
53
  */
package/lib/index.esm.js CHANGED
@@ -3084,6 +3084,13 @@ const getExplorerTxUrl = (tx) => ({
3084
3084
  * @returns {boolean} `true` or `false`
3085
3085
  */
3086
3086
  const isAssetRuneNative = (asset) => assetToString(asset) === assetToString(AssetRuneNative);
3087
+ /**
3088
+ * Checks whether an asset is the native TCY asset
3089
+ *
3090
+ * @param {CompatibleAsset} asset
3091
+ * @returns {boolean} `true` or `false`
3092
+ */
3093
+ const isTCYAsset = (asset) => assetToString(asset) === assetToString(AssetTCY);
3087
3094
  /**
3088
3095
  * Get denomination from Asset
3089
3096
  *
@@ -3097,6 +3104,8 @@ const getDenom = (asset) => {
3097
3104
  return assetToString(asset).toLowerCase();
3098
3105
  if (isSecuredAsset(asset))
3099
3106
  return assetToString(asset).toLowerCase();
3107
+ if (isTCYAsset(asset))
3108
+ return TCY_DENOM;
3100
3109
  return asset.symbol.toLowerCase();
3101
3110
  };
3102
3111
  /**
@@ -3209,10 +3218,18 @@ const RUNE_DECIMAL = 8;
3209
3218
  * Denomination of the RUNE asset
3210
3219
  */
3211
3220
  const RUNE_DENOM = 'rune';
3221
+ /**
3222
+ * Denomination of the RUNE asset
3223
+ */
3224
+ const TCY_DENOM = 'tcy';
3212
3225
  /**
3213
3226
  * Ticker symbol for the RUNE asset
3214
3227
  */
3215
3228
  const RUNE_TICKER = 'RUNE';
3229
+ /**
3230
+ * Ticker symbol for the RUNE asset
3231
+ */
3232
+ const TCY_TICKER = 'TCY';
3216
3233
  /**
3217
3234
  * Default fee used by the client to make transactions
3218
3235
  */
@@ -3238,6 +3255,15 @@ const AssetRuneNative = {
3238
3255
  ticker: RUNE_TICKER,
3239
3256
  type: AssetType.NATIVE,
3240
3257
  };
3258
+ /**
3259
+ * Native asset representation for RUNE in Thorchain
3260
+ */
3261
+ const AssetTCY = {
3262
+ chain: THORChain,
3263
+ symbol: TCY_TICKER,
3264
+ ticker: TCY_TICKER,
3265
+ type: AssetType.TOKEN,
3266
+ };
3241
3267
  /**
3242
3268
  * Message type URL used to make send transactions
3243
3269
  */
@@ -3343,6 +3369,8 @@ class Client extends Client$1 {
3343
3369
  assetFromDenom(denom) {
3344
3370
  if (denom === RUNE_DENOM)
3345
3371
  return AssetRuneNative;
3372
+ if (denom === TCY_DENOM)
3373
+ return AssetTCY;
3346
3374
  return assetFromString(denom.toUpperCase());
3347
3375
  }
3348
3376
  /**
@@ -3913,4 +3941,4 @@ class ClientLedger extends Client {
3913
3941
  }
3914
3942
  }
3915
3943
 
3916
- export { AssetRuneNative, ClientKeystore as Client, ClientKeystore, ClientLedger, DEFAULT_EXPLORER_URL, DEFAULT_FEE, DEFAULT_GAS_LIMIT_VALUE, DEPOSIT_GAS_LIMIT_VALUE, MSG_DEPOSIT_TYPE_URL, MSG_SEND_TYPE_URL, RUNE_DECIMAL, RUNE_DENOM, RUNE_TICKER, THORChain, defaultClientConfig, getChainId, getDefaultClientUrls, getDefaultExplorers, getDefaultRootDerivationPaths, getDenom, getExplorerAddressUrl, getExplorerTxUrl, getPrefix, isAssetRuneNative, parseAssetToTHORNodeAsset, parseDerivationPath, sortAndStringifyJson, sortedObject };
3944
+ export { AssetRuneNative, AssetTCY, ClientKeystore as Client, ClientKeystore, ClientLedger, DEFAULT_EXPLORER_URL, DEFAULT_FEE, DEFAULT_GAS_LIMIT_VALUE, DEPOSIT_GAS_LIMIT_VALUE, MSG_DEPOSIT_TYPE_URL, MSG_SEND_TYPE_URL, RUNE_DECIMAL, RUNE_DENOM, RUNE_TICKER, TCY_DENOM, TCY_TICKER, THORChain, defaultClientConfig, getChainId, getDefaultClientUrls, getDefaultExplorers, getDefaultRootDerivationPaths, getDenom, getExplorerAddressUrl, getExplorerTxUrl, getPrefix, isAssetRuneNative, isTCYAsset, parseAssetToTHORNodeAsset, parseDerivationPath, sortAndStringifyJson, sortedObject };
package/lib/index.js CHANGED
@@ -3110,6 +3110,13 @@ const getExplorerTxUrl = (tx) => ({
3110
3110
  * @returns {boolean} `true` or `false`
3111
3111
  */
3112
3112
  const isAssetRuneNative = (asset) => xchainUtil.assetToString(asset) === xchainUtil.assetToString(AssetRuneNative);
3113
+ /**
3114
+ * Checks whether an asset is the native TCY asset
3115
+ *
3116
+ * @param {CompatibleAsset} asset
3117
+ * @returns {boolean} `true` or `false`
3118
+ */
3119
+ const isTCYAsset = (asset) => xchainUtil.assetToString(asset) === xchainUtil.assetToString(AssetTCY);
3113
3120
  /**
3114
3121
  * Get denomination from Asset
3115
3122
  *
@@ -3123,6 +3130,8 @@ const getDenom = (asset) => {
3123
3130
  return xchainUtil.assetToString(asset).toLowerCase();
3124
3131
  if (xchainUtil.isSecuredAsset(asset))
3125
3132
  return xchainUtil.assetToString(asset).toLowerCase();
3133
+ if (isTCYAsset(asset))
3134
+ return TCY_DENOM;
3126
3135
  return asset.symbol.toLowerCase();
3127
3136
  };
3128
3137
  /**
@@ -3235,10 +3244,18 @@ const RUNE_DECIMAL = 8;
3235
3244
  * Denomination of the RUNE asset
3236
3245
  */
3237
3246
  const RUNE_DENOM = 'rune';
3247
+ /**
3248
+ * Denomination of the RUNE asset
3249
+ */
3250
+ const TCY_DENOM = 'tcy';
3238
3251
  /**
3239
3252
  * Ticker symbol for the RUNE asset
3240
3253
  */
3241
3254
  const RUNE_TICKER = 'RUNE';
3255
+ /**
3256
+ * Ticker symbol for the RUNE asset
3257
+ */
3258
+ const TCY_TICKER = 'TCY';
3242
3259
  /**
3243
3260
  * Default fee used by the client to make transactions
3244
3261
  */
@@ -3264,6 +3281,15 @@ const AssetRuneNative = {
3264
3281
  ticker: RUNE_TICKER,
3265
3282
  type: xchainUtil.AssetType.NATIVE,
3266
3283
  };
3284
+ /**
3285
+ * Native asset representation for RUNE in Thorchain
3286
+ */
3287
+ const AssetTCY = {
3288
+ chain: THORChain,
3289
+ symbol: TCY_TICKER,
3290
+ ticker: TCY_TICKER,
3291
+ type: xchainUtil.AssetType.TOKEN,
3292
+ };
3267
3293
  /**
3268
3294
  * Message type URL used to make send transactions
3269
3295
  */
@@ -3369,6 +3395,8 @@ class Client extends xchainCosmosSdk.Client {
3369
3395
  assetFromDenom(denom) {
3370
3396
  if (denom === RUNE_DENOM)
3371
3397
  return AssetRuneNative;
3398
+ if (denom === TCY_DENOM)
3399
+ return AssetTCY;
3372
3400
  return xchainUtil.assetFromString(denom.toUpperCase());
3373
3401
  }
3374
3402
  /**
@@ -3940,6 +3968,7 @@ class ClientLedger extends Client {
3940
3968
  }
3941
3969
 
3942
3970
  exports.AssetRuneNative = AssetRuneNative;
3971
+ exports.AssetTCY = AssetTCY;
3943
3972
  exports.Client = ClientKeystore;
3944
3973
  exports.ClientKeystore = ClientKeystore;
3945
3974
  exports.ClientLedger = ClientLedger;
@@ -3952,6 +3981,8 @@ exports.MSG_SEND_TYPE_URL = MSG_SEND_TYPE_URL;
3952
3981
  exports.RUNE_DECIMAL = RUNE_DECIMAL;
3953
3982
  exports.RUNE_DENOM = RUNE_DENOM;
3954
3983
  exports.RUNE_TICKER = RUNE_TICKER;
3984
+ exports.TCY_DENOM = TCY_DENOM;
3985
+ exports.TCY_TICKER = TCY_TICKER;
3955
3986
  exports.THORChain = THORChain;
3956
3987
  exports.defaultClientConfig = defaultClientConfig;
3957
3988
  exports.getChainId = getChainId;
@@ -3963,6 +3994,7 @@ exports.getExplorerAddressUrl = getExplorerAddressUrl;
3963
3994
  exports.getExplorerTxUrl = getExplorerTxUrl;
3964
3995
  exports.getPrefix = getPrefix;
3965
3996
  exports.isAssetRuneNative = isAssetRuneNative;
3997
+ exports.isTCYAsset = isTCYAsset;
3966
3998
  exports.parseAssetToTHORNodeAsset = parseAssetToTHORNodeAsset;
3967
3999
  exports.parseDerivationPath = parseDerivationPath;
3968
4000
  exports.sortAndStringifyJson = sortAndStringifyJson;
package/lib/utils.d.ts CHANGED
@@ -28,6 +28,13 @@ export declare const getExplorerTxUrl: (tx: TxHash) => Record<Network, string>;
28
28
  * @returns {boolean} `true` or `false`
29
29
  */
30
30
  export declare const isAssetRuneNative: (asset: CompatibleAsset) => boolean;
31
+ /**
32
+ * Checks whether an asset is the native TCY asset
33
+ *
34
+ * @param {CompatibleAsset} asset
35
+ * @returns {boolean} `true` or `false`
36
+ */
37
+ export declare const isTCYAsset: (asset: CompatibleAsset) => boolean;
31
38
  /**
32
39
  * Get denomination from Asset
33
40
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Custom Thorchain client and utilities used by XChainJS clients",
5
5
  "keywords": [
6
6
  "THORChain",