0.1.7 • Published 2 years ago
spxd-web3-contract-enum v0.1.7
web3-eth-contract
This is a package to load enums from sol contract using ast object from json build file
Installation
You can install the package using NPM
Using NPM
npm i spxd-web3-contract-enum
Usage
const Web3EthContract = require('web3-eth-contract');
const {loadEnum} = require('spxd-web3-contract-enum')
// Set provider for all later instances to use
Web3EthContract.setProvider('ws://localhost:8546');
const contract = new Web3EthContract(jsonInterface, address);
loadEnum(contract,jsonInterfaceAst);
contract.enums.Enum