Types
Public SDK values and return types.
Complete public type inventory
| Area | Exported types |
|---|---|
| Client | Solard, SolardOptions, SolardHistoryApi, SolardEventsApi |
| Amounts / execution | HumanAmount, QuoteAsset, SenderId, SendReceipt, SimulationResult |
| Wallets / tokens | WalletRef, WalletInfo, TokenRef, TokenRow |
| Holders | TokenHolder, ExcludedTokenHolder, TokenHolderSnapshot, TokenHolderSnapshotOptions |
| Market / replay | MarketPrice, MarketHistory, MarketHistoryOptions, ReplayCoverage, ReplayEventSubscription, ReplayEventsOptions, ReplayHistory, ReplayItem, ReplayOptions, ReplayPayout, ReplayTransaction, MergedReplayEventStream, TokenEventHistoryProgress, SolardCanonicalEvent, SolardClaimEvent, SolardClaimAttribution |
| Creator claims | ClaimCreatorRewardsOptions, CreatorRewardClaimPayout, CreatorRewardClaimResult |
| Cumulative distributions | CumulativeEntitlement, CumulativeDistributionInput, CumulativeDistributionExecuteOptions, CumulativeDistributionPlan, CumulativeDistributionRecipient, CumulativeDistributionState |
Market subscription types
Subscription handles accept cancellation, expose closed/close(), and token-aware streams support addTokens().
import {
subscribeLaunches,
subscribeMigrations,
subscribeTrades,
type TradeEvent,
} from "@solard/sdk";TradeEvent raw amount fields are bigint. Launch events can expose isMayhemMode; launch/migration/trade events expose the mint used by the promotion flow.
Use the installed TypeScript declarations for exhaustive event fields.
Amounts and quote assets
type QuoteAsset =
| { kind: "native-sol"; mint: PublicKey; tokenProgram: PublicKey; decimals: 9 }
| { kind: "spl-token"; mint: PublicKey; tokenProgram: PublicKey; decimals: number };
type RawAmount = { raw: bigint; asset: QuoteAsset };
type HumanAmount = { sol: string | number } | RawAmount;
sol(value: string | number): RawAmount;
tokenAmount(value: string | number, mint: PublicKey, decimals: number, tokenProgram?): RawAmount;
formatRaw(raw: bigint, decimals: number): string;sol() converts SOL to lamports. tokenAmount() converts UI token amounts to raw units. Excess precision is rejected.
WalletRef and TokenRef
type WalletRef = string | PublicKey | Keypair | WalletRow;
type TokenRef = string | PublicKey | TokenRow;Common refs are aliases, addresses/mints, or PublicKey objects.
WalletInfo
type WalletInfo = {
id: number;
name: string;
address: string;
isActive: number;
createdAtMs: number;
updatedAtMs: number;
};WalletInfo is a public projection. It intentionally contains no secret-key or encrypted-secret fields.
MarketPrice
type MarketPrice = {
venue: VenueId;
mint: PublicKey;
quoteAsset: QuoteAsset;
priceQuotePerToken: number;
baseReserveRaw?: bigint;
quoteReserveRaw?: bigint;
capturedAtMs: number;
};TokenHolderSnapshot
type TokenHolderSnapshot = {
version: 1;
mint: string;
tokenProgram: string;
decimals: number;
supplyRaw: bigint;
slot: number;
observedAtMs: number;
tokenAccounts: number;
holderCount: number;
eligibleHolderCount: number;
totalHeldRaw: bigint;
eligibleTotalRaw: bigint;
excludedTotalRaw: bigint;
holders: TokenHolder[];
excluded: ExcludedTokenHolder[];
};| Option | Type | Default | Meaning |
|---|---|---|---|
commitment | confirmed|finalized? | confirmed | Consistency level used for the token-program account snapshot. |
excludeOwners | Iterable<string|PublicKey>? | — | Owners removed from the eligible denominator. |
minimumRaw | bigint? | 1n | Minimum raw token amount required for holder eligibility. |
SendReceipt and SimulationResult
type SendReceipt = {
signature: string;
slot: number | null;
sender: string;
status: "submitted" | "confirmed" | "failed";
feeLamports?: number;
computeUnitsConsumed?: number;
error?: string;
};
type SimulationResult = {
success: boolean;
logs: string[];
cuUsed: number | null;
error: unknown | null;
accountChanges: Array<...>;
tokenChanges: Array<...>;
solChanges: Array<...>;
};Receipts may include actual fee/CU data. Simulations include expected account, token, and SOL deltas.
Replay types
type ReplayCoverage = {
version: 1;
mint: string;
fromCreation: boolean;
throughSlot: number;
complete: boolean;
warnings: string[];
updatedAtMs: number;
};
type ReplayTransaction = "mint" | "burn" | "transfer" | "change_owner" | "claim";Coverage must be checked before treating replay output as authoritative accounting history.
Distribution state
type CumulativeDistributionState = {
version: 1;
id: string;
sourceWallet: string;
asset: { kind: QuoteAsset["kind"]; mint: string; tokenProgram: string; decimals: number };
status: "ready" | "distributing" | "complete" | "funding-required" | "uncertain";
recipients: CumulativeDistributionRecipient[];
entitlementHash: string;
pending: CumulativeDistributionPending | null;
receipts: Array<...>;
reserveRaw: string;
lastError: string | null;
uncertainReason: string | null;
createdAtMs: number;
updatedAtMs: number;
};State includes pending and confirmed payment data so distributions can resume safely.