{"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"bf6a320ab762c71ca8ddc789f358648b53aec77c","tarball":"https://registry.npmjs.org/@ethereum-waffle/provider/-/provider-4.0.0-alpha.19.tgz","fileCount":6,"integrity":"sha512-XU2yAR5cxd3bWePKSD/N5Ez+O2lGA+ly/5c2XYS8tQbKIUQ3v30QTjZE26xo/N3rXCrsGd1Yj0+xONKWGl+Vbg==","signatures":[{"sig":"MEQCIGhV8yMnoRoHSxZGSwIguPuOFMBIq1cAfcK4LWW003+PAiBceOis4WQCdOGQjwM30cdQ71JASxFDIZisBIHA+75YJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":10585,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVqt2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmokmBAAlPin/Qua98k4hHo8GNffvM0gx1WBi5F1XnsahKVh9cvsbOgP\r\nYjiKDysCqnfpA63M/UX/fZ/jCYQBKigGigavoYVJGFc4kSbv9R9fa7cR72y+\r\nX8wX9fzKSA+JlLTRFh6zvavP3YBJIXJ3KbPAzLQR6+EmzZEnkEH9QrI0OdUZ\r\n0RAhY6YILe786lOBtlVSNkVRqPvV6gH9PV5SrG/vuHaTkc8OHolZCwQofY5S\r\nCxCOk0Wi2AFnDHhNDINPJEhQ2AYcGhZaQIhdleY5RG1wS8A1y5Kvc/GT2le4\r\ngcXYn4jlJGuDx5QNfevU3tM+DLNHZkQ0vQE8hgS2dc5LeasCGNTtRPzAkveY\r\nDkOZC8mQozuVulBeUryvzusVS0ipWI2DVVMkC975S4JToKv3NFDGhoG6xDSD\r\nm/oCLqROv7MHTqxGUV7jNgf8Ax63H4rB5K++XGg/zlEaECSnTbRbOBVncpcL\r\nUYJvwTmVYAaVcgRaCia4O6pYxqxRHgd3T/GARoeQX/EFwssFSn3zUIbB7xX2\r\nmHevgat4bDsH7NKG7NE2ngaj6ZDr1Ioj6bLxjXrqGzkW22QGf+uyDXuE0KT/\r\nnWbuKWUZqAahEifU3bfibEj9nLo3Mj56DVpc8BYdLO591is21eHXPlDJpNuF\r\nwavPtGPKj387ZUxCacBfHNJyh1M0QMh+Mws=\r\n=BAgg\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/index.js","name":"@ethereum-waffle/provider","_from":"file:ethereum-waffle-provider-4.0.0-alpha.19.tgz","types":"dist/esm/index.d.ts","author":"Marek Kirejczyk <account@ethworks.io> (http://ethworks.io)","module":"dist/esm/index.ts","readme":"![CI](https://github.com/EthWorks/Waffle/workflows/CI/badge.svg)\n[![](https://img.shields.io/npm/v/@ethereum-waffle/provider.svg)](https://www.npmjs.com/package/@ethereum-waffle/provider)\n\n![Ethereum Waffle](https://raw.githubusercontent.com/EthWorks/Waffle/master/docs/source/logo.png)\n\n# @ethereum-waffle/provider\n\nA mock provider for your blockchain testing needs.\n\n## Installation\n\nIn the current version of waffle (v2.x.x) you will install this package as a dependency of the main waffle package - `ethereum-waffle`.\n\n```\nyarn add --dev ethereum-waffle\nnpm install --save-dev ethereum-waffle\n```\n\nIf you want to use this package directly please install it via:\n```\nyarn add --dev @ethereum-waffle/provider\nnpm install --save-dev @ethereum-waffle/provider\n```\n\n## Feature overview\n\n**NOTE**: You do not need to use this package directly. You can install it through the main package (`ethereum-waffle`) and use it instead.\n\n### MockProvider\n\nThe `MockProvider` class is the main way of interacting with the blockchain in your waffle tests.\n\nIt wraps `ganache-core` in an `ethers` provider and extends it with useful functionality.\n\nYou can learn more about it [in the documentation](https://ethereum-waffle.readthedocs.io/en/latest/basic-testing.html).\n\n### Usage\n\nExamples of creating `MockProvider` and usage `getWallets` function:\n```ts\nimport {expect} from 'chai';\nimport {MockProvider} from '@ethereum-waffle/provider';\n\ndescribe('waffle tests', async () => {\n  it('wallets have non-zero balance', async () => {\n    const provider = new MockProvider();\n    const wallets = provider.getWallets();\n    const balance = await wallets[0].getBalance();\n    expect(balance.gt(0)).to.equal(true)\n  })\n})\n```\n\nUse `setupENS` function to set up your `ens` and setting ens address to the provider's networks. The function accepts\nthe `wallet` as an argument, and if you call it without an argument, it will use the last `wallet` from `MockProvider`.\n\n```ts\nimport {expect} from 'chai';\nimport {MockProvider} from '@ethereum-waffle/provider';\ndescribe('waffle tests', async () => {\n  it('setup ens', async () => {\n    const provider = new MockProvider();\n    await provider.setupENS();\n    expect(provider.network.ensAddress).to.eq(provider.ens.ens.address);\n  });\n});\n```\n\n\n### Fixtures\n\nFixtures are an advanced concept that you can use to make your tests run faster. They take advantage of the snapshot mechanism in Ganache.\n\nYou can learn more about it [in the documentation](https://ethereum-waffle.readthedocs.io/en/latest/fixtures.html).\n\n### Legacy API\n\n- `createMockProvider` - this was the old way to construct a MockProvider instance\n- `getGanacheOptions` - previously it was possible to load the options from the waffle config file\n- `getWallets` - this was the old way to get wallets from a provider\n","engines":{"node":">=10.0"},"license":"MIT","private":false,"scripts":{"lint":"eslint '{src,test}/**/*.ts'","test":"mocha","build":"rimraf ./dist && yarn build:esm && yarn build:cjs","lint:fix":"eslint --fix '{src,test}/**/*.ts'","build:cjs":"tsc -p tsconfig.build.json --outDir dist/cjs --declaration false","build:esm":"tsc -p tsconfig.build.json --outDir dist/esm --module ES6"},"_npmUser":{"name":"ethworks","email":"account@ethworks.io"},"homepage":"https://github.com/EthWorks/Waffle","keywords":["ethereum","smart-contracts","solidity","testing","javascript","typescript","library"],"_resolved":"/home/runner/work/Waffle/Waffle/waffle-provider/ethereum-waffle-provider-4.0.0-alpha.19.tgz","_integrity":"sha512-XU2yAR5cxd3bWePKSD/N5Ez+O2lGA+ly/5c2XYS8tQbKIUQ3v30QTjZE26xo/N3rXCrsGd1Yj0+xONKWGl+Vbg==","repository":"git@github.com:EthWorks/Waffle.git","_npmVersion":"8.5.0","description":"A mock provider for your blockchain testing needs.","directories":{},"maintainers":[{"name":"ethworks","email":"account@ethworks.io"}],"resolutions":{"web3":"1.2.4"},"_nodeVersion":"16.14.2","dependencies":{"debug":"^4.3.4","ethers":"5.6.1","ganache":"7.0.3","@ethereum-waffle/ens":"4.0.0-alpha.19","@ganache/ethereum-options":"0.1.4"},"publishConfig":{"tag":"alpha","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/debug":"^4.1.7"},"_npmOperationalInternal":{"tmp":"tmp/provider_4.0.0-alpha.19_1649847157919_0.7780197673193163","host":"s3://npm-registry-packages"},"_id":"@ethereum-waffle/provider@4.0.0-alpha.19","version":"4.0.0-alpha.19"}