(Not token) I'm trying to move all the SOL that I receive in my SOL wallet, but I get an error: Transaction results in an account (0) with insufficient funds for rent
While I know what rent is, and that you need to have a minimum balance to be rent exempt, I have seen wallets completely drain their SOL balance (so they have 0 left) and I have looked at their instructions on solana explorer and it was nothing but a normal transfer. So what am I missing?
I'm using solana and solders on python to construct, sign & broadcast the transaction with this code:
def send_transaction(
cls,
sender,
receiver,
amount,
keypair.
*args,
**kwargs,
):
# signature fee
amount -= 5000
transaction = Transaction().add(
transfer(
TransferParams(
from_pubkey=sender_key,
to_pubkey=receiver_key,
lamports=int(amount),
)
)
)
receipt = cls.client.send_transaction(transaction, keypair)