UNPKG

irys-complete-toolkit

Version:

Complete Irys SDK toolkit supporting all chains, tokens, and features

99 lines (98 loc) 2.7 kB
/** * Irys Node.js SDK Toolkit * Comprehensive SDK for server-side Irys operations */ import { NodeSDKConfig, IrysReceipt, UploadOptions, FolderUploadOptions, CreateApprovalOptions, BalanceApproval, DataInput } from '../types'; export declare class IrysNodeSDK { private uploader; private config; constructor(config: NodeSDKConfig); private validateConfig; /** * Initialize the uploader with the specified token */ initialize(): Promise<void>; /** * Get the wallet address */ get address(): string; /** * Get current token */ get token(): string; /** * Get account balance */ getBalance(): Promise<string>; /** * Fund the account */ fund(amount: string | number): Promise<any>; /** * Get upload price for data size */ getPrice(bytes: number): Promise<string>; /** * Upload data to Irys */ upload(data: DataInput, options?: UploadOptions): Promise<IrysReceipt>; /** * Upload a file */ uploadFile(filePath: string, options?: UploadOptions): Promise<IrysReceipt>; /** * Upload a folder */ uploadFolder(folderPath: string, options?: FolderUploadOptions): Promise<IrysReceipt>; /** * Create a balance approval */ createApproval(options: CreateApprovalOptions): Promise<IrysReceipt>; /** * Revoke a balance approval */ revokeApproval(approvedAddress: string): Promise<IrysReceipt>; /** * Get balance approvals */ getApprovals(payingAddresses?: string[]): Promise<BalanceApproval[]>; /** * Get created approvals */ getCreatedApprovals(approvedAddresses?: string[]): Promise<BalanceApproval[]>; /** * Create a mutable reference */ createMutableReference(data: DataInput, options?: UploadOptions): Promise<{ receipt: IrysReceipt; url: string; }>; /** * Update a mutable reference */ updateMutableReference(rootTxId: string, data: DataInput, options?: UploadOptions): Promise<IrysReceipt>; /** * Utility function to get data size */ private getDataSize; /** * Generate gateway URL for transaction */ static getGatewayUrl(txId: string): string; /** * Generate mutable reference URL */ static getMutableUrl(txId: string): string; /** * Validate transaction ID format */ static isValidTxId(txId: string): boolean; /** * Get supported tokens list */ static getSupportedTokens(): string[]; /** * Get token information */ static getTokenInfo(token: string): import("../types").SupportedToken; }