Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown variant hashMap #114

Open
GabrielePicco opened this issue Mar 3, 2023 · 2 comments
Open

Unknown variant hashMap #114

GabrielePicco opened this issue Mar 3, 2023 · 2 comments

Comments

@GabrielePicco
Copy link
Contributor

GabrielePicco commented Mar 3, 2023

I'm trying to generate the client for the metaplex metadata program IDL, but seems that hashmap type is missing the mapping.

Steps to reproduce

  1. Download the idl: https://raw.githubusercontent.com/metaplex-foundation/metaplex-program-library/master/token-metadata/js/idl/mpl_token_metadata.json
  2. anchorpy client-gen mpl_token_metadata.json metaplex_client

Error:

solders.SerdeJSONError: unknown variant `hashMap`, expected one of `bool`, `u8`, `i8`, `u16`, `i16`, `u32`, `i32`, `f32`, `u64`, `i64`, `f64`, `u128`, `i128`, `bytes`, `string`, `publicKey`, `defined`, `option`, `vec`, `array` at line 4498 column 5
@GabrielePicco
Copy link
Contributor Author

GabrielePicco commented Mar 9, 2023

Update:

Using the Idl.from_json, I also get the same issue:

with Path("./mpl_token_metadata.json").open() as f:
        raw_idl = f.read()
idl = Idl.from_json(raw_idl)

I did some investigation, and this likely needs bindings to be added in the anchorpy-core module

@kevinheavey
Copy link
Owner

This means it would need to be in Anchor itself. The anchor_lang crate doesn't support HashMap in IDLs https://github.com/coral-xyz/anchor/blob/master/lang/syn/src/idl/mod.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants