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
Parameter | Description | Type | Default |
---|---|---|---|
address | address-base58 format | string | - |
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
Parameter | Description | Type | Default |
---|---|---|---|
address | address-hexstring format | string | - |
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
Parameter | Description | Type | Default |
---|---|---|---|
privateKey | privateKey | string | - |
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
Parameter | Description | Type | Default值 |
---|---|---|---|
address | Ethereum public key | string | - |
Returns
string。
Example
visionWeb.address.fromEth('0x609395874f03E676603E7A173bCA2eB30012d7cc')
> VKTsbLhPk7W5QTWbBEsi9E1DAZwbRzSrKd