dapphub / dpack

simple lockfile for your dapp's addresses and artifacts
46 stars 9 forks source link

Improve basic usage #28

Closed nmushegian closed 2 years ago

nmushegian commented 2 years ago

In current readme:

const dpack = require('dpack');
const my_pack = require('./packs/my_pack.dpack.json')
const dapp = dpack.Dapp.loadFromJson(my_pack);  // also have loadFromFile, loadFromCID

dapp.objects // all instantiated contract *objects* from this pack
dapp.types   // all artifacts plus ethers.js 'factories'; JS-level objects that deploy new instances of contracts

await dapp.objects.WETH.wrap(...)

could be:

const dpack = require('dpack')
const dapp = await dpack.load('./pack/weth_ethereum.dpack.json')
await dapp.weth.wrap(...)  // objects on top-level dapp object. types in `_types`.