Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 7969

How can phantom send the total amount of sol to an account and I get "Transaction would result in an account with insufficient funds for rent"

$
0
0

My question is: when I try to send the total amount of my solana balance from one account to another programatically (JS) I get an error saying that Transaction would result in an account with insufficient funds for rent (tx example: https://solscan.io/tx/2xfuWbDFKnj2RskQHVGWAdfbNw1xsyF46yZnZtS8PAEASKtXa27PMKYb2T8NwaDgJ6GQvHtzyou4hywrnySwoTxz)But when I do the exact same thing through phantom, the transaction goes through and successfully transfers 100% of the funds to the other account.I am using the same priority fees as phantom uses but that doesn't seem to be the problem.The 2 transactions look identical, but mine doesn't go through while phantom's does.Any ideas on why this might be happening? Thanks in advance!the code Im using for creating the transaction is this:

    SystemProgram.transfer({      fromPubkey: sourceKeypair.publicKey,      toPubkey: destinationPubkey,      lamports: balance-5000,    })  );

Viewing all articles
Browse latest Browse all 7969

Trending Articles