@drift-labs/sdk 2.77.0-beta.2 → 2.77.0-beta.3
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/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.77.0-beta.
|
|
1
|
+
2.77.0-beta.3
|
|
@@ -8,10 +8,18 @@ const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
|
8
8
|
async function fetchDriftPriorityFee(url, marketTypes, marketIndexs) {
|
|
9
9
|
try {
|
|
10
10
|
const response = await (0, node_fetch_1.default)(`${url}/batchPriorityFees?marketType=${marketTypes.join(',')}&marketIndex=${marketIndexs.join(',')}`);
|
|
11
|
+
if (!response.ok) {
|
|
12
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
13
|
+
}
|
|
11
14
|
return await response.json();
|
|
12
15
|
}
|
|
13
16
|
catch (err) {
|
|
14
|
-
|
|
17
|
+
if (err instanceof Error) {
|
|
18
|
+
console.error('Error fetching priority fees:', err.message);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
console.error('Unknown error fetching priority fees:', err);
|
|
22
|
+
}
|
|
15
23
|
}
|
|
16
24
|
return [];
|
|
17
25
|
}
|
package/package.json
CHANGED
|
@@ -14,9 +14,16 @@ export async function fetchDriftPriorityFee(
|
|
|
14
14
|
','
|
|
15
15
|
)}&marketIndex=${marketIndexs.join(',')}`
|
|
16
16
|
);
|
|
17
|
+
if (!response.ok) {
|
|
18
|
+
throw new Error(`HTTP error! status: ${response.status}`);
|
|
19
|
+
}
|
|
17
20
|
return await response.json();
|
|
18
21
|
} catch (err) {
|
|
19
|
-
|
|
22
|
+
if (err instanceof Error) {
|
|
23
|
+
console.error('Error fetching priority fees:', err.message);
|
|
24
|
+
} else {
|
|
25
|
+
console.error('Unknown error fetching priority fees:', err);
|
|
26
|
+
}
|
|
20
27
|
}
|
|
21
28
|
|
|
22
29
|
return [];
|