@@ -221,14 +221,18 @@ export async function executeMultipleTransactions(
221221 connection : Connection ,
222222 txs : ( Transaction | VersionedTransaction ) [ ] ,
223223 confirmationParams : ConfirmationParams ,
224- { sendRate = 1 , sendThrottler } : ThrottleParams ,
224+ { sendRate = 1 , sendThrottler, ... throttlingParams } : ThrottleParams ,
225225) : Promise < PromiseSettledResult < string > [ ] > {
226226 if ( ! sendThrottler ) {
227227 sendThrottler = buildSendThrottler ( sendRate ) ;
228228 }
229229 return Promise . allSettled (
230230 txs . map ( ( tx ) =>
231- executeTransaction ( connection , tx , confirmationParams , { sendRate : sendRate , sendThrottler : sendThrottler } ) ,
231+ executeTransaction ( connection , tx , confirmationParams , {
232+ ...throttlingParams ,
233+ sendRate : sendRate ,
234+ sendThrottler : sendThrottler ,
235+ } ) ,
232236 ) ,
233237 ) ;
234238}
@@ -250,7 +254,7 @@ export async function sendAndConfirmTransaction(
250254 connection : Connection ,
251255 tx : Transaction | VersionedTransaction ,
252256 { hash, context, commitment } : ConfirmationParams ,
253- { sendRate = 1 , sendThrottler } : ThrottleParams ,
257+ { sendRate = 1 , sendThrottler, waitBeforeConfirming } : ThrottleParams ,
254258) : Promise < string > {
255259 const isVersioned = isTransactionVersioned ( tx ) ;
256260
@@ -291,7 +295,8 @@ export async function sendAndConfirmTransaction(
291295 }
292296 throw e ;
293297 }
294- await sleep ( 500 ) ;
298+ // Wait at least 5 slots (~400ms before confirming)
299+ await sleep ( waitBeforeConfirming ?? 2000 ) ;
295300 try {
296301 const value = await confirmAndEnsureTransaction ( connection , signature ) ;
297302 if ( value ) {
0 commit comments