Comparing version 2.1.0 to 2.1.1
@@ -42,2 +42,6 @@ import { BaseProvider } from '@ethersproject/providers'; | ||
*/ | ||
export declare const getENS: (provider?: BaseProvider, contractAddress?: string, endpointUrl?: string) => (_domain: string, fetchOptions?: RequestInit) => Promise<ResolvedENS>; | ||
export declare const getENS: (opts?: Partial<{ | ||
provider: BaseProvider; | ||
contractAddress: string; | ||
endpointUrl: string; | ||
}>) => (_domain: string, fetchOptions?: RequestInit) => Promise<ResolvedENS>; |
@@ -158,3 +158,6 @@ import { namehash } from '@ethersproject/hash'; | ||
*/ | ||
const getENS = (provider = getDefaultProvider(), contractAddress = '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41', endpointUrl = ENDPOINT) => { | ||
const getENS = (opts) => { | ||
const provider = opts?.provider || getDefaultProvider(); | ||
const contractAddress = opts?.contractAddress || '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'; | ||
const endpointUrl = opts?.endpointUrl || ENDPOINT; | ||
const contract = new Contract(contractAddress, ABI, provider); | ||
@@ -161,0 +164,0 @@ const getRecord = async (node, record) => await contract.functions.text(node, record); |
{ | ||
"name": "get-ens", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Get text records of an ENS address with ease.", | ||
@@ -50,3 +50,3 @@ "exports": "./dist/index.js", | ||
"scripts": { | ||
"test": "tsm node_modules/uvu/bin.js tests", | ||
"test": "uvu -r tsm tests", | ||
"build": "rollup -c", | ||
@@ -53,0 +53,0 @@ "test:coverage": "c8 --include=src pnpm test", |
<div align="center"> | ||
<img src="https://www.pngkit.com/png/full/152-1526200_ens-logo-ethereum-name-service.png" height="150px" /><br /> | ||
@@ -41,3 +40,3 @@ | ||
const { address, records, owner } = await getENS(provider)('foda.eth') | ||
const { address, records, owner } = await getENS({ provider })('foda.eth') | ||
@@ -72,3 +71,3 @@ /* | ||
const { address, records, owner } = await getENS(provider)('foda.eth') | ||
const { address, records, owner } = await getENS({ provider })('foda.eth') | ||
``` | ||
@@ -82,4 +81,4 @@ | ||
[github-actions]: https://github.com/talentlessguy/get-ens/actions | ||
[gh-actions-img]: https://img.shields.io/github/workflow/status/talentlessguy/get-ens/CI?style=for-the-badge&color=4D48F7&label=&logo=github | ||
[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/talentlessguy/get-ens/main.yml?branch=master&style=for-the-badge&color=4D48F7 | ||
[docs-badge]: https://img.shields.io/badge/Docs-4D48F7?style=for-the-badge&logo=deno | ||
[docs]: https://doc.deno.land/https/esm.sh/get-ens |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12921
296
1
82