Questions tagged [solana]

Use for questions about programming on the Solana Blockchain Platform or using its Anchor Framework. Use with the appropriate language tag.

From the website:

Solana is a decentralized blockchain built to enable scalable, user-friendly apps for the world.

Developer documentation can be found here, including information about Solana's Anchor Framework.

1213 questions
10
votes
2 answers

I would like to mint a new token on solana. How can I do this using solana-web3.js?

I'm using the solana-web3.js but can't find any examples for how to create and mint my own tokens. What's the best way to do this?
anondevpepe
  • 287
  • 1
  • 4
  • 8
9
votes
0 answers

Invalid Account Discriminator downloading Metaplex Collections

I updated from anchor 0.17 to version 0.24, and since then, fetching a collection account fails with an anchor error like: Error: Invalid account discriminator This is my code export const getCollectionPDA = async (candyMachineAddress: string):…
alfongj
  • 2,255
  • 1
  • 19
  • 23
9
votes
2 answers

How get all the NFTs in a collection in Solana?

Hello to fetch all the NFTs in a collection using the symbol of the collection. Is any API available that provides the data?
9
votes
1 answer

How to find all NFTs minted from a v2 candy machine

I'm minting Solana NFTs. Candy machine v2 was recently released and v1 is deprecated. If I create a v2 candy machine and mint some NFTs, how can I later find the hashes from all the tokens that were minted?
emersonthis
  • 32,822
  • 59
  • 210
  • 375
9
votes
2 answers

How do I get list of tokens owned by me?

I want to get a list of tokens I currently own, for a given wallet public key. Currently I am using https://api.solscan.io/account/tokens?address="PUBLIC_KEY">&price=1 to get the tokens I own. Okay. So I found this. Using the SPL Token ID as the…
munanadi
  • 799
  • 9
  • 13
9
votes
3 answers

Solana : Adding Sollet / Phantom Wallet Connect to my website - Steps?

I was hoping if anyone could point me in the right direction... I am trying to add the "wallet connect" extension (e.g. sollet / phantom) functionality to my website but I have no idea where to start. Metamask has a good explanation / examples of…
jeeberjoe
  • 91
  • 1
  • 1
  • 2
9
votes
0 answers

failed to run custom build command for `ring v0.16.12`

I am building this (https://github.com/solana-labs/solana) on my new Mac m1 and it failed. The author of ring says it can be fixed by upgrading dependency (https://github.com/briansmith/ring/issues/1163). I tried add ring = "0.16.19" to cargo.toml…
Jill Clover
  • 2,168
  • 7
  • 31
  • 51
8
votes
4 answers

Minting NFTs in Solana. Transaction fees

I have already prepared the Candy Machines for minting an NFT collection in the Solana network, and I am testing the Mint process using its Devnet. Even if you can find a lot of tutorials about how to prepare the candy machines, there are some…
Jaume
  • 3,672
  • 19
  • 60
  • 119
8
votes
1 answer

Proper way to initialize PDAs within the Solana Anchor framework

I'm trying to write a simple Solana Program using Rust/Anchor which uses a PDA, but I get a CPI error when I try to invoke it, even though there's no CPI happening (maybe the PDA account initialization?). Here is the Program code: use…
Kale
  • 183
  • 1
  • 2
  • 8
8
votes
3 answers

How to get Metadata from a Token adress using web3 js on SOLANA

I get a list of tokens own by a publicKey thanks to that method : connection .getParsedTokenAccountsByOwner( new PublicKey(publicKey.toBase58()), { programId: TOKEN_PROGRAM_ID } ) .then((b) => { const owner =…
matt
  • 329
  • 4
  • 11
8
votes
1 answer

What is the Solana pattern for creating a transfer account the program can use to execute a contract payment?

I'm attempting to process a transaction in my solana contract. The way it seems I should do this is by using createAccountWithSeed to generate a transfer account owned by both the program (8DqELvN5TFeMtNJciUYvGqso2CyG5M6XNWxh3HRr3Vjv) and payer. So…
harkl
  • 872
  • 7
  • 17
7
votes
3 answers

MintAccount can't be found

I want to create an NFT using the Metaplex SDK with react. But when i execute this function, it throws following error: AccountNotFoundError: The account of type [MintAccount] was not found at the provided address…
M2DT
  • 125
  • 7
7
votes
5 answers

How can I validate a Solana wallet address with web3js?

I'm trying to validate that the input text I get from a user is a valid Solana address. According to the web3.js documentation, the method .isOnCurve() does that: https://solana-labs.github.io/solana-web3.js/classes/PublicKey.html#isOnCurve I've…
7
votes
6 answers

Solana airdrop error, need help to fix my problem

When I type this in the command prompt: solana airdrop 2 -k ./Wallet/.config/solana/Seller.json I get this error Requesting airdrop of 2 SOL Error: airdrop request failed. This can happen when the rate limit is reached. What can I do?
Dac
  • 71
  • 1
  • 2
7
votes
4 answers

What does "invalid account discriminator" mean in Anchor?

I'm trying to fetch an account from a public key: await program.account.myAccountType.fetch(somePubkey); But then Anchor throws an error saying: Invalid account discriminator What is an account discriminator?
Evan Conrad
  • 3,993
  • 4
  • 28
  • 46
1
2
3
80 81