Questions tagged [solana-web3js]
322 questions
1
vote
1 answer
Module '"@solana/spl-token"' has no exported member 'createAssociatedTokenAccountInstruction'
version: "@solana/spl-token": "0.1.8"
Tried with version 0.2.0 too but didnt work

Anoushk
- 551
- 7
- 20
1
vote
1 answer
Solana. Not matched transfer amount and target account balance change
I sent transaction transferring 3000 lamports, but target account balance was increased for 2954 lamports. Link to transaction:…

Anton Shelenkov
- 315
- 4
- 13
1
vote
1 answer
Is it possible to close an account which was create using SystemProgram.createAccountWithSeed?
I made an error creating an account with seeds. A program is the owner of this account. Is it possible for me to close this or only the program?

wxecqz123
- 325
- 1
- 5
- 12
1
vote
1 answer
SOLANA: How to display my candy machine NFT's on metaplex's storefront?
I minted 30 tokens with candy machine's cli, following the metaplex's github boilerplate project
Uploaded, verified, minted and signed all the NFT's. I can see them on my phantom wallet and it created a cache file on the main directory with the…

jalapina
- 3,962
- 3
- 12
- 19
1
vote
1 answer
Get token list from connected solana wallet and create an array
I'm trying to figure out how to take the connected wallet, from the solana wallet-adapter and grab all the spl-tokens (NFTs specifically but that filter doesn't have to happen) and create an array with the token mint addresses. I'm fairly new to…

TyGuy
- 11
- 1
1
vote
0 answers
Retrying failed custom token transaction with '@solana/web3.js'
I want to send my deployed token other than sol using solana web3.js. My code works most of the time but sometimes the transaction fails.
I put a while loop so that when the transaction fails the client retries it with the sendRawTransaction…

augustin
- 69
- 5
1
vote
1 answer
Solana: Can't make createAccount work, createAccountWithSeed works
I am currently trying to learn on writing programs for Solana and interacting with those.
I am using the example-helloworld code. In order to interact with the helloworld program, the nodejs code creates an account with seed:
const transaction = new…

Donut
- 197
- 9
1
vote
1 answer
Converting _bn back into PublicKey with Solana
When creating a Solana Transaction I set the feePayer with a public key. When I send this transaction between various endpoints, the feePayer gets converted to something like below:
"feePayer": {
"_bn": {
"negative": 0,
…

fes
- 2,465
- 11
- 40
- 56
1
vote
1 answer
Anchor test Transaction simulation failed: An account required by the instruction is missing
I am trying to create a simple program that lets users donates. This program is bootstrapped by Anchor. Unfortunately, It failed on very first step creating a PDA account by CPI. Please see the detailed info below:
Anchor test fails with:
…

onetakt
- 51
- 7
1
vote
2 answers
Transfer error using Phantom Wallet when using signAndSendTransaction function
Does anyone know what's wrong with this code?
await window.solana.connect();
let fromWallet = window.solana.publicKey;
let toWallet = new PublicKey("");
let transaction = new Transaction();
transaction.add(
…

Xec
- 53
- 1
- 8
1
vote
0 answers
sendAndConfirmTransaction bug?
In my application I use the signatures returned from web3.sendAndConfirmTransaction to do some offline/async reporting relating to the fees incurred by my transactions.
i.e. i use the signature to retrieve the transaction and then use the…

1977
- 2,580
- 6
- 26
- 37
1
vote
2 answers
[Solana / Solana/Web3.js]Unable to Airdrop Sol. Internal Error is thrown
So this is a simple Solana / web3.js Airdrop code.
I was able to check the wallet balance. But when I tried to perform an airdrop, internal error is thrown.
Below is my code
const{
Connection,
PublicKey,
clusterApiUrl,
…

Soam
- 11
- 2
1
vote
1 answer
Get NFTs by CandyMachineId always returning an empty array
I am trying to write a script to pull NFTs by candy machine id, but it is either failing or returning an empty array each time.
I am using the genesysgo mainnet rpc.
Here is the relevant code.
const rpc = process.env.REACT_APP_RPC_HOST!;
const…

MMelvin0581
- 509
- 6
- 20
1
vote
1 answer
How to integrate contract (program) with web3 in Solana?
I am using @solana/web3.js library and have tested to create new account and get balance.
Now I am going to integrate the contract (Raydium Liqudity PoolV4) with web3.
I have googled and can not find good material to learn.
Can you help me how to…

Makar
- 13
- 3
1
vote
1 answer
How to extend Solana spl_token program to add more functionality?
SPL_Token program contains lots of features, but I want to add more additional checks as per customer requirement. So I want to create custom spl_token program by extending original spl_token code
e.g. Lets say, I want to limit maximum token that…

Saurabh Suman
- 11
- 2