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

@eth-optimism/core-utils

Package Overview
Dependencies
Maintainers
5
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eth-optimism/core-utils - npm Package Compare versions

Comparing version 0.0.1-alpha.25 to 0.0.1-alpha.26

build/src/app/bloom_filter.js

18

build/index.js
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.rootPath = void 0;
const rootPath = __dirname;
exports.rootPath = rootPath;
__export(require("./src/app"));
__export(require("./src/types"));
__exportStar(require("./src/app"), exports);
__exportStar(require("./src/types"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bufferUtils = void 0;
const misc_1 = require("./misc");

@@ -4,0 +5,0 @@ const lte = (buf1, buf2) => {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ZERO_ADDRESS = void 0;
exports.ZERO_ADDRESS = '0x' + '00'.repeat(20);
//# sourceMappingURL=constants.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateAddress = exports.getDeployedContractAddress = exports.deploy = exports.deployContract = void 0;
const dotenv_1 = require("dotenv");

@@ -4,0 +5,0 @@ const ethers_1 = require("ethers");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hashFunctionFor = exports.keccak256 = exports.Md5Hash = void 0;
const ts_md5_1 = require("ts-md5");

@@ -4,0 +5,0 @@ const ethers_1 = require("ethers");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.objectsEqual = exports.areEqual = void 0;
exports.areEqual = (one, two) => {

@@ -4,0 +5,0 @@ if ((one === undefined && two === undefined) ||

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.abi = void 0;
const ethers_1 = require("ethers");
exports.abi = new ethers_1.ethers.utils.AbiCoder();
__export(require("./serialization"));
__export(require("./transport"));
__export(require("./buffer"));
__export(require("./contract-deployment"));
__export(require("./crypto"));
__export(require("./equals"));
__export(require("./log"));
__export(require("./misc"));
__export(require("./number"));
__export(require("./signatures"));
__export(require("./constants"));
__export(require("./test-utils"));
__exportStar(require("./serialization"), exports);
__exportStar(require("./transport"), exports);
__exportStar(require("./buffer"), exports);
var bloom_filter_1 = require("./bloom_filter");
Object.defineProperty(exports, "BloomFilter", { enumerable: true, get: function () { return bloom_filter_1.default; } });
__exportStar(require("./contract-deployment"), exports);
__exportStar(require("./crypto"), exports);
__exportStar(require("./equals"), exports);
__exportStar(require("./log"), exports);
__exportStar(require("./misc"), exports);
__exportStar(require("./number"), exports);
__exportStar(require("./signatures"), exports);
__exportStar(require("./constants"), exports);
__exportStar(require("./test-utils"), exports);
__exportStar(require("./time-bucketed-counter"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.logError = exports.getLogger = exports.LOG_NEWLINE_STRING = void 0;
const debug_1 = require("debug");
exports.getLogger = (identifier, isTest = false) => {
exports.LOG_NEWLINE_STRING = ' <\\n> ';
exports.getLogger = (identifier, isTest = false, debugToUseTestOnly) => {
const testString = isTest ? 'test:' : '';
return {
debug: debug_1.default(`${testString}debug:${identifier}`),
info: debug_1.default(`${testString}info:${identifier}`),
warn: debug_1.default(`${testString}warn:${identifier}`),
error: debug_1.default(`${testString}error:${identifier}`),
debug: getLogFunction(`${testString}debug:${identifier}`, debugToUseTestOnly),
info: getLogFunction(`${testString}info:${identifier}`, debugToUseTestOnly),
warn: getLogFunction(`${testString}warn:${identifier}`, debugToUseTestOnly),
error: getLogFunction(`${testString}error:${identifier}`, debugToUseTestOnly),
};

@@ -18,2 +20,21 @@ };

};
const joinNewLines = (...logs) => {
const stringifiedLogs = [];
for (const l of logs) {
if (typeof l !== 'string') {
stringifiedLogs.push(JSON.stringify(l));
}
else {
stringifiedLogs.push(l);
}
}
return stringifiedLogs.join(' ').replace(/\n/g, exports.LOG_NEWLINE_STRING);
};
const getLogFunction = (identifier, debugToUseTestOnly = debug_1.default) => {
const d = debugToUseTestOnly(identifier);
return (...logs) => {
const singleLine = joinNewLines(...logs);
return d(singleLine);
};
};
//# sourceMappingURL=log.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCurrentTime = exports.runInDomain = exports.except = exports.isHexStringEmptyOrUndefined = exports.hexStrToString = exports.strToHexStr = exports.bufToHexString = exports.castToNumber = exports.hexStrToNumber = exports.hexStrToBuf = exports.hexStringify = exports.numberToHexString = exports.bnToHexString = exports.reverse = exports.getNullString = exports.isObject = exports.padToLength = exports.add0x = exports.remove0x = exports.sleep = exports.prettify = exports.isJson = exports.jsonify = exports.stringify = exports.NULL_ADDRESS = void 0;
const domain = require("domain");
const number_1 = require("./number");
const utils_1 = require("ethers/utils");
exports.NULL_ADDRESS = '0x0000000000000000000000000000000000000000';

@@ -66,4 +66,4 @@ exports.stringify = (value) => {

};
exports.numberToHexString = (bn) => {
return exports.add0x(bn.toString(16));
exports.numberToHexString = (number) => {
return exports.add0x(number.toString(16));
};

@@ -124,12 +124,2 @@ exports.hexStringify = (value) => {

};
exports.rlpEncodeTransaction = (transaction) => {
return utils_1.RLP.encode([
utils_1.hexlify(transaction['nonce']),
utils_1.hexlify(transaction['gasPrice']),
utils_1.hexlify(transaction['gasLimit']),
utils_1.hexlify(transaction['to']),
utils_1.hexlify(transaction['value']),
transaction['data'],
]);
};
//# sourceMappingURL=misc.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MAX_BIG_NUM = exports.ONE_HALF = exports.THREE = exports.TWO = exports.ONE = exports.ZERO = exports.BigNumber = exports.LITTLE_ENDIAN = exports.BIG_ENDIAN = void 0;
const BigNum = require("bn.js");

@@ -4,0 +5,0 @@ const assert = require("assert");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AbiRange = void 0;
const index_1 = require("../index");

@@ -4,0 +5,0 @@ const number_1 = require("../number");

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./abi-range"));
__export(require("./serializers"));
__exportStar(require("./abi-range"), exports);
__exportStar(require("./serializers"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.objectToBuffer = exports.deserializeObject = exports.serializeObject = void 0;
exports.serializeObject = (obj) => {

@@ -4,0 +5,0 @@ return JSON.stringify(obj);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChecksumAgnosticIdentityVerifier = exports.IdentityVerifier = exports.IdentitySigner = exports.DefaultSignatureProvider = exports.DefaultSignatureVerifier = void 0;
const ethers_1 = require("ethers");

@@ -4,0 +5,0 @@ const misc_1 = require("./misc");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestUtils = void 0;
const assert = require("assert");

@@ -20,2 +21,3 @@ class TestUtils {

let succeeded = true;
let error;
try {

@@ -29,4 +31,6 @@ await func();

}
error = e;
}
assert(succeeded, "Function didn't throw as expected or threw the wrong error.");
return error;
}

@@ -33,0 +37,0 @@ static async assertRevertsAsync(revertMessage, func) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AxiosHttpClient = void 0;
const axios_1 = require("axios");

@@ -4,0 +5,0 @@ class AxiosHttpClient {

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./axios-http-client"));
__export(require("./json-rpc-client"));
__export(require("./json-rpc-http-adapter"));
__exportStar(require("./axios-http-client"), exports);
__exportStar(require("./json-rpc-client"), exports);
__exportStar(require("./json-rpc-http-adapter"), exports);
var simple_client_1 = require("./simple-client");
exports.SimpleClient = simple_client_1.SimpleClient;
Object.defineProperty(exports, "SimpleClient", { enumerable: true, get: function () { return simple_client_1.SimpleClient; } });
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonRpcClient = void 0;
const uuid = require("uuid");

@@ -11,2 +12,9 @@ const types_1 = require("../../../types");

async handle(method, params) {
const response = await this.makeRpcCall(method, params);
if (types_1.isJsonRpcErrorResponse(response)) {
throw new Error(`${JSON.stringify(response.error)}`);
}
return response.result;
}
async makeRpcCall(method, params) {
const request = {

@@ -20,7 +28,3 @@ jsonrpc: '2.0',

const encodedResponse = await this.client.request(encodedRequest);
const response = this.adapter.decodeResponse(encodedResponse);
if (types_1.isJsonRpcErrorResponse(response)) {
throw new Error(`${JSON.stringify(response.error)}`);
}
return response.result;
return this.adapter.decodeResponse(encodedResponse);
}

@@ -27,0 +31,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonRpcHttpAdapter = void 0;
class JsonRpcHttpAdapter {

@@ -4,0 +5,0 @@ encodeRequest(request) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SimpleClient = void 0;
const json_rpc_client_1 = require("./json-rpc-client");

@@ -14,4 +15,7 @@ const json_rpc_http_adapter_1 = require("./json-rpc-http-adapter");

}
async makeRpcCall(method, params) {
return this.jsonRpcClient.makeRpcCall(method, params);
}
}
exports.SimpleClient = SimpleClient;
//# sourceMappingURL=simple-client.js.map
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./server"));
__export(require("./client"));
__exportStar(require("./server"), exports);
__exportStar(require("./client"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpressHttpServer = void 0;
const bodyParser = require("body-parser");

@@ -4,0 +5,0 @@ class ExpressHttpServer {

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./express-http-server"));
__export(require("./json-rpc-server"));
__export(require("./json-rpc-errors"));
__export(require("./simple-server"));
__exportStar(require("./express-http-server"), exports);
__exportStar(require("./json-rpc-server"), exports);
__exportStar(require("./json-rpc-errors"), exports);
__exportStar(require("./simple-server"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildJsonRpcError = exports.JSONRPC_ERRORS = void 0;
exports.JSONRPC_ERRORS = {

@@ -24,2 +25,6 @@ PARSE_ERROR: {

},
UNSUPPORTED_TOPICS_ERROR: {
code: -32604,
message: 'Unsupported filter parameters',
},
REVERT_ERROR: {

@@ -26,0 +31,0 @@ code: -32015,

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonRpcServer = void 0;
const types_1 = require("../../../types");

@@ -4,0 +5,0 @@ const json_rpc_errors_1 = require("./json-rpc-errors");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var json_rpc_server_1 = require("./json-rpc-server");
exports.SimpleServer = json_rpc_server_1.JsonRpcServer;
Object.defineProperty(exports, "SimpleServer", { enumerable: true, get: function () { return json_rpc_server_1.JsonRpcServer; } });
//# sourceMappingURL=simple-server.js.map
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./app"));
__export(require("./types"));
__exportStar(require("./app"), exports);
__exportStar(require("./types"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HashAlgorithm = void 0;
var HashAlgorithm;

@@ -4,0 +5,0 @@ (function (HashAlgorithm) {

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("./hash-algorithms"));
__export(require("./type-guards"));
__exportStar(require("./keystore"), exports);
__exportStar(require("./serialization"), exports);
__exportStar(require("./contract-deployment"), exports);
__exportStar(require("./hash-algorithms"), exports);
__exportStar(require("./log"), exports);
__exportStar(require("./range"), exports);
__exportStar(require("./signatures.interface"), exports);
__exportStar(require("./transport.interface"), exports);
__exportStar(require("./type-guards"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./keystore.interface"), exports);
__exportStar(require("./wallet.interface"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./type.interface"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidHexAddress = exports.isValidRange = exports.isJsonRpcRequest = exports.isJsonRpcErrorResponse = void 0;
const app_1 = require("../app");

@@ -4,0 +5,0 @@ const ethers_1 = require("ethers");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.rootPath = exports.should = void 0;
const fs = require("fs");

@@ -4,0 +5,0 @@ const path = require("path");

{
"name": "@eth-optimism/core-utils",
"version": "0.0.1-alpha.25",
"version": "0.0.1-alpha.26",
"description": "Optimism Core Utils",

@@ -41,2 +41,3 @@ "main": "build/index.js",

"dotenv": "^8.2.0",
"ethereumjs-util": "^6.2.0",
"ethers": "^4.0.37",

@@ -64,3 +65,3 @@ "express": "^4.17.1",

},
"gitHead": "e770cebb0b2d8a46be08bd602b806fcb38ae4c4a"
"gitHead": "ccce366645fca6bad46c5cf7f7ff2f407c6ba5fd"
}
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