@metaplex-foundation/solita
Version:
Generates SDK API from solana contract IDL.
16 lines (15 loc) • 653 B
TypeScript
import { Idl } from './types';
/**
* When anchor doesn't understand a type it just assumes it is a user defined one.
* This includes HashMaps and BTreeMaps. However it doesn't check if that type
* is actually defined somewhere.
* Thus we end up with invalid types here like `HashMap<String,DataItem>` which
* is basically just the type definition copied from the Rust code.
*
* This function attempts to fix this. At this point only top level struct
* fields are supported.
*
* Whenever more cases of incorrect types are encountered this transformer needs
* to be updated to handle them.
*/
export declare function adaptIdl(idl: Idl): void;