Socket
Socket
Sign inDemoInstall

@ganache/utils

Package Overview
Dependencies
20
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.9.0 to 0.9.1

8

lib/src/things/json-rpc/json-rpc-base-types.js

@@ -7,2 +7,6 @@ "use strict";

class BaseJsonRpcType {
// used to make console.log debugging a little easier
[inspect](_depth, _options) {
return `[${this.constructor.name}] ${this.toString()}`;
}
constructor(value) {

@@ -32,6 +36,2 @@ if (value == null) {

}
// used to make console.log debugging a little easier
[inspect](_depth, _options) {
return `[${this.constructor.name}] ${this.toString()}`;
}
toString() {

@@ -38,0 +38,0 @@ if (this.bufferValue == null) {

@@ -8,2 +8,7 @@ "use strict";

class Quantity extends json_rpc_base_types_1.BaseJsonRpcType {
static from(value, nullable = false) {
if (value instanceof Quantity)
return value;
return new Quantity(value, nullable);
}
constructor(value, nullable) {

@@ -17,7 +22,2 @@ super(value);

}
static from(value, nullable = false) {
if (value instanceof Quantity)
return value;
return new Quantity(value, nullable);
}
toString() {

@@ -24,0 +24,0 @@ if (this.bufferValue == null) {

@@ -94,3 +94,3 @@ "use strict";

JsonRpcErrorCode[JsonRpcErrorCode["JSON_RPC_VERSION_NOT_SUPPORTED"] = -32006] = "JSON_RPC_VERSION_NOT_SUPPORTED";
})(JsonRpcErrorCode = exports.JsonRpcErrorCode || (exports.JsonRpcErrorCode = {}));
})(JsonRpcErrorCode || (exports.JsonRpcErrorCode = JsonRpcErrorCode = {}));
//# sourceMappingURL=jsonrpc.js.map

@@ -17,5 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./connector"), exports);
__exportStar(require("./provider"), exports);
__exportStar(require("./api"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {

@@ -8,7 +13,2 @@ if (kind === "m") throw new TypeError("Private method is not writable");

};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
var _RequestCoordinator_paused, _RequestCoordinator_process;

@@ -22,2 +22,5 @@ Object.defineProperty(exports, "__esModule", { value: true });

class RequestCoordinator {
get paused() {
return __classPrivateFieldGet(this, _RequestCoordinator_paused, "f");
}
/**

@@ -96,5 +99,2 @@ * Promise-based FIFO queue.

}
get paused() {
return __classPrivateFieldGet(this, _RequestCoordinator_paused, "f");
}
/**

@@ -101,0 +101,0 @@ * Stop processing tasks - calls to queue(), and resume() will reject with an

@@ -6,6 +6,6 @@ {

},
"version": "0.9.0",
"version": "0.9.1",
"description": "Utility functions for @ganache packages",
"author": "David Murdoch <david@trufflesuite.com> (https://davidmurdoch.com)",
"homepage": "https://github.com/trufflesuite/ganache/tree/develop/src/packages/utils#readme",
"homepage": "https://github.com/trufflesuite/ganache/tree/develop/packages/utils#readme",
"license": "MIT",

@@ -26,3 +26,3 @@ "main": "lib/index.js",

"url": "https://github.com/trufflesuite/ganache.git",
"directory": "src/packages/utils"
"directory": "packages/utils"
},

@@ -52,3 +52,4 @@ "scripts": {

"dependencies": {
"@ganache/secp256k1": "0.5.0",
"@ganache/secp256k1": "0.5.1",
"@trufflesuite/bigint-buffer": "1.1.10",
"emittery": "0.10.0",

@@ -59,3 +60,3 @@ "keccak": "3.0.2",

"devDependencies": {
"@trufflesuite/uws-js-unofficial": "20.10.0-unofficial.2",
"@trufflesuite/uws-js-unofficial": "20.30.0-unofficial.0",
"@types/mocha": "9.0.0",

@@ -68,8 +69,5 @@ "@types/seedrandom": "3.0.1",

"ts-node": "10.9.1",
"typescript": "4.7.4"
"typescript": "5.1.6"
},
"optionalDependencies": {
"@trufflesuite/bigint-buffer": "1.1.10"
},
"gitHead": "cb66fef410b40d628acfd97f32e6b300e6f9f562"
"gitHead": "d4618893aaa38a41e2c4d51a603f7048b8635be1"
}
/// <reference types="node" />
export declare type JsonRpcInputArg = number | bigint | string | Buffer;
export type JsonRpcInputArg = number | bigint | string | Buffer;
/**

@@ -4,0 +4,0 @@ * Parse and validate a {@link number} to {@link Buffer} as internal representation for a JSON-RPC data type.

/// <reference types="node" />
import { BaseJsonRpcType } from "./json-rpc-base-types";
export declare type JsonRpcDataInputArg = string | Buffer;
export type JsonRpcDataInputArg = string | Buffer;
export declare class Data extends BaseJsonRpcType {

@@ -5,0 +5,0 @@ private _byteLength?;

import { Api, KnownKeys, OverloadedParameters } from "../types";
declare type JsonRpc = {
type JsonRpc = {
readonly id: string;

@@ -7,3 +7,3 @@ readonly jsonrpc: string;

};
export declare type JsonRpcRequest<Ledger extends Api, Method extends KnownKeys<Ledger>> = JsonRpc & {
export type JsonRpcRequest<Ledger extends Api, Method extends KnownKeys<Ledger>> = JsonRpc & {
readonly id: string | number;

@@ -14,6 +14,6 @@ readonly jsonrpc: string;

};
export declare type JsonRpcResponse = JsonRpc & {
export type JsonRpcResponse = JsonRpc & {
readonly result: any;
};
export declare type JsonRpcError = JsonRpc & {
export type JsonRpcError = JsonRpc & {
readonly error: {

@@ -20,0 +20,0 @@ readonly [key: string]: unknown;

@@ -1,9 +0,9 @@

export declare type LogFunc = (message?: any, ...optionalParams: any[]) => void;
export declare type Logger = {
export type LogFunc = (message?: any, ...optionalParams: any[]) => void;
export type Logger = {
log: LogFunc;
};
export declare type InternalLogger = Logger & {
export type InternalLogger = Logger & {
close: () => Promise<void>;
};
declare type LoggerConfig = {
type LoggerConfig = {
baseLogger: Logger;

@@ -10,0 +10,0 @@ file?: number;

/// <reference types="node" />
export * from "./connector";
export * from "./provider";
export * from "./api";
export declare type RemoveIndex<T> = {
export type RemoveIndex<T> = {
[K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];
};
export declare type KnownKeys<T> = keyof RemoveIndex<T>;
export type KnownKeys<T> = keyof RemoveIndex<T>;
declare global {

@@ -14,3 +12,3 @@ interface JSON {

}
declare type Overloads<T extends (...args: any[]) => any> = T extends {
type Overloads<T extends (...args: any[]) => any> = T extends {
(...args: infer A1): infer R1;

@@ -43,4 +41,4 @@ (...args: infer A2): infer R2;

} ? (...args: A1) => R1 : never;
declare type NoUnknownArray<T> = T extends infer I ? unknown[] extends I ? never : I : T;
export declare type OverloadedParameters<T extends (...args: any[]) => any> = NoUnknownArray<Parameters<Overloads<T>>>;
type NoUnknownArray<T> = T extends infer I ? unknown[] extends I ? never : I : T;
export type OverloadedParameters<T extends (...args: any[]) => any> = NoUnknownArray<Parameters<Overloads<T>>>;
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

declare type Comparator<T> = (values: T[], a: number, b: number) => boolean;
type Comparator<T> = (values: T[], a: number, b: number) => boolean;
export declare class Heap<T, U = any> {

@@ -3,0 +3,0 @@ length: number;

import { OverloadedParameters } from "../types";
declare type RejectableTask = {
type RejectableTask = {
execute: (...args: any) => Promise<any>;

@@ -57,53 +57,3 @@ reject: (reason?: any) => void;

*/
queue: <T extends (...args: unknown[]) => unknown>(fn: T, thisArgument: any, argumentsList: Parameters<T extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
} ? ((...args: A1) => R1) | ((...args: A2) => R2) | ((...args: A3) => R3) | ((...args: A4) => R4) | ((...args: A5) => R5) | ((...args: A6) => R6) : T extends {
(...args: infer A1_1): infer R1_1;
(...args: infer A2_1): infer R2_1;
(...args: infer A3_1): infer R3_1;
(...args: infer A4_1): infer R4_1;
(...args: infer A5_1): infer R5_1;
} ? ((...args: A1_1) => R1_1) | ((...args: A2_1) => R2_1) | ((...args: A3_1) => R3_1) | ((...args: A4_1) => R4_1) | ((...args: A5_1) => R5_1) : T extends {
(...args: infer A1_2): infer R1_2;
(...args: infer A2_2): infer R2_2;
(...args: infer A3_2): infer R3_2;
(...args: infer A4_2): infer R4_2;
} ? ((...args: A1_2) => R1_2) | ((...args: A2_2) => R2_2) | ((...args: A3_2) => R3_2) | ((...args: A4_2) => R4_2) : T extends {
(...args: infer A1_3): infer R1_3;
(...args: infer A2_3): infer R2_3;
(...args: infer A3_3): infer R3_3;
} ? ((...args: A1_3) => R1_3) | ((...args: A2_3) => R2_3) | ((...args: A3_3) => R3_3) : T extends {
(...args: infer A1_4): infer R1_4;
(...args: infer A2_4): infer R2_4;
} ? ((...args: A1_4) => R1_4) | ((...args: A2_4) => R2_4) : T extends (...args: infer A1_5) => infer R1_5 ? (...args: A1_5) => R1_5 : never> extends infer T_1 ? T_1 extends Parameters<T extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
(...args: infer A6): infer R6;
} ? ((...args: A1) => R1) | ((...args: A2) => R2) | ((...args: A3) => R3) | ((...args: A4) => R4) | ((...args: A5) => R5) | ((...args: A6) => R6) : T extends {
(...args: infer A1_1): infer R1_1;
(...args: infer A2_1): infer R2_1;
(...args: infer A3_1): infer R3_1;
(...args: infer A4_1): infer R4_1;
(...args: infer A5_1): infer R5_1;
} ? ((...args: A1_1) => R1_1) | ((...args: A2_1) => R2_1) | ((...args: A3_1) => R3_1) | ((...args: A4_1) => R4_1) | ((...args: A5_1) => R5_1) : T extends {
(...args: infer A1_2): infer R1_2;
(...args: infer A2_2): infer R2_2;
(...args: infer A3_2): infer R3_2;
(...args: infer A4_2): infer R4_2;
} ? ((...args: A1_2) => R1_2) | ((...args: A2_2) => R2_2) | ((...args: A3_2) => R3_2) | ((...args: A4_2) => R4_2) : T extends {
(...args: infer A1_3): infer R1_3;
(...args: infer A2_3): infer R2_3;
(...args: infer A3_3): infer R3_3;
} ? ((...args: A1_3) => R1_3) | ((...args: A2_3) => R2_3) | ((...args: A3_3) => R3_3) : T extends {
(...args: infer A1_4): infer R1_4;
(...args: infer A2_4): infer R2_4;
} ? ((...args: A1_4) => R1_4) | ((...args: A2_4) => R2_4) : T extends (...args: infer A1_5) => infer R1_5 ? (...args: A1_5) => R1_5 : never> ? T_1 extends unknown ? never : T_1 : never : never) => Promise<{
queue: <T extends (...args: unknown[]) => unknown>(fn: T, thisArgument: any, argumentsList: OverloadedParameters<T>) => Promise<{
value: ReturnType<T>;

@@ -110,0 +60,0 @@ }>;

/// <reference types="node" />
export declare type ECSignResult = {
export type ECSignResult = {
v: bigint;

@@ -4,0 +4,0 @@ r: Buffer;

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

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

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc