@clonegod/ttd-core 2.0.22 → 2.0.24

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.
@@ -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}`);
@@ -48,6 +48,10 @@ class AbstractTransactionResultCheck {
48
48
  }
49
49
  map_swap_result_to_tx_result(swap_result) {
50
50
  let { success, error_code, wallet, block_number, block_time: order_block_time, txid, tx_price, tokenA, tokenB, gas_fee } = swap_result;
51
+ if (this.context.ui_tip_amount) {
52
+ gas_fee.priority_fee = this.context.ui_tip_amount;
53
+ gas_fee.total_fee = gas_fee.base_fee + gas_fee.priority_fee;
54
+ }
51
55
  let { pool_name, is_reverse_token } = this.pool_info;
52
56
  let { chain_id, dex_id, unique_orderbook_id, pair, price_id, time: quote_time, ask, bid } = this.price_msg;
53
57
  let { group_id, unique_order_msg_id, order_send_time, order_recv_time, order_submit_time, aToB } = this.order_msg;
@@ -15,7 +15,7 @@ export declare class TradeContext {
15
15
  pool_info: StandardPoolInfoType;
16
16
  aToB: boolean;
17
17
  slippage_bps: number;
18
- tip_amount: number;
18
+ ui_tip_amount: number;
19
19
  constructor(price_msg: PriceMessageType, order_msg: OrderMessageType);
20
20
  init(appConfig: AppConfig): Promise<void>;
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.0.22",
3
+ "version": "2.0.24",
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",