@fairmint/canton-node-sdk
Version:
Canton Node SDK
64 lines • 2.51 kB
TypeScript
import { ApiType, PartialProviderConfig, ClientConfig, NetworkType, ProviderType, LighthouseApiConfig } from './types';
import { AuthenticationManager } from './auth/AuthenticationManager';
import { HttpClient } from './http/HttpClient';
/** Abstract base class providing common functionality for all API clients */
export declare abstract class BaseClient {
protected config: PartialProviderConfig;
protected apiType: ApiType;
protected clientConfig: ClientConfig;
protected authManager: AuthenticationManager;
protected httpClient: HttpClient;
constructor(apiType: ApiType, config: ClientConfig);
authenticate(): Promise<string>;
makeGetRequest<T>(url: string, config?: {
contentType?: string;
includeBearerToken?: boolean;
}): Promise<T>;
makePostRequest<T>(url: string, data: unknown, config?: {
contentType?: string;
includeBearerToken?: boolean;
}): Promise<T>;
makeDeleteRequest<T>(url: string, config?: {
contentType?: string;
includeBearerToken?: boolean;
}): Promise<T>;
makePatchRequest<T>(url: string, data: unknown, config?: {
contentType?: string;
includeBearerToken?: boolean;
}): Promise<T>;
getApiUrl(): string;
getPartyId(): string;
getUserId(): string | undefined;
getManagedParties(): string[];
buildPartyList(additionalParties?: string[]): string[];
getNetwork(): NetworkType;
getProvider(): ProviderType | undefined;
getProviderName(): string;
getAuthUrl(): string;
getApiType(): ApiType;
}
/** Simplified base class for APIs that don't require authentication or provider configuration */
export declare abstract class SimpleBaseClient {
protected apiType: ApiType;
protected clientConfig: ClientConfig;
protected httpClient: HttpClient;
protected apiConfig: LighthouseApiConfig;
constructor(apiType: ApiType, config: ClientConfig);
makeGetRequest<T>(url: string, config?: {
contentType?: string;
}): Promise<T>;
makePostRequest<T>(url: string, data: unknown, config?: {
contentType?: string;
}): Promise<T>;
makeDeleteRequest<T>(url: string, config?: {
contentType?: string;
}): Promise<T>;
makePatchRequest<T>(url: string, data: unknown, config?: {
contentType?: string;
}): Promise<T>;
getApiUrl(): string;
getPartyId(): string;
getNetwork(): NetworkType;
getApiType(): ApiType;
}
//# sourceMappingURL=BaseClient.d.ts.map