import type { PublicClient, WalletClient } from 'viem'; import { z } from 'zod'; import type { OAuthTokenStore } from './oauth/tokenStore'; import { AntiAbuseOracleService } from './services/AntiAbuseOracle/types'; import type { AntiAbuseOracleSelectorService } from './services/AntiAbuseOracleSelector/types'; import type { ArchiverService } from './services/Archiver'; import type { AudiusWalletClient } from './services/AudiusWalletClient'; import { EmailEncryptionService } from './services/Encryption'; import type { EntityManagerService } from './services/EntityManager'; import type { EthereumService } from './services/Ethereum'; import type { LoggerService } from './services/Logger'; import type { PaymentRouterClient, SolanaRelayService, SolanaWalletAdapter } from './services/Solana'; import { ClaimableTokensClient } from './services/Solana/programs/ClaimableTokensClient'; import { RewardManagerClient } from './services/Solana/programs/RewardManagerClient'; import type { SolanaClient } from './services/Solana/programs/SolanaClient'; import type { StorageService } from './services/Storage'; import type { StorageNodeSelectorService } from './services/StorageNodeSelector'; export type ServicesContainer = { /** * Service used to choose storage node */ storageNodeSelector: StorageNodeSelectorService; /** * Service used to write and update entities on chain */ entityManager?: EntityManagerService; /** * Service used to store and retrieve content e.g. tracks and images */ storage: StorageService; /** * For interacting with the user or app's wallet for signatures or secrets. */ audiusWalletClient: AudiusWalletClient; /** * Service used to log and set a desired log level */ logger: LoggerService; /** * Service used to store OAuth access and refresh tokens. * Defaults to `TokenStoreLocalStorage` which persists to localStorage. * Override to use in-memory, cookie-based, or other storage strategies. */ tokenStore: OAuthTokenStore; /** * Called with the OAuth URL when `login()` is invoked. Defaults to * `window.open` (popup) or `window.location.href` (fullScreen) on web. * Required on mobile — use `Linking.openURL` or a WebView. */ openUrl?: (url: string) => void | Promise; /** * Service used to interact with the Solana relay */ solanaRelay: SolanaRelayService; /** * Service used to interact with the Solana wallet */ solanaWalletAdapter: SolanaWalletAdapter; /** * Service used to interact with the Solana RPCs */ solanaClient: SolanaClient; /** * Claimable Tokens Program client for Solana */ claimableTokensClient: ClaimableTokensClient; /** * Payment Router Program client for Solana */ paymentRouterClient: PaymentRouterClient; /** * Reward Manager Program client for Solana */ rewardManagerClient: RewardManagerClient; /** * Service used to choose a healthy Anti Abuse Oracle */ antiAbuseOracleSelector: AntiAbuseOracleSelectorService; /** * Service used to interact with Anti Abuse Oracle */ antiAbuseOracle: AntiAbuseOracleService; /** * Service used to handle the encryption and decryption of emails, also used for the encryption needed to share emails between users */ emailEncryptionService: EmailEncryptionService; /** * Service used to create and download track archives */ archiverService?: ArchiverService; /** * Service for interacting with Audius Ethereum contracts. * Exposes viem contract instances for all protocol contracts, * with optional per-environment address overrides. */ ethereum: EthereumService; /** * viem PublicClient for Ethereum reads. */ ethPublicClient: PublicClient; /** * viem WalletClient for Ethereum writes. */ ethWalletClient: WalletClient; }; export declare const SdkConfigSchema: z.ZodUnion<[z.ZodObject<{ /** * Your app name */ appName: z.ZodOptional; /** * Services injection */ services: z.ZodOptional, z.ZodTypeDef, Partial>>; /** * API key, required for writes */ apiKey: z.ZodString; /** * Default redirect URI used by `oauth.login()`. Can be overridden per-call. */ redirectUri: z.ZodOptional; /** * Target environment * @internal */ environment: z.ZodOptional>; /** * Override API base URL (e.g. http://localhost:1323 for local dev). When set, all API and archive requests use this base. */ apiEndpoint: z.ZodOptional; }, "strip", z.ZodTypeAny, { apiKey: string; appName?: string | undefined; services?: Partial | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }, { apiKey: string; appName?: string | undefined; services?: Partial | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }>, z.ZodObject<{ /** * Your app name */ appName: z.ZodOptional; /** * Services injection */ services: z.ZodOptional, z.ZodTypeDef, Partial>>; /** * API key */ apiKey: z.ZodString; /** * API bearer token, required for writes that use the API */ bearerToken: z.ZodString; /** * Default redirect URI used by `oauth.login()`. Can be overridden per-call. */ redirectUri: z.ZodOptional; /** * Target environment * @internal */ environment: z.ZodOptional>; apiEndpoint: z.ZodOptional; }, "strip", z.ZodTypeAny, { apiKey: string; bearerToken: string; appName?: string | undefined; services?: Partial | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }, { apiKey: string; bearerToken: string; appName?: string | undefined; services?: Partial | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }>, z.ZodObject<{ /** * Your app name */ appName: z.ZodString; /** * Services injection */ services: z.ZodOptional, z.ZodTypeDef, Partial>>; /** * Default redirect URI used by `oauth.login()`. Can be overridden per-call. */ redirectUri: z.ZodOptional; /** * Target environment * @internal */ environment: z.ZodOptional>; apiEndpoint: z.ZodOptional; }, "strip", z.ZodTypeAny, { appName: string; services?: Partial | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }, { appName: string; services?: Partial | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }>, z.ZodObject<{ /** * Your app name */ appName: z.ZodOptional; /** * Services injection */ services: z.ZodOptional, z.ZodTypeDef, Partial>>; /** * API key */ apiKey: z.ZodOptional; /** * API secret, required for writes that use Entity Manager */ apiSecret: z.ZodString; /** * Default redirect URI used by `oauth.login()`. Can be overridden per-call. */ redirectUri: z.ZodOptional; /** * Target environment * @internal */ environment: z.ZodOptional>; apiEndpoint: z.ZodOptional; }, "strip", z.ZodTypeAny, { apiSecret: string; appName?: string | undefined; services?: Partial | undefined; apiKey?: string | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }, { apiSecret: string; appName?: string | undefined; services?: Partial | undefined; apiKey?: string | undefined; redirectUri?: string | undefined; environment?: "development" | "production" | undefined; apiEndpoint?: string | undefined; }>]>; /** * Config for SDK initialization. Requires at least an app name or API key for read-only access, and API secret or bearer token for write access. */ export type SdkConfig = z.infer;