Questions tagged [anchor-client]
The anchor-client tag has no usage guidance.
18 questions with no upvoted or accepted answers
2
votes
0
answers
106
views
How can I decode the data for an event emitted by an inner instruction?
For this transaction for example - how can I decode the data in the buy function? I have the IDL. I've tried creating a struct and converting the data to an Uint8 Array and then decoding but I'm ...
2
votes
0
answers
56
views
How to create an instruction from an anchor program with rust client?
Hi I have a simple contract testing slots pasted below. I have a question is there a way I can create an instruction for check_slot that passes in the 2 arguments? I read that anchor-client in rust ...
1
vote
1
answer
35
views
error while executing create token account instruction
const sleeperAccountInstruction = await program.methods
.createNewSleeper("test")
.accountsPartial({
payer: account,
mint: mintPDA,
sleeperAccount: sleeperPDA,
...
1
vote
0
answers
98
views
Property 'accountName' does not exist on type 'AccountNamespace<ProgramName>'.ts(2339)
Trying to fetch data from an on-chain account using Anchor and getting the error Property 'accountName' does not exist on type 'AccountNamespace<ProgramName>'.ts(2339)
fetch method
const ...
1
vote
0
answers
168
views
How to send a solana/web3.js transaction to a anchor program?
I want to send a transaction to a anchor program,
I have found the function discriminator
const dis = [125,112,23,1,23,45,24,12]
I have checked ,that this is the right function, Now i want pass a vec&...
1
vote
1
answer
528
views
How do I resolve the anchor build error: Failed to obtain package metadata
I created a project with the command: anchor init solanasc and I receive this error when I run anchor build
ERROR cargo_build_sbf] Failed to obtain package metadata: `cargo metadata` exited with an ...
1
vote
0
answers
83
views
When using Event listener the rpc call to program function does nothing and eventualy time limit will exceed and test fails
This block of code is giving the trouble..
let listener = null;
//@ts-ignore
let [event, slot] = await new Promise((resolve, _reject) => {
listener = program.addEventListener(&...
1
vote
0
answers
71
views
Calling anchor function in the background
How do I call a anchor function without having the end user approve/sign in their wallet?
During development in my anchor project, I was able to create tests where I can call anchor functions without ...
0
votes
0
answers
20
views
Created Todo: Error Message: A seeds constraint was violated
Anchor code
#[derive(Accounts)]
#[instruction(todo_index: u8)] // Added this to pass the index as an instruction argument
pub struct CreateTodo<'info> {
#[account(mut)]
pub authority: ...
0
votes
0
answers
16
views
anchor verify 5nfdb6vRYEgh7i41jcv5eC4gMUA5stV2bUDJcbM9JzBQ --skip-build
Having issues with anchor verify
anchor verify 5nfdb6vRYEgh7i41jcv5eC4gMUA5stV2bUDJcbM9JzBQ --skip-build
Error: package section not provided
Need your guys help let me know!! Important point I tried ...
0
votes
1
answer
14
views
Error while calling an instruction with PDA in client side code
I’m trying to send SOL to a “hold account” (which I’m thinking should be a PDA) and then only be able to claim it from the address that sent this SOL. I am getting an error as I’m trying to now call ...
0
votes
1
answer
171
views
Error: expected environment variable `ANCHOR_WALLET` is not set
I had an error, seems like I'm missing something. Hope someone can help
const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
const program = new anchor....
0
votes
0
answers
17
views
Could not able to run tests in anchor. Main error is anchor test command is not finding .ts file
The Error, I am receiving in the terminal after running the command 'anchor test' is :
TypeError: Unknown file extension ".ts" for /home/ahmed/development/your-x/tests/your-x.ts
My anchor....
0
votes
0
answers
12
views
Error: Property 'all' does not exist on type 'ticket' account in Anchor program
I'm working on a Solana program using Anchor ("^0.30.1") and encountered an error while trying to fetch accounts with the all method. I want to retrieve all tickets for a specific lotteryId ...
0
votes
1
answer
85
views
Facing issue with account creation with bubblegum, Error: Transaction <some signature> failed ({"err":{"InstructionError":[0,{"Custom":1}]}})
I am trying to create account using below method of bubblegum but getting strange error({"err":{"InstructionError":[0,{"Custom":1}]}}) as described here https://github....
0
votes
1
answer
134
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-...
0
votes
1
answer
221
views
Getting error when I'm going to mint NFT on testnet using Metaplex
Here is my mint contract
use anchor_lang::prelude::*;
use anchor_lang::solana_program::program::invoke;
use anchor_spl::token::mint_to;
use anchor_spl::token::{MintTo, Token};
use mpl_token_metadata::...
0
votes
2
answers
217
views
createAccount with pda gives Error: signature verification failed
I am doing something similar to this issue..
here are the two ix:
let tx = new anchor.web3.Transaction();
tx.add(
anchor.web3.SystemProgram.createAccount({
fromPubkey: ...