Private
constructorSigns a message.
The byte array to sign.
A signature object.
This function signs a byte-encoded message with the account private key. The message is first hashed and then signed. Do not pass a digest to this function as it will be hashed twice.
Encodes the account to a serializable object.
Optional
password: stringThe password to encrypt the private key.
Optional
salt: Uint8ArrayThe salt to use for the encryption. If not provided, a random salt will be generated.
Optional
nonce: Uint8ArrayThe nonce to use for the encryption. If not provided, a random nonce will be generated.
A serializable object.
The serializable object can be serialized to any format (JSON, YAML, XML, etc.) on any support (file, database, browser storage, etc.). The keystore format is defined in the Massa standard format document: Massa Standard Format
If the password is not provided for V0 and V1 keystores.
If the version is not supported.
Verifies a message signature.
The byte array that was signed.
The signature to verify.
A boolean indicating whether the signature is valid.
This function verifies a byte-encoded message signature using the account's public key. The message is first hashed and then the signature is verified against the hashed message. Do not pass a digest to this function as it will be hashed twice.
Static
fromUses the environment variables to create an account.
Optional
key: stringThe environment variable key containing the private key.
An account instance.
The PRIVATE_KEY
or the provided key is required in the environment variables.
Static
fromDecodes the account from a serializable object.
The serializable object to decode.
Optional
password: stringThe password to decrypt the private key.
A new Account instance.
The serializable object can be serialized to any format (JSON, YAML, XML, etc.) on any support (file, database, browser storage, etc.). The keystore format is defined in the Massa standard format document: Massa Standard Format
If the password is not provided for V0 and V1 keystores.
If the version is not supported.
Static
fromInitializes a new account object from a private key.
The private key of the account.
The version of the account.
A new instance of the Account class.
Static
generate
A class representing an account.