File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,9 @@ import type {
4
4
Transaction ,
5
5
TransactionInstruction ,
6
6
VersionedTransaction ,
7
-
8
- PublicKey } from '@solana/web3.js' ;
7
+ PublicKey ,
8
+ AddressLookupTableAccount ,
9
+ } from '@solana/web3.js' ;
9
10
import {
10
11
ComputeBudgetProgram ,
11
12
Keypair ,
@@ -406,8 +407,19 @@ export async function determinePriorityFee(
406
407
// Figure out which accounts need write lock
407
408
let lockedWritableAccounts = [ ] ;
408
409
if ( isVersionedTransaction ( transaction ) ) {
410
+ const luts = (
411
+ await Promise . all (
412
+ transaction . message . addressTableLookups . map ( ( acc ) =>
413
+ connection . getAddressLookupTable ( acc . accountKey ) ,
414
+ ) ,
415
+ )
416
+ )
417
+ . map ( ( lut ) => lut . value )
418
+ . filter ( ( val ) => val !== null ) as AddressLookupTableAccount [ ] ;
409
419
const msg = transaction . message ;
410
- const keys = msg . getAccountKeys ( ) ;
420
+ const keys = msg . getAccountKeys ( {
421
+ addressLookupTableAccounts : luts ?? undefined ,
422
+ } ) ;
411
423
lockedWritableAccounts = msg . compiledInstructions
412
424
. flatMap ( ( ix ) => ix . accountKeyIndexes )
413
425
. map ( ( k ) => ( msg . isAccountWritable ( k ) ? keys . get ( k ) : null ) )
You can’t perform that action at this time.
0 commit comments