aboutsummaryrefslogtreecommitdiffstats
path: root/packages/typescript-typings
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-04-07 00:37:48 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-04-12 18:51:15 +0800
commit442017f93ad1fa5af7b751da7cfdda3deb0861ab (patch)
tree8794e7ea4a38d1a177f842f88d75a2df46c62aa7 /packages/typescript-typings
parent4dd9f29769bea90a4b687be26b086164aaff685a (diff)
downloaddexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.tar
dexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.tar.gz
dexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.tar.bz2
dexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.tar.lz
dexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.tar.xz
dexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.tar.zst
dexon-sol-tools-442017f93ad1fa5af7b751da7cfdda3deb0861ab.zip
Use solc.compileStandardWrapper
Diffstat (limited to 'packages/typescript-typings')
-rw-r--r--packages/typescript-typings/types/solc/index.d.ts116
1 files changed, 116 insertions, 0 deletions
diff --git a/packages/typescript-typings/types/solc/index.d.ts b/packages/typescript-typings/types/solc/index.d.ts
index fcef24b9f..b20f9b2ff 100644
--- a/packages/typescript-typings/types/solc/index.d.ts
+++ b/packages/typescript-typings/types/solc/index.d.ts
@@ -26,12 +26,128 @@ declare module 'solc' {
[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 StandardInput {
+ language: 'Solidity' | 'serpent' | 'lll' | 'assembly';
+ sources: {
+ [fileName: string]: Source;
+ };
+ settings: {
+ 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 type ErrorType =
+ | 'JSONError'
+ | 'IOError'
+ | 'ParserError'
+ | 'DocstringParsingError'
+ | 'SyntaxError'
+ | 'DeclarationError'
+ | 'TypeError'
+ | 'UnimplementedFeatureError'
+ | 'InternalCompilerError'
+ | 'Exception'
+ | 'CompilerError'
+ | 'FatalError'
+ | 'Warning';
+ export type ErrorSeverity = 'error' | 'warning';
+ export interface Error {
+ sourceLocation?: {
+ file: string;
+ start: number;
+ end: number;
+ };
+ type: ErrorType;
+ component: 'general' | 'ewasm';
+ severity: ErrorSeverity;
+ message: string;
+ formattedMessage?: string;
+ }
+ import { ContractAbi } from '@0xproject/types';
+ export interface StandardOutput {
+ errors: Error[];
+ sources: {
+ [fileName: string]: {
+ id: number;
+ ast?: object;
+ legacyAST?: object;
+ };
+ };
+ contracts: {
+ [fileName: string]: {
+ [contractName: string]: {
+ abi: ContractAbi;
+ evm: {
+ bytecode: {
+ object: string;
+ sourceMap: string;
+ };
+ deployedBytecode: {
+ object: string;
+ sourceMap: string;
+ };
+ };
+ };
+ };
+ };
+ }
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: Error | null, res?: SolcInstance) => void): void;
export function setupMethods(solcBin: any): SolcInstance;