UNPKG

@venly/wallet-mcp

Version:

Production-ready MCP server enabling AI agents to perform Web3 wallet operations through Venly's blockchain infrastructure. Supports 14+ networks including Ethereum, Polygon, Arbitrum, and stablecoin operations.

1,504 lines (1,503 loc) 73.2 kB
/** * Venly API Type Definitions * * Comprehensive TypeScript types for Venly Wallet-as-a-Service API * Based on Venly API v4.0 specification */ import { z } from 'zod'; export interface VenlyAuthConfig { clientId: string; clientSecret: string; environment: 'sandbox' | 'production'; baseUrl?: string; authUrl?: string; } export interface UserVenlyCredentials { clientId: string; clientSecret: string; } export interface VenlyAuthToken { access_token: string; token_type: string; expires_in: number; refresh_token?: string; scope?: string; issued_at: number; } export type SecretType = 'ETHEREUM' | 'MATIC' | 'BSC' | 'ARBITRUM' | 'AVAX' | 'BITCOIN' | 'LITECOIN' | 'OPTIMISM' | 'BASE' | 'GOERLI' | 'MUMBAI' | 'BSC_TESTNET' | 'ARBITRUM_GOERLI' | 'FUJI'; export type WalletType = 'WHITE_LABEL' | 'APPLICATION' | 'IMPORTED'; export type TransactionType = 'TRANSFER' | 'TOKEN_TRANSFER' | 'CONTRACT_EXECUTION' | 'NFT_TRANSFER' | 'MULTI_TOKEN_TRANSFER'; export interface WalletBalance { available: boolean; secretType: SecretType; balance: number; gasBalance: number; symbol: string; gasSymbol: string; rawBalance: string; rawGasBalance: string; decimals: number; } export interface TokenBalance { tokenAddress: string; rawBalance: string; balance: number; decimals: number; symbol: string; logo?: string; type: string; transferable: boolean; } export interface EnrichedTokenBalance extends TokenBalance { thumbnail?: string | undefined; portfolioPercentage?: number | undefined; usdPrice?: number | undefined; usdBalanceValue?: number | undefined; categories?: string[] | undefined; name?: string | undefined; description?: string | undefined; website?: string | undefined; coinGeckoId?: string | undefined; marketCap?: number | undefined; volume24h?: number | undefined; priceChange24h?: number | undefined; priceChangePercentage24h?: number | undefined; lastUpdated?: string | undefined; } export interface TokenPortfolioSummary { totalUsdValue: number; tokenCount: number; topTokensByValue: EnrichedTokenBalance[]; categoryBreakdown: { category: string; usdValue: number; percentage: number; tokenCount: number; }[]; priceChange24h: { totalChange: number; totalChangePercentage: number; gainers: number; losers: number; }; } export interface Wallet { id: string; address: string; secretType: SecretType; walletType: WalletType; identifier?: string; description?: string; primary: boolean; hasCustomPin: boolean; balance: WalletBalance; createdAt?: string; archived?: boolean; } export interface CreateWalletRequest { secretType: SecretType; walletType: WalletType; identifier?: string | undefined; description?: string | undefined; pincode?: string | undefined; } export interface TransactionRequest { type: TransactionType; walletId: string; to: string; secretType: SecretType; value?: number; tokenAddress?: string; data?: string; gasLimit?: number; gasPrice?: number; nonce?: number; } export interface ExecuteTransactionRequest { transactionRequest: TransactionRequest; pincode?: string | undefined; } export interface TransactionResult { transactionHash: string; status: 'PENDING' | 'SUCCEEDED' | 'FAILED'; confirmations?: number; gasUsed?: number; gasPrice?: number; blockNumber?: number; blockHash?: string; timestamp?: string; } export interface Transaction { id: string; hash: string; status: 'PENDING' | 'SUCCEEDED' | 'FAILED'; confirmations: number; blockNumber?: number; blockHash?: string; from: string; to: string; value: string; gasLimit: string; gasPrice: string; gasUsed?: string; nonce: number; data?: string; timestamp: string; secretType: SecretType; } export interface SendTransactionRequest { walletId: string; to: string; value: number; secretType: SecretType; pincode?: string; } export interface SendTokenRequest { walletId: string; to: string; tokenAddress: string; value: number; secretType: SecretType; pincode?: string; } export interface GetTransactionRequest { transactionHash: string; secretType: SecretType; } export interface TransactionResponse { transactionHash: string; status: 'PENDING' | 'SUCCEEDED' | 'FAILED'; from?: string; to?: string; value?: number; gasPrice?: number; gasUsed?: number; blockNumber?: number; confirmations?: number; timestamp?: string; } export interface VenlyTransactionExecuteRequest { type: 'TRANSFER' | 'TOKEN_TRANSFER'; walletId: string; to: string; secretType: string; value?: number; tokenAddress?: string; pincode?: string; } export interface VenlyApiResponse<T> { success: boolean; result?: T; errorCode?: string; message?: string; } export interface VenlyError { success: false; errorCode: string; message: string; details?: Record<string, unknown>; } export declare const SecretTypeSchema: z.ZodEnum<["ETHEREUM", "MATIC", "BSC", "ARBITRUM", "AVAX", "BITCOIN", "LITECOIN", "OPTIMISM", "BASE", "GOERLI", "MUMBAI", "BSC_TESTNET", "ARBITRUM_GOERLI", "FUJI"]>; export declare const WalletTypeSchema: z.ZodEnum<["WHITE_LABEL", "APPLICATION", "IMPORTED"]>; export declare const CreateWalletRequestSchema: z.ZodObject<{ secretType: z.ZodEnum<["ETHEREUM", "MATIC", "BSC", "ARBITRUM", "AVAX", "BITCOIN", "LITECOIN", "OPTIMISM", "BASE", "GOERLI", "MUMBAI", "BSC_TESTNET", "ARBITRUM_GOERLI", "FUJI"]>; walletType: z.ZodEnum<["WHITE_LABEL", "APPLICATION", "IMPORTED"]>; identifier: z.ZodOptional<z.ZodString>; description: z.ZodOptional<z.ZodString>; pincode: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; walletType: "WHITE_LABEL" | "APPLICATION" | "IMPORTED"; identifier?: string | undefined; description?: string | undefined; pincode?: string | undefined; }, { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; walletType: "WHITE_LABEL" | "APPLICATION" | "IMPORTED"; identifier?: string | undefined; description?: string | undefined; pincode?: string | undefined; }>; export declare const TransactionRequestSchema: z.ZodObject<{ type: z.ZodEnum<["TRANSFER", "TOKEN_TRANSFER", "CONTRACT_EXECUTION", "NFT_TRANSFER", "MULTI_TOKEN_TRANSFER"]>; walletId: z.ZodString; to: z.ZodString; secretType: z.ZodEnum<["ETHEREUM", "MATIC", "BSC", "ARBITRUM", "AVAX", "BITCOIN", "LITECOIN", "OPTIMISM", "BASE", "GOERLI", "MUMBAI", "BSC_TESTNET", "ARBITRUM_GOERLI", "FUJI"]>; value: z.ZodOptional<z.ZodNumber>; tokenAddress: z.ZodOptional<z.ZodString>; data: z.ZodOptional<z.ZodString>; gasLimit: z.ZodOptional<z.ZodNumber>; gasPrice: z.ZodOptional<z.ZodNumber>; nonce: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; type: "TRANSFER" | "TOKEN_TRANSFER" | "CONTRACT_EXECUTION" | "NFT_TRANSFER" | "MULTI_TOKEN_TRANSFER"; walletId: string; to: string; value?: number | undefined; tokenAddress?: string | undefined; data?: string | undefined; gasLimit?: number | undefined; gasPrice?: number | undefined; nonce?: number | undefined; }, { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; type: "TRANSFER" | "TOKEN_TRANSFER" | "CONTRACT_EXECUTION" | "NFT_TRANSFER" | "MULTI_TOKEN_TRANSFER"; walletId: string; to: string; value?: number | undefined; tokenAddress?: string | undefined; data?: string | undefined; gasLimit?: number | undefined; gasPrice?: number | undefined; nonce?: number | undefined; }>; export declare const ExecuteTransactionRequestSchema: z.ZodObject<{ transactionRequest: z.ZodObject<{ type: z.ZodEnum<["TRANSFER", "TOKEN_TRANSFER", "CONTRACT_EXECUTION", "NFT_TRANSFER", "MULTI_TOKEN_TRANSFER"]>; walletId: z.ZodString; to: z.ZodString; secretType: z.ZodEnum<["ETHEREUM", "MATIC", "BSC", "ARBITRUM", "AVAX", "BITCOIN", "LITECOIN", "OPTIMISM", "BASE", "GOERLI", "MUMBAI", "BSC_TESTNET", "ARBITRUM_GOERLI", "FUJI"]>; value: z.ZodOptional<z.ZodNumber>; tokenAddress: z.ZodOptional<z.ZodString>; data: z.ZodOptional<z.ZodString>; gasLimit: z.ZodOptional<z.ZodNumber>; gasPrice: z.ZodOptional<z.ZodNumber>; nonce: z.ZodOptional<z.ZodNumber>; }, "strip", z.ZodTypeAny, { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; type: "TRANSFER" | "TOKEN_TRANSFER" | "CONTRACT_EXECUTION" | "NFT_TRANSFER" | "MULTI_TOKEN_TRANSFER"; walletId: string; to: string; value?: number | undefined; tokenAddress?: string | undefined; data?: string | undefined; gasLimit?: number | undefined; gasPrice?: number | undefined; nonce?: number | undefined; }, { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; type: "TRANSFER" | "TOKEN_TRANSFER" | "CONTRACT_EXECUTION" | "NFT_TRANSFER" | "MULTI_TOKEN_TRANSFER"; walletId: string; to: string; value?: number | undefined; tokenAddress?: string | undefined; data?: string | undefined; gasLimit?: number | undefined; gasPrice?: number | undefined; nonce?: number | undefined; }>; pincode: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { transactionRequest: { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; type: "TRANSFER" | "TOKEN_TRANSFER" | "CONTRACT_EXECUTION" | "NFT_TRANSFER" | "MULTI_TOKEN_TRANSFER"; walletId: string; to: string; value?: number | undefined; tokenAddress?: string | undefined; data?: string | undefined; gasLimit?: number | undefined; gasPrice?: number | undefined; nonce?: number | undefined; }; pincode?: string | undefined; }, { transactionRequest: { secretType: "ETHEREUM" | "MATIC" | "BSC" | "ARBITRUM" | "AVAX" | "BITCOIN" | "LITECOIN" | "OPTIMISM" | "BASE" | "GOERLI" | "MUMBAI" | "BSC_TESTNET" | "ARBITRUM_GOERLI" | "FUJI"; type: "TRANSFER" | "TOKEN_TRANSFER" | "CONTRACT_EXECUTION" | "NFT_TRANSFER" | "MULTI_TOKEN_TRANSFER"; walletId: string; to: string; value?: number | undefined; tokenAddress?: string | undefined; data?: string | undefined; gasLimit?: number | undefined; gasPrice?: number | undefined; nonce?: number | undefined; }; pincode?: string | undefined; }>; export declare const FiatProviderSchema: z.ZodEnum<["TRANSAK", "MOONPAY", "RAMP_NETWORK"]>; export declare const FiatOnrampRequestSchema: z.ZodObject<{ walletId: z.ZodString; fiatAmount: z.ZodOptional<z.ZodNumber>; fiatCurrency: z.ZodOptional<z.ZodString>; cryptoAmount: z.ZodOptional<z.ZodNumber>; cryptoCurrency: z.ZodOptional<z.ZodString>; cryptoNetwork: z.ZodOptional<z.ZodString>; provider: z.ZodEnum<["TRANSAK", "MOONPAY", "RAMP_NETWORK"]>; returnUrl: z.ZodOptional<z.ZodString>; webhookUrl: z.ZodOptional<z.ZodString>; email: z.ZodOptional<z.ZodString>; selectedCountryCode: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { walletId: string; provider: "TRANSAK" | "MOONPAY" | "RAMP_NETWORK"; fiatAmount?: number | undefined; fiatCurrency?: string | undefined; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; cryptoNetwork?: string | undefined; returnUrl?: string | undefined; webhookUrl?: string | undefined; email?: string | undefined; selectedCountryCode?: string | undefined; }, { walletId: string; provider: "TRANSAK" | "MOONPAY" | "RAMP_NETWORK"; fiatAmount?: number | undefined; fiatCurrency?: string | undefined; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; cryptoNetwork?: string | undefined; returnUrl?: string | undefined; webhookUrl?: string | undefined; email?: string | undefined; selectedCountryCode?: string | undefined; }>; export declare const FiatOfframpRequestSchema: z.ZodObject<{ walletId: z.ZodString; cryptoAmount: z.ZodOptional<z.ZodNumber>; cryptoCurrency: z.ZodOptional<z.ZodString>; cryptoNetwork: z.ZodOptional<z.ZodString>; fiatCurrency: z.ZodOptional<z.ZodString>; fiatAmount: z.ZodOptional<z.ZodNumber>; provider: z.ZodEnum<["TRANSAK", "MOONPAY", "RAMP_NETWORK"]>; returnUrl: z.ZodOptional<z.ZodString>; email: z.ZodOptional<z.ZodString>; refundWalletAddress: z.ZodOptional<z.ZodString>; selectedCountryCode: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { walletId: string; provider: "TRANSAK" | "MOONPAY" | "RAMP_NETWORK"; fiatAmount?: number | undefined; fiatCurrency?: string | undefined; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; cryptoNetwork?: string | undefined; returnUrl?: string | undefined; email?: string | undefined; selectedCountryCode?: string | undefined; refundWalletAddress?: string | undefined; }, { walletId: string; provider: "TRANSAK" | "MOONPAY" | "RAMP_NETWORK"; fiatAmount?: number | undefined; fiatCurrency?: string | undefined; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; cryptoNetwork?: string | undefined; returnUrl?: string | undefined; email?: string | undefined; selectedCountryCode?: string | undefined; refundWalletAddress?: string | undefined; }>; export type FiatProvider = 'TRANSAK' | 'MOONPAY' | 'RAMP_NETWORK'; export interface FiatOnrampRequest { walletId: string; fiatAmount?: number | undefined; fiatCurrency?: string | undefined; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; cryptoNetwork?: string | undefined; provider: FiatProvider; returnUrl?: string | undefined; webhookUrl?: string | undefined; email?: string | undefined; selectedCountryCode?: string | undefined; } export interface FiatOfframpRequest { walletId: string; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; cryptoNetwork?: string | undefined; fiatCurrency?: string | undefined; fiatAmount?: number | undefined; provider: FiatProvider; returnUrl?: string | undefined; email?: string | undefined; refundWalletAddress?: string | undefined; selectedCountryCode?: string | undefined; } export interface ExchangeRate { fromCurrency: string; toCurrency: string; rate: number; timestamp: Date; provider: string; fees?: { networkFee?: number | undefined; processingFee?: number | undefined; totalFee: number; } | undefined; } export interface FiatTransactionStatus { transactionId: string; status: 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED' | 'CANCELLED'; provider: FiatProvider; type: 'ONRAMP' | 'OFFRAMP'; fiatAmount?: number | undefined; fiatCurrency?: string | undefined; cryptoAmount?: number | undefined; cryptoCurrency?: string | undefined; createdAt: string; updatedAt: string; failureReason?: string | undefined; } export interface FiatRampResponse { url: string; } export interface PaginationParams { page?: number | undefined; size?: number | undefined; } export interface PaginatedResponse<T> { content: T[]; totalElements: number; totalPages: number; size: number; number: number; first: boolean; last: boolean; } export interface RateLimitInfo { limit: number; remaining: number; reset: number; retryAfter?: number; } export declare enum WebhookEventType { CONTRACT_CREATION_SUCCEEDED = "CONTRACT_CREATION_SUCCEEDED", CONTRACT_CREATION_FAILED = "CONTRACT_CREATION_FAILED", TOKEN_TYPE_CREATION_SUCCEEDED = "TOKEN_TYPE_CREATION_SUCCEEDED", TOKEN_TYPE_CREATION_FAILED = "TOKEN_TYPE_CREATION_FAILED", TOKEN_CREATION_SUCCEEDED = "TOKEN_CREATION_SUCCEEDED", TOKEN_CREATION_FAILED = "TOKEN_CREATION_FAILED", TRANSACTION_CONFIRMED = "TRANSACTION_CONFIRMED", TRANSACTION_FAILED = "TRANSACTION_FAILED", TRANSACTION_PENDING = "TRANSACTION_PENDING", TRANSACTION_DROPPED = "TRANSACTION_DROPPED", BALANCE_CHANGED = "BALANCE_CHANGED", PORTFOLIO_VALUE_CHANGED = "PORTFOLIO_VALUE_CHANGED", TOKEN_RECEIVED = "TOKEN_RECEIVED", TOKEN_SENT = "TOKEN_SENT" } export interface SetupTransactionWebhookRequest { walletId?: string; secretType?: string; webhookUrl: string; events: TransactionWebhookEvent[]; description?: string; authType?: 'NONE' | 'API_KEY' | 'BASIC_AUTH'; authValue?: string; } export interface SetupBalanceWebhookRequest { walletId?: string; secretType?: string; webhookUrl: string; thresholds?: { minBalanceChange?: number; percentageChange?: number; }; description?: string; authType?: 'NONE' | 'API_KEY' | 'BASIC_AUTH'; authValue?: string; } export interface SetupPortfolioWebhookRequest { walletId?: string; webhookUrl: string; thresholds?: { minValueChange?: number; percentageChange?: number; }; description?: string; authType?: 'NONE' | 'API_KEY' | 'BASIC_AUTH'; authValue?: string; } export interface ProcessWebhookEventRequest { eventPayload: any; eventType?: string; validateSignature?: boolean; } export interface GetWebhookStatusRequest { webhookId?: string; webhookUrl?: string; } export interface WebhookConfigurationResponse { webhookId: string; webhookUrl: string; events: string[]; status: 'ACTIVE' | 'INACTIVE' | 'FAILED'; description?: string; createdAt: string; lastDelivery?: string; deliveryStats?: { totalAttempts: number; successfulDeliveries: number; failedDeliveries: number; lastFailureReason?: string; }; } export interface ProcessWebhookEventResponse { eventId: string; eventType: string; processed: boolean; data: { transactionHash?: string; walletId?: string; balanceChange?: number; portfolioChange?: number; timestamp: string; }; actions?: string[]; } export interface WebhookStatusResponse { webhookId: string; status: 'HEALTHY' | 'DEGRADED' | 'FAILED'; lastCheck: string; uptime: number; recentDeliveries: { timestamp: string; status: 'SUCCESS' | 'FAILED'; responseTime?: number; error?: string; }[]; configuration: { url: string; events: string[]; authType: string; }; } export type TransactionWebhookEvent = 'TRANSACTION_PENDING' | 'TRANSACTION_CONFIRMED' | 'TRANSACTION_FAILED' | 'TRANSACTION_DROPPED'; export interface WebhookConfig { id: string; walletId: string; eventTypes: WebhookEventType[]; callbackUrl: string; secretKey: string; isActive: boolean; filters?: WebhookFilters | undefined; description?: string | undefined; createdAt: string; updatedAt: string; } export interface WebhookFilters { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; } export interface WebhookEvent { eventId: string; eventType: WebhookEventType; timestamp: Date; walletId: string; data: TransactionEvent | BalanceEvent | PortfolioEvent | ContractEvent | TokenEvent; signature: string; retryCount?: number | undefined; } export interface TransactionEvent { transactionHash: string; from: string; to: string; value: string; tokenAddress?: string | undefined; tokenSymbol?: string | undefined; blockNumber: number; gasUsed: string; gasPrice: string; status: 'SUCCEEDED' | 'FAILED'; confirmations: number; } export interface BalanceEvent { previousBalance: string; newBalance: string; difference: string; tokenAddress?: string | undefined; tokenSymbol?: string | undefined; changeType: 'INCREASE' | 'DECREASE'; triggerTransaction?: string | undefined; } export interface PortfolioEvent { previousValue: number; newValue: number; changeAmount: number; changePercentage: number; affectedTokens: { tokenAddress: string; symbol: string; previousValue: number; newValue: number; }[]; } export interface ContractEvent { contractAddress: string; contractName: string; contractSymbol: string; transactionHash: string; blockNumber: number; status: 'SUCCEEDED' | 'FAILED'; errorMessage?: string | undefined; } export interface TokenEvent { tokenId?: number | undefined; tokenTypeId?: number | undefined; contractAddress: string; recipient: string; amount: number; transactionHash: string; blockNumber: number; status: 'SUCCEEDED' | 'FAILED'; metadata?: Record<string, unknown> | undefined; errorMessage?: string | undefined; } export interface WebhookStatus { webhookId: string; isActive: boolean; lastDelivery?: string | undefined; lastSuccessfulDelivery?: string | undefined; failureCount: number; totalDeliveries: number; successRate: number; healthStatus: 'HEALTHY' | 'DEGRADED' | 'FAILING'; recentDeliveries: WebhookDelivery[]; } export interface WebhookDelivery { id: string; timestamp: string; eventType: WebhookEventType; httpStatus: number; responseTime: number; success: boolean; errorMessage?: string | undefined; retryCount: number; } export interface EventInsights { totalEvents: number; eventsByType: Record<WebhookEventType, number>; timeRange: { start: string; end: string; }; patterns: { mostActiveHour: number; averageEventsPerDay: number; peakEventType: WebhookEventType; }; performance: { averageProcessingTime: number; successRate: number; errorRate: number; }; } export declare const WebhookEventTypeSchema: z.ZodNativeEnum<typeof WebhookEventType>; export declare const WebhookFiltersSchema: z.ZodObject<{ minimumAmount: z.ZodOptional<z.ZodNumber>; tokenAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; thresholdPercentage: z.ZodOptional<z.ZodNumber>; contractAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; fromAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; toAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; }, { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; }>; export declare const WebhookConfigSchema: z.ZodObject<{ walletId: z.ZodString; eventTypes: z.ZodArray<z.ZodNativeEnum<typeof WebhookEventType>, "many">; callbackUrl: z.ZodString; secretKey: z.ZodString; isActive: z.ZodDefault<z.ZodBoolean>; filters: z.ZodOptional<z.ZodObject<{ minimumAmount: z.ZodOptional<z.ZodNumber>; tokenAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; thresholdPercentage: z.ZodOptional<z.ZodNumber>; contractAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; fromAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; toAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; }, { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; }>>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { walletId: string; eventTypes: WebhookEventType[]; callbackUrl: string; secretKey: string; isActive: boolean; description?: string | undefined; filters?: { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; } | undefined; }, { walletId: string; eventTypes: WebhookEventType[]; callbackUrl: string; secretKey: string; description?: string | undefined; isActive?: boolean | undefined; filters?: { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; } | undefined; }>; export declare const SetupWebhookRequestSchema: z.ZodObject<{ walletId: z.ZodString; eventTypes: z.ZodArray<z.ZodNativeEnum<typeof WebhookEventType>, "many">; callbackUrl: z.ZodString; filters: z.ZodOptional<z.ZodObject<{ minimumAmount: z.ZodOptional<z.ZodNumber>; tokenAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; thresholdPercentage: z.ZodOptional<z.ZodNumber>; contractAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; fromAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; toAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; }, { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; }>>; description: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { walletId: string; eventTypes: WebhookEventType[]; callbackUrl: string; description?: string | undefined; filters?: { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; } | undefined; }, { walletId: string; eventTypes: WebhookEventType[]; callbackUrl: string; description?: string | undefined; filters?: { minimumAmount?: number | undefined; tokenAddresses?: string[] | undefined; thresholdPercentage?: number | undefined; contractAddresses?: string[] | undefined; fromAddresses?: string[] | undefined; toAddresses?: string[] | undefined; } | undefined; }>; export interface VenlyClientConfig { auth: VenlyAuthConfig; rateLimiting?: { enabled: boolean; windowMs: number; maxRequests: number; skipFailedRequests: boolean; }; retryConfig?: { maxRetries: number; baseDelay: number; maxDelay: number; }; timeout?: number; logging?: { enabled: boolean; level: 'debug' | 'info' | 'warn' | 'error'; }; } export declare enum WorkflowStepType { VENLY_TRANSACTION = "VENLY_TRANSACTION", FIAT_CONVERSION = "FIAT_CONVERSION", EXTERNAL_MCP_CALL = "EXTERNAL_MCP_CALL", WEBHOOK_TRIGGER = "WEBHOOK_TRIGGER", CONDITION_CHECK = "CONDITION_CHECK", DATA_EXPORT = "DATA_EXPORT" } export interface CreateWorkflowTemplateRequest { name: string; description: string; category: 'PAYMENT' | 'NFT_DISTRIBUTION' | 'TOKEN_MANAGEMENT' | 'PORTFOLIO_REBALANCING' | 'CUSTOM'; steps: WorkflowStepMCP[]; triggers?: WorkflowTriggerMCP[]; parameters?: WorkflowParameterMCP[]; errorHandling?: ErrorHandlingConfigMCP; } export interface ExecuteWorkflowRequest { templateId?: string; workflowTemplate?: CreateWorkflowTemplateRequest; parameters: Record<string, any>; executionOptions?: { dryRun?: boolean; stopOnError?: boolean; maxRetries?: number; delayBetweenSteps?: number; }; } export interface MonitorWorkflowStatusRequest { workflowExecutionId: string; templateId?: string; includeStepDetails?: boolean; includeLogs?: boolean; } export interface WorkflowStepMCP { id: string; name: string; type: WorkflowStepTypeMCP; description?: string; parameters: Record<string, any>; dependencies?: string[]; conditions?: WorkflowConditionMCP[]; retryConfig?: { maxRetries: number; delayMs: number; }; } export type WorkflowStepTypeMCP = 'CREATE_WALLET' | 'SEND_TRANSACTION' | 'SEND_TOKEN' | 'CHECK_BALANCE' | 'WAIT_FOR_CONFIRMATION' | 'BATCH_MINT_NFTS' | 'FIAT_ONRAMP' | 'FIAT_OFFRAMP' | 'WEBHOOK_NOTIFICATION' | 'CONDITIONAL_BRANCH' | 'DELAY'; export interface WorkflowTriggerMCP { type: 'MANUAL' | 'SCHEDULED' | 'WEBHOOK' | 'BALANCE_THRESHOLD' | 'TRANSACTION_CONFIRMED'; configuration: Record<string, any>; } export interface WorkflowParameterMCP { name: string; type: 'string' | 'number' | 'boolean' | 'address' | 'amount'; required: boolean; defaultValue?: any; description?: string; validation?: { min?: number; max?: number; pattern?: string; }; } export interface WorkflowConditionMCP { field: string; operator: 'equals' | 'greater_than' | 'less_than' | 'contains' | 'exists'; value: any; } export interface ErrorHandlingConfigMCP { onStepFailure: 'STOP' | 'CONTINUE' | 'RETRY' | 'ROLLBACK'; maxGlobalRetries: number; notificationWebhook?: string; rollbackSteps?: string[]; } export interface WorkflowTemplateResponse { templateId: string; name: string; description: string; category: string; steps: WorkflowStepMCP[]; triggers: WorkflowTriggerMCP[]; parameters: WorkflowParameterMCP[]; createdAt: string; updatedAt: string; version: number; status: 'DRAFT' | 'ACTIVE' | 'DEPRECATED'; } export interface WorkflowExecutionResponse { executionId: string; templateId?: string; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED'; startedAt: string; completedAt?: string; currentStep?: string; progress: { totalSteps: number; completedSteps: number; failedSteps: number; percentage: number; }; results: Record<string, any>; errors?: WorkflowErrorMCP[]; estimatedDuration?: number; actualDuration?: number; } export interface WorkflowStatusResponse { executionId: string; templateId?: string; templateName?: string; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'CANCELLED'; progress: { totalSteps: number; completedSteps: number; failedSteps: number; percentage: number; }; currentStep?: { id: string; name: string; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED'; startedAt?: string; completedAt?: string; result?: any; error?: string; }; stepHistory: WorkflowStepExecutionMCP[]; startedAt: string; completedAt?: string; duration?: number; logs?: WorkflowLogMCP[]; metadata: { executedBy: string; parameters: Record<string, any>; dryRun: boolean; }; } export interface WorkflowStepExecutionMCP { stepId: string; stepName: string; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'SKIPPED'; startedAt?: string; completedAt?: string; duration?: number; result?: any; error?: WorkflowErrorMCP; retryCount: number; } export interface WorkflowErrorMCP { stepId: string; errorCode: string; message: string; details?: any; timestamp: string; retryable: boolean; } export interface WorkflowLogMCP { timestamp: string; level: 'INFO' | 'WARN' | 'ERROR' | 'DEBUG'; stepId?: string; message: string; data?: any; } export declare enum WorkflowStatus { PENDING = "PENDING", RUNNING = "RUNNING", COMPLETED = "COMPLETED", FAILED = "FAILED", CANCELLED = "CANCELLED", PAUSED = "PAUSED" } export declare enum WorkflowTriggerType { MANUAL = "MANUAL", WEBHOOK_EVENT = "WEBHOOK_EVENT", SCHEDULED = "SCHEDULED", BALANCE_THRESHOLD = "BALANCE_THRESHOLD", PRICE_CHANGE = "PRICE_CHANGE" } export interface WorkflowCondition { field: string; operator: 'equals' | 'greater_than' | 'less_than' | 'contains' | 'not_equals'; value: unknown; logicalOperator?: 'AND' | 'OR' | undefined; } export interface RetryPolicy { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; } export interface WorkflowTrigger { id: string; type: WorkflowTriggerType; conditions?: WorkflowCondition[] | undefined; schedule?: string | undefined; webhookEventTypes?: WebhookEventType[] | undefined; isActive: boolean; } export interface WorkflowMetadata { version: string; author: string; description: string; tags: string[]; category: string; estimatedDuration?: number | undefined; complexity: 'LOW' | 'MEDIUM' | 'HIGH'; createdAt: string; updatedAt: string; } export interface WorkflowStep { id: string; name: string; type: WorkflowStepType; mcpServer?: string | undefined; action: string; parameters: Record<string, unknown>; conditions?: WorkflowCondition[] | undefined; retryPolicy?: RetryPolicy | undefined; timeout?: number | undefined; dependsOn?: string[] | undefined; parallel?: boolean | undefined; } export interface WorkflowTemplate { id: string; name: string; description: string; steps: WorkflowStep[]; triggers: WorkflowTrigger[]; metadata: WorkflowMetadata; inputSchema?: Record<string, unknown> | undefined; outputSchema?: Record<string, unknown> | undefined; isActive: boolean; } export interface WorkflowStepResult { stepId: string; status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED' | 'SKIPPED'; startTime?: Date | undefined; endTime?: Date | undefined; result?: unknown | undefined; error?: string | undefined; retryCount: number; logs: string[]; } export interface WorkflowContext { executionId: string; templateId: string; inputs: Record<string, unknown>; variables: Record<string, unknown>; stepResults: Map<string, WorkflowStepResult>; currentStep: number; userId?: string | undefined; metadata: Record<string, unknown>; } export interface WorkflowExecution { id: string; templateId: string; status: WorkflowStatus; currentStep: number; totalSteps: number; startTime: Date; endTime?: Date | undefined; results: WorkflowStepResult[]; error?: string | undefined; inputs: Record<string, unknown>; outputs?: Record<string, unknown> | undefined; triggeredBy: { type: WorkflowTriggerType; source?: string | undefined; eventId?: string | undefined; }; progress: { percentage: number; completedSteps: number; failedSteps: number; skippedSteps: number; }; } export declare enum ExportFormat { CSV = "CSV", JSON = "JSON", PDF = "PDF", XLSX = "XLSX" } export interface DateRange { start: string; end: string; } export interface ExportResult { id: string; format: ExportFormat; filename: string; size: number; downloadUrl: string; expiresAt: string; createdAt: string; metadata: { recordCount: number; dateRange: DateRange; walletIds: string[]; exportType: string; }; } export interface TaxReport extends ExportResult { taxYear: number; jurisdiction: string; summary: { totalTransactions: number; totalGains: number; totalLosses: number; netGainLoss: number; totalFees: number; holdingPeriods: { shortTerm: number; longTerm: number; }; }; warnings?: string[] | undefined; disclaimers: string[]; } export interface PortfolioReport extends ExportResult { summary: { totalValue: number; totalTokens: number; totalWallets: number; performanceMetrics: { totalReturn: number; totalReturnPercentage: number; annualizedReturn: number; volatility: number; sharpeRatio: number; }; }; holdings: { tokenAddress: string; symbol: string; balance: number; value: number; percentage: number; costBasis?: number | undefined; unrealizedGainLoss?: number | undefined; }[]; } export interface TransactionHistoryExport extends ExportResult { summary: { totalTransactions: number; totalVolume: number; uniqueTokens: number; dateRange: DateRange; networks: string[]; }; filters: { walletIds?: string[] | undefined; tokenAddresses?: string[] | undefined; transactionTypes?: string[] | undefined; minAmount?: number | undefined; maxAmount?: number | undefined; }; } export interface RouteOption { id: string; path: string[]; estimatedGas: number; estimatedTime: number; estimatedCost: number; confidence: number; networks: SecretType[]; bridges?: string[] | undefined; dexes?: string[] | undefined; slippage: number; priceImpact: number; } export interface OptimizationCriteria { priority: 'COST' | 'SPEED' | 'RELIABILITY' | 'BALANCED'; maxSlippage?: number | undefined; maxPriceImpact?: number | undefined; preferredNetworks?: SecretType[] | undefined; avoidNetworks?: SecretType[] | undefined; maxHops?: number | undefined; } export interface TransactionRoute { fromToken: string; toToken: string; amount: number; fromNetwork: SecretType; toNetwork: SecretType; routes: RouteOption[]; recommendedRoute: RouteOption; optimizationCriteria: OptimizationCriteria; timestamp: string; expiresAt: string; } export interface MCPServerConfig { name: string; endpoint: string; authentication?: { type: 'API_KEY' | 'OAUTH' | 'BASIC' | 'BEARER'; credentials: Record<string, string>; } | undefined; timeout: number; retryPolicy: RetryPolicy; rateLimiting?: { requestsPerSecond: number; burstLimit: number; } | undefined; } export interface MCPCallResult { server: string; action: string; success: boolean; result?: unknown | undefined; error?: string | undefined; duration: number; timestamp: string; } export interface CrossMCPWorkflowStep extends WorkflowStep { mcpServer: string; fallbackActions?: { action: string; parameters: Record<string, unknown>; }[] | undefined; validation?: { required: boolean; schema?: Record<string, unknown> | undefined; } | undefined; } export declare const WorkflowStepTypeSchema: z.ZodNativeEnum<typeof WorkflowStepType>; export declare const WorkflowStatusSchema: z.ZodNativeEnum<typeof WorkflowStatus>; export declare const WorkflowTriggerTypeSchema: z.ZodNativeEnum<typeof WorkflowTriggerType>; export declare const ExportFormatSchema: z.ZodNativeEnum<typeof ExportFormat>; export declare const WorkflowConditionSchema: z.ZodObject<{ field: z.ZodString; operator: z.ZodEnum<["equals", "greater_than", "less_than", "contains", "not_equals"]>; value: z.ZodUnknown; logicalOperator: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>; }, "strip", z.ZodTypeAny, { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }, { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }>; export declare const RetryPolicySchema: z.ZodObject<{ maxRetries: z.ZodNumber; baseDelay: z.ZodNumber; maxDelay: z.ZodNumber; backoffMultiplier: z.ZodNumber; retryableErrors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; }, { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; }>; export declare const WorkflowStepSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodNativeEnum<typeof WorkflowStepType>; mcpServer: z.ZodOptional<z.ZodString>; action: z.ZodString; parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>; conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{ field: z.ZodString; operator: z.ZodEnum<["equals", "greater_than", "less_than", "contains", "not_equals"]>; value: z.ZodUnknown; logicalOperator: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>; }, "strip", z.ZodTypeAny, { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }, { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }>, "many">>; retryPolicy: z.ZodOptional<z.ZodObject<{ maxRetries: z.ZodNumber; baseDelay: z.ZodNumber; maxDelay: z.ZodNumber; backoffMultiplier: z.ZodNumber; retryableErrors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; }, { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; }>>; timeout: z.ZodOptional<z.ZodNumber>; dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; parallel: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: WorkflowStepType; id: string; name: string; action: string; parameters: Record<string, unknown>; mcpServer?: string | undefined; conditions?: { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }[] | undefined; retryPolicy?: { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; } | undefined; timeout?: number | undefined; dependsOn?: string[] | undefined; parallel?: boolean | undefined; }, { type: WorkflowStepType; id: string; name: string; action: string; parameters: Record<string, unknown>; mcpServer?: string | undefined; conditions?: { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }[] | undefined; retryPolicy?: { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; } | undefined; timeout?: number | undefined; dependsOn?: string[] | undefined; parallel?: boolean | undefined; }>; export declare const WorkflowTemplateSchema: z.ZodObject<{ name: z.ZodString; description: z.ZodString; steps: z.ZodArray<z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodNativeEnum<typeof WorkflowStepType>; mcpServer: z.ZodOptional<z.ZodString>; action: z.ZodString; parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>; conditions: z.ZodOptional<z.ZodArray<z.ZodObject<{ field: z.ZodString; operator: z.ZodEnum<["equals", "greater_than", "less_than", "contains", "not_equals"]>; value: z.ZodUnknown; logicalOperator: z.ZodOptional<z.ZodEnum<["AND", "OR"]>>; }, "strip", z.ZodTypeAny, { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }, { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }>, "many">>; retryPolicy: z.ZodOptional<z.ZodObject<{ maxRetries: z.ZodNumber; baseDelay: z.ZodNumber; maxDelay: z.ZodNumber; backoffMultiplier: z.ZodNumber; retryableErrors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; }, { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; }>>; timeout: z.ZodOptional<z.ZodNumber>; dependsOn: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; parallel: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { type: WorkflowStepType; id: string; name: string; action: string; parameters: Record<string, unknown>; mcpServer?: string | undefined; conditions?: { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }[] | undefined; retryPolicy?: { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; } | undefined; timeout?: number | undefined; dependsOn?: string[] | undefined; parallel?: boolean | undefined; }, { type: WorkflowStepType; id: string; name: string; action: string; parameters: Record<string, unknown>; mcpServer?: string | undefined; conditions?: { field: string; operator: "equals" | "greater_than" | "less_than" | "contains" | "not_equals"; value?: unknown; logicalOperator?: "AND" | "OR" | undefined; }[] | undefined; retryPolicy?: { maxRetries: number; baseDelay: number; maxDelay: number; backoffMultiplier: number; retryableErrors?: string[] | undefined; } | undefined; timeout?: number | undefined; dependsOn?: string[] | undefined; parallel?: boolean | undefined; }>, "many">; triggers: z.ZodArray<z.ZodObject<{