NameServiceProgram.realloc constructor

NameServiceProgram.realloc({
  1. required SolAddress payerKey,
  2. required SolAddress nameAccountKey,
  3. required SolAddress nameOwnerKey,
  4. required NameServiceReallocLayout layout,
  5. SolAddress nameProgramId = NameServiceProgramConst.programId,
  6. SolAddress systemProgramId = SystemProgramConst.programId,
})

Realloc the data of a name record.

Implementation

factory NameServiceProgram.realloc({
  /// Payer account (will be refunded if new space is less than current space)
  required SolAddress payerKey,

  /// Name record to be reallocated
  required SolAddress nameAccountKey,

  /// Account owner
  required SolAddress nameOwnerKey,
  required NameServiceReallocLayout layout,
  SolAddress nameProgramId = NameServiceProgramConst.programId,

  /// System program
  SolAddress systemProgramId = SystemProgramConst.programId,
}) {
  return NameServiceProgram(
    keys: [
      systemProgramId.toReadOnly(),
      payerKey.toSignerAndWritable(),
      nameAccountKey.toWritable(),
      nameOwnerKey.toSigner(),
    ],
    programId: nameProgramId,
    layout: layout,
  );
}