Solard

Claims & payouts

Creator-fee claims and cumulative distributions.

Creator-fee claims

claims.creatorFees.claim

Resolve the token's registered creator-reward claim source, build the claim, submit it, and persist reconciliation/checkpoint state.

ts
claims.creatorFees.claim(
  token: TokenRef,
  wallet: WalletRef,
  options?: {
    id?: string;
    basis?: RewardEntitlementBasisInput;
    via?: SenderId;
    skipSimulation?: boolean;
    skipPreflight?: boolean;
  },
): Promise<CreatorRewardClaimResult>
  • wallet is the transaction fee payer; payout addresses come from the resolved on-chain claim plan and may differ from the fee payer.
  • id enables stable durable claim state. basis can pin an entitlement basis containing an id, slot, hash, and optional observed timestamp so downstream reward accounting can tie a claim to a specific observed basis.
  • The result includes estimatedClaimRaw, claimedRaw when known, payout splits, the SendReceipt, signature/slot, block time, observed time, and basis.

Returns: CreatorRewardClaimResult.

claims.creatorFees.status

Read remembered durable claim state by stable id.

ts
claims.creatorFees.status(id: string): DurableCreatorRewardClaimState | null
  • Durable state tracks prepared/submitted/confirmed/failed/uncertain status, pending signed transaction information, checkpoint, last error, and uncertainty reason.
ts
type CreatorRewardClaimResult = {
  version: 2;
  claimId: string | null;
  tokenMint: string;
  source: string;
  feePayer: string;
  quoteAsset: { kind: QuoteAsset["kind"]; mint: string; tokenProgram: string; decimals: number };
  estimatedClaimRaw: bigint;
  claimedRaw: bigint | null;
  payouts: Array<{ address: string; amountRaw: bigint; shareBps: number | null }>;
  receipt: SendReceipt;
  claimSignature: string;
  claimSlot: number | null;
  blockTimeMs: number | null;
  observedAtMs: number;
  basis: { id: string; slot: number; hash: string; observedAtMs: number | null } | null;
};
ts
const result = await slrd.claims.creatorFees.claim(token, feePayer, {
  id: "creator-fees:epoch-42",
  via: "rpc",
});

console.log(result.claimedRaw, result.payouts);
console.log(slrd.claims.creatorFees.status("creator-fees:epoch-42"));

Cumulative distributions

distributions.plan

Calculate outstanding cumulative payments without broadcasting transactions.

ts
distributions.plan({
  id,
  from,
  asset,
  entitlements,
  reserveRaw?,
  maxRecipientsPerTransaction?,
}: CumulativeDistributionInput): Promise<CumulativeDistributionPlan>
  • Each entitlement is cumulative, not a one-shot payment. The planner subtracts confirmedPaidRaw from entitledRaw and only returns outstanding recipients.
  • The plan reports source balance, reserve, available balance, total entitled/confirmed/outstanding amounts, next payments, and any pending transaction that still needs reconciliation.
OptionTypeDefaultMeaning
idstring—Stable distribution id used to persist/reconcile state.
fromWalletRef—Source signing wallet.
asset'SOL' | string | PublicKey—SOL or SPL token mint to distribute.
entitlementsCumulativeEntitlement[]—Recipient plus cumulative entitled raw amount.
reserveRawbigint?0nRaw balance that must remain in the source wallet.
maxRecipientsPerTransactionnumber?—Upper bound on recipients packed into one transfer transaction.

Returns: CumulativeDistributionPlan.

distributions.execute

Execute outstanding cumulative payments while persisting pending and confirmed payment state.

ts
distributions.execute({
  ...input,
  via?,
  skipSimulation?,
  skipPreflight?,
}: CumulativeDistributionExecuteOptions): Promise<CumulativeDistributionState>
  • Execution state can be ready, distributing, complete, funding-required, or uncertain.
  • Pending state stores the signed transaction, recent blockhash, last valid block height, included payments, submission attempts, and timestamps so uncertain outcomes can be reconciled instead of blindly repeated.

Returns: CumulativeDistributionState with durable recipients, receipts, pending transaction, entitlement hash, and status.

ts
type CumulativeDistributionPlan = {
  id: string;
  sourceWallet: string;
  asset: { kind: QuoteAsset["kind"]; mint: string; tokenProgram: string; decimals: number };
  totalEntitledRaw: bigint;
  totalConfirmedPaidRaw: bigint;
  totalOutstandingRaw: bigint;
  sourceBalanceRaw: bigint;
  availableRaw: bigint;
  reserveRaw: bigint;
  outstanding: Array<{
    recipient: string;
    entitledRaw: bigint;
    confirmedPaidRaw: bigint;
    outstandingRaw: bigint;
  }>;
  nextPayments: Array<{ id: string; recipient: string; amountRaw: bigint }>;
  pending: CumulativeDistributionPending | null;
};

distributions.status

Read durable distribution state without planning or executing another payment.

ts
distributions.status(id: string): CumulativeDistributionState | null

Stable IDs: reuse the same claim/distribution id to resume and reconcile the same payout.