@xylabs/eth-address
v5.0.65
Published
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Readme
@xylabs/eth-address
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
Reference
@xylabs/eth-address
Classes
Functions
classes
EthAddress
Properties
type
readonly static type: "EthAddress" = 'EthAddress';type
type: string = EthAddress.type;Methods
fromString()
static fromString(value?, base?): undefined | EthAddress;Parameters
value?
string
base?
number = 16
Returns
undefined | EthAddress
parse()
static parse(value, base?): undefined | EthAddress;Parameters
value
unknown
base?
number
Returns
undefined | EthAddress
validate()
static validate(address): boolean;Parameters
address
string
Returns
boolean
equals()
equals(address?): boolean;Parameters
address?
null | string | EthAddress
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
ellipsize
function ellipsize(value, length): string;Parameters
value
string
length
number = 2
Returns
string
isEthAddress
function isEthAddress(obj): boolean;Parameters
obj
type
string
Returns
boolean
padHex
function padHex(hex, byteCount): string;Parameters
hex
string
byteCount
number = 0
Returns
string
Part of sdk-js
Maintainers
License
See the LICENSE file for license details
