initReverseLookupRegistry method

Future<String> initReverseLookupRegistry(
  1. AptosAccount owner, {
  2. BigInt? maxGasAmount,
  3. BigInt? gasUnitPrice,
  4. BigInt? expireTimestamp,
})

Initialize reverse lookup for contract owner.

owner the aptos_names AptosAccount. Return the hash of the pending transaction submitted to the API.

Implementation

Future<String> initReverseLookupRegistry(
  AptosAccount owner,{
  BigInt? maxGasAmount,
  BigInt? gasUnitPrice,
  BigInt? expireTimestamp
}) async {
  final buildConfig = ABIBuilderConfig(
    sender: owner.address,
    maxGasAmount: maxGasAmount,
    gasUnitPrice: gasUnitPrice,
    expSecFromNow: expireTimestamp
  );
  final builder = TransactionBuilderRemoteABI(aptosClient, buildConfig);
  final rawTxn = await builder.build(
    "$contractAddress::domains::init_reverse_lookup_registry_v1",
    [],
    []
  );

  final bcsTxn = AptosClient.generateBCSTransaction(owner, rawTxn);
  final pendingTransaction = await aptosClient.submitSignedBCSTransaction(bcsTxn);

  return pendingTransaction["hash"];
}