Socket
Socket
Sign inDemoInstall

@ganache/utils

Package Overview
Dependencies
6
Maintainers
3
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1-beta.1 to 0.1.1-beta.2

6

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

@@ -28,7 +28,7 @@ "use strict";

exports.toStrings.set(this, () => value.toString(16));
exports.toBuffers.set(this, () => value === 0 ? constants_1.BUFFER_EMPTY : utils_2.uintToBuffer(value));
exports.toBuffers.set(this, () => value === 0 ? constants_1.BUFFER_EMPTY : (0, utils_2.uintToBuffer)(value));
break;
case "bigint":
exports.toStrings.set(this, () => value.toString(16));
exports.toBuffers.set(this, () => value === 0n ? constants_1.BUFFER_EMPTY : utils_1.bigIntToBuffer(value));
exports.toBuffers.set(this, () => value === 0n ? constants_1.BUFFER_EMPTY : (0, utils_1.bigIntToBuffer)(value));
break;

@@ -68,3 +68,3 @@ case "string": {

// used to make console.log debugging a little easier
[inspect](_depth, _options) {
[(Symbol.toStringTag, inspect)](_depth, _options) {
return this.value;

@@ -71,0 +71,0 @@ }

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

if (Buffer.isBuffer(value)) {
const bigInt = utils_1.bufferToBigInt(value);
const bigInt = (0, utils_1.bufferToBigInt)(value);
return bigInt == null ? (this._nullable ? null : 0n) : bigInt;

@@ -73,0 +73,0 @@ }

@@ -21,2 +21,5 @@ "use strict";

];
// A hack to fix Emittery's `mixin` type.
// issue: https://github.com/sindresorhus/emittery/issues/79
const mixin = emittery_1.default.mixin.bind(emittery_1.default);
let PromiEvent = PromiEvent_1 = class PromiEvent extends Promise {

@@ -54,3 +57,3 @@ constructor(executor) {

* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A PromiEvent for the completion of the callback.

@@ -75,5 +78,5 @@ */

PromiEvent = PromiEvent_1 = __decorate([
emittery_1.default.mixin(Symbol.for("emittery"), emitteryMethods)
mixin(Symbol.for("emittery"), emitteryMethods)
], PromiEvent);
exports.default = PromiEvent;
//# sourceMappingURL=promievent.js.map

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

__exportStar(require("./api"), exports);
function b() { }
function g(t) {
return 123;
}
g({});
//# sourceMappingURL=index.js.map

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

* Returns the number of bytes contained in this given `value`.
* @param value
* @param value -
*/

@@ -27,15 +27,15 @@ function bigIntByteLength(value) {

if (value <= MAX_SAFE_INTEGER) {
return uint_to_buffer_1.uintToBuffer(Number(value));
return (0, uint_to_buffer_1.uintToBuffer)(Number(value));
}
else {
const size = bigIntByteLength(value);
return common_1.toBufferBE(value, size);
return (0, common_1.toBufferBE)(value, size);
}
};
}
catch (e) {
catch {
_bigIntToBuffer = (value) => {
if (value <= MAX_SAFE_INTEGER) {
// if this value can be handled as a JS number safely, convert it that way
return uint_to_buffer_1.uintToBuffer(Number(value));
return (0, uint_to_buffer_1.uintToBuffer)(Number(value));
}

@@ -42,0 +42,0 @@ else {

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

* note: this doesn't handle negative values
* @param value Buffer representation of a bigint, most-significant bit first (Big-endian)
* @param value - Buffer representation of a bigint, most-significant bit first (Big-endian)
*/

@@ -36,3 +36,3 @@ function bufferToBigInt(value) {

// TODO: toBigIntBE is a native lib with no pure JS fallback yet.
return bigint_buffer_1.toBigIntBE(value);
return (0, bigint_buffer_1.toBigIntBE)(value);
}

@@ -39,0 +39,0 @@ return view.getBigUint64(0);

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

*
* @param buffer
* @param buffer -
*/

@@ -25,0 +25,0 @@ function bufferToMinHexKey(buffer) {

"use strict";
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
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;
var _Executor_requestCoordinator;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -24,9 +22,9 @@ exports.Executor = void 0;

constructor(requestCoordinator) {
_requestCoordinator.set(this, void 0);
__classPrivateFieldSet(this, _requestCoordinator, requestCoordinator);
_Executor_requestCoordinator.set(this, void 0);
__classPrivateFieldSet(this, _Executor_requestCoordinator, requestCoordinator, "f");
}
/**
* Executes the method with the given methodName on the API
* @param methodName The name of the JSON-RPC method to execute.
* @param params The params to pass to the JSON-RPC method.
* @param methodName - The name of the JSON-RPC method to execute.
* @param params - The params to pass to the JSON-RPC method.
*/

@@ -46,4 +44,4 @@ execute(api, methodName, params) {

// }
if ((has_own_1.hasOwn(api.__proto__, methodName) && methodName !== "constructor") ||
has_own_1.hasOwn(api, methodName)) {
if (((0, has_own_1.hasOwn)(api.__proto__, methodName) && methodName !== "constructor") ||
(0, has_own_1.hasOwn)(api, methodName)) {
// cast methodName from `KnownKeys<T> & string` back to KnownKeys<T> so our return type isn't weird.

@@ -55,3 +53,3 @@ const fn = api[methodName];

// queue up this method for actual execution:
return __classPrivateFieldGet(this, _requestCoordinator).queue(fn, api, params);
return __classPrivateFieldGet(this, _Executor_requestCoordinator, "f").queue(fn, api, params);
}

@@ -64,3 +62,3 @@ }

exports.Executor = Executor;
_requestCoordinator = new WeakMap();
_Executor_requestCoordinator = new WeakMap();
//# sourceMappingURL=executor.js.map

@@ -20,5 +20,5 @@ "use strict";

*
* @param array
* @param val Value of the upper bound to search for in the range.
* @param comp A function that accepts two arguments (the first is always
* @param array -
* @param val - Value of the upper bound to search for in the range.
* @param comp - A function that accepts two arguments (the first is always
* `val`, and the second from the given `array`) and returns bool. The value

@@ -25,0 +25,0 @@ * returned indicates whether the first argument is considered to go before the

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

*
* @param obj The object that will be checked.
* @param v A property name.
* @param obj - The object that will be checked.
* @param v - A property name.
* @returns `true` if the object has a property with the specified name,

@@ -15,0 +15,0 @@ * otherwise false.

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

* read and remove the element call `shift()`
* @param less the comparator function
* @param refresher the refresher function
* @param less - the comparator function
* @param refresher - the refresher function
*/

@@ -30,3 +30,3 @@ constructor(less, refresher) {

* item in the heap and then re-sorting.
* @param context
* @param context -
*/

@@ -36,3 +36,3 @@ /**

* item in the heap and then re-sorting.
* @param context
* @param context -
*/

@@ -52,3 +52,3 @@ refresh(context) {

* Pushes a new element onto the heap
* @param value
* @param value -
*/

@@ -106,3 +106,3 @@ push(value) {

* unexpected behavior.
* @param newValue
* @param newValue -
*/

@@ -117,4 +117,4 @@ replaceBest(newValue) {

* find unexpected behavior.
* @param i
* @param newValue
* @param i -
* @param newValue -
*/

@@ -128,3 +128,3 @@ replace(i, newValue) {

* The complexity is O(log n) where n = this.size().
* @param i the element to remove
* @param i - the element to remove
*/

@@ -168,3 +168,3 @@ remove(i) {

* The complexity is O(log n) where n = this.size().
* @param i
* @param i -
*/

@@ -201,4 +201,4 @@ fix(i) {

* Swaps the elements in the heap
* @param i The first element
* @param j The second element
* @param i - The first element
* @param j - The second element
*/

@@ -214,5 +214,5 @@ swap(i, j) {

* heap.
* @param item
* @param less
* @param refresher
* @param item -
* @param less -
* @param refresher -
*/

@@ -219,0 +219,0 @@ static from(item, less, refresher) {

@@ -10,6 +10,6 @@ "use strict";

const CAPACITY = 512;
const instance = keccak_1.default("keccak256");
const instance = (0, keccak_1.default)("keccak256");
/**
* keccak256, but faster if you use it a lot.
* @param buffer
* @param buffer -
*/

@@ -16,0 +16,0 @@ function keccak(buffer) {

"use strict";
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
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 _paused, _process;
var _RequestCoordinator_paused, _RequestCoordinator_process;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -25,3 +23,3 @@ exports.RequestCoordinator = void 0;

* Promise-based FIFO queue.
* @param limit The number of requests that can be processed at a time.
* @param limit - The number of requests that can be processed at a time.
* Default value is is no limit (`0`).

@@ -38,3 +36,3 @@ */

this.runningTasks = 0;
_paused.set(this, true);
_RequestCoordinator_paused.set(this, true);
/**

@@ -45,3 +43,3 @@ * Pause processing. This will *not* cancel any promises that are currently

this.pause = () => {
__classPrivateFieldSet(this, _paused, true);
__classPrivateFieldSet(this, _RequestCoordinator_paused, true, "f");
};

@@ -52,6 +50,6 @@ /**

this.resume = () => {
__classPrivateFieldSet(this, _paused, false);
__classPrivateFieldGet(this, _process).call(this);
__classPrivateFieldSet(this, _RequestCoordinator_paused, false, "f");
__classPrivateFieldGet(this, _RequestCoordinator_process, "f").call(this);
};
_process.set(this, () => {
_RequestCoordinator_process.set(this, () => {
// if we aren't paused and the number of things we're processing is under

@@ -73,3 +71,3 @@ // our limit and we have things to process: do it!

this.runningTasks--;
__classPrivateFieldGet(this, _process).call(this);
__classPrivateFieldGet(this, _RequestCoordinator_process, "f").call(this);
});

@@ -95,3 +93,3 @@ }

this.pending.push(executor);
__classPrivateFieldGet(this, _process).call(this);
__classPrivateFieldGet(this, _RequestCoordinator_process, "f").call(this);
});

@@ -102,7 +100,7 @@ };

get paused() {
return __classPrivateFieldGet(this, _paused);
return __classPrivateFieldGet(this, _RequestCoordinator_paused, "f");
}
}
exports.RequestCoordinator = RequestCoordinator;
_paused = new WeakMap(), _process = new WeakMap();
_RequestCoordinator_paused = new WeakMap(), _RequestCoordinator_process = new WeakMap();
//# sourceMappingURL=request-coordinator.js.map

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

*
* @param {number} size count of octets to allocate
* @param {number} - size count of octets to allocate
*/

@@ -23,3 +23,3 @@ const allocUnsafe = Buffer.allocUnsafe;

*
* @param num A positive whole number less than 33 bits wide, i.e. a uint32.
* @param num - A positive whole number less than 33 bits wide, i.e. a uint32.
* @returns an optimally sized buffer holding `num` in big-endian order (LSB is

@@ -88,3 +88,3 @@ * the _last_ value in the Buffer)

*
* @param num A positive whole number <= `Number.MAX_SAFE_INTEGER`
* @param num - A positive whole number <= `Number.MAX_SAFE_INTEGER`
* @returns an optimally sized buffer holding `num` in big-endian order (LSB is

@@ -176,3 +176,3 @@ * the _last_ value in the Buffer)

*
* @param num A positive whole number <= `Number.MAX_SAFE_INTEGER`
* @param num - A positive whole number <= `Number.MAX_SAFE_INTEGER`
*/

@@ -179,0 +179,0 @@ function uintToBuffer(num) {

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

* timer's callback is invoked.
* @param timer
* @param timer -
* @returns `true` if the timer could be `unref`ed, otherwise returns `false`

@@ -12,0 +12,0 @@ */

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

},
"version": "0.1.1-beta.1",
"version": "0.1.1-beta.2",
"description": "Utility functions for @ganache packages",

@@ -29,5 +29,5 @@ "author": "David Murdoch <david@trufflesuite.com> (https://davidmurdoch.com)",

"scripts": {
"tsc": "ttsc --build",
"tsc": "tsc --build",
"test": "npm run mocha",
"mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha -s 0 -t 0 --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'"
"mocha": "cross-env TS_NODE_FILES=true mocha -s 0 -t 0 --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'"
},

@@ -52,3 +52,3 @@ "bugs": {

"dependencies": {
"emittery": "0.7.2",
"emittery": "0.10.0",
"keccak": "3.0.1",

@@ -64,5 +64,4 @@ "seedrandom": "3.0.5"

"sinon": "11.1.2",
"ts-node": "9.1.1",
"ttypescript": "1.5.12",
"typescript": "4.1.3"
"ts-node": "10.4.0",
"typescript": "4.5.2"
},

@@ -72,3 +71,3 @@ "optionalDependencies": {

},
"gitHead": "fd31f6b70e9e5c9acfa2d232d4b34ccbbab2342d"
"gitHead": "ba61f67d4a3f7772e00e66c00b853206dc9e1c9e"
}

@@ -11,3 +11,3 @@ import { Api, KnownKeys, OverloadedParameters } from "../types";

readonly method: Method;
readonly params?: OverloadedParameters<Ledger[keyof Ledger]>;
readonly params?: OverloadedParameters<Ledger[Method]>;
};

@@ -25,3 +25,3 @@ export declare type JsonRpcResponse = JsonRpc & {

};
export declare const makeRequest: <Ledger extends Api, Method extends KnownKeys<Ledger>>(json: any) => JsonRpcRequest<Ledger, Method>;
export declare const makeRequest: <Ledger extends Api, Method extends keyof import("../types").RemoveIndex<Ledger>>(json: any) => JsonRpcRequest<Ledger, Method>;
export declare const makeResponse: (id: string, result: any) => JsonRpcResponse;

@@ -28,0 +28,0 @@ export declare const makeError: <T extends Error & {

@@ -5,3 +5,3 @@ import Emittery from "emittery";

* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.

@@ -12,3 +12,3 @@ */

* Creates a new resolved promievent for the provided value.
* @param value A promise.
* @param value - A promise.
* @returns A promievent whose internal state matches the provided promise.

@@ -28,3 +28,3 @@ */

* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @param onrejected - The callback to execute when the Promise is rejected.
* @returns A PromiEvent for the completion of the callback.

@@ -40,3 +40,3 @@ */

* Creates a new resolved promievent for the provided value.
* @param value A promise.
* @param value - A promise.
* @returns A promievent whose internal state matches the provided promise.

@@ -43,0 +43,0 @@ */

@@ -10,3 +10,6 @@ /// <reference types="node" />

*/
export interface Connector<ApiImplementation extends Api, RequestFormat, ResponseFormat> extends Emittery.Typed<undefined, "ready" | "close"> {
export interface Connector<ApiImplementation extends Api, RequestFormat, ResponseFormat> extends Emittery<{
ready: undefined;
close: undefined;
}> {
provider: Provider<ApiImplementation>;

@@ -21,3 +24,3 @@ /**

* Parses a raw message into something that can be handled by `handle`
* @param message
* @param message -
*/

@@ -27,3 +30,3 @@ parse(message: Buffer): RequestFormat;

* Handles a parsed message
* @param payload
* @param payload -
*/

@@ -41,4 +44,4 @@ handle: ((payload: RequestFormat, connection: HttpRequest) => Promise<{

* Formats the response (returned from `handle`)
* @param response
* @param payload
* @param response -
* @param payload -
*/

@@ -49,4 +52,4 @@ format(result: ResponseFormat, payload: RequestFormat): RecognizedString | Generator<RecognizedString>;

* Formats the error response
* @param error
* @param payload
* @param error -
* @param payload -
*/

@@ -53,0 +56,0 @@ formatError(error: Error, payload: RequestFormat): RecognizedString;

@@ -5,7 +5,6 @@ /// <reference types="node" />

export * from "./api";
export declare type KnownKeys<T> = {
[K in keyof T]: string extends K ? never : number extends K ? never : K;
} extends {
[_ in keyof T]: infer U;
} ? U : never;
export declare 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>;
declare global {

@@ -16,35 +15,32 @@ interface JSON {

}
declare type Has4Overloads<T> = T extends {
(...o: infer U): void;
(...o: infer U2): void;
(...o: infer U3): void;
(...o: infer U4): void;
} ? unknown[] extends U ? [] : true : false;
declare type Has3Overloads<T> = false extends Has4Overloads<T> ? T extends {
(...o: infer U): void;
(...o: infer U2): void;
(...o: infer U3): void;
} ? unknown[] extends U ? [] : true : false : false;
declare type Has2Overloads<T> = false extends Has4Overloads<T> ? false extends Has3Overloads<T> ? T extends {
(...o: infer U): void;
(...o: infer U2): void;
} ? unknown[] extends U ? [] : true : false : false : false;
declare type Has1Overload<T> = false extends Has4Overloads<T> ? false extends Has3Overloads<T> ? false extends Has2Overloads<T> ? T extends {
(...o: infer U): void;
} ? unknown[] extends U ? [] : true : false : false : false : false;
export declare type OverloadedParameters<T> = false extends Has1Overload<T> ? false extends Has2Overloads<T> ? false extends Has3Overloads<T> ? false extends Has4Overloads<T> ? [] : T extends {
(...o: infer U): void;
(...o: infer U1): void;
(...o: infer U2): void;
(...o: infer U3): void;
} ? U | U1 | U2 | U3 : never : T extends {
(...o: infer U): void;
(...o: infer U1): void;
(...o: infer U2): void;
} ? U | U1 | U2 : never : T extends {
(...o: infer U): void;
(...o: infer U1): void;
} ? U | U1 : never : T extends {
(...o: infer U): void;
} ? U : never;
declare type Overloads<T extends (...args: any[]) => any> = 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): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
(...args: infer A5): infer R5;
} ? ((...args: A1) => R1) | ((...args: A2) => R2) | ((...args: A3) => R3) | ((...args: A4) => R4) | ((...args: A5) => R5) : T extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
(...args: infer A4): infer R4;
} ? ((...args: A1) => R1) | ((...args: A2) => R2) | ((...args: A3) => R3) | ((...args: A4) => R4) : T extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
(...args: infer A3): infer R3;
} ? ((...args: A1) => R1) | ((...args: A2) => R2) | ((...args: A3) => R3) : T extends {
(...args: infer A1): infer R1;
(...args: infer A2): infer R2;
} ? ((...args: A1) => R1) | ((...args: A2) => R2) : T extends {
(...args: infer A1): infer R1;
} ? (...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>>>;
//# sourceMappingURL=index.d.ts.map
/// <reference types="node" />
/**
* note: this doesn't handle negative values
* @param value Buffer representation of a bigint, most-significant bit first (Big-endian)
* @param value - Buffer representation of a bigint, most-significant bit first (Big-endian)
*/
export declare function bufferToBigInt(value: Buffer): bigint;
//# sourceMappingURL=buffer-to-bigint.d.ts.map

@@ -6,5 +6,5 @@ /// <reference types="node" />

*
* @param buffer
* @param buffer -
*/
export declare function bufferToMinHexKey(buffer: Buffer): string;
//# sourceMappingURL=buffer-to-key.d.ts.map

@@ -11,4 +11,4 @@ import { KnownKeys, Api, OverloadedParameters } from "../types";

* Executes the method with the given methodName on the API
* @param methodName The name of the JSON-RPC method to execute.
* @param params The params to pass to the JSON-RPC method.
* @param methodName - The name of the JSON-RPC method to execute.
* @param params - The params to pass to the JSON-RPC method.
*/

@@ -15,0 +15,0 @@ execute<T extends Api, M extends KnownKeys<T>>(api: T, methodName: M, params: OverloadedParameters<T[M]>): Promise<{

@@ -17,5 +17,5 @@ /**

*
* @param array
* @param val Value of the upper bound to search for in the range.
* @param comp A function that accepts two arguments (the first is always
* @param array -
* @param val - Value of the upper bound to search for in the range.
* @param comp - A function that accepts two arguments (the first is always
* `val`, and the second from the given `array`) and returns bool. The value

@@ -22,0 +22,0 @@ * returned indicates whether the first argument is considered to go before the

@@ -7,4 +7,4 @@ /**

*
* @param obj The object that will be checked.
* @param v A property name.
* @param obj - The object that will be checked.
* @param v - A property name.
* @returns `true` if the object has a property with the specified name,

@@ -11,0 +11,0 @@ * otherwise false.

@@ -12,4 +12,4 @@ declare type Comparator<T> = (values: T[], a: number, b: number) => boolean;

* read and remove the element call `shift()`
* @param less the comparator function
* @param refresher the refresher function
* @param less - the comparator function
* @param refresher - the refresher function
*/

@@ -21,3 +21,3 @@ constructor(less: Comparator<T>, refresher?: (item: T, context: U) => void);

* item in the heap and then re-sorting.
* @param context
* @param context -
*/

@@ -27,3 +27,3 @@ /**

* item in the heap and then re-sorting.
* @param context
* @param context -
*/

@@ -33,3 +33,3 @@ refresh(context: U): void;

* Pushes a new element onto the heap
* @param value
* @param value -
*/

@@ -56,3 +56,3 @@ push(value: T): void;

* unexpected behavior.
* @param newValue
* @param newValue -
*/

@@ -64,4 +64,4 @@ replaceBest(newValue: T): void;

* find unexpected behavior.
* @param i
* @param newValue
* @param i -
* @param newValue -
*/

@@ -72,3 +72,3 @@ replace(i: number, newValue: T): void;

* The complexity is O(log n) where n = this.size().
* @param i the element to remove
* @param i - the element to remove
*/

@@ -90,3 +90,3 @@ remove(i: number): void;

* The complexity is O(log n) where n = this.size().
* @param i
* @param i -
*/

@@ -98,4 +98,4 @@ fix(i: number): void;

* Swaps the elements in the heap
* @param i The first element
* @param j The second element
* @param i - The first element
* @param j - The second element
*/

@@ -106,5 +106,5 @@ private swap;

* heap.
* @param item
* @param less
* @param refresher
* @param item -
* @param less -
* @param refresher -
*/

@@ -111,0 +111,0 @@ static from<T, U>(item: T, less: Comparator<T>, refresher?: (item: T, context: U) => void): Heap<T, U>;

/// <reference types="node" />
/**
* keccak256, but faster if you use it a lot.
* @param buffer
* @param buffer -
*/
export declare function keccak(buffer: Buffer): Buffer;
//# sourceMappingURL=keccak.d.ts.map

@@ -22,3 +22,3 @@ import { OverloadedParameters } from "../types";

* Promise-based FIFO queue.
* @param limit The number of requests that can be processed at a time.
* @param limit - The number of requests that can be processed at a time.
* Default value is is no limit (`0`).

@@ -39,3 +39,53 @@ */

*/
queue: <T extends (...args: unknown[]) => unknown>(fn: T, thisArgument: any, argumentsList: OverloadedParameters<T>) => Promise<{
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 I ? unknown[] extends I ? never : I : 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>) => Promise<{
value: ReturnType<T>;

@@ -42,0 +92,0 @@ }>;

@@ -10,5 +10,5 @@ /// <reference types="node" />

*
* @param num A positive whole number <= `Number.MAX_SAFE_INTEGER`
* @param num - A positive whole number <= `Number.MAX_SAFE_INTEGER`
*/
export declare function uintToBuffer(num: number): Buffer;
//# sourceMappingURL=uint-to-buffer.d.ts.map

@@ -7,3 +7,3 @@ /// <reference types="node" />

* timer's callback is invoked.
* @param timer
* @param timer -
* @returns `true` if the timer could be `unref`ed, otherwise returns `false`

@@ -10,0 +10,0 @@ */

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

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