import type { Address } from "@aboutcircles/sdk-types"; import type { ReferralInfo, ReferralList, ReferralPreviewList, StoreBatchResult } from "./types.js"; /** * Referrals service client for storing and retrieving referral links * * The referrals backend enables Circles SDK users to invite others via referral links. * - Store: Save a referral private key with on-chain validation * - Retrieve: Get referral info by private key (public) * - List: Get all referrals created by authenticated user */ export declare class Referrals { private readonly baseUrl; private readonly getToken?; private readonly referralsModule; constructor(baseUrl: string, referralsModuleAddress: Address, rpcUrl: string, getToken?: (() => Promise) | undefined); private getBaseUrl; private getAuthHeaders; /** * Store a referral private key * * The private key is validated on-chain via ReferralsModule.accounts() to ensure * the account exists and has not been claimed. The inviter address is self-declared * for dashboard visibility only - the on-chain indexer captures the true inviter. */ store(privateKey: string, inviter: string): Promise; /** * Store multiple referral private keys in a single request (max 200) * * Processing is independent — one failure doesn't block others. */ storeBatch(invitations: Array<{ privateKey: string; inviter: string; }>): Promise; /** * Retrieve referral info by private key (public endpoint, no auth required) * * Performs an on-chain check via ReferralsModule.accounts(signer): * - If account is 0x0 → key not found on-chain (404) * - If claimed on-chain → 410 * - Otherwise returns the active ReferralInfo (200) */ retrieve(privateKey: string): Promise; /** * List all referrals created by the authenticated user * * Requires authentication - the user's address is extracted from the JWT token. */ listMine(opts?: { limit?: number; offset?: number; inSession?: boolean; status?: string; }): Promise; /** * List referrals for a given address (public, no auth required) * * Returns masked key previews — full keys are never exposed here. */ listPublic(address: string, opts?: { limit?: number; offset?: number; inSession?: boolean; }): Promise; } //# sourceMappingURL=Referrals.d.ts.map