getTwitterRegistry static method
Implementation
static Future<NameRegistryAccount> getTwitterRegistry({
required SolanaRPC rpc,
required String twitterHandle,
}) async {
final hashedTwitterHandle =
NameServiceProgramUtils.getHashedName(twitterHandle);
final twitterHandleRegistryKey =
NameServiceProgramUtils.getNameAccountProgram(
hashedName: hashedTwitterHandle,
nameParent: NameServiceProgramConst.twitterRootPrentRegisteryKey,
);
final registry = await rpc.request(
SolanaRPCNameRegistryAccount(account: twitterHandleRegistryKey));
if (registry == null) {
throw const MessageException("Account not found.");
}
return registry;
}