Quantcast
↧

How to fetch recent blockhash on chain since recent blockhash sysvar is...

I want to perform on-chain signature verification for alternative signature schemes like secp256k1/secp256r1, where the tx must be signed and executed in real time. To ensure freshness and prevent...

View Article


Image may be NSFW.
Clik here to view.

Class extends value /static/media/client.98866d6736d9f36d61b8.cjs is not a...

Getting this error just by importing these two dependencies:import * as anchor from "@coral-xyz/anchor";import {Connection, Publicky, clusterApiUrl} from "@solana/web3.js";Class extends value...

View Article


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...

View Article

DeclaredProgramIdMismatch

Hello Solana community!Can you please explain one thing to me?In my program (lib.rs), I have:declare_id!("HvfFKzgpvjCUatSU9wiQktYYdkXo77gh1Kpg9PyJPYJJ");And in my Anchor.toml, I...

View Article

Error: Reached maximum depth for account resolution in one account but not in...

use anchor_lang::prelude::*;declare_id!("9hWXNsuz6fXRnmnCY3x7sYRBTrUBEGHZGsosht96SpNG");#[program]pub mod solpgbeta { use super::*; pub fn initializevoting(ctx: Context<Initializevoting>,...

View Article


Pyth SDK with Anchor Error - function or associated item not found in PriceFeed

I'm facing issues with Pyth SDKI'm getting these errorserror[E0599]: no function or associated item named `create_type` found for struct `states::states::PriceFeed` in the current scope -->...

View Article

Image may be NSFW.
Clik here to view.

Phantom Wallet Fails to Confirm Transaction on Solana Localnet

I'm testing a Solana program on localnet using a frontend I built, but when I try to confirm a transaction in Phantom Wallet, the "Confirm" button remains disabled. Instead, I get the following...

View Article

Why is the TypeScript IDL definition a type not a constant?

I have used the Anchor CLI to fetch the IDL for a program I am interacting with, and then used anchor idl type to generate a typescript type as follows:export type RaydiumCpSwap = {"address":...

View Article


seahorse build Error: anchor-spl v0.30.0 error[E0308]: mismatched types

I'm testing the test case program for the Seahorse architecture calculator.py and everything works fine when I test with beta.solpg.io, and when I test with a local environment I get an error.My local...

View Article


"Cannot read properties of undefined (reading 'encode')" error when calling a...

I'm trying to call a simple hello_world method from my Solana Anchor program, but I keep getting this error:TypeError: Cannot read properties of undefined (reading 'encode') at...

View Article

anchor_lang::Space trait for data structures in anchor

For a while now, i've been trying to write some code that would ordinarily require a HashMap or a BTreeMap, becuase my goal is to find if elements are in the set and also insert elements into the set...

View Article

How can i use Token Extension?

I am developing smart contract.I wanna use token extension in smart contract, how can I start?anchor version is v0.30.1

View Article

Error Code: AccountNotSigner. Error Number: 3010. Error Message: The given...

use anchor_lang::prelude::*;declare_id!("9hWXNsuz6fXRnmnCY3x7sYRBTrUBEGHZGsosht96SpNG");#[program]pub mod solpgbeta { use super::*; pub fn initializevoting(ctx: Context<Initializevoting>,...

View Article


Error in GET /fetch-transactions: TypeError: s.Wallet is not a constructor

I'm currently trying to fetch-transactions in a serverless function using vercel and getting this error: Error in GET /fetch-transactions: TypeError: s.Wallet is not a constructorIs there a special way...

View Article

having trouble with anchor build the error is it is saying my current version...

joshuac@MacBookAir nex-index % anchor builderror: package bytemuck_derive v1.9.2 cannot be built because it requires rustc 1.84 or newer, while the currently active rustc version is 1.75.0-devEither...

View Article


How to create data account in web3.js and read&write from custom program?

I want to store data in data account owned by my custom program.Data structure is very simple - just Vec<PublicKey>I can use pda but I'm worried its space should be set when being...

View Article

Anchor build dependency issue

anchor builderror: not a directory: '/home/emperor/.local/share/solana/install/releases/1.18.18/solana-release/bin/sdk/sbf/dependencies/platform-tools/rust/lib'I have tried to install the latest...

View Article


`anchor build` failed - can't find crate for `core`, `std`. For latest...

Just updated to the latest Anchor, Solana-CLI, and Rust versions:Rust: rustc 1.85.1 (4eb161250 2025-03-15)Solana CLI: solana-cli 2.1.17 (src:4adcd0f2; feat:3271415109, client:Agave)Anchor CLI:...

View Article

Unable to build program due to missing toolchain

When i try to build an anchor program, it gives me the following error. Compiling proc-macro2 v1.0.92 Compiling unicode-ident v1.0.14 Compiling version_check v0.9.5 Compiling typenum v1.17.0 Compiling...

View Article

Error: missing field `discriminator` at line 28 column 5

Hello im trying to build simple smart contract using anchor and solang but when im trying "anchor build" command im getting this error:info: Solang version v0.3.3help: found contract 'helloworld'┌─...

View Article

Anchor build, deploy, test cycle best practices

I am building and testing an anchor program. First is there a good article to read that describes this process in detail (I'm a newb to anchor). Also, I am using solana-test-validator and have my...

View Article


Anchor program failing to recognize admin/authority signature during 10%...

I’m working with a training example Anchor program that initially worked as expected. As part of the training, I modified the program to allow the lottery admin to withdraw 10% of the total payout,...

View Article


New (Anchor + Solana ) version - Unable to deploy contracts - SOLVED -...

I faced this problem and sharing the solution so that others can refer this solution. since i upgraded anchor & solana to latest version (refer below), i was facing problems with deployment due to...

View Article

Error in calling `anchor build` command

I got this error while calling this command anchor buildanchor buildthread 'main' panicked at cli/src/lib.rs:545:18:called `Option::unwrap()` on a `None` valuenote: run with `RUST_BACKTRACE=1`...

View Article

Anchor build: Error - Large stack variables

I am still getting these errors upon Anchor build despite others claiming it has been solved by simply upgrading to solana-cli versions 18.2.0 and higher.Error: Function...

View Article


Anchor-bankrun warpToSlot crashes

Hi fellow Solana developers 👋,I am using to use anchor-bankrun to warp my solana-bankrun context forward to a new slot but it crashes with:thread '<unnamed>' panicked at...

View Article

why "Transaction references a signature that is unnecessary" warning, and...

I was playing with counter program in program-example repo.When run test, I got warning: Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts...

View Article

Image may be NSFW.
Clik here to view.

Suddenly getting error message: Safety checks failed: Failed to get program path

Suddenly getting message: Safety checks failed: Failed to get program path error message during anchor buildanchor version 0.30.0solana version 0.18.17

View Article

this.wallet.signTransaction is not a function

I'm building a journal dapp using the tutorial mentioned in the official docs. I'm trying to use the cli wallet for signing transactions when on localnet. I get this error in UI after trying to create...

View Article



Image may be NSFW.
Clik here to view.

How to call the contract's instruction in the Next.js server?

I now want to use program.account.UserInfo.all() and sort it, but there might be a lot of UserInfo, and processing it on the frontend could be slow. Therefore, I want to handle and filter it in the...

View Article