New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on nfts().findAllByCreator(verifiedcreator) #241
Comments
Just read in https://github.com/metaplex-foundation/js/releases/tag/js%2Fv0.15.0 |
I'm getting the same error too! |
@LaniakeaSC4 you need to pass creator in as an object like you say. But also you need to convert it to a public key like so: const creator = new PublicKey("2UWNPgEto1x2TnBisJ814xdXKUQE5KFzypBNKPPjXz9b");
const nfts = await metaplex.nfts().findAllByCreator({ creator }).run();
Try using a private RPC. Edit: Tested on private RPC and it works |
Thanks. Are there any reference examples of connecting to a private rpc? |
You can just add the private RPC url when you setup the connection like this: const connection = new Connection("my-private-rpc-url"); |
Thanks, got that. I made a alchemyapi.io solana app to test this and although the alchemy app recieves the request, the returned result is empty? My complete function; async function getMetaplexData(creator) {
const connection = new Connection("https://solana-mainnet.g.alchemy.com/v2/mykey")
const wallet = Keypair.generate();
const metaplex = Metaplex.make(connection)
.use(keypairIdentity(wallet))
.use(bundlrStorage())
var creatorkey = new PublicKey(creator);
const nfts = await metaplex.nfts().findAllByCreator({creatorkey}).run();
return nfts
} API recieves
API responds
|
You're forming the My previous example used the shorthand way which may have confused you. Try this: async function getMetaplexData(creator) {
const connection = new Connection("https://solana-mainnet.g.alchemy.com/v2/mykey")
const wallet = Keypair.generate();
const metaplex = Metaplex.make(connection)
.use(keypairIdentity(wallet))
.use(bundlrStorage())
const creatorkey = new PublicKey(creator);
const nfts = await metaplex.nfts().findAllByCreator({ creator: creatorkey }).run();
return nfts
} Edit: Although after testing this properly on |
Hmmm... Me also... So what now? 😀 Edit: for clarity for future readers I assume you mean the input object should be Are you testing with my creator address or another? (just incase I got that wrong, I'm new-ish to all this) |
I just tried with a different RPC (https://www.quicknode.com/) and got a valid response with metadata. Using a different creator address with only 8 NFTs and that request took around 3 minutes. The wallet address you provided in your example seems to timeout. Maybe that address has a lot of NFTs. Checkout issues #196 and #47 that explains the limitations in more detail. |
Thanks for the info. If I could get this working with a private RPC, can I pass all the returned NFT metadata to |
That's correct you can't pass all the NFTs to the load function. You would need to iterate the list of NFTs and call load on each one. |
@ninnjak is there any way to slow the API request rate? I don't necessarily need speed and could avoid these errors (although, they do all resolve successfully). |
@LaniakeaSC4 I think this is a little off topic based on the original question. But there are many ways to approach this (hard to say which is best without context). Here are a few ideas:
|
Hey all 👋 Closing this since @ninnjak did a great job at answering all the questions. Thank you for your help! ❤️ |
I think the problem is this, the method add a unnecessary filter in the RPC call, if you remove this it's works... |
When trying to get a collection using
nfts().findAllByCreator(verifiedcreator)
I get the following error;Version 0.15.0
Using
The text was updated successfully, but these errors were encountered: