@agentdao/core
Version:
Core functionality, skills, and ready-made UI components for AgentDAO - Web3 subscriptions, content generation, social media, help support, live chat, RSS fetching, web search, and agent pricing integration
54 lines (53 loc) • 1.5 kB
TypeScript
import { ethers } from 'ethers';
export interface FundAgentConfig {
chainId: number;
network: string;
rpcUrl: string;
tokenAddress: string;
tokenSymbol: string;
tokenDecimals: number;
safeFactoryAddress?: string;
minDeposit: number;
agentAddress: string;
provider?: ethers.Provider;
database?: {
endpoint: string;
apiKey?: string;
};
rateLimit?: {
maxRequestsPerMinute: number;
retryAttempts: number;
retryDelayMs: number;
};
}
export declare class FundAgent {
private config;
private provider;
private requestCount;
private lastRequestTime;
constructor(config: FundAgentConfig);
/**
* Rate limiting helper
*/
private checkRateLimit;
/**
* Retry wrapper for blockchain calls
*/
private withRetry;
/**
* Determine if an error should not be retried
*/
private shouldNotRetry;
verifyPayment(walletAddress: string): Promise<boolean>;
private checkRecentTransfer;
getTokenBalance(walletAddress: string): Promise<number>;
getADaoBalance(walletAddress: string): Promise<number>;
createSafeWallet(walletAddress: string, depositAmount: number): Promise<string>;
addOwner(safeAddress: string, newOwner: string): Promise<void>;
getWalletStatus(safeAddress: string): Promise<any>;
/**
* Check if an address is a test address
*/
private isTestAddress;
private createSafeWalletInDatabase;
}