Klaytn 문서 아카이브
시작하기스마트 컨트랙트노드 운영dApp 개발자
  • Klaytn 문서
  • -
    • Klaytn Overview
      • 왜 클레이튼일까요?
      • 클레이튼 디자인
        • 합의 메커니즘
        • 계정
        • 트랜잭션
          • 기본
          • 수수료 위임 트랜잭션
          • 수수료 부분 위임 트랜잭션
          • Ethereum
        • 연산
          • 클레이튼 스마트 컨트랙트
          • 실행 모델(Execution Model)
          • Computation Cost
            • 연산 비용 (구 버전 문서)
          • Klaytn 가상머신
            • 클레이튼 가상머신 (구 버전 문서)
        • 스토리지
        • 트랜잭션 비용
          • 트랜잭션 비용 (구 버전 문서)
        • 클레이튼의 네이티브 코인 - KLAY
        • 토큰 이코노미
        • 거버넌스
        • 다중 채널
        • KNI
      • 확장성 솔루션
    • Getting Started
      • Deploying Smart Contract Using Foundry
      • Deploying Smart Contract Using Hardhat
      • 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
    • 스마트 컨트랙트
      • 솔리디티 - 스마트 컨트랙트 언어
      • 미리 컴파일된 컨트랙트
        • 미리 컴파일된 컨트랙트 (구 버전 문서)
      • IDE 및 도구
        • Truffle
      • 샘플 컨트랙트
        • KlaytnGreeter
        • ERC-20
          • 1. ERC-20 스마트 컨트랙트 작성
          • 2. 스마트 컨트랙트 배포
          • 3. 클레이튼 월렛에서 ERC-20 토큰 사용
        • ERC-721
          • 1. ERC-721 스마트 컨트랙트 작성
          • 2. Deploying Smart Contract
      • 테스트 가이드
      • 배포 가이드
      • 클레이튼 호환 토큰
      • 이더리움 컨트랙트 이식
    • Run a Node
      • 배포
        • Endpoint Node
          • 시스템 요구사항
          • 설치 가이드
            • 다운로드
            • Installation Guide
            • 환경설정
            • EN 실행하기
            • 설치 테스트하기
          • ken CLI 명령어
          • JSON-RPC API
        • 코어 셀
          • System Requirements
          • 네트워크 설정
          • Installation Guide
            • Download
            • 설치하기 전에
            • 컨센서스 노드 설정
              • Installation Guide
              • Configuration
              • CN 실행하기
            • 프록시 노드 설정
              • Installation Guide
              • Configuration
              • PN 실행하기
            • 코어 셀 테스트하기
          • 모니터링 설정
          • H/A 설정
        • Service Chain
          • Getting Started
            • 4개 노드 서비스 체인 설정하기
            • Connecting to Baobab
            • 크로스체인 토큰 전송
            • HA(High Availability) for ServiceChain
            • Nested ServiceChain
            • Value Transfer between Sibling ServiceChains
          • 참조 매뉴얼
            • System Requirements
            • Download
            • SCN User Guide
              • Installation
              • Configuration
              • SCN 실행 및 중지하기
              • 노드 상태 확인하기
              • kscn commands
              • homi commands
            • SPN/SEN User Guide
              • Installation
              • Configuration
              • 노드 실행 및 중지
              • Checking Node Status
            • Bridge Configuration
            • 앵커링
            • KAS 앵커링
            • 토큰 전송
            • Configuration Files
            • 로그 파일
            • Genesis JSON
            • 업그레이드 및 하드포크
          • How-To Guides
        • Download Node Packages
          • 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
    • 운영 가이드
      • Configuration
      • 노드 로그
      • Log operation
      • 에러 및 문제 해결
      • 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
          • Wallet Libraries
            • Web3Auth
            • Web3Modal
            • Web3-Onboard
        • Oracles
          • Orakl Network
          • Witnet
          • SupraOracles
        • Block Explorers
          • Klaytnscope
          • Klaytnfinder
        • Klaytn Contracts Wizard
    • Glossary
  • ---
    • Klaytn 하드포크
    • 클레이튼 2.0
      • 메타버스 패키지
      • 완결성과 개선 사항들
      • 이더리움 호환성
      • 거버넌스 탈중앙화
      • 대규모 에코 펀드
    • FAQ
    • 오픈 소스
    • 이용약관
    • 지원 언어
  • ℹ️최신 Klaytn 문서
Powered by GitBook
On this page
  • Class
  • 계정
  • 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

Was this helpful?

  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

Was this helpful?

caver.account는 계정 업데이트시 사용 되며 Account에 관련된 기능을 제공하는 패키지입니다.

Class

계정

const account = new caver.account(address, accountKey)

Account는 Klaytn 계정의 를 업데이트하기 위해 필요한 정보를 포함하는 클래스입니다. caver.account 패키지의 기본 클래스입니다. 공개키(들)을 이용해 Account 인스턴스를 만들고자 한다면 를 참고하세요.

속성

Name
Type
Description

address

string

업데이트 할 계정의 주소입니다.

accountKey

object

AccountKeyLegacy

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

AccountKeyLegacy는 를 통해 Klaytn 계정의 AccountKey를 업데이트할 때 사용됩니다. AccountKeyLegacy를 가지고 Account 인스턴스를 생성하고자 한다면 를 참고하세요.

AccountKeyPublic

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

AccountKeyPublic는 를 이용해 Klaytn 계정의 AccountKey를 업데이트할 때 사용됩니다. AccountKey를 AccountKeyPublic로 업데이트하면 기존의 AccountKey가 새로운 공개키로 바뀌며, 이는 Klaytn 트랜잭션 검증에 사용됩니다. 계정의 개인키를 주소로부터 분리할 때 필요한 업데이트입니다. 자세한 사항은 와 를 참고하세요.

AccountKeyPublic로 Account 인스턴스를 만들고자 한다면 or 를 참고하세요.

properties

Name
Type
Description

publicKey

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

검증 임계값입니다.

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는 임계값과 가중치를 포함합니다. WeightedMultiSigOptions는 AccountKeyWeightedMultiSig의 옵션을 정의하는 클래스입니다.

properties

Name
Type
Description

threshold

number

The validation threshold.

가중치

Array

키 가중치의 배열입니다.

caver.account.create

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

주소와 accountKey를 지닌 Account 인스턴스를 생성합니다.

Parameters

Name
Type
Description

address

string

The address of account to be updated.

accountKey

string | Array

공개키 문자열, 공개키(들)의 배열, 또는 각 요소가 각 역할에 사용될 키(들) 의 배열을 포함하는 2차원 배열입니다.

options

(선택 사항) AccountKeyWeigthedMultiSig에 대한 옵션들입니다.

Return Value

Type
Description

Account 인스턴스가 반환됩니다.

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)

RLP 인코딩된 AccountKey로부터 Account 인스턴스를 생성합니다.

Parameters

Name
Type
Description

address

string

업데이트 할 계정의 주소입니다.

rlpEncodedKey

string

AccountKey의 RLP 인코딩된 문자열입니다.

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)

AccountKeyLegacy를 accountKey로 지닌 Account 인스턴스를 생성합니다.

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)

AccountKeyPublic를 accountKey로 지닌 Account 인스턴스를 생성합니다.

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)

AccountKeyFail를 accountKey로 지닌 Account 인스턴스를 생성합니다.

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])

AccountKeyWeightedMultiSig를 accountKey로 지닌 Account 인스턴스를 생성합니다.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

publicKeyArray

Array

다수의 공개키 문자열을 포함한 배열입니다.

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])

AccountKeyRoleBased를 accountKey로 지닌 Account 인스턴스를 생성합니다.

Parameters

Name
Type
Description

address

string

The address of an account to be updated.

roledBasedPublicKeyArray

Array

각 역할에 대해 공개키 문자열의 배열을 포함하고 있는 2차원 배열입니다.

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

AccountKey의 RLP 인코딩된 문자열입니다.

Return Value

Type
Description

AccountKey 인스턴스가 반환됩니다.

Example

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

account.getRLPEncodingAccountKey

account.getRLPEncodingAccountKey()

AccountKey의 RLP 인코딩된 문자열을 반환합니다.

Return Value

Type
Description

string

AccountKey의 RLP 인코딩된 문자열입니다 .

Example

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

계정에 사용될 새 accountKey입니다. , , , 또는 의 인스턴스일 수 있습니다. 트랜잭션이 실행되면 Klaytn에 저장된 계정의 accountKey가 이렇게 변경됩니다.

AccountKeyFail은 을 통해 Klaytn 계정의 AccountKey를 업데이트할 때 사용됩니다. AccountKeyFail을 사용하여 Account 인스턴스를 만들고자 한다면 를 참고하세요.

AccountKeyWeightedMultiSig는 를 사용해 Klaytn 계정의 AccountKey를 업데이트할 때 사용합니다. AccountKey를 AccountKeyWeightedMultiSig로 업데이트하면 기존의 AccountKey가 새로운 공개키로 바뀌며, 이는 Klaytn 트랜잭션 검증에 사용됩니다. This change is necessary when you decouple your private key from the address of your account. See and for details.

AccountKeyWeightedMultiSig로 Account 인스턴스를 만들고자 한다면 or 를 참고하세요.

의 배열입니다.

AccountKeyRoleBased는 를 통해 Klaytn 계정의 AccountKey를 업데이트할 때 사용됩니다. AccountKey를 AccountKeyRoleBased로 업데이트함으로써 Klaytn 트랜잭션 검증에 사용되는 각 역할에 할당된 AccountKey(들)을 변경할 수 있습니다. 자세한 사항은 와 를 참고하세요.

AccountKeyRoleBased로 Account 인스턴스를 만들고자 한다면 or 를 참고하세요.

각 에 사용되는 키를 정의하는 배열입니다. 각 역할은 [AccountKeyLegacy, , , 또는 AccountKeyRoleBased](#accountkeylegacy)로 정의될 수 있습니다.

WeightedPublicKey contains a public key and its weight. WeightedPublicKey는 공개키와 그 가중치를 포함하는 클래스로, 에 사용됩니다.

공개키의 가중치입니다. 공개키의 가중치 합계가 객체의 임계값을 초과하는지 여부를 확인하는 데 사용됩니다.

accountKey가 공개키 문자열인 경우, accountKey가 인 Account 인스턴스가 생성됩니다. accountKey가 공개키 문자열을 포함한 배열인 경우, accountKey가 인 Account 인스턴스가 생성됩니다. 옵션들이 마지막 파라미터로 정의되지 않은 경우 기본값으로 임계값이 1, 각 키의 가중치가 1로 설정되어 생성됩니다. accountKey가 각 역할에 사용되는 accountKeys를 포함한 배열인 경우, 를 지닌 Account 인스턴스가 생성됩니다. 옵션들은 를 통해 각 역할에 정의되어야 합니다. 옵션들이 정의되어 있지 않다면, 다수의 공개키를 사용하는 역할들에 대해 기본 옵션이 사용됩니다. 사용법은 아래 예시를 참고하세요.

| Array

(선택 사항) 임계값과 가중치 배열을 정의하는 인스턴스입니다.

(선택 사항) 각 역할에 대해 인스턴스를 포함하는 배열입니다.

AccountKey의 RLP 인코딩된 문자열을 디코딩하며, , , , 또는 인스턴스를 반환합니다.

| | | |

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
AccountKeyPublic
AccountKeyFail
AccountKeyWeightedMultiSig
AccountUpdate
AccountUpdate
AccountUpdate
AccountKey
AccountKeyLegacy
AccountKeyPublic
AccountKey
AccountKeyFail
AccountKeyWeightedMultiSig
AccountKey
AccountKeyRoleBased
AccountKey
역할
AccountKeyWeightedMultiSig