{"bugs":{"url":"https://github.com/EthWorks/Waffle/issues"},"dist":{"shasum":"d34e55108f4412144d9887aed787785517a4efa5","tarball":"https://registry.npmjs.org/@ethereum-waffle/provider/-/provider-4.0.5-dev.4946c9b.tgz","fileCount":77,"integrity":"sha512-cy0Ws0V2Oq0XH5VVbd7CyKXPN6r0M4NNeyHuvoMHrcUjBfd750XkUmG/Le0S+6VGm8L2gcGZLkmGBMloovYHbw==","signatures":[{"sig":"MEUCIQD8VL4s82hla5yk02xcEBwlKvPxabBlGaiypkR976hCCAIgPoN2zwHwR9lUf3+T0Bjbzpc3noPpRJFYi9E/HOYVI/s=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":251194,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbRH+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmriYw//UdviT086ENIpsDJpoy/3Q1vWE8VOaCIRYpuy9NY9jwTzPEaI\r\nZPXzHkk3XdsTvxssYoRa76qN7OZzCto4+N8hylqjWuTpFaGYBTRmB3SPUzcr\r\nDOAapV/ePM57MpCb0s6PLE83xE3xEtmS56kkMRJq1AJ2/AV3suqVeaOyRlRq\r\nIfW7OepvcWWTm5d9usWA9qRKAxUotpYdJBTH4oZW+JdEECSSAi5N7poLaxPV\r\n3kN1evSfS8qMzHMjcWlPypt6WcO4YDspg/Sz4R96VLFcK5dUOu54ixEXMZS6\r\n6VykqkoEX8rVcjT+Lb8QdZ3TiPGtr7Sm0NSvAWD8c6GlBSwin2QGEik251hM\r\n45m9cpryhMaoy7f7yRqXc3z9zF5MmXjAJ8Exp23/2jyedN5DH4uAmqX59Ocy\r\n30vJrJ5o15L5J88ZSVfcBmu+XqZunZoe9TWKTLkmHx3E7mixzlgAfhWjpQOP\r\nIZF2Ec/xnN6DI+VFc8yxZrg+tyoKp7pzG//xq/pdP2fINSerBx69BN2U38Uy\r\nQIru0PqBJd8zNbaKyp6dN33pm77ABwH/x/9iymCI4BruCdqQDwvyqA22iuXM\r\nB4r4XPf3pym8CIdcynLqsqP/jUkWkLZCkVSqr/X928Yt9mx72xivYTqXrEm4\r\nBVQ4jf9RLyWBBi65rhgHuc2LuGX1Rvyf+S4=\r\n=Hm22\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/cjs/src/index.js","name":"@ethereum-waffle/provider","_from":"file:ethereum-waffle-provider-4.0.5-dev.4946c9b.tgz","types":"dist/esm/src/index.d.ts","author":{"url":"http://ethworks.io","name":"Marek Kirejczyk","email":"account@ethworks.io"},"module":"dist/esm/src/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","build:esm":"tsc -p tsconfig.build.json --outDir dist/esm --module ES6"},"_npmUser":{"name":"ethworks","email":"code@trusttoken.com"},"homepage":"https://github.com/EthWorks/Waffle","keywords":["ethereum","smart-contracts","solidity","testing","javascript","typescript","library"],"_resolved":"/tmp/689709b2000e6cf4fc37e3d25d7b2432/ethereum-waffle-provider-4.0.5-dev.4946c9b.tgz","_integrity":"sha512-cy0Ws0V2Oq0XH5VVbd7CyKXPN6r0M4NNeyHuvoMHrcUjBfd750XkUmG/Le0S+6VGm8L2gcGZLkmGBMloovYHbw==","repository":{"url":"git+ssh://git@github.com/EthWorks/Waffle.git","type":"git"},"_npmVersion":"8.19.2","description":"A mock provider for your blockchain testing needs.","directories":{},"maintainers":[{"name":"ethworks","email":"code@trusttoken.com"}],"resolutions":{"web3":"1.2.4"},"_nodeVersion":"16.18.0","dependencies":{"debug":"^4.3.4","ganache":"7.4.3","@ethereum-waffle/ens":"4.0.3-dev.4946c9b","@ganache/ethereum-options":"0.1.4"},"publishConfig":{"tag":"dev","access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mocha":"^8.2.1","eslint":"^7.14.0","ethers":"5.6.2","rimraf":"^3.0.2","typescript":"^4.6.2","@types/debug":"^4.1.7"},"peerDependencies":{"ethers":"*"},"_npmOperationalInternal":{"tmp":"tmp/provider_4.0.5-dev.4946c9b_1668092414391_0.5834199844162142","host":"s3://npm-registry-packages"},"_id":"@ethereum-waffle/provider@4.0.5-dev.4946c9b","version":"4.0.5-dev.4946c9b"}