UNPKG

@dima_aryze/reforge

Version:

TypeScript/JavaScript SDK for Reforge - Cross-chain token operations

101 lines 2.9 kB
/** * Main Reforge SDK class providing methods for reforge operations */ import { ReforgeClient } from './client'; import type { ActionResponse, IReforgeFinish, IReforgeInitiate, ReforgeSDKConfig, ReforgeSuccessResponse } from './types'; /** * Main Reforge SDK class providing methods for reforge operations */ export declare class ReforgeSDK { private client; private isConfigured; private readonly logger; constructor(config?: ReforgeSDKConfig); /** * Configure the SDK with API credentials */ configure(config: ReforgeSDKConfig): void; /** * Validate SDK configuration */ private validateConfig; /** * Check if SDK is properly configured */ private ensureConfigured; /** * Initiate a reforge operation * @param data - Reforge initiation data * @returns Promise resolving to action response */ initiateReforge(data: IReforgeInitiate): Promise<ActionResponse<ReforgeSuccessResponse>>; /** * Finish a reforge operation * @param data - Reforge completion data * @returns Promise resolving to action response */ finishReforge(data: IReforgeFinish): Promise<ActionResponse<ReforgeSuccessResponse>>; /** * Handle operation errors with proper error transformation */ private handleOperationError; /** * Get the underlying HTTP client for advanced usage * @returns The HTTP client instance */ getClient(): ReforgeClient; /** * Update the API key * @param apiKey - New API key */ setApiKey(apiKey: string): void; /** * Get the current API key * @returns Current API key or undefined if not set */ getApiKey(): string | undefined; /** * Check if the SDK is configured * @returns True if configured, false otherwise */ isReady(): boolean; /** * Test the connection to the API * @returns Promise resolving to connection status */ testConnection(): Promise<{ connected: boolean; latency?: number; }>; } /** * Default export object with reforge methods */ declare const reforge: { /** * Initiate a reforge operation using the default instance */ initiateReforge: (data: IReforgeInitiate) => Promise<ActionResponse<{ success: boolean; }>>; /** * Finish a reforge operation using the default instance */ finishReforge: (data: IReforgeFinish) => Promise<ActionResponse<{ success: boolean; }>>; /** * Configure the default instance */ config: (config: ReforgeSDKConfig) => void; /** * Create a new Reforge SDK instance */ create: (config: ReforgeSDKConfig) => ReforgeSDK; /** * Get access to the default SDK instance */ getInstance: () => ReforgeSDK; }; export default reforge; //# sourceMappingURL=reforge.d.ts.map