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

@nomicfoundation/ethereumjs-util

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nomicfoundation/ethereumjs-util - npm Package Compare versions

Comparing version 8.0.6 to 9.0.0

src/asyncEventEmitter.ts

4

dist/account.d.ts

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

/**
* Converts a slim account RLP to a normal account RLP
* Converts a slim account (per snap protocol spec) to the RLP encoded version of the account
* @param body Array of 4 Buffer-like items to represent the account
* @returns RLP encoded version of the account
*/
export declare function accountBodyToRLP(body: AccountBodyBuffer, couldBeSlim?: boolean): Buffer;
//# sourceMappingURL=account.d.ts.map

@@ -183,3 +183,8 @@ "use strict";

const isValidPrivate = function (privateKey) {
return (0, secp256k1_1.privateKeyVerify)(privateKey);
try {
return (0, secp256k1_1.privateKeyVerify)(privateKey);
}
catch {
return false;
}
};

@@ -298,3 +303,5 @@ exports.isValidPrivate = isValidPrivate;

/**
* Converts a slim account RLP to a normal account RLP
* Converts a slim account (per snap protocol spec) to the RLP encoded version of the account
* @param body Array of 4 Buffer-like items to represent the account
* @returns RLP encoded version of the account
*/

@@ -301,0 +308,0 @@ function accountBodyToRLP(body, couldBeSlim = true) {

/// <reference types="node" />
/**
* Handling and generating Ethereum addresses
*/
export declare class Address {

@@ -3,0 +6,0 @@ readonly buf: Buffer;

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

const bytes_1 = require("./bytes");
/**
* Handling and generating Ethereum addresses
*/
class Address {

@@ -8,0 +11,0 @@ constructor(buf) {

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

export declare function bigIntToUnpaddedBuffer(value: bigint): Buffer;
export declare function intToUnpaddedBuffer(value: number): Buffer;
//# sourceMappingURL=bytes.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bigIntToUnpaddedBuffer = exports.bigIntToHex = exports.bufArrToArr = exports.arrToBufArr = exports.validateNoLeadingZeroes = exports.baToJSON = exports.toUtf8 = exports.short = exports.addHexPrefix = exports.toUnsigned = exports.fromSigned = exports.bufferToInt = exports.bigIntToBuffer = exports.bufferToBigInt = exports.bufferToHex = exports.toBuffer = exports.unpadHexString = exports.unpadArray = exports.unpadBuffer = exports.setLengthRight = exports.setLengthLeft = exports.zeros = exports.intToBuffer = exports.intToHex = void 0;
exports.intToUnpaddedBuffer = exports.bigIntToUnpaddedBuffer = exports.bigIntToHex = exports.bufArrToArr = exports.arrToBufArr = exports.validateNoLeadingZeroes = exports.baToJSON = exports.toUtf8 = exports.short = exports.addHexPrefix = exports.toUnsigned = exports.fromSigned = exports.bufferToInt = exports.bigIntToBuffer = exports.bufferToBigInt = exports.bufferToHex = exports.toBuffer = exports.unpadHexString = exports.unpadArray = exports.unpadBuffer = exports.setLengthRight = exports.setLengthLeft = exports.zeros = exports.intToBuffer = exports.intToHex = void 0;
const helpers_1 = require("./helpers");

@@ -350,2 +350,6 @@ const internal_1 = require("./internal");

exports.bigIntToUnpaddedBuffer = bigIntToUnpaddedBuffer;
function intToUnpaddedBuffer(value) {
return (0, exports.unpadBuffer)((0, exports.intToBuffer)(value));
}
exports.intToUnpaddedBuffer = intToUnpaddedBuffer;
//# sourceMappingURL=bytes.js.map

@@ -13,2 +13,4 @@ /// <reference types="node" />

* The max integer that the evm can handle (2^256-1) as a bigint
* 2^256-1 equals to 340282366920938463463374607431768211455
* We use literal value instead of calculated value for compatibility issue.
*/

@@ -50,2 +52,3 @@ export declare const MAX_INTEGER_BIGINT: bigint;

export declare const RLP_EMPTY_STRING: Buffer;
export declare const MAX_WITHDRAWALS_PER_PAYLOAD = 16;
//# sourceMappingURL=constants.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RLP_EMPTY_STRING = exports.KECCAK256_RLP = exports.KECCAK256_RLP_S = exports.KECCAK256_RLP_ARRAY = exports.KECCAK256_RLP_ARRAY_S = exports.KECCAK256_NULL = exports.KECCAK256_NULL_S = exports.TWO_POW256 = exports.SECP256K1_ORDER_DIV_2 = exports.SECP256K1_ORDER = exports.MAX_INTEGER_BIGINT = exports.MAX_INTEGER = exports.MAX_UINT64 = void 0;
exports.MAX_WITHDRAWALS_PER_PAYLOAD = exports.RLP_EMPTY_STRING = exports.KECCAK256_RLP = exports.KECCAK256_RLP_S = exports.KECCAK256_RLP_ARRAY = exports.KECCAK256_RLP_ARRAY_S = exports.KECCAK256_NULL = exports.KECCAK256_NULL_S = exports.TWO_POW256 = exports.SECP256K1_ORDER_DIV_2 = exports.SECP256K1_ORDER = exports.MAX_INTEGER_BIGINT = exports.MAX_INTEGER = exports.MAX_UINT64 = void 0;
const buffer_1 = require("buffer");

@@ -15,4 +15,6 @@ /**

* The max integer that the evm can handle (2^256-1) as a bigint
* 2^256-1 equals to 340282366920938463463374607431768211455
* We use literal value instead of calculated value for compatibility issue.
*/
exports.MAX_INTEGER_BIGINT = BigInt(2) ** BigInt(256) - BigInt(1);
exports.MAX_INTEGER_BIGINT = BigInt('115792089237316195423570985008687907853269984665640564039457584007913129639935');
exports.SECP256K1_ORDER = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');

@@ -52,2 +54,3 @@ exports.SECP256K1_ORDER_DIV_2 = exports.SECP256K1_ORDER / BigInt(2);

exports.RLP_EMPTY_STRING = buffer_1.Buffer.from([0x80]);
exports.MAX_WITHDRAWALS_PER_PAYLOAD = 16;
//# sourceMappingURL=constants.js.map

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

/// <reference types="node" />
/**

@@ -3,0 +2,0 @@ * Throws if a string is not hex prefixed

@@ -6,2 +6,6 @@ /**

/**
* Units helpers
*/
export * from './units';
/**
* Account class and helper functions

@@ -15,2 +19,6 @@ */

/**
* Withdrawal type
*/
export * from './withdrawal';
/**
* ECDSA signature

@@ -24,2 +32,6 @@ */

/**
* SSZ containers
*/
export * as ssz from './ssz';
/**
* Helpful TypeScript types

@@ -31,3 +43,5 @@ */

*/
export * from './asyncEventEmitter';
export { arrayContainsArray, fromAscii, fromUtf8, getBinarySize, getKeys, isHexPrefixed, isHexString, padToEven, stripHexPrefix, toAscii, } from './internal';
export * from './lock';
//# sourceMappingURL=index.d.ts.map

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.toAscii = exports.stripHexPrefix = exports.padToEven = exports.isHexString = exports.isHexPrefixed = exports.getKeys = exports.getBinarySize = exports.fromUtf8 = exports.fromAscii = exports.arrayContainsArray = void 0;
exports.toAscii = exports.stripHexPrefix = exports.padToEven = exports.isHexString = exports.isHexPrefixed = exports.getKeys = exports.getBinarySize = exports.fromUtf8 = exports.fromAscii = exports.arrayContainsArray = exports.ssz = void 0;
/**

@@ -24,2 +24,6 @@ * Constants

/**
* Units helpers
*/
__exportStar(require("./units"), exports);
/**
* Account class and helper functions

@@ -33,2 +37,6 @@ */

/**
* Withdrawal type
*/
__exportStar(require("./withdrawal"), exports);
/**
* ECDSA signature

@@ -42,2 +50,6 @@ */

/**
* SSZ containers
*/
exports.ssz = require("./ssz");
/**
* Helpful TypeScript types

@@ -49,2 +61,3 @@ */

*/
__exportStar(require("./asyncEventEmitter"), exports);
var internal_1 = require("./internal");

@@ -61,2 +74,3 @@ Object.defineProperty(exports, "arrayContainsArray", { enumerable: true, get: function () { return internal_1.arrayContainsArray; } });

Object.defineProperty(exports, "toAscii", { enumerable: true, get: function () { return internal_1.toAscii; } });
__exportStar(require("./lock"), exports);
//# sourceMappingURL=index.js.map

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

if (typeof str !== 'string') {
throw new Error(`[getBinarySize] method requires input type 'string', recieved ${typeof str}`);
throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof str}`);
}

@@ -76,0 +76,0 @@ return Buffer.byteLength(str, 'utf8');

{
"name": "@nomicfoundation/ethereumjs-util",
"version": "8.0.6",
"version": "9.0.0",
"description": "A collection of utility functions for Ethereum",

@@ -85,3 +85,4 @@ "keywords": [

"dependencies": {
"@nomicfoundation/ethereumjs-rlp": "4.0.3",
"@chainsafe/ssz": "^0.10.0",
"@nomicfoundation/ethereumjs-rlp": "5.0.0",
"ethereum-cryptography": "0.1.3"

@@ -88,0 +89,0 @@ },

@@ -56,2 +56,4 @@ # @ethereumjs/util

- Internalized helper methods
- [withdrawal](src/withdrawal.ts)
- Withdrawal class (EIP-4895)

@@ -58,0 +60,0 @@ ### BigInt Support

@@ -248,3 +248,7 @@ import { RLP } from '@nomicfoundation/ethereumjs-rlp'

export const isValidPrivate = function (privateKey: Buffer): boolean {
return privateKeyVerify(privateKey)
try {
return privateKeyVerify(privateKey)
} catch {
return false
}
}

@@ -365,3 +369,5 @@

/**
* Converts a slim account RLP to a normal account RLP
* Converts a slim account (per snap protocol spec) to the RLP encoded version of the account
* @param body Array of 4 Buffer-like items to represent the account
* @returns RLP encoded version of the account
*/

@@ -368,0 +374,0 @@ export function accountBodyToRLP(body: AccountBodyBuffer, couldBeSlim = true) {

@@ -10,2 +10,5 @@ import {

/**
* Handling and generating Ethereum addresses
*/
export class Address {

@@ -12,0 +15,0 @@ public readonly buf: Buffer

@@ -389,1 +389,5 @@ import { assertIsArray, assertIsBuffer, assertIsHexString } from './helpers'

}
export function intToUnpaddedBuffer(value: number): Buffer {
return unpadBuffer(intToBuffer(value))
}

@@ -17,4 +17,8 @@ import { Buffer } from 'buffer'

* The max integer that the evm can handle (2^256-1) as a bigint
* 2^256-1 equals to 340282366920938463463374607431768211455
* We use literal value instead of calculated value for compatibility issue.
*/
export const MAX_INTEGER_BIGINT = BigInt(2) ** BigInt(256) - BigInt(1)
export const MAX_INTEGER_BIGINT = BigInt(
'115792089237316195423570985008687907853269984665640564039457584007913129639935'
)

@@ -68,1 +72,3 @@ export const SECP256K1_ORDER = BigInt(

export const RLP_EMPTY_STRING = Buffer.from([0x80])
export const MAX_WITHDRAWALS_PER_PAYLOAD = 16

@@ -7,2 +7,7 @@ /**

/**
* Units helpers
*/
export * from './units'
/**
* Account class and helper functions

@@ -18,2 +23,7 @@ */

/**
* Withdrawal type
*/
export * from './withdrawal'
/**
* ECDSA signature

@@ -29,2 +39,7 @@ */

/**
* SSZ containers
*/
export * as ssz from './ssz'
/**
* Helpful TypeScript types

@@ -37,2 +52,3 @@ */

*/
export * from './asyncEventEmitter'
export {

@@ -50,1 +66,2 @@ arrayContainsArray,

} from './internal'
export * from './lock'

@@ -75,3 +75,3 @@ /*

if (typeof str !== 'string') {
throw new Error(`[getBinarySize] method requires input type 'string', recieved ${typeof str}`)
throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof str}`)
}

@@ -78,0 +78,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

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