caver.klay.accounts
는 Klaytn 계정과 서명 트랜잭션과 데이터를 생성하는 함수를 포함합니다.
create
Copy caver . klay . accounts .create ([entropy])
개인키와 공개키를 사용하여 계정 개체를 생성합니다.
Parameters
Return Value
Object
- 다음 구조의 계정 객체:
Example
Copy > caver . klay . accounts .create ();
{
address : '0x79FF91738661760AC67b3E951c0B4f1F70F80478' ,
privateKey : '0x{private key}' ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
> caver . klay . accounts .create ( 'entropy' );
{
address : '0x205fffB1025F4af604fEB1d3a22b46C0D2326585' ,
privateKey : '0x{private key}' ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
> caver . klay . accounts .create ( caver . utils .randomHex ( 32 ));
{
address : '0x62Ca8964610A9D447E1a64753a09fC8b3D40b405' ,
privateKey : '0x{private key}' ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
createWithAccountKey
Copy caver . klay . accounts .createWithAccountKey (address , accountKey)
주어진 AccountKey로 Account 인스턴스를 생성합니다. Account는 계정 주소와 AccountKey를 관리하기 위한 클래스입니다.
참고 이는 caver-js에서 사용되는 데이터 구조체일 뿐입니다. 이 메서드는 Klaytn 네트워크에 계정을 생성하거나 네트워크에 있는 계정을 업데이트하지 않습니다. 참고 caver.klay.accounts.createWithAccountKey
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- 다음 속성을 가진 Account 인스턴스가 반환됩니다.
Example
Copy // Create an Account with AccountKeyPublic
> caver . klay . accounts .createWithAccountKey ( '0x62ca8964610a9d447e1a64753a09fc8b3d40b405' , '0x{private key}' )
Account {
address : [Getter / Setter] ,
accountKey : [Getter / Setter] ,
privateKey : [Getter / Setter] ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
// Create an Account with AccountKeyMultiSig
> caver.klay.accounts.createWithAccountKey('0x62ca8964610a9d447e1a64753a09fc8b3d40b405', ['0x{private key}', '0x{private key}'])
Account {
address : [Getter / Setter] ,
accountKey : [Getter / Setter] ,
privateKey : [Getter / Setter] ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
// Create an Account with AccountKeyRoleBased
> caver . klay . accounts .createWithAccountKey ( '0x62ca8964610a9d447e1a64753a09fc8b3d40b405' , {
transactionKey : [ '0x{private key}' , '0x{private key}' ] , '0x{private key}' ,
updateKey : [ '0x{private key}' , '0x{private key}' , '0x{private key}' ] ,
feePayerKey : [ '0x{private key}' , '0x{private key}' , '0x{private key}' ]
})
Account {
address : [Getter / Setter] ,
accountKey : [Getter / Setter] ,
privateKey : [Getter / Setter] ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
createWithAccountKeyPublic
Copy caver . klay . accounts .createWithAccountKeyPublic (address , accountKey)
AccountKeyPublic을 가지는 Account 인스턴스를 생성합니다.
참고 caver.klay.accounts.createWithAccountKeyPublic
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- An Account instance, see caver.klay.accounts.createWithAccountKey .
Example
Copy > caver . klay . accounts .createWithAccountKeyPublic ( '0x62ca8964610a9d447e1a64753a09fc8b3d40b405' , '0x{private key}' )
Account {
address : [Getter / Setter] ,
accountKey : [Getter / Setter] ,
privateKey : [Getter / Setter] ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
createWithAccountKeyMultiSig
Copy caver . klay . accounts .createWithAccountKeyMultiSig (address , accountKey)
AccountKeyMultiSig를 가지는 Account 인스턴스를 생성합니다.
참고 caver.klay.accounts.createWithAccountKeyMultiSig
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- An Account instance, see caver.klay.accounts.createWithAccountKey .
Example
Copy > caver.klay.accounts.createWithAccountKeyMultiSig('0x62ca8964610a9d447e1a64753a09fc8b3d40b405', ['0x{private key}', '0x{private key}'])
Account {
address : [Getter / Setter] ,
accountKey : [Getter / Setter] ,
privateKey : [Getter / Setter] ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
createWithAccountKeyRoleBased
Copy caver . klay . accounts .createWithAccountKeyRoleBased (address , accountKey)
AccountKeyRoleBased를 가지는 Account 인스턴스를 생성합니다.
참고 caver.klay.accounts.createWithAccountKeyRoleBased
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- An Account instance, see caver.klay.accounts.createWithAccountKey .
Example
Copy > caver . klay . accounts .createWithAccountKeyRoleBased ( '0x62ca8964610a9d447e1a64753a09fc8b3d40b405' , {
transactionKey : [ '0x{private key}' , '0x{private key}' , '0x{private key}' ] ,
updateKey : [ '0x{private key}' , '0x{private key}' , '0x{private key}' ] ,
feePayerKey : [ '0x{private key}' , '0x{private key}' , '0x{private key}' ]
})
Account {
address : [Getter / Setter] ,
accountKey : [Getter / Setter] ,
privateKey : [Getter / Setter] ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
createAccountKey
Copy caver . klay . accounts .createAccountKey (key)
매개 변수 유형에 따라 AccountKeyPublic
, AccountKeyMultiSig
또는 AccountKeyRoleBased
인스턴스를 생성합니다.
AccountKey는 caver-js에서 키를 관리하기 위한 데이터 구조체입니다. 하나의 개인키를 사용하려면 AccountKeyPublic을 사용하고 여러 개인키를 사용하려면 AccountKeyMultiSig, 각 역할(Role)별로 다른 키를 사용하려면 AccountKeyRoleBased를 사용하세요.
참고 caver.klay.accounts.createAccountKey
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- 다음 속성을 가지는 AccountKeyPublic, AccountKeyMultiSig 또는 AccountKeyRoleBased 객체가 반환됩니다.
Example
Copy // AccountKeyPublic 생성
> caver . klay . accounts .createAccountKey ( '0x{private key}' )
AccountKeyPublic {
_key : '0x{private key}'
}
// AccountKeyMultiSig 생성
> caver . klay . accounts .createAccountKey ([ '0x{private key}' , '0x{private key}' ])
AccountKeyMultiSig {
_keys : [
'0x{private key}' ,
'0x{private key}'
]
}
// AccountKeyRoleBased 생성
> caver . klay . accounts .createAccountKey ({
transactionKey : '0x{private key}' ,
updateKey : [ '0x{private key}' , '0x{private key}' ] ,
feePayerKey : '0x{private key}'
})
AccountKeyRoleBased {
_transactionKey :
AccountKeyPublic {
_key : '0x{private key}'
} ,
_updateKey :
AccountKeyMultiSig {
_keys : [
'0x{private key}' ,
'0x{private key}'
]
} ,
_feePayerKey :
AccountKeyPublic {
_key : '0x{private key}'
}
}
createAccountKeyPublic
Copy caver . klay . accounts .createAccountKeyPublic (key)
주어진 개인키 문자열을 사용하여 AccountKeyPublic
의 인스턴스를 생성합니다.
참고 caver.klay.accounts.createAccountKeyPublic
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- AccountKeyPublic 인스턴스, caver.klay.accounts.createAccountKey 를 참고하세요.
Example
Copy > caver . klay . accounts .createAccountKeyPublic ( '0x{private key}' )
AccountKeyPublic {
_key : '0x{private key}'
}
createAccountKeyMultiSig
Copy caver . klay . accounts .createAccountKeyMultiSig (keys
주어진 여러 개의 개인키를 사용하여 AccountKeyMultiSig
인스턴스를 생성합니다.
참고 caver.klay.accounts.createAccountKeyMultiSig
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- AccountKeyMultiSig 인스턴스, caver.klay.accounts.createAccountKey 를 참조하세요.
Example
Copy > caver . klay . accounts .createAccountKeyMultiSig ([ '0x{private key}' , '0x{private key}' ])
AccountKeyMultiSig {
_keys : [
'0x{private key}' ,
'0x{private key}'
]
}
createAccountKeyRoleBased
Copy caver . klay . accounts .createAccountKeyRoleBased (keyObject)
주어진 역할별 키를 사용하여 AccountKeyRoleBased
인스턴스를 생성합니다.
참고 caver.klay.accounts.createAccountKeyRoleBased
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- AccountKeyRoleBased 인스턴스, caver.klay.accounts.createAccountKey 를 참조하세요.
Example
Copy > caver . klay . accounts .createAccountKeyRoleBased ({
transactionKey : '0x{private key}' ,
updateKey : [ '0x{private key}' , '0x{private key}' ] ,
feePayerKey : '0x{private key}'
})
AccountKeyRoleBased {
_transactionKey :
AccountKeyPublic {
_key : '0x{private key}'
} ,
_updateKey :
AccountKeyMultiSig {
_keys : [
'0x{private key}' ,
'0x{private key}'
]
} ,
_feePayerKey :
AccountKeyPublic {
_key : '0x{private key}'
}
}
accountKeyToPublicKey
Copy caver . klay . accounts .accountKeyToPublicKey (accountKey)
이 함수는 AccountKey의 개인키를 공개키로 변환합니다.
참고 caver.klay.accounts.accountKeyToPublicKey
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Example
Copy // 개인키 문자열 변환
> caver . klay . accounts .accountKeyToPublicKey ( '0x{private key}' )
'0x67f20d1198abcdc036a4d8f3ea0cf837527716c90f71d0b0410dfe3e1b405eded9ea818eedd5e8ad79658b2cdf4862ab0956a6f7fd0a4886afe6110b2e9803a4'
// 개인키 문자열 배열 변환
> caver . klay . accounts .accountKeyToPublicKey ([ '0x{private key}' , '0x{private key}' ])
[
'0x67f20d1198abcdc036a4d8f3ea0cf837527716c90f71d0b0410dfe3e1b405eded9ea818eedd5e8ad79658b2cdf4862ab0956a6f7fd0a4886afe6110b2e9803a4',
'0x7c5415f99628618b3fe78e14606c83a22488769b3361e3758c7c98a204a23b615cf07af65490895d70a7b7e7e885fc2f597d65ea69ed586c7ae7cb0241656036'
]
// Convert a role-based key
> caver.klay.accounts.accountKeyToPublicKey({transactionKey: ['0x{private key}', '0x{private key}'], updateKey: '0x{private key}', feePayerKey: ['0x{private key}', '0x{private key}']})
{
transactionKey : [
'0x67f20d1198abcdc036a4d8f3ea0cf837527716c90f71d0b0410dfe3e1b405eded9ea818eedd5e8ad79658b2cdf4862ab0956a6f7fd0a4886afe6110b2e9803a4',
'0x7c5415f99628618b3fe78e14606c83a22488769b3361e3758c7c98a204a23b615cf07af65490895d70a7b7e7e885fc2f597d65ea69ed586c7ae7cb0241656036'
] ,
updateKey: '0x21aa42e0232e6c7607a0028bcbd690400b92574c44b17af8b036f3f4f01b0586f90578976a040debf6aecef4a5d00b5315b8c82e999ed8e5fbacd5fcbee82080',
feePayerKey : [
'0xb82bb74e902b1fa3594c7cc8bd33a727eb1c85a9bfc991327a0215fc413eafe0b3723cc7f3c6e79981b409e82b8bf7033fed2d2878c26502bea64f84d592b167',
'0x39acd887f32ccecd1b13c890854d2dfd0016f0be477155d81a848e971ff59412b0e4c0b5bfc1fd548b971f98cd9ef19367309d0475033fda3c8028ba9df27734'
]
}
privateKeyToAccount
Copy caver . klay . accounts .privateKeyToAccount (privateKey)
개인키에서 계정 객체를 생성합니다.
Parameters
Return Value
Object
- 계정 객체
Example
Copy > caver . klay . accounts .privateKeyToAccount ( '0x{private key}' );
{
address : '0x62ca8964610a9d447e1a64753a09fc8b3d40b405' ,
privateKey : '0x{private key}' ,
signTransaction : [Function: signTransaction] ,
sign : [Function: sign] ,
encrypt : [Function: encrypt] ,
getKlaytnWalletKey : [Function: getKlaytnWalletKey]
}
privateKeyToPublicKey
Copy caver . klay . accounts .privateKeyToPublicKey (privateKey)
주어진 개인키에서 공개키를 도출합니다.
Parameters
Return Value
String
- 공개키 (64바이트)
Example
Copy > caver . klay . accounts .privateKeyToPublicKey ( '0x{private key}' )
'0xbb1846722a4c27e71196e1a44611ee7174276a6c51c4830fb810cac64b0725f217cb8783625a809d1303adeeec2cf036ab74098a77a6b7f1003486e173b29aa7'
createAccountForUpdate
Copy caver . klay . accounts .createAccountForUpdate (address , accountKey , options)
AccountForUpdate
인스턴스를 생성합니다. AccountForUpdate는 계정의 주소와 업데이트 할 새로운 공개키를 가지고 있습니다.
AccountForUpdate
는 계정 업데이트 트랜잭션 객체(ACCOUNT_UPDATE
, FEE_DELEGATED_ACCOUNT_UPDATE
, FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO
)의 key
로 사용될 수 있습니다. AccountForUpdate
를 트랜잭션에서 사용하는 방법은 Account update with AccountForUpdate 를 참조하세요.
caver.klay.accounts.createAccountForUpdate의 accountKey 매개 변수는 개인키이어야합니다.
공개키로 AccountForUpdate 인스턴스를 생성하고 싶으면 caver.klay.accounts.createAccountForUpdateWithPublicKey 를 사용하세요.
또한 caver.klay.accounts.createAccountForUpdateWithLegacyKey 를 사용해 AccountForUpdate 인스턴스를 만들어 AccountKeyLegacy 로 업데이트 할 수 있습니다. 그리고 caver.klay.accounts.createAccountForUpdateWithFailKey 를 사용해 AccountForUpdate 인스턴스를 만들어 AccountKeyFail 로 업데이트할 수 있습니다.
참고 caver.klay.accounts.createAccountForUpdate
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- 다음 속성을 가진 AccountForUpdate 인스턴스가 반환됩니다.
Example
Copy // Create AccountForUpdate for AccountKeyPublic
> caver . klay . accounts .createAccountForUpdate ( '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' , '0x{private key}' )
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
publicKey: '0x24c32ee4f908ceed89e7501de2980fcb1d2add69080d3921f86c49de863eb2d507e24d9aaf91328b7f7cef2a94b538cb33b3f8cdd64925855ce0a4bf6e11f3db'
}
}
// Create AccountForUpdate for AccountKeyMultiSig with an options object
> caver.klay.accounts.createAccountForUpdate('0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef', ['0x{private key}', '0x{private key}'], { threshold: 2, weight: [1,1] })
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
multisig : {
threshold : 2 ,
keys : [
{
weight : 1 ,
publicKey: '0xc89f551ce9c569cf978f4f64833e447f177a83eda4f1883d770360ab35002dbdeb2d502cd33217238add013ea1c4ff5055ceda46473569824e336d0d64e9eeb2'
} ,
{
weight : 1 ,
publicKey: '0xab0837fa3d61cf33dc4f3af4aca692d8c939566e1abbca0036fa3b29cd55b38a387f73baf59510d96680062bd129dd2bb8dcbb5ea5ed16c881f83a3251f73600'
}
]
}
}
}
// Create AccountForUpdate for AccountKeyRoleBased with an options object
> caver.klay.accounts.createAccountForUpdate('0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef', { transactionKey: '0x{private key}', updateKey: ['0x{private key}', '0x{private key}'], feePayerKey: '0x{private key}' }, { updateKey: { threshold: 2, weight: [1,1] } })
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
roleTransactionKey : {
publicKey: '0x2b4a1d4ca1ee828f17e8c4c0ac0c0c46cf08f4b27fafc01e4b3481a4fe0891cacf315ed10b1df85bfd6797ea6c5ebafac437a7564eff355b11ad1e3d6e6c43a7'
} ,
roleAccountUpdateKey : {
multisig : {
threshold : 2 ,
keys : [
{
weight : 1 ,
publicKey: '0x26156615c8e503d96cd332a2fba6aab88b6156b983c89f586bcfc0443c0a7f2372d892d73c66d30f726f8269c75920a082eb2e57f6662d855389bb922ee263f3'
} ,
{
weight : 1 ,
publicKey: '0xafc139d2bcace02fa3d4b12926f976cf672f35a6ea2bc0f7e2e6d2ada0dd28f672acb8dcaedc694d6134a2f6c4aae472c9d67d30f760e16e742e01758c4daf83'
}
]
}
} ,
roleFeePayerKey : {
publicKey: '0xe55d39e147a0d5542d4bb965aeaa01e918c81a332ce47e0d3173179fe5b68c8c9264bec516d50bea0a7da7c3d8f98e124761a9b27434221d138ff8e22d932a0a'
}
}
}
// Create AccountForUpdate for AccountKeyRoleBased with legacy key or fail key
// When updating the key used for a specific role in AccountKeyRoleBased to AccountKeyLegacy or AccountKeyFailKey, define the role to update as follows.
> caver.klay.accounts.createAccountForUpdate('0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef', { transactionKey: 'legacyKey', updateKey: 'failKey' })
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
roleTransactionKey : { legacyKey : true } ,
roleAccountUpdateKey : { failKey : true }
}
}
createAccountForUpdateWithPublicKey
Copy caver . klay . accounts .createAccountForUpdateWithPublicKey (address , keyForUpdate , options)
업데이트 할 새 키의 공개키를 사용하여 AccountForUpdate
인스턴스를 생성합니다.
AccountForUpdate
can be used in the account update transaction object (ACCOUNT_UPDATE
, FEE_DELEGATED_ACCOUNT_UPDATE
, or FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO
) as a key
. If you want to know how to use AccountForUpdate
in the transaction, see Account update with AccountForUpdate .
참고 caver.klay.accounts.createAccountForUpdateWithPublicKey
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- An AccountForUpdate instance, see caver.klay.accounts.createAccountForUpdate .
Example
Copy // Create AccountForUpdate for AccountKeyPublic
> caver.klay.accounts.createAccountForUpdateWithPublicKey('0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef', '0x24c32ee4f908ceed89e7501de2980fcb1d2add69080d3921f86c49de863eb2d507e24d9aaf91328b7f7cef2a94b538cb33b3f8cdd64925855ce0a4bf6e11f3db')
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
publicKey: '0x24c32ee4f908ceed89e7501de2980fcb1d2add69080d3921f86c49de863eb2d507e24d9aaf91328b7f7cef2a94b538cb33b3f8cdd64925855ce0a4bf6e11f3db'
}
}
// Create AccountForUpdate for AccountKeyMultiSig with an options object
> caver.klay.accounts.createAccountForUpdateWithPublicKey('0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef', ['0xc89f551ce9c569cf978f4f64833e447f177a83eda4f1883d770360ab35002dbdeb2d502cd33217238add013ea1c4ff5055ceda46473569824e336d0d64e9eeb2', '0xab0837fa3d61cf33dc4f3af4aca692d8c939566e1abbca0036fa3b29cd55b38a387f73baf59510d96680062bd129dd2bb8dcbb5ea5ed16c881f83a3251f73600'], { threshold: 2, weight: [1,1] })
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
multisig : {
threshold : 2 ,
keys : [
{
weight : 1 ,
publicKey: '0xc89f551ce9c569cf978f4f64833e447f177a83eda4f1883d770360ab35002dbdeb2d502cd33217238add013ea1c4ff5055ceda46473569824e336d0d64e9eeb2'
} ,
{
weight : 1 ,
publicKey: '0xab0837fa3d61cf33dc4f3af4aca692d8c939566e1abbca0036fa3b29cd55b38a387f73baf59510d96680062bd129dd2bb8dcbb5ea5ed16c881f83a3251f73600'
}
]
}
}
}
// Create AccountForUpdate for AccountKeyRoleBased with an options object
> caver.klay.accounts.createAccountForUpdateWithPublicKey('0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef', { transactionKey: '0x2b4a1d4ca1ee828f17e8c4c0ac0c0c46cf08f4b27fafc01e4b3481a4fe0891cacf315ed10b1df85bfd6797ea6c5ebafac437a7564eff355b11ad1e3d6e6c43a7', updateKey: ['0x26156615c8e503d96cd332a2fba6aab88b6156b983c89f586bcfc0443c0a7f2372d892d73c66d30f726f8269c75920a082eb2e57f6662d855389bb922ee263f3', '0xafc139d2bcace02fa3d4b12926f976cf672f35a6ea2bc0f7e2e6d2ada0dd28f672acb8dcaedc694d6134a2f6c4aae472c9d67d30f760e16e742e01758c4daf83'], feePayerKey: '0xe55d39e147a0d5542d4bb965aeaa01e918c81a332ce47e0d3173179fe5b68c8c9264bec516d50bea0a7da7c3d8f98e124761a9b27434221d138ff8e22d932a0a' }, { updateKey: { threshold: 2, weight: [1,1] } })
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : {
roleTransactionKey : {
publicKey: '0x2b4a1d4ca1ee828f17e8c4c0ac0c0c46cf08f4b27fafc01e4b3481a4fe0891cacf315ed10b1df85bfd6797ea6c5ebafac437a7564eff355b11ad1e3d6e6c43a7'
} ,
roleAccountUpdateKey : {
multisig : {
threshold : 2 ,
keys : [
{
weight : 1 ,
publicKey: '0x26156615c8e503d96cd332a2fba6aab88b6156b983c89f586bcfc0443c0a7f2372d892d73c66d30f726f8269c75920a082eb2e57f6662d855389bb922ee263f3'
} ,
{
weight : 1 ,
publicKey: '0xafc139d2bcace02fa3d4b12926f976cf672f35a6ea2bc0f7e2e6d2ada0dd28f672acb8dcaedc694d6134a2f6c4aae472c9d67d30f760e16e742e01758c4daf83'
}
]
}
} ,
roleFeePayerKey : {
publicKey: '0xe55d39e147a0d5542d4bb965aeaa01e918c81a332ce47e0d3173179fe5b68c8c9264bec516d50bea0a7da7c3d8f98e124761a9b27434221d138ff8e22d932a0a'
}
}
}
createAccountForUpdateWithLegacyKey
Copy caver . klay . accounts .createAccountForUpdateWithLegacyKey (address)
계정의 키를 AccountKeyLegacy 로 업데이트 하기 위한 AccountForUpdate 인스턴스를 생성합니다. AccountKeyLegacy로 업데이트하기 전에 계정 주소와 일치하는 개인키를 가지고 있는지 확인하세요.
AccountForUpdate
can be used in the account update transaction object (ACCOUNT_UPDATE
, FEE_DELEGATED_ACCOUNT_UPDATE
, or FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO
) as a key
. If you want to know how to use AccountForUpdate
in the transaction, see Account update with AccountForUpdate .
참고 caver.klay.accounts.createAccountForUpdateWithLegacyKey
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- An AccountForUpdate instance, see caver.klay.accounts.createAccountForUpdate .
Example
Copy // Create AccountForUpdate for AccountKeyLegacy
> caver . klay . accounts .createAccountForUpdateWithLegacyKey ( '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' )
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : { legacyKey : true }
}
createAccountForUpdateWithFailKey
Copy caver . klay . accounts .createAccountForUpdateWithFailKey (address)
계정의 키를 AccountKeyFail 로 업데이트 하기 위한 AccountForUpdate 인스턴스를 생성합니다. AccountKeyFail을 가진 계정에서 보낸 트랜잭션은 항상 유효성 검사 과정에서 실패합니다.
AccountForUpdate
can be used in the account update transaction object (ACCOUNT_UPDATE
, FEE_DELEGATED_ACCOUNT_UPDATE
, or FEE_DELEGATED_ACCOUNT_UPDATE_WITH_RATIO
) as a key
. If you want to know how to use AccountForUpdate
in the transaction, see Account update with AccountForUpdate .
참고 caver.klay.accounts.createAccountForUpdateWithFailKey
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Object
- An AccountForUpdate instance, see caver.klay.accounts.createAccountForUpdate .
Example
Copy // Create AccountForUpdate for AccountKeyFail
> caver . klay . accounts .createAccountForUpdateWithFailKey ( '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' )
AccountForUpdate {
address : '0x5B4EF8e2417DdE1b9B80BcfC35d1bfeF3D7234ef' ,
keyForUpdate : { failKey : true }
}
signTransaction
Copy caver . klay . accounts .signTransaction (tx [ , privateKey] [ , callback])
주어진 개인키로 Klaytn 트랜잭션에 서명합니다.
caver-js v1.2.0 부터, 이 메서드는 입력 매개 변수로 일반 트랜잭션 객체뿐만 아니라 RLP 인코딩된 트랜잭션도 받습니다. See caver.klay.sendTransaction for the various types of transaction object. 이 메서드는 기본적으로 발신자로 서명합니다. If you want to sign as a fee-payer, we recommend to use caver.klay.accounts.feePayerSignTransaction . 그러나 객체 {senderRawTransaction: rawTransaction, feePayer: feePayerAddress}
를 tx
로 전달하면 수수료 납부자도 여전히 이 메서드를 사용하여 서명할 수 있습니다. senderRawTransaction은 FEE_DELEGATED_ 유형의 트랜잭션이어야 합니다.
Also since caver-js v1.2.0 , signTransaction keeps the existing signatures/feePayerSignatures in the input transaction and appends the signature(s) of the signer to it.
여러 사용자의 서명을 하나의 rawTransaction으로 결합하는 방법은 Sending a Transaction with multiple signer 를 참조하세요.
Parameters
참고 privateKey
매개변수는 caver-js v1.2.0-rc.3 이후 선택적 매개변수
로 변경되었습니다. 또한 privateKey 매개변수는 caver-js v1.2.0-rc.3 이후 개인키 문자열의 array
를 지원합니다. privateKey를 전달하지 않으면, 트랜잭션을 서명하기 위해 from
또는 feePayer
계정이 caver.klay.accounts.wallet에 반드시 존재해야 합니다. privateKey 배열이 제공되면, 배열 내부의 모든 키로 트랜잭션이 서명됩니다.
참고 caver-js v1.2.0 부터 tx
매개변수는 RLP 인코딩된 트랜잭션을 받아들입니다.
Return Value
Promise
는 Object
를 반환: RLP 인코딩된 서명된 트랜잭션. 객체 속성은 다음과 같습니다:
참고 signatures 및 feePayerSignatures 속성은 caver-js v1.2.0-rc.3 이후 추가되었습니다. 발신자가 트랜잭션에 서명하면, 서명 배열이 signatures
로 반환됩니다. 수수료 지불자가 서명하면, 서명 배열이 feePayerSignatures
로 반환됩니다.
참고 반환되는 객체에 있는 txHash
와 senderTxHash
는 최종 값이 아닐 수 있습니다. 다른 발신자 서명이 추가되면 txHash 및 senderTxHash가 변경됩니다. 수수료 납부자 서명이 추가되면 txHash가 변경됩니다.
Example
Copy // sign legacy transaction with private key string
> caver . klay . accounts .signTransaction ({
from : '0x72519cf34d9aa14629e7ad0cad5d55a3bb398364' ,
to : '0xa9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6' ,
value : caver . utils .toPeb ( 1 , 'KLAY' ) ,
gas : 900000 ,
} , '0x{private key}' ) .then ( console .log)
{
messageHash : '0xc4f3d98b901489c2c6e7bb9a5ddb4bc807b0251c6eac671356f01b66b749141f' ,
v : '0x4e44' ,
r : '0x2ef0d0c59ad302bcd73823879f6e1550e4bc6e6c38be69724c71ad6e09edde82' ,
s : '0x602b1064ff5a6ba4718a493e50cf9e58ca9a9addf6ed4bbbc89fbc040a3c107e' ,
rawTransaction: '0xf86f808505d21dba00830dbba094a9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6880de0b6b3a764000080824e44a02ef0d0c59ad302bcd73823879f6e1550e4bc6e6c38be69724c71ad6e09edde82a0602b1064ff5a6ba4718a493e50cf9e58ca9a9addf6ed4bbbc89fbc040a3c107e',
txHash : '0x87e84bd1d9c512cfabe5ebce10597dd40bc6fe828a10e460b7c01075c76b71a5' ,
senderTxHash : '0x87e84bd1d9c512cfabe5ebce10597dd40bc6fe828a10e460b7c01075c76b71a5' ,
signatures : [
'0x4e44' ,
'0x2ef0d0c59ad302bcd73823879f6e1550e4bc6e6c38be69724c71ad6e09edde82' ,
'0x602b1064ff5a6ba4718a493e50cf9e58ca9a9addf6ed4bbbc89fbc040a3c107e'
]
}
// signTransaction with private key string
> caver . klay . accounts .signTransaction ({
type : 'VALUE_TRANSFER' ,
from : '0x72519cf34d9aa14629e7ad0cad5d55a3bb398364' ,
to : '0xa9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6' ,
value : caver . utils .toPeb ( 1 , 'KLAY' ) ,
gas : 900000 ,
} , '0x{private key}' ) .then ( console .log)
{
messageHash : '0xf003c68467424eed29b55d3d107167b207adb6bba66f8b9b73b7df824beb144c' ,
v : '0x4e43' ,
r : '0xea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5c' ,
s : '0x5e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924' ,
rawTransaction: '0x08f887808505d21dba00830dbba094a9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6880de0b6b3a76400009472519cf34d9aa14629e7ad0cad5d55a3bb398364f847f845824e43a0ea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5ca05e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924',
txHash : '0x1b5759e8060ac01ba94437bd115ecf471ba05e144f4874dd5b82a8379aa98a63' ,
senderTxHash : '0x1b5759e8060ac01ba94437bd115ecf471ba05e144f4874dd5b82a8379aa98a63' ,
signatures : [
[
'0x4e43' ,
'0xea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5c' ,
'0x5e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924'
]
]
}
// signTransaction without privateKey parameter
> caver . klay . accounts .signTransaction ({
type : 'VALUE_TRANSFER' ,
from : '0x72519cf34d9aa14629e7ad0cad5d55a3bb398364' ,
to : '0xa9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6' ,
value : caver . utils .toPeb ( 1 , 'KLAY' ) ,
gas : 900000 ,
}) .then ( console .log)
{
messageHash : '0xf003c68467424eed29b55d3d107167b207adb6bba66f8b9b73b7df824beb144c' ,
v : '0x4e43' ,
r : '0xea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5c' ,
s : '0x5e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924' ,
rawTransaction: '0x08f887808505d21dba00830dbba094a9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6880de0b6b3a76400009472519cf34d9aa14629e7ad0cad5d55a3bb398364f847f845824e43a0ea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5ca05e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924',
txHash : '0x1b5759e8060ac01ba94437bd115ecf471ba05e144f4874dd5b82a8379aa98a63' ,
senderTxHash : '0x1b5759e8060ac01ba94437bd115ecf471ba05e144f4874dd5b82a8379aa98a63' ,
signatures : [
[
'0x4e43' ,
'0xea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5c' ,
'0x5e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924'
]
]
}
// signTransaction with array of private keys
> caver . klay . accounts .signTransaction ({
type : 'VALUE_TRANSFER' ,
from : '0x72519cf34d9aa14629e7ad0cad5d55a3bb398364' ,
to : '0xa9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6' ,
value : caver . utils .toPeb ( 1 , 'KLAY' ) ,
gas : 900000 ,
} , [ '0x{private key}' , '0x{private key}' ]) .then ( console .log)
{
messageHash : '0xf003c68467424eed29b55d3d107167b207adb6bba66f8b9b73b7df824beb144c' ,
v : '0x4e44' ,
r : '0xf9e93c6dc3227a4cde633dc7a9b3c5e81ceb1879bfcf138d6205b2d49cdef60b' ,
s : '0x0787d1a42c75d6d708ddb7552c6470ad15e58da6259cdf48e508f577187fad20' ,
rawTransaction: '0x08f8ce808505d21dba00830dbba094a9d2cc2bb853163b6eadfb6f962d72f7e00bc2e6880de0b6b3a76400009472519cf34d9aa14629e7ad0cad5d55a3bb398364f88ef845824e44a0f9e93c6dc3227a4cde633dc7a9b3c5e81ceb1879bfcf138d6205b2d49cdef60ba00787d1a42c75d6d708ddb7552c6470ad15e58da6259cdf48e508f577187fad20f845824e43a0ea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5ca05e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924',
txHash : '0x1dfac8cb1ab9c25de93758652f3cded2537355e2207c45ba39442b7cb700e8fd' ,
senderTxHash : '0x1dfac8cb1ab9c25de93758652f3cded2537355e2207c45ba39442b7cb700e8fd' ,
signatures : [
[
'0x4e44' ,
'0xf9e93c6dc3227a4cde633dc7a9b3c5e81ceb1879bfcf138d6205b2d49cdef60b' ,
'0x0787d1a42c75d6d708ddb7552c6470ad15e58da6259cdf48e508f577187fad20'
] ,
[
'0x4e43' ,
'0xea3bba902857eb58bed048fd1b94c5d99881e4356221d6e1e6e873401abf3a5c' ,
'0x5e5d250db3c31a193dbe5289935755461ad78e41c1f60d3ca80ae0a97d2a9924'
]
]
}
// signTransaction with fee payer's private key
> caver . klay . accounts .signTransaction ({
senderRawTransaction: '0x09f886819a8505d21dba00830dbba094d05c5926b0a2f31aadcc9a9cbd3868a50104d834019476d1cc1cdb081de8627cab2c074f02ebc7bce0d0f847f845820fe9a0c5ea5b57f460bbc76101bafa2ed16228af0c0094d31a8a799e430278b4360724a0240afd7cf426e6aababdc59a3935b97aac4e059b59ba85ccedc75c95168abcfb80c4c3018080',
feePayer : '0x6e75945404daa4130a338af01199244b1eae2a0b'
} , '0x{private key}' ) .then ( console .log)
{
messageHash : '0xec121b6f7e2925166bcb1e6f14fd0b078f1168b6feca9340db7bd31998d14043' ,
v : '0x4e44' ,
r : '0xf68d2c65563baee7a76d5f75aaadbfecf4ae3f55b349013f740159edd38465d9' ,
s : '0x5146c0bbe998a7ba6e7c8f5aef7eb5fea0b4b7429713d65e38b2435f6a575300' ,
rawTransaction: '0x09f8de819a8505d21dba00830dbba094d05c5926b0a2f31aadcc9a9cbd3868a50104d834019476d1cc1cdb081de8627cab2c074f02ebc7bce0d0f847f845820fe9a0c5ea5b57f460bbc76101bafa2ed16228af0c0094d31a8a799e430278b4360724a0240afd7cf426e6aababdc59a3935b97aac4e059b59ba85ccedc75c95168abcfb946e75945404daa4130a338af01199244b1eae2a0bf847f845824e44a0f68d2c65563baee7a76d5f75aaadbfecf4ae3f55b349013f740159edd38465d9a05146c0bbe998a7ba6e7c8f5aef7eb5fea0b4b7429713d65e38b2435f6a575300',
txHash : '0xf31ab04d9ccdb93262a4349afabd68326db0d61452c06259ed8ea91bc09ca295' ,
senderTxHash : '0x1b7c0f2fc7548056e90d9690e8c397acf99eb38e622ac91ee22c2085065f8a55' ,
feePayerSignatures : [
[
'0x4e44' ,
'0xf68d2c65563baee7a76d5f75aaadbfecf4ae3f55b349013f740159edd38465d9' ,
'0x5146c0bbe998a7ba6e7c8f5aef7eb5fea0b4b7429713d65e38b2435f6a575300'
]
]
}
// signTransaction without fee payer's private key
> caver . klay . accounts .signTransaction ({
senderRawTransaction: '0x09f886819a8505d21dba00830dbba094d05c5926b0a2f31aadcc9a9cbd3868a50104d834019476d1cc1cdb081de8627cab2c074f02ebc7bce0d0f847f845820fe9a0c5ea5b57f460bbc76101bafa2ed16228af0c0094d31a8a799e430278b4360724a0240afd7cf426e6aababdc59a3935b97aac4e059b59ba85ccedc75c95168abcfb80c4c3018080',
feePayer : '0x6e75945404daa4130a338af01199244b1eae2a0b'
}) .then ( console .log)
{
messageHash : '0xec121b6f7e2925166bcb1e6f14fd0b078f1168b6feca9340db7bd31998d14043' ,
v : '0x4e44' ,
r : '0xf68d2c65563baee7a76d5f75aaadbfecf4ae3f55b349013f740159edd38465d9' ,
s : '0x5146c0bbe998a7ba6e7c8f5aef7eb5fea0b4b7429713d65e38b2435f6a575300' ,
rawTransaction: '0x09f8de819a8505d21dba00830dbba094d05c5926b0a2f31aadcc9a9cbd3868a50104d834019476d1cc1cdb081de8627cab2c074f02ebc7bce0d0f847f845820fe9a0c5ea5b57f460bbc76101bafa2ed16228af0c0094d31a8a799e430278b4360724a0240afd7cf426e6aababdc59a3935b97aac4e059b59ba85ccedc75c95168abcfb946e75945404daa4130a338af01199244b1eae2a0bf847f845824e44a0f68d2c65563baee7a76d5f75aaadbfecf4ae3f55b349013f740159edd38465d9a05146c0bbe998a7ba6e7c8f5aef7eb5fea0b4b7429713d65e38b2435f6a575300',
txHash : '0xf31ab04d9ccdb93262a4349afabd68326db0d61452c06259ed8ea91bc09ca295' ,
senderTxHash : '0x1b7c0f2fc7548056e90d9690e8c397acf99eb38e622ac91ee22c2085065f8a55' ,
feePayerSignatures : [
[
'0x4e44' ,
'0xf68d2c65563baee7a76d5f75aaadbfecf4ae3f55b349013f740159edd38465d9' ,
'0x5146c0bbe998a7ba6e7c8f5aef7eb5fea0b4b7429713d65e38b2435f6a575300'
]
]
}
signTransactionWithHash
Copy caver . klay . accounts .signTransactionWithHash (txHash , privateKeys [ , chainId] [ , callback])
주어진 트랜잭션 해시와 개인키로 Klaytn 트랜잭션에 서명합니다.
참고 caver.klay.accounts.signTransactionWithHash
는 caver-js v1.3.2-rc.2 부터 지원됩니다.
Parameters
Return Value
프로미스
가 Array
을 반환: 서명들이 있는 배열입니다.
배열에 있는 각 서명 객체는 다음 값들을 가집니다:
Example
Copy // sign transaction with single private key and chain id
> caver.klay.accounts.signTransactionWithHash('0x583d887614e1ce674c05fcd050a661f0631c23ed1f95fa43fefcc25e6383bca1', '0x{priavte key}', '0x3e9').then(console.log)
[
{
V : '0x07f5' ,
R : '0x66eb2dbb90295b7541de72f2d34002bac3f00a94501453b310b25a0da62446a5' ,
S : '0x1c7c3aefabc042b055489f5b899df55439fe1851858d61e8eb6c4b44be35c227'
}
]
// sign transaction with single private key
> caver.klay.accounts.signTransactionWithHash('0x583d887614e1ce674c05fcd050a661f0631c23ed1f95fa43fefcc25e6383bca1', '0x{priavte key}').then(console.log)
[
{
V : '0x07f5' ,
R : '0x66eb2dbb90295b7541de72f2d34002bac3f00a94501453b310b25a0da62446a5' ,
S : '0x1c7c3aefabc042b055489f5b899df55439fe1851858d61e8eb6c4b44be35c227'
}
]
// sign transaction with mulitple private keys and chain id
> caver.klay.accounts.signTransactionWithHash('0x583d887614e1ce674c05fcd050a661f0631c23ed1f95fa43fefcc25e6383bca1', ['0x{priavte key}', '0x{priavte key}'], '0x3e9').then(console.log)
[
{
V : '0x07f5' ,
R : '0x66eb2dbb90295b7541de72f2d34002bac3f00a94501453b310b25a0da62446a5' ,
S : '0x1c7c3aefabc042b055489f5b899df55439fe1851858d61e8eb6c4b44be35c227'
} ,
{
V : '0x07f6' ,
R : '0x946ce0288ee98b56160fadae8ec38e36828cf764f897f68f93157a2dc286d4aa' ,
S : '0x049ab3f5e91cec831124bdb10782e38de3a02a803ca2dd61a50da81cf5c4f8ef'
}
]
// sign transaction with mulitple private keys
> caver.klay.accounts.signTransactionWithHash('0x583d887614e1ce674c05fcd050a661f0631c23ed1f95fa43fefcc25e6383bca1', ['0x{priavte key}', '0x{priavte key}']).then(console.log)
[
{
V : '0x07f5' ,
R : '0x66eb2dbb90295b7541de72f2d34002bac3f00a94501453b310b25a0da62446a5' ,
S : '0x1c7c3aefabc042b055489f5b899df55439fe1851858d61e8eb6c4b44be35c227'
} ,
{
V : '0x07f6' ,
R : '0x946ce0288ee98b56160fadae8ec38e36828cf764f897f68f93157a2dc286d4aa' ,
S : '0x049ab3f5e91cec831124bdb10782e38de3a02a803ca2dd61a50da81cf5c4f8ef'
}
]
feePayerSignTransaction
Copy caver . klay . accounts .feePayerSignTransaction (tx , feePayerAddress [ , privateKey] [ , callback])
트랜잭션 수수료 납부자로서 트랜잭션에 서명합니다.
트랜잭션 수수료 납부자는 FEE_DELEGATED 트랜잭션에 서명할 수 있습니다. 트랜잭션 객체 또는 RLP 인코딩된 트랜잭션은 인자로 전달될 수 있습니다.
privateKay가 주어지지 않으면 caver-js 인메모리 지갑에 있는 수수료 납부자 계정의 feePayerKey가 사용됩니다.
feePayerSignTransaction keeps the existing signatures/feePayerSignatures in the input transaction and appends the fee-payer signature(s) to it.
See Sending a Transaction with multiple signer for how to combine multiple users' signatures into a single rawTransaction.
참고 caver.klay.accounts.feePayerSignTransaction
는 caver-js v1.2.0 부터 지원됩니다.
Parameters
Return Value
Promise
returning Object
: The RLP encoded signed transaction. The object properties are as follows:
NOTE The txHash
and senderTxHash
in the result object may not be the final values. If another sender signature is added, txHash and senderTxHash will change. If a fee-payer signature is added, txHash will change.
Example
Copy // feePayerSignTransaction with transaction object
> caver . klay . accounts .feePayerSignTransaction ({
type : 'FEE_DELEGATED_VALUE_TRANSFER' ,
from : '0x9230c09295dd8b9c02b6ae138ffe3133b58b25c1' ,
to : '0x715139255d5e300b431722ec9666ac2350cbf523' ,
value : 1 ,
gas : 900000 ,
}, '0x2e4351e950d8d43444ac789cc9e87ba35340ad52', '0x90300d268bb2bad69f5b24e2ac1409a9416cc814254b356ce96b3f75c4364716').then(console.log)
{
messageHash : '0x4cc0a423199d374d412cd3f92777a8f82bfc47b701d0df1f82b0d932802c955e' ,
v : '0x4e44' ,
r : '0x2a2cdce5dd2fea8e717f94457700ca9cfa43fd5b09b57b1c8dc9cd2e73ac2730' ,
s : '0x4fdf1e4483f8c07c5ea180eea1af11fcd7fc32f6b6dded39eb8cb4a1f2e9f5a7' ,
rawTransaction: '0x09f899808505d21dba00830dbba094715139255d5e300b431722ec9666ac2350cbf52301949230c09295dd8b9c02b6ae138ffe3133b58b25c1c4c3018080942e4351e950d8d43444ac789cc9e87ba35340ad52f847f845824e44a02a2cdce5dd2fea8e717f94457700ca9cfa43fd5b09b57b1c8dc9cd2e73ac2730a04fdf1e4483f8c07c5ea180eea1af11fcd7fc32f6b6dded39eb8cb4a1f2e9f5a7',
txHash : '0xead2cdf961090d014044de7ac78e3f9522b430edcd0ea4d3299811464ed636ea' ,
senderTxHash : '0x5e0bfce81dca4d6ec5ebeaff8a55fe5dd6d77e6292ee0548c12d7a7aaaff1300' ,
feePayerSignatures : [
[
'0x4e44' ,
'0x2a2cdce5dd2fea8e717f94457700ca9cfa43fd5b09b57b1c8dc9cd2e73ac2730' ,
'0x4fdf1e4483f8c07c5ea180eea1af11fcd7fc32f6b6dded39eb8cb4a1f2e9f5a7'
]
]
}
// feePayerSignTransaction with transaction object defines signatures
// rawTransaction in result will include signatures
> caver.klay.accounts.feePayerSignTransaction({
type : 'FEE_DELEGATED_VALUE_TRANSFER' ,
from : '0x9230c09295dd8b9c02b6ae138ffe3133b58b25c1' ,
to : '0x715139255d5e300b431722ec9666ac2350cbf523' ,
value : 1 ,
gas : 900000 ,
signatures: [['0x4e44', '0xd31041fe47da32fe03cf644186f50f39beaa969f73deb189d1a51706715215ec', '0x335961d9b38027a01d6b97842c036725a8d4781b5010c47ddb85756687c2def9']]
}, '0x2e4351e950d8d43444ac789cc9e87ba35340ad52', '0x90300d268bb2bad69f5b24e2ac1409a9416cc814254b356ce96b3f75c4364716').then(console.log)
{
messageHash : '0x4cc0a423199d374d412cd3f92777a8f82bfc47b701d0df1f82b0d932802c955e' ,
v : '0x4e44' ,
r : '0x2a2cdce5dd2fea8e717f94457700ca9cfa43fd5b09b57b1c8dc9cd2e73ac2730' ,
s : '0x4fdf1e4483f8c07c5ea180eea1af11fcd7fc32f6b6dded39eb8cb4a1f2e9f5a7' ,
rawTransaction: '0x09f8dd808505d21dba00830dbba094715139255d5e300b431722ec9666ac2350cbf52301949230c09295dd8b9c02b6ae138ffe3133b58b25c1f847f845824e44a0d31041fe47da32fe03cf644186f50f39beaa969f73deb189d1a51706715215eca0335961d9b38027a01d6b97842c036725a8d4781b5010c47ddb85756687c2def9942e4351e950d8d43444ac789cc9e87ba35340ad52f847f845824e44a02a2cdce5dd2fea8e717f94457700ca9cfa43fd5b09b57b1c8dc9cd2e73ac2730a04fdf1e4483f8c07c5ea180eea1af11fcd7fc32f6b6dded39eb8cb4a1f2e9f5a7',
txHash : '0x19006aa7228aa50000bab00ecccde8232516b8e1dce6835528d57561a79b5d3d' ,
senderTxHash : '0x7aa6d0b4146020ae38c07c2c9efc26030bd667b9256981379b8cbc86acfd5b27' ,
feePayerSignatures : [
[
'0x4e44' ,
'0x2a2cdce5dd2fea8e717f94457700ca9cfa43fd5b09b57b1c8dc9cd2e73ac2730' ,
'0x4fdf1e4483f8c07c5ea180eea1af11fcd7fc32f6b6dded39eb8cb4a1f2e9f5a7