@ liastools/ eth- 地址
XY Labs TypeScript/JavaScript 库中所使用的基本功能
安装
使用 npm :
npm install {{name}}
使用线条 :
yarn add {{name}}
使用 pnpm :
pnpm add {{name}}
使用包子 :
bun add {{name}}
许可证
见 自由主义 用于许可证权利和限制的文件(LGPL-3.0-只).
参考文献
软件包
地址
### .temp-typedoc
### classes
### <a id="EthAddressWrapper"></a>EthAddressWrapper
环绕 Ethereum 地址提供解析、格式化、校验和校验支持.
构造器
构造器
protected new EthAddressWrapper(address): EthAddressWrapper;
参数
地址
bigint
回返
EthAddressWrapper
方法
从 String () 中
static fromString(value?, base?): EthAddressWrapper | undefined;
参数
价值?
string
基地吗?
number =: 16
回返
EthAddressWrapper | undefined
参数( )
static parse(value, base?): EthAddressWrapper | undefined;
参数
价值
unknown
基地吗?
number
回返
EthAddressWrapper | undefined
验证( )
static validate(address): boolean;
参数
地址
string
回返
boolean
等于( )
equals(address?): boolean;
参数
地址吗?
string | EthAddressWrapper | null
回返
boolean
数字
toBigNumber(): bigint;
回返
bigint
toHex () (中文(简体) )
toHex(): string;
回返
string
转到 JSON ()
toJSON(): string;
回返
string
切换到小写
toLowerCaseString(): string;
回返
string
转到ShortString ()
toShortString(length?): string;
参数
长度 ?
number =: 2
回返
string
转到 String ()
toString(checksum?, chainId?): string;
参数
验收?
boolean
链路?
string
回返
string
验证( )
validate(): boolean;
回返
boolean
### functions
### <a id="ellipsize"></a>ellipsize
function ellipsize(value, length?): string;
截断字符串以显示第一个和最后一个 length 以椭圆分隔字符.
参数
价值
string
椭圆大小的字符串
长度 ?
number =: 2
每端保留字符数( 默认 2)
回返
string
椭圆字符串
### <a id="isEthAddressWrapper"></a>isEthAddressWrapper
function isEthAddressWrapper(obj): obj is { type: string } & EthAddressWrapper;
类型守护以检查给定对象是否为 EthAddressWrapper 实例 .
参数
目标
类型
string
回返
obj is { type: string } & EthAddressWrapper
### <a id="padHex"></a>padHex
function padHex(hex, byteCount?): string;
参数
六进制
string
字节Count?
number =: 0
回返
string