@limitless-exchange/sdk 0.0.2 → 0.0.3

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.
package/README.md CHANGED
@@ -117,15 +117,75 @@ const result = await authenticator.authenticate({
117
117
  });
118
118
  ```
119
119
 
120
+ ### Token Approvals
121
+
122
+ **Important**: Before placing orders, you must approve tokens for the exchange contracts. This is a **one-time setup** per wallet.
123
+
124
+ #### Required Approvals
125
+
126
+ **CLOB Markets:**
127
+ - **BUY orders**: Approve USDC → `market.venue.exchange`
128
+ - **SELL orders**: Approve Conditional Tokens → `market.venue.exchange`
129
+
130
+ **NegRisk Markets:**
131
+ - **BUY orders**: Approve USDC → `market.venue.exchange`
132
+ - **SELL orders**: Approve Conditional Tokens → **both** `market.venue.exchange` AND `market.venue.adapter`
133
+
134
+ #### Quick Setup
135
+
136
+ Run the approval setup script:
137
+
138
+ ```bash
139
+ # Copy .env.example and configure your wallet
140
+ cp docs/code-samples/.env.example docs/code-samples/.env
141
+
142
+ # Edit .env and set your PRIVATE_KEY and market slug
143
+ # Then run the approval script
144
+ npx tsx docs/code-samples/setup-approvals.ts
145
+ ```
146
+
147
+ #### Manual Approval Example
148
+
149
+ ```typescript
150
+ import { ethers } from 'ethers';
151
+ import { MarketFetcher, getContractAddress } from '@limitless-exchange/sdk';
152
+
153
+ // 1. Fetch market to get venue addresses
154
+ const market = await marketFetcher.getMarket('market-slug');
155
+
156
+ // 2. Create contract instances
157
+ const usdc = new ethers.Contract(
158
+ getContractAddress('USDC'),
159
+ ['function approve(address spender, uint256 amount) returns (bool)'],
160
+ wallet
161
+ );
162
+
163
+ const ctf = new ethers.Contract(
164
+ getContractAddress('CTF'),
165
+ ['function setApprovalForAll(address operator, bool approved)'],
166
+ wallet
167
+ );
168
+
169
+ // 3. Approve USDC for BUY orders
170
+ await usdc.approve(market.venue.exchange, ethers.MaxUint256);
171
+
172
+ // 4. Approve CT for SELL orders
173
+ await ctf.setApprovalForAll(market.venue.exchange, true);
174
+
175
+ // 5. For NegRisk SELL orders, also approve adapter
176
+ if (market.negRiskRequestId) {
177
+ await ctf.setApprovalForAll(market.venue.adapter, true);
178
+ }
179
+ ```
180
+
181
+ For complete examples, see [docs/code-samples/setup-approvals.ts](./docs/code-samples/setup-approvals.ts).
182
+
120
183
  ### Trading on NegRisk Markets
121
184
 
122
185
  NegRisk markets are group markets with multiple related outcomes. Here's a quick example:
123
186
 
124
187
  ```typescript
125
- import { OrderClient, MarketFetcher, MarketType, Side, OrderType } from '@limitless-exchange/sdk';
126
-
127
- // Set the NegRisk contract address
128
- process.env.NEGRISK_CONTRACT_ADDRESS = '0x5a38afc17F7E97ad8d6C547ddb837E40B4aEDfC6';
188
+ import { OrderClient, MarketFetcher, Side, OrderType } from '@limitless-exchange/sdk';
129
189
 
130
190
  // 1. Fetch NegRisk group market
131
191
  const marketFetcher = new MarketFetcher(httpClient);
@@ -135,7 +195,7 @@ const groupMarket = await marketFetcher.getMarket('largest-company-end-of-2025-1
135
195
  const appleMarket = groupMarket.markets[0];
136
196
  const marketDetails = await marketFetcher.getMarket(appleMarket.slug);
137
197
 
138
- // 3. Create order client for NegRisk
198
+ // 3. Create order client (contract address from venue)
139
199
  const orderClient = new OrderClient({
140
200
  httpClient,
141
201
  wallet,
@@ -143,7 +203,6 @@ const orderClient = new OrderClient({
143
203
  userId: (authResult.profile as any).id,
144
204
  feeRateBps: (authResult.profile as any).rank?.feeRateBps || 300,
145
205
  },
146
- marketType: MarketType.NEGRISK, // Important: Use NEGRISK
147
206
  });
148
207
 
149
208
  // 4. Place order on submarket (not group!)
package/dist/index.d.mts CHANGED
@@ -309,14 +309,6 @@ declare enum OrderType {
309
309
  /** Good-Til-Cancelled: Remain on orderbook until filled or cancelled */
310
310
  GTC = "GTC"
311
311
  }
312
- /**
313
- * Market type enum.
314
- * @public
315
- */
316
- declare enum MarketType {
317
- CLOB = "CLOB",
318
- NEGRISK = "NEGRISK"
319
- }
320
312
  /**
321
313
  * Signature type enum.
322
314
  * @public
@@ -342,11 +334,6 @@ interface BaseOrderArgs {
342
334
  * Order side (BUY or SELL)
343
335
  */
344
336
  side: Side;
345
- /**
346
- * Market type (CLOB or NEGRISK)
347
- * @defaultValue 'CLOB'
348
- */
349
- marketType?: MarketType;
350
337
  /**
351
338
  * Expiration timestamp (0 for no expiration)
352
339
  * @defaultValue '0'
@@ -684,13 +671,9 @@ interface OrderSigningConfig {
684
671
  */
685
672
  chainId: number;
686
673
  /**
687
- * Contract address for verification
674
+ * Contract address for verification (from venue.exchange)
688
675
  */
689
676
  contractAddress: string;
690
- /**
691
- * Market type (CLOB or NEGRISK)
692
- */
693
- marketType: MarketType;
694
677
  }
695
678
 
696
679
  /**
@@ -931,6 +914,35 @@ interface MarketOutcome {
931
914
  */
932
915
  price?: number;
933
916
  }
917
+ /**
918
+ * Venue information for CLOB markets.
919
+ *
920
+ * @remarks
921
+ * Contains contract addresses required for trading:
922
+ * - exchange: Used as verifyingContract for EIP-712 order signing
923
+ * - adapter: Required for NegRisk/Grouped market SELL approvals
924
+ *
925
+ * @public
926
+ */
927
+ interface Venue {
928
+ /**
929
+ * Exchange contract address.
930
+ *
931
+ * @remarks
932
+ * This address is used as the verifyingContract in EIP-712 order signing.
933
+ * All BUY orders require USDC approval to this address.
934
+ * Simple CLOB SELL orders require CT approval to this address.
935
+ */
936
+ exchange: string;
937
+ /**
938
+ * Adapter contract address.
939
+ *
940
+ * @remarks
941
+ * Required for NegRisk/Grouped markets only.
942
+ * SELL orders on NegRisk markets require CT approval to both exchange AND adapter.
943
+ */
944
+ adapter: string;
945
+ }
934
946
  /**
935
947
  * Market token IDs for CLOB markets.
936
948
  * @public
@@ -1063,6 +1075,17 @@ interface Market {
1063
1075
  * Market settings (CLOB only)
1064
1076
  */
1065
1077
  settings?: MarketSettings;
1078
+ /**
1079
+ * Venue information for CLOB markets.
1080
+ *
1081
+ * @remarks
1082
+ * Contains exchange and adapter contract addresses for order signing and approvals.
1083
+ * The exchange address is used as verifyingContract in EIP-712 signatures.
1084
+ *
1085
+ * Performance tip: Call getMarket() before createOrder() to cache venue data
1086
+ * and avoid additional API requests during order creation.
1087
+ */
1088
+ venue?: Venue;
1066
1089
  /**
1067
1090
  * Market logo URL
1068
1091
  */
@@ -2552,22 +2575,34 @@ declare const SIGNING_MESSAGE_TEMPLATE = "Welcome to Limitless.exchange! Please
2552
2575
  declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
2553
2576
  /**
2554
2577
  * Contract addresses by network
2578
+ *
2579
+ * @remarks
2580
+ * Note: CLOB and NegRisk exchange addresses are provided dynamically via the venue system
2581
+ * (market.venue.exchange and market.venue.adapter). These addresses vary per market and
2582
+ * should be fetched from the API rather than hardcoded.
2583
+ *
2555
2584
  * @public
2556
2585
  */
2557
2586
  declare const CONTRACT_ADDRESSES: {
2558
2587
  readonly 8453: {
2559
- readonly CLOB: "0xa4409D988CA2218d956BeEFD3874100F444f0DC3";
2560
- readonly NEGRISK: "0x5a38afc17F7E97ad8d6C547ddb837E40B4aEDfC6";
2588
+ readonly USDC: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
2589
+ readonly CTF: "0xC9c98965297Bc527861c898329Ee280632B76e18";
2561
2590
  };
2562
2591
  readonly 84532: {
2563
- readonly CLOB: "0x...";
2564
- readonly NEGRISK: "0x...";
2592
+ readonly USDC: "0x...";
2593
+ readonly CTF: "0x...";
2565
2594
  };
2566
2595
  };
2567
2596
  /**
2568
- * Get contract address for a specific market type and chain
2597
+ * Get contract address for tokens (USDC or CTF)
2598
+ *
2599
+ * @remarks
2600
+ * For CLOB and NegRisk exchange addresses, use the venue system instead:
2601
+ * - Fetch market via `marketFetcher.getMarket(slug)`
2602
+ * - Use `market.venue.exchange` for signing and approvals
2603
+ * - Use `market.venue.adapter` for NegRisk adapter approvals
2569
2604
  *
2570
- * @param marketType - Market type (CLOB or NEGRISK)
2605
+ * @param contractType - Contract type (USDC or CTF)
2571
2606
  * @param chainId - Chain ID (default: 8453 for Base mainnet)
2572
2607
  * @returns Contract address
2573
2608
  *
@@ -2575,7 +2610,7 @@ declare const CONTRACT_ADDRESSES: {
2575
2610
  *
2576
2611
  * @public
2577
2612
  */
2578
- declare function getContractAddress(marketType: 'CLOB' | 'NEGRISK', chainId?: number): string;
2613
+ declare function getContractAddress(contractType: 'USDC' | 'CTF', chainId?: number): string;
2579
2614
 
2580
2615
  /**
2581
2616
  * Order builder for constructing unsigned order payloads.
@@ -2639,8 +2674,7 @@ declare class OrderBuilder {
2639
2674
  * const fokOrder = builder.buildOrder({
2640
2675
  * tokenId: '123456',
2641
2676
  * makerAmount: 50, // 50 USDC to spend
2642
- * side: Side.BUY,
2643
- * marketType: MarketType.CLOB
2677
+ * side: Side.BUY
2644
2678
  * });
2645
2679
  *
2646
2680
  * // GTC order (price + size)
@@ -2648,8 +2682,7 @@ declare class OrderBuilder {
2648
2682
  * tokenId: '123456',
2649
2683
  * price: 0.38,
2650
2684
  * size: 22.123, // Will be rounded to tick-aligned: 22.123 shares
2651
- * side: Side.BUY,
2652
- * marketType: MarketType.CLOB
2685
+ * side: Side.BUY
2653
2686
  * });
2654
2687
  * ```
2655
2688
  */
@@ -2803,8 +2836,7 @@ declare class OrderSigner {
2803
2836
  * ```typescript
2804
2837
  * const signature = await signer.signOrder(unsignedOrder, {
2805
2838
  * chainId: 8453,
2806
- * contractAddress: '0x...',
2807
- * marketType: MarketType.CLOB
2839
+ * contractAddress: '0x...'
2808
2840
  * });
2809
2841
  * ```
2810
2842
  */
@@ -2891,6 +2923,139 @@ declare function validateUnsignedOrder(order: UnsignedOrder): void;
2891
2923
  */
2892
2924
  declare function validateSignedOrder(order: SignedOrder): void;
2893
2925
 
2926
+ /**
2927
+ * Market data fetcher for Limitless Exchange.
2928
+ * @module markets/fetcher
2929
+ */
2930
+
2931
+ /**
2932
+ * Market data fetcher for retrieving market information and orderbooks.
2933
+ *
2934
+ * @remarks
2935
+ * This class provides methods to fetch market data, orderbooks, and prices
2936
+ * from the Limitless Exchange API.
2937
+ *
2938
+ * Venue caching: When fetching market data, venue information is automatically
2939
+ * cached for efficient order signing. This eliminates redundant API calls when
2940
+ * creating orders for the same market.
2941
+ *
2942
+ * @public
2943
+ */
2944
+ declare class MarketFetcher {
2945
+ private httpClient;
2946
+ private logger;
2947
+ private venueCache;
2948
+ /**
2949
+ * Creates a new market fetcher instance.
2950
+ *
2951
+ * @param httpClient - HTTP client for API requests
2952
+ * @param logger - Optional logger for debugging (default: no logging)
2953
+ *
2954
+ * @example
2955
+ * ```typescript
2956
+ * const fetcher = new MarketFetcher(httpClient);
2957
+ * ```
2958
+ */
2959
+ constructor(httpClient: HttpClient, logger?: ILogger);
2960
+ /**
2961
+ * Gets active markets with query parameters and pagination support.
2962
+ *
2963
+ * @param params - Query parameters for filtering and pagination
2964
+ * @returns Promise resolving to active markets response
2965
+ * @throws Error if API request fails
2966
+ *
2967
+ * @example
2968
+ * ```typescript
2969
+ * // Get 8 markets sorted by LP rewards
2970
+ * const response = await fetcher.getActiveMarkets({
2971
+ * limit: 8,
2972
+ * sortBy: 'lp_rewards'
2973
+ * });
2974
+ * console.log(`Found ${response.data.length} of ${response.totalMarketsCount} markets`);
2975
+ *
2976
+ * // Get page 2
2977
+ * const page2 = await fetcher.getActiveMarkets({
2978
+ * limit: 8,
2979
+ * page: 2,
2980
+ * sortBy: 'ending_soon'
2981
+ * });
2982
+ * ```
2983
+ */
2984
+ getActiveMarkets(params?: ActiveMarketsParams): Promise<ActiveMarketsResponse>;
2985
+ /**
2986
+ * Gets a single market by slug.
2987
+ *
2988
+ * @remarks
2989
+ * Automatically caches venue information for efficient order signing.
2990
+ * Always call this method before creating orders to ensure venue data
2991
+ * is available and avoid additional API requests.
2992
+ *
2993
+ * @param slug - Market slug identifier
2994
+ * @returns Promise resolving to market details
2995
+ * @throws Error if API request fails or market not found
2996
+ *
2997
+ * @example
2998
+ * ```typescript
2999
+ * const market = await fetcher.getMarket('bitcoin-price-2024');
3000
+ * console.log(`Market: ${market.title}`);
3001
+ *
3002
+ * // Venue is now cached for order signing
3003
+ * await orderClient.createOrder({
3004
+ * marketSlug: 'bitcoin-price-2024',
3005
+ * ...
3006
+ * });
3007
+ * ```
3008
+ */
3009
+ getMarket(slug: string): Promise<Market>;
3010
+ /**
3011
+ * Gets cached venue information for a market.
3012
+ *
3013
+ * @remarks
3014
+ * Returns venue data previously cached by getMarket() call.
3015
+ * Used internally by OrderClient for efficient order signing.
3016
+ *
3017
+ * @param slug - Market slug identifier
3018
+ * @returns Cached venue information, or undefined if not in cache
3019
+ *
3020
+ * @example
3021
+ * ```typescript
3022
+ * const venue = fetcher.getVenue('bitcoin-price-2024');
3023
+ * if (venue) {
3024
+ * console.log(`Exchange: ${venue.exchange}`);
3025
+ * }
3026
+ * ```
3027
+ */
3028
+ getVenue(slug: string): Venue | undefined;
3029
+ /**
3030
+ * Gets the orderbook for a CLOB market.
3031
+ *
3032
+ * @param slug - Market slug identifier
3033
+ * @returns Promise resolving to orderbook data
3034
+ * @throws Error if API request fails
3035
+ *
3036
+ * @example
3037
+ * ```typescript
3038
+ * const orderbook = await fetcher.getOrderBook('bitcoin-price-2024');
3039
+ * console.log(`Bids: ${orderbook.bids.length}, Asks: ${orderbook.asks.length}`);
3040
+ * ```
3041
+ */
3042
+ getOrderBook(slug: string): Promise<OrderBook>;
3043
+ /**
3044
+ * Gets the current price for a token.
3045
+ *
3046
+ * @param tokenId - Token ID
3047
+ * @returns Promise resolving to price information
3048
+ * @throws Error if API request fails
3049
+ *
3050
+ * @example
3051
+ * ```typescript
3052
+ * const price = await fetcher.getPrice('123456');
3053
+ * console.log(`Current price: ${price.price}`);
3054
+ * ```
3055
+ */
3056
+ getPrice(tokenId: string): Promise<MarketPrice>;
3057
+ }
3058
+
2894
3059
  /**
2895
3060
  * Order client for managing orders on Limitless Exchange.
2896
3061
  * @module orders/client
@@ -2900,9 +3065,11 @@ declare function validateSignedOrder(order: SignedOrder): void;
2900
3065
  * Configuration for the order client.
2901
3066
  *
2902
3067
  * @remarks
2903
- * The order client supports two configuration modes:
2904
- * 1. Simple mode: Provide userData and marketType (auto-configures signing)
2905
- * 2. Advanced mode: Provide userData and custom signingConfig
3068
+ * The order client auto-configures signing based on venue data from the API.
3069
+ * Custom signingConfig is optional for advanced use cases.
3070
+ *
3071
+ * Performance tip: Provide a shared marketFetcher instance to enable venue caching
3072
+ * across market fetches and order creation, avoiding redundant API calls.
2906
3073
  *
2907
3074
  * @public
2908
3075
  */
@@ -2928,23 +3095,41 @@ interface OrderClientConfig {
2928
3095
  */
2929
3096
  userData: UserData;
2930
3097
  /**
2931
- * Market type for auto-configuration (optional if signingConfig provided)
3098
+ * Custom signing configuration (optional)
2932
3099
  *
2933
3100
  * @remarks
2934
- * When provided without signingConfig, automatically loads contract address
2935
- * from environment variables or SDK defaults.
2936
- *
2937
- * @defaultValue MarketType.CLOB
3101
+ * If not provided, SDK will auto-configure from venue data.
3102
+ * Useful for custom deployments or testing.
2938
3103
  */
2939
- marketType?: MarketType;
3104
+ signingConfig?: OrderSigningConfig;
2940
3105
  /**
2941
- * Custom signing configuration (optional)
3106
+ * Shared MarketFetcher instance for venue caching (optional)
2942
3107
  *
2943
3108
  * @remarks
2944
- * If not provided, SDK will auto-configure based on marketType.
2945
- * Useful for custom deployments or testing.
3109
+ * When provided, enables efficient venue caching across market fetches and order creation.
3110
+ * If not provided, OrderClient creates its own internal MarketFetcher instance.
3111
+ *
3112
+ * Best practice: Share the same MarketFetcher instance between market operations
3113
+ * and order creation for optimal performance.
3114
+ *
3115
+ * @example
3116
+ * ```typescript
3117
+ * const marketFetcher = new MarketFetcher(httpClient);
3118
+ * const orderClient = new OrderClient({
3119
+ * httpClient,
3120
+ * wallet,
3121
+ * userData,
3122
+ * marketFetcher // Shared instance
3123
+ * });
3124
+ *
3125
+ * // Venue is cached
3126
+ * await marketFetcher.getMarket('bitcoin-2024');
3127
+ *
3128
+ * // Uses cached venue, no extra API call
3129
+ * await orderClient.createOrder({ marketSlug: 'bitcoin-2024', ... });
3130
+ * ```
2946
3131
  */
2947
- signingConfig?: OrderSigningConfig;
3132
+ marketFetcher?: MarketFetcher;
2948
3133
  /**
2949
3134
  * Optional logger
2950
3135
  */
@@ -2957,17 +3142,21 @@ interface OrderClientConfig {
2957
3142
  * This class provides high-level methods for order operations,
2958
3143
  * abstracting away HTTP details and order signing complexity.
2959
3144
  *
3145
+ * Uses dynamic venue addressing for EIP-712 order signing. For best performance,
3146
+ * always call marketFetcher.getMarket() before creating orders to cache venue data.
3147
+ *
2960
3148
  * @example
2961
3149
  * ```typescript
2962
3150
  * const orderClient = new OrderClient({
2963
3151
  * httpClient,
2964
3152
  * wallet,
2965
- * ownerId: 123,
2966
- * feeRateBps: 100,
3153
+ * userData: {
3154
+ * userId: 123,
3155
+ * feeRateBps: 100
3156
+ * },
2967
3157
  * signingConfig: {
2968
3158
  * chainId: 8453,
2969
- * contractAddress: '0x...',
2970
- * marketType: MarketType.CLOB
3159
+ * contractAddress: '0x...'
2971
3160
  * }
2972
3161
  * });
2973
3162
  *
@@ -2987,6 +3176,7 @@ declare class OrderClient {
2987
3176
  private httpClient;
2988
3177
  private orderBuilder;
2989
3178
  private orderSigner;
3179
+ private marketFetcher;
2990
3180
  private ownerId;
2991
3181
  private signingConfig;
2992
3182
  private logger;
@@ -2994,8 +3184,6 @@ declare class OrderClient {
2994
3184
  * Creates a new order client instance.
2995
3185
  *
2996
3186
  * @param config - Order client configuration
2997
- *
2998
- * @throws Error if neither marketType nor signingConfig is provided
2999
3187
  */
3000
3188
  constructor(config: OrderClientConfig);
3001
3189
  /**
@@ -3003,24 +3191,31 @@ declare class OrderClient {
3003
3191
  *
3004
3192
  * @remarks
3005
3193
  * This method handles the complete order creation flow:
3006
- * 1. Build unsigned order
3007
- * 2. Sign with EIP-712
3008
- * 3. Submit to API
3194
+ * 1. Resolve venue address (from cache or API)
3195
+ * 2. Build unsigned order
3196
+ * 3. Sign with EIP-712 using venue.exchange as verifyingContract
3197
+ * 4. Submit to API
3198
+ *
3199
+ * Performance best practice: Always call marketFetcher.getMarket(marketSlug)
3200
+ * before createOrder() to cache venue data and avoid additional API requests.
3009
3201
  *
3010
3202
  * @param params - Order parameters
3011
3203
  * @returns Promise resolving to order response
3012
3204
  *
3013
- * @throws Error if order creation fails
3205
+ * @throws Error if order creation fails or venue not found
3014
3206
  *
3015
3207
  * @example
3016
3208
  * ```typescript
3209
+ * // Best practice: fetch market first to cache venue
3210
+ * const market = await marketFetcher.getMarket('bitcoin-2024');
3211
+ *
3017
3212
  * const order = await orderClient.createOrder({
3018
- * tokenId: '123456',
3213
+ * tokenId: market.tokens.yes,
3019
3214
  * price: 0.65,
3020
3215
  * size: 100,
3021
3216
  * side: Side.BUY,
3022
3217
  * orderType: OrderType.GTC,
3023
- * marketSlug: 'market-slug'
3218
+ * marketSlug: 'bitcoin-2024'
3024
3219
  * });
3025
3220
  *
3026
3221
  * console.log(`Order created: ${order.order.id}`);
@@ -3131,104 +3326,6 @@ declare class OrderClient {
3131
3326
  signOrder(order: UnsignedOrder): Promise<string>;
3132
3327
  }
3133
3328
 
3134
- /**
3135
- * Market data fetcher for Limitless Exchange.
3136
- * @module markets/fetcher
3137
- */
3138
-
3139
- /**
3140
- * Market data fetcher for retrieving market information and orderbooks.
3141
- *
3142
- * @remarks
3143
- * This class provides methods to fetch market data, orderbooks, and prices
3144
- * from the Limitless Exchange API.
3145
- *
3146
- * @public
3147
- */
3148
- declare class MarketFetcher {
3149
- private httpClient;
3150
- private logger;
3151
- /**
3152
- * Creates a new market fetcher instance.
3153
- *
3154
- * @param httpClient - HTTP client for API requests
3155
- * @param logger - Optional logger for debugging (default: no logging)
3156
- *
3157
- * @example
3158
- * ```typescript
3159
- * const fetcher = new MarketFetcher(httpClient);
3160
- * ```
3161
- */
3162
- constructor(httpClient: HttpClient, logger?: ILogger);
3163
- /**
3164
- * Gets active markets with query parameters and pagination support.
3165
- *
3166
- * @param params - Query parameters for filtering and pagination
3167
- * @returns Promise resolving to active markets response
3168
- * @throws Error if API request fails
3169
- *
3170
- * @example
3171
- * ```typescript
3172
- * // Get 8 markets sorted by LP rewards
3173
- * const response = await fetcher.getActiveMarkets({
3174
- * limit: 8,
3175
- * sortBy: 'lp_rewards'
3176
- * });
3177
- * console.log(`Found ${response.data.length} of ${response.totalMarketsCount} markets`);
3178
- *
3179
- * // Get page 2
3180
- * const page2 = await fetcher.getActiveMarkets({
3181
- * limit: 8,
3182
- * page: 2,
3183
- * sortBy: 'ending_soon'
3184
- * });
3185
- * ```
3186
- */
3187
- getActiveMarkets(params?: ActiveMarketsParams): Promise<ActiveMarketsResponse>;
3188
- /**
3189
- * Gets a single market by slug.
3190
- *
3191
- * @param slug - Market slug identifier
3192
- * @returns Promise resolving to market details
3193
- * @throws Error if API request fails or market not found
3194
- *
3195
- * @example
3196
- * ```typescript
3197
- * const market = await fetcher.getMarket('bitcoin-price-2024');
3198
- * console.log(`Market: ${market.title}`);
3199
- * ```
3200
- */
3201
- getMarket(slug: string): Promise<Market>;
3202
- /**
3203
- * Gets the orderbook for a CLOB market.
3204
- *
3205
- * @param slug - Market slug identifier
3206
- * @returns Promise resolving to orderbook data
3207
- * @throws Error if API request fails
3208
- *
3209
- * @example
3210
- * ```typescript
3211
- * const orderbook = await fetcher.getOrderBook('bitcoin-price-2024');
3212
- * console.log(`Bids: ${orderbook.bids.length}, Asks: ${orderbook.asks.length}`);
3213
- * ```
3214
- */
3215
- getOrderBook(slug: string): Promise<OrderBook>;
3216
- /**
3217
- * Gets the current price for a token.
3218
- *
3219
- * @param tokenId - Token ID
3220
- * @returns Promise resolving to price information
3221
- * @throws Error if API request fails
3222
- *
3223
- * @example
3224
- * ```typescript
3225
- * const price = await fetcher.getPrice('123456');
3226
- * console.log(`Current price: ${price.price}`);
3227
- * ```
3228
- */
3229
- getPrice(tokenId: string): Promise<MarketPrice>;
3230
- }
3231
-
3232
3329
  /**
3233
3330
  * Portfolio data fetcher for Limitless Exchange.
3234
3331
  * @module portfolio/fetcher
@@ -3550,4 +3647,4 @@ declare class WebSocketClient {
3550
3647
  private getChannelFromKey;
3551
3648
  }
3552
3649
 
3553
- export { type AMMPosition, APIError, type ActiveMarketsParams, type ActiveMarketsResponse, type ActiveMarketsSortBy, type AmmPriceEntry, type AuthResult, AuthenticatedClient, type AuthenticatedClientConfig, Authenticator, BASE_SEPOLIA_CHAIN_ID, type BaseOrderArgs, type CLOBPosition, CONTRACT_ADDRESSES, type ClientType, type CollateralToken, ConsoleLogger, type CreatedOrder, DEFAULT_API_URL, DEFAULT_CHAIN_ID, DEFAULT_WS_URL, type FOKOrderArgs, type FillEvent, type GTCOrderArgs, HttpClient, type HttpClientConfig, type ILogger, type LatestTrade, type LoginOptions, type Market, type MarketCreator, MarketFetcher, type MarketMetadata, type MarketOutcome, type MarketPrice, type MarketSettings, type MarketTokens, MarketType, type MarketUpdate, type MarketsResponse, MessageSigner, type ModeInfo, type NewOrderPayload, type NewPriceData, NoOpLogger, type OrderArgs, type OrderBook, OrderBuilder, OrderClient, type OrderClientConfig, type OrderMatch, type OrderResponse, OrderSigner, type OrderSigningConfig, OrderType, type OrderUpdate, type OrderbookData, type OrderbookEntry, type OrderbookUpdate, PortfolioFetcher, type PortfolioPositionsResponse, type PortfolioSummary, type Position, type PositionMarket, type PositionSide, type PriceOracleMetadata, type PriceUpdate, type ReferralData, RetryConfig, type RetryConfigOptions, RetryableClient, SIGNING_MESSAGE_TEMPLATE, Side, type SignatureHeaders, SignatureType, type SignedOrder, type SubscriptionChannel, type SubscriptionOptions, type TokenBalance, type TradeEvent, type TradePrices, type TradingMode, type TransactionEvent, type UnsignedOrder, type UserData, type UserProfile, type UserRank, ValidationError, WebSocketClient, type WebSocketConfig, type WebSocketEvents, WebSocketState, ZERO_ADDRESS, getContractAddress, retryOnErrors, validateOrderArgs, validateSignedOrder, validateUnsignedOrder, withRetry };
3650
+ export { type AMMPosition, APIError, type ActiveMarketsParams, type ActiveMarketsResponse, type ActiveMarketsSortBy, type AmmPriceEntry, type AuthResult, AuthenticatedClient, type AuthenticatedClientConfig, Authenticator, BASE_SEPOLIA_CHAIN_ID, type BaseOrderArgs, type CLOBPosition, CONTRACT_ADDRESSES, type ClientType, type CollateralToken, ConsoleLogger, type CreatedOrder, DEFAULT_API_URL, DEFAULT_CHAIN_ID, DEFAULT_WS_URL, type FOKOrderArgs, type FillEvent, type GTCOrderArgs, HttpClient, type HttpClientConfig, type ILogger, type LatestTrade, type LoginOptions, type Market, type MarketCreator, MarketFetcher, type MarketMetadata, type MarketOutcome, type MarketPrice, type MarketSettings, type MarketTokens, type MarketUpdate, type MarketsResponse, MessageSigner, type ModeInfo, type NewOrderPayload, type NewPriceData, NoOpLogger, type OrderArgs, type OrderBook, OrderBuilder, OrderClient, type OrderClientConfig, type OrderMatch, type OrderResponse, OrderSigner, type OrderSigningConfig, OrderType, type OrderUpdate, type OrderbookData, type OrderbookEntry, type OrderbookUpdate, PortfolioFetcher, type PortfolioPositionsResponse, type PortfolioSummary, type Position, type PositionMarket, type PositionSide, type PriceOracleMetadata, type PriceUpdate, type ReferralData, RetryConfig, type RetryConfigOptions, RetryableClient, SIGNING_MESSAGE_TEMPLATE, Side, type SignatureHeaders, SignatureType, type SignedOrder, type SubscriptionChannel, type SubscriptionOptions, type TokenBalance, type TradeEvent, type TradePrices, type TradingMode, type TransactionEvent, type UnsignedOrder, type UserData, type UserProfile, type UserRank, ValidationError, type Venue, WebSocketClient, type WebSocketConfig, type WebSocketEvents, WebSocketState, ZERO_ADDRESS, getContractAddress, retryOnErrors, validateOrderArgs, validateSignedOrder, validateUnsignedOrder, withRetry };