- encodeCfxAddress(address, numberId, [verbose]) ⇒
string
encode hex40 address to base32 address
- decodeCfxAddress(address) ⇒
object
decode base32 address to hex40 address
- isValidCfxAddress(address) ⇒
boolean
check if the address is valid
- verifyCfxAddress(address) ⇒
boolean
verify base32 address if pass return true if not throw error
- hasNetworkPrefix(address) ⇒
boolean
check if the address has network prefix
- simplifyCfxAddress(address) ⇒
string
simplify base32 address to non verbose address
- shortenCfxAddress(address) ⇒
string
- isZeroAddress(address) ⇒
boolean
- isInternalContractAddress(address) ⇒
boolean
- isValidHexAddress(address) ⇒
boolean
- isValidCfxHexAddress(address) ⇒
boolean
check if the address is valid conflux hex address
- ethChecksumAddress(address) ⇒
string
Makes a ethereum checksum address
- ethAddressToCfxAddress(address) ⇒
string
Convert an ethereum address to conflux hex address by replace it's first letter to 1
- cfxMappedEVMSpaceAddress(address) ⇒
string
Calculate CFX space address's mapped EVM address
encode hex40 address to base32 address
Kind: global function
Returns: string
- base32 string address
Param | Type | Description |
---|---|---|
address | string | Buffer |
hex40 address |
numberId | number |
networkId |
[verbose] | boolean |
if true, return verbose address |
decode base32 address to hex40 address
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
check if the address is valid
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
verify base32 address if pass return true if not throw error
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
check if the address has network prefix
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
simplify base32 address to non verbose address
Kind: global function
Returns: string
- return a non verbose address
Param | Type | Description |
---|---|---|
address | string |
base32 string |
Kind: global function
Returns: string
- Return a short address
Param | Type | Description |
---|---|---|
address | string |
base32 string |
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
hex string |
check if the address is valid conflux hex address
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
hex string |
Makes a ethereum checksum address
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
Hex string |
Example
> ethChecksumAddress('0x1b716c51381e76900ebaa7999a488511a4e1fd0a')
"0x1B716c51381e76900EBAA7999A488511A4E1fD0a"
Convert an ethereum address to conflux hex address by replace it's first letter to 1
Kind: global function
Param | Type |
---|---|
address | string |
Calculate CFX space address's mapped EVM address
Kind: global function
Param | Type | Description |
---|---|---|
address | string |
base32 string |
Example
> cfxMappedEVMSpaceAddress(cfx:aak2rra2njvd77ezwjvx04kkds9fzagfe6ku8scz91)
"0x12Bf6283CcF8Ad6ffA63f7Da63EDc217228d839A"