{"id":22123633,"url":"https://github.com/v3xlabs/ens-tools","last_synced_at":"2025-07-25T15:31:27.561Z","repository":{"id":103706025,"uuid":"565304831","full_name":"v3xlabs/ens-tools","owner":"v3xlabs","description":"All your bits and bobs for ENS. A package with a bit of everything","archived":false,"fork":false,"pushed_at":"2024-04-30T11:37:37.000Z","size":572,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-30T13:10:44.460Z","etag":null,"topics":["ens","ens-tools","wagmi"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ens-tools","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/v3xlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-13T00:44:27.000Z","updated_at":"2024-04-30T11:35:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"929c7875-a3c9-4e92-aeb8-0ce738bb49ef","html_url":"https://github.com/v3xlabs/ens-tools","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v3xlabs%2Fens-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v3xlabs%2Fens-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v3xlabs%2Fens-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v3xlabs%2Fens-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v3xlabs","download_url":"https://codeload.github.com/v3xlabs/ens-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227587669,"owners_count":17790246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ens","ens-tools","wagmi"],"created_at":"2024-12-01T15:36:27.325Z","updated_at":"2024-12-01T15:36:27.833Z","avatar_url":"https://github.com/v3xlabs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![ens-tools](https://raw.githubusercontent.com/v3xlabs/ens-tools/master/.github/banner1.png)](https://www.npmjs.com/package/ens-tools)\n\n\u003e **Note**\n\u003e\n\u003e This project aims to extend the functionality of [wagmi](https://wagmi.sh/),\u003cbr /\u003e\n\u003e in addition to providing utility to the ENS ecosystem.\n\n## Features\n\n-   🪝 React Hook for Multichain Addresses\n-   💾 React Hook for getting Records\n-   🔠 React Hook for preferred name Capitalization\n-   💼 Easily Normalize Records\n-   📝 Easily truncate Ethereum Addresses\n\n...and a lot more.\n\n## Documentation\n\nFor documentation. Stick to the Typescript Intellisense.\n\n## Installation\n\nInstall ens-tools and let the magic happen.\n\n```bash\nnpm install ens-tools\n```\n\n## Usage\n\nThis library thingiemajig contains the following bits and bobs:\n\n-   [⚛️🪝 useMultichainAddress](##%EF%B8%8F-react-hook-for-multichain-addresses)\n-   [⚛️🪝 useRecords](##%EF%B8%8F-react-hook-for-getting-records)\n-   [⚛️🪝 usePreferredName](##%EF%B8%8F-react-hook-for-name-capitalization)\n-   [📝 formatAddress](#-format-ethereum-addresses)\n-   [📝 formatRecords](#-format-records)\n\n### ⚛️🪝 React Hook for Multichain Addresses\n\nThe `coinType` variable supports all the coins following the [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) specification.\n\n```tsx\nimport { useMultichainAddress } from 'ens-tools/react';\n\nexport const BtcAddress = () =\u003e {\n    const { address } = useMultichainAddress({\n        name: 'vitalik.eth',\n        coinType: 2,\n    });\n\n    return \u003cdiv\u003eBTC Address: {address}\u003c/div\u003e;\n};\n```\n\n### ⚛️🪝 React Hook for getting Records\n\nThis react hook lets you easily get records from an ENS name.\nSimply specify the records and wether you would like them normalized and you're good to go.\n\n```tsx\nimport { useRecords } from 'ens-tools/react';\n\nexport const Records = () =\u003e {\n    const { data } = useRecords({\n        name: 'vitalik.eth',\n        records: ['com.twitter', 'com.github'],\n        normalize: true,\n    });\n\n    return (\n        \u003cdiv\u003e\n            {data.map((record) =\u003e (\n                \u003cdiv key={record.key}\u003e\n                    {record.key}: {record.value}\n                \u003c/div\u003e\n            ))}\n        \u003c/div\u003e\n    );\n};\n```\n\n### ⚛️🪝 React Hook for name Capitalization\n\nThis react hook lets you easily get the preferred capitalization for an ENS name.\nIt does this by reading the `display` record of the ENS name and defaults to the inputted validation.\nOptionally you can specify a fallback name to use in case the ENS name does not have a `display` record.\nSimply specify the name you're good to go.\n\n```tsx\nimport { usePreferredName } from 'ens-tools/react';\n\nexport const Name = () =\u003e {\n    const { data } = usePreferredName({\n        name: 'vitalik.eth',\n        fallback: 'vItAlIk.eth',\n    });\n\n    return (\n        \u003cdiv\u003e\n            Hey there \u003cb\u003e{data}\u003c/b\u003e!\n        \u003c/div\u003e\n    );\n};\n```\n\n### 📝 Format Ethereum Addresses\n\nEasily truncate Ethereum Addresses to 10 characters.\n\n```ts\nimport { formatAddress } from 'ens-tools';\n\nconst address = formatAddress('0x1234567890123456789012345678901234567890');\n// Outputs: 0x1234...7890\n```\n\n### 📝 Format Records\n\nEasily normalize records.\n\n| Record Type  | Output                            | Rules Applied                                                                                        |\n| ------------ | --------------------------------- | ---------------------------------------------------------------------------------------------------- |\n| com.twitter  | `@lucemansnl`                     | [Twitter](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/twitter/twitter.ts)    |\n| com.github   | `lucemans`                        | [Github](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/github/github.ts)       |\n| com.linkedin | `lucemans`                        | [LinkedIn](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/linkedin/linkedin.ts) |\n| org.reddit   | `u/lucemans`, `r/oddlysatisfying` | [Reddit](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/reddit/reddit.ts)       |\n| org.telegram | `lucemans`                        | [Telegram](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/telegram/telegram.ts) |\n| com.discord  | `Lucemans#2066`, `discord.gg/v3x` | [Discord](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/discord/discord.ts)    |\n| website      | `https://luc.computer`            | [Website](https://github.com/v3xlabs/ens-tools/blob/master/src/format/records/website/website.ts)    |\n\n```ts\nimport { formatRecord } from 'ens-tools';\n\nconst cleanTwitter = formatRecord(\n    'com.twitter',\n    'https://mobile.twitter.com/lucemansnl'\n);\n// Outputs: @lucemansnl\n```\n\n## ⚖️ License\n\n[LGPL-3.0](/LICENSE) License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv3xlabs%2Fens-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv3xlabs%2Fens-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv3xlabs%2Fens-tools/lists"}