BasicTxApi

BasicTxApi

new BasicTxApi()

Version:
  • 1.0

BasicTx service.

Methods

accountUpdateTransaction(opts, callback)

Account update transaction Create a transaction that updates Klaytn account keys. You can find Klaytn account key types in Accounts.<p></p> If you update the account to Legacy key type (1), you can start using your account once it is enabled. If you update the account to Public key type (2), the account cannot be used within the wallet. To restore your account, use Global Fee Delegation RLP API, or update to legacy externally and before enabling the account. If you update the key to Fail key type (3), the account will automatically be disabled.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~accountUpdateTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

anchorTransaction(opts, callback)

Anchor transaction Create a transaction for anchoring service chain data to Klaytn main chain.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~anchorTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

cancelTransaction(opts, callback)

Cancel transaction Create a transaction for cancelling a pending transaction that had been sent to Klaytn with the KAS global fee payer account. To cancel, you need either the nonce or the transaction hash.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~cancelTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

contractCall(opts, callback)

Calls contract Can parse data within the deloyed contract or decide whether the transaction can be executed.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~contractCallCallback

The callback function, accepting three arguments: error, data, response data is of type: ContractCallResponse

contractDeployTransaction(opts, callback)

Contract deploy transaction Create a transaction for deploying a contract.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~contractDeployTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

contractExecutionTransaction(opts, callback)

Contract execution transaction Create a transaction for executing the function of a deployed contract.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~contractExecutionTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

legacyTransaction(opts, callback)

Legacy transaction occurrence Create a transaction that supports the legacy account (for which the public key is derived from the private key) and transaction formats. All newly created Klaytn accounts on KAS are legacy accounts.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~legacyTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

processRLP(opts, callback)

Transaction using rlp Create transaction using rlp (SigRLP or TxHashRLP). The rlp from the transaction API of Wallet API is in the TxHashRLP format, which includes signature. You can create a SigRLP without signature easily using caver.<p></p> If you want to create a SigRLP for each transaction method on caver, use `getRLPEncodingForSignature()`, and `getRLPEncoding()` to create TxHashRLP. For SigRLP, you sign with the private key of the `from` account, as long as the accounts have been created in the account pool. For more details on SigRLP and TxHashRLP by each transaction type, please refer to Klaytn Docs.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~processRLPCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

transactionReceipt(callback)

Retrieve transaction Retrieve transaction result with transaction hash value. You can find out whether the transaction was successful by checking the `status` field in the response.

Parameters:
Name Type Description
callback BasicTxApi~transactionReceiptCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionReceipt

valueTransferTransaction(opts, callback)

KLAY transfer transaction Create a transaction for KLAY transfers with/without memos.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~valueTransferTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

Type Definitions

accountUpdateTransactionCallback(error, data, response)

Callback function to receive the result of the accountUpdateTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

anchorTransactionCallback(error, data, response)

Callback function to receive the result of the anchorTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

cancelTransactionCallback(error, data, response)

Callback function to receive the result of the cancelTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

contractCallCallback(error, data, response)

Callback function to receive the result of the contractCall operation.

Parameters:
Name Type Description
error String

Error message, if any.

data ContractCallResponse

The data returned by the service call.

response String

The complete HTTP response.

contractDeployTransactionCallback(error, data, response)

Callback function to receive the result of the contractDeployTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

contractExecutionTransactionCallback(error, data, response)

Callback function to receive the result of the contractExecutionTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

legacyTransactionCallback(error, data, response)

Callback function to receive the result of the legacyTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

processRLPCallback(error, data, response)

Callback function to receive the result of the processRLP operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

transactionReceiptCallback(error, data, response)

Callback function to receive the result of the transactionReceipt operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionReceipt

The data returned by the service call.

response String

The complete HTTP response.

valueTransferTransactionCallback(error, data, response)

Callback function to receive the result of the valueTransferTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

BasicTxApi

new BasicTxApi(apiClientopt)

Constructs a new BasicTxApi.

Parameters:
Name Type Attributes Description
apiClient ApiClient <optional>

Optional API client implementation to use, default to ApiClient#instance if unspecified.

Methods

accountUpdateTransaction(opts, callback)

Account update transaction Create a transaction that updates Klaytn account keys. You can find Klaytn account key types in Accounts.<p></p> If you update the account to Legacy key type (1), you can start using your account once it is enabled. If you update the account to Public key type (2), the account cannot be used within the wallet. To restore your account, use Global Fee Delegation RLP API, or update to legacy externally and before enabling the account. If you update the key to Fail key type (3), the account will automatically be disabled.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~accountUpdateTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

anchorTransaction(opts, callback)

Anchor transaction Create a transaction for anchoring service chain data to Klaytn main chain.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~anchorTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

cancelTransaction(opts, callback)

Cancel transaction Create a transaction for cancelling a pending transaction that had been sent to Klaytn with the KAS global fee payer account. To cancel, you need either the nonce or the transaction hash.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~cancelTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

contractCall(opts, callback)

Calls contract Can parse data within the deloyed contract or decide whether the transaction can be executed.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~contractCallCallback

The callback function, accepting three arguments: error, data, response data is of type: ContractCallResponse

contractDeployTransaction(opts, callback)

Contract deploy transaction Create a transaction for deploying a contract.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~contractDeployTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

contractExecutionTransaction(opts, callback)

Contract execution transaction Create a transaction for executing the function of a deployed contract.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~contractExecutionTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

legacyTransaction(opts, callback)

Legacy transaction occurrence Create a transaction that supports the legacy account (for which the public key is derived from the private key) and transaction formats. All newly created Klaytn accounts on KAS are legacy accounts.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~legacyTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

processRLP(opts, callback)

Transaction using rlp Create transaction using rlp (SigRLP or TxHashRLP). The rlp from the transaction API of Wallet API is in the TxHashRLP format, which includes signature. You can create a SigRLP without signature easily using caver.<p></p> If you want to create a SigRLP for each transaction method on caver, use `getRLPEncodingForSignature()`, and `getRLPEncoding()` to create TxHashRLP. For SigRLP, you sign with the private key of the `from` account, as long as the accounts have been created in the account pool. For more details on SigRLP and TxHashRLP by each transaction type, please refer to Klaytn Docs.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~processRLPCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

transactionReceipt(callback)

Retrieve transaction Retrieve transaction result with transaction hash value. You can find out whether the transaction was successful by checking the `status` field in the response.

Parameters:
Name Type Description
callback BasicTxApi~transactionReceiptCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionReceipt

valueTransferTransaction(opts, callback)

KLAY transfer transaction Create a transaction for KLAY transfers with/without memos.

Parameters:
Name Type Description
opts Object

Optional parameters

callback BasicTxApi~valueTransferTransactionCallback

The callback function, accepting three arguments: error, data, response data is of type: TransactionResult

Type Definitions

accountUpdateTransactionCallback(error, data, response)

Callback function to receive the result of the accountUpdateTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

anchorTransactionCallback(error, data, response)

Callback function to receive the result of the anchorTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

cancelTransactionCallback(error, data, response)

Callback function to receive the result of the cancelTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

contractCallCallback(error, data, response)

Callback function to receive the result of the contractCall operation.

Parameters:
Name Type Description
error String

Error message, if any.

data ContractCallResponse

The data returned by the service call.

response String

The complete HTTP response.

contractDeployTransactionCallback(error, data, response)

Callback function to receive the result of the contractDeployTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

contractExecutionTransactionCallback(error, data, response)

Callback function to receive the result of the contractExecutionTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

legacyTransactionCallback(error, data, response)

Callback function to receive the result of the legacyTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

processRLPCallback(error, data, response)

Callback function to receive the result of the processRLP operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.

transactionReceiptCallback(error, data, response)

Callback function to receive the result of the transactionReceipt operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionReceipt

The data returned by the service call.

response String

The complete HTTP response.

valueTransferTransactionCallback(error, data, response)

Callback function to receive the result of the valueTransferTransaction operation.

Parameters:
Name Type Description
error String

Error message, if any.

data TransactionResult

The data returned by the service call.

response String

The complete HTTP response.