Skip to content

Commit 52e5279

Browse files
committed
Merge branch 'develop' into release/1.34.0
2 parents 8483784 + 9d85be9 commit 52e5279

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utilities.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import bowser from 'bowser'
22
import BigNumber from 'bignumber.js'
33
import { get } from 'svelte/store'
4-
import ENS, { getEnsAddress } from '@ensdomains/ensjs'
54

65
import { app } from './stores'
76
import { WalletInterface, Ens } from './interfaces'
@@ -71,6 +70,11 @@ export function getAddress(provider: any): Promise<string | any> {
7170
export async function getEns(provider: any, address: string): Promise<Ens> {
7271
const { networkId } = get(app)
7372
try {
73+
// There is an issue with ens and ts unable to find the
74+
// declaration file for it even though it is present.
75+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
76+
// @ts-ignore - TS7016
77+
const { default: ENS, getEnsAddress } = await import('@ensdomains/ensjs')
7478
const ens = new ENS({ provider, ensAddress: getEnsAddress(networkId) })
7579
const { name } = await ens.getName(address)
7680
const nameInterface = await ens.name(name)
@@ -84,6 +88,7 @@ export async function getEns(provider: any, address: string): Promise<Ens> {
8488
}
8589
} catch (e) {
8690
// Error getting ens
91+
console.error(e)
8792
return {}
8893
}
8994
}

0 commit comments

Comments
 (0)