Skip to Content

AirdropStudioClient

The client is the main entry point for SDK usage. Initialize it once and reuse it for reads and transaction-building.

Initialize

import { Connection } from '@solana/web3.js' import { AirdropStudioClient } from '@bonkit/airdrop-sdk' const connection = new Connection('https://api.devnet.solana.com', 'confirmed') const client = await AirdropStudioClient.init({ connection, network: 'devnet', defaultCommitment: 'confirmed', })

Configuration

FieldTypeRequiredDescription
connectionConnectionyesSolana RPC connection used for reads and transaction building
network'devnet' | 'mainnet-beta' | 'mainnet'yesRuntime network used by the client
defaultCommitmentCommitmentnoDefault commitment used by read methods and blockhash lookup
lookupTableAddressPublicKeynoAddress Lookup Table (ALT) override used when the SDK builds versioned transactions, for advanced setups that rely on a custom ALT

Read Methods

Read methods query on-chain accounts directly. They do not require a wallet signer.

listOnchainRecipients

Reads and decodes recipients stored in list chunk accounts.

await client.listOnchainRecipients({ airdrop, // PublicKey offset, // number, optional limit, // number, optional })

Returns an array of decoded recipients within the requested range. Each item includes at least entryIndex (the recipient’s position in the on-chain list), wallet (PublicKey), and amount (allocation).

fetchClaimStatusFromLeaf

Looks up a claim status PDA derived from a merkle leaf hash.

await client.fetchClaimStatusFromLeaf({ airdrop, // PublicKey leaf, // Buffer | Uint8Array })

fetchClaimStatusFromIndex

Looks up a claim status PDA derived from an on-chain entry index.

await client.fetchClaimStatusFromIndex({ airdrop, // PublicKey entryIndex, // number })

Building Transactions

Every transaction method on the client follows the same call shape:

const tx = await client.someMethod({ params, // Instruction-specific values accounts, // Required accounts for that instruction payer, // PublicKey paying transaction fees signers, // Optional signers used to sign the returned transaction })

Each call returns a VersionedTransaction. Send it via your own RPC layer or wallet adapter.

See Transactions for the full method list.

The SDK builds transactions but does not send them. This keeps the SDK runtime-agnostic — you can use it in browsers, Node backends, or serverless functions without bundling a wallet adapter.

Next Step

Continue to Transactions for the full set of transaction builders.

Last updated on