From 927f84e679cba51d943db838e6319745b3cf1bb8 Mon Sep 17 00:00:00 2001 From: Jamie Hewitt Date: Mon, 22 Aug 2022 16:03:45 +0300 Subject: [PATCH] Fixing avatar request --- api/profile.ts | 3 ++- api/text.ts | 1 + package.json | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/profile.ts b/api/profile.ts index e1fe3d9..c132460 100644 --- a/api/profile.ts +++ b/api/profile.ts @@ -18,7 +18,7 @@ interface Profile { function getEnsAvatar(ensName: string): string { return ensName ? `https://metadata.ens.domains/mainnet/avatar/${ensName}` - : null + : 'null' } export async function getEnsProfile(accountId: string): Promise { @@ -46,6 +46,7 @@ export async function getEnsProfile(accountId: string): Promise { const links: ProfileLink[] = records.filter((record) => linkKeys.includes(record.key) ) + console.log('getEnsAvatar(name)', getEnsAvatar(name)) const profile: Profile = { name, diff --git a/api/text.ts b/api/text.ts index 6514468..4e4964d 100644 --- a/api/text.ts +++ b/api/text.ts @@ -6,6 +6,7 @@ export async function getEnsTextRecords( ): Promise<{ key: string; value: string }[]> { const texts = [ 'url', + 'avatar', 'com.twitter', 'com.github', 'org.telegram', diff --git a/package.json b/package.json index e9099cb..caddc2b 100644 --- a/package.json +++ b/package.json @@ -9,9 +9,7 @@ "clean": "rm -rf ./dist", "format": "prettier --ignore-path .gitignore './**/*.{css,yml,js,ts,tsx,json}' --write", "test:format": "npm run format && npm run lint", - "type-check": "tsc --noEmit", - "test:integration": "mocha --config=test/.mocharc.json --node-env=test --exit 'test/**/*.test.ts'", - "test": "npm run test:format && npm run test:integration" + "type-check": "tsc --noEmit" }, "dependencies": { "ethers": "^5.7.0"