caver.account
caver.account is a package that provides functionality related to Account that is used when updating an account.
Class
Account
const account = new caver.account(address, accountKey)
Account is a class that contains information needed to update the AccountKey of the account in the kaia blockchain platform (kaia). This is the default class for the caver.account package. To create an Account instance with public key string(s), please refer to caver.account.create.
properties
| Name | Type | Description |
|---|---|---|
| address | string | The address of account to be updated. |
| accountKey | object | The new accountKey to be used in account. This can be an instance of AccountKeyLegacy, AccountKeyPublic, AccountKeyFail, AccountKeyWeightedMultiSig or AccountKeyRoleBased. When the transaction is executed, the accountKey of the account stored in the kaia is changed to this. |
AccountKeyLegacy
const accountKeyLegacy = new caver.account.accountKey.accountKeyLegacy()
AccountKeyLegacy is used to update the AccountKey of an account in the kaia with AccountKeyLegacy. To create an Account instance with AccountKeyLegacy, please refer to caver.account.createWithAccountKeyLegacy.
AccountKeyPublic
const accountKeyPublic = new caver.account.accountKey.accountKeyPublic(publicKey)
AccountKeyPublic is used to update the AccountKey of an account in the kaia with AccountKeyPublic. By updating AccountKey to AccountKeyPublic, you can change your existing AccountKey into the new public key, which will be used to validate a transaction in kaia. This change is necessary when you decouple your private key from the address of your account. See AccountUpdate and AccountKey for details.
To create an Account instance with AccountKeyPublic, please refer to caver.account.create or caver.account.createWithAccountKeyPublic.
properties
| Name | Type | Description |
|---|---|---|
| publicKey | string | The public key string. |
AccountKeyFail
const accountKeyFail = new caver.account.accountKey.accountKeyFail()
AccountKeyFail is used to update AccountKey of an account in the kaia with AccountKeyFail. To create an Account instance with AccountKeyFail, please refer to caver.account.createWithAccountKeyFail.