Smart Contract Execution
sendTransaction (SMART_CONTRACT_EXECUTION)
Sends a Smart Contract Execution transaction to the network.
Parameters
The parameters of sendTransaction are a transaction object and a callback function.
A transaction object of type SMART_CONTRACT_EXECUTION
has the following structure:
Return Value
The callback
will return the 32-byte transaction hash.
PromiEvent
: A promise combined event emitter. Will be resolved when the transaction receipt is available. Additionally the following events are available:
"transactionHash"
returnsString
: Is fired right after the transaction is sent and a transaction hash is available."receipt"
returnsObject
: Is fired when the transaction receipt is available."error"
returnsError
: Is fired if an error occurs during sending. On an out-of-gas error, the second parameter is the receipt.
Example
sendTransaction (FEE_DELEGATED_SMART_CONTRACT_EXECUTION)
Sends a Fee Delegated Smart Contract Execution transaction to the network.
Parameters
The parameters of sendTransaction are a transaction object and a callback function.
A transaction object of type FEE_DELEGATED_SMART_CONTRACT_EXECUTION
has the following structure:
A transaction object of type FEE_DELEGATED_SMART_CONTRACT_EXECUTION
with the above structure or an RLP-encoded transaction
of type FEE_DELEGATED_SMART_CONTRACT_EXECUTION
can be used as a parameter in caver.klay.accounts.signTransaction for sender and in caver.klay.accounts.feePayerSignTransaction for fee payer.
In order for the fee payer to sign an RLP encoded transaction signed by the sender and send it to the network, define an object with the following structure and call caver.klay.sendTransaction
.
Return Value
The callback
will return the 32-byte transaction hash.
PromiEvent
: A promise combined event emitter. Will be resolved when the transaction receipt is available. Additionally the following events are available:
"transactionHash"
returnsString
: Is fired right after the transaction is sent and a transaction hash is available."receipt"
returnsObject
: Is fired when the transaction receipt is available."error"
returnsError
: Is fired if an error occurs during sending. On an out-of-gas error, the second parameter is the receipt.
Example
sendTransaction (FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO)
Sends a Fee Delegated Smart Contract Execution With Ratio transaction to the network.
Parameters
The parameters of sendTransaction are a transaction object and a callback function.
A transaction object of type FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO
has the following structure:
A transaction object of type FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO
with the above structure or an RLP-encoded transaction
of type FEE_DELEGATED_SMART_CONTRACT_EXECUTION_WITH_RATIO
can be used as a parameter in caver.klay.accounts.signTransaction for sender and in caver.klay.accounts.feePayerSignTransaction for fee payer.
In order for the fee payer to sign an RLP encoded transaction signed by the sender and send it to the network, define an object with the following structure and call caver.klay.sendTransaction
.
Return Value
The callback
will return the 32-byte transaction hash.
PromiEvent
: A promise combined event emitter. Will be resolved when the transaction receipt is available. Additionally the following events are available:
"transactionHash"
returnsString
: Is fired right after the transaction is sent and a transaction hash is available."receipt"
returnsObject
: Is fired when the transaction receipt is available."error"
returnsError
: Is fired if an error occurs during sending. On an out-of-gas error, the second parameter is the receipt.
Example
Last updated