@@ -84,9 +84,7 @@ export const getSimulationComputeUnits = async (
8484 const simulationInstructions = [ ...instructions ] ;
8585
8686 // Replace or add compute limit instruction
87- const computeLimitIndex = simulationInstructions . findIndex (
88- isSetComputeLimitInstruction ,
89- ) ;
87+ const computeLimitIndex = simulationInstructions . findIndex ( isSetComputeLimitInstruction ) ;
9088 const simulationLimitIx = ComputeBudgetProgram . setComputeUnitLimit ( {
9189 units : 1_400_000 ,
9290 } ) ;
@@ -116,8 +114,7 @@ export const getSimulationComputeUnits = async (
116114 if ( rpcResponse ?. value ?. err ) {
117115 const logs = rpcResponse . value . logs ?. join ( "\n • " ) || "No logs available" ;
118116 throw new Error (
119- `Transaction simulation failed:\n •${ logs } ` +
120- JSON . stringify ( rpcResponse ?. value ?. err ) ,
117+ `Transaction simulation failed:\n •${ logs } ` + JSON . stringify ( rpcResponse ?. value ?. err ) ,
121118 ) ;
122119 }
123120
@@ -173,9 +170,7 @@ export type ComputeUnitBuffer = {
173170/**
174171 * Default configuration values for transaction sending
175172 */
176- export const DEFAULT_SEND_OPTIONS : Required <
177- Omit < SendTransactionOptions , "onStatusUpdate" >
178- > = {
173+ export const DEFAULT_SEND_OPTIONS : Required < Omit < SendTransactionOptions , "onStatusUpdate" > > = {
179174 maxRetries : MAX_RETRIES ,
180175 initialDelayMs : RETRY_INTERVAL_MS ,
181176 commitment : "confirmed" ,
@@ -239,7 +234,7 @@ export async function sendTransaction(
239234 // Skip compute preparation if transaction is already signed or has compute instructions
240235 if ( transaction . signatures . length > 0 ) {
241236 console . log ( "Transaction already signed, skipping compute preparation" ) ;
242- return sendRawTransactionWithRetry ( connection , transaction . serialize ( ) , {
237+ return sendRawTransactionWithRetry ( connection , transaction . serialize ( ) as Uint8Array , {
243238 commitment,
244239 ...sendOptions ,
245240 } ) ;
@@ -256,7 +251,7 @@ export async function sendTransaction(
256251 ) ;
257252
258253 transaction . sign ( ...signers ) ;
259- return sendRawTransactionWithRetry ( connection , transaction . serialize ( ) , {
254+ return sendRawTransactionWithRetry ( connection , transaction . serialize ( ) as Uint8Array , {
260255 commitment,
261256 ...sendOptions ,
262257 } ) ;
@@ -318,8 +313,7 @@ export async function sendVersionedTransaction(
318313 ...sendOptions
319314 } = options ;
320315
321- const hasComputeLimitInstructions =
322- hasSetComputeLimitInstruction ( instructions ) ;
316+ const hasComputeLimitInstructions = hasSetComputeLimitInstruction ( instructions ) ;
323317
324318 if ( ! hasComputeLimitInstructions ) {
325319 const computeUnitBuffer = userComputeBuffer ?? { multiplier : 1.1 } ;
@@ -336,20 +330,15 @@ export async function sendVersionedTransaction(
336330
337331 const messageV0 = new TransactionMessage ( {
338332 payerKey : signers [ 0 ] . publicKey ,
339- recentBlockhash : ( await connection . getLatestBlockhash ( commitment ) )
340- . blockhash ,
333+ recentBlockhash : ( await connection . getLatestBlockhash ( commitment ) ) . blockhash ,
341334 instructions,
342335 } ) . compileToV0Message ( lookupTables ) ;
343336
344337 const transaction = new VersionedTransaction ( messageV0 ) ;
345338
346339 transaction . sign ( signers ) ;
347340
348- return await sendRawTransactionWithRetry (
349- connection ,
350- transaction . serialize ( ) ,
351- sendOptions ,
352- ) ;
341+ return await sendRawTransactionWithRetry ( connection , transaction . serialize ( ) , sendOptions ) ;
353342}
354343
355344/**
@@ -399,9 +388,7 @@ export async function addComputeInstructions(
399388 // Apply buffer to compute units
400389 let finalComputeUnits = simulatedCompute ;
401390 if ( computeUnitBuffer . multiplier ) {
402- finalComputeUnits = Math . floor (
403- finalComputeUnits * computeUnitBuffer . multiplier ,
404- ) ;
391+ finalComputeUnits = Math . floor ( finalComputeUnits * computeUnitBuffer . multiplier ) ;
405392 }
406393 if ( computeUnitBuffer . fixed ) {
407394 finalComputeUnits += computeUnitBuffer . fixed ;
@@ -541,12 +528,11 @@ export async function createLookupTable(
541528) : Promise < [ PublicKey , AddressLookupTableAccount ] > {
542529 const slot = await connection . getSlot ( ) ;
543530
544- const [ lookupTableInst , lookupTableAddress ] =
545- AddressLookupTableProgram . createLookupTable ( {
546- authority : sender . publicKey ,
547- payer : sender . publicKey ,
548- recentSlot : slot ,
549- } ) ;
531+ const [ lookupTableInst , lookupTableAddress ] = AddressLookupTableProgram . createLookupTable ( {
532+ authority : sender . publicKey ,
533+ payer : sender . publicKey ,
534+ recentSlot : slot ,
535+ } ) ;
550536
551537 const extendInstruction = AddressLookupTableProgram . extendLookupTable ( {
552538 payer : sender . publicKey ,
@@ -565,16 +551,9 @@ export async function createLookupTable(
565551 ) ;
566552
567553 // Need to wait until the lookup table is active
568- await confirmTransaction (
569- connection ,
570- lookupTableInstructionsSignature ,
571- "finalized" ,
572- ) ;
554+ await confirmTransaction ( connection , lookupTableInstructionsSignature , "finalized" ) ;
573555
574- console . log (
575- "Lookup table instructions signature" ,
576- lookupTableInstructionsSignature ,
577- ) ;
556+ console . log ( "Lookup table instructions signature" , lookupTableInstructionsSignature ) ;
578557
579558 const lookupTableAccount = (
580559 await connection . getAddressLookupTable ( lookupTableAddress , {
0 commit comments