I'm using Alchemy for an airdrop, but after completing airdrop, my confirmTransaction function is not working, which prevents below code from running
I'm using Alchemy for an airdrop, but after completing airdrop, my confirmTransaction function is not working, which prevents below code from running
Loading saved threads...
Rahul Bhati · External communityPost link
External question — Solana Stack Exchange
Author: Rahul Bhati
Original post: https://solana.stackexchange.com/questions/16170
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
try {
let signature = await connection.requestAirdrop(
new PublicKey(publicKey),
LAMPORTS_PER_SOL
);
console.log("Airdrop complete");
await connection.confirmTransaction({
signature,
});
// **code is not reaching here**
const balance = await connection.getBalance(new PublicKey(publicKey));
const balanceInSOL = balance / LAMPORTS_PER_SOL;
console.log(`Balance of wallet ${publicKey} is: ${balanceInSOL} SOL`);
} catch (error) {
console.error("An error occurred:", error);
}
Quote
Report
Effe2 · External communityPost link
External answer — Solana Stack Exchange
Author: Effe2
Original post: https://solana.stackexchange.com/a/16182
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
confirmTransaction has recently been removed from RPCs on devnet. That's why it fails on the line connection.confirmTransaction()
Quote
Report
Jon C · External communityPost link
External answer — Solana Stack Exchange
Author: Jon C
Original post: https://solana.stackexchange.com/a/16228
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
This works on my side, so perhaps you've gone over the airdrop limit for that key -- it's typically limited to 1-2 SOL per day.
Or you may be using
finalized
confirmation with your connection, which takes ~13 seconds to confirm, in which case you'll need to wait longer or change the confirmation level to
confirmed
.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Solana Stack Exchange Author: Jon C Source score (net votes, not local likes): 0 Original post: https://solana.stackexchange.com/a/16228 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. This works on my side, so perhaps you've gone over the airdrop limit for that key -- it's typically limited to 1-2 SOL per day. Or you may be using finalized confirmation with your connection, which takes ~13 seconds to confirm, in which case you'll need to wait longer or change the confirmation level to confirmed .
Checking account access…