import { Connection, Keypair, PublicKey, Transaction, TransactionInstruction } from '@solana/web3.js'; /** * 处理Base64签名 * @param base64Signature Base64签名 * @returns {buffer: Buffer, base58: string, hex: string} */ export declare const handleBase64Signature: (base64Signature: string) => { buffer: Buffer; base58: string; hex: string; }; /** * 将数字编码为指定字节的Uint8Array * @param value 要编码的数字 * @param bytes 字节数 * @returns Uint8Array */ export declare const encodeBigInt: (value: number | bigint, bytes: number) => Uint8Array; /** * 查找关联的Token账户 * @param owner 所有者公钥 * @param mint 代币公钥 * @returns 关联的Token账户公钥 */ export declare const findAssociatedTokenAccount: (owner: PublicKey, mint: PublicKey) => Promise; /** * 模拟交易 * @param tx 交易 * @param connection 连接 * @param owner 所有者 */ export declare const simulationTx: (tx: Transaction, connection: Connection, owner: Keypair) => Promise; /** * 获取账户数据 * @param connection 连接 * @param address 账户公钥 * @returns 账户数据 */ export declare const getAccountData: (connection: Connection, address: PublicKey) => Promise | undefined>; /** * 从私钥发送交易 * @param privateKey 私钥 * @param rpcUrl RPC URL * @param instructions 交易指令 * @param enableSimulation 是否启用模拟 * @returns 交易哈希 */ export declare const sendTxFromPrivateKey: (privateKey: string, rpcUrl: string, instructions: TransactionInstruction[], enableSimulation?: boolean) => Promise; /** * 从其他账户发送交易 * @param feePayerPrivateKey 交易费支付者私钥 * @param privateKey 私钥 * @param rpcUrl RPC URL * @param instructions 交易指令 * @param enableSimulation 是否启用模拟 * @returns 交易哈希 */ export declare const sendTxFromOtherFeePayer: (feePayerPrivateKey: string, signerPrivateKey: string, rpcUrl: string, instructions: TransactionInstruction[], enableSimulation?: boolean) => Promise; /** * 批量转账SOL * @param rpcUrl RPC URL * @param fromPrivateKey 发送者私钥 * @param toPublicKeys 接收者公钥数组 * @param solAmount 转账数量 * @returns 交易哈希 */ export declare const batchTransferSol: (rpcUrl: string, fromPrivateKey: string, toPublicKeys: PublicKey[], solAmount: number | bigint) => Promise; /** * 获取SPL Token 账户信息 * @param rpcUrl RPC URL * @param mint 代币公钥 * @param publicKey 公钥 * @returns 账户信息 */ export declare const getSPLTokenAccountInfo: (rpcUrl: string, mint: PublicKey, publicKey: PublicKey) => Promise; /** * 转账SPL Token 指令 * @param rpcUrl RPC URL * @param mint 代币公钥 * @param fromPublicKey 发送者公钥 * @param toPublicKey 接收者公钥 * @param tokenAmount 转账数量 */ export declare const transferSPLTokenInstructions: (rpcUrl: string, mint: PublicKey, fromPublicKey: PublicKey, toPublicKey: PublicKey, tokenAmount: number | bigint) => Promise; /** * 批量转账SPL Token * @param rpcUrl RPC URL * @param mint 代币公钥 * @param fromPrivateKey 发送者私钥 * @param toPublicKeys 接收者公钥数组 * @param tokenAmount 转账数量 */ export declare const batchTransferSPLToken: (rpcUrl: string, mint: PublicKey, fromPrivateKey: string, toPublicKeys: PublicKey[], tokenAmount: number | bigint) => Promise; /** * 生成新的助记词 * @param strength 助记词强度 (128生成12个词, 256生成24个词) * @returns 助记词字符串 */ export declare const generateMnemonic: (strength?: 128 | 256) => string; /** * 验证助记词是否有效 * @param mnemonic 助记词 * @returns 是否有效 */ export declare const validateMnemonic: (mnemonic: string) => boolean; /** * 从助记词派生出多个密钥对 * @param mnemonic 助记词 * @param count 需要派生的密钥对数量 * @param startIndex 起始索引 * @returns Keypair数组 */ export declare const deriveKeypairsFromMnemonic: (mnemonic: string, count?: number, startIndex?: number) => { publicKey: string; secretKey: string; }[]; /** * 从助记词获取指定路径的密钥对 * @param mnemonic 助记词 * @param path 派生路径 * @returns Keypair */ export declare const deriveKeypairFromPath: (mnemonic: string, path: string) => { publicKey: string; secretKey: string; };