Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: change normalize to a dynamic import #3006

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/popular-ligers-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@wagmi/core": patch
"wagmi": patch
---

Changed `normalize` to a dynamic import.
2 changes: 1 addition & 1 deletion packages/core/src/actions/ens/fetchEnsAddress.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type Address, getAddress } from 'viem'
import { normalize } from 'viem/ens'

import { getPublicClient } from '../viem'

Expand All @@ -16,6 +15,7 @@ export async function fetchEnsAddress({
chainId,
name,
}: FetchEnsAddressArgs): Promise<FetchEnsAddressResult> {
const { normalize } = await import('viem/ens')
const publicClient = getPublicClient({ chainId })
const address = await publicClient.getEnsAddress({
name: normalize(name),
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/ens/fetchEnsAvatar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { GetEnsAvatarReturnType } from 'viem/ens'
import { normalize } from 'viem/ens'

import { getPublicClient } from '../viem'

Expand All @@ -16,6 +15,7 @@ export async function fetchEnsAvatar({
name,
chainId,
}: FetchEnsAvatarArgs): Promise<FetchEnsAvatarResult> {
const { normalize } = await import('viem/ens')
const publicClient = getPublicClient({ chainId })
const avatar = await publicClient.getEnsAvatar({ name: normalize(name) })
return avatar
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/actions/ens/fetchEnsResolver.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { GetEnsResolverReturnType } from 'viem'
import { normalize } from 'viem/ens'

import { getPublicClient } from '../viem'

Expand All @@ -16,6 +15,7 @@ export async function fetchEnsResolver({
chainId,
name,
}: FetchEnsResolverArgs): Promise<FetchEnsResolverResult> {
const { normalize } = await import('viem/ens')
const publicClient = getPublicClient({ chainId })
const resolver = await publicClient.getEnsResolver({ name: normalize(name) })
return resolver
Expand Down
Loading