@clonegod/ttd-core 2.0.23 → 2.0.25

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.
@@ -8,11 +8,11 @@ const token_1 = require("../token");
8
8
  const token_util_1 = require("../token/token_util");
9
9
  function get_pair_name(native_token, pool_name) {
10
10
  let arr = pool_name.split('/');
11
- if (pool_name.includes(native_token) && (pool_name.includes('USDC') || pool_name.includes('USDT'))) {
11
+ if (pool_name.includes(native_token) && (pool_name.includes('USDC') || pool_name.includes('USDT') || pool_name.includes('USD1'))) {
12
12
  if (pool_name.endsWith(native_token)) {
13
13
  arr.reverse();
14
14
  }
15
- return arr.join('/').replace('USDC', 'USDT');
15
+ return arr.join('/').replace('USDC', 'USDT').replace('USD1', 'USDT');
16
16
  }
17
17
  const symbols = pool_name.split('/');
18
18
  if (symbols.includes(native_token)) {
@@ -21,11 +21,11 @@ function get_pair_name(native_token, pool_name) {
21
21
  }
22
22
  return arr.join('/');
23
23
  }
24
- if (symbols.includes('USDC') || symbols.includes('USDT')) {
25
- if (symbols[1] !== 'USDC' && symbols[1] !== 'USDT') {
24
+ if (symbols.includes('USDC') || symbols.includes('USDT') || symbols.includes('USD1')) {
25
+ if (symbols[1] !== 'USDC' && symbols[1] !== 'USDT' && symbols[1] !== 'USD1') {
26
26
  arr.reverse();
27
27
  }
28
- return arr.join('/').replace('USDC', 'USDT');
28
+ return arr.join('/').replace('USDC', 'USDT').replace('USD1', 'USDT');
29
29
  }
30
30
  return pool_name;
31
31
  }
@@ -52,8 +52,8 @@ function valid_fetch_pool_data(formatted_pool, min_tvl, min_vol, native_token) {
52
52
  if ((tvl < min_tvl || vol_24h < min_vol)) {
53
53
  throw new Error(`pool is too small: ${pool_name}, ${pool_address}, tvl=${tvl}, vol_24h=${vol_24h}`);
54
54
  }
55
- if (!symbols.includes(native_token) && !symbols.includes('USDC') && !symbols.includes('USDT')) {
56
- throw new Error(`pool don't contains: SOL, USDC, USDT, ${pool_name}, ${pool_address}`);
55
+ if (!symbols.includes(native_token) && !symbols.includes('USDC') && !symbols.includes('USDT') && !symbols.includes('USD1')) {
56
+ throw new Error(`pool don't contains: SOL, USDC, USDT, USD1, ${pool_name}, ${pool_address}`);
57
57
  }
58
58
  if (!(0, token_util_1.is_valid_symbol)(tokenA.symbol)) {
59
59
  throw new Error(`pool contains bad symbol: tokenA.symbol=${tokenA.symbol}, ${pool_name}, ${pool_address}`);
@@ -76,7 +76,6 @@ class AbstractTransactionResultCheck {
76
76
  order_end_time,
77
77
  total_order_time,
78
78
  };
79
- let tip_amount = this.context.ui_tip_amount || 0;
80
79
  let broadcast = [];
81
80
  broadcast.push({
82
81
  rpc: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.0.23",
3
+ "version": "2.0.25",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",