diff --git a/web3.js/src/connection.ts b/web3.js/src/connection.ts index 19a2f3f4d8..99c1686485 100644 --- a/web3.js/src/connection.ts +++ b/web3.js/src/connection.ts @@ -3257,15 +3257,26 @@ export class Connection { } /** - * Request an allocation of lamports to the specified account + * Request an allocation of lamports to the specified address + * + * ```typescript + * import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js"; + * + * (async () => { + * const connection = new Connection("https://api.testnet.solana.com", "confirmed"); + * const myAddress = new PublicKey("2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM"); + * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL); + * await connection.confirmTransaction(signature); + * })(); + * ``` */ async requestAirdrop( to: PublicKey, - amount: number, + lamports: number, ): Promise { const unsafeRes = await this._rpcRequest('requestAirdrop', [ to.toBase58(), - amount, + lamports, ]); const res = create(unsafeRes, RequestAirdropRpcResult); if ('error' in res) {