import { AccountLookupMeta, AccountMeta, Instruction } from '@solana/instructions'; import { AddressesByLookupTableAddress } from './addresses-by-lookup-table-address'; import { TransactionMessage } from './transaction-message'; type TransactionMessageNotLegacy = Exclude; type WidenInstructionAccounts = TInstruction extends Instruction ? Instruction ? AccountLookupMeta | AccountMeta : TAccounts[K]; }> : TInstruction; type WidenTransactionMessageInstructions = TTransactionMessage extends { readonly instructions: readonly (infer TInstruction extends Instruction)[]; } ? Omit & { readonly instructions: readonly WidenInstructionAccounts[]; } : TTransactionMessage; /** * Given a transaction message and a mapping of lookup tables to the addresses stored in them, this * function will return a new transaction message with the same instructions but with all non-signer * accounts that are found in the given lookup tables represented by an {@link AccountLookupMeta} * instead of an {@link AccountMeta}. * * This means that these accounts will take up less space in the compiled transaction message. This * size reduction is most significant when the transaction includes many accounts from the same * lookup table. * * @example * ```ts * import { address } from '@solana/addresses'; * import { * AddressesByLookupTableAddress, * compressTransactionMessageUsingAddressLookupTables, * } from '@solana/transaction-messages'; * import { fetchAddressLookupTable } from '@solana-program/address-lookup-table'; * * const lookupTableAddress = address('4QwSwNriKPrz8DLW4ju5uxC2TN5cksJx6tPUPj7DGLAW'); * const { * data: { addresses }, * } = await fetchAddressLookupTable(rpc, lookupTableAddress); * const addressesByAddressLookupTable: AddressesByLookupTableAddress = { * [lookupTableAddress]: addresses, * }; * * const compressedTransactionMessage = compressTransactionMessageUsingAddressLookupTables( * transactionMessage, * addressesByAddressLookupTable, * ); * ``` */ export declare function compressTransactionMessageUsingAddressLookupTables(transactionMessage: TTransactionMessage, addressesByLookupTableAddress: AddressesByLookupTableAddress): TTransactionMessage | WidenTransactionMessageInstructions; export {}; //# sourceMappingURL=compress-transaction-message.d.ts.map