/ src / types.ts
types.ts
  1  export const ALL_CONTRACTS = '_ALL_';
  2  
  3  export interface Environment {
  4    apiKey?: string;
  5    username?: string;
  6    password?: string;
  7    apiUrl?: string;
  8  }
  9  
 10  export enum Mode {
 11    Quick = 'quick',
 12    Full = 'full',
 13    Standard = 'standard',
 14    Deep = 'deep'
 15  }
 16  
 17  export enum Format {
 18    Text = 'text',
 19    Stylish = 'stylish',
 20    Compact = 'compact',
 21    Table = 'table',
 22    Html = 'html',
 23    Json = 'json'
 24  }
 25  
 26  export interface Args {
 27    options: {
 28      mode: Mode;
 29      format: Format;
 30      noCacheLookup: boolean;
 31      debug: boolean;
 32      limit: number;
 33      contracts: string | string[];
 34      uuid: string;
 35      timeout: number;
 36    };
 37    deprecated?: {
 38      initialDelay: number;
 39    };
 40    obsolete?: {
 41      full: boolean;
 42    };
 43  }
 44  
 45  export interface UuidArgs {
 46    options: {
 47      uuid: string;
 48    };
 49  }
 50  
 51  export interface ReportArgs {
 52    options: {
 53      uuid: string;
 54      format: Format;
 55    };
 56  }
 57  
 58  export interface CompilationInput {
 59    content: string;
 60  }
 61  
 62  export interface CompilationInputs {
 63    [filePath: string]: CompilationInput;
 64  }
 65  
 66  export interface CompilationResult {
 67    contracts: CompiledContracts;
 68    sources: CompiledSources;
 69    solidityFileName: string;
 70    compiledContractName?: string;
 71  }
 72  
 73  export interface CompiledContracts {
 74    [filePath: string]: CompiledContractList;
 75  }
 76  
 77  export interface CompiledContractList {
 78    [className: string]: CompiledContract;
 79  }
 80  
 81  export interface CompiledContract {
 82    abi: any[];
 83    devdoc: {
 84      methods: object;
 85    };
 86    evm: {
 87      bytecode: {
 88        sourceMap: string;
 89        object: string;
 90      };
 91      deployedBytecode: {
 92        sourceMap: string;
 93        object: string;
 94      };
 95      methodIdentifiers: {
 96        [signature: string]: string;
 97      };
 98    };
 99    metadata: string;
100    userdoc: {
101      methods: object;
102    };
103  }
104  
105  export interface CompiledSources {
106    [filePath: string]: CompiledSource;
107  }
108  
109  export interface CompiledSource {
110    ast: any;
111    id: number;
112    legacyAST: any;
113  }
114  
115  export interface FunctionHashes {
116    [hash: string]: string;
117  }
118  
119  export interface CompiledData {
120    compiled: CompilationResult;
121    contract: CompiledContract;
122    contractName: string;
123    functionHashes: FunctionHashes;
124  }