1.1.6 • Published 3 years ago

@tdos/protocoljs v1.1.6

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago
// 1. create contract
const { FARM_ABI, farmContract } = require('@tdos/mazejs/dist')
const { Contract } = require('ethers') // import ethers version >= 5

// 2. create contract 
const u = `http://${process.env.HOST}:${process.env.PORT}` // jsonrpc provider
const provider = new providers.JsonRpcProvider(u)

const wallet = new Wallet(process.env.PRIVATE_KEY, provider) // wallet
const c = farmContract(new Contract('0x', FARM_ABI, wallet)) 

// 3. query

c.getMineParams().then(console.log)