3

In keeping with the official examples:

const airdropSignature = await connection.requestAirdrop(
    keypair.publicKey,
    LAMPORTS_PER_SOL
);
await connection.confirmTransaction(airdropSignature);

We get this notice: @deprecated - Instead, call confirmTransaction using a TransactionConfirmationConfig

I googled around and reviewed the specs and the code and have not been able to resolve the new correct way to use confirmTransaction.

1 Answer 1

3
const airdropSignature = await connection.requestAirdrop(
  keypair.publicKey,
  web3.LAMPORTS_PER_SOL
)

const latestBlockHash = await connection.getLatestBlockhash()

await connection.confirmTransaction({
  blockhash: latestBlockHash.blockhash,
  lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
  signature: airdropSignature,
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.