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

Release v1.2.0

Compare
Choose a tag to compare
@jimni1222 jimni1222 released this 21 Oct 08:22
· 1522 commits to dev since this release
cc42ffe

v1.2.0 Release Note

Highlights: Klaytn account key types are supported since [email protected].

Klaytn supports various key types such as multisig and role-baed keys for an account. Those key types are now supported in caver-js as well. For more information about key types, refer to https://docs.klaytn.com/klaytn/design/accounts#account-key.

Breaking Change

  • privateKey of an Account object cannot be modified since v1.2.0.
    If you update account.privateKey directly using account.privateKey = ‘prvKey’, please use account.accountKey = caver.klay.accounts.createAccountKey(‘prvKey’) instead.

New features

  • Introduced new classes for various account key types:
    • Account
    • AccountForUpdate
    • AccountKeyPublic
    • AccountKeyMultiSig
    • AccountKeyRoleBased
  • Introduced a new field ‘key’ in the transaction object.
    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 functions in the Accounts package:
    • 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
    • caver.klay.accounts.isDecoupled
    • caver.klay.accounts.getLegacyAccount
    • caver.klay.accounts.feePayerSignTransaction
    • caver.klay.accounts.getRawTransactionWithSignatures
    • caver.klay.accounts.combineSignatures
  • 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 util functions:
    • caver.utils.isTxHash
    • caver.utils.isTxHashStrict
    • caver.utils.isValidPublicKey
    • caver.utils.isValidRole
    • caver.utils.isEmptySig

Fixed

  • Fixed setProvider to handle parameters.
  • Fixed currentProvider to set properly with setProvider function.
  • Fixed callback function in caver.klay.accounts.signTransaction to call once.

Improvements

  • Modified decodeTransaction logic to handle multiple signatures.
  • Made privateKey as a optional parameter in caver.klay.accounts.signTransaction.
  • 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.