Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

@xylabs/eth-address

Package Overview
Dependencies
Maintainers
5
Versions
523
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xylabs/eth-address

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

latest
Source
npmnpm
Version
5.0.100
Version published
Weekly downloads
1.5K
-59.66%
Maintainers
5
Weekly downloads
 
Created
Source

@xylabs/eth-address

npm license

Base functionality used throughout XY Labs TypeScript/JavaScript libraries

Install

Using npm:

npm install {{name}}

Using yarn:

yarn add {{name}}

Using pnpm:

pnpm add {{name}}

Using bun:

bun add {{name}}

License

See the LICENSE file for license rights and limitations (LGPL-3.0-only).

Reference

packages

eth-address

### .temp-typedoc

  ### classes

    ### <a id="EthAddressWrapper"></a>EthAddressWrapper

@xylabs/eth-address

Wrapper around an Ethereum address providing parsing, formatting, validation, and checksum support.

Constructors

Constructor

protected new EthAddressWrapper(address): EthAddressWrapper;

Parameters

address

bigint

Returns

EthAddressWrapper

Methods

fromString()

static fromString(value?, base?): EthAddressWrapper | undefined;

Parameters

value?

string

base?

number = 16

Returns

EthAddressWrapper | undefined

parse()

static parse(value, base?): EthAddressWrapper | undefined;

Parameters

value

unknown

base?

number

Returns

EthAddressWrapper | undefined

validate()

static validate(address): boolean;

Parameters

address

string

Returns

boolean

equals()

equals(address?): boolean;

Parameters

address?

string | EthAddressWrapper | null

Returns

boolean

toBigNumber()

toBigNumber(): bigint;

Returns

bigint

toHex()

toHex(): string;

Returns

string

toJSON()

toJSON(): string;

Returns

string

toLowerCaseString()

toLowerCaseString(): string;

Returns

string

toShortString()

toShortString(length?): string;

Parameters

length?

number = 2

Returns

string

toString()

toString(checksum?, chainId?): string;

Parameters

checksum?

boolean

chainId?

string

Returns

string

validate()

validate(): boolean;

Returns

boolean

  ### functions

    ### <a id="ellipsize"></a>ellipsize

@xylabs/eth-address

function ellipsize(value, length?): string;

Truncates a string to show the first and last length characters separated by an ellipsis.

Parameters

value

string

The string to ellipsize

length?

number = 2

Number of characters to keep at each end (default 2)

Returns

string

The ellipsized string

    ### <a id="isEthAddressWrapper"></a>isEthAddressWrapper

@xylabs/eth-address

function isEthAddressWrapper(obj): obj is { type: string } & EthAddressWrapper;

Type guard that checks if the given object is an instance of EthAddressWrapper.

Parameters

obj

type

string

Returns

obj is { type: string } & EthAddressWrapper

    ### <a id="padHex"></a>padHex

@xylabs/eth-address

function padHex(hex, byteCount?): string;

Parameters

hex

string

byteCount?

number = 0

Returns

string

Keywords

eth

FAQs

Package last updated on 22 Apr 2026

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