@clonegod/ttd-core 2.1.6 → 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 =
|
|
106
|
+
const timeout = 6000;
|
|
107
107
|
const maxRetries = 2;
|
|
108
108
|
const retrysleepMs = 500;
|
|
109
|
-
const url =
|
|
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, {
|
|
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;
|