Write with TxType
Import extend from web3py_ext to extend web3 to kaia web3
Import necessary utils from web3 and eth_account
Create a Web3 instance with the kaia Baobab testnet endpoint
Also, you can change the provider URL from baobab to allthatnode
Load an account from private key
Create a contract instance with its address and ABI
Set the contract address that you deployed in the deploy tutorial (Counter contract). You can see the address in your deploy tx receipt
Set the contract abi. You can get the ABI after compiled in remix or solc compiler
Call the view function of the contract and print the result before it is updated
Make a tx with build_transaction that returns the tx instance along with the additional fields passed as parameter
You should pass TxType.SMART_CONTRACT_EXECUTION type to make a kaia tx contract execution type
Use fill_transaction util 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 tx with the user's private key
Send the tx to the blockchain. It will return the tx hash
Wait the tx receipt from the blockchain and print after received the tx receipt
Call the view function again to see what number the counter have after the tx