This page uses machine translation from English, which may contain errors or unclear language. For the most accurate information, please see the original English version. Some content may be in the original English due to frequent updates. Help us improve this page's translation by joining our effort on Crowdin. (Crowdin translation page, Contributing guide)
Legacy Account Key
Import necessary classes from the Web3j and kaia libraries(web3j-ext
).
Create a Web3j instance with the specified BAOBAB_URL
Also, you can change the default provider. For example, using the alchemy provider.
Create a credential from private key
Gas price and gas limit settings
Set the sender address equal to the loaded credential's address
Get chain ID from the network
Set the receiver address equal to any valid address
Get the nonce for the sender's address
Set the value to transfer
Set transaction type as VALUE_TRANSFER
Create a raw transaction for value transfer
Sign the transaction
Send the signed transaction to kaia network
Recover the sender address from signed transaction and compare it to the from address
Shut down the Web3j instance