Klaytn Docs Archive
Getting StartedBuild a dAppNode OperationDeveloper Hub
  • Klaytn Docs
  • -
    • Klaytn Overview
      • Why Klaytn
      • Klaytn Design
        • Consensus Mechanism
        • Accounts
        • Transactions
          • Basic
          • Fee Delegation
          • Partial Fee Delegation
          • Ethereum
        • Computation
          • Klaytn Smart Contract
          • Execution Model
          • Computation Cost
            • Computation Cost (Previous docs)
          • Klaytn Virtual Machine
            • Klaytn Virtual Machine (Previous docs)
        • Storage
          • State Migration
          • StateDB Live Pruning
        • Transaction Fees
          • Transaction Fees (Previous docs)
        • Klaytn native coin - KLAY
        • Token Economy
        • Governance
        • Multi-Channel
        • KNI
      • Scaling Solutions
    • Getting Started
      • Deploying Smart Contract Using Foundry
      • Deploying Smart Contract Using Hardhat
      • Deploying Smart Contract Using Thirdweb
      • Deploying Smart Contract Using KEN
        • Launch an Endpoint Node
        • Top up your Account
        • Install Development Tools
        • Deploy a Smart Contract
        • Check the Deployment
        • Account Management
          • Creating Accounts
          • Managing Accounts
      • Development Environment
      • Getting KLAY
    • Smart Contract
      • Solidity - Smart Contract Language
      • Precompiled Contracts
        • Precompiled Contracts (Previous docs)
      • IDE and Tools
        • Truffle
      • Sample Contracts
        • KlaytnGreeter
        • ERC-20
          • 1. Writing ERC-20 Smart Contract
          • 2. Deploying Smart Contract
          • 3. Interacting with ERC-20 token from Klaytn Wallet
        • ERC-721
          • 1. Writing ERC-721 Smart Contract
          • 2. Deploying Smart Contract
      • Testing Guide
      • Deployment Guide
      • Klaytn Compatible Tokens
      • Porting Ethereum Contract
    • Run a Node
      • Deployment
        • Endpoint Node
          • System Requirements
          • Installation Guide
            • Download
            • Installation Guide
            • Configuration
            • Startup the EN
            • Testing the Installation
          • ken CLI commands
          • JSON-RPC APIs
        • Core Cell
          • System Requirements
          • Network Configuration
          • Installation Guide
            • Download
            • Before You Install
            • Consensus Node Setup
              • Installation Guide
              • Configuration
              • Startup the CN
            • Proxy Node Setup
              • Installation Guide
              • Configuration
              • Startup the PN
            • Testing the Core Cell
          • Monitoring Setup
          • H/A Setup
        • Service Chain
          • Getting Started
            • Setting up a 4-node Service Chain
            • Connecting to Baobab
            • Cross-Chain Value Transfer
            • HA(High Availability) for ServiceChain
            • Nested ServiceChain
            • Value Transfer between Sibling ServiceChains
          • Reference Manuals
            • System Requirements
            • Download
            • SCN User Guide
              • Installation
              • Configuration
              • Starting/Stopping SCN
              • Checking Node Status
              • kscn commands
              • homi commands
            • SPN/SEN User Guide
              • Installation
              • Configuration
              • Starting/Stopping Node
              • Checking Node Status
            • Bridge Configuration
            • Anchoring
            • KAS Anchoring
            • Value Transfer
            • Configuration Files
            • Log Files
            • Genesis JSON
            • Upgrade & Hard Fork
          • How-To Guides
        • Download Node Packages
          • v1.12.0
          • v1.11.1
          • v1.11.0
          • v1.10.2
          • v1.10.1
          • v1.10.0
          • v1.9.1
          • v1.9.0
          • v1.8.4
          • v1.8.3
          • v1.8.2
          • v1.8.1
          • v1.8.0
          • v1.7.3
          • v1.7.2
          • v1.7.1
          • v1.7.0
          • v1.6.4
          • v1.6.3
          • v1.6.2
          • v1.6.1
          • v1.6.0
          • v1.5.3
          • v1.5.2
          • v1.5.1
          • v1.5.0
          • v1.4.2
          • v1.4.1
          • v1.4.0
          • v1.3.0
          • v1.2.0
          • v1.1.1
          • v1.0.0
          • v0.9.6
          • v0.8.2
    • Operation Guide
      • Configuration
      • Node Log
      • Log operation
      • Errors & Troubleshooting
      • Klaytn Command
      • Chaindata Change
      • Chaindata Migration
    • dApp Developers
      • JSON-RPC APIs
        • API references
          • eth
            • Caution
            • Account
            • Block
            • Transaction
            • Config
            • Filter
            • Gas
            • Miscellaneous
          • klay
            • Account
            • Block
            • Transaction
              • Working with Klaytn Transaction Types
            • Configuration
            • Filter
            • Gas
            • Miscellaneous
          • net
          • debug
            • Logging
            • Profiling
            • Runtime Tracing
            • Runtime Debugging
            • VM Tracing
            • VM Standard Tracing
            • Blockchain Inspection
          • admin
          • personal
          • txpool
          • governance
        • Service Chain API references
          • mainbridge
          • subbridge
        • Transaction Error Codes
      • RPC Service Providers
        • Public Endpoints
      • SDK & Libraries for interacting with Klaytn Node
        • caver-js
          • Getting Started
          • Sending a sample transaction
          • API references
            • caver.account
            • caver.wallet
              • caver.wallet.keyring
            • caver.transaction
              • Basic
              • Fee Delegation
              • Partial Fee Delegation
            • caver.rpc
              • caver.rpc.klay
              • caver.rpc.net
              • caver.rpc.governance
            • caver.contract
            • caver.abi
            • caver.kct
              • caver.kct.kip7
              • caver.kct.kip17
              • caver.kct.kip37
            • caver.validator
            • caver.utils
            • caver.ipfs
          • caver-js ~v1.4.1
            • Getting Started (~v1.4.1)
            • API references
              • caver.klay
                • Account
                • Block
                • Transaction
                  • Legacy
                  • Value Transfer
                  • Value Transfer Memo
                  • Account Update
                  • Smart Contract Deploy
                  • Smart Contract Execution
                  • Cancel
                • Configuration
                • Filter
                • Miscellaneous
              • caver.klay.net
              • caver.klay.accounts
              • caver.klay.Contract
              • caver.klay.KIP7
              • caver.klay.KIP17
              • caver.klay.abi
              • caver.utils (~v1.4.1)
            • Porting from web3.js
        • caver-java
          • Getting Started
          • API references
          • caver-java ~v1.4.0
            • Getting Started (~v1.4.0)
            • Porting from web3j
        • ethers.js
        • web3.js
      • Tutorials
        • Klaytn Online Toolkit
        • Fee Delegation Example
        • Count DApp
          • 1. Environment Setup
          • 2. Clone Count DApp
          • 3. Directory Structure
          • 4. Write Smart Contract
          • 5. Frontend Code Overview
            • 5-1. Blocknumber Component
            • 5-2. Auth Component
            • 5-3. Count Component
          • 6. Deploy Contract
          • 7. Run App
        • Klaystagram
          • 1. Environment Setup
          • 2. Clone Klaystagram DApp
          • 3. Directory Structure
          • 4. Write Klaystagram Smart Contract
          • 5. Deploy Contract
          • 6. Frontend Code Overview
          • 7. FeedPage
            • 7-1. Connect Contract to Frontend
            • 7-2. UploadPhoto Component
            • 7-3. Feed Component
            • 7-4. TransferOwnership Component
          • 8. Run App
        • Building a Buy Me a Coffee dApp
          • 1. Project Setup
          • 2. Creating a BMC Smart Contract
          • 3. Testing the contract using scripts
          • 4. Deploying BMC Smart contract
          • 5. Building the BMC Frontend with React and Web3Onboard
          • 6. Deploying Frontend code on IPFS using Fleek
          • 7. Conclusion
        • Migrating Ethereum App to Klaytn
        • Connecting MetaMask
        • Connecting Remix
        • Verifying Smart Contracts Using Block Explorers
      • Developer Tools
        • Wallets
          • Kaikas
          • Klaytn Wallet
          • Klaytn Safe
            • Klaytn Safe Design
            • Create a Safe
            • Add assets
            • Send assets
            • Contract Interaction
            • Transaction Builder
            • Points to Note
            • Frequently Asked Questions
          • SafePal S1
          • Wallet Libraries
            • Web3Auth
            • Web3Modal
            • Web3-Onboard
            • Particle Network
        • Oracles
          • Orakl Network
          • Witnet
          • SupraOracles
        • Indexers
          • SubQuery
        • Cross-chain
          • LayerZero
        • Block Explorers
          • Klaytnscope
          • Klaytnfinder
        • Klaytn Contracts Wizard
    • Glossary
  • ---
    • Klaytn Hard Fork History
    • Klaytn 2.0
      • Metaverse Package
      • Finality and Improvements
      • Ethereum Compatibility
      • Decentralizing Governance
      • Massive Eco Fund
    • FAQ
    • Open Source
    • Terms of Use
    • Languages
  • ℹ️Latest Klaytn Docs
Powered by GitBook
On this page
  • Class
  • Account
  • AccountKeyLegacy
  • AccountKeyPublic
  • AccountKeyFail
  • AccountKeyWeightedMultiSig
  • AccountKeyRoleBased
  • WeightedPublicKey
  • WeightedMultiSigOptions
  • caver.account.create
  • caver.account.createFromRLPEncoding
  • caver.account.createWithAccountKeyLegacy
  • caver.account.createWithAccountKeyPublic
  • caver.account.createWithAccountKeyFail
  • caver.account.createWithAccountKeyWeightedMultiSig
  • caver.account.createWithAccountKeyRoleBased
  • caver.account.accountKey.decode
  • account.getRLPEncodingAccountKey
  1. -
  2. dApp Developers
  3. SDK & Libraries for interacting with Klaytn Node
  4. caver-js
  5. API references

caver.account

PreviousAPI referencesNextcaver.wallet

Last updated 2 years ago

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 of the account in the Klaytn blockchain platform (Klaytn). This is the default class for the caver.account package. To create an Account instance with public key string(s), please refer to .

properties

Name
Type
Description

address

string

The address of account to be updated.

accountKey

object

AccountKeyLegacy

const accountKeyLegacy = new caver.account.accountKey.accountKeyLegacy()

AccountKeyLegacy is used to update the AccountKey of an account in the Klaytn with . To create an Account instance with AccountKeyLegacy, please refer to .

AccountKeyPublic

const accountKeyPublic = new caver.account.accountKey.accountKeyPublic(publicKey)

AccountKeyPublic is used to update the AccountKey of an account in the Klaytn with . 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 Klaytn. This change is necessary when you decouple your private key from the address of your account. See and for details.

To create an Account instance with AccountKeyPublic, please refer to or .

properties

Name
Type
Description

publicKey

string

The public key string.

AccountKeyFail

const accountKeyFail = new caver.account.accountKey.accountKeyFail()

AccountKeyWeightedMultiSig

const accountKeyWeightedMultiSig = new caver.account.accountKey.accountKeyWeightedMultiSig(threshold, weightedPublicKeys)

properties

Name
Type
Description

threshold

number

The validation threshold.

weightedPublicKeys

Array

AccountKeyRoleBased

const accountKeyRoleBased = new caver.account.accountKey.accountKeyRoleBased(accountKeyArray)

properties

Name
Type
Description

accountKeyArray

Array

WeightedPublicKey

const weightedPublicKey = new caver.account.accountKey.weightedPublicKey(weight, publicKey)

properties

Name
Type
Description

weight

number

publicKey

string

The public key string.

WeightedMultiSigOptions

const weightedMultiSigOptions = new caver.account.weightedMultiSigOptions(threshold, weights)

WeightedMultiSigOptions contains a threshold and weights. WeightedMultiSigOptions is a class for defining the options of AccountKeyWeightedMultiSig.

properties

Name
Type
Description

threshold

number

The validation threshold.

weights

Array

An array of weights of keys.

caver.account.create

caver.account.create(address, accountKey [, options])

Generates an Account instance with an address and an accountKey.

Parameters

Name
Type
Description

address

string

The address of account to be updated.

accountKey

string | Array

A public key string, an array of public keys, or a 2D array of which each element contains an array of key(s) to be used for each role.

options

(optional) Options for AccountKeyWeigthedMultiSig.

Return Value

Type
Description

The account instance is returned.

Example

// Create an Account instance with a public key string -> Account with AccountKeyPublic
> caver.account.create('0x{address in hex}', '0x034f1...')
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey: AccountKeyPublic { _publicKey: '0x034f1...' } 
}

// Create an Account instance with an array of public keys -> Account with AccountKeyWeightedMultiSig
> caver.account.create('0x{address in hex}', ['0x034f1...', '0xfe4b8...'])
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyWeightedMultiSig {
        _threshold: 1,
        _weightedPublicKeys: [ 
            WeightedPublicKey { _weight: 1, _publicKey: '0x034f1...' },
            WeightedPublicKey { _weight: 1, _publicKey: '0xfe4b8...' }
        ]
    } 
}
     
// Create an Account instance with an array of public keys with WeightedMultiSigOptions -> Account with AccountKeyWeightedMultiSig
> const options = new caver.account.weightedMultiSigOptions(2, [1, 1])
> caver.account.create('0x{address in hex}', ['0x034f1...', '0xfe4b8...'], options)
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyWeightedMultiSig {
        _threshold: 2,
        _weightedPublicKeys: [ 
            WeightedPublicKey { _weight: 1, _publicKey: '0x034f1...' },
            WeightedPublicKey { _weight: 1, _publicKey: '0xfe4b8...' }
        ]
    } 
}

// Create an Account instance with an array in which keys to be used for each role are defined as an array -> Account with AccountKeyRoleBased
> const publicKeys = [
    ['0xd8510...', '0xaa105...'],
    ['0xd8510...'],
    ['0xd8510...', '0xceeee...']
]
> caver.account.create('0x{address in hex}', publicKeys)
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyRoleBased {
        _accountKeys: [
            AccountKeyWeightedMultiSig { 
                _threshold: 1, 
                _weightedPublicKeys: [ 
                    WeightedPublicKey { _weight: 1, _publicKey: '0xd8510...' }, 
                    WeightedPublicKey { _weight: 1, _publicKey: '0xaa105...' } 
                ]
            },
            AccountKeyPublic { _publicKey: '0xd8510...' },
            AccountKeyWeightedMultiSig {
                _threshold: 1,
                _weightedPublicKeys: [
                    WeightedPublicKey { _weight: 1, _publicKey: '0xd8510...' },
                    WeightedPublicKey { _weight: 1, _publicKey: '0xceeee...' }
                ]
            }
        ]
    }
}

// Create an Account instance with an array in which keys to be used for each role are defined as an array with an array of WeightedMultiSigOptions -> Account with AccountKeyRoleBased
> const publicKeys = [
    ['0xd8510...', '0xaa105...'],
    ['0xd8510...'],
    ['0xd8510...', '0xceeee...']
]
> const options = [
    new caver.account.weightedMultiSigOptions(2, [1, 1]),
    new caver.account.weightedMultiSigOptions(),
    new caver.account.weightedMultiSigOptions(3, [1, 2])
]
> caver.account.create('0x{address in hex}', publicKeys, options)
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyRoleBased {
        _accountKeys: [
            AccountKeyWeightedMultiSig { 
                _threshold: 2, 
                _weightedPublicKeys: [ 
                    WeightedPublicKey { _weight: 1, _publicKey: '0xd8510...' }, 
                    WeightedPublicKey { _weight: 1, _publicKey: '0xaa105...' } 
                ]
            },
            AccountKeyPublic { _publicKey: '0xd8510...' },
            AccountKeyWeightedMultiSig {
                _threshold: 3,
                _weightedPublicKeys: [
                    WeightedPublicKey { _weight: 1, _publicKey: '0xd8510...' },
                    WeightedPublicKey { _weight: 2, _publicKey: '0xceeee...' }
                ]
            }
        ]
    }
}

caver.account.createFromRLPEncoding

caver.account.createFromRLPEncoding(address, rlpEncodedKey)

Creates an Account instance from RLP-encoded AccountKey.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

rlpEncodedKey

string

The RLP-encoded string of AccountKey.

Return Value

Type
Description

The account instance is returned.

Example

> caver.account.createFromRLPEncoding('0x{address in hex}', '0x04f84b02f848e301a102c10b598a1a3ba252acc21349d61c2fbd9bc8c15c50a5599f420cccc3291f9bf9e301a1021769a9196f523c419be50c26419ebbec34d3d6aa8b59da834212f13dbec9a9c1')
Account {
    _address: '0x9ea5b871e7bef65868a0d278be3fc6cdbee543ee',
    _accountKey: 
        AccountKeyWeightedMultiSig { 
            _threshold: 2, 
            _weightedPublicKeys: [ 
                WeightedPublicKey { _weight: 1, _publicKey: '0x02c10...' },
                WeightedPublicKey { _weight: 1, _publicKey: '0x02176...' }
            ]
        }
}

caver.account.createWithAccountKeyLegacy

caver.account.createWithAccountKeyLegacy(address)

Creates an Account instance which has AccountKeyLegacy as an accountKey.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

Return Value

Type
Description

The account instance is returned.

Example

> caver.account.createWithAccountKeyLegacy('0x{address in hex}')
Account {
  _address: '0x9ea5b871e7bef65868a0d278be3fc6cdbee543ee',
  _accountKey: AccountKeyLegacy {}
}

caver.account.createWithAccountKeyPublic

caver.account.createWithAccountKeyPublic(address, publicKey)

Creates an Account instance which has AccountKeyPublic as an accountKey.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

publicKey

string

The public key string.

Return Value

Type
Description

The account instance is returned.

Example

> caver.account.createWithAccountKeyPublic('0x{address in hex}', '0xb5a9a...')
Account {
    _address: '0x9ea5b871e7bef65868a0d278be3fc6cdbee543ee',
    _accountKey: AccountKeyPublic { _publicKey: ,'0xb5a9a...' }
}

caver.account.createWithAccountKeyFail

caver.account.createWithAccountKeyFail(address)

Creates an Account instance which has AccountKeyFail as an accountKey.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

Return Value

Type
Description

The account instance is returned.

Example

> caver.account.createWithAccountKeyFail('0x{address in hex}')
Account {
  _address: '0x9ea5b871e7bef65868a0d278be3fc6cdbee543ee',
  _accountKey: AccountKeyFail {}
}

caver.account.createWithAccountKeyWeightedMultiSig

caver.account.createWithAccountKeyWeightedMultiSig(address, publicKeyArray [, options])

Creates an Account instance which has AccountKeyWeightedMultiSig as an accountKey.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

publicKeyArray

Array

The array that includes multiple public key strings.

options

Return Value

Type
Description

The account instance is returned.

Example

// create an Account instance without options
> caver.account.createWithAccountKeyWeightedMultiSig('0x{address in hex}', ['0xb5a9a...', '0xfe4b8...'])
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyWeightedMultiSig {
        _threshold: 1,
        _weightedPublicKeys: [ 
            WeightedPublicKey { _weight: 1, _publicKey: '0xb5a9a...' },
            WeightedPublicKey { _weight: 1, _publicKey: '0xfe4b8...' }
        ]
    } 
}

// create an Account instance with options
> const options = new caver.account.weightedMultiSigOptions(2, [1, 1])
> caver.account.createWithAccountKeyWeightedMultiSig('0x{address in hex}', ['0xb5a9a...', '0xfe4b8...'], options)
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyWeightedMultiSig {
        _threshold: 2,
        _weightedPublicKeys: [ 
            WeightedPublicKey { _weight: 1, _publicKey: '0xb5a9a...' },
            WeightedPublicKey { _weight: 1, _publicKey: '0xfe4b8...' }
        ]
    } 
}

caver.account.createWithAccountKeyRoleBased

caver.account.createWithAccountKeyRoleBased(address, roledBasedPublicKeyArray [, options])

Creates an Account instance which has AccountKeyRoleBased as an accountKey.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

roledBasedPublicKeyArray

Array

A two-dimensional array containing arrays of public key strings for each role.

options

Array

Return Value

Type
Description

The account instance is returned.

Example

// create an Account instance without options
> const publicKeys = [
    ['0x034f1...', '0xfe4b8...'],
    ['0xb5a9a...'],
    ['0x034f1...', '0xb5a9a...']
]
> caver.account.createWithAccountKeyRoleBased('0x{address in hex}', publicKeys)
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyRoleBased {
        _accountKeys: [
            AccountKeyWeightedMultiSig { 
                _threshold: 1, 
                _weightedPublicKeys: [ 
                    WeightedPublicKey { _weight: 1, _publicKey: '0x034f1...' }, 
                    WeightedPublicKey { _weight: 1, _publicKey: '0xfe4b8...' } 
                ]
            },
            AccountKeyPublic { _publicKey: '0xb5a9a...' },
            AccountKeyWeightedMultiSig {
                _threshold: 1,
                _weightedPublicKeys: [
                    WeightedPublicKey { _weight: 1, _publicKey: '0x034f1...' },
                    WeightedPublicKey { _weight: 1, _publicKey: '0xb5a9a...' }
                ]
            }
        ]
    }
}

// create an Account instance with options
> const publicKeys = [
    ['0x034f1...', '0xfe4b8...'],
    ['0xb5a9a...'],
    ['0x034f1...', '0xb5a9a...']
]
> const options = [
    new caver.account.weightedMultiSigOptions(2, [1, 1]),
    new caver.account.weightedMultiSigOptions(),
    new caver.account.weightedMultiSigOptions(3, [1, 2])
]
> caver.account.createWithAccountKeyRoleBased('0x{address in hex}', publicKeys, options)
Account {
    _address: '0xc771822ad361898a330df0169f2382ee92f6286d',
    _accountKey:
    AccountKeyRoleBased {
        _accountKeys: [
            AccountKeyWeightedMultiSig { 
                _threshold: 2, 
                _weightedPublicKeys: [ 
                    WeightedPublicKey { _weight: 1, _publicKey: '0x034f1...' }, 
                    WeightedPublicKey { _weight: 1, _publicKey: '0xfe4b8...' } 
                ]
            },
            AccountKeyPublic { _publicKey: '0xb5a9a...' },
            AccountKeyWeightedMultiSig {
                _threshold: 3,
                _weightedPublicKeys: [
                    WeightedPublicKey { _weight: 1, _publicKey: '0x034f1...' },
                    WeightedPublicKey { _weight: 2, _publicKey: '0xb5a9a...' }
                ]
            }
        ]
    }
}

caver.account.accountKey.decode

caver.account.accountKey.decode(rlpEncodedAccountKey)

Parameters

Name
Type
Description

rlpEncodedAccountKey

string

An RLP-encoded string of AccountKey.

Return Value

Type
Description

The AccountKey instance is returned.

Example

> caver.account.accountKey.decode('0x02a102c10b598a1a3ba252acc21349d61c2fbd9bc8c15c50a5599f420cccc3291f9bf9')
AccountKeyPublic { _publicKey: '0x02c10b598a1a3ba252acc21349d61c2fbd9bc8c15c50a5599f420cccc3291f9bf9' }

account.getRLPEncodingAccountKey

account.getRLPEncodingAccountKey()

Return RLP-encoded string of AccountKey.

Return Value

Type
Description

string

A RLP-encoded string of AccountKey .

Example

> const account = caver.account.create('0x{address in hex}', '0x034f1...')
> account.getRLPEncodingAccountKey()
'0x02a102d851040f46d61a042a787cca34ad12bc43e51f01ad0b22270cfc25c15c4b4e22'

The new accountKey to be used in account. This can be an instance of , , , or . When the transaction is executed, the accountKey of the account stored in the Klaytn is changed to this.

AccountKeyFail is used to update AccountKey of an account in the Klaytn with . To create an Account instance with AccountKeyFail, please refer to .

AccountKeyWeightedMultiSig is used to update AccountKey of an account in the Klaytn with . By updating your AccountKey to AccountKeyWeightedMultiSig, you can change your existing AccountKey into the new public key, which will be used to validate a transaction in Klaytn. This change is necessary when you decouple your private key from the address of your account. See and for details.

To create an Account instance with AccountKeyWeightedMultiSig, please refer to or .

The array of .

AccountKeyRoleBased is used to update AccountKey of an account in the Klaytn with . By updating your AccountKey to AccountKeyRoleBased, you can change the AccountKey(s) assigned for each role, all of which are used to validate a transaction in Klaytn. See and for more details.

To create an Account instance with AccountKeyRoleBased, please refer to or .

The array defining accountKey to be used for each . Each role can be defined with , , , or .

WeightedPublicKey contains a public key and its weight. WeightedPublicKey is a class that contains the public key and the weight of the key, and it is used in .

The weight of public key. The weight is used to check whether the weighted sum of public keys is larger than the threshold of the object.

If accountKey is a public key string, an Account instance with as accountKey is created. If accountKey is an array containing public key strings, an Account instance with as accountKey is created. If options are not defined as the last parameter, it is created using a default option with a threshold of 1 and a weight of 1 for each key. If accountKey is an array containing accountKeys that are used for each role, an Account instance with is created. Options must be defined for each role with . If options are not defined, the default option is used for roles that use multiple public keys. Please refer to the example below for how to use it.

| Array

(optional) The instance that defines threshold and weight array.

(optional) An array that contains instances for each role.

Decodes an RLP-encoded string of AccountKey and returns an , , , or instance.

| | | |

caver.account.create
caver.account.createWithAccountKeyWeightedMultiSig
caver.account.create
caver.account.createWithAccountKeyRoleBased
AccountKeyWeightedMultiSig
AccountKeyPublic
AccountKeyWeightedMultiSig
AccountKeyRoleBased
WeightedMultiSigOptions
AccountKeyLegacy
AccountKeyPublic
AccountKeyFail
AccountKeyWeightedMultiSig
AccountKeyRoleBased
AccountKeyLegacy
AccountKeyPublic
AccountKeyFail
AccountKeyWeightedMultiSig
AccountKeyRoleBased
WeightedPublicKey
WeightedMultiSigOptions
Account
Account
Account
Account
Account
WeightedMultiSigOptions
WeightedMultiSigOptions
Account
WeightedMultiSigOptions
Account
AccountKeyLegacy
AccountKeyPublic
AccountKeyFail
AccountKeyWeightedMultiSig
AccountKeyRoleBased
caver.account.create
caver.account.createWithAccountKeyLegacy
caver.account.create
caver.account.createWithAccountKeyPublic
caver.account.createWithAccountKeyFail
AccountKeyLegacy
AccountKeyPublic
AccountKeyFail
AccountKeyWeightedMultiSig
AccountKeyFail
role
AccountKeyWeightedMultiSig
AccountKey
AccountKeyLegacy
AccountKeyPublic
AccountKey
AccountKeyWeightedMultiSig
AccountKey
AccountKeyRoleBased
AccountKey
AccountUpdate
AccountUpdate
AccountUpdate