import KardiaClient from'kardia-js-sdk';constkardiaClient=newKardiaClient({ endpoint:'https://rpc.kardiachain.io'});// Sign and send a transactionconsttxPayload= { to:'RECEIVER_WALLET_ADDRESS', from:'YOUR_WALLET_ADDRESS', value:231095,// Amount of KAI to send}consttxResult=awaittransactionModule.sendTransaction( txPayload,'YOUR_WALLET_PRIVATEKEY',true,// Flag to indicate if you want to wait for the transaction to complete50000// Time (in ms) you want to wait for transaction to complete, default will be 300000 (300s));
For detail on using kardiaClient object, please refer to KardiaClient
Using Web3
Note: this is available only after Galaxias hardfork
Initialize web3 instance
import Web3 from'web3';constweb3=newWeb3('https://rpc.kardiachain.io');// Sign and send a transactionconstsignedTx=awaitweb3.eth.accounts.signTransaction({ to:'RECEIVER_WALLET_ADDRESS', from:'YOUR_WALLET_ADDRESS', value:'1000000000', gas:2000000, chainId:24// KardiaChain Mainnet chain id},'YOUR_WALLET_PRIVATEKEY')consttxHash=awaitweb3.eth.sendSignedTransaction(signedTx.rawTransaction);