riskmarket-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of riskmarket-sdk might be problematic. Click here for more details.
- package/README.md +418 -0
- package/dist/ProtocolSDK.d.ts +82 -0
- package/dist/ProtocolSDK.d.ts.map +1 -0
- package/dist/ProtocolSDK.js +129 -0
- package/dist/abi/ExampleABI.d.ts +160 -0
- package/dist/abi/ExampleABI.d.ts.map +1 -0
- package/dist/abi/ExampleABI.js +92 -0
- package/dist/api/APIClient.d.ts +106 -0
- package/dist/api/APIClient.d.ts.map +1 -0
- package/dist/api/APIClient.js +201 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +729 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +746 -0
- package/dist/index.js.map +1 -0
- package/dist/transactions/TransactionBuilder.d.ts +89 -0
- package/dist/transactions/TransactionBuilder.d.ts.map +1 -0
- package/dist/transactions/TransactionBuilder.js +111 -0
- package/dist/types/index.d.ts +109 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +21 -0
- package/dist/utils/constants.d.ts +83 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/constants.js +82 -0
- package/dist/utils/helpers.d.ts +75 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +185 -0
- package/package.json +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/types/index.ts","../src/api/APIClient.ts","../src/utils/helpers.ts","../src/transactions/TransactionBuilder.ts","../src/ProtocolSDK.ts","../src/utils/constants.ts"],"sourcesContent":["import { Provider } from 'ethers';\n\n/**\n * Configuration for initializing the SDK\n */\nexport interface SDKConfig {\n /** Base URL for the API endpoint */\n apiBaseURL: string;\n /** Ethers provider instance */\n provider: Provider;\n /** Smart contract address */\n contractAddress: string;\n /** Contract ABI */\n abi: any[];\n /** Optional API key for authenticated endpoints */\n apiKey?: string;\n /** Network chain ID */\n chainId?: number;\n}\n\n// ============================================\n// ADD YOUR TRANSACTION PARAMETER TYPES HERE\n// ============================================\n\n/**\n * Example transaction parameters\n * Create interfaces for your specific contract functions\n * \n * Example:\n * \n * export interface YourTransactionParams {\n * tokenAddress: string;\n * amount: string;\n * recipient: string;\n * // ... your parameters\n * }\n */\n\n/**\n * Market data response from API\n */\nexport interface MarketData {\n id: string;\n name: string;\n baseToken: string;\n quoteToken: string;\n price: string;\n volume24h: string;\n liquidity: string;\n priceChange24h: string;\n}\n\n/**\n * User balance information\n */\nexport interface UserBalance {\n address: string;\n token: string;\n balance: string;\n balanceFormatted: string;\n decimals: number;\n}\n\n/**\n * Transaction history item\n */\nexport interface Transaction {\n hash: string;\n from: string;\n to: string;\n value: string;\n timestamp: number;\n status: 'pending' | 'success' | 'failed';\n type: 'swap' | 'deposit' | 'withdraw' | 'transfer';\n}\n\n/**\n * API response wrapper\n */\nexport interface APIResponse<T> {\n success: boolean;\n data: T;\n error?: string;\n message?: string;\n}\n\n/**\n * Transaction response from blockchain\n */\nexport interface TransactionResponse {\n hash: string;\n from: string;\n to: string;\n data: string;\n value: string;\n gasLimit: string;\n gasPrice?: string;\n maxFeePerGas?: string;\n maxPriorityFeePerGas?: string;\n nonce: number;\n chainId: number;\n}\n\n/**\n * Error types\n */\nexport enum ErrorType {\n API_ERROR = 'API_ERROR',\n TRANSACTION_ERROR = 'TRANSACTION_ERROR',\n VALIDATION_ERROR = 'VALIDATION_ERROR',\n NETWORK_ERROR = 'NETWORK_ERROR',\n}\n\n/**\n * Custom SDK Error\n */\nexport class SDKError extends Error {\n type: ErrorType;\n details?: any;\n\n constructor(message: string, type: ErrorType, details?: any) {\n super(message);\n this.name = 'SDKError';\n this.type = type;\n this.details = details;\n }\n}\n","import axios, { AxiosInstance, AxiosError } from \"axios\";\nimport { APIResponse, SDKError, ErrorType } from \"../types\";\n\n/**\n * APIClient class for interacting with backend APIs\n */\nexport class APIClient {\n private client: AxiosInstance;\n private apiKey?: string;\n private baseURL: string;\n\n /**\n * Initialize API client\n * @param baseURL - Base URL for API endpoints\n * @param apiKey - Optional API key for authentication\n */\n constructor(baseURL: string, apiKey?: string) {\n this.baseURL = baseURL;\n this.apiKey = apiKey;\n\n this.client = axios.create({\n baseURL,\n timeout: 30000,\n headers: {\n \"Content-Type\": \"application/json\",\n ...(apiKey && { Authorization: `Bearer ${apiKey}` }),\n },\n });\n\n // Add response interceptor for error handling\n this.client.interceptors.response.use(\n (response) => response,\n (error: AxiosError) => {\n throw this.handleAPIError(error);\n }\n );\n }\n\n /**\n * Handle API errors\n * @private\n */\n private handleAPIError(error: AxiosError): SDKError {\n if (error.response) {\n // Server responded with error status\n const message = (error.response.data as any)?.message || error.message;\n return new SDKError(`API Error: ${message}`, ErrorType.API_ERROR, {\n status: error.response.status,\n data: error.response.data,\n });\n } else if (error.request) {\n // Request was made but no response\n return new SDKError(\"No response from server\", ErrorType.NETWORK_ERROR, {\n originalError: error,\n });\n } else {\n // Something else happened\n return new SDKError(\n `Request failed: ${error.message}`,\n ErrorType.API_ERROR\n );\n }\n }\n\n // ============================================\n // ADD YOUR API METHODS HERE\n // ============================================\n\n /**\n * Example method - Replace with your actual API calls\n *\n * Template for a GET request:\n *\n * async getYourData(id: string): Promise<YourDataType> {\n * try {\n * const response = await this.client.get<APIResponse<YourDataType>>(\n * `/your-endpoint/${id}`\n * );\n *\n * if (!response.data.success) {\n * throw new SDKError(\n * response.data.error || 'Failed to fetch data',\n * ErrorType.API_ERROR\n * );\n * }\n *\n * return response.data.data;\n * } catch (error) {\n * if (error instanceof SDKError) throw error;\n * throw new SDKError(\n * `Failed to fetch data: ${error}`,\n * ErrorType.API_ERROR\n * );\n * }\n * }\n *\n * Template for a POST request:\n *\n * async createYourData(data: YourInputType): Promise<YourDataType> {\n * try {\n * const response = await this.client.post<APIResponse<YourDataType>>(\n * '/your-endpoint',\n * data\n * );\n *\n * if (!response.data.success) {\n * throw new SDKError(\n * response.data.error || 'Failed to create data',\n * ErrorType.API_ERROR\n * );\n * }\n *\n * return response.data.data;\n * } catch (error) {\n * if (error instanceof SDKError) throw error;\n * throw new SDKError(\n * `Failed to create data: ${error}`,\n * ErrorType.API_ERROR\n * );\n * }\n * }\n */\n\n // ============================================\n // GENERIC REQUEST METHODS (Keep these - they're useful!)\n // ============================================\n\n /**\n * Generic GET request\n * @param endpoint - API endpoint (relative to baseURL)\n * @param params - Query parameters\n */\n async get<T>(endpoint: string, params?: Record<string, any>): Promise<T> {\n try {\n const response = await this.client.get<APIResponse<T>>(endpoint, {\n params,\n });\n\n if (!response.data.success) {\n throw new SDKError(\n response.data.error || \"Request failed\",\n ErrorType.API_ERROR\n );\n }\n\n return response.data.data;\n } catch (error) {\n if (error instanceof SDKError) throw error;\n throw new SDKError(`GET request failed: ${error}`, ErrorType.API_ERROR);\n }\n }\n\n /**\n * Generic POST request\n * @param endpoint - API endpoint (relative to baseURL)\n * @param data - Request body data\n */\n async post<T>(endpoint: string, data: any): Promise<T> {\n try {\n const response = await this.client.post<APIResponse<T>>(endpoint, data);\n\n if (!response.data.success) {\n throw new SDKError(\n response.data.error || \"Request failed\",\n ErrorType.API_ERROR\n );\n }\n\n return response.data.data;\n } catch (error) {\n if (error instanceof SDKError) throw error;\n throw new SDKError(`POST request failed: ${error}`, ErrorType.API_ERROR);\n }\n }\n\n /**\n * Generic PUT request\n * @param endpoint - API endpoint (relative to baseURL)\n * @param data - Request body data\n */\n async put<T>(endpoint: string, data: any): Promise<T> {\n try {\n const response = await this.client.put<APIResponse<T>>(endpoint, data);\n\n if (!response.data.success) {\n throw new SDKError(\n response.data.error || \"Request failed\",\n ErrorType.API_ERROR\n );\n }\n\n return response.data.data;\n } catch (error) {\n if (error instanceof SDKError) throw error;\n throw new SDKError(`PUT request failed: ${error}`, ErrorType.API_ERROR);\n }\n }\n\n /**\n * Generic DELETE request\n * @param endpoint - API endpoint (relative to baseURL)\n */\n async delete<T>(endpoint: string): Promise<T> {\n try {\n const response = await this.client.delete<APIResponse<T>>(endpoint);\n\n if (!response.data.success) {\n throw new SDKError(\n response.data.error || \"Request failed\",\n ErrorType.API_ERROR\n );\n }\n\n return response.data.data;\n } catch (error) {\n if (error instanceof SDKError) throw error;\n throw new SDKError(\n `DELETE request failed: ${error}`,\n ErrorType.API_ERROR\n );\n }\n }\n\n /**\n * Get the base URL\n */\n getBaseURL(): string {\n return this.baseURL;\n }\n\n /**\n * Get the axios instance for advanced usage\n */\n getClient(): AxiosInstance {\n return this.client;\n }\n}\n","import { ethers } from 'ethers';\nimport { SDKError, ErrorType } from '../types';\n\n/**\n * Utility class with helper functions\n */\nexport class Utils {\n /**\n * Validate Ethereum address\n */\n static isValidAddress(address: string): boolean {\n try {\n return ethers.isAddress(address);\n } catch {\n return false;\n }\n }\n\n /**\n * Validate and checksum an address\n */\n static validateAddress(address: string): string {\n if (!this.isValidAddress(address)) {\n throw new SDKError(\n `Invalid Ethereum address: ${address}`,\n ErrorType.VALIDATION_ERROR\n );\n }\n return ethers.getAddress(address);\n }\n\n /**\n * Format token amount from wei to human-readable format\n */\n static formatAmount(amount: string | bigint, decimals: number = 18): string {\n try {\n return ethers.formatUnits(amount, decimals);\n } catch (error) {\n throw new SDKError(\n `Failed to format amount: ${error}`,\n ErrorType.VALIDATION_ERROR\n );\n }\n }\n\n /**\n * Parse human-readable amount to wei\n */\n static parseAmount(amount: string, decimals: number = 18): string {\n try {\n return ethers.parseUnits(amount, decimals).toString();\n } catch (error) {\n throw new SDKError(\n `Failed to parse amount: ${error}`,\n ErrorType.VALIDATION_ERROR\n );\n }\n }\n\n /**\n * Validate amount is positive and not zero\n */\n static validateAmount(amount: string): void {\n const amountBN = BigInt(amount);\n if (amountBN <= 0n) {\n throw new SDKError(\n 'Amount must be greater than zero',\n ErrorType.VALIDATION_ERROR\n );\n }\n }\n\n /**\n * Calculate deadline timestamp (current time + minutes)\n */\n static getDeadline(minutes: number = 20): number {\n return Math.floor(Date.now() / 1000) + minutes * 60;\n }\n\n /**\n * Calculate percentage difference\n */\n static calculatePercentageChange(oldValue: string, newValue: string): string {\n const old = parseFloat(oldValue);\n const newVal = parseFloat(newValue);\n \n if (old === 0) return '0';\n \n const change = ((newVal - old) / old) * 100;\n return change.toFixed(2);\n }\n\n /**\n * Estimate gas with buffer (adds 20% buffer)\n */\n static addGasBuffer(gasEstimate: bigint | string, bufferPercent: number = 20): string {\n const estimate = BigInt(gasEstimate);\n const buffer = estimate * BigInt(bufferPercent) / 100n;\n return (estimate + buffer).toString();\n }\n\n /**\n * Parse error message from contract call\n */\n static parseContractError(error: any): string {\n // Check for common error patterns\n if (error.reason) {\n return error.reason;\n }\n \n if (error.message) {\n // Extract revert reason if present\n const revertMatch = error.message.match(/reason=\"([^\"]*)\"/);\n if (revertMatch) {\n return revertMatch[1];\n }\n \n return error.message;\n }\n \n if (error.data?.message) {\n return error.data.message;\n }\n \n return 'Unknown error occurred';\n }\n\n /**\n * Wait for transaction confirmation\n */\n static async waitForTransaction(\n txHash: string,\n provider: ethers.Provider,\n confirmations: number = 1\n ): Promise<ethers.TransactionReceipt | null> {\n try {\n const receipt = await provider.waitForTransaction(txHash, confirmations);\n return receipt;\n } catch (error) {\n throw new SDKError(\n `Transaction failed: ${this.parseContractError(error)}`,\n ErrorType.TRANSACTION_ERROR,\n { txHash }\n );\n }\n }\n\n /**\n * Get current gas prices\n */\n static async getGasPrices(provider: ethers.Provider): Promise<{\n gasPrice?: bigint;\n maxFeePerGas?: bigint;\n maxPriorityFeePerGas?: bigint;\n }> {\n try {\n const feeData = await provider.getFeeData();\n \n return {\n gasPrice: feeData.gasPrice || undefined,\n maxFeePerGas: feeData.maxFeePerGas || undefined,\n maxPriorityFeePerGas: feeData.maxPriorityFeePerGas || undefined,\n };\n } catch (error) {\n throw new SDKError(\n `Failed to fetch gas prices: ${error}`,\n ErrorType.NETWORK_ERROR\n );\n }\n }\n\n /**\n * Convert chain ID to network name\n */\n static getNetworkName(chainId: number): string {\n const networks: Record<number, string> = {\n 1: 'Ethereum Mainnet',\n 5: 'Goerli',\n 11155111: 'Sepolia',\n 137: 'Polygon',\n 42161: 'Arbitrum One',\n 10: 'Optimism',\n };\n \n return networks[chainId] || `Unknown Network (${chainId})`;\n }\n\n /**\n * Sleep/delay utility\n */\n static sleep(ms: number): Promise<void> {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n /**\n * Retry logic for API calls\n */\n static async retry<T>(\n fn: () => Promise<T>,\n maxRetries: number = 3,\n delayMs: number = 1000\n ): Promise<T> {\n let lastError: any;\n \n for (let i = 0; i < maxRetries; i++) {\n try {\n return await fn();\n } catch (error) {\n lastError = error;\n if (i < maxRetries - 1) {\n await this.sleep(delayMs * (i + 1));\n }\n }\n }\n \n throw lastError;\n }\n\n /**\n * Format transaction hash with ellipsis\n */\n static shortenHash(hash: string, startLength: number = 6, endLength: number = 4): string {\n if (hash.length <= startLength + endLength) {\n return hash;\n }\n return `${hash.slice(0, startLength)}...${hash.slice(-endLength)}`;\n }\n\n /**\n * Check if a transaction was successful\n */\n static isTransactionSuccessful(receipt: ethers.TransactionReceipt | null): boolean {\n return receipt?.status === 1;\n }\n}\n","import { ethers, Contract, TransactionRequest } from 'ethers';\nimport { SDKError, ErrorType } from '../types';\nimport { Utils } from '../utils/helpers';\n\n/**\n * TransactionBuilder class for creating blockchain transactions\n * Returns unsigned transaction data that can be signed and sent by the frontend\n * \n * This is a TEMPLATE - add your own transaction methods based on your contract functions\n */\nexport class TransactionBuilder {\n private provider: ethers.Provider;\n private contract: Contract;\n private contractAddress: string;\n\n /**\n * Initialize TransactionBuilder\n * @param provider - Ethers provider instance\n * @param contractAddress - Main protocol contract address\n * @param abi - Contract ABI\n */\n constructor(\n provider: ethers.Provider,\n contractAddress: string,\n abi: any[]\n ) {\n this.provider = provider;\n this.contractAddress = Utils.validateAddress(contractAddress);\n this.contract = new ethers.Contract(this.contractAddress, abi, provider);\n }\n\n // ============================================\n // ADD YOUR TRANSACTION PREPARATION METHODS HERE\n // ============================================\n \n /**\n * Example method - Replace with your actual contract functions\n * \n * Template for preparing a transaction:\n * \n * async prepareYourTransaction(params: YourParams): Promise<TransactionRequest> {\n * try {\n * // 1. Validate inputs\n * Utils.validateAddress(params.someAddress);\n * Utils.validateAmount(params.amount);\n * \n * // 2. Populate transaction from your contract\n * const tx = await this.contract.yourFunction.populateTransaction(\n * params.arg1,\n * params.arg2,\n * // ... your parameters\n * );\n * \n * // 3. Estimate gas (optional but recommended)\n * try {\n * const gasEstimate = await this.contract.yourFunction.estimateGas(\n * params.arg1,\n * params.arg2\n * );\n * tx.gasLimit = Utils.addGasBuffer(gasEstimate);\n * } catch (error) {\n * // Fallback to a default gas limit if estimation fails\n * tx.gasLimit = BigInt(200000);\n * console.warn('Gas estimation failed, using default:', error);\n * }\n * \n * // 4. Return the unsigned transaction\n * return tx;\n * } catch (error) {\n * throw new SDKError(\n * `Failed to prepare transaction: ${Utils.parseContractError(error)}`,\n * ErrorType.TRANSACTION_ERROR,\n * { params }\n * );\n * }\n * }\n */\n\n // ============================================\n // UTILITY METHODS (Keep these - they're useful for any protocol)\n // ============================================\n\n /**\n * Create a contract instance for custom interactions\n * @param abi - Contract ABI\n * @param address - Contract address (optional, defaults to main contract)\n */\n getContractInstance(abi: any[], address?: string): Contract {\n const contractAddress = address || this.contractAddress;\n Utils.validateAddress(contractAddress);\n return new ethers.Contract(contractAddress, abi, this.provider);\n }\n\n /**\n * Get the main contract instance\n */\n getContract(): Contract {\n return this.contract;\n }\n\n /**\n * Get the provider\n */\n getProvider(): ethers.Provider {\n return this.provider;\n }\n\n /**\n * Estimate gas for any transaction\n * @param tx - Transaction request\n */\n async estimateGas(tx: TransactionRequest): Promise<bigint> {\n try {\n const gasEstimate = await this.provider.estimateGas(tx);\n return BigInt(Utils.addGasBuffer(gasEstimate));\n } catch (error) {\n throw new SDKError(\n `Failed to estimate gas: ${Utils.parseContractError(error)}`,\n ErrorType.TRANSACTION_ERROR\n );\n }\n }\n\n /**\n * Get current gas prices\n */\n async getGasPrices() {\n return Utils.getGasPrices(this.provider);\n }\n}\n","import { Provider } from 'ethers';\nimport { APIClient } from './api/APIClient';\nimport { TransactionBuilder } from './transactions/TransactionBuilder';\nimport { Utils } from './utils/helpers';\nimport { SDKConfig, SDKError, ErrorType } from './types';\n\n/**\n * Main SDK class that combines all functionality\n * \n * @example\n * ```typescript\n * import { ProtocolSDK } from '@yourorg/protocol-sdk';\n * import { ethers } from 'ethers';\n * \n * const provider = new ethers.JsonRpcProvider('YOUR_RPC_URL');\n * \n * const sdk = new ProtocolSDK({\n * apiBaseURL: 'https://api.yourprotocol.com',\n * provider: provider,\n * contractAddress: '0x...',\n * abi: YourContractABI,\n * apiKey: 'your-api-key', // optional\n * });\n * \n * // Use the SDK\n * const markets = await sdk.api.getAllMarkets();\n * const tx = await sdk.tx.prepareSwapTransaction({ ... });\n * ```\n */\nexport class ProtocolSDK {\n /** API client for fetching data */\n public api: APIClient;\n \n /** Transaction builder for creating blockchain transactions */\n public tx: TransactionBuilder;\n \n /** Utility functions */\n public utils: typeof Utils;\n \n /** Provider instance */\n public provider: Provider;\n \n /** Main contract address */\n public contractAddress: string;\n \n /** Chain ID */\n public chainId?: number;\n\n /**\n * Initialize the SDK\n * @param config - SDK configuration\n */\n constructor(config: SDKConfig) {\n // Validate configuration\n this.validateConfig(config);\n\n // Initialize components\n this.provider = config.provider;\n this.contractAddress = config.contractAddress;\n this.chainId = config.chainId;\n \n this.api = new APIClient(config.apiBaseURL, config.apiKey);\n this.tx = new TransactionBuilder(\n config.provider,\n config.contractAddress,\n config.abi\n );\n this.utils = Utils;\n }\n\n /**\n * Validate SDK configuration\n */\n private validateConfig(config: SDKConfig): void {\n if (!config.apiBaseURL) {\n throw new SDKError(\n 'apiBaseURL is required',\n ErrorType.VALIDATION_ERROR\n );\n }\n\n if (!config.provider) {\n throw new SDKError(\n 'provider is required',\n ErrorType.VALIDATION_ERROR\n );\n }\n\n if (!config.contractAddress) {\n throw new SDKError(\n 'contractAddress is required',\n ErrorType.VALIDATION_ERROR\n );\n }\n\n if (!config.abi || !Array.isArray(config.abi)) {\n throw new SDKError(\n 'abi must be an array',\n ErrorType.VALIDATION_ERROR\n );\n }\n\n // Validate contract address format\n if (!Utils.isValidAddress(config.contractAddress)) {\n throw new SDKError(\n 'Invalid contract address',\n ErrorType.VALIDATION_ERROR\n );\n }\n }\n\n /**\n * Get network information\n */\n async getNetworkInfo(): Promise<{\n name: string;\n chainId: number;\n }> {\n try {\n const network = await this.provider.getNetwork();\n return {\n name: Utils.getNetworkName(Number(network.chainId)),\n chainId: Number(network.chainId),\n };\n } catch (error) {\n throw new SDKError(\n `Failed to get network info: ${error}`,\n ErrorType.NETWORK_ERROR\n );\n }\n }\n\n /**\n * Get current block number\n */\n async getBlockNumber(): Promise<number> {\n try {\n return await this.provider.getBlockNumber();\n } catch (error) {\n throw new SDKError(\n `Failed to get block number: ${error}`,\n ErrorType.NETWORK_ERROR\n );\n }\n }\n\n /**\n * Check if provider is connected\n */\n async isConnected(): Promise<boolean> {\n try {\n await this.provider.getBlockNumber();\n return true;\n } catch {\n return false;\n }\n }\n\n /**\n * Get transaction receipt\n * @param txHash - Transaction hash\n */\n async getTransactionReceipt(txHash: string) {\n try {\n return await this.provider.getTransactionReceipt(txHash);\n } catch (error) {\n throw new SDKError(\n `Failed to get transaction receipt: ${error}`,\n ErrorType.NETWORK_ERROR,\n { txHash }\n );\n }\n }\n\n /**\n * Wait for transaction confirmation\n * @param txHash - Transaction hash\n * @param confirmations - Number of confirmations to wait for\n */\n async waitForTransaction(txHash: string, confirmations: number = 1) {\n return Utils.waitForTransaction(txHash, this.provider, confirmations);\n }\n\n /**\n * Get SDK version\n */\n static getVersion(): string {\n return '1.0.0'; // This should match package.json version\n }\n}\n","/**\n * Network configuration\n */\nexport const NETWORKS = {\n MAINNET: {\n chainId: 1,\n name: 'Ethereum Mainnet',\n rpcUrl: 'https://eth.llamarpc.com',\n },\n GOERLI: {\n chainId: 5,\n name: 'Goerli Testnet',\n rpcUrl: 'https://goerli.infura.io/v3/',\n },\n SEPOLIA: {\n chainId: 11155111,\n name: 'Sepolia Testnet',\n rpcUrl: 'https://sepolia.infura.io/v3/',\n },\n POLYGON: {\n chainId: 137,\n name: 'Polygon Mainnet',\n rpcUrl: 'https://polygon-rpc.com',\n },\n ARBITRUM: {\n chainId: 42161,\n name: 'Arbitrum One',\n rpcUrl: 'https://arb1.arbitrum.io/rpc',\n },\n} as const;\n\n/**\n * API endpoints\n */\nexport const API_ENDPOINTS = {\n MARKET_DATA: '/markets',\n USER_BALANCE: '/balance',\n TRANSACTIONS: '/transactions',\n PRICES: '/prices',\n} as const;\n\n/**\n * Contract method names\n */\nexport const CONTRACT_METHODS = {\n SWAP: 'swap',\n DEPOSIT: 'deposit',\n WITHDRAW: 'withdraw',\n APPROVE: 'approve',\n BALANCE_OF: 'balanceOf',\n ALLOWANCE: 'allowance',\n} as const;\n\n/**\n * Token decimals (common tokens)\n */\nexport const TOKEN_DECIMALS = {\n ETH: 18,\n USDC: 6,\n USDT: 6,\n DAI: 18,\n WBTC: 8,\n} as const;\n\n/**\n * Gas limit estimates for different operations\n */\nexport const GAS_LIMITS = {\n APPROVE: 50000,\n SWAP: 200000,\n DEPOSIT: 150000,\n WITHDRAW: 150000,\n TRANSFER: 21000,\n} as const;\n\n/**\n * Default transaction deadline (20 minutes from now)\n */\nexport const DEFAULT_DEADLINE_MINUTES = 20;\n\n/**\n * Maximum uint256 value for unlimited approvals\n */\nexport const MAX_UINT256 = '0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff';\n\n/**\n * Zero address\n */\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';\n"],"names":[],"mappings":";;;AAuGA;;AAEG;IACS;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,SAAA,CAAA,mBAAA,CAAA,GAAA,mB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