{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { PublicKey } from \"@solana/web3.js\";\nimport type { Connection } from \"@solana/web3.js\";\n\nimport * as http from \"fetch-unfucked\";\nimport { TldParser as ANSTLDParser, MainDomain as ANSMainDomain } from \"@onsol/tldparser\";\nimport type { ProfilePictureResponse } from \"./types\";\n// Name here is way too generic. We already have our own getProfilePictureUsingSolanaPFPStandard to let's call this the 'Upstream' version\nimport { getProfilePicture as getProfilePictureUsingSolanaPFPStandardUpstream } from \"@solflare-wallet/pfp\";\n\n// Just for debugging. Keep them around as they're useful sometimes.\nconst log = console.log;\nconst stringify = (object: unknown) => JSON.stringify(object, null, 2);\n\ninterface WalletNameAndProfilePicture {\n  walletName: string | null;\n  profilePicture: string | null;\n}\n\ninterface WalletAddressAndProfilePicture {\n  walletAddress: string | null;\n  profilePicture: string | null;\n}\n\nconst removeExtension = (string: string, extension: string): string => {\n  const extensionWithDot = `.${extension}`;\n  if (string.endsWith(extensionWithDot)) {\n    return string.split(extensionWithDot)[0];\n  }\n  return string;\n};\n\n// https://www.npmjs.com/package/@onsol/tldparser\nexport const dotAnythingToWalletAddress = async (\n  connection: Connection,\n  ansDomainName: string\n): Promise<WalletAddressAndProfilePicture> => {\n  const parser = new ANSTLDParser(connection);\n  const ownerPublicKey = await parser.getOwnerFromDomainTld(ansDomainName);\n  return {\n    walletAddress: ownerPublicKey?.toBase58() || null,\n    profilePicture: null,\n  };\n};\n\n// https://www.npmjs.com/package/@onsol/tldparser\n// Docs for this suck, so check out\n// https://github.com/onsol-labs/tld-parser/blob/main/tests/tld-parser.spec.ts#L78\n// getMainDomain() is what we want\nexport const walletAddressToDotAnything = async (\n  connection: Connection,\n  wallet: PublicKey\n): Promise<WalletNameAndProfilePicture> => {\n  const parser = new ANSTLDParser(connection);\n  // Assume this is an ANS Main Domain - a main domain is the domain that a wallet address\n  // with multiple names will resolve to.\n  let mainDomain = {} as ANSMainDomain;\n  try {\n    mainDomain = await parser.getMainDomain(wallet);\n  } catch (thrownObject) {\n    const error = thrownObject as Error;\n    if (error.message.includes(\"Unable to find MainDomain account\")) {\n      return {\n        walletName: null,\n        profilePicture: null,\n      };\n    }\n  }\n  if (!mainDomain?.domain) {\n    return {\n      walletName: null,\n      profilePicture: null,\n    };\n  }\n  // Yes the . is already included in the tld\n  const domainString = `${mainDomain.domain}${mainDomain.tld}`;\n  return {\n    walletName: domainString,\n    profilePicture: null,\n  };\n};\n\n\n\n\n// https://docs.glow.app/reference/resolve-glow-id\n// The 'API' node module has a bunch of issues running in the browser so just use http module directly\nexport const dotGlowToWalletAddress = async (\n  dotGlowDomain: string\n): Promise<WalletAddressAndProfilePicture> => {\n  const dotGlowUserName = removeExtension(dotGlowDomain, \"glow\");\n  const { body } = await http.get(\n    `https://api.glow.app/glow-id/resolve?handle=${dotGlowUserName}`\n  );\n  const walletAddress = body?.info?.resolved || null;\n  const profilePicture = body?.info?.image || null;\n  return {\n    walletAddress,\n    profilePicture,\n  };\n};\n\nexport const walletAddressToDotGlow = async (wallet: PublicKey) => {\n  const walletString = wallet.toBase58();\n  const { body } = await http.get(\n    `https://api.glow.app/glow-id/resolve?wallet=${walletString}`\n  );\n  const dotGlowUsername = body?.info?.handle || null;\n  const walletName = `${dotGlowUsername}.glow`;\n  const profilePicture = body?.info?.image || null;\n  return {\n    walletName,\n    profilePicture,\n  };\n};\n\n// See https://www.quicknode.com/guides/solana-development/accounts-and-data/how-to-query-solana-naming-service-domains-sol/#set-up-your-environment\nexport const dotSolToWalletAddress = async (\n  dotSolDomain: string\n): Promise<WalletAddressAndProfilePicture> => {\n  try {\n    const { body } = await http.get(\n      `https://sns-sdk-proxy.bonfida.workers.dev/resolve/${dotSolDomain}`\n    );\n\n    let walletAddress = null;\n\n    const result = body?.result;\n\n    // Bonfida's API is garbage\n    if (result !== \"Domain not found\") {\n      walletAddress = result;\n    }\n\n    return {\n      walletAddress,\n      profilePicture: null,\n    };\n  } catch (thrownObject) {\n    const error = thrownObject as Error;\n    if (error.message === \"Invalid name account provided\") {\n      return {\n        walletAddress: null,\n        profilePicture: null,\n      };\n    }\n    throw error;\n  }\n};\n\n// See https://www.quicknode.com/guides/solana-development/accounts-and-data/how-to-query-solana-naming-service-domains-sol/#reverse-lookup-find-all-domains-owned-by-a-wallet\nexport const walletAddressToDotSol = async (\n  connection: Connection,\n  wallet: PublicKey\n): Promise<WalletNameAndProfilePicture> => {\n  try {\n    const { body } = await http.get(\n      // See https://github.com/Bonfida/sns-sdk#sdk-proxy\n      // There's a 'favorite-domain' endpoint butmost SNS users haven't set up a\n      // favorite domain, as the UI to do so is complex\n      // `https://sns-sdk-proxy.bonfida.workers.dev/favorite-domain/${wallet.toBase58()}`\n      `https://sns-sdk-proxy.bonfida.workers.dev/domains/${wallet.toBase58()}`\n    );\n\n    let walletName = null;\n\n    const firstDomainNoSuffix = body?.result?.[0]?.domain;\n\n    if (firstDomainNoSuffix) {\n      walletName = `${firstDomainNoSuffix}.sol`;\n    }\n    return {\n      walletName,\n      profilePicture: null,\n    };\n  } catch (thrownObject) {\n    const error = thrownObject as Error;\n    if (error.message === \"Invalid wallet account provided\") {\n      return {\n        walletName: null,\n        profilePicture: null,\n      };\n    }\n    throw error;\n  }\n};\n\nexport const dotBackpackToWalletAddress = async (\n  dotBackpackDomainName: string,\n  jwt: string | null = null\n): Promise<WalletAddressAndProfilePicture> => {\n  // Note backpack API responses mix snake_case and CamelCase\n  const dotBackpackUserName = removeExtension(\n    dotBackpackDomainName,\n    \"backpack\"\n  );\n\n  // By default use the open public endpoint\n  if (!jwt) {\n    // Note xray uses a different endpoint\n    // ;\n    // However that endpoint does not include profile pictures, however it also does not require a JWT\n    //\n    // Have chased in the Backpack Discord\n    const { body } = await http.get(\n      `https://backpack-api.xnfts.dev/users/${dotBackpackUserName}`\n    );\n    // publicKeys isn't an array of publicKeys\n    // it's an array of objects with a publicKey property. Euw.\n    const publicKeysDetails = body?.publicKeys || null;\n    const firstPublicKeyDetails = publicKeysDetails[0];\n    const walletAddress = firstPublicKeyDetails.publicKey || null;\n    return {\n      walletAddress,\n      profilePicture: null,\n    };\n  }\n\n  // Use a JWT if we want profile pictures\n  // Also note there is a typo '&blockchain=solanalimit=6' instead of\n  // '&blockchain=solana&limit=6' but the typo version is what backpack app actually uses\n  // I suspect the endpoint below API searches only *other* users, ie not the user owning the JWT\n  // hence 0 results for mikemaccana\n  const { body } = await http.get(\n    `https://backpack-api.xnfts.dev/users?usernamePrefix=${dotBackpackUserName}&blockchain=solanalimit=6`,\n    {\n      cookie: `jwt=${jwt}`,\n    }\n  );\n  const users = body?.users || null;\n\n  if (!users) {\n    return {\n      walletAddress: null,\n      profilePicture: null,\n    };\n  }\n\n  const matchingUser = users.find(\n    (user: any) => user.username === dotBackpackUserName\n  );\n\n  const profilePicture = matchingUser?.image || null;\n\n  if (!matchingUser) {\n    return {\n      walletAddress: null,\n      profilePicture: null,\n    };\n  }\n\n  const publicKeysDetails = matchingUser.public_keys || null;\n\n  if (!publicKeysDetails?.length) {\n    return {\n      walletAddress: null,\n      profilePicture: null,\n    };\n  }\n\n  const solanaPublicKeyDetails = publicKeysDetails.find(\n    (publicKeyDetails: any) => {\n      return publicKeyDetails.blockchain === \"solana\";\n    }\n  );\n\n  if (!solanaPublicKeyDetails) {\n    return {\n      walletAddress: null,\n      profilePicture: null,\n    };\n  }\n\n  const walletAddress = solanaPublicKeyDetails.publicKey || null;\n\n  return {\n    walletAddress,\n    profilePicture,\n  };\n};\n\n// TODO: looks like this endpoint isn't finished, it doesn't work for all backpack users\n// and is hidden\nexport const walletAddressToDotBackpack = async (\n  wallet: PublicKey,\n  jwt: string | null = null\n): Promise<WalletNameAndProfilePicture> => {\n  // Sadly there's no public version of this API\n  // Matt from Backpack 20230414:\n  // \"(pubkey -> username) endpoint doesn't exist anymore on purpose for identity obfuscation reasons\"\n  // It's odd (since name -> pubkey effectively exposes the same info) but 🤷🏻‍♂️\n  if (!jwt) {\n    return {\n      walletName: null,\n      profilePicture: null,\n    };\n  }\n  const walletString = wallet.toBase58();\n  const backpackAPIEndpoint = `https://backpack-api.xnfts.dev/users?usernamePrefix=${walletString}`;\n  const { body } = await http.get(backpackAPIEndpoint, {\n    cookie: `jwt=${jwt}`,\n  });\n  const users = body?.users || null;\n  if (!users?.length) {\n    return {\n      walletName: null,\n      profilePicture: null,\n    };\n  }\n  const firstUser = users[0];\n  const username = firstUser.username;\n  const profilePicture = firstUser.image || null;\n  const domainName = `${username}.backpack`;\n  return {\n    walletName: domainName,\n    profilePicture,\n  };\n};\n\nexport const walletNameToAddressAndProfilePicture = async (\n  connection: Connection,\n  walletName: string,\n  jwt: string | null = null\n): Promise<WalletAddressAndProfilePicture> => {\n  let walletAddressAndProfilePicture: WalletAddressAndProfilePicture = {\n    walletAddress: null,\n    profilePicture: null,\n  };\n\n  // All domain name services have at least two parts\n  const parts = walletName.split(\".\");\n  if (parts.length < 2) {\n    return walletAddressAndProfilePicture;\n  }\n\n  // Requires people to buy a custom token\n  // and is complex to set up, but was more popular\n  if (walletName.endsWith(\".sol\")) {\n    walletAddressAndProfilePicture = await dotSolToWalletAddress(\n      walletName\n    );\n  }\n\n  if (walletName.endsWith(\".glow\")) {\n    walletAddressAndProfilePicture = await dotGlowToWalletAddress(walletName);\n  }\n\n  if (walletName.endsWith(\".backpack\")) {\n    walletAddressAndProfilePicture = await dotBackpackToWalletAddress(\n      walletName,\n      jwt\n    );\n  }\n\n \n\n  // ANS seems to be the nicest maintained and less land-grab naming service\n  // It also has multiple TLDs, so we will fall back to it for all other domains.\n  if (!walletAddressAndProfilePicture.walletAddress) {\n    walletAddressAndProfilePicture = await dotAnythingToWalletAddress(\n      connection,\n      walletName\n    );\n  }\n\n  // Use Solana PFP if we have an address but no profile picture\n  if (\n    walletAddressAndProfilePicture.walletAddress &&\n    !walletAddressAndProfilePicture.profilePicture\n  ) {\n    const solanaPFPUrl = await getProfilePictureUsingSolanaPFPStandard(\n      connection,\n      new PublicKey(walletAddressAndProfilePicture.walletAddress)\n    );\n    walletAddressAndProfilePicture.profilePicture = solanaPFPUrl || null;\n  }\n  return walletAddressAndProfilePicture;\n};\n\n// Try all the major name services, but don't fallback to Solana PFP\nexport const walletAddressToNameAndProfilePicture = async (\n  connection: Connection,\n  wallet: PublicKey,\n  backpackJWT: string | null = null\n): Promise<WalletNameAndProfilePicture> => {\n  const solanaPFPStandardImageURL =\n    await getProfilePictureUsingSolanaPFPStandard(connection, wallet);\n  const dotAnything = await walletAddressToDotAnything(connection, wallet);\n  // ANS domains don't have a profile picture, so use Solana PFP Standard\n  dotAnything.profilePicture = solanaPFPStandardImageURL || null;\n  if (dotAnything?.walletName && dotAnything?.profilePicture) {\n    return dotAnything;\n  }\n  const dotSol = await walletAddressToDotSol(connection, wallet);\n  // Likewise .sol doesn't have a profile picture, so use Solana PFP Standard\n  dotSol.profilePicture = solanaPFPStandardImageURL || null;\n  if (dotSol?.walletName && dotSol?.profilePicture) {\n    return dotSol;\n  }\n  const dotGlow = await walletAddressToDotGlow(wallet);\n  if (dotGlow?.walletName && dotGlow?.profilePicture) {\n    return dotGlow;\n  }\n  if (backpackJWT) {\n    const dotBackpack = await walletAddressToDotBackpack(wallet, backpackJWT);\n    if (dotBackpack?.walletName && dotBackpack?.profilePicture) {\n      return dotBackpack;\n    }\n  }\n\n  return {\n    walletName: null,\n    profilePicture: null,\n  };\n};\n\nexport const getProfilePictureUsingSolanaPFPStandard = async (\n  connection: Connection,\n  walletPubkey: PublicKey\n) => {\n  // https://www.npmjs.com/package/@solflare-wallet/pfp\n  const response = (await getProfilePictureUsingSolanaPFPStandardUpstream(\n    connection,\n    walletPubkey,\n    {\n      fallback: false,\n    }\n  )) as ProfilePictureResponse;\n\n  // This API returns the Netscape 'broken' image instead of null when 'fallback' is set to false.\n  // (also if we turned 'fallback' on, fallback images are ugly gravatar style autogenerated images)\n  // We don't want the ugly Netscape broken images or the ugly garavatar style images so let's return null\n  if (!response.url.startsWith(\"http\")) {\n    return null;\n  }\n  return response.url;\n};\n"],"mappings":"AAAA,SAA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