/** * Blockchain Integration Platform Types * Following AI Code Generation Guidelines */ import { SDKConfig } from '@iota-big3/sdk-types'; import { ethers } from 'ethers'; export interface ChainConfig { chainId: number; name: string; shortName: string; network: 'mainnet' | 'testnet' | 'devnet'; nativeCurrency: NativeCurrency; rpcUrls: string[]; blockExplorerUrls: string[]; iconUrl?: string; contracts?: ChainContracts; } export interface NativeCurrency { name: string; symbol: string; decimals: number; } export interface ChainContracts { multicall?: string; ensRegistry?: string; wrappedNative?: string; } export type SupportedChain = 'ethereum' | 'polygon' | 'arbitrum' | 'optimism' | 'avalanche' | 'bnb' | 'solana'; export interface MultiChainProvider { getProvider(chainId: number): ethers.Provider; getSigner(chainId?: number): Promise; switchChain(chainId: number): Promise; getCurrentChain(): number; getSupportedChains(): ChainConfig[]; } export interface SmartContract { address: string; abi: ContractABI; chainId?: number; name?: string; symbol?: string; version?: string; deploymentBlock?: number; deploymentTransaction?: { hash: string; blockNumber: number; }; createdAt?: Date; owner?: string; verified?: boolean; } export interface ABIParameter { name: string; type: string; indexed?: boolean; components?: ABIParameter[]; internalType?: string; } export interface ABIFragment { type: 'function' | 'constructor' | 'event' | 'fallback' | 'receive' | 'error'; name?: string; inputs?: ABIParameter[]; outputs?: ABIParameter[]; stateMutability?: 'pure' | 'view' | 'nonpayable' | 'payable'; anonymous?: boolean; constant?: boolean; payable?: boolean; } export type ContractABI = ABIFragment[]; export interface ContractDeployment { bytecode: string; abi: ContractABI; constructorArgs?: unknown[]; salt?: string; gasLimit?: bigint; value?: bigint; } export interface TransactionRequest { to?: string; from?: string; value?: bigint; data?: string; gasLimit?: bigint; gasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; nonce?: number; chainId?: number; } export interface TransactionReceipt { transactionHash: string; blockNumber: number; blockHash: string; from: string; to?: string; gasUsed: bigint; effectiveGasPrice: bigint; status: 0 | 1; logs: readonly Log[]; contractAddress?: string; } export interface Log { address: string; topics: string[]; data: string; blockNumber: number; transactionHash: string; logIndex: number; } export interface DeFiProtocol { name: string; version: string; chainId: number; contracts: Record; supportedAssets?: Asset[]; } export interface Asset { address: string; symbol: string; name: string; decimals: number; logoUri?: string; priceUSD?: number; } export interface LendingPosition { user: string; supplied: AssetBalance[]; borrowed: AssetBalance[]; healthFactor: number; totalCollateralUSD: number; totalBorrowedUSD: number; availableBorrowsUSD: number; } export interface AssetBalance { asset: Asset; balance: bigint; balanceUSD: number; apy?: number; } export interface SwapQuote { tokenIn: string; tokenOut: string; amountIn: bigint; expectedAmountOut: bigint; minAmountOut: bigint; priceImpact: number; route: SwapRoute[]; gasCost: bigint; } export interface SwapRoute { protocol: string; pool: string; tokenIn: string; tokenOut: string; fee: number; } export interface SwapParams { tokenIn: string; tokenOut: string; amountIn: bigint; minAmountOut: bigint; recipient: string; deadline?: number; slippage?: number; } export interface LiquidityParams { tokenA: string; tokenB: string; amountA: bigint; amountB: bigint; minAmountA?: bigint; minAmountB?: bigint; recipient: string; deadline?: number; } export interface StakingParams { asset: string; amount: bigint; duration?: number; validator?: string; } export interface StakingPosition { asset: string; amount: bigint; rewards: bigint; apy: number; unlockTime?: Date; validator?: string; } export interface NFTMetadata { name: string; description: string; image: string; attributes?: NFTAttribute[]; external_url?: string; animation_url?: string; background_color?: string; } export interface NFTAttribute { trait_type: string; value: string | number; display_type?: 'number' | 'boost_percentage' | 'boost_number' | 'date'; max_value?: number; } export interface NFT { contract: string; tokenId: string; owner: string; metadata?: NFTMetadata; tokenUri?: string; standard: NFTStandard; } export type NFTStandard = 'ERC721' | 'ERC1155' | 'METAPLEX'; export interface NFTCollection { address: string; chainId: number; name: string; symbol: string; standard: NFTStandard; totalSupply?: bigint; owner?: string; royaltyBasisPoints?: number; royaltyRecipient?: string; } export interface MarketplaceListing { id: string; nft: NFT; seller: string; price: bigint; currency: string; startTime: Date; endTime?: Date; status: ListingStatus; } export type ListingStatus = 'active' | 'sold' | 'cancelled' | 'expired'; export interface AuctionParams { startingPrice: bigint; reservePrice?: bigint; duration: number; minBidIncrement?: bigint; } export interface Bid { bidder: string; amount: bigint; timestamp: Date; transactionHash: string; } export interface Web3AuthConfig { providers: WalletProvider[]; message?: string; sessionDuration?: number; domain?: string; } export type WalletProvider = 'metamask' | 'walletconnect' | 'coinbase' | 'phantom' | 'rainbow' | 'trust'; export interface Web3Session { address: string; chainId: number; provider: WalletProvider; nonce: string; signature: string; message: string; createdAt: Date; expiresAt: Date; } export interface SignMessageParams { message: string; address?: string; isEIP712?: boolean; } export interface EIP712Domain { name: string; version: string; chainId: number; verifyingContract?: string; } export interface TransactionConfig { confirmations?: number; timeout?: number; retries?: number; gasStrategy?: GasStrategy; } export type GasStrategy = 'slow' | 'standard' | 'fast' | 'custom'; export interface GasEstimate { gasLimit: bigint; gasPrice?: bigint; maxFeePerGas?: bigint; maxPriorityFeePerGas?: bigint; estimatedCost: bigint; } export interface PendingTransaction { hash: string; chainId: number; from: string; to?: string; value?: bigint; data?: string; nonce: number; submittedAt: Date; confirmations: number; status: TransactionStatus; } export type TransactionStatus = 'pending' | 'confirmed' | 'failed' | 'replaced' | 'dropped'; export interface EventFilter { address: string; event: string; topics?: Array; fromBlock?: number | 'latest' | 'earliest' | string; toBlock?: number | 'latest' | 'pending' | string; } export interface EventListener { id: string; filter: EventFilter; callback: (event: Event) => void | Promise; active?: boolean; } export interface Event { address: string; blockNumber: number; transactionHash: string; transactionIndex: number; blockHash: string; logIndex: number; removed: boolean; id: string; returnValues: Record; event: string; signature: string; raw: { data: string; topics: readonly string[]; }; } export interface IPFSConfig { host: string; port: number; protocol: 'http' | 'https'; apiKey?: string; } export interface StorageProvider { upload(_data: Buffer | string, options?: StorageOptions): Promise; download(cid: string): Promise; pin(cid: string): Promise; unpin(cid: string): Promise; } export interface StorageOptions { filename?: string; contentType?: string; encrypt?: boolean; pin?: boolean; } export interface PriceFeed { asset: string; price: bigint; decimals: number; timestamp: Date; source: string; } export interface OracleProvider { getPrice(asset: string): Promise; getPrices(_assets: string[]): Promise; subscribeToPrice(asset: string, _callback: (_price: PriceFeed) => void): void; } export interface BlockchainError extends Error { code: string; reason?: string; transaction?: TransactionRequest; receipt?: TransactionReceipt; } export interface ValidationResult { isValid: boolean; errors: ValidationError[]; warnings?: string[]; } export interface ValidationError { field: string; message: string; code: string; } export interface BlockInfo { number: number; hash: string; timestamp: Date; miner: string; gasLimit: bigint; gasUsed: bigint; baseFeePerGas?: bigint; transactions: string[]; } export interface AccountInfo { address: string; balance: bigint; nonce: number; code?: string; } export interface BlockchainSDKConfig extends SDKConfig { logLevel?: string; chains?: ChainConfig[]; defaultChainId?: number; providers?: { infura?: string; alchemy?: string; quicknode?: string; custom?: Record; }; ipfs?: IPFSConfig; cache?: { enabled?: boolean; ttl?: number; maxSize?: number; }; security?: { allowedContracts?: string[]; maxGasLimit?: bigint; requireSignatureVerification?: boolean; }; } //# sourceMappingURL=blockchain.types.d.ts.map