레거시
TxTypeLegacyTransaction은 이전에 카이아에 존재했던 트랜잭션의 유형을 나타냅니다.
이러한 유형의 트랜잭션은 계정 생성, 토큰 전송, 스마트 컨트랙트 배포, 스마트 컨트랙트 실행, 또는 앞서 언급한 여러 가지를 혼합하여 수행할 수 있습니다.
Import the ethers package that can interact with the Ethereum Blockchain and its ecosystem.
Import @kaiachain/ethers-ext packages to add kaia features on ethers.js
Define sender address, sender private key and reciever address
Set up the provider with the specified kairos testnet URL. A provider in ethers is a read-only abstraction to access the blockchain data.
Also, you can change the provider URL from kairos to quicknode
Init Wallet instance with the private key and provider.
Declare a transaction with the fields such as from, to, value.
Send the tx to the blockchain. Function sendTransaction
internally signs with the private key of the account and then transmits it to the blockchain network.
The wait function returns the tx receipt if it is completed in the blockchain.