Solard

Types

Public SDK values and return types.

Complete public type inventory

AreaExported types
ClientSolard, SolardOptions, SolardHistoryApi, SolardEventsApi
Amounts / executionHumanAmount, QuoteAsset, SenderId, SendReceipt, SimulationResult
Wallets / tokensWalletRef, WalletInfo, TokenRef, TokenRow
HoldersTokenHolder, ExcludedTokenHolder, TokenHolderSnapshot, TokenHolderSnapshotOptions
Market / replayMarketPrice, MarketHistory, MarketHistoryOptions, ReplayCoverage, ReplayEventSubscription, ReplayEventsOptions, ReplayHistory, ReplayItem, ReplayOptions, ReplayPayout, ReplayTransaction, MergedReplayEventStream, TokenEventHistoryProgress, SolardCanonicalEvent, SolardClaimEvent, SolardClaimAttribution
Creator claimsClaimCreatorRewardsOptions, CreatorRewardClaimPayout, CreatorRewardClaimResult
Cumulative distributionsCumulativeEntitlement, CumulativeDistributionInput, CumulativeDistributionExecuteOptions, CumulativeDistributionPlan, CumulativeDistributionRecipient, CumulativeDistributionState

Market subscription types

Subscription handles accept cancellation, expose closed/close(), and token-aware streams support addTokens().

ts
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

ts
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

ts
type WalletRef = string | PublicKey | Keypair | WalletRow;
type TokenRef = string | PublicKey | TokenRow;

Common refs are aliases, addresses/mints, or PublicKey objects.

WalletInfo

ts
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

ts
type MarketPrice = {
  venue: VenueId;
  mint: PublicKey;
  quoteAsset: QuoteAsset;
  priceQuotePerToken: number;
  baseReserveRaw?: bigint;
  quoteReserveRaw?: bigint;
  capturedAtMs: number;
};

TokenHolderSnapshot

ts
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[];
};
OptionTypeDefaultMeaning
commitmentconfirmed|finalized?confirmedConsistency level used for the token-program account snapshot.
excludeOwnersIterable<string|PublicKey>?—Owners removed from the eligible denominator.
minimumRawbigint?1nMinimum raw token amount required for holder eligibility.

SendReceipt and SimulationResult

ts
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

ts
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

ts
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.