Skip to Content
TypeScript SDKBurnerClient Reference

BurnerClient Reference

Complete reference for every method on the BurnerClient class.

Constructor

import { BurnerClient } from '@burnandclaim/sdk' const client = new BurnerClient(options?: BurnerClientOptions)

See SDK Overview for the full BurnerClientOptions table.


createSession

Create a short-lived session token for a browser or mobile client. Requires the client to be constructed with an apiKey.

async createSession(request: CreateSessionRequest): Promise<CreateSessionResponse>

Parameters

FieldTypeRequiredDescription
walletAddressstringYesThe Solana wallet address to bind the session to.
scopesSessionScope[]NoCapabilities the token grants. Defaults to all scopes.
ttlSecondsnumberNoToken lifetime in seconds. Default 300, max 3600.

Response

interface CreateSessionResponse { token: string // The session token expiresAt: string // ISO 8601 expiry timestamp scopes: SessionScope[] // The granted scopes }

Example

const session = await client.createSession({ walletAddress: 'DRpb...xy4Z', scopes: ['wallet:read', 'transactions:build', 'transactions:submit'], ttlSeconds: 600, }) console.log(session.token) // "eyJhbGci..." console.log(session.expiresAt) // "2026-04-09T12:10:00.000Z"

getWalletAssets

Discover everything in a wallet that the API can act on. Returns items grouped by type with their available actions.

async getWalletAssets(walletAddress: string): Promise<WalletAssets>

Parameters

FieldTypeRequiredDescription
walletAddressstringYesThe Solana wallet address to scan.

Response

interface WalletAssets { walletAddress: string items: WalletItem[] counts: Record<WalletItemType, number> } interface WalletItem { type: WalletItemType address: string name?: string symbol?: string imageUri?: string collection?: { address: string; name?: string } mint?: string // only for empty_account decimals?: number balance?: string // raw amount as string uiBalance?: number // human-readable balance usdValue?: number tokenProgram?: string tokenStandard?: string lamports?: number // rent held by the account isMetaplexResized?: boolean isFrozen?: boolean isCompressed?: boolean actions: BurnerAction[] // available actions for this item }

WalletItemType values

ValueDescription
empty_accountToken account with zero balance. Closing it reclaims ~0.002 SOL rent.
tokenSPL token with a non-zero balance.
nftStandard NFT, pNFT, or Metaplex Core asset.
fungible_assetFungible asset (SFT / fungible with metadata).
zk_compressed_tokenZK-compressed token via Light Protocol.
cnftCompressed NFT (Bubblegum).

BurnerAction values

ValueDescription
closeClose the account, reclaiming rent SOL.
burnBurn the token/NFT and close the account.
resizeResize an over-allocated Metaplex NFT account.
zk_compressCompress a token to ZK-compressed format.
zk_decompressDecompress a ZK-compressed token back to a standard account.

Example

const { items, counts } = await client.getWalletAssets(walletAddress) console.log(`Found ${items.length} items`) console.log(`Empty accounts: ${counts.empty_account}`) console.log(`Tokens: ${counts.token}`) for (const item of items) { console.log(`${item.name ?? item.address} - ${item.type} - actions: ${item.actions.join(', ')}`) }

buildTransactions

Build one unsigned VersionedTransaction per selected item. Each result includes accounting details (rebate, donation, fees) and a signed submission ticket.

async buildTransactions( walletAddress: string, request: BuildTransactionsRequest ): Promise<BuildTransactionsResponse>

Parameters

FieldTypeRequiredDescription
walletAddressstring (path)YesThe wallet address.
request.itemsItemSelection[]YesItems to include in the burn batch.
request.donationPercentagenumberNoPercentage of rebate to donate (0-1). The donation is routed to your project automatically based on your API key.
request.priorityFeeLevelstringNoTransaction priority fee level: none, low, medium, or high. Defaults to medium.

ItemSelection

interface ItemSelection { type: WalletItemType address: string // same address returned by getWalletAssets action: BurnerAction }

Response

interface BuildTransactionsResponse { transactions: BuiltTransaction[] recentBlockhash: string lastValidBlockHeight: number totals: { itemCount: number grossRebate: number // lamports before fees netRebate: number // lamports the user keeps donationAmount: number // lamports routed to donation fees: number // platform fee in lamports } } interface BuiltTransaction { transactionBase64: string // base64 unsigned VersionedTransaction includes: ItemSelection[] // which items this tx covers grossRebate: number netRebate: number donationAmount: number computeUnitsNeeded: number submissionTicket: string // pass this back on submit }

Example

const { transactions, totals } = await client.buildTransactions( walletAddress, { items: [ { type: 'empty_account', address: 'ATA111...', action: 'close' }, { type: 'token', address: 'Mint222...', action: 'burn' }, ], donationPercentage: 0.05, } ) console.log(`${totals.itemCount} items, net rebate: ${totals.netRebate / 1e9} SOL`)

submitTransactions

Submit signed transactions to the Solana cluster. Each entry pairs a wallet-signed transaction with the submission ticket from the build step.

async submitTransactions( walletAddress: string, request: SubmitTransactionsRequest ): Promise<SubmitTransactionsResponse>

Parameters

FieldTypeRequiredDescription
walletAddressstring (path)YesThe wallet address.
request.signedSignedTransaction[]YesArray of signed transactions with their tickets.

SignedTransaction

interface SignedTransaction { transactionBase64: string // base64 signed VersionedTransaction submissionTicket: string // from the build response }

Response

interface SubmitTransactionsResponse { results: SubmissionResult[] } interface SubmissionResult { signature: string | null status: 'submitted' | 'duplicate' | 'failed' includes: ItemSelection[] error?: { code: string; message: string } }

Status values

StatusMeaning
submittedTransaction sent to the cluster. signature contains the tx hash.
duplicateThis submission ticket was already used. The original signature is returned. Safe to treat as success.
failedSubmission failed. Check error for details.

Example

const { results } = await client.submitTransactions(walletAddress, { signed: signedTransactions.map((tx, i) => ({ transactionBase64: Buffer.from(tx.serialize()).toString('base64'), submissionTicket: transactions[i].submissionTicket, })), }) for (const result of results) { if (result.status === 'submitted') { console.log(`https://solscan.io/tx/${result.signature}`) } }

streamWalletAssets

Stream wallet assets over a WebSocket connection. Returns an AsyncGenerator that yields WalletAssetsChunk objects as items are discovered. Use this for large wallets where you want to render items progressively.

Requires a sessionToken with the wallet:stream scope. API keys are not accepted on the WebSocket path.

async *streamWalletAssets( walletAddress: string, options?: { chunkSize?: number } ): AsyncGenerator<WalletAssetsChunk>

See Streaming for full details.


getStats

Fetch stats for your project — total SOL reclaimed, transaction counts, unique wallets, and donation totals.

async getStats(): Promise<ProjectBurnerStats>

Response

interface ProjectBurnerStats { totalGrossRebate: number // SOL reclaimed before fees (lamports) totalNetRebate: number // SOL users kept after fees (lamports) totalTransactionCount: number // total transactions transactionTypeCounts: Record<string, number> // breakdown by type totalReferrals: number // transactions via referrals totalReferralProfitShare: number // profit share earned from referrals (lamports) totalWallets: number // unique wallets totalDonations: number // donation count totalDonationAmount: number // total donated (lamports) }

Example

const stats = await client.getStats() console.log(`${stats.totalWallets} wallets have reclaimed ${stats.totalNetRebate / 1e9} SOL`)

getLeaderboard

Fetch the wallet leaderboard with optional filters.

async getLeaderboard(filter?: LeaderboardFilter): Promise<BurnerLeaderboardEntry[]>

LeaderboardFilter

FieldTypeDescription
payerstringFilter to a specific wallet address.
transactionTypestringFilter by transaction type.
startDateDate | stringStart of date range (ISO string or Date).
endDateDate | stringEnd of date range (ISO string or Date).

Response

interface BurnerLeaderboardEntry { payer: string totalGrossRebate: number totalNetRebate: number totalTransactionCount: number transactionTypeCounts: Record<string, number> totalDonationAmount: number totalDonationCount: number totalCommunityAmount: number }

Example

const leaderboard = await client.getLeaderboard({ startDate: '2026-01-01T00:00:00Z', endDate: '2026-04-01T00:00:00Z', }) for (const entry of leaderboard) { console.log(`${entry.payer}: ${entry.totalTransactionCount} burns`) }
Last updated on