Skip to content

Commit

Permalink
feat: server - Linagee domains
Browse files Browse the repository at this point in the history
  • Loading branch information
charmful0x authored Oct 3, 2022
1 parent 39c4ae2 commit 467c49b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/utils/server-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export async function getArkProfile(network, address) {
userProfile.ANS = await getAnsProfile(userProfile.arweave_address);
userProfile.ENS = await getEnsProfile(userProfile.evm_address);
userProfile.AVVY = await getAvvyProfile(userProfile.evm_address);
userProfile.LINAGEE = await getLinageeDomains(userProfile.evm_address);
userProfile.IS_VOUCHED = await isVouched(userProfile.arweave_address);
userProfile.LENS_HANDLES = await getLensHandles(userProfile.evm_address);
userProfile.GITPOAPS = await getGitPoaps(userProfile.evm_address);
Expand Down Expand Up @@ -340,6 +341,37 @@ async function getLensHandles(evm_address) {
}
}

async function getLinageeDomains(address) {
try {
const options = {
method: "GET",
url: `https://deep-index.moralis.io/api/v2/${address}/nft`,
params: {
chain: "eth",
format: "decimal",
token_addresses: "0x2cc8342d7c8bff5a213eb2cde39de9a59b3461a7",
},
headers: { accept: "application/json", "X-API-Key": "test" },
};

const res = await axios.request(options);

for (const domain of res?.data?.result) {
domain.open_sea_url = `https://opensea.io/assets/ethereum/0x2cc8342d7c8bff5a213eb2cde39de9a59b3461a7/${domain.token_id}`;
// delete unnecessay metadata
delete domain.token_uri;
delete domain.metadata;
delete domain.last_token_uri_sync;
delete domain.last_metadata_sync;
}
return res?.data?.result;
} catch (error) {
console.log(error);
return [];
}
}


async function getGalaxyCreds(address) {
try {
const q = {
Expand Down

0 comments on commit 467c49b

Please sign in to comment.