getNameAccountProgram static method

SolAddress getNameAccountProgram({
  1. required List<int> hashedName,
  2. SolAddress? nameClass,
  3. SolAddress? nameParent,
})

find program address of name account.

Implementation

static SolAddress getNameAccountProgram({
  required List<int> hashedName,
  SolAddress? nameClass,
  SolAddress? nameParent,
}) {
  List<List<int>> seeds = [hashedName];
  seeds.add(nameClass?.toBytes() ?? List<int>.filled(32, 0));
  seeds.add(nameParent?.toBytes() ?? List<int>.filled(32, 0));
  return SolanaUtils.findProgramAddress(
    seeds: seeds,
    programId: NameServiceProgramConst.programId,
  ).item1;
}