Skip to content

Commit

Permalink
fix: label get ENS name
Browse files Browse the repository at this point in the history
  • Loading branch information
0xsign committed Nov 15, 2023
1 parent 9394514 commit 55f44ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion scripts/find-user.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { parseAddress } from '@lib/fmt'

import type { LabelSource } from '../src/labels'
import { fetchENSName } from '../src/labels/ens'
import { fetchLlamaFolioLabel } from '../src/labels/llamafolio'
Expand All @@ -22,7 +24,11 @@ async function main() {
console.error('Missing user argument')
return help()
}
const address = process.argv[2].toLowerCase()
const address = parseAddress(process.argv[2] || '')
if (!address) {
console.error('Invalid address parameter')
return help()
}

const [llamaFolioLabels, openSea, ens] = await Promise.all([
fetchLlamaFolioLabel(address),
Expand Down
4 changes: 2 additions & 2 deletions src/labels/ens/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { providers } from '@lib/providers'

export function fetchENSName(address: string) {
export function fetchENSName(address: `0x${string}`) {
const provider = providers.ethereum

return provider.lookupAddress(address)
return provider.getEnsName({ address })
}

0 comments on commit 55f44ac

Please sign in to comment.