solflare-wallet/solana-pfp-program

Example of a wallet that has a PFP? I get the fallback for Vidor's account.

Closed this issue · 2 comments

I tried to look up Vidor's wallet (I think Hp8SsZZZot8UB28HTfEuxxCXECoSiwHfpzqwenjrMPKF) assuming he has a PFP set using this standard, but it's using the autogenerated fallback images:

Here's my code.

import { PublicKey } from "@solana/web3.js";
import { getProfilePicture } from "@solflare-wallet/pfp";
import { log, stringify } from "./src/backend/functions";
import { connect } from "./src/backend/wallet";

const main = async () => {
  const connection = await connect("localhost");
  const response = await getProfilePicture(
    connection,
    new PublicKey("Hp8SsZZZot8UB28HTfEuxxCXECoSiwHfpzqwenjrMPKF")
  );

  log(stringify(response));
};

main();

Returns

PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0iIzdlMzhhOCIgZD0iTTM5LjUgMjlMMjkgMTguNUwzOS41IDhMNTAgMTguNVpNNTAgMTguNUw2MC41IDhMNzEgMTguNUw2MC41IDI5Wk02MC41IDcxTDcxIDgxLjVMNjAuNSA5Mkw1MCA4MS41Wk01MCA4MS41TDM5LjUgOTJMMjkgODEuNUwzOS41IDcxWk0xOC41IDUwTDggMzkuNUwxOC41IDI5TDI5IDM5LjVaTTcxIDM5LjVMODEuNSAyOUw5MiAzOS41TDgxLjUgNTBaTTgxLjUgNTBMOTIgNjAuNUw4MS41IDcxTDcxIDYwLjVaTTI5IDYwLjVMMTguNSA3MUw4IDYwLjVMMTguNSA1MFoiLz48cGF0aCBmaWxsPSIjYWY3NWQxIiBkPSJNMjkgMjlMOCAyOUw4IDhaTTcxIDI5TDcxIDhMOTIgOFpNNzEgNzFMOTIgNzFMOTIgOTJaTTI5IDcxTDI5IDkyTDggOTJaIi8+PHBhdGggZmlsbD0iI2Q3YmFlOCIgZD0iTTM3IDQyYTUsNSAwIDEsMSAxMCwwYTUsNSAwIDEsMSAtMTAsME01MyA0MmE1LDUgMCAxLDEgMTAsMGE1LDUgMCAxLDEgLTEwLDBNNTMgNThhNSw1IDAgMSwxIDEwLDBhNSw1IDAgMSwxIC0xMCwwTTM3IDU4YTUsNSAwIDEsMSAxMCwwYTUsNSAwIDEsMSAtMTAsMCIvPjwvc3ZnPg==

which is a autogenerated gravatar-style PFP.

What's a real wallet that's using PFP standard?

Solflare is using it. Is your connection mainnet? Try this:

import { PublicKey, Connection, clusterApiUrl } from "@solana/web3.js";
import { getProfilePicture } from "@solflare-wallet/pfp";

const main = async () => {
  const connection = new Connection(clusterApiUrl("mainnet-beta"))
  const response = await getProfilePicture(
    connection,
    new PublicKey("Hp8SsZZZot8UB28HTfEuxxCXECoSiwHfpzqwenjrMPKF")
  );

  console.log(response.url)
};

main();

lol sorry my fault, I added an integration test (that should use mainnet) into a bunch of code that was running on the lcoalhost validator. I can indeed see your Monke!