Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pryority/ensurl
Don't trust a link is the correct URL, instead use ENSURL to verify Ethereum data.
https://github.com/pryority/ensurl
bun ens security viem
Last synced: 10 days ago
JSON representation
Don't trust a link is the correct URL, instead use ENSURL to verify Ethereum data.
- Host: GitHub
- URL: https://github.com/pryority/ensurl
- Owner: Pryority
- Created: 2023-12-19T22:18:16.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-19T22:32:09.000Z (about 1 year ago)
- Last Synced: 2024-11-10T14:47:35.187Z (2 months ago)
- Topics: bun, ens, security, viem
- Language: TypeScript
- Homepage:
- Size: 783 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ENSURL
Have you been warned to not click the link in a tweet because of potential wallet drainers? Don't trust the link is the correct URL, *verify* with ENSURL.
---
Example of a Fake/Malicious Link (12/19/2023)
---
## Check URL Text Record [↗](./index.ts)
```typescript
import { addEnsContracts } from "@ensdomains/ensjs";
import { getTextRecord } from "@ensdomains/ensjs/public";
import { createPublicClient, http } from "viem";
import { mainnet } from "viem/chains";const client = createPublicClient({
chain: addEnsContracts(mainnet),
transport: http(),
});
const url = await getTextRecord(client, {
name: "ens.eth",
key: "url",
});
console.log(url);
```---
## Using ENSURL
### Option 1
1. Clone the repository.
2. Install dependencies with `bun install`.
3. Update .eth name in `index.ts` to the desired name to have URL fetched.
4. Run `bun check` to view the URL in the console.### Server/Runtime Demo
## Option 2
1. Open up a new tab of a browser like Chrome, Brave or Firefox.
2. Copy and paste the entire contents of [out/index.js](./out/index.js) into the console.
3. Update the default `"ens.eth"` name to the ENS name you want to check.
4. Once updated, hit enter or return and wait for the URL to be fetched from Ethereum. You should see the URL printed on the next line in your browser console.Check the demo below to understand the instructions better.
### Browser Demo