UNPKG

p-sdk-wallet

Version:

A comprehensive wallet SDK for React Native (pwc), supporting multi-chain and multi-account features.

43 lines (42 loc) 2.1 kB
import { ChainService } from '../chain/ChainService'; import { SolanaChainService } from '../chain/SolanaChainService'; import { Recipient, BatchResult } from '../types/multiTransfer'; /** * Handles batch processing of transfers for both native tokens and ERC-20/SPL tokens. * Processes transfers in batches to optimize gas usage and provide progress tracking. */ export declare class BatchProcessor { /** * Processes a batch of native token transfers. * @param chainService - The chain service instance (EVM or Solana) * @param recipients - Array of recipients to transfer to * @param onProgress - Optional progress callback * @returns Promise resolving to batch processing results */ static processNativeTokenBatch(chainService: ChainService | SolanaChainService, recipients: Recipient[], onProgress?: (completed: number, total: number, txHash: string) => void): Promise<BatchResult>; /** * Processes a batch of ERC-20/SPL token transfers. * @param chainService - The chain service instance (EVM or Solana) * @param tokenAddress - The token contract address * @param recipients - Array of recipients to transfer to * @param onProgress - Optional progress callback * @returns Promise resolving to batch processing results */ static processTokenBatch(chainService: ChainService | SolanaChainService, tokenAddress: string, recipients: Recipient[], onProgress?: (completed: number, total: number, txHash: string) => void): Promise<BatchResult>; /** * Splits recipients into batches of specified size. * @param recipients - Array of all recipients * @param batchSize - Size of each batch * @returns Array of recipient batches */ static splitIntoBatches(recipients: Recipient[], batchSize: number): Recipient[][]; /** * Validates recipient addresses and amounts. * @param recipients - Array of recipients to validate * @returns Validation result */ static validateRecipients(recipients: Recipient[]): { isValid: boolean; errors: string[]; }; }