Helius SDK - v3.0.0
    Preparing search index...

    Interface AuthClient

    interface AuthClient {
        checkSolBalance(address: string): Promise<bigint>;
        checkUsdcBalance(address: string): Promise<bigint>;
        createApiKey(
            jwt: string,
            projectId: string,
            wallet: string,
        ): Promise<ApiKey>;
        createPayment(request: CreatePaymentRequest): Promise<PaymentLink>;
        createProject(jwt: string): Promise<Project>;
        generateKeypair(): Promise<
            { publicKey: Uint8Array; secretKey: Uint8Array },
        >;
        getAddress(keypair: WalletKeypair): Promise<string>;
        getCheckoutPreview(
            jwt: string,
            plan: string,
            period: "monthly" | "yearly",
            refId: string,
            couponCode?: string,
        ): Promise<CheckoutPreviewResponse>;
        getPaymentIntent(
            jwt: string,
            paymentIntentId: string,
        ): Promise<CheckoutInitializeResponse>;
        getPaymentStatus(
            jwt: string,
            paymentIntentId: string,
        ): Promise<CheckoutStatusResponse>;
        getProject(jwt: string, id: string): Promise<ProjectDetails>;
        initializeCheckout(
            jwt: string,
            request: CheckoutInitializeRequest,
        ): Promise<CheckoutInitializeResponse>;
        listProjects(jwt: string): Promise<ProjectListItem[]>;
        loadKeypair(bytes: Uint8Array): WalletKeypair;
        payPaymentLink(
            secretKey: Uint8Array,
            paymentLink: PaymentLink,
        ): Promise<{ txSignature: string }>;
        payRenewal(jwt: string, paymentIntentId: string): Promise<PayRenewalResult>;
        payRenewalAndPay(
            secretKey: Uint8Array,
            jwt: string,
            paymentIntentId: string,
        ): Promise<UpgradePlanAndPayResult>;
        payUSDC(secretKey: Uint8Array): Promise<string>;
        payWithMemo(
            secretKey: Uint8Array,
            treasury: string,
            amount: bigint,
            memo: string,
        ): Promise<string>;
        purchaseCredits(
            options: PurchaseCreditsLinkOptions,
        ): Promise<PurchaseCreditsLinkResult>;
        purchaseCreditsAndPay(
            options: PurchaseCreditsAndPayOptions,
        ): Promise<UpgradePlanAndPayResult>;
        signAuthMessage(
            secretKey: Uint8Array,
        ): Promise<{ message: string; signature: string }>;
        signup(options: SignupOptions): Promise<SignupResult>;
        signupAndPay(options: SignupAndPayOptions): Promise<SignupAndPayResult>;
        upgradePlan(options: UpgradePlanOptions): Promise<UpgradePlanResult>;
        upgradePlanAndPay(
            options: UpgradePlanAndPayOptions,
        ): Promise<UpgradePlanAndPayResult>;
        walletSignup(
            msg: string,
            sig: string,
            address: string,
        ): Promise<SignupResponse>;
    }
    Index

    Methods

    • Parameters

      • address: string

      Returns Promise<bigint>

    • Parameters

      • address: string

      Returns Promise<bigint>

    • Parameters

      • jwt: string
      • projectId: string
      • wallet: string

      Returns Promise<ApiKey>

    • Phase 2 — shared primitive that drives every paid flow. Exposed for advanced callers; signup / upgrade / credits / renewal-link wrap it.

      Parameters

      • request: CreatePaymentRequest

      Returns Promise<PaymentLink>

    • Returns Promise<{ publicKey: Uint8Array; secretKey: Uint8Array }>

    • Parameters

      • jwt: string
      • plan: string
      • period: "monthly" | "yearly"
      • refId: string
      • OptionalcouponCode: string

      Returns Promise<CheckoutPreviewResponse>

    • Send USDC + memo for a stored PaymentLink. Wraps payWithMemo with the cents → raw conversion (USDC has 6 decimals; cents × 10_000 → raw token units) and uses paymentLink.paymentIntentId as the memo. Used by the CLI --pay resume path; does not poll.

      Parameters

      Returns Promise<{ txSignature: string }>

    • Phase 2 — wrap an existing renewal payment intent as a PaymentLink. The intent must already exist (created by the billing handler when a subscription renews). Use AuthClient.payRenewalAndPay to auto-pay from a local keypair.

      Parameters

      • jwt: string
      • paymentIntentId: string

      Returns Promise<PayRenewalResult>

    • Parameters

      • secretKey: Uint8Array

      Returns Promise<string>

    • Parameters

      • secretKey: Uint8Array
      • treasury: string
      • amount: bigint
      • memo: string

      Returns Promise<string>

    • Parameters

      • secretKey: Uint8Array

      Returns Promise<{ message: string; signature: string }>

    • Phase 1 unified signup. Authenticates the wallet, detects existing projects, and either short-circuits (already_subscribed) or returns a hosted-checkout link (payment_required). Different-plan existing projects return upgrade_required (use upgradePlan in Phase 2).

      Zero-amount checkouts (e.g. 100% coupons) are rejected up front.

      Parameters

      Returns Promise<SignupResult>