{
	"name": "eth-rpc-errors",
	"versions": {
		"2.1.0": {
			"name": "eth-rpc-errors",
			"version": "2.1.0",
			"description": "Ethereum RPC and Provider errors.",
			"main": "index.js",
			"scripts": {
				"build": "echo",
				"test": "node test",
				"test:coverage": "nyc tape test",
				"lint": "eslint . --ext js,json",
				"lint:fix": "eslint . --ext js,json --fix"
			},
			"repository": {
				"type": "git",
				"url": "git+https://github.com/MetaMask/eth-rpc-errors.git"
			},
			"keywords": [
				"rpc",
				"ethereum",
				"errors",
				"utility"
			],
			"author": {
				"name": "Erik Marks",
				"email": "rekmarks@protonmail.com"
			},
			"license": "MIT",
			"bugs": {
				"url": "https://github.com/MetaMask/eth-rpc-errors/issues"
			},
			"homepage": "https://github.com/MetaMask/eth-rpc-errors#readme",
			"devDependencies": {
				"@metamask/eslint-config": "^2.1.1",
				"eslint": "6.8.0",
				"eslint-plugin-import": "^2.20.2",
				"eslint-plugin-json": "^2.1.1",
				"fast-deep-equal": "^2.0.1",
				"nyc": "^15.0.1",
				"tape": "^5.0.0"
			},
			"dependencies": {
				"fast-safe-stringify": "^2.0.6"
			},
			"gitHead": "1275c426989376fd0f713b70736d754d5ab59afc",
			"_id": "eth-rpc-errors@2.1.0",
			"_nodeVersion": "10.16.0",
			"_npmVersion": "6.9.0",
			"dist": {
				"integrity": "sha512-ZAoVPVfNF9tnuxw9/sOnmFky8scwUcUwjh00s88AF0yScz/3ot1Hsv8shjpwFgtph6+k8vjVE+qNYrVB077FtA==",
				"shasum": "05c68c52a0bb4cefa14e2c42b3269f5ed0c074ae",
				"tarball": "https://registry.npmjs.org/eth-rpc-errors/-/eth-rpc-errors-2.1.0.tgz",
				"fileCount": 20,
				"unpackedSize": 42751,
				"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeug20CRA9TVsSAnZWagAAIkMP/0yAj2rSOEGMUuRCQLs7\npWJIheGErjAztaSCEm7kCQQr+XA93MA/pk3AkhX6uliGJqP8VKjvC0q4K8Hb\nRhmgz132uwXz0Wxoqbx+2tCPEzBMK6XD2ky95tnrADwuOVI0KWXffFtXghLB\n//RWnF1ieY42gFpTySiAG1XRIr/9t0575LOlvqtyZoZM8YeNDhh8RkG76kq1\n0/T0fV72BTHSKuC8X5SmwLF6STcRjE7VZxYJCgdzU+Drq706Tn/kX1iamqms\ndAztmomW/a9FKgDo4pyj+91JTQJu5LvqpjOfwo9GJSG/Xan7sikAarj/Sz+O\nUsRvQBZRzuyJRoptL24o3cLSASca4AKC/LscGK9pDAwVIXP0LQztxZ8aBivG\na41lj9zowMCFjMAe43vcpv1Mk2bf+krxTXjvf8pfZ5VSmI5GPx9iQ3sWM78P\nqE0zLSWZ8wtNvvvN6aXaNxmyit/P8RcUA10rkSJ2TRx1VSG0ioyMB9aq7uoP\noX/obgi6juFL3lMnFTvIG9V79U1RKqL2OkZXSxe2pPBFgnP5LqDxuwsTqkm+\nAA6mKHN8dh62wALB1fFQ7SdyC/0dyaWh6ICTzDFlxLwK2YrhLk4+iGXrq+zp\nWQ1+XUy89q0FDbrNYihuquA2PPAKuES+CIuQXgKwchFQhk0yNaFfOcEL6itZ\nJVBV\r\n=DLGf\r\n-----END PGP SIGNATURE-----\r\n"
			},
			"maintainers": [
				{
					"name": "rekmarks",
					"email": "rekmarks@protonmail.com"
				}
			],
			"_npmUser": {
				"name": "rekmarks",
				"email": "rekmarks@protonmail.com"
			},
			"directories": {},
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/eth-rpc-errors_2.1.0_1589251508007_0.24284183909754087"
			},
			"_hasShrinkwrap": false,
			"contributors": []
		},
		"2.1.1": {
			"name": "eth-rpc-errors",
			"version": "2.1.1",
			"description": "Ethereum RPC and Provider errors.",
			"license": "MIT",
			"author": {
				"name": "Erik Marks",
				"email": "rekmarks@protonmail.com"
			},
			"scripts": {
				"build": "echo",
				"test": "node test",
				"test:coverage": "nyc tape test",
				"lint": "eslint . --ext js,json",
				"lint:fix": "eslint . --ext js,json --fix"
			},
			"main": "index.js",
			"dependencies": {
				"fast-safe-stringify": "^2.0.6"
			},
			"devDependencies": {
				"@metamask/eslint-config": "^2.1.1",
				"eslint": "6.8.0",
				"eslint-plugin-import": "^2.20.2",
				"eslint-plugin-json": "^2.1.1",
				"fast-deep-equal": "^2.0.1",
				"nyc": "^15.0.1",
				"tape": "^5.0.0"
			},
			"bugs": {
				"url": "https://github.com/MetaMask/eth-rpc-errors/issues"
			},
			"homepage": "https://github.com/MetaMask/eth-rpc-errors#readme",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/MetaMask/eth-rpc-errors.git"
			},
			"keywords": [
				"rpc",
				"ethereum",
				"errors",
				"utility"
			],
			"gitHead": "e5f4991f43c9caafb7886007689865f4474c41f3",
			"_id": "eth-rpc-errors@2.1.1",
			"_nodeVersion": "10.16.0",
			"_npmVersion": "6.9.0",
			"dist": {
				"integrity": "sha512-MY3zAa5ZF8hvgQu1HOF9agaK5GgigBRGpTJ8H0oVlE0NqMu13CW6syyjLXdeIDCGQTbUeHliU1z9dVmvMKx1Tg==",
				"shasum": "00a7d6c8a9c864a8ab7d0356be20964e5bee4b13",
				"tarball": "https://registry.npmjs.org/eth-rpc-errors/-/eth-rpc-errors-2.1.1.tgz",
				"fileCount": 11,
				"unpackedSize": 29810,
				"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeuq2yCRA9TVsSAnZWagAA2wsP/3oZ0rWh1A+EInVxCE0B\n8Nv4ZKU87ryoe6iPyajknb+w/Uxsl3yrSBRLu7eyxo6iUjqle4HWXMOEpBWM\nzVWyaaht8qnmCR7KTy980O08xVqXjrlvcROpvV1r8iiXMRy/pyULixruS5zq\n/nFbwvb2rg1lVLer9zzsy1NqKpoF+FIdxqEL4F8zedhIklUyAtdbT0y9c2Er\ndsasqE6zCMnGSDToCHFaAFDXnYejVeCOynC7vfDkWHZAjbWzZY4ph1MW2zIV\ns0geKUAI6liAdIuZYFYD+QHB5sWj+9zFLM7lsmFkcOrcC3C7+Dru83HnCkRC\nJYk1jVfbP+O0tYNtSt7VPo3nqxCd2VeFuGFDA6olrSXdOTXa5gZOoTbnM7uC\nJ78p+oADKXkirQYqHwjQoaKYeTsJYVtq/ujhBsWAqCYk0uLj8cXiHpnpgud8\nC5HDalboM6dO+6e/UCjsemr8a2zNcA/nFk+bL/rdWBm1Dyvi1+IX40BIrk/H\nK9bkam9PCSI+5RZ8Xqv2KZnRRMvWU5D3Nt5x4G65w8z7/VWCkKDSGj16YbKG\nKRg/3aPqmuY/v84u7wNYLAPp2s4mFHbY7rtJDFjbxytZIlrlfUC63TnktYDF\nzVLttKkqWPNiaCWq8vCEbOHerchwzwya5mN3jAglbq6ccHNyGjGN5Ws2i/ly\nSe19\r\n=6CGl\r\n-----END PGP SIGNATURE-----\r\n"
			},
			"maintainers": [
				{
					"name": "rekmarks",
					"email": "rekmarks@protonmail.com"
				}
			],
			"_npmUser": {
				"name": "rekmarks",
				"email": "rekmarks@protonmail.com"
			},
			"directories": {},
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/eth-rpc-errors_2.1.1_1589292465670_0.576338135247451"
			},
			"_hasShrinkwrap": false,
			"contributors": []
		},
		"3.0.0": {
			"name": "eth-rpc-errors",
			"version": "3.0.0",
			"description": "Ethereum RPC and Provider errors.",
			"license": "MIT",
			"author": {
				"name": "Erik Marks",
				"email": "rekmarks@protonmail.com"
			},
			"scripts": {
				"build": "echo",
				"test": "node test",
				"test:coverage": "nyc tape test",
				"lint": "eslint . --ext js,json",
				"lint:fix": "eslint . --ext js,json --fix"
			},
			"main": "index.js",
			"dependencies": {
				"fast-safe-stringify": "^2.0.6"
			},
			"devDependencies": {
				"@metamask/eslint-config": "^2.1.1",
				"eslint": "6.8.0",
				"eslint-plugin-import": "^2.20.2",
				"eslint-plugin-json": "^2.1.1",
				"fast-deep-equal": "^2.0.1",
				"nyc": "^15.0.1",
				"tape": "^5.0.0"
			},
			"bugs": {
				"url": "https://github.com/MetaMask/eth-rpc-errors/issues"
			},
			"homepage": "https://github.com/MetaMask/eth-rpc-errors#readme",
			"repository": {
				"type": "git",
				"url": "git+https://github.com/MetaMask/eth-rpc-errors.git"
			},
			"keywords": [
				"rpc",
				"ethereum",
				"errors",
				"utility"
			],
			"gitHead": "62b5ff7d8aaec0388b1a89c67f44bdfc41e2e78b",
			"_id": "eth-rpc-errors@3.0.0",
			"_nodeVersion": "10.18.1",
			"_npmVersion": "6.13.4",
			"dist": {
				"integrity": "sha512-iPPNHPrLwUlR9xCSYm7HHQjWBasor3+KZfRvwEWxMz3ca0yqnlBeJrnyphkGIXZ4J7AMAaOLmwy4AWhnxOiLxg==",
				"shasum": "d7b22653c70dbf9defd4ef490fd08fe70608ca10",
				"tarball": "https://registry.npmjs.org/eth-rpc-errors/-/eth-rpc-errors-3.0.0.tgz",
				"fileCount": 11,
				"unpackedSize": 30445,
				"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIgJYCRA9TVsSAnZWagAAONIP+wav+Ng36MyWhQ7ufRly\ncSDGDe/ymRt4aEZrtENXMryiXtlXUM0XP33S2IY8fayCl0HSH3roidIACt72\nCH+OoDbbAN3tRTTy2GMmXeKBMWRPD3aAKWZDJZfLVpq2jxrjLCb5GdNegtmh\nAnvVssdHMOQmKQq+w2MjXJ6mcwqeFoi6anNL7QfEjNh+VNo4ONMa9RNbtv8L\ntjvCUG9ljJJMhd5HN+U+t9YaTtSyncDYCQgt8KhbHMB/Lh0Abx//rmJGGKkR\ngM6HGLSVd5xhgKAaSu6gsoLE2NiDfspg5PMQFex9yl4cFRKEOLNPAbdwiQXn\nPNb1kEyHFEogprzhi1XacCJrs8DCaQWnp0j02OZb2p7NNJSdQc/l26OVPvcv\nSEK71HRU9JVq2rtNmblCxMDuCeaBEhAS7hbX0Wg81GIUIe5b/kGzvgfAr+vx\nzkl6y7K9yzLKEBcE2RQ7oCx4NRClbJMfeLFGBeR4T4fN6Ep8gonCcyG+L2Ak\nJs+MHqKC5U7w6mC7jF3UKzV52I/jgBqCNTJdsIZNm1cLyVmIs4ZRxICZMWda\n3ZuzmDEkSxTzMtUoN0VUoEW6gYK6woUceYHe7rcJj0mhKnFy4IE0yebb+udf\nCyJppO7rTLwJwO3qCvQhP8eC6czwFOZJd28U0E7Fq0Ozmaag2bpupawORO1+\nsxTT\r\n=CAl9\r\n-----END PGP SIGNATURE-----\r\n"
			},
			"maintainers": [
				{
					"name": "rekmarks",
					"email": "rekmarks@protonmail.com"
				}
			],
			"_npmUser": {
				"name": "rekmarks",
				"email": "rekmarks@protonmail.com"
			},
			"directories": {},
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/eth-rpc-errors_3.0.0_1596064344114_0.6718400329957823"
			},
			"_hasShrinkwrap": false,
			"contributors": []
		}
	},
	"time": {
		"created": "2020-05-12T02:45:08.007Z",
		"2.1.0": "2020-05-12T02:45:08.113Z",
		"modified": "2020-07-29T23:12:26.537Z",
		"2.1.1": "2020-05-12T14:07:45.770Z",
		"3.0.0": "2020-07-29T23:12:24.251Z"
	},
	"users": {},
	"dist-tags": {
		"latest": "3.0.0"
	},
	"_uplinks": {
		"npmjs": {
			"etag": "W/\"1e7edc3b21ad5d9900c6abb7c40240bd\"",
			"fetched": 1598370746808
		}
	},
	"_distfiles": {
		"eth-rpc-errors-2.1.0.tgz": {
			"url": "https://registry.npmjs.org/eth-rpc-errors/-/eth-rpc-errors-2.1.0.tgz",
			"sha": "05c68c52a0bb4cefa14e2c42b3269f5ed0c074ae",
			"registry": "npmjs"
		},
		"eth-rpc-errors-2.1.1.tgz": {
			"url": "https://registry.npmjs.org/eth-rpc-errors/-/eth-rpc-errors-2.1.1.tgz",
			"sha": "00a7d6c8a9c864a8ab7d0356be20964e5bee4b13",
			"registry": "npmjs"
		},
		"eth-rpc-errors-3.0.0.tgz": {
			"url": "https://registry.npmjs.org/eth-rpc-errors/-/eth-rpc-errors-3.0.0.tgz",
			"sha": "d7b22653c70dbf9defd4ef490fd08fe70608ca10",
			"registry": "npmjs"
		}
	},
	"_attachments": {},
	"_rev": "13-22636b136973f1eb",
	"_id": "eth-rpc-errors",
	"readme": "# eth-rpc-errors\n\nEthereum RPC errors, including for\n[Ethereum JSON RPC](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md)\nand\n[Ethereum Provider](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md),\nand [making unknown errors compliant with either spec](#parsing-unknown-errors).\n\n## Basic Usage\n\n```js\nimport { ethErrors } from 'eth-rpc-errors'\n\nthrow ethErrors.provider.unauthorized()\n// or\nthrow ethErrors.provider.unauthorized('my custom message')\n```\n\n## Supported Errors\n\n- Ethereum JSON RPC\n  - Per [EIP 1474](https://eips.ethereum.org/EIPS/eip-1474#error-codes)\n    - This includes all\n    [JSON RPC 2.0 errors](https://www.jsonrpc.org/specification#error_object)\n- Ethereum Provider errors\n  - Per [EIP 1193](https://eips.ethereum.org/EIPS/eip-1193#provider-errors)\n    - Does **not** yet support [`CloseEvent` errors or status codes](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes).\n\n## Usage\n\nInstallation: `npm install eth-rpc-errors` or `yarn add eth-rpc-errors`\n\n`import` or `require` as normal (no default export).\n\n### Errors API\n\n```js\nimport { ethErrors } from 'eth-rpc-errors'\n\n// Ethereum RPC errors are namespaced under \"ethErrors.rpc\"\nresponse.error = ethErrors.rpc.methodNotFound({\n  message: optionalCustomMessage, data: optionalData\n})\n\n// Provider errors namespaced under ethErrors.provider\nresponse.error = ethErrors.provider.unauthorized({\n  message: optionalCustomMessage, data: optionalData\n})\n\n// each error getter takes a single \"opts\" argument\n// for most errors, this can be replaced with a single string, which becomes\n// the error message\nresponse.error = ethErrors.provider.unauthorized(customMessage)\n\n// if an error getter accepts a single string, all arguments can be omitted\nresponse.error = ethErrors.provider.unauthorized()\nresponse.error = ethErrors.provider.unauthorized({})\n\n// omitting the message will produce an error with a default message per\n// the relevant spec\n\n// omitting the data argument will produce an error without a\n// \"data\" property\n\n// the JSON RPC 2.0 server error requires a valid code\nresponse.error = ethErrors.rpc.server({\n  code: -32031\n})\n\n// custom Ethereum Provider errors require a valid code and message\n// valid codes are integers i such that: 1000 <= i <= 4999\nresponse.error = ethErrors.provider.custom({\n  code: 1001, message: 'foo'\n})\n```\n\n### Parsing Unknown Errors\n\n```js\n// this is useful for ensuring your errors are standardized\nimport { serializeError } from 'eth-rpc-errors'\n\n// if the argument is not a valid error per any supported spec,\n// it will be added as error.data.originalError\nresponse.error = serializeError(maybeAnError)\n\n// you can add a custom fallback error code and message if desired\nconst fallbackError = { code: 4999, message: 'My custom error.' }\nresponse.error = serializeError(maybeAnError, fallbackError)\n\n// Note: if the original error has a \"message\" property, it will take\n// precedence over the fallback error's message\n\n// the default fallback is:\n{\n  code: -32603,\n  message: 'Internal JSON-RPC error.'\n}\n```\n\n### Other Exports\n\n```js\n/**\n * TypeScript interfaces\n */\nimport {\n  // these describe to the corresponding exports from index.js\n  IEthErrors, IEthereumRpcError, IEthereumProviderError, ISerializeError,\n  // these describe the options argument to error getters in ethErrors\n  IErrorOptions, IRpcServerErrorOptions, IProviderCustomErrorOptions\n} from 'eth-rpc-errors/@types'\n\n/**\n * Classes\n */\nimport { EthereumRpcError, EthereumProviderError } from 'eth-rpc-errors'\n\n/**\n * getMessageFromCode & ERROR_CODES\n */\nimport { getMessageFromCode, ERROR_CODES } from 'eth-rpc-errors'\n\n// get the default message string for the given code, or a fallback message if\n// no message exists for the given code\nconst message1 = getMessageFromCode(someCode)\n\n// you can specify your own fallback message\nconst message2 = getMessageFromCode(someCode, myFallback)\n// it can be anything, use at your own peril\nconst message3 = getMessageFromCode(someCode, null)\n\n// {\n//   rpc: { [errorName]: code, ... },\n//   provider: { [errorName]: code, ... },\n// }\nconst code1 = ERROR_CODES.rpc.parse\nconst code2 = ERROR_CODES.provider.userRejectedRequest\n\n// all codes in ERROR_CODES have default messages\nconst message4 = getMessageFromCode(code1)\nconst message5 = getMessageFromCode(code2)\n```\n\n## License\n\nMIT"
}