@clonegod/ttd-core 2.1.5 → 2.1.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.
@@ -103,15 +103,20 @@ function fetchPriceFromJupiter(addresses) {
103
103
  return __awaiter(this, void 0, void 0, function* () {
104
104
  const result = new Map();
105
105
  const currentTime = (0, index_1.getCurDateTime)();
106
- const timeout = 10000;
106
+ const timeout = 6000;
107
107
  const maxRetries = 2;
108
108
  const retrysleepMs = 500;
109
- const url = `https://lite-api.jup.ag/price/v3?ids=${addresses.join(',')}`;
109
+ const url = (process.env.JUPITER_PRICE_API || 'https://api.jup.ag/price/v3') + `?ids=${addresses.join(',')}`;
110
110
  (0, index_1.log_debug)(`[fetchPriceFromJupiter] Requesting Jupiter API for ${addresses.length} tokens`);
111
111
  let retryCount = 0;
112
112
  while (retryCount <= maxRetries) {
113
113
  try {
114
- const response = yield axios_1.default.get(url, { timeout });
114
+ const response = yield axios_1.default.get(url, {
115
+ headers: {
116
+ 'x-api-key': process.env.JUPITER_API_KEY
117
+ },
118
+ timeout,
119
+ });
115
120
  if (response.data) {
116
121
  for (const address of addresses) {
117
122
  const key = address;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
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",
package/types/index.d.ts CHANGED
@@ -172,6 +172,7 @@ export interface TradeStrategyType {
172
172
  sol_priority_fee: number // solana 优先级费用 lamports (1SOL = 10^9 lamports)
173
173
  sol_tip_fee: number // solana tip 金额 lamports (1SOL = 10^9 lamports)
174
174
  sol_swqos_only: boolean // solana 是否只使用swqos提交交易
175
+ sol_bundle_only: boolean // solana 是否只使用bundle提交交易
175
176
  max_block_offset: number // Solana特定:限制交易在多少个区块内有效(约等于秒数,1 block ≈ 0.4秒)。使用最新blockhash,设置lastValidBlockHeight = currentBlockHeight + max_block_offset
176
177
 
177
178
  // evm chain