reverseENSAddress method

  1. @override
Future<ENSResponse> reverseENSAddress(
  1. EthereumAddress address,
  2. {BlockNum? toBlock}
)
override

Performs a reverse ENS address lookup to obtain the associated ENS name.

Given the address, this method returns an ENSResponse with information about the ENS name associated with the Ethereum address.

Implementation

@override
Future<ENSResponse> reverseENSAddress(EthereumAddress address,
    {BlockNum? toBlock}) async {
  return ENSResponse.fromJson(await _restClient
      .get<Map<String, dynamic>>('/ens/reverse', queryParameters: {
    'address': address,
    'chain_id': 1,
    if (toBlock != null) 'to_block': toBlock.toBlockParam()
  }));
}