@clonegod/ttd-sol-common 1.1.2 → 1.1.4
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.
|
@@ -690,6 +690,29 @@ class RpcClient {
|
|
|
690
690
|
serializedMainTx
|
|
691
691
|
].join(',');
|
|
692
692
|
const max_retry = Number(process.env.JITO_MAX_RETRIES || '0');
|
|
693
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
694
|
+
let jito_send_tx_ext_srv_list = process.env.JITO_SEND_TX_EXT_SRV_LIST || '';
|
|
695
|
+
if ((0, dist_1.isEmpty)(jito_send_tx_ext_srv_list)) {
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
jito_send_tx_ext_srv_list.split(';').filter(Boolean).forEach((region_group) => __awaiter(this, void 0, void 0, function* () {
|
|
699
|
+
let index = (0, dist_1.generateRandomNumber)(0, region_group.split(',').length - 1);
|
|
700
|
+
let host = region_group.split(',')[index];
|
|
701
|
+
let url = `http://${host}/solana/send_tx`;
|
|
702
|
+
(0, dist_1.postJSON)(url, {
|
|
703
|
+
encoding,
|
|
704
|
+
encoded_tx,
|
|
705
|
+
txid,
|
|
706
|
+
trace_id: '',
|
|
707
|
+
group_id,
|
|
708
|
+
max_retry
|
|
709
|
+
}).then(res => {
|
|
710
|
+
(0, dist_1.log_info)(`redirect tx ${txid} to ${url} success`, res);
|
|
711
|
+
}).catch(err => {
|
|
712
|
+
(0, dist_1.log_error)(`redirect tx ${txid} to ${url} failed`, err);
|
|
713
|
+
});
|
|
714
|
+
}));
|
|
715
|
+
}), 0);
|
|
693
716
|
const send_result = yield (0, dist_1.postJSON)(send_tx_jito_url, {
|
|
694
717
|
encoding,
|
|
695
718
|
encoded_tx,
|