AddressLookupTableProgram.extendLookupTable constructor

AddressLookupTableProgram.extendLookupTable({
  1. required SolAddress authority,
  2. required SolAddress lookupTable,
  3. required AddressExtendLookupTableLayout layout,
  4. SolAddress? payer,
})

Creates an instruction to extend a lookup table.

Implementation

factory AddressLookupTableProgram.extendLookupTable({
  /// Account which is the current authority.
  required SolAddress authority,

  /// Address lookup table account to extend.
  required SolAddress lookupTable,
  required AddressExtendLookupTableLayout layout,

  /// Account that will fund the table reallocation.
  /// Not required if the reallocation has already been funded.
  SolAddress? payer,
}) {
  final keys = [
    lookupTable.toWritable(),
    authority.toSigner(),
  ];
  if (payer != null) {
    keys.addAll([
      payer.toSignerAndWritable(),
      SystemProgramConst.programId.toReadOnly(),
    ]);
  }
  return AddressLookupTableProgram(
    layout: layout,
    keys: keys,
    programId: AddressLookupTableProgramConst.programId,
  );
}