Role-based Account Key
AccountKeyRoleBased represents a role-based key. If an account has an AccountKeyRoleBased object and the transaction type is one except account update, the validation process is done according to each roles like below:
Import extend from web3py_ext to extend web3 to kaia web3
Import necessary utils from web3 and eth_account
Define a web3 connection using Web3.HTTPProvider and RPC endpoint
Also, you can change the provider URL from kairos to quicknode
Define a wallet from address and private key using Account.from_key_pair which has the role to send transaction
Create an empty transaction of type TxType.VALUE_TRANSFER. You can use empty_tx util to get a tx with default fields filled.
Create a transaction with from, to and value fields to transfer.
from: the sender's address, to: target address to receive kaia.
value field means how many kaia you want to send and you can use the Web3.to_peb utils to convert kaia to peb unit.
Use fill_transaction to add rest of the fields of the transaction like gas limit, Nonce, etc. You can print all the fields after this line if you want to see
Sign the transaction with the defined account
Sending the signed transaction to the network and waiting receipt until it is completely executed in the blockchain
Recover sender address with Account.recover_transaction from signed transaction