Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eth-rpc-errors

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-rpc-errors - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

dist/classes.d.ts

44

CHANGELOG.md

@@ -8,9 +8,25 @@ # Changelog

## [3.0.0]
## [Unreleased]
## [4.0.0] - 2020-11-02
### Changed
- Second argument of `serializeError` is now an options object ([#22](https://github.com/MetaMask/eth-rpc-errors/pull/22))
- **BREAKING:** `ERROR_CODES` export renamed to `errorCodes` ([#28](https://github.com/MetaMask/eth-rpc-errors/pull/28))
- **BREAKING:** `ethErrors` getters will now throw an error if passed a truthy, non-string `message` ([#28](https://github.com/MetaMask/eth-rpc-errors/pull/28))
- Updated TypeScript types for all exports ([#28](https://github.com/MetaMask/eth-rpc-errors/pull/28))
## [3.0.0] - 2020-07-29
### Changed
- **BREAKING:** Second argument of `serializeError` is now an options object ([#22](https://github.com/MetaMask/eth-rpc-errors/pull/22))
- Error stacks are no longer serialized by default by `serializeError` ([#22](https://github.com/MetaMask/eth-rpc-errors/pull/22))
## [2.1.1] - 2020-05-12
### Changed
- Prevent unnecessary files from being published ([#17](https://github.com/MetaMask/eth-rpc-errors/pull/17))
## [2.1.0] - 2020-05-11

@@ -31,4 +47,16 @@

## [2.0.0]
## [2.0.2] - 2020-02-12
### Changed
- Fix faulty null checks throughout codebase ([764832d](https://github.com/MetaMask/eth-rpc-errors/commit/764832d777f9274ca5bb9a6efa6958db2b640952))
## [2.0.1] - 2020-01-31
### Added
- Error codes in docstrings ([5452001](https://github.com/MetaMask/eth-rpc-errors/commit/545200100af05aeade62ba6b736f5080a6891bc4))
## [2.0.0] - 2019-09-26
- **Exports**

@@ -62,3 +90,3 @@ - `errors` renamed `ethErrors`

## [1.1.0]
## [1.1.0] - 2019-09-16

@@ -69,1 +97,9 @@ - `serializeError`

creating the returned serialized error object
[Unreleased]:https://github.com/MetaMask/controllers/compare/v4.0.0...HEAD
[4.0.0]:https://github.com/MetaMask/controllers/compare/v3.0.0...v4.0.0
[3.0.0]:https://github.com/MetaMask/controllers/compare/v2.1.1...v3.0.0
[2.1.1]:https://github.com/MetaMask/controllers/compare/v2.1.0...v2.1.1
[2.1.0]:https://github.com/MetaMask/controllers/compare/v2.0.2...v2.1.0
[2.0.2]:https://github.com/MetaMask/controllers/compare/v2.0.1...v2.0.2
[2.0.1]:https://github.com/MetaMask/controllers/compare/v2.0.0...v2.0.1

31

package.json
{
"name": "eth-rpc-errors",
"version": "3.0.0",
"version": "4.0.0",
"description": "Ethereum RPC and Provider errors.",

@@ -8,13 +8,12 @@ "license": "MIT",

"scripts": {
"build": "echo",
"test": "node test",
"test:coverage": "nyc tape test",
"lint": "eslint . --ext js,json",
"lint:fix": "eslint . --ext js,json --fix"
"build": "tsc",
"test": "yarn build && node test",
"test:coverage": "yarn build && nyc tape test",
"lint": "eslint . --ext ts,js,json",
"lint:fix": "eslint . --ext ts,js,json --fix",
"prepublishOnly": "yarn test"
},
"main": "index.js",
"main": "dist/index.js",
"files": [
"@types",
"index.js",
"src"
"dist"
],

@@ -25,9 +24,13 @@ "dependencies": {

"devDependencies": {
"@metamask/eslint-config": "^2.1.1",
"eslint": "6.8.0",
"eslint-plugin-import": "^2.20.2",
"@metamask/eslint-config": "^4.1.0",
"@typescript-eslint/eslint-plugin": "^4.6.0",
"@typescript-eslint/parser": "^4.6.0",
"eslint": "^7.12.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-json": "^2.1.1",
"eslint-plugin-node": "^11.1.0",
"fast-deep-equal": "^2.0.1",
"nyc": "^15.0.1",
"tape": "^5.0.0"
"tape": "^5.0.0",
"typescript": "^4.0.5"
},

@@ -34,0 +37,0 @@ "bugs": {

@@ -22,7 +22,7 @@ # eth-rpc-errors

- Ethereum JSON RPC
- Per [EIP 1474](https://eips.ethereum.org/EIPS/eip-1474#error-codes)
- Per [EIP-1474](https://eips.ethereum.org/EIPS/eip-1474#error-codes)
- This includes all
[JSON RPC 2.0 errors](https://www.jsonrpc.org/specification#error_object)
- Ethereum Provider errors
- Per [EIP 1193](https://eips.ethereum.org/EIPS/eip-1193#provider-errors)
- Per [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193#provider-errors)
- Does **not** yet support [`CloseEvent` errors or status codes](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes).

@@ -121,5 +121,5 @@

/**
* getMessageFromCode & ERROR_CODES
* getMessageFromCode and errorCodes
*/
import { getMessageFromCode, ERROR_CODES } from 'eth-rpc-errors'
import { getMessageFromCode, errorCodes } from 'eth-rpc-errors'

@@ -139,6 +139,6 @@ // get the default message string for the given code, or a fallback message if

// }
const code1 = ERROR_CODES.rpc.parse
const code2 = ERROR_CODES.provider.userRejectedRequest
const code1 = errorCodes.rpc.parse
const code2 = errorCodes.provider.userRejectedRequest
// all codes in ERROR_CODES have default messages
// all codes in errorCodes have default messages
const message4 = getMessageFromCode(code1)

@@ -145,0 +145,0 @@ const message5 = getMessageFromCode(code2)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc