You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If the transaction is a `VersionedTransaction`, it also contains an extra byte at the beginning, indicating the version and an array of `MessageAddressTableLookup` at the end.
66
-
* We don't support Account Lookup Tables, so that array has a size of 0.
67
+
* After this field there is an array of indexes into the address lookup table that represents the accounts from the address lookup table used in the transaction.
67
68
*
68
69
* Each instruction has the following layout :
69
70
* - One byte indicating the index of the program in the account addresses array
numberOfAddressLookups=totalNumberOfAccounts-accounts.size;// This number is equal to the number of accounts that are in the lookup table and are neither signers nor programs
116
+
}
117
+
101
118
return(
102
119
getSizeOfCompressedU16(signers.size)+
103
120
signers.size*64+// array of signatures
@@ -107,7 +124,10 @@ export function getSizeOfTransaction(
107
124
32+// recent blockhash
108
125
getSizeOfCompressedU16(instructions.length)+
109
126
instruction_sizes+// array of instructions
110
-
(versionedTransaction ? 1+getSizeOfCompressedU16(0) : 0)// we don't support Account Lookup Tables
127
+
(versionedTransaction ? 1+getSizeOfCompressedU16(0) : 0)+// transaction version and number of address lookup tables
128
+
(versionedTransaction&&addressLookupTable ? 32 : 0)+// address lookup table address (we only support 1 address lookup table)
129
+
(versionedTransaction&&addressLookupTable ? 2 : 0)+// number of address lookup indexes
130
+
numberOfAddressLookups// address lookup indexes
111
131
);
112
132
}
113
133
@@ -130,11 +150,17 @@ export class TransactionBuilder {
/** Make a new `TransactionBuilder`. It requires a `payer` to populate the `payerKey` field and a connection to populate `recentBlockhash` in the versioned transactions. */
0 commit comments