Cancel
TxTypeCancel cancels the execution of the transaction with the same nonce in the transaction pool. This transaction type is useful when a submitted transaction seems unprocessed for a certain amount of time.
Import extend from web3py_ext to extend web3 to kaia web3
Import necessary utils from eth_account, web3py_ext and cytoolz
Create a Web3 instance with the specified kaia Baobab testnet URL
Also, you can change the provider URL from baobab to allthatnode
Load an account from private key
Load an fee payer account from private key to sign and send the transaction instead of above account
Create an empty transaction of type TxType.FEE_DELEGATED_CANCEL. You can use empty_tx util to get a tx with default fields filled.
Merge the from and nonce fields into the empty tx by using the merge util.
Use fill_transaction to add more params to transaction object like gas limit...
Sign the cancel tx by user's private key
Recover the signer's address from the signature in signed tx
You can decode the RLP-encoded tx by the Account.decode_transaction util and if you want to make the output format pretty, use the to_pretty util
Sign the raw transaction with the fee delegator's account
Recover the fee payer's address from the signed transaction
You can decode the RLP-encoded tx by the Account.decode_transaction util and if you want to make the output format pretty, use the to_pretty util