export { createGraphQLClient, graphqlRequest, typedGraphqlRequest, useMarket } from './queries/index.mjs'; export { CategoryType, ChartType, LineType, Query, TimeInterval, TimeWindow } from './types/index.mjs'; export { collateralTokenAbi, liquidityVaultAbi, lzResolverAbi, lzResolverUmaSideAbi, predictionMarketAbi, umaResolverAbi } from './abis/index.mjs'; export { CHAIN_ID_ARBITRUM, CHAIN_ID_ETHEREAL, CHAIN_ID_ETHEREAL_TESTNET, COLLATERAL_SYMBOLS, DEFAULT_CHAIN_ID } from './constants/index.mjs'; export { ChainAddressMap, ChainId, ContractAddressEntry, collateralToken, contracts, eas, lzPMResolver, lzUmaResolver, passiveLiquidityVault, predictionMarket, pythResolver, umaResolver } from './contracts/index.mjs'; export { JsonRpcRequest, JsonRpcResponse, McpClient, createMcpClient } from './mcp/client.mjs'; import { Address, Chain, PublicClient, Transport, WalletClient, Account } from 'viem'; export { AuctionRequestPayload, AuctionStartLike, AuctionStartSigningPayload, buildMakerBidTypedData, createAuctionStartSiweMessage, extractSiweDomainAndUri, signMakerBid } from './auction/signing.mjs'; export { PythBinaryOptionMarket, PythBinaryOptionOutcome, UmaPredictedOutcome, encodePythBinaryOptionOutcomes, encodeUmaPredictedOutcomes, getPythMarketId } from './auction/encoding.mjs'; export { createAuctionWs } from './relayer/auctionWs.mjs'; import 'graphql-request'; import 'abitype'; import 'ws'; type Hex$3 = `0x${string}`; declare function simulateTransaction(args: { rpc: string; tx: { to: Hex$3; data?: Hex$3; value?: bigint | string; }; }): Promise<{ result: any; }>; declare function submitTransaction(args: { rpc: string; privateKey?: Hex$3; account?: any; tx: { to: Hex$3; data?: Hex$3; value?: bigint | string; }; }): Promise<{ hash: Hex$3; }>; type Hex$2 = `0x${string}`; type AttestationCalldata = { to: Address; data: Hex$2; value: string; chainId: number; description: string; }; /** * Decode probability from D18 format * D18 means 18 decimal places, so 50 * 10^18 = 50% */ declare function decodeProbabilityFromD18(value: string): number | null; declare function buildAttestationCalldata(prediction: { probability: number; reasoning: string; confidence: number; }, chainId?: number, resolver?: Address, condition?: Hex$2): Promise; type Hex$1 = `0x${string}`; /** Probability value constrained to 0-100 */ type Probability = number & { readonly __brand: 'Probability'; }; /** Create a validated Probability value (0-100) */ declare function probability(value: number): Probability; type ForecastCalldata = { to: Address; data: Hex$1; value: '0'; chainId: 42161; }; /** * Build calldata for submitting a forecast attestation to Arbitrum EAS. * * @param resolver - The resolver contract address * @param condition - The condition data (bytes) * @param probability - Probability 0-100 that the condition resolves YES * @param comment - Optional comment/reasoning (max 180 chars, will be truncated) */ declare function buildForecastCalldata(resolver: Address, condition: Hex$1, prob: number, comment?: string): ForecastCalldata; /** * Submit a forecast attestation to Arbitrum EAS. * * This is the main entry point for agents to submit forecasts. * Always submits to Arbitrum mainnet. * * @param resolver - The resolver contract address * @param condition - The condition data (bytes) * @param probability - Probability 0-100 that the condition resolves YES * @param comment - Optional comment/reasoning (max 180 chars) * @param privateKey - Wallet private key for signing * @param rpc - Arbitrum RPC URL (defaults to public endpoint) * * @example * ```ts * const { hash } = await submitForecast({ * resolver: '0x1234...abcd', * condition: '0x...', * probability: 75, * comment: 'High confidence based on recent polling data', * privateKey: '0x...', * }); * ``` */ declare function submitForecast(args: { resolver: Address; condition: Hex$1; probability: number; comment?: string; privateKey: Hex$1; rpc?: string; }): Promise<{ hash: Hex$1; calldata: ForecastCalldata; }>; type Hex = `0x${string}`; declare const tradingChain: Chain; declare const TRADING_RPC_URL = "https://rpc.ethereal.trade"; declare const WUSDE_ADDRESS: Hex; /** * Create a public client for the trading chain */ declare function createTradingPublicClient(rpcUrl?: string): PublicClient; /** * Create a wallet client for the trading chain */ declare function createTradingWalletClient(privateKey: Hex, rpcUrl?: string): WalletClient; /** * Get WUSDe (wrapped collateral) balance for an address */ declare function getWUSDEBalance(address: Hex, rpcUrl?: string): Promise; /** * Get native USDe balance for an address */ declare function getUSDEBalance(address: Hex, rpcUrl?: string): Promise; /** * Wrap native USDe into WUSDe (required before trading) * @returns Transaction hash */ declare function wrapUSDe(args: { privateKey: Hex; amount: bigint; rpcUrl?: string; }): Promise<{ hash: Hex; }>; /** * Unwrap WUSDe back to native USDe * @returns Transaction hash */ declare function unwrapUSDe(args: { privateKey: Hex; amount: bigint; rpcUrl?: string; }): Promise<{ hash: Hex; }>; /** * Get the current WUSDe allowance for a spender */ declare function getWUSDEAllowance(args: { owner: Hex; spender: Hex; rpcUrl?: string; }): Promise; /** * Complete preparation for trading: wraps USDe to WUSDe and approves for spending. * * This function optimizes wrapping by only converting the additional USDe needed: * 1. Check existing WUSDe balance and only wrap the difference needed * 2. Check allowance and approve only if insufficient * 3. Execute transactions sequentially, waiting for each to confirm * * On Ethereal chain, native token is USDe but contracts expect WUSDe (Wrapped USDe). * This function handles the wrapping and approval automatically. * * @example * ```ts * const { ready, wrapTxHash, approvalTxHash } = await prepareForTrade({ * privateKey: '0x...', * collateralAmount: parseEther('10'), * }); * if (ready) { * // Execute trade mint... * } * ``` */ declare function prepareForTrade(args: { privateKey: Hex; collateralAmount: bigint; spender?: Hex; rpcUrl?: string; }): Promise<{ ready: boolean; wrapTxHash?: Hex; approvalTxHash?: Hex; wusdBalance: bigint; }>; export { type AttestationCalldata, type ForecastCalldata, type Probability, TRADING_RPC_URL, WUSDE_ADDRESS, buildAttestationCalldata, buildForecastCalldata, createTradingPublicClient, createTradingWalletClient, decodeProbabilityFromD18, getUSDEBalance, getWUSDEAllowance, getWUSDEBalance, prepareForTrade, probability, simulateTransaction, submitForecast, submitTransaction, tradingChain, unwrapUSDe, wrapUSDe };