Address
Overview
Represents a public address of an Aleo account. The Address class provides methods for creating addresses from various sources (private keys, view keys, compute keys), converting between different formats (bytes, bits, fields, groups), and verifying signatures.
Methods
from_private_key
Derive an Aleo address from a private key
from_private_key(private_key) ► Address
| Param | Type | Description |
|---|---|---|
| private_key | PrivateKey | The private key to derive the address from |
| return | Address | Address corresponding to the private key |
from_view_key
Derive an Aleo address from a view key
from_view_key(view_key) ► Address
| Param | Type | Description |
|---|---|---|
| view_key | ViewKey | The view key to derive the address from |
| return | Address | Address corresponding to the view key |
from_compute_key
Derive an Aleo address from a compute key
from_compute_key(compute_key) ► Address
| Param | Type | Description |
|---|---|---|
| compute_key | ComputeKey | The compute key to derive the address from |
| return | Address | Address corresponding to the compute key |
fromBytesLe
Get an address from a series of bytes
fromBytesLe(bytes) ► Address
| Param | Type | Description |
|---|---|---|
| bytes | Uint8Array | A left endian byte array representing the address |
| return | Address | The address object |
toBytesLe
Get the left endian byte array representation of the address
toBytesLe() ► Uint8Array
| Param | Type |
|---|---|
| return | Uint8Array |
fromBitsLe
Get an address from a series of bits represented as a boolean array
fromBitsLe(bits) ► Address
| Param | Type | Description |
|---|---|---|
| bits | Array | A left endian boolean array representing the bits of the address |
| return | Address | The address object |
toBitsLe
Get the left endian boolean array representation of the bits of the address
toBitsLe() ► Array.<any>
| Param | Type |
|---|---|
| return | Array.<any> |
fromFields
Get an address object from an array of fields
fromFields(fields) ► Plaintext
| Param | Type | Description |
|---|---|---|
| fields | Array | An array of fields |
| return | Plaintext | The address object |
toFields
Get the field array representation of the address
toFields() ► Array.<any>
| Param | Type |
|---|---|
| return | Array.<any> |
fromGroup
Get an address object from a group
fromGroup(group) ► Address
| Param | Type | Description |
|---|---|---|
| group | Group | The group object |
| return | Address | The address object |
toGroup
Get the group representation of the address object
toGroup() ► Group
| Param | Type |
|---|---|
| return | Group |
from_string
Create an aleo address object from a string representation of an address
from_string(address) ► Address
| Param | Type | Description |
|---|---|---|
| address | string | String representation of an address |
| return | Address | Address object |
to_string
Get a string representation of an Aleo address object
to_string(Address) ► string
| Param | Type |
|---|---|
| Address | Address |
| return | string |
toPlaintext
Get the plaintext representation of the address
toPlaintext() ► Plaintext
| Param | Type |
|---|---|
| return | Plaintext |
verify
Verify a signature for a message signed by the address
verify(Byte) ► boolean
| Param | Type | Description |
|---|---|---|
| Byte | Uint8Array | array representing a message signed by the address |
| return | boolean | Boolean representing whether or not the signature is valid |