Before you start
You need a Sei Testnet account that holds some SEI. Get testnet SEI from the faucet. Then put the account’s private key in thePRIVATE_KEY environment variable:
Install
await. Save each one as a .mts file, such as script.mts. Run it with npx tsx script.mts on Node.js 18 or later. In a new npm project, tsx compiles a plain .ts file as CommonJS, where top-level await does not work.
Send the transaction
Replace0xRecipientAddress with the 0x address that receives the SEI.
success and the block number as a bigint, with an n at the end. ethers and web3.py print the status as 1. A status of reverted or 0 means that the transaction was included but failed. To find the cause, see Error handling.
To see the transfer in the block explorer, open https://testnet.seiscan.io/tx/ followed by the transaction hash.
How gas is set
All three libraries set the nonce, the gas limit, and the fees for you:- Gas limit. The libraries call
eth_estimateGas. A transfer to a wallet address uses 21,000 gas. A transfer to a contract can use more, because the contract runs code when it receives SEI. - Fees. The libraries send an EIP-1559 (type 2) transaction and read the current base fee from the latest block. Sei does not burn the base fee. Validators receive the whole fee. See Gas and fees.
To send on Sei Mainnet, use the
sei chain in viem, or the https://evm-rpc.sei-apis.com endpoint in ethers and web3.py. Transfers on Sei Mainnet spend real SEI.Related recipes
- Read a balance: check the result of the transfer
- Transaction lifecycle: receipts, logs, and past transactions
- Sponsor gas with Pimlico: send from an account that holds no SEI