aboutsummaryrefslogtreecommitdiffstats
path: root/packages/typescript-typings/types/solc/index.d.ts
blob: f4c05cd7c9b538cbe9de9a1e7935ef2593c52388 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
declare module 'solc' {
    export { ErrorType, ErrorSeverity, SolcError, StandardContractOutput, StandardOutput } from 'ethereum-types';
    import { SolcError } from 'ethereum-types';
    export interface ContractCompilationResult {
        srcmap: string;
        srcmapRuntime: string;
        bytecode: string;
        runtimeBytecode: string;
        interface: string;
    }
    export interface CompilationResult {
        errors: string[];
        contracts: {
            [contractIdentifier: string]: ContractCompilationResult;
        };
        sources: {
            [sourceName: string]: {
                AST: any;
            };
        };
        sourceList: string[];
    }
    export interface ImportContents {
        contents: string;
    }
    export interface InputSources {
        sources: {
            [fileName: string]: string;
        };
    }
    export interface BaseSource {
        keccak256?: string;
    }
    export interface InMemorySource extends BaseSource {
        content: string;
    }
    export interface UrlSource extends BaseSource {
        urls: string[];
    }
    export type Source = UrlSource | InMemorySource;
    export type OutputField =
        | '*'
        | 'ast'
        | 'legacyAST'
        | 'abi'
        | 'devdoc'
        | 'userdoc'
        | 'metadata'
        | 'ir'
        | 'evm.assembly'
        | 'evm.legacyAssembly'
        | 'evm.bytecode.object'
        | 'evm.bytecode.opcodes'
        | 'evm.bytecode.sourceMap'
        | 'evm.bytecode.linkReferences'
        | 'evm.deployedBytecode.object'
        | 'evm.deployedBytecode.opcodes'
        | 'evm.deployedBytecode.sourceMap'
        | 'evm.deployedBytecode.linkReferences'
        | 'evm.methodIdentifiers'
        | 'evm.gasEstimates'
        | 'ewasm.wast'
        | 'ewasm.wasm';
    export interface CompilerSettings {
        remappings?: string[];
        optimizer?: {
            enabled: boolean;
            runs?: number;
        };
        evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople';
        metadata?: {
            useLiteralContent: true;
        };
        libraries?: {
            [fileName: string]: {
                [libName: string]: string;
            };
        };
        outputSelection: {
            [fileName: string]: {
                [contractName: string]: OutputField[];
            };
        };
    }
    export interface StandardInput {
        language: 'Solidity' | 'serpent' | 'lll' | 'assembly';
        sources: {
            [fileName: string]: Source;
        };
        settings: CompilerSettings;
    }
    export interface SolcInstance {
        compile(
            sources: InputSources,
            optimizerEnabled: number,
            findImports: (importPath: string) => ImportContents,
        ): CompilationResult;
        compileStandardWrapper(input: string, findImports: (importPath: string) => ImportContents): string;
    }
    export function loadRemoteVersion(
        versionName: string,
        cb: (err: SolcError | null, res?: SolcInstance) => void,
    ): void;
    export function setupMethods(solcBin: any): SolcInstance;
}