Socket
Socket
Sign inDemoInstall

@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.5 to 8.0.6

8

dist/account.d.ts

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

export declare const isZeroAddress: (hexAddress: string) => boolean;
export declare function accountBodyFromSlim(body: AccountBodyBuffer): (Uint8Array | Buffer)[];
export declare function accountBodyToSlim(body: AccountBodyBuffer): (Uint8Array | Buffer)[];
export declare function accountBodyFromSlim(body: AccountBodyBuffer): (Buffer | Uint8Array)[];
export declare function accountBodyToSlim(body: AccountBodyBuffer): (Buffer | Uint8Array)[];
/**
* 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
* Converts a slim account RLP to a normal account RLP
*/
export declare function accountBodyToRLP(body: AccountBodyBuffer, couldBeSlim?: boolean): Buffer;
//# sourceMappingURL=account.d.ts.map

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

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

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

/**
* 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
* Converts a slim account RLP to a normal account RLP
*/

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

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

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

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

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

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

@@ -166,3 +166,2 @@ /// <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.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;
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,6 +350,2 @@ 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,4 +13,2 @@ /// <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.
*/

@@ -52,3 +50,2 @@ 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.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;
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,6 +15,4 @@ /**

* 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('115792089237316195423570985008687907853269984665640564039457584007913129639935');
exports.MAX_INTEGER_BIGINT = BigInt(2) ** BigInt(256) - BigInt(1);
exports.SECP256K1_ORDER = BigInt('0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141');

@@ -54,3 +52,2 @@ 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

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

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

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

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

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

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

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

*/
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 = exports.ssz = void 0;
exports.toAscii = exports.stripHexPrefix = exports.padToEven = exports.isHexString = exports.isHexPrefixed = exports.getKeys = exports.getBinarySize = exports.fromUtf8 = exports.fromAscii = exports.arrayContainsArray = void 0;
/**

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

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

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

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

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

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

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

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

@@ -74,3 +61,2 @@ 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', received ${typeof str}`);
throw new Error(`[getBinarySize] method requires input type 'string', recieved ${typeof str}`);
}

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

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

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

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

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

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

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

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

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

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

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

/**
* 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
* Converts a slim account RLP to a normal account RLP
*/

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

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

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

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

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

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

@@ -17,8 +17,4 @@ 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(
'115792089237316195423570985008687907853269984665640564039457584007913129639935'
)
export const MAX_INTEGER_BIGINT = BigInt(2) ** BigInt(256) - BigInt(1)

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

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

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

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

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

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

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

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

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

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

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

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

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

if (typeof str !== 'string') {
throw new Error(`[getBinarySize] method requires input type 'string', received ${typeof str}`)
throw new Error(`[getBinarySize] method requires input type 'string', recieved ${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

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