Questions tagged [instructions]
The instructions tag has no usage guidance.
49
questions
0
votes
1
answer
30
views
How to parse the inner instructions of the transaction's instruction?
Its parsing only transaction instructions, but not inner.
import { PublicKey, Connection, LAMPORTS_PER_SOL } from "@solana/web3.js";
import { SolanaParser } from "@debridge-finance/...
1
vote
1
answer
51
views
How to decode base64 response?
Req:
{
"method": "getMultipleAccounts",
"jsonrpc": "2.0",
"params": [
[
"...
0
votes
0
answers
17
views
Call Instructions Anchor IDL error address not inicialized
I am trying to replicate some calls to an Anchor IDL of a contract. And all the instructions work for me, but the most important one doesn't. And I have a couple of doubts, comparing my calls with the ...
0
votes
1
answer
43
views
Getting different Buffers in Solana transactions. The front-end and back-end transactions are different
I have a Solana dApp that requests tokens from a wallet that I own. When the user try to claim the Tokens, one transaction is created on the frontend and signed by the user; the signature is coded and ...
0
votes
3
answers
102
views
How to create a metadata account with python?
Original Question
I would like to write a python script that can create tokens. Since the Metaplex Python API seems outdated and only targeted to NFTs, I decided to do it myself. With the help of the (...
1
vote
1
answer
43
views
How to create, sign and send transaction to Magiceden program
I have Magiceden API bearer token and using the buyNow endpoint
Which return Buffer data as in the picture.
I tried to create the Transaction like this:
const transactionME = Transaction.from(Buffer....
2
votes
2
answers
22
views
Does there exist a practical application of calling a program with neither instruction data nor a list of accounts?
Each instruction in a transaction can include:
The address of a program to invoke
A list of accounts the program can access during its execution
A byte buffer of instruction data
Can you give an ...
0
votes
0
answers
87
views
Transaction simulation failed: Error processing Instruction 1: custom program error: 0xbbf
I get the following error when trying to execute an instruction:
Transaction simulation failed: Error processing Instruction 1: custom program error: 0xbbf
This is the account:
#[derive(Accounts)]
pub ...
0
votes
1
answer
43
views
How can a system transfer instruction not result in a corresponding balance change?
I found a mainnet transaction with an inner system transfer instruction which does not seem to create a corresponding SOL balance change.
The inner system transafer is transfering 0.001 SOL from ...
2
votes
2
answers
107
views
How to obtain transaction innerInstructions as Explorer shows?
I'm a bit confused about additional info in transaction. I need to parse it and handle information from the instruction, but i can't. And what confusing me more - explorer. Explorer knows everything. ...
1
vote
1
answer
62
views
Anchor: How to know instruction number without having to run "cargo expand"?
I have a Tic Tac Toe game contract which looks like this:
#[program]
pub mod tic_tac_toe {
use super::*;
pub fn start_game(ctx: Context<StartGame>) -> Result<()> {
...
1
vote
2
answers
48
views
Find collection in a Sharky offer loan transaction
I'm trying to analyze a transaction for the NFT Lending protocol Sharky.fi.
This txn for example : Cm4pCJFCKQzmtuZ254itotMokhK8X6zs7YfeWKYE6i8kpaowZ3XzUPWJbhvvcoZ6KxULP79PEBy8A3P4nmPpkgg
We have an ...
4
votes
2
answers
160
views
Instruction order in a transaction
I'm currently exploring priority fee in Solana transaction, so I'm wondering should I add the setComputeUnitPrice as the first instruction or the order doesn't matter? Extending the concept, the order ...
5
votes
2
answers
170
views
What is the main function of setComputeUnitLimit? Can the instruction 1232 limit be expanded?
The transaction instruction length limit is 1232, can it be modified through setComputeUnitLimit? In what scenario is setComputeUnitLimit used?
2
votes
1
answer
53
views
How do your retrieve nested CPI/Inner Instructions from web3.js?
From solana web3.js, it looks like it only shows 1 level deep of CPI.
How would I get inner ix 2 in this example:
tx:
ix1:
inner ix1:
inner ix2:
ix2:
...
type ...
1
vote
1
answer
326
views
Transaction simulation failed: Error processing Instruction 0: insufficient account keys for instruction
I cloned this repo: solana-movie-program and deployed it on Solana Playground.
I also cloned solana-movie-client and tried it but I get the error: "Transaction simulation failed: Error processing ...
5
votes
1
answer
68
views
Most impactful optimisations to improve transaction finality on solana?
I would like my application to have the transaction finality similar to "break" solana game. "break" does several optimisations to achieve the speeds it does as stated here - https:...
2
votes
1
answer
118
views
Can I send the same transaction twice in the same block?
I am building a game and want to send multiple move transactions in quick succession.
But when I do that I get two transactions with the same hash when the recent block hash didn't change yet and I ...
1
vote
1
answer
57
views
What is the size of Option<u64> in instruction data for an anchor program ix?
Assuming u64 is 8 bytes what is Option<u64>. How many bytes extra does Option add to the instruction data for an anchor program ix?
2
votes
1
answer
238
views
InvalidProgramId when passing the correct program id
I have a anchor program locally that runs perfectly with anchor typescript client, but while trying to access with rust's solana_client it throws this error:
AnchorError caused by account: ...
2
votes
1
answer
88
views
can i send identical transaction without api ME
Do I need to get instructions via the Magiceden api
to send such a transaction
solscanlink - link
5
votes
1
answer
42
views
Getting an IDLError when I try to create a vector of a defined Struct
I currently have defined a Ship struct in my backend code, as well as a Port struct which contains an attribute ships_berthed that is of type Vec.
However, on my frontend (Svelte), when I try to call ...
2
votes
1
answer
114
views
solana token program 0xc Invalid Instruction
I have recently begun getting the below error when running the createMint instruction from @solana/spl-token. To my knowledge, I have not changed any code or dependencies that would affect this.
...
2
votes
2
answers
123
views
Can a mint's supply or decimals ever change?
I am building a data ingestion pipeline for solana blockchain data, and trying to determine whether it is safe for my processing pipeline to classify a given mint as an NFT based on whether the supply ...
2
votes
1
answer
45
views
Implementation of AssignWithSeed?
I cant seem to understand how to change the ownership of a system owned account. How do I pass in new owner to the instruction?
2
votes
2
answers
77
views
Multiple account creation in one transaction
When we create a Solana PDA we construct the instruction, sign it and then send the transaction to Solana cluster. So I would like to know the transaction fees is charged based on nr. of instructions/...
3
votes
1
answer
478
views
How to create an associated Token Account in anchor, I'm getting the following error: "insufficient account keys for instruction"
I need to create a SPL-Token before each test I'm running
So I created the 2 following functions : createMint and createUserAndAssociatedWallet
I'm able to create a mint but I can't create the ...
0
votes
1
answer
402
views
Serialize custom struct type defined in Solana anchor program from JS
I have the following struct defined in the Solana anchor program
#[account]
pub struct Parent {
pub field1: String,
pub data_arr: Vec<Data>,
}
#[derive(Debug, Clone, AnchorSerialize, ...
3
votes
2
answers
612
views
Multiple instructions in one transactions using Anchor TS client (@project-serum/anchor)
I would like to add multiple instructions into a single transaction, using Anchor TS (@project-serum/anchor). Here is an example how this works with Solana Web3.js (@solana/web3.js): What is the best ...
4
votes
1
answer
121
views
Correlate the instructions of the innerInstructions
I get the parsed transaction from Solana (getParsedTransaction) and I would like to specifically parse the instructions and their corresponding innerInstructions. How can I know that my ...
2
votes
1
answer
30
views
Is there a transaction instruction verification system in place to avoid verifying user-fed transaction id's in a server?
Is there an efficient way to solve the verification of a particular transaction in the server? For example, I want the user to transfer 100 XYZ tokens. But while confirming the transaction in the ...
1
vote
0
answers
38
views
Call program instruction using solana/web3 [duplicate]
Is it possible to call a program instruction using Web3?
I need to create the TransactionInstruction and sign the transaction manually and send the raw transaction to the blockchain.
The program ...
1
vote
1
answer
165
views
What is the significance of inner Instructions in a transaction and how do they relate to the instructions?
I have some confusion over the inner instructions in a transaction. Does every transaction have inner instructions? Whats the difference between instructions and the inner instructions? Thank you.
1
vote
0
answers
67
views
How to encode transaction instruction data from an Anchor program?
I'm trying to encode the transaction instruction data from Anchor using the documentation (https://docs.solana.com/developing/clients/javascript-api#interacting-with-custom-programs) but this is not ...
8
votes
2
answers
1k
views
IllegalOwner error: Provided owner is not allowed
I am having this error when processing instructions for a transaction.
Detail error log:
Transaction simulation failed: Error processing Instruction 1: Provided owner is not allowed
Program ...
3
votes
2
answers
201
views
Finding instruction identifiers
When you send a raw instruction to the network, you have to specify in the instruction data an instruction identifier, so that the program knows what function to call. For example, in python:
from ...
3
votes
2
answers
113
views
Then what is the purpose of `CreateWithSeed` instruction?
System Program has two distinct instructions: CreateAccount and CreateWithSeed. The latter's documentation says:
Create a new account at an address derived from a base pubkey and a seed
This sounds ...
0
votes
1
answer
130
views
How to encode array data (Uint8Array) for instruction?
I am trying to call a function using a non-anchor program from solana. The function takes a [u8:32] argument as "seeds" and a u32 argument as "number_of_schedules". I have looked ...
1
vote
1
answer
242
views
Send Instruction with multiple parameters to non-anchor program help (instruciton_data)
I am working with a solana program which was written a couple years ago and it is non-anchor. I am specifically having trouble with calling the program functions from the test-side, the data field ...
1
vote
1
answer
37
views
How to get wallets to recognize instructions (instead of having "unknown instruction") within a transaction?
When sending a transaction, in the wallet confirmation step, in some programs ?the wallet? seems to recognize what the instruction does, whereas in others it just lists the accounts that get written ...
1
vote
1
answer
48
views
Am I able to search for specific transactions based what's in the program instruction logs?
I'm interested in trying to find all transactions for a specific program that include a specific instruction. Take this Mango transaction for example, I can see that someone is placing multiple Perp ...
7
votes
2
answers
223
views
What is the use for `program_id` in program's entrypoint
All Solana programs receive its own program_id as a parameter.
But I don't see how this is useful, as you can use declare_id to declare it in case you need it.
I've also seen that if you get your ...
1
vote
2
answers
40
views
What happens when Invoke is successful but Instruction fails
if I have an instruction that invokes another instruction that succeeds but the instruction that invoked it later fails, are there balance changes.
transfer_sol_instruction() -> ProgramResult
{
...
2
votes
3
answers
92
views
How do you split a function call across multiple instructions? (How can I get around the compute limit)
I'm trying to verify ZK proofs on solana, but running into compute limits. I was told I can break things into multiple instructions to get around compute limits but I'm not sure how to do that exactly....
4
votes
1
answer
60
views
Can I call 'get account info' in instruction in rust?
I'd like to get account info from pubkey of account in instruction method in rust.
like this,
// instructions.rs
fn instruction_method() -> Instruction {
let pubkey: Pubkey;
let account_info =...
5
votes
2
answers
1k
views
How to get Solana instruction data from transaction object
Disclaimer: I asked this on SO and also in Discord, but was directed here, so here I am...
I'm doing a simple transaction with a single transfer instruction for 0,1 SOL from one account to another. ...
1
vote
2
answers
128
views
dynamic seed generation | seed not getting recognised when passing from frontend/cli
I am following the following tutorial:
https://dev.to/findiglay/building-a-blog-on-solana-2pg8
But in the code below it is creating seeds using the value from blog_account. I want to pass some ...
0
votes
1
answer
123
views
How do I create transaction instructions? [closed]
I’m learning how to send transactions through solana-py. I have everything down except for instructions. How do I calculate them?
0
votes
2
answers
132
views
How we can decode an Instruction from a list in a transaction receipt
I would like to decode a sell instruction from a transaction, to obtain instruction detail. Idem as make Solscan with a transaction after we sell an NFT on Opensea or Magiceden. For example the code ...