Skip to main content

Questions tagged [anchor-program-idl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
4 answers
62 views

"anchor build" wont generate my "../target/types/program_name" file

I am using the Anchor Framework to build Solana Programs. I haven't had this issue until now: When running anchor build to generate my ../target folder, usually, my ../tests/program-name.ts file is ...
TheLazySol's user avatar
0 votes
1 answer
23 views

Solana CLI how to fix this? Not configured Program ID

PS C:\Users\Keola> spl-token mint 4ZPyP3fGWEoFV7ey32jqwJGCydyK9(censored) 80000000 14fbryUnN5Px4GGg1MMgTKawpyvBXUz(censored) Error: "Account 14fbryUnN5Px4GGg1MMgTKawpyvBXUz(censored) is owned ...
Keola's user avatar
  • 73
0 votes
1 answer
180 views

Type 'SolanaNftAnchor' is missing the following properties from type 'Idl': address, metadata

Hi I am new to solana and i am testing my mint nft contract , while testing when i import my program using : import { SolanaNftAnchor } from "../target/types/solana_nft_anchor"; It gives me ...
Mohammad Abuzar's user avatar
3 votes
2 answers
86 views

Issue While Connecting to Frontend with Anchor Backend [closed]

Issue Description I followed all the steps mentioned in the documentation Full Stack Solana development with React and Anchor: https://solana.com/developers/guides/getstarted/full-stack-solana-...
Ajit's user avatar
  • 159
2 votes
1 answer
334 views

Anchor IDL different (incorrect?) from Solana Playground IDL generated

I was following this guide to learn anchor: https://www.quicknode.com/guides/solana-development/anchor/transfer-tokens When deploying the program via Solana Playground (as instructed), everything runs ...
Crypto Actuary's user avatar
0 votes
0 answers
8 views

I am Facing the error in the smart contract after setting up the project via command "anchor init project_name --solidity "

The error is in the smart contract of the project setup by anchor init command. This is the error { " Expected pragma, import directive or contract/interface/library/struct/enum/constant/function/...
Aditya Singh's user avatar
1 vote
1 answer
73 views

Types/IDL isn't generating on building the program

Im building the program using anchor build with latest version. and it's building successfully also but the target folder is empty and sometime on building i'm getting this error warning: some crates ...
Sabir Khan's user avatar
0 votes
1 answer
119 views

how to pass `remaining_accounts` from my program to closed-source third-party program?

From on-chain program, calling a normal third-party program (without source code, but has IDL) instruction would be like this: let accounts_meta = vec![ // ... ]; ...
breeze wang's user avatar
0 votes
1 answer
87 views

Anchor programs not working in react native and expo environment [TypeError: b.readUIntLE is not a function (it is undefined)]

I'm facing this error when I'm interacting with an onchain program on solana using anchor in expo react native , its the same outcome when I run it with the AnchorCounterProgram example on the ...
Timothy Adigwe's user avatar
2 votes
1 answer
59 views

How to get the types from compiled Idl in my tests?

So I'm able to run tests just fine and I know for a fact that the typescript is picking up the types from my compiled program. With that said, I have resorted to using let myAccount: Awaited<...
techiejd's user avatar
0 votes
2 answers
51 views

How to disable IDL generation on some Account structs in Anchor?

When developing Solana on-chain programs with Anchor, after running anchor build, structs that are decorated with #[account] attribute will be in the generated IDL file. I'm wondering if I can turn ...
Yan's user avatar
  • 375
0 votes
0 answers
64 views

Error: AnchorError occurred. Error Code: InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not supported)

I am building an app on Solana using Anchor, and everything works when I'm testing on localnet, but whenever I switch to devnet, I'm getting the error when I call any program method. Error: ...
sammyd's user avatar
  • 1
0 votes
1 answer
40 views

For a given IDL and account name, is there a lib (anchor or other) or function that finds for each account struct key, the offset where it begins?

So I'm having trouble finding the offset for some account keys of programs that have an IDL and would like to get some help on this. For example in this program https://solscan.io/account/...
Miguel Valente's user avatar
2 votes
1 answer
69 views

IDLs explorers - Curiosity

Why do some idls ain't showing in solana.explorer and only showing on solscan? Context:(Some programs had all idls deployed) Was upgrading the idls on chain, noted that some programs on solana....
beliveN DAOist.dev's user avatar
1 vote
1 answer
168 views

how to make a proper schema for the arguments

there are arguments "args": [ { "name": "decimals", "type": "u8" }, { "name": &...
slntrx's user avatar
  • 111
0 votes
1 answer
80 views

Converting JS IDL to Python [closed]

does anyone have any example to convert IDL in Javascript to a useable one in Python? I want to be able to decode data with the IDL in python
wonton's user avatar
  • 21
0 votes
0 answers
87 views

no method named `try_to_vec` found for reference `&UpdateArgs` in the current scope

Here is my idl: use solana_idlgen::idlgen; idlgen!({ "version": "0.1.0", "name": "wba_prereq", "instructions": [ { &...
WowBow's user avatar
  • 135
2 votes
1 answer
82 views

Unable to upload Solang generated idl

$ anchor idl init -f target/idl/program.json `solana address -k target/deploy/program-keypair.json` Error: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: ...
CrossedCarpet's user avatar
1 vote
1 answer
85 views

Reference for supported IDL types

Is there a reference for supported anchor IDL types, just like we have for the space reference. Trying to use a slice [usize; 32] but getting the error IdlError: Type not found: {"type":{&...
Jimii's user avatar
  • 3,160
1 vote
1 answer
234 views

Fallback functions are not supported. error 101 (Anchor)

I have a very weird use case. I have a method in a program, my method is call "bid" When i try to call it with program.transaction.bid(...) it worked 2 times, and it's not working anymore, i ...
Effe2's user avatar
  • 1,178
4 votes
1 answer
207 views

how can i send a transaction to a solana program using flutter/dart

I have a solana program to which I want to send parameters and also different accounts, however I have not found how to do it, in this case I am using this flutter/dart library. Flutter Packages [...
Jesus Silva's user avatar
2 votes
2 answers
85 views

Using the #[constant] macro in anchor depending on feature flag

Does anyone know if there is a method to produce an IDL that has different constants depending on the feature flag? I have tried variations of #[cfg(not(feature = "mainnet"))] #[constant] ...
Burger Bob's user avatar
  • 1,456
3 votes
1 answer
254 views

Can't anchor idl init

when I try to anchor IDL init, i get stuck permanently trying to finalize the txn. anchor idl init --filepath ./target/idl/solotesting2.json Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS --provider....
2ndsonsolomon's user avatar
3 votes
1 answer
81 views

Is it possible to retrieve an IDL using getAccountInfo() without brute forcing anchor decode() on the accounts

Is there a pattern in which account the IDL is stored in?
Sewy's user avatar
  • 85
5 votes
1 answer
994 views

How can I get the discriminator of an instruction in an Anchor Solana IDL?

First of all can someone explain to me what a discriminator is, in the context of Solana instructions, in simple terms? Second, how can I get the discriminator of an instruction in an Anchor Solana ...
Sam's user avatar
  • 51
2 votes
0 answers
29 views

What is `store` and `store_bump` [closed]

this is like a parent of the program ID , with a new thing which I am not aware of called store, and store_bump, can someone tell me what is this, the child program is ...
Kid Knot's user avatar
1 vote
1 answer
139 views

Trouble initializing solana contract on front-end client

I have a very simple program which stores GIFs in a solana contract. Before I can get the gifs, however, I believe I need to call the "initialize" function in my front-end. I have created ...
user2487's user avatar
3 votes
2 answers
1k views

Anchor IDL address missing from json

Is it just me or did the "metadata": {"address: Pubkey} key-value pair from the generated json disappear when running anchor build?
Burger Bob's user avatar
  • 1,456
1 vote
0 answers
156 views

How to use program id as seeds for a PDA

I am trying to use my program_id as one of my seeds for a PDA in my code. Here is a sample pub const seed: &str = "seed" pub struct PoolAccounts<'info> { /// CHECK: This is a ...
chinepun.sol's user avatar
2 votes
1 answer
552 views

How to check for a list of wallets that interacted with a specific program id

As the title says Let's say I have a program id and I want to see a list of wallets that interacted with and filter by the type of interaction, how do I do so?
Dlight's user avatar
  • 21
1 vote
1 answer
383 views

How to decode anchor zero copy account with idl?

The zero copy version of the following struct adds 4 bytes of padding between arg_1 and arg_2. This makes the idl not able to decode the struct correctly as arg_2 is being decoded based on the 4 bytes ...
escargo's user avatar
  • 15
2 votes
1 answer
41 views

Is there a way to tell anchor to ignore a field on deserilize?

We are facing an issue. Appreciate it if you can give some suggestions. We have several AccountExample in mainnet/devnet. It is created the following way. #[account] pub struct AccountExample { ...
Irshad's user avatar
  • 21
0 votes
1 answer
203 views

Anchor: Change Localnet to Devnet

so we delpoyed our code onto devnet, and now I am wondering how to interact with it. The main problem I have is connecting to the provider. Code: const provider = anchor.AnchorProvider.env(); anchor....
incog's user avatar
  • 567
0 votes
1 answer
80 views

How do I include the Decimal struct in the anchor idl?

I have copied the math section from the token lending program here https://github.com/solana-labs/solana-program-library/tree/master/token-lending/program/src/math Decimal struct is as below // U192 ...
escargo's user avatar
  • 15
0 votes
1 answer
97 views

Is there any way to fetch all anchor idl's?

Is there any way to get all anchor idl's? Right now the CLI supports the command anchor idl fetch <account>, but I'd like something like anchor idl fetch --all, or a way to fetch all anchor ...
liamvovk's user avatar
  • 168
0 votes
2 answers
335 views

Anchor cluster provider issue

I have setup the Anchor.toml fiel for the devnet but got the error in the test cases some thing like "request to http://localhost:8899/ failed, reason: connect ECONNREFUSED 127.0.0.1:8899", ...
Aslam's user avatar
  • 423
2 votes
1 answer
243 views

Pass tuple enum to instruction data

I pass custom struct including tuple enum to instruction: #[derive(Debug, AnchorSerialize, AnchorDeserialize)] pub enum FeedValue { Boolean(bool), U8(u8), U16(u16), U32(u32), U64(...
Alex's user avatar
  • 23
1 vote
1 answer
729 views

How to parse base64 program data from getParsedAccountInfo?

I've been trying to figure out a way to programmatically derive the descriptive "label" given a program's base58 address, e.g. cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ => NFT Candy ...
Sun Lee's user avatar
  • 113