UNPKG

@honeycomb-protocol/solita

Version:

Generates SDK API from solana contract IDL.

17 lines (16 loc) 718 B
import { SolitaConfig } from './cli/types'; 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, config: SolitaConfig): Idl;