Skip to content

Commit 35f6c0a

Browse files
authored
Rename to @metamask/rpc-errors (#67)
1 parent dad0ffa commit 35f6c0a

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# eth-rpc-errors
1+
# `@metamask/rpc-errors`
22

3-
Ethereum RPC errors, including for
3+
JSON-RPC errors, including for
44
[Ethereum JSON RPC](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1474.md)
55
and
66
[Ethereum Provider](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1193.md),
@@ -11,7 +11,7 @@ and [making unknown errors compliant with either spec](#parsing-unknown-errors).
1111
In TypeScript or JavaScript:
1212

1313
```js
14-
import { ethErrors } from 'eth-rpc-errors'
14+
import { ethErrors } from '@metamask/rpc-errors'
1515

1616
throw ethErrors.provider.unauthorized()
1717
// or
@@ -30,7 +30,7 @@ throw ethErrors.provider.unauthorized('my custom message')
3030

3131
## Usage
3232

33-
Installation: `npm install eth-rpc-errors` or `yarn add eth-rpc-errors`
33+
Installation: `npm install @metamask/rpc-errors` or `yarn add @metamask/rpc-errors`
3434

3535
`import` or `require` as normal (no default export).
3636

@@ -45,7 +45,7 @@ yarn test
4545
### Errors API
4646

4747
```js
48-
import { ethErrors } from 'eth-rpc-errors'
48+
import { ethErrors } from '@metamask/rpc-errors'
4949

5050
// Ethereum RPC errors are namespaced under "ethErrors.rpc"
5151
response.error = ethErrors.rpc.methodNotFound({
@@ -88,7 +88,7 @@ response.error = ethErrors.provider.custom({
8888

8989
```js
9090
// this is useful for ensuring your errors are standardized
91-
import { serializeError } from 'eth-rpc-errors'
91+
import { serializeError } from '@metamask/rpc-errors'
9292

9393
// if the argument is not a valid error per any supported spec,
9494
// it will be added as error.data.originalError
@@ -114,12 +114,12 @@ response.error = serializeError(maybeAnError, fallbackError)
114114
/**
115115
* Classes
116116
*/
117-
import { EthereumRpcError, EthereumProviderError } from 'eth-rpc-errors'
117+
import { EthereumRpcError, EthereumProviderError } from '@metamask/rpc-errors'
118118

119119
/**
120120
* getMessageFromCode and errorCodes
121121
*/
122-
import { getMessageFromCode, errorCodes } from 'eth-rpc-errors'
122+
import { getMessageFromCode, errorCodes } from '@metamask/rpc-errors'
123123

124124
// get the default message string for the given code, or a fallback message if
125125
// no message exists for the given code

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@metamask/eth-rpc-errors",
2+
"name": "@metamask/rpc-errors",
33
"version": "4.0.3",
44
"description": "Ethereum RPC and Provider errors.",
55
"author": "Erik Marks <[email protected]>",

yarn.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ __metadata:
305305
languageName: node
306306
linkType: hard
307307

308-
"@metamask/eth-rpc-errors@workspace:.":
308+
"@metamask/rpc-errors@workspace:.":
309309
version: 0.0.0-use.local
310-
resolution: "@metamask/eth-rpc-errors@workspace:."
310+
resolution: "@metamask/rpc-errors@workspace:."
311311
dependencies:
312312
"@lavamoat/allow-scripts": ^2.0.3
313313
"@metamask/auto-changelog": ^2.3.0

0 commit comments

Comments
 (0)