AddressLookupTableProgram.createLookupTable constructor

AddressLookupTableProgram.createLookupTable({
  1. required SolAddress authority,
  2. required SolAddress payer,
  3. required SolAddress lookupTableAddress,
  4. required AddressLookupCreateLookupTableLayout layout,
})

Creates an instruction to create a lookup table.

Implementation

factory AddressLookupTableProgram.createLookupTable({
  /// Account used to derive and control the new address lookup table.
  required SolAddress authority,

  /// Account that will fund the new address lookup table.
  required SolAddress payer,

  /// lookupTableAddress derived from recent slot [findAddressLookupTableProgram]
  required SolAddress lookupTableAddress,
  required AddressLookupCreateLookupTableLayout layout,
}) {
  return AddressLookupTableProgram(
    layout: layout,
    keys: [
      lookupTableAddress.toWritable(),
      authority.toSigner(),
      payer.toSignerAndWritable(),
      SystemProgramConst.programId.toReadOnly(),
    ],
    programId: AddressLookupTableProgramConst.programId,
  );
}