{"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"2d4ba578e3a376a42ed9c5449049423af4bb4062","tarball":"https://registry.npmjs.org/@ethereum-waffle/provider/-/provider-4.0.0-alpha.23.tgz","fileCount":31,"integrity":"sha512-HSeZx4kNRlzWhgUZ4oTeDSvaU4I+y1nokZUW80YaxmQVdmaFTq9J7z632Wn/95YPNW+4+Dt/VtUWkqs1cg5L4A==","signatures":[{"sig":"MEYCIQC+1Zetm9tznLNXgHrlBX/kSkH76HpiQan/KEuVkintdAIhAPui1nU7RS+ZtQZHVcADy0AB+a6+uyjf85jEaO3sZBIw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":64532,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidOeHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGVQ//dNeZv2OOs+Tk2DI/LqhXV5fijGdGIwqQaJYZyf33s8DNT0LA\r\njkvRCSUZHc+rjadgFkPMhcvaYGa55cOovJ+JrIjpaDfaUyMZ3O0qy97/bMJk\r\n/DJGW7ls1h6wroqbQi4sTxH01UlVBl0RKk3ipwVURtra47dKQbqY29pk4rtN\r\nyMy86LeWjgvit1D/S3JjG+G9AhHrMD2gqn0ZFC+Ib+Ly0y7wusU9SvSdFztO\r\nwdS/Bsc6c3wyjdMD5/bMJXIZQIqLwB1ve7oKGFyV6h9hsGFcjPlE0prnFM8b\r\nbS0FsfigDKSKOHr/K49aCFICIgZttYroEikuAWfZLNiVgZRmX8/bwuXQYZUx\r\n30WcRdJlseDfvxn4fqzm8/ZVWQsDu5zDTZWTtMn6+CDwjN7wF52yAQXWaMD9\r\nlbdbzLO65NYGo0cBB10ccAHqzzaIbRRhmaiDSlvy90H9ioYhUP3YU1SDsvD1\r\n5dfXWbnXWsLjUyeGJVbKDsVoftpXbYgty294G8cAInA0+eqklFm9HWuurTOD\r\n3DfS0LDMuByQQaCupGCk/cM8F+9iVUyamc1yF8tKvdfE1spk0ZuejCJHyDHP\r\nZMhVVd7GDxuFgO+heyA9MkgEAvmFGHYUIMvI96I/kYHs1UTaBjJJ1/jib3Zf\r\nxRR7UfUb3UT5eIl4ROulbUu3fbt8qh9/7Js=\r\n=9Fvv\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.23.tgz","types":"dist/esm/index.d.ts","author":{"url":"http://ethworks.io","name":"Marek Kirejczyk","email":"account@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.23.tgz","_integrity":"sha512-HSeZx4kNRlzWhgUZ4oTeDSvaU4I+y1nokZUW80YaxmQVdmaFTq9J7z632Wn/95YPNW+4+Dt/VtUWkqs1cg5L4A==","repository":{"url":"git+ssh://git@github.com/EthWorks/Waffle.git","type":"git"},"_npmVersion":"8.5.5","description":"A mock provider for your blockchain testing needs.","directories":{},"maintainers":[{"name":"ethworks","email":"account@ethworks.io"}],"resolutions":{"web3":"1.2.4"},"_nodeVersion":"16.15.0","dependencies":{"debug":"^4.3.4","ethers":"5.6.2","ganache":"7.0.3","@ethereum-waffle/ens":"4.0.0-alpha.21","@ganache/ethereum-options":"0.1.4"},"publishConfig":{"tag":"alpha","access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^8.2.1","eslint":"^7.14.0","rimraf":"^3.0.2","typescript":"^4.6.2","@types/debug":"^4.1.7"},"_npmOperationalInternal":{"tmp":"tmp/provider_4.0.0-alpha.23_1651828615418_0.698997512712257","host":"s3://npm-registry-packages"},"_id":"@ethereum-waffle/provider@4.0.0-alpha.23","version":"4.0.0-alpha.23"}