NameServiceProgram.update constructor

NameServiceProgram.update({
  1. required NameServiceUpdateLayout layout,
  2. required SolAddress nameAccountKey,
  3. required SolAddress nameUpdateSigner,
  4. SolAddress nameProgramId = NameServiceProgramConst.programId,
  5. SolAddress? parentNameKey,
})

Update the data in a name record.

Implementation

factory NameServiceProgram.update({
  required NameServiceUpdateLayout layout,

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

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

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