@clonegod/ttd-sol-common 1.0.131 → 1.0.132
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.
|
@@ -715,33 +715,6 @@ class RpcClient {
|
|
|
715
715
|
txid,
|
|
716
716
|
bundleId
|
|
717
717
|
});
|
|
718
|
-
const currentBlockHeight = yield solana_trade_runtime.connection.getBlockHeight();
|
|
719
|
-
const lastValidBlockHeight = Math.min(blockhash.lastValidBlockHeight, currentBlockHeight + lastValidBlockHeightOffset);
|
|
720
|
-
const timeout = 70000;
|
|
721
|
-
const interval = 10000;
|
|
722
|
-
const startTime = Date.now();
|
|
723
|
-
while (Date.now() - startTime < timeout ||
|
|
724
|
-
(yield this.connection.getBlockHeight()) <= lastValidBlockHeight) {
|
|
725
|
-
yield new Promise((resolve) => setTimeout(resolve, interval));
|
|
726
|
-
const bundleStatuses = yield this.getBundleStatuses([bundleId], jitoApiUrl);
|
|
727
|
-
(0, dist_1.log_info)(`getBundleStatuses`, {
|
|
728
|
-
txid,
|
|
729
|
-
bundleId,
|
|
730
|
-
jitoApiUrl,
|
|
731
|
-
bundleStatuses
|
|
732
|
-
});
|
|
733
|
-
if (bundleStatuses &&
|
|
734
|
-
bundleStatuses.value &&
|
|
735
|
-
bundleStatuses.value.length > 0 &&
|
|
736
|
-
bundleStatuses.value[0]) {
|
|
737
|
-
const status = bundleStatuses.value[0].confirmation_status;
|
|
738
|
-
if (status === 'confirmed') {
|
|
739
|
-
return bundleStatuses.value[0].transactions[0];
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
let err = new Error('Bundle failed to confirm within the timeout period:' + timeout + 'ms');
|
|
744
|
-
(0, dist_1.log_error)(`Bundle failed to confirm, txid=${txid}`, err);
|
|
745
718
|
}), 0);
|
|
746
719
|
return txid;
|
|
747
720
|
});
|