package.jsonfile should exist on the same install path. If it does not exist,
package.jsonshould be generated via
caver.klay.sendTransaction. Note that
caver.klay.sendTransactionperforms both signature generation and submission of the transaction at once.
caver.klay.accounts.signTransaction- The process of signing a transaction with a private key and getting a RLP-encoded transaction.
caver.klay.sendSignedTransaction- sends the RLP-encoded transaction to the node connected to caver-js.
txErrorof the receipt. For more information about
txError, see txError: Detailed Information of Transaction Failures.
rawTransaction), the fee payer can send the transaction after attaching the one's signature. The fee payer sets the
rawTransactionto senderRawTransaction and signs with the address of the fee payer, as in the example below.
datafield as shown below:
contractAddressof the transaction receipt. Before sending a smart contract execution transaction, set the address to the address of the contract instance as follows:
test.jsfile created in the working directory.
feePayerKeyreturn a private key string or an array of private key strings that should be used for the role. So rather than using privateKey property, it is recommended that you use
feePayerKeyas appropriate, without worrying about the accountKey type.
caver.klay.accounts.createAccountKey. This function determines which AccountKey to generate based on the type of the parameter. It creates AccountKeyPublic if a private key string comes as a parameter, or AccountKeyMultiSig if an array of private key strings comes. And if there is an object with a different key for each role, it creates AccountKeyRoleBased.
AccountKeydefined in caver-js are data structures for storing private keys for use in caver-js. It can be different from the key in your account on Klaytn network.
feePayerKeyall represent the same private key string.
feePayerKeyall represent the same multiple private key strings.
fee payerand sign with it. In this case, if your account has multiple private keys, caver-js will sign the transaction with all of those keys.
keysproperty. Therefore, unlike other AccountKey (AccountKeyPublic or AccountKeyMultiSig), transactionKey, updateKey and feePayerKey each represents a different key.
createAccountForUpdate()with the target account address and the new key you want to use.
accountis an account that has enough KLAY balance, and
accountForUpdateis an AccountForUpdate instance that contains the new key and the target account address.
accountForUpdate is created usingcaver.klay.accounts.createAccountForUpdate`.
FEE_DELEGATED_ACCOUNT_UPDATEtransaction, see the example below.
updateTxin the above example as:
accountKeyof the account stored in caver-js as follows.
accountKeyproperty of an account directly, the assigning value must be an instance of AccountKeyPublic, AccountKeyMultiSig, or AccountKeyRoleBased.
rawTransactionhas an RLP encoded transaction that contains both
feePayerSignatureis included only when the transaction is a fee delegated transaction.
feePayerSignTransaction. See the example below.
caver.klay.accounts.feePayerSignTransactionfrom several people, you can create a single RLP encoded transaction that contains all the signature information.
feePayerSignaturesfrom multiple signers, you can send a transaction as follows:
caver.klay.accounts.getRawTransactionWithSignaturesto get an RLP encoded transaction containing the signatures and feePayerSignatures of the transaction object.