@clonegod/ttd-sol-common 2.0.27 → 2.0.29
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/dist/trade/send/jito.js
CHANGED
|
@@ -78,7 +78,7 @@ const getJitoTipAccount = () => {
|
|
|
78
78
|
exports.getJitoTipAccount = getJitoTipAccount;
|
|
79
79
|
JitoUtils.init();
|
|
80
80
|
const sendBundleWithJito = async (mainTx, tipTx) => {
|
|
81
|
-
var _a, _b
|
|
81
|
+
var _a, _b;
|
|
82
82
|
let url = process.env.JITO_SEND_BUNDLE_URL || 'https://tokyo.mainnet.block-engine.jito.wtf/api/v1/bundles';
|
|
83
83
|
const client = (0, http_client_1.getHttpClient)(url);
|
|
84
84
|
const requestData = {
|
|
@@ -94,16 +94,15 @@ const sendBundleWithJito = async (mainTx, tipTx) => {
|
|
|
94
94
|
};
|
|
95
95
|
try {
|
|
96
96
|
const response = await client.post(url, requestData);
|
|
97
|
-
|
|
97
|
+
const bundleId = response.data.result;
|
|
98
|
+
console.log(`[sendBundleWithJito] bundleId: ${bundleId}`);
|
|
99
|
+
return bundleId;
|
|
98
100
|
}
|
|
99
101
|
catch (error) {
|
|
100
102
|
if (error instanceof axios_1.AxiosError) {
|
|
101
|
-
const
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
const status = (_e = error.response) === null || _e === void 0 ? void 0 : _e.status;
|
|
105
|
-
const statusText = (_f = error.response) === null || _f === void 0 ? void 0 : _f.statusText;
|
|
106
|
-
(0, dist_1.log_warn)(`[sendBundleWithJito] Request failed - method: ${method}, url: ${errorUrl}, status: ${status}, statusText: ${statusText}, data: ${errorData}`);
|
|
103
|
+
const status = (_a = error.response) === null || _a === void 0 ? void 0 : _a.status;
|
|
104
|
+
const statusText = (_b = error.response) === null || _b === void 0 ? void 0 : _b.statusText;
|
|
105
|
+
(0, dist_1.log_warn)(`[sendBundleWithJito] Request failed: ${status} - ${statusText}`);
|
|
107
106
|
}
|
|
108
107
|
else {
|
|
109
108
|
(0, dist_1.log_warn)(`[sendBundleWithJito] Unexpected error: ${url} - ${error.message}`);
|
package/package.json
CHANGED
package/src/trade/send/jito.ts
CHANGED
|
@@ -76,17 +76,17 @@ export const sendBundleWithJito = async (mainTx: Transaction, tipTx: Transaction
|
|
|
76
76
|
// id: 1
|
|
77
77
|
// }
|
|
78
78
|
// console.dir(response.data, { depth: null })
|
|
79
|
-
|
|
79
|
+
const bundleId = response.data.result;
|
|
80
|
+
console.log(`[sendBundleWithJito] bundleId: ${bundleId}`);
|
|
81
|
+
|
|
82
|
+
return bundleId;
|
|
80
83
|
} catch (error) {
|
|
81
84
|
if(error instanceof AxiosError) {
|
|
82
85
|
// 提取关键错误信息
|
|
83
|
-
const method = error.config?.method?.toUpperCase() || '';
|
|
84
|
-
const errorUrl = error.config?.url || url;
|
|
85
|
-
const errorData = error.config?.data;
|
|
86
86
|
const status = error.response?.status;
|
|
87
87
|
const statusText = error.response?.statusText;
|
|
88
88
|
|
|
89
|
-
log_warn(`[sendBundleWithJito] Request failed
|
|
89
|
+
log_warn(`[sendBundleWithJito] Request failed: ${status} - ${statusText}`);
|
|
90
90
|
} else {
|
|
91
91
|
log_warn(`[sendBundleWithJito] Unexpected error: ${url} - ${error.message}`);
|
|
92
92
|
}
|