You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the declare_program!() to generate client sdk from idl file, I see the following error:
error[E0774]: `derive` may only be applied to `struct`s, `enum`s and `union`s
--> src/trydeclare.rs:5:1
|
5 | declare_program!(ammv3);
| ^^^^^^^^^^^^^^^^^^^^^^^
| |
| not applicable here
| not a `struct`, `enum` or `union`
|
= note: this error originates in the macro `declare_program` (in Nightly builds, run with -Z macro-backtrace for more info)
pub mod trydeclare {
use anchor_lang::declare_program;
use anchor_lang::declare_id;
declare_id!("CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK");
declare_program!(ammv3);
}
create the ammv3.json from the json file above, adding the metadata field:
Problem
When using the
declare_program!()
to generate client sdk from idl file, I see the following error:Specifically, I am using the idl file from raydium-clmm program, https://github.com/raydium-io/raydium-idl/blob/master/raydium_clmm/amm_v3.json
anchor version, rust version, etc
stable-x86_64-unknown-linux-gnu (default)
rustc 1.84.0 (9fc6b4312 2025-01-07)
How to reproduce
ammv3.json
from the json file above, adding themetadata
field:cargo build
or compile any other way. You will then see the error above.The text was updated successfully, but these errors were encountered: