Skip to content

Commit 209ef66

Browse files
committed
Update error message
1 parent f94f350 commit 209ef66

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/thirdweb/src/extensions/unstoppable-domains/read/resolveAddress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ export async function resolveAddress(
4040
const resolved = await getMany({
4141
contract,
4242
tokenId: possibleTokenId,
43-
// note that you can also retrieve the BTC address by using "crypto.BTC.address" (should that become useful one day)
43+
// note that you can also retrieve the (BTC, SOL, etc.) address by using "crypto.<symbol>.address" (should that become useful one day)
4444
keys: ["crypto.ETH.address"],
4545
});
4646

4747
const possibleETHAddress = resolved[0];
4848
if (!possibleETHAddress) {
4949
throw new Error(
50-
`Could not retrieve any ETH address associated with domain name: ${name}`,
50+
`Could not retrieve any ETH address associated with domain name: ${name}. Make sure you have set the base EVM address for your domain here: https://unstoppabledomains.com/manage?page=crypto&domain=<your-domain>`,
5151
);
5252
}
5353
return possibleETHAddress;

packages/thirdweb/src/extensions/unstoppable-domains/read/resolveName.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ export async function resolveName(
2424
chain: resolverChain || polygon,
2525
address: resolverAddress || UD_POLYGON_MAINNET,
2626
});
27+
2728
// Note: if the given wallet address does not have any UD name, `reverseNameOf` will return an empty string
28-
return await reverseNameOf({ contract, addr: address });
29+
// This can still happen if you have transfered a domain to a new address, and forgot to set up the Reverse Resolution on the new address
30+
const domain = await reverseNameOf({ contract, addr: address });
31+
if (!domain) {
32+
throw new Error(
33+
`Failed to retrieve domain for address: ${address}. Make sure you have set the Reverse Resolution address for your domain at https://unstoppabledomains.com/manage?page=reverseResolution&domain=your-domain`,
34+
);
35+
}
36+
return domain;
2937
},
3038
{
3139
cacheKey: `unstoppable-domain:name:${resolverChain?.id || 1}:${address}`,

0 commit comments

Comments
 (0)