PollarPollar
SDK Reference

@pollar/core

Shared TypeScript package: authentication, wallet lifecycle, trustline orchestration, sponsorship rules, transaction preparation and Horizon queries.

PollarClient (v0.4.3)

class PollarClient {
  // Authentication
  login(provider: 'google' | 'github' | 'email' | 'freighter' | 'albedo'): Promise<void>;
  logout(): Promise<void>;
  onStateChange(callback: (state: PollarState) => void): void;

  // Stellar queries via StellarClient
  getBalance(address: string): Promise<Balance[]>;
}

Planned extensions (grant)

type FundingMode = "immediate" | "deferred" | "manual";
type AddressType = "g_account" | "c_account";

createWallet(input: {
  userId: string;
  fundingMode: FundingMode;
  assets?: string[];
  addressType?: AddressType;
}): Promise<{ walletId: string; address: string; status: string }>;

activateWallet(input: { walletId: string; assets?: string[] }): Promise<{ status: "active"; txHash: string }>;

ensureTrustlines(input: { walletId: string; assets: string[] }): Promise<void>;

preparePayment(input: { walletId: string; asset: string; amount: string; destination: string; sponsorFees?: boolean }): Promise<{ xdr: string }>;

prepareContractInvocation(input: { contractId: string; method: string; args: unknown[]; sponsorFees?: boolean }): Promise<{ xdr: string }>;

signAndSubmit(input: { walletId: string; xdr: string }): Promise<{ txHash: string }>;

StellarClient

Used internally for Horizon queries: balances, account state, etc. The public API exposes getBalance(address) from PollarClient.

Installation

npm install @pollar/core

On this page

Was this helpful?