Skip to Content
DocumentationSOLAirdrop if Required

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 to
  • airdropAmount: Lamports - Amount of lamports to airdrop if needed
  • minimumBalance: Lamports - Minimum balance threshold that triggers airdrop

See also: Get Lamport Balance, Transfer Lamports

Last updated on