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
2
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eth-optimism/core-utils

[Optimism] Core typescript utilities

  • 0.0.0-develop-20230921172205
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
85K
decreased by-31.75%
Maintainers
2
Weekly downloads
 
Created

What is @eth-optimism/core-utils?

@eth-optimism/core-utils is a utility library for working with the Optimism Layer 2 scaling solution for Ethereum. It provides various tools and utilities to facilitate the development and interaction with the Optimism network.

What are @eth-optimism/core-utils's main functionalities?

Merkle Tree Utilities

This feature allows you to create and manipulate Merkle Trees, which are essential for various cryptographic proofs in blockchain technology.

const { MerkleTree } = require('@eth-optimism/core-utils');

const elements = ['a', 'b', 'c'];
const tree = new MerkleTree(elements);
const root = tree.getRoot();
console.log('Merkle Root:', root);

Hexadecimal Utilities

Provides utilities for converting between hexadecimal strings and buffers, which is useful for encoding and decoding data in Ethereum transactions.

const { toHexString, fromHexString } = require('@eth-optimism/core-utils');

const hexString = toHexString(Buffer.from('hello'));
console.log('Hex String:', hexString);
const buffer = fromHexString(hexString);
console.log('Buffer:', buffer.toString());

Address Utilities

Includes functions for validating and formatting Ethereum addresses, ensuring they are correctly checksummed.

const { isAddress, getAddress } = require('@eth-optimism/core-utils');

const address = '0x1234567890abcdef1234567890abcdef12345678';
console.log('Is Address:', isAddress(address));
console.log('Checksummed Address:', getAddress(address));

Other packages similar to @eth-optimism/core-utils

Keywords

FAQs

Package last updated on 21 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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