111 questions
-2
votes
1
answer
87
views
# Phantom Wallet signMessage() Always Returns -32603 "Unexpected error" on Solana
Problem Description
I'm implementing wallet authentication in a Next.js/Solana application using direct Phantom wallet integration. The wallet connects successfully, but signMessage() consistently ...
0
votes
0
answers
48
views
Detecting token creations with Solana Program Library not working as it should be
Here's my current code:
const {Connection, PublicKey} = require("@solana/web3.js");
const bs58 = require('bs58');
// Program IDs for monitoring logs
const TOKEN_PROGRAM_ID = new PublicKey('...
0
votes
1
answer
118
views
Solana PDA Seed Mismatch Issue
I'm building a Solana program in Rust using Anchor framework. I'm facing an issue with PDA (Program Derived Address) derivation when testing my program using JavaScript/TypeScript. The PDA address ...
-1
votes
1
answer
158
views
How to add solana-address-lookup-table-program program to solana-program-test
While testing using solana-program-test .
I tried to make a transacton to craete a lookup table. However , I encountered the below error and after some search I found it is because the address lookup ...
1
vote
0
answers
69
views
Solana USDC Transfer: "Cannot Read Properties of Undefined (Reading 'from')" Error in @solana/spl-token
I'm trying to transfer USDC on Solana using @solana/spl-token in a React app with @solana/wallet-adapter-react, but I'm getting this error:
Uncaught TypeError: Cannot read properties of undefined (...
5
votes
2
answers
3k
views
unexpected `cfg` condition value: solana
I'm trying to make a smart contract with Solana and build it using Anchor on WSL, but everytime it always gives a target_os warning like this:
warning: unexpected cfg condition value: solana
--> ...
1
vote
0
answers
421
views
Transaction signing failure raydium CP-Swap
I have been attempting to send transactions using the Standard AMM (CP-Swap, New), particularly for tokens that do not utilize the OpenBook program ID. However, I encounter issues during signing and ...
-3
votes
1
answer
180
views
How to implement TS code connection.onLogs monitoring in Rust
enter image description here
I want to implement the watchRaydiumV4Initialize2Logs method, so I need to find something similar to connection.onLogs in Rust, but the RpcClient struct in solana-client ...
0
votes
0
answers
5k
views
Error: "Could not find token account XXXXXXXXXXXXXXXXXXXX" after using spl-token create-account
After following these steps, I receive the error "Error: "Could not find token account ___" when trying to mint or transfer tokens to a recipient.
Creating keypairs:
solana-keygen new ...
0
votes
1
answer
239
views
Having issues with solana cli token distribution, recieving error PickleDbError(Error { msg: EOF while parsing a value })
enter image description hereHi im recieving the error above in the title while running solana-tokens distribute-tokens on devnet. im following the instructions correctly. Below im adding an image of ...
0
votes
1
answer
962
views
Blockchain - Raydium - Python - Matching Transactions cross wallet
I have been trying to create a program in python to analyze my Pnl of trades subcategorized by wallets that I am copy trading on Raydium. I have tried out two code bases so far and the first returns 0 ...
1
vote
1
answer
920
views
Solana Inner Instruction & Instruction Relationship
I am a beginner in Solana development. I just have a question regarding instruction and inner instruction.
https://solscan.io/tx/...
0
votes
2
answers
1k
views
Failed to upgrade solana program
I always close and redeploy but it's annoying. So I need to upgrade instead.
solana program upgrade target/deploy/program-keypair.json new_program.json owner.json -u "https://mainnet.helius-rpc....
0
votes
1
answer
285
views
How to execute a TS that was designed for solana Playground, locally. To launch on mainnet
I have a TypeScript script that was initially created to run in the Solana Playground, and I would like to execute it locally on my pc, since playground only allows devnet. I only want to update the ...
1
vote
1
answer
944
views
Solana SPL token transfer from A to B wallet in program with PDAs
I am trying to develop a program on the Solana network, I have had experiences for EVM before but Solana looks very different.
If we give an example on EVM, it is enough to authorize spending with &...
0
votes
1
answer
308
views
Compute fee for Solana transferCheckedWithFee instruction
When broadcastring a token-2022 program transaction using the transferCheckedWithFee instruction, solana documentation suggest to compute token fee using this formula:
const fee = (amountToSend * ...
-1
votes
1
answer
1k
views
How to create an associated token account in solana using the token-2022 program
How do you create an associated token account in Solana for a token-2022?
function getAssociatedTokenAddressSync(
mint: PublicKey,
owner: PublicKey,
allowOwnerOffCurve = false,
...
2
votes
0
answers
3k
views
Solana mainnet block height exceeded for transactions with `TransactionExpiredBlockheightExceededError` error
I am trying write a simple program to send some SOL from one wallet to another. I keep running into TransactionExpiredBlockheightExceededError on sendAndConfirmTransaction.
Interestingly, this works ...
0
votes
1
answer
1k
views
How to add token metadata to solana token 2022 token created using createInitializeTransferFeeConfigInstruction extension
I am trying to create a token using solana token program 2022 extension createInitializeTransferFeeConfigInstruction. How can I add token metadata (name, symbol ) to it?
Here is my current code.
// ...
1
vote
3
answers
1k
views
Error when attempting to mint SPL token on Solana
Getting the following error every time script is run:
TransactionExpiredBlockheightExceededError: Signature [SIGNATURE] has expired: block height exceeded.
Script:
import { percentAmount, ...
0
votes
0
answers
584
views
Is it possible to send SPL-Tokens to multiple addresses in 1 or multiple transaction with spltoken cli in Solana
I've tried to do it using a .csv but couldn't get it to work, I've only used cli commands. I'm a beginner in coding (been doing it for roughly 2 months now). So if the only way is through code, please ...
1
vote
1
answer
3k
views
How to correctly import solders for Pubkey into a project?
I am trying to write a script in Python to track events from the solana blockchain. I read that solana public key is now used as solders pubkey.
this is my code:
from solana.rpc.async_api import ...
7
votes
1
answer
753
views
Does program keypair has any other usage besides program deployment?
When we are doing program deployment on Solana using Anchor cli, it will read the key pair generated at target/deploy/<program>-keypair.json and use it to sign the instruction for initial ...
0
votes
1
answer
571
views
Transaction failing while calling a Solana program with PDA
I'm calling a function of anchor_movie_review_program program on devnet CLA5Pk8tpcsA3RPmCYPaRNBdU6xBknRnqshsT1bKT7if.
I cloned the following GitHub https://github.com/Unboxed-Software/anchor-movie-...
1
vote
1
answer
138
views
How to restrict acces to Solana programs only to owners of certain NFT collection using Sol Cerberus
I am using Sol Cerberus to manage the access to my Solana program, but I don't know how can I call my instruction in javascript to test the access using an NFT collection.
For instance this is my ...
0
votes
0
answers
661
views
Got error "Cross-program invocation with unauthorized signer or writable account"
I'm new in Solana and tries to reassign account's owner.
I do next:
Deploy program
Create account with owner = program deployed id
Call program, which change owner
But on step 3 I got error:
...
0
votes
1
answer
337
views
Spl token not getting minted using spl js library
Here's my code i'm trying to mint spl token using spl js library:
(async () => {
const connection = new web3.Connection(web3.clusterApiUrl("devnet"));
let secretKey = Uint8Array.from(...
0
votes
0
answers
237
views
its trait bounds were not satisfied label: method `serialize` not found for this struct
I'm trying to save AccountInfo in a struct that #[derive(BorshSerialize, BorshDeserialize, Clone, Debug)] to send SOL to this account. AccountInfo is a struct in library that don't impl serialize ...
1
vote
1
answer
2k
views
How can I create a associated token address in solana from connected wallet address?
I want to create an associated token address in Solana from a connected wallet address. This is my code currently:
import { useWallet, useConnection } from "@solana/wallet-adapter-react";
....
0
votes
2
answers
5k
views
Transfer a solana token from my wallet to another in python
So I am working on a script that transfers tokens (custom-made tokens not owned by me) from my wallet to another in python using solana.py. How do I go about doing that?
(By tokens I mean, tokens like ...
0
votes
1
answer
702
views
Solana PDA passing from javascript client
I'm writing a Solana program which uses PDAs to store auction positions and I have a question about passing the accounts from client when calling instructions. My positions use a numeric counter as a ...
2
votes
0
answers
1k
views
How to close and transfer all SOL balance programatically without reserving the rent?
I have a Solana account A which is a fee payer, and another Solana account B with some SOL balance, I want to close and transfer all account B's SOL balance to another account C. How do I do that?
I ...
-1
votes
1
answer
733
views
Init Token Account error - "Error processing Instruction 0: custom program error: 0x0"
In my program I'm trying to init PDA Token Accounts so that my program can store tokens of specified mints like this:
#[derive(Accounts)]
pub struct StartAuction<'info> {
#[account(init, ...
0
votes
0
answers
999
views
Solana Token Swap Program
I am trying to create a swap pool and interact with existing pools to perform a swap by interacting with solana swap program but getting this error.
"Program log: panicked at 'index out of bounds:...
1
vote
2
answers
3k
views
How can we Wrap and Unwrap SOL using the Solana Web3 TS/JS library?
Using Solana Web3 TS library how can we wrap and unwrap SOL?
Here on this link it is possible to see what the SPL Token CLI program does for wrapping and unwrapping SOL, but the conversion of those ...
0
votes
1
answer
1k
views
ATA ownership changed to token program
I have been spending hours trying to understand why my ATA address owner suddenly changed to the token program instead of my account address. I am using PDA to transfer the token from the PDA ATA ...
1
vote
1
answer
884
views
SendTransactionError: failed to send transaction: Node is unhealthy
I'm trying to send a transaction with a memo program inside it.
The problem appears on solana cli and web3 too.
This is the command:
solana transfer --from ./.cache/solana.json RECIVER_PUBLIC_KEY 0....
0
votes
1
answer
1k
views
"Invalid param: not a Token account" when trying to obtain the balance of USDT account in Solana
I'm trying to get the balance of a random USDT account in Solana. I've tried several public gateways and hasn't successed. Here's one example:
curl --request POST \
--url https://solana-mainnet.g....
0
votes
0
answers
335
views
Unable to transfer token to another account due toTypeError: Cannot read property 'toString' of undefined
I am trying to transfer the token to another account using the Solana rust program. I am currently using the Anchor framework. I have created the program for it.
Now, I am trying to execute the test ...
0
votes
2
answers
2k
views
Solana Anchor: CPI with PDA
I'm trying to create an Mint having my program as authority and I'm struggling to get my CPI calls right.
Here is a toy example of what I have so far:
use anchor_lang::prelude::*;
use anchor_spl::...
0
votes
1
answer
92
views
Make a stake program for my own nft project
Friends, I want to stake my own nft project. I wonder if there is a tool like candy machine for this? How can I make a staking program?
2
votes
0
answers
389
views
How to make non-transferable token on solana
I'm trying to deploy non-transferable token on solana. As explained in the document, I used token-program-2022 example with non-transferable extension.
import {
clusterApiUrl,
...
0
votes
0
answers
795
views
Getting error: No identifiers allowed directly after numeric literal
I am getting the error : [SyntaxError: No identifiers allowed directly after numeric literal]
Actually I am using @solana/web3.js and @solana/spl-token libraries.
/*
param is
{"amount": &...
0
votes
1
answer
1k
views
Solana can't mint to a different token account
Folks, I'm starting with Solana and it's been rough to learn. Despite the poor error messages and the learning curve of Rust, I'm making my way through it.
I'm trying to develop a new token that will ...
0
votes
1
answer
2k
views
Can I do solana spl-token authorize mint --disable but from javascript?
I am trying create an NFT mint, I know how to do it from CLI, but I need to do it from JS, I am looking at the code of @solana/spl-token package, but cannot find API analogous to
spl-token authorize &...
0
votes
0
answers
385
views
Solana: Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account, Transfer sol to wallet without pri key
I am trying to implement Program Flow of a bet game in solana with following features:
A Player transfers some amount to house wallet (deposit_wallet) and plays a game
System records the win loss net ...
0
votes
2
answers
2k
views
Smart contract to Lock/Hold Solana tokens for a short period
I have a solana program that will transfer some amount. After agreeing to the amount to transfer, the transaction will take place a little later. Few hours to few days. Is there a way my solana smart ...
0
votes
1
answer
463
views
Validate the integrity of the solana program request content
Suppose I have a simple web UI to connect wallet and click a button to invoke a solana program transaction. Since the call is happening actually on user’s host machine/the browser, it's possible ...
0
votes
1
answer
561
views
Testnet validator is not coming up the with leader schedule
Hello I have started the Testnet validator, and it's not validating at all, I have changed the Validator identity and Vote account identityy it's still showing the same info. There is no issue with ...
0
votes
2
answers
845
views
Is it possible to continue a computation in a Solana smart-contract beyond the compute budget?
I've been trying to figure out if it's at all possible to create a smart contract in Solana that will run a long-ish calculation (e.g. many sha256 iterations, or a KDF), maybe in parts, even though ...