metaplex-foundation / shank

Extracts IDL from Solana Rust contracts
https://docs.rs/crate/shank_macro/latest
116 stars 23 forks source link

feat: supporting hashmap and btreemap fully #30

Closed thlorenz closed 2 years ago

thlorenz commented 2 years ago

Summary

Adds support for HashMap and BTreeMap field types.

They are added to the IDL as hashMap and btreeMap respectively. i.e. for HashMap<String, Vec<Custom>>.

{
  "type": {
    "hashMap": [
      {
        "option": "string"
      },
      {
        "vec": {
          "defined": "Custom"
        }
      }
    ]
  }
}

Remaining

As more map types need support they can be added using a similar approach.