address

Object that allows you to convert between hex / base58 and privatekey representations of a VISION address.

📘

NOTE:

If you wish to convert generic data to hexadecimal strings, please use the function visionWeb.toHex.

visionWeb.address.toHex

Convert Base58 format addresses to Hex

Usage

visionWeb.address.toHex(address);

Parameters

ParameterDescriptionTypeDefault
addressaddress-base58 formatstring-

Returns

String

Example

visionWeb.address.toHex("VEoh3WDXviqcPZ1qVNCQpqLHYzigrQWTPL");
> 462d7a77f8bef6fe225bf5e353dd6a380f588a1496

visionWeb.address.fromHex

Convert Hexstring format address to Base58 format address

Usage

visionWeb.address.fromHex(address);

Parameters

ParameterDescriptionTypeDefault
addressaddress-hexstring formatstring-

Returns

String

Example

visionWeb.address.fromHex("462d7a77f8bef6fe225bf5e353dd6a380f588a1496");
> VEoh3WDXviqcPZ1qVNCQpqLHYzigrQWTPL

visionWeb.address.fromPrivateKey

Derive its corresponding address based on the private key

Usage

visionWeb.address.fromPrivateKey(privateKey);

Parameters

ParameterDescriptionTypeDefault
privateKeyprivateKeystring-

Returns

String

Example

visionWeb.address.fromPrivateKey("your private key")
> VEoh3WDXviqcPZ1qVNCQpqLHYzigrQWTPL

visionWeb.address.fromEth

Derive the vision public key address based on the Ethereum public key.

Usage

visionWeb.address.fromEth(address);;

Parameters

ParameterDescriptionTypeDefault值
addressEthereum public keystring-

Returns

string。

Example

visionWeb.address.fromEth('0x609395874f03E676603E7A173bCA2eB30012d7cc')
> VKTsbLhPk7W5QTWbBEsi9E1DAZwbRzSrKd