Skip to content

Commit

Permalink
- update farcaster reolver to also handle eth profile names
Browse files Browse the repository at this point in the history
- update readme
  • Loading branch information
lennardevertz committed Oct 17, 2024
1 parent 6375757 commit cb599d8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
"lavamoat": {
"allowScripts": {
"@lavamoat/preinstall-always-fail": false,
"sharp": true
"sharp": true,
"@metamask/snaps-types>@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>keccak": false,
"@metamask/snaps-types>@metamask/snaps-utils>@metamask/permission-controller>@metamask/controller-utils>ethereumjs-util>ethereum-cryptography>secp256k1": false
}
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# IDriss Multi Resolver Snap
# Web3 Address Book Snap

This snap can be used to resolve several naming services in the sending input field of your MetaMask wallet.

Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/idriss-crypto/snap/tree/main/packages/snap"
},
"source": {
"shasum": "rZ3/bn8vq8mEBpc9WsKQTIgmz+Rs/SzZX4QUfnpmN3g=",
"shasum": "QKmljyoAWt8Sa3+I5agWFVvt5sQJIfo9+YOad5nasMo=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
5 changes: 3 additions & 2 deletions packages/snap/src/resolvers/farcaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export async function resolveFarcasterName(
const handle = domain
.replace('@', '')
.replace('.fc', '')
.replace('.farcaster', '');
.replace('.farcaster', '')
.replace('.eth', '');

const FID_URL = `https://fnames.farcaster.xyz/transfers/current?name=${handle}`;
try {
Expand All @@ -33,7 +34,7 @@ export async function resolveFarcasterName(
return [];
}

const ADDRESS_URL = `${BASE_API_URL}get-connected-addresses?fid=${userFID}`;
const ADDRESS_URL = `${BASE_API_URL}/snap/get-connected-addresses?fid=${userFID}`;
const addressResponse = await fetch(ADDRESS_URL);
const addressData = await addressResponse.json();
const { result } = addressData;
Expand Down

0 comments on commit cb599d8

Please # to comment.