UNPKG

@fairmint/canton-node-sdk

Version:
60 lines 2.81 kB
import { type ClientConfig, type NetworkType, type ProviderType } from '../types'; export interface EnvLoaderOptions { currentNetwork?: NetworkType; currentProvider?: ProviderType; } /** Singleton class for managing environment variables and configuration */ export declare class EnvLoader { private static instance; private readonly env; private options; private constructor(); static getInstance(options?: EnvLoaderOptions): EnvLoader; static resetInstance(): void; /** * Get configuration for a specific API type from environment variables * * @param apiType The API type to get configuration for * @param options Optional network and provider to use instead of reading from env * @returns ClientConfig with only the specified API configured */ static getConfig(apiType: string, options?: { network?: NetworkType; provider?: ProviderType; }): ClientConfig; /** * Get a summary of the environment variables being used for a specific configuration This is useful for debugging * configuration issues */ static getConfigSummary(apiType: string, options?: { network?: NetworkType; provider?: ProviderType; }): { network: NetworkType; provider?: ProviderType; envVars: Record<string, string | undefined>; missingVars: string[]; }; getNodeEnv(): 'development' | 'production' | 'test'; getCurrentNetwork(): NetworkType; getCurrentProvider(): ProviderType; getApiUri(apiType: string, network?: NetworkType, provider?: ProviderType): string | undefined; getApiClientId(apiType: string, network?: NetworkType, provider?: ProviderType): string | undefined; getApiClientSecret(apiType: string, network?: NetworkType, provider?: ProviderType): string | undefined; getApiUsername(apiType: string, network?: NetworkType, provider?: ProviderType): string | undefined; getApiPassword(apiType: string, network?: NetworkType, provider?: ProviderType): string | undefined; getAuthUrl(network?: NetworkType, provider?: ProviderType): string; getPartyId(network?: NetworkType, provider?: ProviderType): string; getUserId(network?: NetworkType, provider?: ProviderType): string | undefined; getDatabaseUrl(network?: NetworkType): string; getManagedParties(network?: NetworkType, provider?: ProviderType): string[]; getAmuletRulesContractId(network?: NetworkType): string; getValidatorWalletAppInstallContractId(network?: NetworkType): string; /** * Get localnet defaults for cn-quickstart These are the standard OAuth2 credentials and URLs for cn-quickstart with * OAuth2 enabled */ private getLocalnetDefaults; private loadApiConfig; } //# sourceMappingURL=EnvLoader.d.ts.map