Write with TxType
Import the web3 and @kaiachain/web3js-ext packages to add kaia features on web3
Define sender's address and private key
Set up the provider with the specified kaia Baobab testnet URL. A provider in web3 is a read-only abstraction to access the blockchain data.
Also, you can change the provider URL from baobab to allthatnode
Create a sender's account using web3.eth.accounts.privateKeyToAccount
Define contract Abi and address to interact with
Create a contract instance using Web3.eth.Contract
with defined contractAbi and address. You can read and write the contract through this instance
Get the number before update
Encoded the contract method data with contract.methods.increment().encodeABI()
Create a transaction to update the value number with type: FeeDelegatedSmartContractExecution
Sign the transaction with sender account
Send the transaction to network and wait for the receipt
Get the number after update