Questions tagged [idl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
10 views

Error: IDL for program `loss_harvester` does not have `metadata.address` field

When running anchor test on my solana program it complains that the IDL is missing the metadata.address field. But when I add it, it disappears again after running anchor test. My program built fine. ...
samuelshix's user avatar
0 votes
1 answer
23 views

Parsing Token Program Transactions

I'm currently working on monitoring the Solana Token Program with the address TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA. My goal is to filter out specific events, namely Token Mints, Token Burns, ...
Abdullah Aftab's user avatar
0 votes
1 answer
12 views

how to generate alignment padding in idl file while running anchor build

zero_copy and repr(c) are used before state struct to handle the over-stack problem. While generating the idl json file by anchor build, no padding field is generated following #[repr(C)] alignment ...
PeterMMM's user avatar
0 votes
1 answer
29 views

Parsing instructions in Rust

I'm exploring a service called Streaming Fast that parses instruction data by program ID. I'm currently listening to the Stake11111111111111111111111111111111111111 program id and I see: { "...
AceGravity's user avatar
3 votes
2 answers
114 views

What is an IDL?

When talking about Solana programs, I often run across the word "IDL". What is it and what is it used for?
Ahri's user avatar
  • 2,393
0 votes
1 answer
25 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
0 votes
0 answers
21 views

Anchor IDL command / verification

> anchor idl Commands for interacting with interface definitions Usage: anchor-0.29.0 idl [OPTIONS] <COMMAND> Commands: init Initializes a program's IDL account. Can only be ...
AceGravity's user avatar
2 votes
1 answer
59 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
61 views

how to make a proper schema for the arguments

there are arguments "args": [ { "name": "decimals", "type": "u8" }, { "name": &...
slntrx's user avatar
  • 97
3 votes
2 answers
211 views

How do I interact with closed-source Solana programs with no public IDL?

How do I interact with a program that has no open source and no Anchor program IDL. I need to get types, accounts and instructions for this program: https://solscan.io/account/...
FDFD FDFD's user avatar
1 vote
2 answers
267 views

How to get full IDL for a Solana program?

I am facing difficulties in getting Interface Definition Language (IDL) for a program on Solana. I need the complete IDL for the following program: https://solscan.io/account/...
FDFD FDFD's user avatar
1 vote
0 answers
34 views

How to generate Anchor CPI from source code?

There are a few libraries to gen the Anchor CPI from IDL file, like anchor-gen. They work to some extend, though the output contains some errors that have to be manually fixed. If I have access to the ...
Kise's user avatar
  • 141
0 votes
1 answer
53 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
1 answer
323 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/...
omm's user avatar
  • 27
0 votes
1 answer
28 views

Anchor IDL type for structs

I'm trying to fetch a PDA account and use one of it's properties as a seed for another PDA account. Here's what the implementation looks like: const [ registryPDA, registryBump ] = PublicKey....
brknarsy's user avatar
2 votes
1 answer
57 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
0 votes
0 answers
21 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 ...
Victor Maldonado's user avatar
1 vote
1 answer
51 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
  • 1,438
0 votes
1 answer
120 views

IdlError: Type not found for custom struct

I got started with writing smart contracts 2 days ago so please bear with me. The function emit_event emits an event. I want to call the function via a CPI form another program. I have written code ...
Wilfred Almeida's user avatar
2 votes
1 answer
143 views

How to deserialized Anchor accounts in Rust

In JS/TS I can decode an account from bytes using the coder: const program = new Program(IDL, new PublicKey(""), anchorProvider) const decoded = program.coder.accounts.decode("...
lameren's user avatar
  • 133
2 votes
2 answers
75 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,256
0 votes
1 answer
29 views

VecDeque in Anchor

Does anyone have experience using VecDeque in an Anchor project? I have the following structure: #[account] pub struct Market { pub bids: VecDeque<Order>, pub asks: VecDeque<Order>,...
Proph3t's user avatar
  • 402
0 votes
1 answer
54 views

How to clone Anchor Program with IDL

If I have an Anchor IDL json, is it possible to generate an Anchor program (Rust) script with it?
gud's user avatar
  • 395
3 votes
1 answer
172 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
61 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
2 votes
1 answer
504 views

How do we call solana methods if program.rpc deprecated?

I initialized a correct program const provider = getProvider(); const program = new Program(idl, programID, provider); When I called this function await program.rpc.create("name", "...
Yilmaz's user avatar
  • 1,071
3 votes
1 answer
152 views

Anchor IdlError: Type not Found for usize

When parsing an account using Anchor, I receive the following error: IdlError: Type not found: "type":{"defined":"usize"} My code import * as anchor from "@project-...
vicyyn's user avatar
  • 3,875
3 votes
1 answer
566 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,256
1 vote
0 answers
23 views

Fixing Replay Attack. Someone added tx to bypass executing by adding an amount not available in the wallet [closed]

So, we had a coinflip sort of logic implemented and sols kept in a pool to be rewarded to someone who wins with a randomizer code in place using blockhash. However, right after we deployed, someone ...
Fahad Bilal's user avatar
4 votes
2 answers
759 views

Fetch onChain IDL from Program ID

I've been looking around the posts and I don't really see anything that can help me so I'm trying here. I'm looking for a way to fetch the IDL of a program by the ID of this program (provided that it ...
Swifty's user avatar
  • 428
1 vote
0 answers
65 views

Event Index In Solana

What are the index and non-index properties in the Event (in Solana) and how many indexes are allowed (I know that in EVM Solidity there are three index properties allowed in the Event)
Bilal Afzal's user avatar
0 votes
2 answers
176 views

Question regarding IDL

Guys I am trying to learn about Coding on Solana & I have a question that, if there is no IDL of a program or the IDL is not updated of a program then how do we get the account data & ...
Kid Knot's user avatar
0 votes
1 answer
61 views

Anchor IDL fails and says unknown account

anchor idl fetch M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K But I get Error: Account not found, why is this? Surely the Program Account must have an IDL??
dinmavr's user avatar
  • 93
3 votes
1 answer
87 views

Using Fs to fetch idl error: "Module not found: Can't resolve 'fs'"

I keep getting this error when trying to import fs to get my idl: Module not found: Can't resolve 'fs' Code: const { readFileSync } = require("fs"); export class BigBazaar { constructor( ...
incog's user avatar
  • 567
0 votes
1 answer
126 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
70 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
  • 169
1 vote
1 answer
70 views

Can I get magicEden's escrow program IDL?

I wanna have magicEden's program IDL. https://solscan.io/account/M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K I can see many transactions here, and what I want to achieve is to get listing price info ...
yacho's user avatar
  • 107
2 votes
2 answers
224 views

Anchor: does an account being initialized (not PDA) need to be a signer?

I have the following accounts in an instruction: #[derive(Accounts)] pub struct CreatePixel<'info> { #[account(init, payer=user, space=Pixel::LEN)] pub pixel: Account<'info, Pixel>,...
Callum M's user avatar
  • 2,817
0 votes
2 answers
108 views

Is it possible to generate idl/bindings for non-Anchor programs

As the title states is there a crate or any mechanism to get an idl similar to what we get with anchor programs but for vanilla/bare-bones solana programs ?
Nabeel Naveed's user avatar
4 votes
1 answer
72 views

How to override a trait implementation generated by a macro

anchor-gen is a handy crate which allows the generation of a CPI crates from only a program's Anchor IDL. It generates all the necessary Rust structs/functions/impls to allow CPI invocation of the ...
man0s's user avatar
  • 690
4 votes
3 answers
1k views

How to get the IDL of a Solana Program?

Similar to ABI files for EVM, Solana programs (hopefully) have IDLs that describe the structure of their contracts. What's the best way to obtain the IDL of a Solana Program?
0xMertimus's user avatar
1 vote
1 answer
182 views

Intitalize Solana Program through IDL

I want to initialize solana program through IDL using rust (anchor-client) program as same as we do in JS let programNetworkDemand = new Program( IDL, programIDNetworkDemand, provider, ); I didn't ...
Mohammad Mavia's user avatar