-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This isn't complete, but it is _way_ better than nothing and gives a place for people to add additional typescript definitions in the future. Recommend switching over to TypeScript for this library so this file is generated automatically. :)
1 parent
eace963
commit c609aea
Showing
2 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
declare module 'solc' { | ||
export type Primitive = | ||
'bool' | | ||
'string' | | ||
'address' | | ||
'uint8' | | ||
'uint16' | | ||
'uint32' | | ||
'uint64' | | ||
'uint128' | | ||
'uint256' | | ||
'int8' | | ||
'int16' | | ||
'int32' | | ||
'int64' | | ||
'int128' | | ||
'int256' | | ||
'bytes' | | ||
'bytes20' | | ||
'bytes32' | | ||
'bool[]' | | ||
'string[]' | | ||
'address[]' | | ||
'uint8[]' | | ||
'uint16[]' | | ||
'uint32[]' | | ||
'uint64[]' | | ||
'uint128[]' | | ||
'uint256[]' | | ||
'int8[]' | | ||
'int16[]' | | ||
'int32[]' | | ||
'int64[]' | | ||
'int128[]' | | ||
'int256[]' | | ||
'bytes[]' | | ||
'bytes20[]' | | ||
'bytes32[]'; | ||
|
||
export interface AbiParameter { | ||
name: string, | ||
type: Primitive, | ||
} | ||
|
||
export interface AbiEventParameter extends AbiParameter { | ||
indexed: boolean, | ||
} | ||
|
||
export interface AbiFunction { | ||
name: string, | ||
type: 'function' | 'constructor' | 'fallback', | ||
stateMutability: 'pure' | 'view' | 'payable' | 'nonpayable', | ||
constant: boolean, | ||
payable: boolean, | ||
inputs: Array<AbiParameter>, | ||
outputs: Array<AbiParameter>, | ||
} | ||
|
||
export interface AbiEvent { | ||
name: string, | ||
type: 'event', | ||
inputs: Array<AbiEventParameter>, | ||
anonymous: boolean, | ||
} | ||
|
||
export type Abi = Array<AbiFunction | AbiEvent>; | ||
|
||
interface CompilerInputSourceFile { | ||
keccak256?: string; | ||
urls: string[]; | ||
} | ||
interface CompilerInputSourceCode { | ||
keccak256?: string; | ||
content: string; | ||
} | ||
interface CompilerInput { | ||
language: "Solidity" | "serpent" | "lll" | "assembly"; | ||
settings?: any, | ||
sources: { | ||
[globalName: string]: CompilerInputSourceFile|CompilerInputSourceCode, | ||
}; | ||
} | ||
interface CompilerOutputError { | ||
sourceLocation?: { | ||
file: string; | ||
start: number; | ||
end: number; | ||
}; | ||
type: "TypeError" | "InternalCompilerError" | "Exception"; | ||
component: "general" | "ewasm"; | ||
severity: "error" | "warning"; | ||
message: string; | ||
formattedMessage?: string; | ||
} | ||
interface CompilerOutputEvmBytecode { | ||
object?: string; | ||
opcodes?: string; | ||
sourceMap?: string; | ||
linkReferences?: {} | { | ||
[globalName: string]: { | ||
[name: string]: {start: number, length: number}[]; | ||
}; | ||
}; | ||
} | ||
interface CompilerOutputSources { | ||
[globalName: string]: { | ||
id: number; | ||
ast?: any; | ||
legacyAST?: any; | ||
}, | ||
} | ||
interface CompilerOutputContracts { | ||
[globalName: string]: { | ||
[contractName: string]: { | ||
abi?: Abi; | ||
metadata?: string; | ||
userdoc?: any; | ||
devdoc?: any; | ||
ir?: string; | ||
evm?: { | ||
assembly?: string; | ||
legacyAssembly?: any; | ||
bytecode: CompilerOutputEvmBytecode; | ||
deployedBytecode?: CompilerOutputEvmBytecode; | ||
methodIdentifiers?: { | ||
[methodName: string]: string; | ||
}; | ||
gasEstimates?: { | ||
creation: { | ||
codeDepositCost: string; | ||
executionCost: string; | ||
totalCost: string; | ||
}; | ||
external: { | ||
[functionSignature: string]: string; | ||
}; | ||
internal: { | ||
[functionSignature: string]: string; | ||
}; | ||
}; | ||
}; | ||
ewasm: { | ||
wast?: string; | ||
wasm?: string; | ||
} | ||
} | ||
}; | ||
} | ||
interface CompilerOutput { | ||
errors: CompilerOutputError[]; | ||
sources: CompilerOutputSources; | ||
contracts: CompilerOutputContracts; | ||
} | ||
type ReadCallback = (path: string) => { contents?: string, error?: string}; | ||
function compileStandardWrapper(input: string, readCallback?: ReadCallback): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters