Skip to content

Commit f673c20

Browse files
committed
fix: only lookup .sonic domains
1 parent c7ac6d5 commit f673c20

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/lookupDomains/unstoppableDomains.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { Address, Handle } from '../utils';
44

55
export const DEFAULT_CHAIN_ID = 'unstoppable-domains';
66

7-
// Filter out invalid ENS domains like
8-
// [0xa410d74c2b6736f223654461c22395a9b49e2c36fcfcbef22962a195a6a67c37].[0xd8cc269d5812cbdfe0adbba6897038c687381383d2e1cf56e0696d3133566d6e].eth
7+
const SUPPORTED_TLDS = ['sonic'];
8+
99
function normalizeHandles(handles: Handle[]): Handle[] {
10-
return handles.map(h => (/^[.a-z0-9-]+$/.test(h) ? h : '')).filter(h => h);
10+
return handles.filter(h => SUPPORTED_TLDS.some(tld => h.endsWith(`.${tld}`)));
1111
}
1212

1313
export default async function lookupDomains(address: Address, chainId: string): Promise<Handle[]> {

test/integration/lookupDomains.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ describe('lookupDomains', () => {
6161

6262
it('should return an array of addresses for unstoppable domains', async () => {
6363
const result = await lookupDomains(
64-
'0xeF8305E140ac520225DAf050e2f71d5fBcC543e7',
64+
'0x17af7086649580ab880060c92f46fc931ab3588b',
6565
'unstoppable-domains'
6666
);
67-
expect(result).toContain('snapshot.crypto');
67+
expect(result).toContain('boorger.sonic');
6868
});
6969

7070
it('should return an empty array if the address does not own any unstoppable domains', async () => {

0 commit comments

Comments
 (0)