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
23
votes
3 answers

Import phantom wallet private key into solana CLI

I need to use a Phantom Wallet through the Solana CLI, but I'm unable to configure it. For example, to check balance using solana balance --keypair fileexportedfromphantom but can't read the info. How do I convert that private key into a valid form…
user1843376
  • 535
  • 2
  • 7
  • 12
20
votes
3 answers

How to transfer custom token by '@solana/web3.js'

I want to send my deployed token other than sol using solana web3.js, but I don't know how. I've been looking for the official documentation for a long time, but I can't find it. Could you please let me know if you have any information on this?…
Normalbut_Genuine
  • 511
  • 2
  • 5
  • 13
19
votes
6 answers

How to transfer custom SPL token by '@solana/web3.js' and '@solana/sol-wallet-adapter'

I am trying to transfer a custom SPL token with the solana-wallet adapter. However I am having trouble getting the wallet's secret key/signing the transaction. I've looked at these answers for writing the transfer code, but I need to get the Signer…
Rick Lancee
  • 1,629
  • 1
  • 15
  • 20
16
votes
1 answer

rust solana build error: no such subcommand: +bpf

I am new to solana and rust, recently i have installed thier example-helloworld from this repo- https://github.com/solana-labs/example-helloworld . Whenever i have tried to build the rust program using npm scripts or going to the rust program…
abhishek
  • 189
  • 1
  • 3
15
votes
1 answer

solana web3 confirmTransaction @deprecated using a TransactionConfirmationConfig example

With this code VS show a deprecated warning: (method) Connection.confirmTransaction(strategy: string, commitment?: Commitment): Promise (+1 overload) @deprecated — Instead, call confirmTransaction using…
user3887366
  • 2,226
  • 4
  • 28
  • 41
14
votes
2 answers

Solana Test Program Anchor Test failing tsconfig.json" > needs an import assertion of type "json"

I ran anchor test --skip-deploy and all it should do is initialize my program, but all I get is this error, that I cannot resolve. I checked the tsconfig.json settings they should be fine. This is just the default anchor setup and I'm not importing…
Julia
  • 981
  • 1
  • 8
  • 16
12
votes
2 answers

Solana Anchor Rust: How to convert a public key into an AccountInfo type

I know I can give my Solana Rust program an user's token account via a Context struct as shown in Anchor tutorial 2: https://project-serum.github.io/anchor/tutorials/tutorial-2.html#defining-a-program #[derive(Accounts)] pub struct Stake<'info> { …
Russo
  • 2,186
  • 2
  • 26
  • 42
12
votes
2 answers

How can you transfer SOL using the web3.js sdk for Solana?

How can you transfer SOL using the web3.js sdk for Solana?
anondevpepe
  • 287
  • 1
  • 4
  • 8
11
votes
5 answers

Unable to verify message signed by sol-wallet-adapter

Having created a signed message I'm unsure how to use the resulting signature to verify the message using the publicKey. My use case is, I'm wanting to use a Solana Wallet to login to an API server with a pattern like: GET message: String (from API…
harkl
  • 872
  • 7
  • 17
10
votes
3 answers

Error loading workspace IDL for Solana Anchor Testing

For some reason, my mocha test is unable to find my IDL. I am getting the error below: name@Mabels-MacBook-Pro solana-anchor-reactjs-payment % anchor test BPF SDK:…
Mabel Oza
  • 557
  • 8
  • 22
10
votes
2 answers

Add Meta Data To Solana Token with @solana/web3.js

I am trying to create an NFT using web3.js and spl-token.js. However, i need to add meta data (like the name of the token or other attributes), otherwise it just shows up as "Unknown Token" in my wallet. This is the relevant part of the code where I…
Ood
  • 1,445
  • 4
  • 23
  • 43
10
votes
2 answers

How to get proper public address from mnemonic phrase for Solana?

I am trying to get proper public address for Solana wallet using solana-web3.js at my react-native test project import { Keypair} from '@solana/web3.js'; import * as bip39 from 'bip39'; import * as bip32 from 'bip32'; const derivePath =…
Mikenso
  • 121
  • 2
  • 6
10
votes
4 answers

I can not deploy the program to dev net with anchor

I get this error where I run anchor deploy: Deploying workspace: http://127.0.0.1:8899 Upgrade authority: /home//.config/solana/id.json Deploying program "faucet"... Program path:…
Noldorin Zhang
  • 181
  • 1
  • 2
  • 7
10
votes
1 answer

Solana - Commitment vs preflightCommitment

I'm curious what the difference between preflightCommitment and commitment is. Also, what are the different types of commitments listed below. export type Commitment = | 'processed' | 'confirmed' | 'finalized' | 'recent' |…
yangli-io
  • 16,760
  • 8
  • 37
  • 47
10
votes
2 answers

I want to know causing a solana transfer error

My token sending program has met an issue about sending transaction, throwing an error below. Error: failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: 0x1 It is related with sol balance.…
Normalbut_Genuine
  • 511
  • 2
  • 5
  • 13
1
2 3
80 81