changeTwitterRegistryData static method

TransactionInstruction changeTwitterRegistryData({
  1. required String twitterHandle,
  2. required SolAddress verifiedPubkey,
  3. required int offset,
  4. required List<int> inputData,
})

Overwrite the data that is written in the user facing registry

Implementation

static TransactionInstruction changeTwitterRegistryData({
  required String twitterHandle,
  required SolAddress verifiedPubkey,
  required int offset,
  required List<int> inputData,
}) {
  final hashedTwitterHandle =
      NameServiceProgramUtils.getHashedName(twitterHandle);
  final twitterHandleRegistryKey =
      NameServiceProgramUtils.getNameAccountProgram(
    hashedName: hashedTwitterHandle,
    nameParent: NameServiceProgramConst.twitterRootPrentRegisteryKey,
  );

  return NameServiceProgram.update(
    nameAccountKey: twitterHandleRegistryKey,
    layout: NameServiceUpdateLayout(inputData: inputData, offset: offset),
    nameUpdateSigner: verifiedPubkey,
  );
}