NameServiceProgram.transfer constructor

NameServiceProgram.transfer({
  1. required NameServiceTransferLayout layout,
  2. required SolAddress nameAccountKey,
  3. required SolAddress currentNameOwnerKey,
  4. SolAddress nameProgramId = NameServiceProgramConst.programId,
  5. SolAddress? nameClassKey,
  6. SolAddress? nameParent,
})

Transfer ownership of a name record.

Implementation

factory NameServiceProgram.transfer({
  required NameServiceTransferLayout layout,

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

  /// Account owner
  required SolAddress currentNameOwnerKey,
  SolAddress nameProgramId = NameServiceProgramConst.programId,

  /// Account class
  SolAddress? nameClassKey,

  /// Parent name record
  SolAddress? nameParent,
}) {
  return NameServiceProgram(
    keys: [
      nameAccountKey.toWritable(),
      currentNameOwnerKey.toSigner(),
      if (nameClassKey != null) nameClassKey.toSigner(),
      if (nameParent != null) nameParent.toReadOnly(),
    ],
    programId: nameProgramId,
    layout: layout,
  );
}