Skip to content

Latest commit

 

History

History
48 lines (38 loc) · 1.5 KB

File metadata and controls

48 lines (38 loc) · 1.5 KB

Solidity Compiler

  • Name in Remix: solidity
  • kind: compiler
Type Name Description
event compilationFinished Triggered when a compilation finishes.
method getCompilationResult Get the current result of the compilation.
method compile Run solidity compiler against a file.

Examples

Events

compilationFinished:

client.solidity.on('compilationFinished', (fileName: string, source: CompilationFileSources, languageVersion: string, data: CompilationResult) => {
  // Do something
})
// OR
client.on('solidity', 'compilationFinished', (fileName: string, source: CompilationFileSources, languageVersion: string, data: CompilationResult) => {
  // Do something
})

Methods

getCompilationResult:

const result = await client.solidity.getCompilationResult()
// OR
const result = await client.call('solidity', 'getCompilationResult')

compile:

const fileName = 'browser/ballot.sol'
await client.solidity.compile(fileName)
// OR
await client.call('solidity', 'compile', 'fileName')

Types

CompilationFileSources: A map with the file name as the key and the content as the value.

CompilationResult: The result of the compilation matches the Solidity Compiler Output documentation.

Type Definitions can be found here