Airdrop if Required
Airdrops SOL to an address if its balance is below the specified threshold.
Returns: Promise<string | null>
- Transaction signature if airdrop occurred, null if no airdrop was needed
const signature = await connection.airdropIfRequired(address, airdropAmount, minimumBalance);
Options
address
:Address
- Address to check balance and potentially airdrop toairdropAmount
:Lamports
- Amount of lamports to airdrop if neededminimumBalance
:Lamports
- Minimum balance threshold that triggers airdrop
See also: Get Lamport Balance, Transfer Lamports
Last updated on