Optimal use cases for the Resolution API

The Resolution API is primarily intended for integration into an existing address input field.

The API should be invoked when a user inputs a string with a full stop in the middle, indicating it may be a domain. This can then be resolved using the Resolution API. Here are two examples to illustrate this:

  • For a BTC address input of 3Cqj5GeuHf7c1GZNPxFhiWtvAWojwD4FF6, the Resolution API does not need to be invoked.
  • For a BTC address input of matt.winn, the Resolution API should be invoked to resolve the domain and extract the BTC address from the response.

If you are already using another name service

If you are already using another name service then you can either:

  • Fall back to the Superlink resolution service if your existing service doesn’t resolve the domain.
  • Use the Superlink resolution service instead of your existing one. The Superlink resolution service will resolve Superlink, ENS and Unstoppable domains.

User experience (UX) recommendations

Processing indication

While the Resolution API is resolving a domain, it is beneficial to provide visual feedback to your users that the resolution is in progress. This could be in the form of a spinner or a loader.

Handling API responses

Proper handling of API responses is critical to relay accurate information to your users.

Successful domain resolution with wallet addresses

The Resolution API will return a response containing domain information if it has wallet addresses associated. The response includes a wallet key with an array of wallet objects. This array should be filtered by the coin type (BTC, ETH, etc.), and the respective address should be extracted. Once the address is extracted, it can be integrated into your regular workflow.

When the wallets array does not include the desired coin type

In cases where the desired coin type is not present in the wallets array, your users should be informed that the domain does not have the necessary address associated with it.

Domain not found

A 404 error response from the API signifies that the domain was not found. This may occur if the domain is associated with an unsupported nameservice or the name has not been claimed or configured yet.

Successful domain resolution without wallet addresses

If the domain is found but has no associated wallet addresses, the API will return a response, but the Wallets array will be empty. In this scenario, your users should be informed that the domain does not have any associated wallets.

Service unavailability

In the rare event of service unavailability, the resulting error needs to be appropriately handled. Users should be informed that the information associated with the domain could not be retrieved.

Demo

You can use the domain resolution demo to see an example of the Resolution API in action.