saber-hq / anchor-gen

Generates an Anchor CPI crate from a JSON IDL.
https://crates.io/crates/anchor-gen
Apache License 2.0
105 stars 58 forks source link

idl json: "isOptional" not working #82

Open jeongwoo-ji opened 3 months ago

jeongwoo-ji commented 3 months ago

https://github.com/MeteoraAg/dlmm-sdk/blob/main/target/idl/lb_clmm.json#L129

i couldn't find the code which handle isOptional.. is it a bug?

SC4RECOIN commented 2 months ago

this repo was probably developed against an old version of anchor and optional accounts was added in anchor 0.26 so I'm sure this tool doesn't support it

You can pass in the program id instead if the optional field is required This is what anchor does for you: https://github.com/coral-xyz/anchor/pull/2101