/** * VeChain Clause Builder Utility * * VeChain supports multi-clause transactions, allowing multiple operations * in a single transaction. This is powerful for: * - Batch transfers to multiple addresses * - Multiple contract calls in one transaction * - Atomic operations across contracts * - Gas efficiency (shared base cost) * * Each clause contains: * - to: recipient address * - value: VET amount in wei * - data: encoded data for contract calls */ import { ethers } from 'ethers'; /** * Clause structure */ export interface Clause { to: string | null; value: string; data: string; } /** * Clause with metadata for tracking */ export interface ClauseWithMeta extends Clause { comment?: string; gasEstimate?: number; } /** * Clause builder class */ export declare class ClauseBuilder { private clauses; /** * Add a VET transfer clause */ addVetTransfer(to: string, amount: string, comment?: string): this; /** * Add a VIP-180 token transfer clause */ addTokenTransfer(tokenAddress: string, to: string, amount: string, comment?: string): this; /** * Add a VIP-180 token approval clause */ addTokenApproval(tokenAddress: string, spender: string, amount: string, comment?: string): this; /** * Add a VIP-181 NFT transfer clause */ addNftTransfer(nftAddress: string, from: string, to: string, tokenId: string, comment?: string): this; /** * Add a VIP-181 NFT safe transfer clause */ addNftSafeTransfer(nftAddress: string, from: string, to: string, tokenId: string, comment?: string): this; /** * Add a contract call clause */ addContractCall(contractAddress: string, abi: ethers.InterfaceAbi, functionName: string, args: unknown[], value?: string, comment?: string): this; /** * Add a raw clause with custom data */ addRawClause(to: string | null, value: string, data: string, comment?: string, gasEstimate?: number): this; /** * Add a contract deployment clause */ addContractDeploy(bytecode: string, constructorArgs?: string, value?: string, comment?: string): this; /** * Get all clauses */ getClauses(): Clause[]; /** * Get clauses with metadata */ getClausesWithMeta(): ClauseWithMeta[]; /** * Get total estimated gas */ getTotalGasEstimate(): number; /** * Get clause count */ getClauseCount(): number; /** * Clear all clauses */ clear(): this; /** * Remove clause at index */ removeClause(index: number): this; /** * Validate clauses */ validate(): { valid: boolean; errors: string[]; }; } /** * Create a simple VET transfer clause */ export declare function createVetTransferClause(to: string, amount: string): Clause; /** * Create a token transfer clause */ export declare function createTokenTransferClause(tokenAddress: string, to: string, amount: string): Clause; /** * Create a contract call clause */ export declare function createContractCallClause(contractAddress: string, abi: ethers.InterfaceAbi, functionName: string, args: unknown[], value?: string): Clause; /** * Batch VET transfers helper */ export declare function createBatchVetTransfers(transfers: { to: string; amount: string; }[]): Clause[]; /** * Batch token transfers helper */ export declare function createBatchTokenTransfers(tokenAddress: string, transfers: { to: string; amount: string; }[]): Clause[]; //# sourceMappingURL=clauseBuilder.d.ts.map