Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Release v1.2.0-rc.4

Pre-release
Pre-release
Compare
Choose a tag to compare
@jimni1222 jimni1222 released this 21 Oct 01:23
· 1528 commits to dev since this release
3971ce9

v1.2.0-rc.4 Release Note

Breaking Change

In the new Account class, privateKey is changed as a read-only property. Account class is a data structure used inside the caver.klay.accounts package and is independent of the Klaytn network. privateKey is now a read-only property that references the defaultKey of the accountKey in the Account, so if you directly update the property, it will return an error. To change the privateKey you need to update the accountKey in your Account. Since privateKey only represents the default key, it is recommended to use transactionKey, updateKey, and feePayerKey rather than privateKey when you sign or send a transaction.

New features

  • Introduced new classes in caver-js
    • Account
    • AccountForUpdate
    • AccountKeyPublic
    • AccountKeyMultiSig
    • AccountKeyRoleBased
  • Introduced new Accounts package functions for newly introduced classes
    • caver.klay.accounts.createWithAccountKey
    • caver.klay.accounts.createWithAccountKeyPublic
    • caver.klay.accounts.createWithAccountKeyMultiSig
    • caver.klay.accounts.createWithAccountKeyRoleBased
    • caver.klay.accounts.createAccountForUpdate
    • caver.klay.accounts.createAccountForUpdateWithPublicKey
    • caver.klay.accounts.createAccountForUpdateWithLegacyKey
    • caver.klay.accounts.createAccountForUpdateWithFailKey
    • caver.klay.accounts.createAccountKey
    • caver.klay.accounts.createAccountKeyPublic
    • caver.klay.accounts.createAccountKeyMultiSig
    • caver.klay.accounts.createAccountKeyRoleBased
    • caver.klay.accounts.accountKeyToPublicKey
    • caver.klay.accounts.updateAccountKey
  • The following APIs are extended to support newly introduced classes
    • add, updatePrivateKey and remove functions in caver.klay.accounts.wallet are extended to handle the new classes.
    • caver.klay.accounts.encrypt and caver.klay.accounts.decrypt functions are extended with new format of keystore v4, to handle the new classes (AccountKeyPublic, AccountKeyMultiSig, AccountKeyRoleBased).
  • Introduced new functions in Accounts package
    • caver.klay.accounts.feePayerSignTransaction
    • caver.klay.accounts.getRawTransactionWithSignatures
    • caver.klay.accounts.combineSignatures
  • Introduced a new field ‘key’ in the transaction object used for account update. In order to update an account, the key to be used for updating must be set correctly in the field defined for each key type. By introducing a key field into the transaction object for account update, you can set an instance of AccountForUpdate in the key field that contains the information to be updated.
  • Introduced new util functions
    • caver.utils.isValidPublicKey
    • caver.utils.isValidRole
    • caver.utils.isEmptySig

Improvements

  • Allowed a custom client configuration with WS connection
  • Updated signTransaction in caver.klay.accounts to accept an RLP encoded transaction as a parameter
  • Updated signTransaction in caver.klay.accounts to append signatures or feePayerSignatures to the existing signatures or feePayerSignatures
  • caver.klay.sendSignedTransaction now accepts an object as a parameter. The object should include at least one of RLP encoded transaction string or signatures/feePayerSignatures. You can pass the returning object from signTransaction, feePayerSignTransaction, getRawTransactionWithSignatures or combineSignatures.