@1001-digital/layers.evm 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/composables/ens.ts +1 -1
- package/app/utils/ens.ts +4 -4
- package/package.json +1 -1
package/app/composables/ens.ts
CHANGED
|
@@ -61,7 +61,7 @@ function useEnsBase(
|
|
|
61
61
|
export const useEns = (identifier: MaybeRefOrGetter<string | undefined>, options?: UseEnsOptions) =>
|
|
62
62
|
useEnsBase('resolve', identifier, [], options)
|
|
63
63
|
|
|
64
|
-
export const
|
|
64
|
+
export const useEnsWithAvatar = (identifier: MaybeRefOrGetter<string | undefined>, options?: UseEnsOptions) =>
|
|
65
65
|
useEnsBase('avatar', identifier, [...ENS_KEYS_AVATAR], options)
|
|
66
66
|
|
|
67
67
|
export const useEnsProfile = (identifier: MaybeRefOrGetter<string | undefined>, options?: UseEnsOptions) =>
|
package/app/utils/ens.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
1
|
+
import { isAddress, type PublicClient, type Address } from 'viem'
|
|
2
|
+
import { normalize } from 'viem/ens'
|
|
3
3
|
|
|
4
4
|
export interface EnsProfile {
|
|
5
5
|
address: string
|
|
@@ -79,10 +79,10 @@ export async function fetchEnsFromChain(
|
|
|
79
79
|
|
|
80
80
|
const name = normalize(ens)
|
|
81
81
|
const results = await Promise.all(
|
|
82
|
-
keys.map(key => client.getEnsText({ name, key }).catch(() =>
|
|
82
|
+
keys.map(key => client.getEnsText({ name, key }).catch(() => null)),
|
|
83
83
|
)
|
|
84
84
|
|
|
85
|
-
return { address, ens, data: buildData(keys, results) }
|
|
85
|
+
return { address, ens, data: buildData(keys, results.map(r => r || '')) }
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export const ENS_KEYS_AVATAR = ['avatar'] as const
|