Skip to main content

Questions tagged [idl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
72 views

Are there any security risks by adding the program IDL in client side code?

I don't really see any inherit risk by doing this, but maybe I am being naive. If it is dangerous or a potential vulnerability, please let me know why. thanks <3
keegan's user avatar
  • 23
1 vote
2 answers
98 views

React Frontend not working right with Anchor and localnet deployed Solana Program which passes Anchor Test

So I am mainly backend focused and new to Solana trying to become a full stack dev. I am very new to frontend development and have been facing some problems there. So I've been working on my first ...
Mark's user avatar
  • 43
0 votes
1 answer
191 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
98 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
363 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
2 votes
0 answers
244 views

how to create market id in devnet with js

I was learning solana evm on devnet and I started to code a token with @solana/spl-token library and then I tried to add a liquidity to radiyum and then it asked for openbook market id , I want to ...
diana artist's user avatar
0 votes
1 answer
41 views

why "Transaction references a signature that is unnecessary" warning, and value of 'isSigner' is false in IDL?

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 ...
breeze wang's user avatar
0 votes
2 answers
53 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
  • 387
0 votes
0 answers
34 views

Why does the published contract IDL fail with RPC response error -32002?

So I can create, test locally, and publish my contract to testnet. Yet when I run anchor idl init --filepath target/idl/getter_examples.json --provider.wallet /keys/id.json --provider.cluster testnet ...
Blender's user avatar
  • 101
1 vote
2 answers
310 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
304 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
21 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
239 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
4 votes
2 answers
426 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
  • 4,150
0 votes
1 answer
42 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
81 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
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
177 views

how to make a proper schema for the arguments

there are arguments "args": [ { "name": "decimals", "type": "u8" }, { "name": &...
slntrx's user avatar
  • 111
3 votes
2 answers
820 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
2k 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
85 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
  • 165
0 votes
1 answer
82 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
845 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
42 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
83 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
23 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
87 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,420
0 votes
2 answers
223 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
279 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
  • 153
2 votes
2 answers
86 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
0 votes
1 answer
43 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
  • 412
0 votes
1 answer
99 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
  • 427
3 votes
1 answer
257 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
83 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
3 votes
1 answer
831 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,164
3 votes
1 answer
207 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
  • 4,095
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
44 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
1k 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
81 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
293 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
99 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
  • 103
3 votes
1 answer
113 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
206 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
98 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
1 vote
1 answer
100 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
306 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
  • 3,130
0 votes
2 answers
210 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
91 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
3k 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