UNPKG

@aryze/reforge

Version:

TypeScript SDK for Aryze Reforge cross-chain bridge protocol

104 lines 2.84 kB
/** * Simplified Reforge SDK - Only core functionality */ /** * Configuration options for the Reforge SDK */ export interface ReforgeSDKConfig { /** API key for authentication */ apiKey: string; /** API URL for the service */ apiUrl: string; /** Request timeout in milliseconds (default: 30000) */ timeout?: number; /** Enable debug logging (default: false) */ debug?: boolean; /** Include User-Agent header (default: true, set to false for AWS API Gateway issues) */ includeUserAgent?: boolean; /** Use minimal fetch options for maximum AWS compatibility (default: false) */ minimalMode?: boolean; } /** * History ID type for tracking reforge operations */ export type HistoryId = `${string}_${string}`; /** * Supported token types for reforge operations */ export type TokenType = 'erc20' | 'erc721' | 'erc1155'; /** * NFT payload structure for ERC721 and ERC1155 tokens */ export interface NFTPayload { tokenId?: number; amount?: number; tokenURI?: string; } /** * Interface for initiating a reforge operation */ export interface IReforgeInitiate { historyId?: HistoryId; chainIdHex0: string; chainIdHex1: string; token0: string; token1: string; amount0: string; amount1?: string; decimals0?: number; decimals1?: number; priceToken0InUSD: number; priceToken1InUSD?: number; tx0: string; account0: string; tx0Timestamp: number; tokenType: TokenType; payload?: NFTPayload[]; } /** * Interface for finishing a reforge operation */ export interface IReforgeFinish { historyId: HistoryId; amount1: string; decimals0?: number; decimals1?: number; priceToken1InUSD: number; tx1: string; account1?: string; tx1Timestamp: number; } /** * Response type for reforge operations */ export interface ActionResponse<T = { success: boolean; }> { data?: T; error?: string; } /** * Create AWS API Gateway compatible configuration * Automatically disables headers that commonly cause issues with AWS API Gateway */ export declare function createAWSConfig(config: Omit<ReforgeSDKConfig, 'includeUserAgent' | 'minimalMode'>): ReforgeSDKConfig; /** * Configure the SDK with API credentials */ export declare function configure(config: ReforgeSDKConfig): void; /** * Initiate a reforge operation */ export declare function initiateReforge(data: IReforgeInitiate): Promise<ActionResponse>; /** * Finish a reforge operation */ export declare function finishReforge(data: IReforgeFinish): Promise<ActionResponse>; declare const reforge: { configure: typeof configure; createAWSConfig: typeof createAWSConfig; initiateReforge: typeof initiateReforge; finishReforge: typeof finishReforge; }; export default reforge; //# sourceMappingURL=reforge.d.ts.map