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

ox

Package Overview
Dependencies
Maintainers
2
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ox - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

20

_cjs/core/Provider.js

@@ -36,4 +36,4 @@ "use strict";

class UserRejectedRequestError extends ProviderRpcError {
constructor() {
super(4001, 'The user rejected the request.');
constructor({ message = 'The user rejected the request.', } = {}) {
super(4001, message);
Object.defineProperty(this, "name", {

@@ -55,4 +55,4 @@ enumerable: true,

class UnauthorizedError extends ProviderRpcError {
constructor() {
super(4100, 'The requested method and/or account has not been authorized by the user.');
constructor({ message = 'The requested method and/or account has not been authorized by the user.', } = {}) {
super(4100, message);
Object.defineProperty(this, "name", {

@@ -74,4 +74,4 @@ enumerable: true,

class UnsupportedMethodError extends ProviderRpcError {
constructor() {
super(4200, 'The provider does not support the requested method.');
constructor({ message = 'The provider does not support the requested method.', } = {}) {
super(4200, message);
Object.defineProperty(this, "name", {

@@ -93,4 +93,4 @@ enumerable: true,

class DisconnectedError extends ProviderRpcError {
constructor() {
super(4900, 'The provider is disconnected from all chains.');
constructor({ message = 'The provider is disconnected from all chains.', } = {}) {
super(4900, message);
Object.defineProperty(this, "name", {

@@ -112,4 +112,4 @@ enumerable: true,

class ChainDisconnectedError extends ProviderRpcError {
constructor() {
super(4901, 'The provider is not connected to the requested chain.');
constructor({ message = 'The provider is not connected to the requested chain.', } = {}) {
super(4901, message);
Object.defineProperty(this, "name", {

@@ -116,0 +116,0 @@ enumerable: true,

@@ -80,4 +80,8 @@ "use strict";

class InvalidInputError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Missing or invalid parameters.',
...parameters,
code: InvalidInputError.code,
});
Object.defineProperty(this, "code", {

@@ -105,4 +109,8 @@ enumerable: true,

class ResourceNotFoundError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Requested resource not found.',
...parameters,
code: ResourceNotFoundError.code,
});
Object.defineProperty(this, "code", {

@@ -130,4 +138,8 @@ enumerable: true,

class ResourceUnavailableError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Requested resource not available.',
...parameters,
code: ResourceUnavailableError.code,
});
Object.defineProperty(this, "code", {

@@ -155,4 +167,8 @@ enumerable: true,

class TransactionRejectedError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Transaction creation failed.',
...parameters,
code: TransactionRejectedError.code,
});
Object.defineProperty(this, "code", {

@@ -180,4 +196,8 @@ enumerable: true,

class MethodNotSupportedError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Method is not implemented.',
...parameters,
code: MethodNotSupportedError.code,
});
Object.defineProperty(this, "code", {

@@ -205,4 +225,8 @@ enumerable: true,

class LimitExceededError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Rate limit exceeded.',
...parameters,
code: LimitExceededError.code,
});
Object.defineProperty(this, "code", {

@@ -230,4 +254,8 @@ enumerable: true,

class VersionNotSupportedError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'JSON-RPC version not supported.',
...parameters,
code: VersionNotSupportedError.code,
});
Object.defineProperty(this, "code", {

@@ -255,4 +283,8 @@ enumerable: true,

class InvalidRequestError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Input is not a valid JSON-RPC request.',
...parameters,
code: InvalidRequestError.code,
});
Object.defineProperty(this, "code", {

@@ -280,4 +312,8 @@ enumerable: true,

class MethodNotFoundError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Method does not exist.',
...parameters,
code: MethodNotFoundError.code,
});
Object.defineProperty(this, "code", {

@@ -305,4 +341,8 @@ enumerable: true,

class InvalidParamsError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Invalid method parameters.',
...parameters,
code: InvalidParamsError.code,
});
Object.defineProperty(this, "code", {

@@ -330,4 +370,8 @@ enumerable: true,

class InternalError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Internal JSON-RPC error.',
...parameters,
code: InternalError.code,
});
Object.defineProperty(this, "code", {

@@ -355,4 +399,8 @@ enumerable: true,

class ParseError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Failed to parse JSON-RPC response.',
...parameters,
code: ParseError.code,
});
Object.defineProperty(this, "code", {

@@ -359,0 +407,0 @@ enumerable: true,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.version = void 0;
exports.version = '0.2.1';
exports.version = '0.2.2';
//# sourceMappingURL=version.js.map

@@ -31,4 +31,4 @@ import { EventEmitter } from 'eventemitter3';

export class UserRejectedRequestError extends ProviderRpcError {
constructor() {
super(4001, 'The user rejected the request.');
constructor({ message = 'The user rejected the request.', } = {}) {
super(4001, message);
Object.defineProperty(this, "name", {

@@ -50,4 +50,4 @@ enumerable: true,

export class UnauthorizedError extends ProviderRpcError {
constructor() {
super(4100, 'The requested method and/or account has not been authorized by the user.');
constructor({ message = 'The requested method and/or account has not been authorized by the user.', } = {}) {
super(4100, message);
Object.defineProperty(this, "name", {

@@ -69,4 +69,4 @@ enumerable: true,

export class UnsupportedMethodError extends ProviderRpcError {
constructor() {
super(4200, 'The provider does not support the requested method.');
constructor({ message = 'The provider does not support the requested method.', } = {}) {
super(4200, message);
Object.defineProperty(this, "name", {

@@ -88,4 +88,4 @@ enumerable: true,

export class DisconnectedError extends ProviderRpcError {
constructor() {
super(4900, 'The provider is disconnected from all chains.');
constructor({ message = 'The provider is disconnected from all chains.', } = {}) {
super(4900, message);
Object.defineProperty(this, "name", {

@@ -107,4 +107,4 @@ enumerable: true,

export class ChainDisconnectedError extends ProviderRpcError {
constructor() {
super(4901, 'The provider is not connected to the requested chain.');
constructor({ message = 'The provider is not connected to the requested chain.', } = {}) {
super(4901, message);
Object.defineProperty(this, "name", {

@@ -111,0 +111,0 @@ enumerable: true,

@@ -168,4 +168,8 @@ // eslint-disable-next-line jsdoc/require-jsdoc

export class InvalidInputError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Missing or invalid parameters.',
...parameters,
code: InvalidInputError.code,
});
Object.defineProperty(this, "code", {

@@ -193,4 +197,8 @@ enumerable: true,

export class ResourceNotFoundError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Requested resource not found.',
...parameters,
code: ResourceNotFoundError.code,
});
Object.defineProperty(this, "code", {

@@ -218,4 +226,8 @@ enumerable: true,

export class ResourceUnavailableError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Requested resource not available.',
...parameters,
code: ResourceUnavailableError.code,
});
Object.defineProperty(this, "code", {

@@ -243,4 +255,8 @@ enumerable: true,

export class TransactionRejectedError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Transaction creation failed.',
...parameters,
code: TransactionRejectedError.code,
});
Object.defineProperty(this, "code", {

@@ -268,4 +284,8 @@ enumerable: true,

export class MethodNotSupportedError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Method is not implemented.',
...parameters,
code: MethodNotSupportedError.code,
});
Object.defineProperty(this, "code", {

@@ -293,4 +313,8 @@ enumerable: true,

export class LimitExceededError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Rate limit exceeded.',
...parameters,
code: LimitExceededError.code,
});
Object.defineProperty(this, "code", {

@@ -318,4 +342,8 @@ enumerable: true,

export class VersionNotSupportedError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'JSON-RPC version not supported.',
...parameters,
code: VersionNotSupportedError.code,
});
Object.defineProperty(this, "code", {

@@ -343,4 +371,8 @@ enumerable: true,

export class InvalidRequestError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Input is not a valid JSON-RPC request.',
...parameters,
code: InvalidRequestError.code,
});
Object.defineProperty(this, "code", {

@@ -368,4 +400,8 @@ enumerable: true,

export class MethodNotFoundError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Method does not exist.',
...parameters,
code: MethodNotFoundError.code,
});
Object.defineProperty(this, "code", {

@@ -393,4 +429,8 @@ enumerable: true,

export class InvalidParamsError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Invalid method parameters.',
...parameters,
code: InvalidParamsError.code,
});
Object.defineProperty(this, "code", {

@@ -418,4 +458,8 @@ enumerable: true,

export class InternalError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Internal JSON-RPC error.',
...parameters,
code: InternalError.code,
});
Object.defineProperty(this, "code", {

@@ -443,4 +487,8 @@ enumerable: true,

export class ParseError extends BaseError {
constructor() {
super(...arguments);
constructor(parameters = {}) {
super({
message: 'Failed to parse JSON-RPC response.',
...parameters,
code: ParseError.code,
});
Object.defineProperty(this, "code", {

@@ -447,0 +495,0 @@ enumerable: true,

/** @internal */
export const version = '0.2.1';
export const version = '0.2.2';
//# sourceMappingURL=version.js.map

@@ -64,3 +64,5 @@ import { EventEmitter } from 'eventemitter3';

readonly name = "Provider.UserRejectedRequestError";
constructor();
constructor({ message, }?: {
message?: string | undefined;
});
}

@@ -71,3 +73,5 @@ /** The requested method and/or account has not been authorized by the user. */

readonly name = "Provider.UnauthorizedError";
constructor();
constructor({ message, }?: {
message?: string | undefined;
});
}

@@ -78,3 +82,5 @@ /** The provider does not support the requested method. */

readonly name = "Provider.UnsupportedMethodError";
constructor();
constructor({ message, }?: {
message?: string | undefined;
});
}

@@ -85,3 +91,5 @@ /** The provider is disconnected from all chains. */

readonly name = "Provider.DisconnectedError";
constructor();
constructor({ message, }?: {
message?: string | undefined;
});
}

@@ -92,3 +100,5 @@ /** The provider is not connected to the requested chain. */

readonly name = "Provider.ChainDisconnectedError";
constructor();
constructor({ message, }?: {
message?: string | undefined;
});
}

@@ -95,0 +105,0 @@ /**

@@ -196,2 +196,3 @@ import type { Errors, RpcRequest } from '../index.js';

readonly name = "RpcResponse.InvalidInputError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -203,2 +204,3 @@ /** Thrown when a JSON-RPC resource is not found. */

readonly name = "RpcResponse.ResourceNotFoundError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -210,2 +212,3 @@ /** Thrown when a JSON-RPC resource is unavailable. */

readonly name = "RpcResponse.ResourceUnavailableError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -217,2 +220,3 @@ /** Thrown when a JSON-RPC transaction is rejected. */

readonly name = "RpcResponse.TransactionRejectedError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -224,2 +228,3 @@ /** Thrown when a JSON-RPC method is not supported. */

readonly name = "RpcResponse.MethodNotSupportedError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -231,2 +236,3 @@ /** Thrown when a rate-limit is exceeded. */

readonly name = "RpcResponse.LimitExceededError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -238,2 +244,3 @@ /** Thrown when a JSON-RPC version is not supported. */

readonly name = "RpcResponse.VersionNotSupportedError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -245,2 +252,3 @@ /** Thrown when a JSON-RPC request is invalid. */

readonly name = "RpcResponse.InvalidRequestError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -252,2 +260,3 @@ /** Thrown when a JSON-RPC method is not found. */

readonly name = "RpcResponse.MethodNotFoundError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -259,2 +268,3 @@ /** Thrown when the parameters to a JSON-RPC method are invalid. */

readonly name = "RpcResponse.InvalidParamsError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -266,2 +276,3 @@ /** Thrown when an internal JSON-RPC error has occurred. */

readonly name = "RpcResponse.InternalErrorError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}

@@ -273,3 +284,4 @@ /** Thrown when a JSON-RPC response is invalid. */

readonly name = "RpcResponse.ParseError";
constructor(parameters?: Partial<Omit<ErrorObject, 'code'>>);
}
//# sourceMappingURL=RpcResponse.d.ts.map
/** @internal */
export declare const version = "0.2.1";
export declare const version = "0.2.2";
//# sourceMappingURL=version.d.ts.map
# ox
## 0.2.2
### Patch Changes
- [`4f40358`](https://github.com/wevm/ox/commit/4f4035826313dce974b7c7fa64ba4ea20d1f7f61) Thanks [@jxom](https://github.com/jxom)! - Tweaked `RpcResponse` and `Provider` errors to have optional parameters.
## 0.2.1

@@ -4,0 +10,0 @@

@@ -97,4 +97,6 @@ import { EventEmitter } from 'eventemitter3'

constructor() {
super(4001, 'The user rejected the request.')
constructor({
message = 'The user rejected the request.',
}: { message?: string | undefined } = {}) {
super(4001, message)
}

@@ -108,7 +110,6 @@ }

constructor() {
super(
4100,
'The requested method and/or account has not been authorized by the user.',
)
constructor({
message = 'The requested method and/or account has not been authorized by the user.',
}: { message?: string | undefined } = {}) {
super(4100, message)
}

@@ -122,4 +123,6 @@ }

constructor() {
super(4200, 'The provider does not support the requested method.')
constructor({
message = 'The provider does not support the requested method.',
}: { message?: string | undefined } = {}) {
super(4200, message)
}

@@ -133,4 +136,6 @@ }

constructor() {
super(4900, 'The provider is disconnected from all chains.')
constructor({
message = 'The provider is disconnected from all chains.',
}: { message?: string | undefined } = {}) {
super(4900, message)
}

@@ -144,4 +149,6 @@ }

constructor() {
super(4901, 'The provider is not connected to the requested chain.')
constructor({
message = 'The provider is not connected to the requested chain.',
}: { message?: string | undefined } = {}) {
super(4901, message)
}

@@ -148,0 +155,0 @@ }

@@ -308,2 +308,10 @@ import type { Errors, RpcRequest } from '../index.js'

override readonly name = 'RpcResponse.InvalidInputError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Missing or invalid parameters.',
...parameters,
code: InvalidInputError.code,
})
}
}

@@ -316,2 +324,10 @@

override readonly name = 'RpcResponse.ResourceNotFoundError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Requested resource not found.',
...parameters,
code: ResourceNotFoundError.code,
})
}
}

@@ -324,2 +340,10 @@

override readonly name = 'RpcResponse.ResourceUnavailableError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Requested resource not available.',
...parameters,
code: ResourceUnavailableError.code,
})
}
}

@@ -332,2 +356,10 @@

override readonly name = 'RpcResponse.TransactionRejectedError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Transaction creation failed.',
...parameters,
code: TransactionRejectedError.code,
})
}
}

@@ -340,2 +372,10 @@

override readonly name = 'RpcResponse.MethodNotSupportedError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Method is not implemented.',
...parameters,
code: MethodNotSupportedError.code,
})
}
}

@@ -348,2 +388,10 @@

override readonly name = 'RpcResponse.LimitExceededError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Rate limit exceeded.',
...parameters,
code: LimitExceededError.code,
})
}
}

@@ -356,2 +404,10 @@

override readonly name = 'RpcResponse.VersionNotSupportedError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'JSON-RPC version not supported.',
...parameters,
code: VersionNotSupportedError.code,
})
}
}

@@ -364,2 +420,10 @@

override readonly name = 'RpcResponse.InvalidRequestError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Input is not a valid JSON-RPC request.',
...parameters,
code: InvalidRequestError.code,
})
}
}

@@ -372,2 +436,10 @@

override readonly name = 'RpcResponse.MethodNotFoundError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Method does not exist.',
...parameters,
code: MethodNotFoundError.code,
})
}
}

@@ -380,2 +452,10 @@

override readonly name = 'RpcResponse.InvalidParamsError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Invalid method parameters.',
...parameters,
code: InvalidParamsError.code,
})
}
}

@@ -388,2 +468,10 @@

override readonly name = 'RpcResponse.InternalErrorError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Internal JSON-RPC error.',
...parameters,
code: InternalError.code,
})
}
}

@@ -396,2 +484,10 @@

override readonly name = 'RpcResponse.ParseError'
constructor(parameters: Partial<Omit<ErrorObject, 'code'>> = {}) {
super({
message: 'Failed to parse JSON-RPC response.',
...parameters,
code: ParseError.code,
})
}
}
{
"name": "ox",
"description": "Ethereum Standard Library",
"version": "0.2.1",
"version": "0.2.2",
"main": "./_cjs/index.js",

@@ -6,0 +6,0 @@ "module": "./_esm/index.js",

/** @internal */
export const version = '0.2.1'
export const version = '0.2.2'

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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