With this code VS show a deprecated warning:
(method) Connection.confirmTransaction(strategy: string, commitment?: Commitment): Promise<RpcResponseAndContext> (+1 overload) @deprecated — Instead, call confirmTransaction using a TransactionConfirmationConfig
The signature '(strategy: string, commitment?: Commitment): Promise<RpcResponseAndContext>' of 'connection.confirmTransaction' is deprecated
const airDropSol = async () => {
try {
const connection = new Connection(clusterApiUrl("devnet"), "confirmed");
const airdropSignature = await connection.requestAirdrop(
publicKey,
2 * LAMPORTS_PER_SOL
);
await connection.confirmTransaction(airdropSignature);
} catch (error) {
console.error(error);
}
};
Could anyone make me an example with the new syntax, please?