Comparing version 0.6.3 to 0.6.4
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.from = from; | ||
exports.parseErrorObject = parseErrorObject; | ||
exports.parseError = parseError; | ||
const eventemitter3_1 = require("eventemitter3"); | ||
@@ -199,3 +199,3 @@ const Errors = require("./Errors.js"); | ||
catch (error) { | ||
throw parseErrorObject(error); | ||
throw parseError(error); | ||
} | ||
@@ -205,5 +205,5 @@ }, | ||
} | ||
function parseErrorObject(errorObject) { | ||
function parseError(errorObject) { | ||
const errorObject_ = errorObject; | ||
const error = RpcResponse.parseErrorObject(errorObject_); | ||
const error = RpcResponse.parseError(errorObject_); | ||
if (error instanceof RpcResponse.InternalError) { | ||
@@ -223,6 +223,2 @@ if (!error.data) | ||
return new UnsupportedMethodError(errorObject_); | ||
return new RpcResponse.InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}); | ||
} | ||
@@ -229,0 +225,0 @@ return error; |
@@ -6,3 +6,3 @@ "use strict"; | ||
exports.parse = parse; | ||
exports.parseErrorObject = parseErrorObject; | ||
exports.parseError = parseError; | ||
function from(response, options = {}) { | ||
@@ -22,6 +22,6 @@ const { request } = options; | ||
if (response_.error) | ||
throw parseErrorObject(response_.error); | ||
throw parseError(response_.error); | ||
return response_.result; | ||
} | ||
function parseErrorObject(errorObject) { | ||
function parseError(errorObject) { | ||
const errorObject_ = errorObject; | ||
@@ -88,5 +88,5 @@ const { code } = errorObject_; | ||
super({ | ||
message: 'Missing or invalid parameters.', | ||
...parameters, | ||
code: InvalidInputError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Missing or invalid parameters.', | ||
}); | ||
@@ -117,5 +117,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Requested resource not found.', | ||
...parameters, | ||
code: ResourceNotFoundError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Requested resource not found.', | ||
}); | ||
@@ -146,5 +146,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Requested resource not available.', | ||
...parameters, | ||
code: ResourceUnavailableError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Requested resource not available.', | ||
}); | ||
@@ -175,5 +175,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Transaction creation failed.', | ||
...parameters, | ||
code: TransactionRejectedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Transaction creation failed.', | ||
}); | ||
@@ -204,5 +204,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Method is not implemented.', | ||
...parameters, | ||
code: MethodNotSupportedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Method is not implemented.', | ||
}); | ||
@@ -233,5 +233,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Rate limit exceeded.', | ||
...parameters, | ||
code: LimitExceededError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Rate limit exceeded.', | ||
}); | ||
@@ -262,5 +262,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'JSON-RPC version not supported.', | ||
...parameters, | ||
code: VersionNotSupportedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'JSON-RPC version not supported.', | ||
}); | ||
@@ -291,5 +291,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Input is not a valid JSON-RPC request.', | ||
...parameters, | ||
code: InvalidRequestError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Input is not a valid JSON-RPC request.', | ||
}); | ||
@@ -320,5 +320,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Method does not exist.', | ||
...parameters, | ||
code: MethodNotFoundError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Method does not exist.', | ||
}); | ||
@@ -349,5 +349,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Invalid method parameters.', | ||
...parameters, | ||
code: InvalidParamsError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Invalid method parameters.', | ||
}); | ||
@@ -378,5 +378,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Internal JSON-RPC error.', | ||
...parameters, | ||
code: InternalError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Internal JSON-RPC error.', | ||
}); | ||
@@ -407,5 +407,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Failed to parse JSON-RPC response.', | ||
...parameters, | ||
code: ParseError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Failed to parse JSON-RPC response.', | ||
}); | ||
@@ -412,0 +412,0 @@ Object.defineProperty(this, "code", { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.version = void 0; | ||
exports.version = '0.6.3'; | ||
exports.version = '0.6.4'; | ||
//# sourceMappingURL=version.js.map |
@@ -227,3 +227,3 @@ import { EventEmitter } from 'eventemitter3'; | ||
catch (error) { | ||
throw parseErrorObject(error); | ||
throw parseError(error); | ||
} | ||
@@ -250,5 +250,5 @@ }, | ||
*/ | ||
export function parseErrorObject(errorObject) { | ||
export function parseError(errorObject) { | ||
const errorObject_ = errorObject; | ||
const error = RpcResponse.parseErrorObject(errorObject_); | ||
const error = RpcResponse.parseError(errorObject_); | ||
if (error instanceof RpcResponse.InternalError) { | ||
@@ -268,6 +268,2 @@ if (!error.data) | ||
return new UnsupportedMethodError(errorObject_); | ||
return new RpcResponse.InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}); | ||
} | ||
@@ -274,0 +270,0 @@ return error; |
@@ -107,3 +107,3 @@ // eslint-disable-next-line jsdoc/require-jsdoc | ||
if (response_.error) | ||
throw parseErrorObject(response_.error); | ||
throw parseError(response_.error); | ||
return response_.result; | ||
@@ -128,3 +128,3 @@ } | ||
*/ | ||
export function parseErrorObject(errorObject) { | ||
export function parseError(errorObject) { | ||
const errorObject_ = errorObject; | ||
@@ -192,5 +192,5 @@ const { code } = errorObject_; | ||
super({ | ||
message: 'Missing or invalid parameters.', | ||
...parameters, | ||
code: InvalidInputError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Missing or invalid parameters.', | ||
}); | ||
@@ -221,5 +221,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Requested resource not found.', | ||
...parameters, | ||
code: ResourceNotFoundError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Requested resource not found.', | ||
}); | ||
@@ -250,5 +250,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Requested resource not available.', | ||
...parameters, | ||
code: ResourceUnavailableError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Requested resource not available.', | ||
}); | ||
@@ -279,5 +279,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Transaction creation failed.', | ||
...parameters, | ||
code: TransactionRejectedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Transaction creation failed.', | ||
}); | ||
@@ -308,5 +308,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Method is not implemented.', | ||
...parameters, | ||
code: MethodNotSupportedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Method is not implemented.', | ||
}); | ||
@@ -337,5 +337,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Rate limit exceeded.', | ||
...parameters, | ||
code: LimitExceededError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Rate limit exceeded.', | ||
}); | ||
@@ -366,5 +366,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'JSON-RPC version not supported.', | ||
...parameters, | ||
code: VersionNotSupportedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'JSON-RPC version not supported.', | ||
}); | ||
@@ -395,5 +395,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Input is not a valid JSON-RPC request.', | ||
...parameters, | ||
code: InvalidRequestError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Input is not a valid JSON-RPC request.', | ||
}); | ||
@@ -424,5 +424,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Method does not exist.', | ||
...parameters, | ||
code: MethodNotFoundError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Method does not exist.', | ||
}); | ||
@@ -453,5 +453,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Invalid method parameters.', | ||
...parameters, | ||
code: InvalidParamsError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Invalid method parameters.', | ||
}); | ||
@@ -482,5 +482,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Internal JSON-RPC error.', | ||
...parameters, | ||
code: InternalError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Internal JSON-RPC error.', | ||
}); | ||
@@ -511,5 +511,5 @@ Object.defineProperty(this, "code", { | ||
super({ | ||
message: 'Failed to parse JSON-RPC response.', | ||
...parameters, | ||
code: ParseError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Failed to parse JSON-RPC response.', | ||
}); | ||
@@ -516,0 +516,0 @@ Object.defineProperty(this, "code", { |
/** @internal */ | ||
export const version = '0.6.3'; | ||
export const version = '0.6.4'; | ||
//# sourceMappingURL=version.js.map |
@@ -323,5 +323,5 @@ import { EventEmitter } from 'eventemitter3'; | ||
*/ | ||
export declare function parseErrorObject<const errorObject extends RpcResponse.ErrorObject | unknown>(errorObject: errorObject | RpcResponse.ErrorObject): parseErrorObject.ReturnType<errorObject>; | ||
export declare namespace parseErrorObject { | ||
type ReturnType<errorObject extends RpcResponse.ErrorObject | unknown, error = errorObject extends RpcResponse.ErrorObject ? (errorObject['code'] extends DisconnectedError['code'] ? DisconnectedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? DisconnectedError : never) | (errorObject['code'] extends ChainDisconnectedError['code'] ? ChainDisconnectedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ChainDisconnectedError : never) | (errorObject['code'] extends UserRejectedRequestError['code'] ? UserRejectedRequestError : never) | (IsNarrowable<errorObject['code'], number> extends false ? UserRejectedRequestError : never) | (errorObject['code'] extends UnauthorizedError['code'] ? UnauthorizedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? UnauthorizedError : never) | (errorObject['code'] extends UnsupportedMethodError['code'] ? UnsupportedMethodError : never) | (IsNarrowable<errorObject['code'], number> extends false ? UnsupportedMethodError : never) : RpcResponse.parseErrorObject.ReturnType<RpcResponse.ErrorObject>> = IsNever<error> extends true ? RpcResponse.parseErrorObject.ReturnType<errorObject> : error; | ||
export declare function parseError<const errorObject extends RpcResponse.ErrorObject | unknown>(errorObject: errorObject | RpcResponse.ErrorObject): parseError.ReturnType<errorObject>; | ||
export declare namespace parseError { | ||
type ReturnType<errorObject extends RpcResponse.ErrorObject | unknown, error = errorObject extends RpcResponse.ErrorObject ? (errorObject['code'] extends DisconnectedError['code'] ? DisconnectedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? DisconnectedError : never) | (errorObject['code'] extends ChainDisconnectedError['code'] ? ChainDisconnectedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ChainDisconnectedError : never) | (errorObject['code'] extends UserRejectedRequestError['code'] ? UserRejectedRequestError : never) | (IsNarrowable<errorObject['code'], number> extends false ? UserRejectedRequestError : never) | (errorObject['code'] extends UnauthorizedError['code'] ? UnauthorizedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? UnauthorizedError : never) | (errorObject['code'] extends UnsupportedMethodError['code'] ? UnsupportedMethodError : never) | (IsNarrowable<errorObject['code'], number> extends false ? UnsupportedMethodError : never) : RpcResponse.parseError.ReturnType<RpcResponse.ErrorObject>> = IsNever<error> extends true ? RpcResponse.parseError.ReturnType<errorObject> : error; | ||
} | ||
@@ -328,0 +328,0 @@ /** Thrown when the provider is undefined. */ |
@@ -198,5 +198,5 @@ import type { Errors, RpcRequest } from '../index.js'; | ||
*/ | ||
export declare function parseErrorObject<const errorObject extends ErrorObject | unknown>(errorObject: errorObject | ErrorObject): parseErrorObject.ReturnType<errorObject>; | ||
export declare namespace parseErrorObject { | ||
type ReturnType<errorObject extends ErrorObject | unknown, error = errorObject extends ErrorObject ? (errorObject['code'] extends InternalError['code'] ? InternalError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InternalError : never) | (errorObject['code'] extends InvalidInputError['code'] ? InvalidInputError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InvalidInputError : never) | (errorObject['code'] extends ResourceNotFoundError['code'] ? ResourceNotFoundError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ResourceNotFoundError : never) | (errorObject['code'] extends ResourceUnavailableError['code'] ? ResourceUnavailableError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ResourceUnavailableError : never) | (errorObject['code'] extends TransactionRejectedError['code'] ? TransactionRejectedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? TransactionRejectedError : never) | (errorObject['code'] extends ParseError['code'] ? ParseError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ParseError : never) | (errorObject['code'] extends MethodNotSupportedError['code'] ? MethodNotSupportedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? MethodNotSupportedError : never) | (errorObject['code'] extends LimitExceededError['code'] ? LimitExceededError : never) | (IsNarrowable<errorObject['code'], number> extends false ? LimitExceededError : never) | (errorObject['code'] extends VersionNotSupportedError['code'] ? VersionNotSupportedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? VersionNotSupportedError : never) | (errorObject['code'] extends InvalidRequestError['code'] ? InvalidRequestError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InvalidRequestError : never) | (errorObject['code'] extends MethodNotFoundError['code'] ? MethodNotFoundError : never) | (IsNarrowable<errorObject['code'], number> extends false ? MethodNotFoundError : never) | (errorObject['code'] extends InvalidParamsError['code'] ? InvalidParamsError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InvalidParamsError : never) | (IsNarrowable<errorObject['code'], number> extends false ? BaseError : never) : parseErrorObject.ReturnType<ErrorObject>> = IsNever<error> extends true ? BaseError : error; | ||
export declare function parseError<const errorObject extends ErrorObject | unknown>(errorObject: errorObject | ErrorObject): parseError.ReturnType<errorObject>; | ||
export declare namespace parseError { | ||
type ReturnType<errorObject extends ErrorObject | unknown, error = errorObject extends ErrorObject ? (errorObject['code'] extends InternalError['code'] ? InternalError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InternalError : never) | (errorObject['code'] extends InvalidInputError['code'] ? InvalidInputError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InvalidInputError : never) | (errorObject['code'] extends ResourceNotFoundError['code'] ? ResourceNotFoundError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ResourceNotFoundError : never) | (errorObject['code'] extends ResourceUnavailableError['code'] ? ResourceUnavailableError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ResourceUnavailableError : never) | (errorObject['code'] extends TransactionRejectedError['code'] ? TransactionRejectedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? TransactionRejectedError : never) | (errorObject['code'] extends ParseError['code'] ? ParseError : never) | (IsNarrowable<errorObject['code'], number> extends false ? ParseError : never) | (errorObject['code'] extends MethodNotSupportedError['code'] ? MethodNotSupportedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? MethodNotSupportedError : never) | (errorObject['code'] extends LimitExceededError['code'] ? LimitExceededError : never) | (IsNarrowable<errorObject['code'], number> extends false ? LimitExceededError : never) | (errorObject['code'] extends VersionNotSupportedError['code'] ? VersionNotSupportedError : never) | (IsNarrowable<errorObject['code'], number> extends false ? VersionNotSupportedError : never) | (errorObject['code'] extends InvalidRequestError['code'] ? InvalidRequestError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InvalidRequestError : never) | (errorObject['code'] extends MethodNotFoundError['code'] ? MethodNotFoundError : never) | (IsNarrowable<errorObject['code'], number> extends false ? MethodNotFoundError : never) | (errorObject['code'] extends InvalidParamsError['code'] ? InvalidParamsError : never) | (IsNarrowable<errorObject['code'], number> extends false ? InvalidParamsError : never) | (IsNarrowable<errorObject['code'], number> extends false ? BaseError : never) : parseError.ReturnType<ErrorObject>> = IsNever<error> extends true ? BaseError : error; | ||
} | ||
@@ -203,0 +203,0 @@ export type BaseErrorType = BaseError & { |
/** @internal */ | ||
export declare const version = "0.6.3"; | ||
export declare const version = "0.6.4"; | ||
//# sourceMappingURL=version.d.ts.map |
# ox | ||
## 0.6.4 | ||
### Patch Changes | ||
- [`74ceae4`](https://github.com/wevm/ox/commit/74ceae4089663ebae18690a44fd98accc28b9b5c) Thanks [@jxom](https://github.com/jxom)! - Fixed `Provider.parseError` behavior. | ||
## 0.6.3 | ||
@@ -4,0 +10,0 @@ |
@@ -403,3 +403,3 @@ import { EventEmitter } from 'eventemitter3' | ||
} catch (error) { | ||
throw parseErrorObject(error) | ||
throw parseError(error) | ||
} | ||
@@ -431,9 +431,9 @@ }, | ||
*/ | ||
export function parseErrorObject< | ||
export function parseError< | ||
const errorObject extends RpcResponse.ErrorObject | unknown, | ||
>( | ||
errorObject: errorObject | RpcResponse.ErrorObject, | ||
): parseErrorObject.ReturnType<errorObject> { | ||
): parseError.ReturnType<errorObject> { | ||
const errorObject_ = errorObject as RpcResponse.ErrorObject | ||
const error = RpcResponse.parseErrorObject(errorObject_) | ||
const error = RpcResponse.parseError(errorObject_) | ||
if (error instanceof RpcResponse.InternalError) { | ||
@@ -453,6 +453,2 @@ if (!error.data) return error as never | ||
return new UnsupportedMethodError(errorObject_) as never | ||
return new RpcResponse.InternalError({ | ||
data: errorObject_, | ||
message: errorObject_.message, | ||
}) as never | ||
} | ||
@@ -462,3 +458,3 @@ return error as never | ||
export declare namespace parseErrorObject { | ||
export declare namespace parseError { | ||
type ReturnType< | ||
@@ -499,5 +495,5 @@ errorObject extends RpcResponse.ErrorObject | unknown, | ||
: never) | ||
: RpcResponse.parseErrorObject.ReturnType<RpcResponse.ErrorObject>, | ||
: RpcResponse.parseError.ReturnType<RpcResponse.ErrorObject>, | ||
> = IsNever<error> extends true | ||
? RpcResponse.parseErrorObject.ReturnType<errorObject> | ||
? RpcResponse.parseError.ReturnType<errorObject> | ||
: error | ||
@@ -504,0 +500,0 @@ } |
@@ -219,3 +219,3 @@ import type { Errors, RpcRequest } from '../index.js' | ||
if (raw) return response as never | ||
if (response_.error) throw parseErrorObject(response_.error) | ||
if (response_.error) throw parseError(response_.error) | ||
return response_.result as never | ||
@@ -284,7 +284,5 @@ } | ||
*/ | ||
export function parseErrorObject< | ||
const errorObject extends ErrorObject | unknown, | ||
>( | ||
export function parseError<const errorObject extends ErrorObject | unknown>( | ||
errorObject: errorObject | ErrorObject, | ||
): parseErrorObject.ReturnType<errorObject> { | ||
): parseError.ReturnType<errorObject> { | ||
const errorObject_ = errorObject as ErrorObject | ||
@@ -321,3 +319,3 @@ const { code } = errorObject_ | ||
export declare namespace parseErrorObject { | ||
export declare namespace parseError { | ||
type ReturnType< | ||
@@ -403,3 +401,3 @@ errorObject extends ErrorObject | unknown, | ||
: never) | ||
: parseErrorObject.ReturnType<ErrorObject>, | ||
: parseError.ReturnType<ErrorObject>, | ||
> = IsNever<error> extends true ? BaseError : error | ||
@@ -433,5 +431,5 @@ } | ||
super({ | ||
message: 'Missing or invalid parameters.', | ||
...parameters, | ||
code: InvalidInputError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Missing or invalid parameters.', | ||
}) | ||
@@ -449,5 +447,5 @@ } | ||
super({ | ||
message: 'Requested resource not found.', | ||
...parameters, | ||
code: ResourceNotFoundError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Requested resource not found.', | ||
}) | ||
@@ -465,5 +463,5 @@ } | ||
super({ | ||
message: 'Requested resource not available.', | ||
...parameters, | ||
code: ResourceUnavailableError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Requested resource not available.', | ||
}) | ||
@@ -481,5 +479,5 @@ } | ||
super({ | ||
message: 'Transaction creation failed.', | ||
...parameters, | ||
code: TransactionRejectedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Transaction creation failed.', | ||
}) | ||
@@ -497,5 +495,5 @@ } | ||
super({ | ||
message: 'Method is not implemented.', | ||
...parameters, | ||
code: MethodNotSupportedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Method is not implemented.', | ||
}) | ||
@@ -513,5 +511,5 @@ } | ||
super({ | ||
message: 'Rate limit exceeded.', | ||
...parameters, | ||
code: LimitExceededError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Rate limit exceeded.', | ||
}) | ||
@@ -529,5 +527,5 @@ } | ||
super({ | ||
message: 'JSON-RPC version not supported.', | ||
...parameters, | ||
code: VersionNotSupportedError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'JSON-RPC version not supported.', | ||
}) | ||
@@ -545,5 +543,5 @@ } | ||
super({ | ||
message: 'Input is not a valid JSON-RPC request.', | ||
...parameters, | ||
code: InvalidRequestError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Input is not a valid JSON-RPC request.', | ||
}) | ||
@@ -561,5 +559,5 @@ } | ||
super({ | ||
message: 'Method does not exist.', | ||
...parameters, | ||
code: MethodNotFoundError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Method does not exist.', | ||
}) | ||
@@ -577,5 +575,5 @@ } | ||
super({ | ||
message: 'Invalid method parameters.', | ||
...parameters, | ||
code: InvalidParamsError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Invalid method parameters.', | ||
}) | ||
@@ -593,5 +591,5 @@ } | ||
super({ | ||
message: 'Internal JSON-RPC error.', | ||
...parameters, | ||
code: InternalError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Internal JSON-RPC error.', | ||
}) | ||
@@ -609,7 +607,7 @@ } | ||
super({ | ||
message: 'Failed to parse JSON-RPC response.', | ||
...parameters, | ||
code: ParseError.code, | ||
data: parameters.data, | ||
message: parameters.message ?? 'Failed to parse JSON-RPC response.', | ||
}) | ||
} | ||
} |
{ | ||
"name": "ox", | ||
"description": "Ethereum Standard Library", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"main": "./_cjs/index.js", | ||
@@ -6,0 +6,0 @@ "module": "./_esm/index.js", |
/** @internal */ | ||
export const version = '0.6.3' | ||
export const version = '0.6.4' |
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
5085522
95569