@xchainjs/xchain-thorchain-query 2.0.6 → 2.0.7

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/index.esm.js CHANGED
@@ -88,6 +88,10 @@ const DefaultChainAttributes = {
88
88
  blockReward: 0,
89
89
  avgBlockTimeInSecs: 4, // Average block time for xrp in seconds
90
90
  },
91
+ SOL: {
92
+ blockReward: 0,
93
+ avgBlockTimeInSecs: 0.4, // Average block time for sol in seconds
94
+ },
91
95
  };
92
96
 
93
97
  /**
@@ -131,6 +135,7 @@ const assetUSDC = assetFromStringEx('ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE
131
135
  const AssetBNB = assetFromStringEx('BSC.BNB');
132
136
  const AssetBASE = assetFromStringEx('BASE.ETH');
133
137
  const AssetXRP = assetFromStringEx('XRP.XRP');
138
+ const AssetSOL = assetFromStringEx('SOL.SOL');
134
139
  const BNBChain = 'BNB';
135
140
  const BTCChain = 'BTC';
136
141
  const BCHChain = 'BCH';
@@ -144,6 +149,7 @@ const BSCChain = 'BSC';
144
149
  const THORChain = 'THOR';
145
150
  const BASEChain = 'BASE';
146
151
  const XRPChain = 'XRP';
152
+ const SOLChain = 'SOL';
147
153
  const THORCHAIN_DECIMAL = 8;
148
154
  const isAssetRuneNative = (asset) => assetToString(asset) === assetToString(AssetRuneNative);
149
155
 
@@ -190,6 +196,8 @@ const getChainAsset = (chain) => {
190
196
  return AssetBASE;
191
197
  case XRPChain:
192
198
  return AssetXRP;
199
+ case SOLChain:
200
+ return AssetSOL;
193
201
  default:
194
202
  throw Error('Unknown chain');
195
203
  }
@@ -249,6 +257,8 @@ const calcNetworkFee = (asset, inbound) => {
249
257
  return new AssetCryptoAmount(baseAmount(inbound.gasRate), AssetBASE);
250
258
  case XRPChain:
251
259
  return new AssetCryptoAmount(baseAmount(inbound.gasRate), AssetXRP);
260
+ case SOLChain:
261
+ return new AssetCryptoAmount(baseAmount(inbound.gasRate), AssetSOL);
252
262
  }
253
263
  throw new Error(`could not calculate inbound fee for ${asset.chain}`);
254
264
  };
@@ -287,7 +297,11 @@ const calcOutboundFee = (asset, inbound) => {
287
297
  case MAYAChain:
288
298
  return new AssetCryptoAmount(baseAmount(2000000), AssetMAYA);
289
299
  case BASEChain:
290
- return new AssetCryptoAmount(baseAmount(2000000), AssetBASE);
300
+ return new AssetCryptoAmount(baseAmount(inbound.outboundFee), AssetBASE);
301
+ case XRPChain:
302
+ return new AssetCryptoAmount(baseAmount(inbound.outboundFee), AssetXRP);
303
+ case SOLChain:
304
+ return new AssetCryptoAmount(baseAmount(inbound.outboundFee), AssetSOL);
291
305
  }
292
306
  throw new Error(`could not calculate outbound fee for ${asset.chain}`);
293
307
  };
@@ -3165,4 +3179,4 @@ class TransactionStage {
3165
3179
  }
3166
3180
  }
3167
3181
 
3168
- export { AVAXChain, AddLpStatus, AddSaverStatus, AssetATOM, AssetAVAX, AssetBASE, AssetBCH, AssetBNB, AssetBSC, AssetBTC, AssetDOGE, AssetETH, AssetLTC, AssetMAYA, AssetRuneNative, AssetXRP, BASEChain, BCHChain, BNBChain, BSCChain, BTCChain, DOGEChain, DefaultChainAttributes, ETHChain, GAIAChain, InboundStatus, LTCChain, LiquidityPool, MAYAChain, RefundStatus, SwapStatus, THORCHAIN_DECIMAL, THORChain, ThorchainCache, ThorchainQuery, Thornode, TransactionStage, TxType, WithdrawStatus, XRPChain, assetUSDC, calcNetworkFee, getCryptoAmountWithNotation, getLiquidityProtectionData, getLiquidityUnits, getPoolShare, getSlipOnLiquidity, isAssetRuneNative };
3182
+ export { AVAXChain, AddLpStatus, AddSaverStatus, AssetATOM, AssetAVAX, AssetBASE, AssetBCH, AssetBNB, AssetBSC, AssetBTC, AssetDOGE, AssetETH, AssetLTC, AssetMAYA, AssetRuneNative, AssetSOL, AssetXRP, BASEChain, BCHChain, BNBChain, BSCChain, BTCChain, DOGEChain, DefaultChainAttributes, ETHChain, GAIAChain, InboundStatus, LTCChain, LiquidityPool, MAYAChain, RefundStatus, SOLChain, SwapStatus, THORCHAIN_DECIMAL, THORChain, ThorchainCache, ThorchainQuery, Thornode, TransactionStage, TxType, WithdrawStatus, XRPChain, assetUSDC, calcNetworkFee, getCryptoAmountWithNotation, getLiquidityProtectionData, getLiquidityUnits, getPoolShare, getSlipOnLiquidity, isAssetRuneNative };
package/lib/index.js CHANGED
@@ -96,6 +96,10 @@ const DefaultChainAttributes = {
96
96
  blockReward: 0,
97
97
  avgBlockTimeInSecs: 4, // Average block time for xrp in seconds
98
98
  },
99
+ SOL: {
100
+ blockReward: 0,
101
+ avgBlockTimeInSecs: 0.4, // Average block time for sol in seconds
102
+ },
99
103
  };
100
104
 
101
105
  /**
@@ -139,6 +143,7 @@ const assetUSDC = xchainUtil.assetFromStringEx('ETH.USDC-0XA0B86991C6218B36C1D19
139
143
  const AssetBNB = xchainUtil.assetFromStringEx('BSC.BNB');
140
144
  const AssetBASE = xchainUtil.assetFromStringEx('BASE.ETH');
141
145
  const AssetXRP = xchainUtil.assetFromStringEx('XRP.XRP');
146
+ const AssetSOL = xchainUtil.assetFromStringEx('SOL.SOL');
142
147
  const BNBChain = 'BNB';
143
148
  const BTCChain = 'BTC';
144
149
  const BCHChain = 'BCH';
@@ -152,6 +157,7 @@ const BSCChain = 'BSC';
152
157
  const THORChain = 'THOR';
153
158
  const BASEChain = 'BASE';
154
159
  const XRPChain = 'XRP';
160
+ const SOLChain = 'SOL';
155
161
  const THORCHAIN_DECIMAL = 8;
156
162
  const isAssetRuneNative = (asset) => xchainUtil.assetToString(asset) === xchainUtil.assetToString(AssetRuneNative);
157
163
 
@@ -198,6 +204,8 @@ const getChainAsset = (chain) => {
198
204
  return AssetBASE;
199
205
  case XRPChain:
200
206
  return AssetXRP;
207
+ case SOLChain:
208
+ return AssetSOL;
201
209
  default:
202
210
  throw Error('Unknown chain');
203
211
  }
@@ -257,6 +265,8 @@ const calcNetworkFee = (asset, inbound) => {
257
265
  return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(inbound.gasRate), AssetBASE);
258
266
  case XRPChain:
259
267
  return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(inbound.gasRate), AssetXRP);
268
+ case SOLChain:
269
+ return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(inbound.gasRate), AssetSOL);
260
270
  }
261
271
  throw new Error(`could not calculate inbound fee for ${asset.chain}`);
262
272
  };
@@ -295,7 +305,11 @@ const calcOutboundFee = (asset, inbound) => {
295
305
  case MAYAChain:
296
306
  return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(2000000), AssetMAYA);
297
307
  case BASEChain:
298
- return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(2000000), AssetBASE);
308
+ return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(inbound.outboundFee), AssetBASE);
309
+ case XRPChain:
310
+ return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(inbound.outboundFee), AssetXRP);
311
+ case SOLChain:
312
+ return new xchainUtil.AssetCryptoAmount(xchainUtil.baseAmount(inbound.outboundFee), AssetSOL);
299
313
  }
300
314
  throw new Error(`could not calculate outbound fee for ${asset.chain}`);
301
315
  };
@@ -3186,6 +3200,7 @@ exports.AssetETH = AssetETH;
3186
3200
  exports.AssetLTC = AssetLTC;
3187
3201
  exports.AssetMAYA = AssetMAYA;
3188
3202
  exports.AssetRuneNative = AssetRuneNative;
3203
+ exports.AssetSOL = AssetSOL;
3189
3204
  exports.AssetXRP = AssetXRP;
3190
3205
  exports.BASEChain = BASEChain;
3191
3206
  exports.BCHChain = BCHChain;
@@ -3199,6 +3214,7 @@ exports.GAIAChain = GAIAChain;
3199
3214
  exports.LTCChain = LTCChain;
3200
3215
  exports.LiquidityPool = LiquidityPool;
3201
3216
  exports.MAYAChain = MAYAChain;
3217
+ exports.SOLChain = SOLChain;
3202
3218
  exports.THORCHAIN_DECIMAL = THORCHAIN_DECIMAL;
3203
3219
  exports.THORChain = THORChain;
3204
3220
  exports.ThorchainCache = ThorchainCache;
@@ -13,6 +13,7 @@ export declare const assetUSDC: TokenAsset;
13
13
  export declare const AssetBNB: Asset;
14
14
  export declare const AssetBASE: Asset;
15
15
  export declare const AssetXRP: Asset;
16
+ export declare const AssetSOL: Asset;
16
17
  export declare const BNBChain = "BNB";
17
18
  export declare const BTCChain = "BTC";
18
19
  export declare const BCHChain = "BCH";
@@ -26,5 +27,6 @@ export declare const BSCChain = "BSC";
26
27
  export declare const THORChain = "THOR";
27
28
  export declare const BASEChain = "BASE";
28
29
  export declare const XRPChain = "XRP";
30
+ export declare const SOLChain = "SOL";
29
31
  export declare const THORCHAIN_DECIMAL = 8;
30
32
  export declare const isAssetRuneNative: (asset: AnyAsset) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-thorchain-query",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "license": "MIT",
5
5
  "description": "Thorchain query module that is responsible for estimating swap calculations and add/remove liquidity for thorchain ",
6
6
  "keywords": [
@@ -33,9 +33,9 @@
33
33
  "postversion": "git push --follow-tags"
34
34
  },
35
35
  "dependencies": {
36
- "@xchainjs/xchain-client": "2.0.4",
37
- "@xchainjs/xchain-midgard-query": "2.0.4",
38
- "@xchainjs/xchain-thornode": "1.0.3",
36
+ "@xchainjs/xchain-client": "2.0.5",
37
+ "@xchainjs/xchain-midgard-query": "2.0.5",
38
+ "@xchainjs/xchain-thornode": "1.0.4",
39
39
  "@xchainjs/xchain-util": "2.0.3",
40
40
  "axios": "1.8.4",
41
41
  "axios-retry": "3.2.5",