This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
Releases: klaytn/caver-js
Releases · klaytn/caver-js
Release v1.6.2-rc.2
v1.6.2-rc.2 Release Notes
Fixes
- Fixed an error caused by trimming input data when decoding LegacyTransaction. (#461)
Release v1.6.2-rc.1
v1.6.2-rc.1 Release Notes
Fixes
- Fixed
caver.abi.encodeParameters
logic to handle fixed lenght tuple array type. (#456)
Release v1.6.1
v1.6.1-rc.2 Release Notes
New Features
-
Supported
create
function to provide the same usability.- The Contract, ABI and KCT Layer supports
create
function.- The
caver.contract.create
creates a Contract instance. - The
caver.kct.kip7.create
creates a KIP7 instance. - The
caver.kct.kip17.create
creates a KIP17 instance. - The
caver.kct.kip37.create
creates a KIP37 instance.
- The
- The Transaction Layer supports
create
function.- The
caver.transaction.valueTransfer.create
creates a TxTypeValueTransfer transaction instance. - The
caver.transaction.feeDelegatedValueTransfer.create
creates a TxTypeFeeDelegatedValueTransfer transaction instance. - The
caver.transaction.feeDelegatedValueTransferWithRatio.create
creates a TxTypeFeeDelegatedValueTransferWithRatio transaction instance. - The
caver.transaction.valueTransferMemo.create
creates a TxTypeValueTransferMemo transaction instance. - The
caver.transaction.feeDelegatedValueTransferMemo.create
creates a TxTypeFeeDelegatedValueTransferMemo transaction instance. - The
caver.transaction.feeDelegatedValueTransferMemoWithRatio.create
creates a TxTypeFeeDelegatedValueTransferMemoWithRatio transaction instance. - The
caver.transaction.accountUpdate.create
creates a TxTypeAccountUpdate transaction instance. - The
caver.transaction.feeDelegatedAccountUpdate.create
creates a TxTypeFeeDelegatedAccountUpdate transaction instance. - The
caver.transaction.feeDelegatedAccountUpdateWithRatio.create
creates a TxTypeFeeDelegatedAccountUpdateWithRatio transaction instance. - The
caver.transaction.smartContractDeploy.create
creates a TxTypeSmartContractDeploy transaction instance. - The
caver.transaction.feeDelegatedSmartContractDeploy.create
creates a TxTypeFeeDelegatedSmartContractDeploy transaction instance. - The
caver.transaction.feeDelegatedSmartContractDeployWithRatio.create
creates a TxTypeFeeDelegatedSmartContractDeployWithRatio transaction instance. - The
caver.transaction.smartContractExecution.create
creates a TxTypeSmartContractExecution transaction instance. - The
caver.transaction.feeDelegatedSmartContractExecution.create
creates a TxTypeFeeDelegatedSmartContractExecution transaction instance. - The
caver.transaction.feeDelegatedSmartContractExecutionWithRatio.create
creates a TxTypeFeeDelegatedSmartContractExecutionWithRatio transaction instance. - The
caver.transaction.cancel.create
creates a TxTypeCancel transaction instance. - The
caver.transaction.feeDelegatedCancel.create
creates a TxTypeFeeDelegatedCancel transaction instance. - The
caver.transaction.feeDelegatedCancelWithRatio.create
creates a TxTypeFeeDelegatedCancelWithRatio transaction instance. - The
caver.transaction.chainDataAnchoring.create
creates a TxTypeChainDataAnchoring transaction instance. - The
caver.transaction.feeDelegatedChainDataAnchoring.create
creates a TxTypeFeeDelegatedChainDataAnchoring transaction instance. - The
caver.transaction.feeDelegatedChainDataAnchoringWithRatio.create
creates a TxTypeFeeDelegatedChainDataAnchoringWithRatio transaction instance.
- The
- Please refer to Klaytn Docs for more details.
- The Contract, ABI and KCT Layer supports
-
Introduced new shortcut functions in
caver.contract
to provide the same usability.- The
contract.deploy
function is overloaded and provided.- You can use
contract.deploy
to deploy smart contracts likecontract.deploy({from, … }, byteCode, arguments…)
.
- You can use
- The
contract.send
function executes the smart contract.- You can use
contract.send
to execute smart contracts likecontract.send({from, … }, functionName, arguments...)
.
- You can use
- The
contract.call
function call the smart contract.- You can use
contract.call
to call smart contracts without callObject likecontract.call(functionName, arguments...)
. - You can use
contract.call
to call smart contracts with callObject likecontract.call(callObject, functionName, arguments...)
.
- You can use
- The
contract.sign
function signs the smart contract transaction as a sender and returns the signed transaction instance.- You can use
contract.sign
to sign TxTypeSmartContractDeploy as a sender likecontract.sign({from, … }, 'constructor', byteCode, arguments...)
. - You can use
contract.sign
to sign TxTypeSmartContractExecution as a sender likecontract.sign({from, … }, functionName, arguments...)
.
- You can use
- The
contract.signAsFeePayer
function signs the smart contract transaction as a fee payer and returns the signed transaction instance. To create fee delegation transaction and sign the transaction as a fee payer,feeDelegation
field should be defined astrue
andfeePayer
should be defined.- You can use
contract.signAsFeePayer
to sign TxTypeSmartContractDeploy as a fee payer likecontract.signAsFeePayer({from, �feePayer, feeDelegation: true, … }, 'constructor', byteCode, arguments...)
. - You can use
contract.signAsFeePayer
to sign TxTypeSmartContractExecution as a fee payer likecontract.signAsFeePayer({from, �feePayer, feeDelegation: true, … }, functionName, arguments...)
.
- You can use
- Please refer to Klaytn Docs for more details.
- The
-
Support fee-delegation feature with
caver.contract
- In
caver.contract
, additional fields related to fee-delegation can be defined incontract.options
. Therefore, if there is a value you want to use as default with a Contract instance, you can define it incontract.options
.- You can define
feeDelegation
field incontract.options
to use fee delegation transaction as a default likecontract.options.feeDelegation = true
. - You can define
feePayer
field incontract.options
to use default fee payer address likecontract.options.feePayer = '0x{address in hex}'
. - You can define
feeRatio
field incontract.options
to use default feeRatio likecontract.options.feeRatio = 30’
.
- You can define
- You can define additional fields in sendOptions to use fee-delegation when deploy a smart contract via Contract class.
- You can use
contract.deploy
likecontract.deploy({from, gas, feePayer, feeDelegation, feeRatio}, byteCode, arguments…)
. - You can use
contract.deploy
likecontract.deploy({data: byteCode, arguments: […]}).send({from, gas, feePayer, feeDelegation, feeRatio})
. - You can use
contract.methods['constructor']
likecontract.methods['constructor'](byteCode, arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
. - You can use
contract.methods.constructor
likecontract.methods.constructor(byteCode, arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
.
- You can use
- You can define additional fields in sendOptions to use fee-delegation when executing a smart contract via Contract class.
- You can use
contract.send
likecontract.send({from, gas, feePayer, feeDelegation, feeRatio}, arguments…)
. - You can use
contract.methods[functionName]
likecontract.methods[functionName](arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
. - You can use
contract.methods.functionName
likecontract.methods.functionName(arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
.
- You can use
- You can define additional fields in sendOptions to use fee-delegation when signing a TxTypeFeeDelegatedSmartContractDeploy or TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender.
- You can define the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
contract.sign({from, feeDelegation, feePayer… }, 'constructor', byteCode, arguments...)
. - You can define the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender like
contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments...)
.
- You can define the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
- You can define additional fields in sendOptions to use fee-delegation when signing a TxTypeFeeDelegatedSmartContractExecution or TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender.
- You can define the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
contract.sign({from, feeDelegation, feePayer… }, functionName, arguments...)
. - You can define the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender like
contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments...)
.
- You can define the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
- You can define additional fields in sendOptions to use fee-delegation when signing a TxTypeFeeDelegatedSmartContractDeploy or TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender.
- You can define additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
contract.sign({from, feeDelegation, feePayer… }, 'constructor', byteCode, arguments...)
. - You can define additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender like
contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments...)
.
- You can define additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
- You can define additional fields in sendOptions to use fee-delegation when signing a TxTypeFeeDelegatedSmartContractExecution or TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender.
- You can define additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
contract.sign({from, feeDelegation, feePayer… }, functionName, arguments...)
. - You can define additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender like `contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCod...
- You can define additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
- In
Release v1.6.1-rc.6
v1.6.1-rc.6 Release Notes
Fixes
- Call redefined constructor when
caver.contract.create
is called. (#452)
Release v1.6.1-rc.5
Release v1.6.1-rc.4
Release v1.6.1-rc.3
Release v1.6.1-rc.2
v1.6.1-rc.2 Release Notes
New Features
-
Support
create
function to provide the same usability- The Contract, ABI and KCT Layer support
create
function.- The
caver.contract.create
creates a Contract instance. - The
caver.kct.kip7.create
creates a KIP7 instance. - The
caver.kct.kip17.create
creates a KIP17 instance. - The
caver.kct.kip37.create
creates a KIP37 instance.
- The
- The Transaction Layer support
create
function.- The
caver.transaction.valueTransfer.create
creates a TxTypeValueTransfer transaction instance. - The
caver.transaction.feeDelegatedValueTransfer.create
creates a TxTypeFeeDelegatedValueTransfer transaction instance. - The
caver.transaction.feeDelegatedValueTransferWithRatio.create
creates a TxTypeFeeDelegatedValueTransferWithRatio transaction instance. - The
caver.transaction.valueTransferMemo.create
creates a TxTypeValueTransferMemo transaction instance. - The
caver.transaction.feeDelegatedValueTransferMemo.create
creates a TxTypeFeeDelegatedValueTransferMemo transaction instance. - The
caver.transaction.feeDelegatedValueTransferMemoWithRatio.create
creates a TxTypeFeeDelegatedValueTransferMemoWithRatio transaction instance. - The
caver.transaction.accountUpdate.create
creates a TxTypeAccountUpdate transaction instance. - The
caver.transaction.feeDelegatedAccountUpdate.create
creates a TxTypeFeeDelegatedAccountUpdate transaction instance. - The
caver.transaction.feeDelegatedAccountUpdateWithRatio.create
creates a TxTypeFeeDelegatedAccountUpdateWithRatio transaction instance. - The
caver.transaction.smartContractDeploy.create
creates a TxTypeSmartContractDeploy transaction instance. - The
caver.transaction.feeDelegatedSmartContractDeploy.create
creates a TxTypeFeeDelegatedSmartContractDeploy transaction instance. - The
caver.transaction.feeDelegatedSmartContractDeployWithRatio.create
creates a TxTypeFeeDelegatedSmartContractDeployWithRatio transaction instance. - The
caver.transaction.smartContractExecution.create
creates a TxTypeSmartContractExecution transaction instance. - The
caver.transaction.feeDelegatedSmartContractExecution.create
creates a TxTypeFeeDelegatedSmartContractExecution transaction instance. - The
caver.transaction.feeDelegatedSmartContractExecutionWithRatio.create
creates a TxTypeFeeDelegatedSmartContractExecutionWithRatio transaction instance. - The
caver.transaction.cancel.create
creates a TxTypeCancel transaction instance. - The
caver.transaction.feeDelegatedCancel.create
creates a TxTypeFeeDelegatedCancel transaction instance. - The
caver.transaction.feeDelegatedCancelWithRatio.create
creates a TxTypeFeeDelegatedCancelWithRatio transaction instance. - The
caver.transaction.chainDataAnchoring.create
creates a TxTypeChainDataAnchoring transaction instance. - The
caver.transaction.feeDelegatedChainDataAnchoring.create
creates a TxTypeFeeDelegatedChainDataAnchoring transaction instance. - The
caver.transaction.feeDelegatedChainDataAnchoringWithRatio.create
creates a TxTypeFeeDelegatedChainDataAnchoringWithRatio transaction instance.
- The
- Please refer to Klaytn Docs for more details.
- The Contract, ABI and KCT Layer support
-
Support short cut functions in
caver.contract
to provide the same usability- The
contract.deploy
function is overloaded and provided.- You can use
contract.deploy
to deploy smart contract likecontract.deploy({from, … }, byteCode, arguments…)
.
- You can use
- The
contract.send
function executes the smart contract.- You can use
contract.send
to execute smart contract likecontract.send({from, … }, functionName, arguments...)
.
- You can use
- The
contract.call
function call the smart contract.- You can use
contract.call
to call smart contract without callObject likecontract.call(functionName, arguments...)
. - You can use
contract.call
to call smart contract with callObject likecontract.call(callObject, functionName, arguments...)
.
- You can use
- The
contract.sign
function signs the smart contract transaction as a sender and returns signed transaction instance.- You can use
contract.sign
to sign TxTypeSmartContractDeploy as a sender likecontract.sign({from, … }, 'constructor', byteCode, arguments...)
. - You can use
contract.sign
to sign TxTypeSmartContractExecution as a sender likecontract.sign({from, … }, functionName, arguments...)
.
- You can use
- The
contract.signAsFeePayer
function signs the smart contract transaction as a fee payer and returns signed transaction instance. To create fee delegation transaction and sign the transaction as a fee payer,feeDelegation
field should be defined totrue
andfeePayer
should be defined.- You can use
contract.signAsFeePayer
to sign TxTypeSmartContractDeploy as a fee payer likecontract.signAsFeePayer({from, �feePayer, feeDelegation: true, … }, 'constructor', byteCode, arguments...)
. - You can use
contract.signAsFeePayer
to sign TxTypeSmartContractExecution as a fee payer likecontract.signAsFeePayer({from, �feePayer, feeDelegation: true, … }, functionName, arguments...)
.
- You can use
- Please refer to Klaytn Docs for more details.
- The
-
Support fee-delegation feature with
caver.contract
- In
caver.contract
, additional fields related to fee-delegation can be defined incontract.options
. Therefore, if there is a value you want to use as default with a Contract instance, you can define it incontract.options
.- You can define
feeDelegation
field incontract.options
to use fee delegation transaction as a default likecontract.options.feeDelegation = true
. - You can define
feePayer
field incontract.options
to use default fee payer address likecontract.options.feePayer = '0x{address in hex}'
. - You can define
feeRatio
field incontract.options
to use default feeRatio likecontract.options.feeRatio = 30’
.
- You can define
- You can define additional fields in sendOptions to use fee-delegation when deploy a smart contract via Contract class.
- You can use
contract.deploy
likecontract.deploy({from, gas, feePayer, feeDelegation, feeRatio}, byteCode, arguments…)
. - You can use
contract.deploy
likecontract.deploy({data: byteCode, arguments: […]}).send({from, gas, feePayer, feeDelegation, feeRatio})
. - You can use
contract.methods['constructor']
likecontract.methods['constructor'](byteCode, arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
. - You can use
contract.methods.constructor
likecontract.methods.constructor(byteCode, arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
.
- You can use
- You can define additional fields in sendOptions to use fee-delegation when execute a smart contract via Contract class.
- You can use
contract.send
likecontract.send({from, gas, feePayer, feeDelegation, feeRatio}, arguments…)
. - You can use
contract.methods[functionName]
likecontract.methods[functionName](arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
. - You can use
contract.methods.functionName
likecontract.methods.functionName(arguments...).send({from, gas, feePayer, feeDelegation, feeRatio})
.
- You can use
- You can define additional fields in sendOptions to use fee-delegation when sign a TxTypeFeeDelegatedSmartContractDeploy or TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
contract.sign({from, feeDelegation, feePayer… }, 'constructor', byteCode, arguments...)
. - You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender like
contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments...)
.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
- You can define additional fields in sendOptions to use fee-delegation when sign a TxTypeFeeDelegatedSmartContractExecution or TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
contract.sign({from, feeDelegation, feePayer… }, functionName, arguments...)
. - You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender like
contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments...)
.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
- You can define additional fields in sendOptions to use fee-delegation when sign a TxTypeFeeDelegatedSmartContractDeploy or TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
contract.sign({from, feeDelegation, feePayer… }, 'constructor', byteCode, arguments...)
. - You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeployWithRatio as a sender like
contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments...)
.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractDeploy as a sender like
- You can define additional fields in sendOptions to use fee-delegation when sign a TxTypeFeeDelegatedSmartContractExecution or TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender.
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
contract.sign({from, feeDelegation, feePayer… }, functionName, arguments...)
. - You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecutionWithRatio as a sender like `contract.sign({from, feeDelegation, feePayer, feeRatio… }, 'constructor', byteCode, arguments.....
- You can defined the additional fields related to fee-delegation to sign TxTypeFeeDelegatedSmartContractExecution as a sender like
- In
Release v1.6.1-rc.1
Release v1.6.0
v1.6.0 Release Notes
New Features
caver.abi
supports tuple type.- You can encode and decode tuple-typed parameters using the functions below.
- caver.abi.encodeParameter
- caver.abi.encodeParameters
- caver.abi.decodeParameter
- caver.abi.decodeParameters
- For more information on tuple type, please refer to Solidity document.
- You can encode and decode tuple-typed parameters using the functions below.