import { BaseClient, WebacyClientConfig, RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from '@webacy-xyz/sdk-core'; import { HolderAnalysisResource, TradingLiteResource, TokensResource } from '@webacy-xyz/sdk-trading'; import { AddressesResource, ContractsResource, UrlResource, WalletsResource, LedgerResource, AccountTraceResource, TransactionsResource, UsageResource, ScanResource, BatchResource, RwaResource, VaultsResource } from '@webacy-xyz/sdk-threat'; /** * Trading namespace containing all trading-related resources */ export interface TradingNamespace { /** Holder analysis resource */ holderAnalysis: HolderAnalysisResource; /** Trading lite resource */ tradingLite: TradingLiteResource; /** Tokens resource */ tokens: TokensResource; } /** * Threat namespace containing all threat-related resources */ export interface ThreatNamespace { /** Addresses resource */ addresses: AddressesResource; /** Contracts resource */ contracts: ContractsResource; /** URL resource */ url: UrlResource; /** Wallets resource */ wallets: WalletsResource; /** Ledger resource */ ledger: LedgerResource; /** Account trace resource */ accountTrace: AccountTraceResource; /** Transactions resource - transaction risk analysis */ transactions: TransactionsResource; /** Usage resource */ usage: UsageResource; /** Scan resource */ scan: ScanResource; /** Batch resource */ batch: BatchResource; /** RWA (Real World Assets) resource - depeg risk monitoring for pegged tokens */ rwa: RwaResource; /** Vaults resource - DeFi vault risk analysis for ERC-4626 vaults */ vaults: VaultsResource; } /** * Unified Webacy SDK Client * * Provides access to all Webacy features including: * - **Trading**: Token holder analysis, sniper/bundler detection, trending tokens * - **Threat**: Address risk, sanctions, contracts, URL safety, wallet security * * This is the recommended package for most users as it provides access to * all Webacy features in a single client. * * @example * ```typescript * import { WebacyClient, Chain, RiskModule } from '@webacy-xyz/sdk'; * * const client = new WebacyClient({ * apiKey: process.env.WEBACY_API_KEY!, * }); * * // Trading: Holder analysis with sniper/bundler detection * const holders = await client.trading.holderAnalysis.get('token_address', { * chain: 'sol', * }); * * // Threat: Address risk analysis * const risk = await client.threat.addresses.analyze('0x...', { * chain: 'eth', * modules: [RiskModule.FUND_FLOW_SCREENING], * }); * * // Analyze a token from both perspectives * const [holderData, riskData] = await Promise.all([ * client.trading.holderAnalysis.get('0x...', { chain: 'eth' }), * client.threat.addresses.analyze('0x...', { chain: 'eth' }), * ]); * ``` */ export declare class WebacyClient extends BaseClient { /** * Trading namespace * * Contains all trading-related resources: * - `holderAnalysis` - Token holder distribution and sniper detection * - `tradingLite` - Simplified trading analysis (Solana) * - `tokens` - Token pools and trending data */ readonly trading: TradingNamespace; /** * Threat namespace * * Contains all threat-related resources: * - `addresses` - Address risk and sanctions screening * - `contracts` - Smart contract security analysis * - `url` - URL safety checking * - `wallets` - Wallet transaction and approval analysis * - `ledger` - Hardware wallet transaction scanning * - `accountTrace` - Fund flow tracing * - `transactions` - Transaction risk analysis * - `usage` - API usage management * - `scan` - Real-time address/URL scanning * - `batch` - Batch address analysis * - `rwa` - Real World Asset (pegged-token) depeg risk * - `vaults` - ERC-4626 DeFi vault risk analysis */ readonly threat: ThreatNamespace; /** * Create a new WebacyClient instance * * @param config - Client configuration * @throws AuthenticationError if API key is not provided * * @example * ```typescript * // Basic setup * const client = new WebacyClient({ * apiKey: 'your-api-key', * }); * * // With custom configuration * const client = new WebacyClient({ * apiKey: 'your-api-key', * timeout: 60000, * retry: { * maxRetries: 5, * initialDelay: 2000, * }, * }); * * // With custom headers * const client = new WebacyClient({ * apiKey: 'your-api-key', * headers: { * 'X-Custom-Header': 'value', * }, * }); * ``` */ constructor(config: WebacyClientConfig); /** * Add a request interceptor * * Request interceptors are called before each request is sent. * Use them to modify requests, add headers, or log requests. * * @example * ```typescript * client.addRequestInterceptor((url, config) => { * console.log(`Making request to ${url}`); * return config; * }); * ``` */ addRequestInterceptor(interceptor: RequestInterceptor): void; /** * Add a response interceptor * * Response interceptors are called after each successful response. * Use them to transform responses or log data. * * @example * ```typescript * client.addResponseInterceptor((response) => { * console.log(`Received ${response.status} response`); * return response; * }); * ``` */ addResponseInterceptor(interceptor: ResponseInterceptor): void; /** * Add an error interceptor * * Error interceptors are called when a request fails. * Use them to handle errors globally or transform error types. * * @example * ```typescript * client.addErrorInterceptor((error) => { * if (error instanceof RateLimitError) { * console.warn('Rate limited, will retry...'); * } * return error; * }); * ``` */ addErrorInterceptor(interceptor: ErrorInterceptor): void; } //# sourceMappingURL=client.d.ts.map