레거시
TxTypeLegacyTransaction은 이전에 카이아에 존재했던 트랜잭션의 유형을 나타냅니다.
이러한 유형의 트랜잭션은 계정 생성, 토큰 전송, 스마트 컨트랙트 배포, 스마트 컨트랙트 실행, 또는 앞서 언급한 여러 가지를 혼합하여 수행할 수 있습니다.
Import the web3 and @kaiachain/web3js-ext packages to add kaia features on web3
Define sender, reciver address and sender private key
Set up the provider with the specified kairos testnet URL. A provider in web3js is a read-only abstraction to access the blockchain data.
Also, you can change the provider URL from kairos to quicknode
Create a KlaytnWeb3 instance using the provider
Define transaction data with from (the sender address), to (receiver address), value (amount to transfer, use toPeb to set the value in Klay then it will be converted)
The privateKeyToAccount method create account instance from sender's private key.
The signTransaction method signs transaction with sender account.
The sendSignedTransaction method send the signed transaction into blockchain.
The getTransactionReceipt method returns the receipt of transaction.
Finally, get the result.