@agnostico/browser-solidity-compiler
Solidity compiler that works in the browser
1,548
18
| Install | |
|---|---|
npm install @agnostico/browser-solidity-compiler |
|
| Latest Version: | 0.2.0 |
| License: | ISC |
| Last Updated: | Aug 27, 2024 |
| Links: | GitHub · npm |
Maintainer: rexdavinci
Browser Solidity Compiler
Inspired by https://github.com/ethereum/solc-js, This browser solidity compiler works in your browser environments built with Reactjs, vueJS etc.
Installation
npm i @agnostico/browser-solidity-compiler
or with yarn
yarn add @agnostico/browser-solidity-compiler
Then import your application
import { solidityCompiler, getCompilerVersions } from "@agnostico/browser-solidity-compiler";
To load available solidity versions from https://binaries.soliditylang.org/bin/list.json
await getCompilerVersions()
This returns an object containing
- Release versions
- Latest release version
- Builds (releases + nightly versions)
To compile a contract
await solidityCompiler({
version: `https://binaries.soliditylang.org/bin/${version}`,
contractBody: content,
options,
})
| Name | Type | Required | Default |
|---|---|---|---|
| version | string |
Yes | |
| contractBody | string |
Yes | |
| options | object |
No | { } |
The options parameter currently ONLY supports the choice to add optimization
options.optimizer = {
enabled: boolean,
runs: number,
}
Related Packages
@framit/meta-pixel
Simple, framework agnostic and GDPR Compliance library to track data to Meta Pix...
15,362
5
@homedia/meta-pixel
Simple, framework agnostic and GDPR Compliance library to track data to Meta Pix...
2,521
@dlhsoft/ganttcharthyperlibrary
Gantt Chart library for JavaScript and TypeScript with Angular, React, and Vue e...
2,650
2
Version History
| Version | Released | License |
|---|---|---|
| 0.2.0 | ISC | |
| 0.1.1 | ISC | |
| 0.1.0 | ISC |