@polymarket/client 0.4.0 → 0.6.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.
@@ -1,5 +1,5 @@
1
1
  import * as _polymarket_bindings from '@polymarket/bindings';
2
- import { PaginationCursor, DecimalString, OrderSide, OrderType, TokenId, BuilderCode, TxHash, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue, PositionId, TransactionId } from '@polymarket/bindings';
2
+ import { PaginationCursor, DecimalString, BuilderCode, OrderSide, PositionId, EpochMilliseconds, TxHash, OrderType, TokenId, EvmAddress as EvmAddress$1, ConditionId, TickSizeValue, TransactionId } from '@polymarket/bindings';
3
3
  import { PolymarketError, HexString, EvmAddress, EvmSignature, NonEmptyArray, Prettify, Erc1271Signature, TxHash as TxHash$1 } from '@polymarket/types';
4
4
  import { WalletType, Event, TagReference, Market, Series, MarketClarification, Tag, RelatedTag, SportsMetadata, SportsMarketTypesResponse, Team, PublicProfile, Comment, MarketClarificationState, Profile, SearchTag } from '@polymarket/bindings/gamma';
5
5
  import { RelayerTransactionType, RelayerExecuteParams, GaslessTransaction } from '@polymarket/bindings/relayer';
@@ -9,8 +9,8 @@ import { ClobTrade, NotificationsResponse, BuilderTrade, Midpoints, Prices, Orde
9
9
  import * as _polymarket_bindings_data from '@polymarket/bindings/data';
10
10
  import { Activity, ComboActivity, Trade, Value, Traded, ClosedPosition, ComboPosition, Position, MetaMarketPosition, LeaderboardEntry, BuilderVolumeEntry, TraderLeaderboardEntry, LiveVolume, OpenInterest, MetaHolder } from '@polymarket/bindings/data';
11
11
  import * as _polymarket_bindings_combos from '@polymarket/bindings/combos';
12
- import { ComboMarket, RfqQuoteRequest, RfqRequestedSize, RfqSide, RfqQuoteAck, RfqConfirmationRequest, RfqConfirmationAck as RfqConfirmationAck$1, RfqExecutionUpdate, RfqTrade, RfqQuoteCancelAck, RfqErrorCode, RfqId, RfqQuoteId, CollateralReturnPlanResponse } from '@polymarket/bindings/combos';
13
- import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId, PerpsSortDirection, PerpsDepositStatus, PerpsWithdrawalStatus, PerpsPnlInterval, PerpsDecimalInput, PerpsTimeInForce, PerpsCredentials, PerpsBalance, PerpsPortfolio, PerpsAccountStats, PerpsAccountConfig, PerpsOrder, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsNotificationEntry, PerpsOrderId, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsUpdateLeverageResult, PerpsInstrumentCategory, PerpsKlineInterval } from '@polymarket/bindings/perps';
12
+ import { ComboMarket, RfqRejectionCode, RfqQuoteId, RfqId, ComboAcceptFailureReason, BuilderRfqError, RfqQuoteRequest, RfqRequestedSize, RfqSide, RfqQuoteAck, RfqConfirmationRequest, RfqConfirmationAck as RfqConfirmationAck$1, RfqExecutionUpdate, RfqTrade, RfqQuoteCancelAck, ComboQuoteUnavailableReason, RfqStatus, RfqErrorCode, BuilderRfqStatusResponse, CollateralReturnPlanResponse } from '@polymarket/bindings/combos';
13
+ import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId, PerpsSortDirection, PerpsDepositStatus, PerpsWithdrawalStatus, PerpsPnlInterval, PerpsDecimalInput, PerpsTimeInForce, PerpsOrder, PerpsOrderId, PerpsCredentials, PerpsBalance, PerpsPortfolio, PerpsAccountStats, PerpsAccountConfig, PerpsAutoCancelStatus, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsNotificationEntry, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsUpdateLeverageResult, PerpsInstrumentCategory, PerpsKlineInterval } from '@polymarket/bindings/perps';
14
14
  import { PerpsSessionEvent, CommentsEvent, CryptoPricesTopic, CryptoPricesChainlinkTwapTopic, CryptoPricesChainlinkTwapWindowSeconds, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, CryptoPricesChainlinkTwapThirtyEvent, CryptoPricesChainlinkTwapSixtyEvent, CryptoPricesChainlinkTwapEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, PerpsTradeEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsTickerEvent, PerpsStatisticEvent, CryptoPricesEvent, PerpsMarketDataEvent } from '@polymarket/bindings/subscriptions';
15
15
  import { Hex } from 'ox';
16
16
 
@@ -89,6 +89,11 @@ declare class ConnectionLostError extends PolymarketError {
89
89
  }
90
90
  type RequestRejectedErrorOptions = {
91
91
  status: number;
92
+ /**
93
+ * Machine-readable error code from the response body, when the service
94
+ * provided one.
95
+ */
96
+ code?: string;
92
97
  /**
93
98
  * Server-requested delay in seconds before retrying, when the response
94
99
  * provided one.
@@ -102,6 +107,11 @@ type RequestRejectedErrorOptions = {
102
107
  declare class RequestRejectedError extends PolymarketError {
103
108
  name: "RequestRejectedError";
104
109
  readonly status: number;
110
+ /**
111
+ * Machine-readable error code from the response body, when the service
112
+ * provided one.
113
+ */
114
+ readonly code?: string;
105
115
  /**
106
116
  * Server-requested delay in seconds before retrying, when the response
107
117
  * provided one.
@@ -159,6 +169,18 @@ declare class InsufficientLiquidityError extends PolymarketError {
159
169
  name: "InsufficientLiquidityError";
160
170
  constructor(message: string, options?: ErrorOptions);
161
171
  }
172
+ /**
173
+ * Error thrown when arming auto-cancel is rejected because the account has
174
+ * reached its daily auto-cancel trigger limit. Arming is rejected until the
175
+ * daily counter resets at the next UTC midnight; clearing an existing
176
+ * schedule is always allowed.
177
+ *
178
+ * @experimental This API may change in a breaking way in any release, including patch releases.
179
+ */
180
+ declare class AutoCancelDailyLimitError extends PolymarketError {
181
+ name: "AutoCancelDailyLimitError";
182
+ constructor(message: string, options?: ErrorOptions);
183
+ }
162
184
  /**
163
185
  * Error thrown when the SDK cannot produce a required signature or
164
186
  * authentication payload.
@@ -1455,24 +1477,33 @@ type DataActions = {
1455
1477
  /**
1456
1478
  * Fetches the last traded price for a token.
1457
1479
  *
1480
+ * Returns `null` when the token has not traded.
1481
+ *
1458
1482
  * @throws {@link FetchLastTradePriceError}
1459
1483
  * Thrown on failure.
1460
1484
  *
1461
1485
  * @example
1462
1486
  * ```ts
1463
- * const price = await client.fetchLastTradePrice({ tokenId: '123' });
1487
+ * const trade = await client.fetchLastTradePrice({ tokenId: '123' });
1488
+ *
1489
+ * // trade === LastTradePrice | null
1464
1490
  * ```
1465
1491
  */
1466
- fetchLastTradePrice(request: FetchLastTradePriceRequest): Promise<LastTradePrice>;
1492
+ fetchLastTradePrice(request: FetchLastTradePriceRequest): Promise<LastTradePrice | null>;
1467
1493
  /**
1468
1494
  * Fetches last traded prices for multiple tokens.
1469
1495
  *
1496
+ * Tokens without trades are omitted from the response. Match returned rows by
1497
+ * `tokenId`; the array is not positionally aligned with the request.
1498
+ *
1470
1499
  * @throws {@link FetchLastTradePricesError}
1471
1500
  * Thrown on failure.
1472
1501
  *
1473
1502
  * @example
1474
1503
  * ```ts
1475
- * const prices = await client.fetchLastTradePrices([{ tokenId: '123' }]);
1504
+ * const tokenId = '123';
1505
+ * const trades = await client.fetchLastTradePrices([{ tokenId }]);
1506
+ * const trade = trades.find((candidate) => candidate.tokenId === tokenId);
1476
1507
  * ```
1477
1508
  */
1478
1509
  fetchLastTradePrices(request: FetchLastTradePricesRequest): Promise<LastTradePriceForToken[]>;
@@ -2740,6 +2771,338 @@ declare const OpenRfqSessionError: {
2740
2771
  * Thrown on failure.
2741
2772
  */
2742
2773
  declare function openRfqSession(client: BaseSecureClient): Promise<RfqSession>;
2774
+ type RfqRequestRejectedErrorOptions = {
2775
+ /** HTTP status of the rejection. */
2776
+ status: number;
2777
+ /** Classified rejection reason. */
2778
+ code: RfqRejectionCode;
2779
+ };
2780
+ /**
2781
+ * Error thrown when an RFQ request or acceptance is rejected.
2782
+ *
2783
+ * @remarks
2784
+ * Inspect {@link RfqRequestRejectedError.code} to distinguish permanent input
2785
+ * problems (`INVALID_RFQ`, `CONTRADICTORY_LEGS`) from transient conditions
2786
+ * (`LEG_METADATA_UNAVAILABLE`) that may be retried.
2787
+ *
2788
+ * Wire codes not recognized by this SDK version map to
2789
+ * {@link RfqRejectionCode.RequestFailed}; the original error is preserved on
2790
+ * `cause`.
2791
+ */
2792
+ declare class RfqRequestRejectedError extends PolymarketError {
2793
+ name: "RfqRequestRejectedError";
2794
+ /** HTTP status of the rejection. */
2795
+ readonly status: number;
2796
+ /** Classified rejection reason. */
2797
+ readonly code: RfqRejectionCode;
2798
+ constructor(message: string, options: ErrorOptions & RfqRequestRejectedErrorOptions);
2799
+ }
2800
+ type ComboQuoteFields = {
2801
+ /** RFQ identifier. */
2802
+ rfqId: RfqId;
2803
+ /** Winning quote identifier. */
2804
+ quoteId: RfqQuoteId;
2805
+ /** Builder code attached to the signed acceptance order. */
2806
+ builderCode: BuilderCode;
2807
+ /** Combo YES position traded by the acceptance order. */
2808
+ positionId: PositionId;
2809
+ /** Signed-order collateral for BUY, or position shares for SELL. */
2810
+ makerAmount: DecimalString;
2811
+ /** Signed-order shares for BUY, or gross collateral limit for SELL. */
2812
+ takerAmount: DecimalString;
2813
+ /** Blended price across legs, in collateral per outcome token. */
2814
+ blendedPrice: DecimalString;
2815
+ /** Total collateral including fees for BUY, or position shares for SELL. */
2816
+ totalRequired: DecimalString;
2817
+ /** Acceptance deadline (Unix ms). */
2818
+ expiresAt: EpochMilliseconds;
2819
+ };
2820
+ /**
2821
+ * A self-contained winning combo quote.
2822
+ *
2823
+ * @remarks
2824
+ * The quote is plain JSON data and carries every input needed to accept it.
2825
+ * It may be persisted or routed between processes before being passed to
2826
+ * {@link acceptComboQuote}.
2827
+ */
2828
+ type ComboQuote = ComboQuoteFields & ({
2829
+ /** Trade direction of the original request. */
2830
+ direction: OrderSide.BUY;
2831
+ /** Net proceeds apply only to SELL quotes. */
2832
+ netReceive?: undefined;
2833
+ } | {
2834
+ /** Trade direction of the original request. */
2835
+ direction: OrderSide.SELL;
2836
+ /** Exact collateral proceeds for the quoted bundle after fees. */
2837
+ netReceive: DecimalString;
2838
+ });
2839
+ type RequestComboQuoteParams = {
2840
+ /** Position IDs of the combo legs. Between 2 and 50, no duplicates. */
2841
+ legPositionIds: string[];
2842
+ /**
2843
+ * Combinatorial position side. Only `YES` is currently supported.
2844
+ *
2845
+ * @defaultValue {@link RfqSide.Yes}
2846
+ */
2847
+ side?: RfqSide.Yes;
2848
+ } & ({
2849
+ direction: OrderSide.BUY;
2850
+ /**
2851
+ * Collateral to spend, in USDC, including fees.
2852
+ *
2853
+ * This is the human-readable amount: `1` means one dollar, not one
2854
+ * 6-decimal base unit.
2855
+ */
2856
+ amount: number | string;
2857
+ } | {
2858
+ direction: OrderSide.SELL;
2859
+ /**
2860
+ * Size to sell, in outcome tokens.
2861
+ *
2862
+ * This is the human-readable token amount: `1` means one full share,
2863
+ * not one 6-decimal base unit.
2864
+ */
2865
+ size: number | string;
2866
+ });
2867
+ type RequestComboQuoteResult = {
2868
+ rfqId: RfqId;
2869
+ /** The winning quote. */
2870
+ quote: ComboQuote;
2871
+ } | {
2872
+ rfqId: RfqId;
2873
+ /** No usable quote was returned. */
2874
+ quote: null;
2875
+ reason: ComboQuoteUnavailableReason;
2876
+ };
2877
+ type RequestComboQuoteError = RateLimitError | RfqRequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
2878
+ declare const RequestComboQuoteError: {
2879
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RateLimitError | RfqRequestRejectedError;
2880
+ };
2881
+ /**
2882
+ * Requests a quote for a combo of positions.
2883
+ *
2884
+ * @remarks
2885
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2886
+ *
2887
+ * Resolves when the quote competition window closes. A request that attracts
2888
+ * no usable quotes is a normal outcome, returned as `quote: null` with a
2889
+ * reason rather than thrown.
2890
+ *
2891
+ * A winning quote is self-contained JSON data and may be persisted or routed
2892
+ * to another process before acceptance.
2893
+ *
2894
+ * @throws {@link RequestComboQuoteError}
2895
+ * Thrown on failure.
2896
+ *
2897
+ * @example
2898
+ * ```ts
2899
+ * const result = await requestComboQuote(client, {
2900
+ * legPositionIds: ['123', '456'],
2901
+ * direction: OrderSide.BUY,
2902
+ * amount: 100,
2903
+ * });
2904
+ *
2905
+ * if (result.quote !== null) {
2906
+ * // result.quote.blendedPrice: DecimalString
2907
+ * // result.quote.totalRequired: DecimalString
2908
+ * // SELL quotes also carry result.quote.netReceive after fees.
2909
+ * }
2910
+ * ```
2911
+ */
2912
+ declare function requestComboQuote(client: BaseSecureClient, params: RequestComboQuoteParams): Promise<RequestComboQuoteResult>;
2913
+ declare const AcceptComboQuoteParamsSchema: z.ZodObject<{
2914
+ blendedPrice: z.ZodString;
2915
+ builderCode: z.ZodPipe<z.ZodString, z.ZodTransform<BuilderCode, string>>;
2916
+ direction: z.ZodType<OrderSide, "BUY" | "SELL", z.core.$ZodTypeInternals<OrderSide, "BUY" | "SELL">>;
2917
+ expiresAt: z.ZodNumber;
2918
+ makerAmount: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<string, string | number>>, z.ZodTransform<_polymarket_bindings.BaseUnits, string>>;
2919
+ netReceive: z.ZodOptional<z.ZodString>;
2920
+ positionId: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
2921
+ quoteId: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
2922
+ rfqId: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
2923
+ takerAmount: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<string, string | number>>, z.ZodTransform<_polymarket_bindings.BaseUnits, string>>;
2924
+ totalRequired: z.ZodString;
2925
+ }, z.core.$strip>;
2926
+ type AcceptComboQuoteParamsInput = z.input<typeof AcceptComboQuoteParamsSchema>;
2927
+ type AcceptComboQuoteParamsFields = {
2928
+ /** RFQ identifier. */
2929
+ rfqId: string;
2930
+ /** Winning quote identifier. */
2931
+ quoteId: string;
2932
+ /** Builder code attached to the signed acceptance order. */
2933
+ builderCode: string;
2934
+ /** Trade direction of the original request. */
2935
+ direction: `${OrderSide}`;
2936
+ /** Combo YES position traded by the acceptance order. */
2937
+ positionId: string;
2938
+ /** Signed-order collateral for BUY, or position shares for SELL. */
2939
+ makerAmount: number | string;
2940
+ /** Signed-order shares for BUY, or gross collateral limit for SELL. */
2941
+ takerAmount: number | string;
2942
+ /** Exact collateral proceeds after fees for a SELL quote. */
2943
+ netReceive?: string;
2944
+ /** Blended price across legs, in collateral per outcome token. */
2945
+ blendedPrice: string;
2946
+ /** Total collateral including fees for BUY, or position shares for SELL. */
2947
+ totalRequired: string;
2948
+ /** Acceptance deadline (Unix ms). */
2949
+ expiresAt: number;
2950
+ };
2951
+ type AcceptComboQuoteParamsSchemaMatch = AcceptComboQuoteParamsFields extends AcceptComboQuoteParamsInput ? AcceptComboQuoteParamsInput extends AcceptComboQuoteParamsFields ? unknown : never : never;
2952
+ /**
2953
+ * Plain JSON representation of a self-contained combo quote.
2954
+ *
2955
+ * @remarks
2956
+ * {@link ComboQuote} is assignable to this type, while quotes restored from a
2957
+ * typed transport or persistence boundary do not need to recreate the SDK's
2958
+ * branded return types. Its fields are checked against the runtime input
2959
+ * schema at compile time.
2960
+ */
2961
+ type AcceptComboQuoteParams = AcceptComboQuoteParamsInput & AcceptComboQuoteParamsFields & AcceptComboQuoteParamsSchemaMatch;
2962
+ type AcceptComboQuoteResult = {
2963
+ status: 'executing';
2964
+ rfqId: RfqId;
2965
+ /**
2966
+ * Hash of the recorded acceptance order.
2967
+ *
2968
+ * Absent when a retry attached to an acceptance recorded by an earlier
2969
+ * attempt; the retried order was not the one recorded.
2970
+ */
2971
+ takerOrderHash?: string;
2972
+ } | {
2973
+ status: 'failed';
2974
+ rfqId: RfqId;
2975
+ reason: ComboAcceptFailureReason;
2976
+ /** Raw error behind the failure, when provided. */
2977
+ error?: BuilderRfqError;
2978
+ };
2979
+ type AcceptComboQuoteError = CancelledSigningError | RateLimitError | RfqRequestRejectedError | SigningError | TimeoutError | TransportError | UnexpectedResponseError | UserInputError;
2980
+ declare const AcceptComboQuoteError: {
2981
+ isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RateLimitError | TimeoutError | RfqRequestRejectedError;
2982
+ };
2983
+ /**
2984
+ * Accepts a self-contained combo quote, signing the acceptance order for the
2985
+ * authenticated account.
2986
+ *
2987
+ * @remarks
2988
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
2989
+ *
2990
+ * Resolves at the maker last-look outcome. A maker declining or the
2991
+ * acceptance window expiring is a normal outcome, returned as
2992
+ * `status: 'failed'`. `status: 'executing'` means the trade was handed off
2993
+ * for onchain execution; follow it with {@link waitForComboFill}.
2994
+ *
2995
+ * A transport failure or unrecognized acceptance response is retried once
2996
+ * automatically; this is safe because an already-accepted RFQ reports its
2997
+ * current status instead of executing twice. After such a retry
2998
+ * `takerOrderHash` is absent because the retried order was not the one
2999
+ * recorded.
3000
+ *
3001
+ * The quote is JSON-serializable and may cross process boundaries before
3002
+ * acceptance. The accepting client must represent the same account and
3003
+ * builder identity used to request it.
3004
+ * Treat the quote as signing-sensitive data: preserve its integrity across
3005
+ * process boundaries and do not accept fields modified by an untrusted client.
3006
+ *
3007
+ * @throws {@link AcceptComboQuoteError}
3008
+ * Thrown on failure.
3009
+ *
3010
+ * @example
3011
+ * ```ts
3012
+ * const result = await requestComboQuote(client, {
3013
+ * legPositionIds: ['123', '456'],
3014
+ * direction: OrderSide.BUY,
3015
+ * amount: 100,
3016
+ * });
3017
+ *
3018
+ * if (result.quote !== null) {
3019
+ * const acceptance = await acceptComboQuote(client, result.quote);
3020
+ * }
3021
+ * ```
3022
+ */
3023
+ declare function acceptComboQuote(client: BaseSecureClient, params: AcceptComboQuoteParams): Promise<AcceptComboQuoteResult>;
3024
+ type WaitForComboFillParams = {
3025
+ /** RFQ identifier of an accepted RFQ. */
3026
+ rfqId: string;
3027
+ /**
3028
+ * Give up after this long.
3029
+ *
3030
+ * @defaultValue 30_000
3031
+ */
3032
+ timeoutMs?: number;
3033
+ /** @defaultValue 1_000 */
3034
+ pollingIntervalMs?: number;
3035
+ };
3036
+ type WaitForComboFillResult = {
3037
+ status: RfqStatus.Filled;
3038
+ rfqId: RfqId;
3039
+ txHash: TxHash;
3040
+ } | {
3041
+ status: RfqStatus.Failed | RfqStatus.Expired | RfqStatus.Canceled;
3042
+ rfqId: RfqId;
3043
+ /** Raw error behind the failure, when provided. */
3044
+ error?: BuilderRfqError;
3045
+ };
3046
+ type WaitForComboFillError = RateLimitError | RfqRequestRejectedError | TimeoutError | TransportError | UnexpectedResponseError | UserInputError;
3047
+ declare const WaitForComboFillError: {
3048
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RateLimitError | TimeoutError | RfqRequestRejectedError;
3049
+ };
3050
+ /**
3051
+ * Waits for an accepted RFQ to reach a terminal state.
3052
+ *
3053
+ * @remarks
3054
+ * This is a low-level function. Most SDK consumers should prefer the client instance API.
3055
+ *
3056
+ * Polls the RFQ status until it is filled (or confirmed onchain), `FAILED`,
3057
+ * `EXPIRED`, or `CANCELED`. Terminal failure is a normal outcome and is
3058
+ * returned, not thrown. A {@link TimeoutError} does not mean the trade
3059
+ * failed; resume with {@link fetchRfqStatus}.
3060
+ *
3061
+ * @throws {@link WaitForComboFillError}
3062
+ * Thrown on failure.
3063
+ *
3064
+ * @example
3065
+ * ```ts
3066
+ * const fill = await waitForComboFill(client, { rfqId });
3067
+ *
3068
+ * if (fill.status === RfqStatus.Filled) {
3069
+ * // fill.txHash: TxHash
3070
+ * }
3071
+ * ```
3072
+ */
3073
+ declare function waitForComboFill(client: BaseSecureClient, params: WaitForComboFillParams): Promise<WaitForComboFillResult>;
3074
+ type FetchRfqStatusParams = {
3075
+ /** RFQ identifier of an accepted RFQ. */
3076
+ rfqId: string;
3077
+ };
3078
+ /**
3079
+ * Status projection for an accepted RFQ.
3080
+ *
3081
+ * @remarks
3082
+ * Onchain execution progress is merged into the top-level `status`:
3083
+ * {@link RfqExecutionStatus} values surface alongside the RFQ lifecycle.
3084
+ */
3085
+ type RfqStatusResult = BuilderRfqStatusResponse;
3086
+ type FetchRfqStatusError = RateLimitError | RfqRequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
3087
+ declare const FetchRfqStatusError: {
3088
+ isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RateLimitError | RfqRequestRejectedError;
3089
+ };
3090
+ /**
3091
+ * Fetches the status of an accepted RFQ.
3092
+ *
3093
+ * @remarks
3094
+ * Status is available once an acceptance has been recorded; earlier reads are
3095
+ * rejected.
3096
+ *
3097
+ * @throws {@link FetchRfqStatusError}
3098
+ * Thrown on failure.
3099
+ *
3100
+ * @example
3101
+ * ```ts
3102
+ * const status = await fetchRfqStatus(client, { rfqId });
3103
+ * ```
3104
+ */
3105
+ declare function fetchRfqStatus(client: BaseSecureClient, params: FetchRfqStatusParams): Promise<RfqStatusResult>;
2743
3106
 
2744
3107
  type SecureRfqActions = {
2745
3108
  /**
@@ -2875,6 +3238,102 @@ type SecureRfqActions = {
2875
3238
  * Thrown on failure.
2876
3239
  */
2877
3240
  openRfqSession(): Promise<RfqSession>;
3241
+ /**
3242
+ * Requests a quote for a combo of positions.
3243
+ *
3244
+ * @remarks
3245
+ * Resolves when the quote competition window closes. A request that
3246
+ * attracts no usable quotes is a normal outcome, returned as `quote: null`
3247
+ * with a reason rather than thrown.
3248
+ *
3249
+ * A winning quote is self-contained JSON data and may be persisted or
3250
+ * routed to another process before acceptance.
3251
+ *
3252
+ * Requires a Builder API Key in the client configuration, via
3253
+ * `builderApiKey(...)` or `remoteBuilderSigning(...)`.
3254
+ *
3255
+ * @throws {@link RequestComboQuoteError}
3256
+ * Thrown on failure.
3257
+ *
3258
+ * @example
3259
+ * ```ts
3260
+ * const result = await client.requestComboQuote({
3261
+ * legPositionIds: ['123', '456'],
3262
+ * direction: OrderSide.BUY,
3263
+ * amount: 100,
3264
+ * });
3265
+ *
3266
+ * if (result.quote !== null) {
3267
+ * // result.quote.blendedPrice: DecimalString
3268
+ * // result.quote.totalRequired: DecimalString
3269
+ * // SELL quotes also carry result.quote.netReceive after fees.
3270
+ * // result.quote.expiresAt: EpochMilliseconds
3271
+ * }
3272
+ * ```
3273
+ */
3274
+ requestComboQuote(params: RequestComboQuoteParams): Promise<RequestComboQuoteResult>;
3275
+ /**
3276
+ * Accepts a self-contained combo quote, signing the acceptance order for
3277
+ * the authenticated account.
3278
+ *
3279
+ * @remarks
3280
+ * Resolves at the maker last-look outcome. A maker declining or the
3281
+ * acceptance window expiring is a normal outcome, returned as
3282
+ * `status: 'failed'`. `status: 'executing'` means the trade was handed off
3283
+ * for onchain execution; follow it with `waitForComboFill`.
3284
+ *
3285
+ * A transport failure or unrecognized acceptance response is retried once
3286
+ * automatically; this is safe because an already-accepted RFQ reports its
3287
+ * current status instead of executing twice. After such a retry
3288
+ * `takerOrderHash` is absent because the retried order was not the one
3289
+ * recorded.
3290
+ *
3291
+ * The quote is JSON-serializable and may cross process boundaries before
3292
+ * acceptance. The accepting client must represent the same account and
3293
+ * builder identity used to request it.
3294
+ * Treat the quote as signing-sensitive data: preserve its integrity across
3295
+ * process boundaries and do not accept fields modified by an untrusted client.
3296
+ *
3297
+ * @throws {@link AcceptComboQuoteError}
3298
+ * Thrown on failure.
3299
+ *
3300
+ * @example
3301
+ * ```ts
3302
+ * const result = await client.requestComboQuote({
3303
+ * legPositionIds: ['123', '456'],
3304
+ * direction: OrderSide.BUY,
3305
+ * amount: 100,
3306
+ * });
3307
+ *
3308
+ * if (result.quote !== null) {
3309
+ * const acceptance = await client.acceptComboQuote(result.quote);
3310
+ * }
3311
+ * ```
3312
+ */
3313
+ acceptComboQuote(params: AcceptComboQuoteParams): Promise<AcceptComboQuoteResult>;
3314
+ /**
3315
+ * Waits for an accepted RFQ to reach a terminal state.
3316
+ *
3317
+ * @remarks
3318
+ * Polls the RFQ status until it is filled (or confirmed onchain),
3319
+ * `FAILED`, `EXPIRED`, or `CANCELED`. Terminal failure is a normal outcome
3320
+ * and is returned, not thrown. A `TimeoutError` does not mean the trade
3321
+ * failed; resume with the `fetchRfqStatus` action from
3322
+ * `@polymarket/client/actions`.
3323
+ *
3324
+ * @throws {@link WaitForComboFillError}
3325
+ * Thrown on failure.
3326
+ *
3327
+ * @example
3328
+ * ```ts
3329
+ * const fill = await client.waitForComboFill({ rfqId });
3330
+ *
3331
+ * if (fill.status === RfqStatus.Filled) {
3332
+ * // fill.txHash: TxHash
3333
+ * }
3334
+ * ```
3335
+ */
3336
+ waitForComboFill(params: WaitForComboFillParams): Promise<WaitForComboFillResult>;
2878
3337
  };
2879
3338
  declare function rfqActions(client: BaseSecureClient): SecureRfqActions;
2880
3339
 
@@ -3870,6 +4329,7 @@ type ClobEndpoints = RestEndpoint & {
3870
4329
  user: WebSocketEndpoint;
3871
4330
  };
3872
4331
  type CombosEndpoints = RestEndpoint & WebSocketEndpoint & {
4332
+ builderGateway: RestEndpoint;
3873
4333
  collateralReturn: RestEndpoint;
3874
4334
  };
3875
4335
  /**
@@ -3912,6 +4372,7 @@ type EnvironmentConfigFork = {
3912
4372
  gamma?: Partial<RestEndpoint>;
3913
4373
  data?: Partial<RestEndpoint>;
3914
4374
  combos?: EnvironmentConfigForkEndpoint & {
4375
+ builderGateway?: Partial<RestEndpoint>;
3915
4376
  collateralReturn?: Partial<RestEndpoint>;
3916
4377
  };
3917
4378
  perps?: EnvironmentConfigForkEndpoint;
@@ -4921,9 +5382,9 @@ declare const ResolveConditionByTokenError: {
4921
5382
  * @throws {@link ResolveConditionByTokenError}
4922
5383
  * Thrown on failure.
4923
5384
  */
4924
- declare function resolveConditionByToken(client: BaseClient, request: ResolveConditionByTokenRequest): Promise<CtfConditionId>;
5385
+ declare function resolveConditionByToken(client: BaseClient, request: ResolveConditionByTokenRequest): Promise<ConditionId>;
4925
5386
  declare const FetchMarketInfoRequestSchema: z.ZodObject<{
4926
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
5387
+ conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
4927
5388
  }, z.core.$strip>;
4928
5389
  type FetchMarketInfoRequest = z.input<typeof FetchMarketInfoRequestSchema>;
4929
5390
  type FetchMarketInfoError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
@@ -5151,6 +5612,8 @@ declare const FetchLastTradePriceError: {
5151
5612
  /**
5152
5613
  * Fetches the last traded price for a token.
5153
5614
  *
5615
+ * Returns `null` when the token has not traded.
5616
+ *
5154
5617
  * @remarks
5155
5618
  * This is a low-level function. Most SDK consumers should prefer the client instance API.
5156
5619
  *
@@ -5164,11 +5627,11 @@ declare const FetchLastTradePriceError: {
5164
5627
  * '8501497159083948713316135768103773293754490207922884688769443031624417212426',
5165
5628
  * });
5166
5629
  *
5167
- * // trade === { price: '0.53', side: OrderSide.BUY }
5630
+ * // trade === LastTradePrice | null
5168
5631
  * ```
5169
5632
  *
5170
5633
  */
5171
- declare function fetchLastTradePrice(client: BaseClient, request: FetchLastTradePriceRequest): Promise<LastTradePrice>;
5634
+ declare function fetchLastTradePrice(client: BaseClient, request: FetchLastTradePriceRequest): Promise<LastTradePrice | null>;
5172
5635
  declare const FetchLastTradePricesRequestSchema: z.ZodArray<z.ZodObject<{
5173
5636
  tokenId: z.ZodString;
5174
5637
  }, z.core.$strip>>;
@@ -5180,6 +5643,9 @@ declare const FetchLastTradePricesError: {
5180
5643
  /**
5181
5644
  * Fetches last traded prices for multiple tokens.
5182
5645
  *
5646
+ * Tokens without trades are omitted from the response. Match returned rows by
5647
+ * `tokenId`; the array is not positionally aligned with the request.
5648
+ *
5183
5649
  * @remarks
5184
5650
  * This is a low-level function. Most SDK consumers should prefer the client instance API.
5185
5651
  *
@@ -5188,14 +5654,11 @@ declare const FetchLastTradePricesError: {
5188
5654
  *
5189
5655
  * @example
5190
5656
  * ```ts
5191
- * const trades = await fetchLastTradePrices(client, [
5192
- * {
5193
- * tokenId:
5194
- * '8501497159083948713316135768103773293754490207922884688769443031624417212426',
5195
- * },
5196
- * ]);
5657
+ * const tokenId =
5658
+ * '8501497159083948713316135768103773293754490207922884688769443031624417212426';
5659
+ * const trades = await fetchLastTradePrices(client, [{ tokenId }]);
5197
5660
  *
5198
- * // trades[0] === { tokenId, price: '0.53', side: OrderSide.BUY }
5661
+ * const trade = trades.find((candidate) => candidate.tokenId === tokenId);
5199
5662
  * ```
5200
5663
  *
5201
5664
  */
@@ -5278,7 +5741,7 @@ declare const ListCurrentRewardsError: {
5278
5741
  */
5279
5742
  declare function listCurrentRewards(client: BaseClient, request?: ListCurrentRewardsRequest): Paginated<CurrentReward[]>;
5280
5743
  declare const ListMarketRewardsRequestSchema: z.ZodObject<{
5281
- conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
5744
+ conditionId: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
5282
5745
  cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
5283
5746
  sponsored: z.ZodOptional<z.ZodBoolean>;
5284
5747
  }, z.core.$strip>;
@@ -5953,7 +6416,7 @@ declare const ListMarketsRequestSchema: z.ZodObject<{
5953
6416
  clobTokenIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
5954
6417
  cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
5955
6418
  pageSize: z.ZodOptional<z.ZodNumber>;
5956
- conditionIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.CtfConditionId, string>>>>;
6419
+ conditionIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ConditionId, string>>>>;
5957
6420
  cyom: z.ZodOptional<z.ZodBoolean>;
5958
6421
  decimalized: z.ZodOptional<z.ZodBoolean>;
5959
6422
  endDateMax: z.ZodOptional<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.IsoDateTimeString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<_polymarket_bindings.IsoDateTimeString, Date>>]>>;
@@ -6084,7 +6547,7 @@ declare function listMarkets(client: BaseClient, request?: ListMarketsRequest):
6084
6547
  declare const ListComboMarketsRequestSchema: z.ZodObject<{
6085
6548
  cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
6086
6549
  pageSize: z.ZodOptional<z.ZodNumber>;
6087
- exclude: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.CtfConditionId, string>>>>;
6550
+ exclude: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<_polymarket_bindings.ConditionId, string>>>>;
6088
6551
  }, z.core.$strip>;
6089
6552
  type ListComboMarketsRequest = z.input<typeof ListComboMarketsRequestSchema>;
6090
6553
  type ListComboMarketsError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
@@ -6554,7 +7017,7 @@ type PlacePerpsOrderRequest = {
6554
7017
  postOnly?: boolean;
6555
7018
  /** Whether the order may only reduce or close an existing position. */
6556
7019
  reduceOnly?: boolean;
6557
- /** Optional caller-supplied idempotency identifier. */
7020
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6558
7021
  clientOrderId?: string;
6559
7022
  /** Optional command expiration timestamp in milliseconds. */
6560
7023
  expiresAt?: number;
@@ -6574,7 +7037,7 @@ type PlacePerpsOrderRequest = {
6574
7037
  postOnly?: never;
6575
7038
  /** Whether the order may only reduce or close an existing position. */
6576
7039
  reduceOnly?: boolean;
6577
- /** Optional caller-supplied idempotency identifier. */
7040
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6578
7041
  clientOrderId?: string;
6579
7042
  /** Optional command expiration timestamp in milliseconds. */
6580
7043
  expiresAt?: number;
@@ -6594,7 +7057,7 @@ type PlacePerpsOrderRequest = {
6594
7057
  postOnly?: never;
6595
7058
  /** Whether the order may only reduce or close an existing position. */
6596
7059
  reduceOnly?: boolean;
6597
- /** Optional caller-supplied idempotency identifier. */
7060
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6598
7061
  clientOrderId?: string;
6599
7062
  /** Optional command expiration timestamp in milliseconds. */
6600
7063
  expiresAt?: number;
@@ -6619,7 +7082,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6619
7082
  postOnly?: boolean;
6620
7083
  /** Whether the order may only reduce or close an existing position. */
6621
7084
  reduceOnly?: boolean;
6622
- /** Optional caller-supplied idempotency identifier. */
7085
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6623
7086
  clientOrderId?: string;
6624
7087
  /** Optional command expiration timestamp in milliseconds. */
6625
7088
  expiresAt?: number;
@@ -6642,7 +7105,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6642
7105
  postOnly?: boolean;
6643
7106
  /** Whether the order may only reduce or close an existing position. */
6644
7107
  reduceOnly?: boolean;
6645
- /** Optional caller-supplied idempotency identifier. */
7108
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6646
7109
  clientOrderId?: string;
6647
7110
  /** Optional command expiration timestamp in milliseconds. */
6648
7111
  expiresAt?: number;
@@ -6664,7 +7127,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6664
7127
  postOnly?: never;
6665
7128
  /** Whether the order may only reduce or close an existing position. */
6666
7129
  reduceOnly?: boolean;
6667
- /** Optional caller-supplied idempotency identifier. */
7130
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6668
7131
  clientOrderId?: string;
6669
7132
  /** Optional command expiration timestamp in milliseconds. */
6670
7133
  expiresAt?: number;
@@ -6686,7 +7149,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6686
7149
  postOnly?: never;
6687
7150
  /** Whether the order may only reduce or close an existing position. */
6688
7151
  reduceOnly?: boolean;
6689
- /** Optional caller-supplied idempotency identifier. */
7152
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6690
7153
  clientOrderId?: string;
6691
7154
  /** Optional command expiration timestamp in milliseconds. */
6692
7155
  expiresAt?: number;
@@ -6708,7 +7171,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6708
7171
  postOnly?: never;
6709
7172
  /** Whether the order may only reduce or close an existing position. */
6710
7173
  reduceOnly?: boolean;
6711
- /** Optional caller-supplied idempotency identifier. */
7174
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6712
7175
  clientOrderId?: string;
6713
7176
  /** Optional command expiration timestamp in milliseconds. */
6714
7177
  expiresAt?: number;
@@ -6730,7 +7193,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6730
7193
  postOnly?: never;
6731
7194
  /** Whether the order may only reduce or close an existing position. */
6732
7195
  reduceOnly?: boolean;
6733
- /** Optional caller-supplied idempotency identifier. */
7196
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6734
7197
  clientOrderId?: string;
6735
7198
  /** Optional command expiration timestamp in milliseconds. */
6736
7199
  expiresAt?: number;
@@ -6739,6 +7202,31 @@ type PlacePerpsOrderWithTpSlRequest = {
6739
7202
  /** Stop-loss trigger to place with the entry order. */
6740
7203
  stopLoss: PerpsTpSlTrigger;
6741
7204
  };
7205
+ /**
7206
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7207
+ */
7208
+ type PerpsPlacedTpSlOrder = {
7209
+ orderId: PerpsOrderId;
7210
+ };
7211
+ /**
7212
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7213
+ */
7214
+ type PerpsPlacedTpSlOrders = {
7215
+ takeProfit?: PerpsPlacedTpSlOrder;
7216
+ stopLoss?: PerpsPlacedTpSlOrder;
7217
+ };
7218
+ /**
7219
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7220
+ */
7221
+ type PlacePerpsOrderResult = {
7222
+ order: PerpsOrder;
7223
+ };
7224
+ /**
7225
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7226
+ */
7227
+ type PlacePerpsOrderWithTpSlResult = PlacePerpsOrderResult & {
7228
+ tpSl: PerpsPlacedTpSlOrders;
7229
+ };
6742
7230
  /**
6743
7231
  * @experimental This API may change in a breaking way in any release, including patch releases.
6744
7232
  */
@@ -6761,6 +7249,12 @@ type PlacePerpsPositionTpSlRequest = {
6761
7249
  /** Optional command expiration timestamp in milliseconds. */
6762
7250
  expiresAt?: number;
6763
7251
  };
7252
+ /**
7253
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7254
+ */
7255
+ type PlacePerpsPositionTpSlResult = {
7256
+ tpSl: PerpsPlacedTpSlOrders;
7257
+ };
6764
7258
  /**
6765
7259
  * @experimental This API may change in a breaking way in any release, including patch releases.
6766
7260
  */
@@ -6802,6 +7296,35 @@ type CancelAllPerpsOrdersRequest = {
6802
7296
  /** Optional command expiration timestamp in milliseconds. */
6803
7297
  expiresAt?: number;
6804
7298
  };
7299
+ /**
7300
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7301
+ */
7302
+ type ArmPerpsAutoCancelRequest = {
7303
+ /**
7304
+ * Unix timestamp in milliseconds at which all open orders are cancelled.
7305
+ * Must be at least five seconds in the future.
7306
+ */
7307
+ cancelAt: number;
7308
+ /** Optional command expiration timestamp in milliseconds. */
7309
+ expiresAt?: number;
7310
+ };
7311
+ /**
7312
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7313
+ */
7314
+ type ArmPerpsAutoCancelError = AutoCancelDailyLimitError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
7315
+ /**
7316
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7317
+ */
7318
+ declare const ArmPerpsAutoCancelError: {
7319
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | AutoCancelDailyLimitError;
7320
+ };
7321
+ /**
7322
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7323
+ */
7324
+ type DisarmPerpsAutoCancelRequest = {
7325
+ /** Optional command expiration timestamp in milliseconds. */
7326
+ expiresAt?: number;
7327
+ };
6805
7328
  /**
6806
7329
  * @experimental This API may change in a breaking way in any release, including patch releases.
6807
7330
  */
@@ -6867,38 +7390,7 @@ type PerpsSessionAccountError = RateLimitError | RequestRejectedError | Transpor
6867
7390
  /**
6868
7391
  * @experimental This API may change in a breaking way in any release, including patch releases.
6869
7392
  */
6870
- type PerpsSessionTradingError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6871
- /**
6872
- * @experimental This API may change in a breaking way in any release, including patch releases.
6873
- */
6874
- type PerpsPlacedTpSlOrder = {
6875
- orderId: PerpsOrderId;
6876
- };
6877
- /**
6878
- * @experimental This API may change in a breaking way in any release, including patch releases.
6879
- */
6880
- type PerpsPlacedTpSlOrders = {
6881
- takeProfit?: PerpsPlacedTpSlOrder;
6882
- stopLoss?: PerpsPlacedTpSlOrder;
6883
- };
6884
- /**
6885
- * @experimental This API may change in a breaking way in any release, including patch releases.
6886
- */
6887
- type PlacePerpsOrderResult = {
6888
- order: PerpsOrder;
6889
- };
6890
- /**
6891
- * @experimental This API may change in a breaking way in any release, including patch releases.
6892
- */
6893
- type PlacePerpsOrderWithTpSlResult = PlacePerpsOrderResult & {
6894
- tpSl: PerpsPlacedTpSlOrders;
6895
- };
6896
- /**
6897
- * @experimental This API may change in a breaking way in any release, including patch releases.
6898
- */
6899
- type PlacePerpsPositionTpSlResult = {
6900
- tpSl: PerpsPlacedTpSlOrders;
6901
- };
7393
+ type PerpsSessionTradingError = RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransportError | UnexpectedResponseError | UserInputError;
6902
7394
  /**
6903
7395
  * @experimental This API may change in a breaking way in any release, including patch releases.
6904
7396
  */
@@ -6982,6 +7474,17 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
6982
7474
  * @experimental This API may change in a breaking way in any release, including patch releases.
6983
7475
  */
6984
7476
  fetchAccountConfig(request?: FetchPerpsAccountConfigRequest): Promise<PerpsAccountConfig[]>;
7477
+ /**
7478
+ * Fetches the auto-cancel status for the authenticated account, including
7479
+ * the armed deadline, today's trigger count, the daily trigger limit, and
7480
+ * when the daily counter resets.
7481
+ *
7482
+ * @throws {@link PerpsSessionAccountError}
7483
+ * Thrown on failure.
7484
+ *
7485
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7486
+ */
7487
+ fetchAutoCancelStatus(): Promise<PerpsAutoCancelStatus>;
6985
7488
  /**
6986
7489
  * Fetches currently open Perps orders, optionally filtered by instrument.
6987
7490
  *
@@ -7231,6 +7734,54 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
7231
7734
  * @experimental This API may change in a breaking way in any release, including patch releases.
7232
7735
  */
7233
7736
  cancelAllOrders(request?: CancelAllPerpsOrdersRequest): Promise<void>;
7737
+ /**
7738
+ * Arms the auto-cancel switch that cancels all open Perps orders for the
7739
+ * authenticated account at `cancelAt`.
7740
+ *
7741
+ * @remarks
7742
+ * The switch is one-shot: once it fires and open orders are cancelled, the
7743
+ * schedule clears itself and orders placed afterwards are unprotected.
7744
+ * Re-arm periodically to keep protection active. Arming again replaces the
7745
+ * previous schedule, and `cancelAt` must be at least five seconds in the
7746
+ * future. Accounts may only trigger auto-cancel a limited number of times
7747
+ * per UTC day; use {@link PerpsSession.fetchAutoCancelStatus} to inspect the
7748
+ * limit, today's trigger count, and when the counter resets.
7749
+ *
7750
+ * @example
7751
+ * ```ts
7752
+ * // Keep a 60-second dead man's switch alive by re-arming every 20 seconds.
7753
+ * await session.armAutoCancel({ cancelAt: Date.now() + 60_000 });
7754
+ * const rearm = setInterval(() => {
7755
+ * // A missed re-arm is fail-safe: the previously armed switch still fires.
7756
+ * session.armAutoCancel({ cancelAt: Date.now() + 60_000 }).catch(() => {});
7757
+ * }, 20_000);
7758
+ *
7759
+ * // On graceful shutdown, stop re-arming and disarm the schedule.
7760
+ * clearInterval(rearm);
7761
+ * await session.disarmAutoCancel();
7762
+ * ```
7763
+ *
7764
+ * @throws {@link ArmPerpsAutoCancelError}
7765
+ * Thrown on failure, including `AutoCancelDailyLimitError` when the daily
7766
+ * trigger limit has been reached.
7767
+ *
7768
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7769
+ */
7770
+ armAutoCancel(request: ArmPerpsAutoCancelRequest): Promise<void>;
7771
+ /**
7772
+ * Disarms the auto-cancel schedule for the authenticated account without
7773
+ * triggering it.
7774
+ *
7775
+ * @remarks
7776
+ * Disarming is always allowed, even when the daily trigger limit has been
7777
+ * reached.
7778
+ *
7779
+ * @throws {@link PerpsSessionTradingError}
7780
+ * Thrown on failure.
7781
+ *
7782
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7783
+ */
7784
+ disarmAutoCancel(request?: DisarmPerpsAutoCancelRequest): Promise<void>;
7234
7785
  /**
7235
7786
  * Updates Perps leverage and margin mode for an instrument.
7236
7787
  *
@@ -7710,7 +8261,7 @@ type PrepareSplitMarketPositionRequest = {
7710
8261
  /** Amount of collateral to convert into market positions. */
7711
8262
  amount: bigint;
7712
8263
  /** Existing market condition ID that identifies the positions to mint. */
7713
- conditionId: string | CtfConditionId;
8264
+ conditionId: string | ConditionId;
7714
8265
  /** Optional transaction metadata for workflows that support metadata. */
7715
8266
  metadata?: string;
7716
8267
  };
@@ -7864,7 +8415,7 @@ type PrepareMergeMarketPositionRequest = {
7864
8415
  /** Amount per complementary market position to merge. */
7865
8416
  amount: bigint | 'max';
7866
8417
  /** Existing market condition ID that identifies the positions to merge. */
7867
- conditionId: string | CtfConditionId;
8418
+ conditionId: string | ConditionId;
7868
8419
  /** Optional transaction metadata for workflows that support metadata. */
7869
8420
  metadata?: string;
7870
8421
  };
@@ -7974,7 +8525,7 @@ declare function mergePositions(client: BaseSecureClient, request: PrepareMergeP
7974
8525
  */
7975
8526
  type PrepareRedeemMarketPositionsByConditionIdRequest = {
7976
8527
  /** Existing market condition ID that identifies the positions to redeem. */
7977
- conditionId: string | CtfConditionId;
8528
+ conditionId: string | ConditionId;
7978
8529
  marketId?: never;
7979
8530
  amount?: never;
7980
8531
  positionId?: never;
@@ -8778,4 +9329,4 @@ type Signer = {
8778
9329
  sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
8779
9330
  };
8780
9331
 
8781
- export { FetchMarketTagsError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type CryptoPricesChainlinkTwapSubscription as D, type DataActions as E, DepositToPerpsError as F, type DepositToPerpsRequest as G, type DiscoveryActions as H, DownloadAccountingSnapshotError as I, DropNotificationsError as J, type EnvironmentConfig as K, type EnvironmentConfigFork as L, type EnvironmentContracts as M, EstimateMarketPriceError as N, ExecuteCollateralReturnPlanError as O, type ExecuteCollateralReturnPlanRequest as P, FetchClosedOnlyModeError as Q, FetchCommentsByIdError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchEventError as V, FetchEventLiveVolumeError as W, FetchEventTagsError as X, FetchLastTradePriceError as Y, FetchLastTradePricesError as Z, FetchMarketError as _, type TypedData as a, type ListPerpsPnlHistoryRequest as a$, FetchMidpointError as a0, FetchMidpointsError as a1, FetchNotificationsError as a2, FetchOrderBookError as a3, FetchOrderBooksError as a4, FetchOrderError as a5, FetchOrderScoringError as a6, FetchOrdersScoringError as a7, type FetchPerpsAccountConfigRequest as a8, FetchPerpsBookError as a9, ListActivityError as aA, ListBuilderLeaderboardError as aB, ListBuilderTradesError as aC, ListBuilderVolumeError as aD, ListClosedPositionsError as aE, ListComboActivityError as aF, ListComboMarketsError as aG, ListComboPositionsError as aH, ListCommentsByUserAddressError as aI, ListCommentsError as aJ, ListCurrentRewardsError as aK, ListEventsError as aL, ListMarketHoldersError as aM, ListMarketPositionsError as aN, ListMarketRewardsError as aO, ListMarketsError as aP, ListOpenInterestError as aQ, ListOpenOrdersError as aR, ListPerpsCandlesError as aS, type ListPerpsCandlesRequest as aT, type ListPerpsDepositsRequest as aU, type ListPerpsEquityHistoryRequest as aV, type ListPerpsFillsRequest as aW, ListPerpsFundingHistoryError as aX, type ListPerpsFundingHistoryRequest as aY, type ListPerpsFundingPaymentsRequest as aZ, type ListPerpsNotificationsRequest as a_, type FetchPerpsBookRequest as aa, FetchPerpsFeesError as ab, FetchPerpsInstrumentsError as ac, type FetchPerpsInstrumentsRequest as ad, type FetchPerpsOpenOrdersRequest as ae, type FetchPerpsOrdersRequest as af, FetchPerpsTickerError as ag, type FetchPerpsTickerRequest as ah, FetchPerpsTickersError as ai, type FetchPerpsTickersRequest as aj, FetchPortfolioValueError as ak, FetchPriceError as al, FetchPriceHistoryError as am, FetchPricesError as an, FetchPublicProfileError as ao, FetchRelatedTagResourcesError as ap, FetchRelatedTagsError as aq, FetchRewardPercentagesError as ar, FetchSeriesError as as, FetchSpreadError as at, FetchSpreadsError as au, FetchTagError as av, FetchTotalEarningsForUserForDayError as aw, FetchTradedMarketCountError as ax, InsufficientLiquidityError as ay, ListAccountTradesError as az, type TransactionCall as b, type RfqCancelQuoteRejectedErrorOptions as b$, ListPerpsTradesError as b0, type ListPerpsTradesRequest as b1, type ListPerpsWithdrawalsRequest as b2, ListPositionsError as b3, ListSeriesError as b4, ListTagsError as b5, ListTeamsError as b6, ListTraderLeaderboardError as b7, ListTradesError as b8, ListUserEarningsAndMarketsConfigError as b9, type PlacePerpsOrderWithTpSlRequest as bA, type PlacePerpsOrderWithTpSlResult as bB, type PlacePerpsPositionTpSlRequest as bC, type PlacePerpsPositionTpSlResult as bD, PlanCollateralReturnError as bE, PostOrderError as bF, PostOrdersError as bG, type PostPerpsOrdersRequest as bH, type PublicAccountActions as bI, type PublicActions as bJ, type PublicClient as bK, type PublicClientOptions as bL, type PublicPerpsActions as bM, type PublicRewardsActions as bN, type PublicSubscriptionsActions as bO, RateLimitError as bP, type RateLimitErrorOptions as bQ, RedeemPositionsError as bR, RequestRejectedError as bS, type RequestRejectedErrorOptions as bT, type RestEndpoint as bU, type ResumePerpsSessionRequest as bV, RevokePerpsCredentialsError as bW, type RevokePerpsCredentialsRequest as bX, type RfqCancelQuoteAck as bY, RfqCancelQuoteError as bZ, RfqCancelQuoteRejectedError as b_, ListUserEarningsForDayError as ba, type MarkPerpsNotificationsReadRequest as bb, MergePositionsError as bc, OpenPerpsSessionError as bd, type OpenPerpsSessionRequest as be, OpenRfqSessionError as bf, type Page as bg, PageSizeSchema as bh, type Paginated as bi, type PerpsActions as bj, type PerpsBookDepth as bk, type PerpsEndpoints as bl, type PerpsOrderRequest as bm, type PerpsPlaceFokOrderRequest as bn, type PerpsPlaceGtcOrderRequest as bo, type PerpsPlaceIocOrderRequest as bp, type PerpsPlacedTpSlOrder as bq, type PerpsPlacedTpSlOrders as br, type PerpsPositionTpSlTrigger as bs, PerpsSession as bt, type PerpsSessionAccountError as bu, type PerpsSessionLifecycleError as bv, type PerpsSessionTradingError as bw, type PerpsTpSlTrigger as bx, type PlacePerpsOrderRequest as by, type PlacePerpsOrderResult as bz, type AccountIdentity as c, analyticsActions as c$, type RfqConfirmationAck as c0, RfqConfirmationError as c1, RfqConfirmationRejectedError as c2, type RfqConfirmationRequestEvent as c3, type RfqEvent as c4, RfqQuoteError as c5, type RfqQuoteReference as c6, RfqQuoteRejectedError as c7, type RfqQuoteRejectedErrorOptions as c8, type RfqQuoteRequestEvent as c9, type SignerTransactionRequest as cA, SigningError as cB, SplitPositionError as cC, SubscribeError as cD, TimeoutError as cE, TransactionFailedError as cF, type TransactionHandle as cG, type TransactionOutcome as cH, TransferErc20Error as cI, TransportError as cJ, type TypedDataDomain as cK, type TypedDataField as cL, UnexpectedResponseError as cM, UpdatePerpsLeverageError as cN, type UpdatePerpsLeverageRequest as cO, UpdatePerpsMarginError as cP, type UpdatePerpsMarginRequest as cQ, WaitForOrderFillSettlementError as cR, WaitForTransactionError as cS, type WalletDerivationConfig as cT, type WebSocketCloseCode as cU, type WebSocketEndpoint as cV, WebSocketKnownCloseCode as cW, WithdrawFromPerpsError as cX, type WithdrawFromPerpsRequest as cY, accountActions as cZ, allActions as c_, type RfqQuoteResponse as ca, type RfqQuoteSource as cb, type RfqSession as cc, type RfqTradeEvent as cd, SearchError as ce, SearchSort as cf, type SecureAccountActions as cg, type SecureActions as ch, type SecureClient as ci, type SecureClientOptions as cj, type SecureDownloadAccountingSnapshotRequest as ck, type SecureFetchPortfolioValueRequest as cl, type SecureFetchTradedMarketCountRequest as cm, type SecureListActivityRequest as cn, type SecureListClosedPositionsRequest as co, type SecureListComboActivityRequest as cp, type SecureListComboPositionsRequest as cq, type SecureListPositionsRequest as cr, type SecurePerpsActions as cs, type SecureRewardsActions as ct, type SecureRfqActions as cu, type SecureSubscriptionsActions as cv, type SecureTradingActions as cw, type SecureWalletActions as cx, SetupGaslessWalletError as cy, SetupTradingApprovalsError as cz, type AnalyticsActions as d, type FetchOrdersScoringRequest as d$, createPublicClient as d0, createSecureClient as d1, dataActions as d2, discoveryActions as d3, forkEnvironmentConfig as d4, makeErrorGuard as d5, perpsActions as d6, production as d7, rewardsActions as d8, rfqActions as d9, type EventForSubscriptionSpec as dA, type EventForSubscriptionSpecs as dB, FetchBalanceAllowanceError as dC, type FetchBalanceAllowanceRequest as dD, FetchBuilderFeeRatesError as dE, type FetchBuilderFeeRatesRequest as dF, type FetchCommentsByIdRequest as dG, type FetchEventLiveVolumeRequest as dH, type FetchEventRequest as dI, type FetchEventTagsRequest as dJ, FetchExecuteParamsError as dK, type FetchExecuteParamsRequest as dL, type FetchGaslessTransactionRequest as dM, type FetchLastTradePriceRequest as dN, type FetchLastTradePricesRequest as dO, FetchMarketInfoError as dP, type FetchMarketInfoRequest as dQ, type FetchMarketRequest as dR, type FetchMarketTagsRequest as dS, type FetchMidpointRequest as dT, type FetchMidpointsRequest as dU, FetchNegRiskError as dV, type FetchNegRiskRequest as dW, type FetchOrderBookRequest as dX, type FetchOrderBooksRequest as dY, type FetchOrderRequest as dZ, type FetchOrderScoringRequest as d_, subscriptionsActions as da, tradingActions as db, walletActions as dc, type CancelMarketOrdersRequest as dd, type CancelOrderRequest as de, type CancelOrdersRequest as df, type CollateralReturnExecutionWorkflow as dg, type CommentsEventType as dh, type CommentsSubscription as di, type CryptoPricesEventType as dj, type CryptoPricesSubscription as dk, DeployDepositWalletError as dl, type DownloadAccountingSnapshotRequest as dm, type DropNotificationsRequest as dn, type EquityPricesEventType as dp, type EquityPricesSubscription as dq, type Erc1155ApprovalForAllWorkflow as dr, type Erc1155ApprovalForAllWorkflowRequest as ds, type Erc20ApprovalWorkflow as dt, type Erc20ApprovalWorkflowRequest as du, type Erc20TransferWorkflow as dv, type Erc20TransferWorkflowRequest as dw, type EstimateMarketBuyPriceRequest as dx, type EstimateMarketPriceRequest as dy, type EstimateMarketSellPriceRequest as dz, ApproveErc1155ForAllError as e, type PerpsDepositWorkflowRequest as e$, type FetchPortfolioValueRequest as e0, type FetchPriceHistoryRequest as e1, type FetchPriceRequest as e2, type FetchPricesRequest as e3, type FetchPublicProfileRequest as e4, type FetchRelatedTagResourcesRequest as e5, type FetchRelatedTagsRequest as e6, type FetchSeriesRequest as e7, type FetchSpreadRequest as e8, type FetchSpreadsRequest as e9, type ListMarketPositionsRequest as eA, type ListMarketRewardsRequest as eB, type ListMarketsRequest as eC, type ListOpenInterestRequest as eD, type ListOpenOrdersRequest as eE, type ListPositionsRequest as eF, type ListSeriesRequest as eG, type ListTagsRequest as eH, type ListTeamsRequest as eI, type ListTraderLeaderboardRequest as eJ, type ListTradesRequest as eK, type ListUserEarningsAndMarketsConfigRequest as eL, type ListUserEarningsForDayRequest as eM, type MarketEventType as eN, type MarketSubscription as eO, MergeComboPositionError as eP, MergeMarketPositionError as eQ, type MergePositionsWorkflow as eR, type MergePositionsWorkflowRequest as eS, type OrderDraft as eT, type OrderPostingWorkflow as eU, type OrderWorkflow as eV, type OrderWorkflowRequest as eW, type PerpsBboSubscription as eX, type PerpsBookSubscription as eY, type PerpsCandlesSubscription as eZ, type PerpsDepositWorkflow as e_, type FetchTagRequest as ea, FetchTickSizeError as eb, type FetchTickSizeRequest as ec, type FetchTotalEarningsForUserForDayRequest as ed, type FetchTradedMarketCountRequest as ee, GaslessTransactionMetadataSchema as ef, type GaslessWorkflow as eg, type GaslessWorkflowRequest as eh, IsWalletDeployedError as ei, type IsWalletDeployedRequest as ej, type ListAccountTradesRequest as ek, type ListActivityRequest as el, type ListBuilderLeaderboardRequest as em, type ListBuilderTradesRequest as en, type ListBuilderVolumeRequest as eo, type ListClosedPositionsRequest as ep, type ListComboActivityRequest as eq, type ListComboMarketsRequest as er, type ListComboPositionsRequest as es, type ListCommentsByUserAddressRequest as et, type ListCommentsRequest as eu, type ListCurrentRewardsRequest as ev, type ListEventsRequest as ew, ListMarketClarificationsError as ex, type ListMarketClarificationsRequest as ey, type ListMarketHoldersRequest as ez, ApproveErc20Error as f, type SubscriptionHandle as f$, type PerpsMarketDataEventType as f0, type PerpsMarketDataSubscription as f1, type PerpsStatisticsSubscription as f2, type PerpsStreamingCandleInterval as f3, type PerpsTickersSubscription as f4, type PerpsTradesSubscription as f5, type PostOrdersRequest as f6, PrepareCollateralReturnExecutionError as f7, PrepareErc1155ApprovalForAllError as f8, type PrepareErc1155ApprovalForAllRequest as f9, type PrepareSplitComboPositionRequest as fA, PrepareSplitMarketPositionError as fB, type PrepareSplitMarketPositionRequest as fC, PrepareSplitPositionError as fD, type PrepareSplitPositionRequest as fE, PrepareTradingApprovalsError as fF, type PublicRealtimeEvent as fG, type PublicRealtimeTopic as fH, type PublicSubscriptionSpec as fI, type RedeemPositionsWorkflow as fJ, type RedeemPositionsWorkflowRequest as fK, ResolveConditionByTokenError as fL, type ResolveConditionByTokenRequest as fM, type RfqConfirmationRejectedErrorOptions as fN, type RfqExecutionUpdateEvent as fO, type SearchRequest as fP, type SearchResults as fQ, type SecureRealtimeEvent as fR, type SecureRealtimeTopic as fS, type SecureSubscriptionSpec as fT, type SignedOrder as fU, SplitComboPositionError as fV, SplitMarketPositionError as fW, type SplitPositionWorkflow as fX, type SplitPositionWorkflowRequest as fY, type SportsEventType as fZ, type SportsSubscription as f_, PrepareErc20ApprovalError as fa, type PrepareErc20ApprovalRequest as fb, PrepareErc20TransferError as fc, type PrepareErc20TransferRequest as fd, PrepareGaslessTransactionError as fe, type PrepareGaslessTransactionRequest as ff, type PrepareLimitOrderRequest as fg, type PrepareMarketBuyOrderRequest as fh, type PrepareMarketOrderRequest as fi, type PrepareMarketSellOrderRequest as fj, PrepareMergeComboPositionError as fk, type PrepareMergeComboPositionRequest as fl, PrepareMergeMarketPositionError as fm, type PrepareMergeMarketPositionRequest as fn, PrepareMergePositionsError as fo, type PrepareMergePositionsRequest as fp, PreparePerpsDepositError as fq, PrepareRedeemComboPositionError as fr, type PrepareRedeemComboPositionRequest as fs, type PrepareRedeemMarketPositionsByConditionIdRequest as ft, type PrepareRedeemMarketPositionsByMarketIdRequest as fu, PrepareRedeemMarketPositionsError as fv, type PrepareRedeemMarketPositionsRequest as fw, PrepareRedeemPositionsError as fx, type PrepareRedeemPositionsRequest as fy, PrepareSplitComboPositionError as fz, BasePublicClient as g, fetchTransaction as g$, type TradingApprovalsWorkflow as g0, type TradingApprovalsWorkflowRequest as g1, UpdateBalanceAllowanceError as g2, type UpdateBalanceAllowanceRequest as g3, type UserEventType as g4, type UserSubscription as g5, WaitForGaslessTransactionError as g6, type WaitForOrderFillSettlementRequest as g7, approveErc1155ForAll as g8, approveErc20 as g9, fetchNegRisk as gA, fetchNotifications as gB, fetchOrder as gC, fetchOrderBook as gD, fetchOrderBooks as gE, fetchOrderScoring as gF, fetchOrdersScoring as gG, fetchPerpsBook as gH, fetchPerpsFees as gI, fetchPerpsInstruments as gJ, fetchPerpsTicker as gK, fetchPerpsTickers as gL, fetchPortfolioValue as gM, fetchPrice as gN, fetchPriceHistory as gO, fetchPrices as gP, fetchPublicProfile as gQ, fetchRelatedTagResources as gR, fetchRelatedTags as gS, fetchRewardPercentages as gT, fetchSeries as gU, fetchSpread as gV, fetchSpreads as gW, fetchTag as gX, fetchTickSize as gY, fetchTotalEarningsForUserForDay as gZ, fetchTradedMarketCount as g_, cancelAll as ga, cancelMarketOrders as gb, cancelOrder as gc, cancelOrders as gd, deployDepositWallet as ge, depositToPerps as gf, downloadAccountingSnapshot as gg, dropNotifications as gh, estimateMarketPrice as gi, executeCollateralReturnPlan as gj, fetchBalanceAllowance as gk, fetchBuilderFeeRates as gl, fetchBuilderVolume as gm, fetchClosedOnlyMode as gn, fetchCommentsById as go, fetchEvent as gp, fetchEventLiveVolume as gq, fetchEventTags as gr, fetchExecuteParams as gs, fetchLastTradePrice as gt, fetchLastTradePrices as gu, fetchMarket as gv, fetchMarketInfo as gw, fetchMarketTags as gx, fetchMidpoint as gy, fetchMidpoints as gz, BaseSecureClient as h, subscribe as h$, isWalletDeployed as h0, listAccountTrades as h1, listActivity as h2, listBuilderLeaderboard as h3, listBuilderTrades as h4, listClosedPositions as h5, listComboActivity as h6, listComboMarkets as h7, listComboPositions as h8, listComments as h9, planCollateralReturn as hA, postOrder as hB, postOrders as hC, prepareCollateralReturnExecution as hD, prepareErc1155ApprovalForAll as hE, prepareErc20Approval as hF, prepareErc20Transfer as hG, prepareGaslessTransaction as hH, prepareMergeComboPosition as hI, prepareMergeMarketPosition as hJ, prepareMergePositions as hK, preparePerpsDeposit as hL, prepareRedeemComboPosition as hM, prepareRedeemMarketPositions as hN, prepareRedeemPositions as hO, prepareSplitComboPosition as hP, prepareSplitMarketPosition as hQ, prepareSplitPosition as hR, prepareTradingApprovals as hS, redeemPositions as hT, resolveConditionByToken as hU, revokePerpsCredentials as hV, search as hW, setupTradingApprovals as hX, splitComboPosition as hY, splitMarketPosition as hZ, splitPosition as h_, listCommentsByUserAddress as ha, listCurrentRewards as hb, listEvents as hc, listMarketClarifications as hd, listMarketHolders as he, listMarketPositions as hf, listMarketRewards as hg, listMarkets as hh, listOpenInterest as hi, listOpenOrders as hj, listPerpsCandles as hk, listPerpsFundingHistory as hl, listPerpsTrades as hm, listPositions as hn, listSeries as ho, listTags as hp, listTeams as hq, listTraderLeaderboard as hr, listTrades as hs, listUserEarningsAndMarketsConfig as ht, listUserEarningsForDay as hu, mergeComboPosition as hv, mergeMarketPosition as hw, mergePositions as hx, openPerpsSession as hy, openRfqSession as hz, type BeginAuthenticationRequest as i, transferErc20 as i0, updateBalanceAllowance as i1, waitForOrderFillSettlement as i2, withdrawFromPerps as i3, type CancelAllPerpsOrdersRequest as j, CancelMarketOrdersError as k, CancelOrderError as l, CancelOrdersError as m, type CancelPerpsOrderRequest as n, type CancelPerpsOrdersRequest as o, CancelledSigningError as p, type Client as q, type ClientActions as r, type ClientDecorator as s, type ClobEndpoints as t, ComboPositionSort as u, type CombosEndpoints as v, ConnectionLostError as w, type ConnectionLostErrorOptions as x, type CreatePerpsSessionRequest as y, CreateSecureClientError as z };
9332
+ export { FetchClosedOnlyModeError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, ComboPositionSort as D, type ComboQuote as E, type CombosEndpoints as F, ConnectionLostError as G, type ConnectionLostErrorOptions as H, type CreatePerpsSessionRequest as I, CreateSecureClientError as J, type CryptoPricesChainlinkTwapSubscription as K, type DataActions as L, DepositToPerpsError as M, type DepositToPerpsRequest as N, type DisarmPerpsAutoCancelRequest as O, type DiscoveryActions as P, DownloadAccountingSnapshotError as Q, DropNotificationsError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, type EnvironmentConfig as V, type EnvironmentConfigFork as W, type EnvironmentContracts as X, EstimateMarketPriceError as Y, ExecuteCollateralReturnPlanError as Z, type ExecuteCollateralReturnPlanRequest as _, type TypedData as a, ListOpenOrdersError as a$, FetchCommentsByIdError as a0, FetchEventError as a1, FetchEventLiveVolumeError as a2, FetchEventTagsError as a3, FetchLastTradePriceError as a4, FetchLastTradePricesError as a5, FetchMarketError as a6, FetchMarketTagsError as a7, FetchMidpointError as a8, FetchMidpointsError as a9, FetchRfqStatusError as aA, type FetchRfqStatusParams as aB, FetchSeriesError as aC, FetchSpreadError as aD, FetchSpreadsError as aE, FetchTagError as aF, FetchTotalEarningsForUserForDayError as aG, FetchTradedMarketCountError as aH, InsufficientLiquidityError as aI, ListAccountTradesError as aJ, ListActivityError as aK, ListBuilderLeaderboardError as aL, ListBuilderTradesError as aM, ListBuilderVolumeError as aN, ListClosedPositionsError as aO, ListComboActivityError as aP, ListComboMarketsError as aQ, ListComboPositionsError as aR, ListCommentsByUserAddressError as aS, ListCommentsError as aT, ListCurrentRewardsError as aU, ListEventsError as aV, ListMarketHoldersError as aW, ListMarketPositionsError as aX, ListMarketRewardsError as aY, ListMarketsError as aZ, ListOpenInterestError as a_, FetchNotificationsError as aa, FetchOrderBookError as ab, FetchOrderBooksError as ac, FetchOrderError as ad, FetchOrderScoringError as ae, FetchOrdersScoringError as af, type FetchPerpsAccountConfigRequest as ag, FetchPerpsBookError as ah, type FetchPerpsBookRequest as ai, FetchPerpsFeesError as aj, FetchPerpsInstrumentsError as ak, type FetchPerpsInstrumentsRequest as al, type FetchPerpsOpenOrdersRequest as am, type FetchPerpsOrdersRequest as an, FetchPerpsTickerError as ao, type FetchPerpsTickerRequest as ap, FetchPerpsTickersError as aq, type FetchPerpsTickersRequest as ar, FetchPortfolioValueError as as, FetchPriceError as at, FetchPriceHistoryError as au, FetchPricesError as av, FetchPublicProfileError as aw, FetchRelatedTagResourcesError as ax, FetchRelatedTagsError as ay, FetchRewardPercentagesError as az, type TransactionCall as b, RedeemPositionsError as b$, ListPerpsCandlesError as b0, type ListPerpsCandlesRequest as b1, type ListPerpsDepositsRequest as b2, type ListPerpsEquityHistoryRequest as b3, type ListPerpsFillsRequest as b4, ListPerpsFundingHistoryError as b5, type ListPerpsFundingHistoryRequest as b6, type ListPerpsFundingPaymentsRequest as b7, type ListPerpsNotificationsRequest as b8, type ListPerpsPnlHistoryRequest as b9, type PerpsPlacedTpSlOrder as bA, type PerpsPlacedTpSlOrders as bB, type PerpsPositionTpSlTrigger as bC, PerpsSession as bD, type PerpsSessionAccountError as bE, type PerpsSessionLifecycleError as bF, type PerpsSessionTradingError as bG, type PerpsTpSlTrigger as bH, type PlacePerpsOrderRequest as bI, type PlacePerpsOrderResult as bJ, type PlacePerpsOrderWithTpSlRequest as bK, type PlacePerpsOrderWithTpSlResult as bL, type PlacePerpsPositionTpSlRequest as bM, type PlacePerpsPositionTpSlResult as bN, PlanCollateralReturnError as bO, PostOrderError as bP, PostOrdersError as bQ, type PostPerpsOrdersRequest as bR, type PublicAccountActions as bS, type PublicActions as bT, type PublicClient as bU, type PublicClientOptions as bV, type PublicPerpsActions as bW, type PublicRewardsActions as bX, type PublicSubscriptionsActions as bY, RateLimitError as bZ, type RateLimitErrorOptions as b_, ListPerpsTradesError as ba, type ListPerpsTradesRequest as bb, type ListPerpsWithdrawalsRequest as bc, ListPositionsError as bd, ListSeriesError as be, ListTagsError as bf, ListTeamsError as bg, ListTraderLeaderboardError as bh, ListTradesError as bi, ListUserEarningsAndMarketsConfigError as bj, ListUserEarningsForDayError as bk, type MarkPerpsNotificationsReadRequest as bl, MergePositionsError as bm, OpenPerpsSessionError as bn, type OpenPerpsSessionRequest as bo, OpenRfqSessionError as bp, type Page as bq, PageSizeSchema as br, type Paginated as bs, type PerpsActions as bt, type PerpsBookDepth as bu, type PerpsEndpoints as bv, type PerpsOrderRequest as bw, type PerpsPlaceFokOrderRequest as bx, type PerpsPlaceGtcOrderRequest as by, type PerpsPlaceIocOrderRequest as bz, AcceptComboQuoteError as c, type TypedDataField as c$, RequestComboQuoteError as c0, type RequestComboQuoteParams as c1, type RequestComboQuoteResult as c2, RequestRejectedError as c3, type RequestRejectedErrorOptions as c4, type RestEndpoint as c5, type ResumePerpsSessionRequest as c6, RevokePerpsCredentialsError as c7, type RevokePerpsCredentialsRequest as c8, type RfqCancelQuoteAck as c9, type SecureDownloadAccountingSnapshotRequest as cA, type SecureFetchPortfolioValueRequest as cB, type SecureFetchTradedMarketCountRequest as cC, type SecureListActivityRequest as cD, type SecureListClosedPositionsRequest as cE, type SecureListComboActivityRequest as cF, type SecureListComboPositionsRequest as cG, type SecureListPositionsRequest as cH, type SecurePerpsActions as cI, type SecureRewardsActions as cJ, type SecureRfqActions as cK, type SecureSubscriptionsActions as cL, type SecureTradingActions as cM, type SecureWalletActions as cN, SetupGaslessWalletError as cO, SetupTradingApprovalsError as cP, type SignerTransactionRequest as cQ, SigningError as cR, SplitPositionError as cS, SubscribeError as cT, TimeoutError as cU, TransactionFailedError as cV, type TransactionHandle as cW, type TransactionOutcome as cX, TransferErc20Error as cY, TransportError as cZ, type TypedDataDomain as c_, RfqCancelQuoteError as ca, RfqCancelQuoteRejectedError as cb, type RfqCancelQuoteRejectedErrorOptions as cc, type RfqConfirmationAck as cd, RfqConfirmationError as ce, RfqConfirmationRejectedError as cf, type RfqConfirmationRequestEvent as cg, type RfqEvent as ch, RfqQuoteError as ci, type RfqQuoteReference as cj, RfqQuoteRejectedError as ck, type RfqQuoteRejectedErrorOptions as cl, type RfqQuoteRequestEvent as cm, type RfqQuoteResponse as cn, type RfqQuoteSource as co, RfqRequestRejectedError as cp, type RfqRequestRejectedErrorOptions as cq, type RfqSession as cr, type RfqStatusResult as cs, type RfqTradeEvent as ct, SearchError as cu, SearchSort as cv, type SecureAccountActions as cw, type SecureActions as cx, type SecureClient as cy, type SecureClientOptions as cz, type AcceptComboQuoteParams as d, type FetchEventRequest as d$, UnexpectedResponseError as d0, UpdatePerpsLeverageError as d1, type UpdatePerpsLeverageRequest as d2, UpdatePerpsMarginError as d3, type UpdatePerpsMarginRequest as d4, WaitForComboFillError as d5, type WaitForComboFillParams as d6, type WaitForComboFillResult as d7, WaitForOrderFillSettlementError as d8, WaitForTransactionError as d9, type CollateralReturnExecutionWorkflow as dA, type CommentsEventType as dB, type CommentsSubscription as dC, type CryptoPricesEventType as dD, type CryptoPricesSubscription as dE, DeployDepositWalletError as dF, type DownloadAccountingSnapshotRequest as dG, type DropNotificationsRequest as dH, type EquityPricesEventType as dI, type EquityPricesSubscription as dJ, type Erc1155ApprovalForAllWorkflow as dK, type Erc1155ApprovalForAllWorkflowRequest as dL, type Erc20ApprovalWorkflow as dM, type Erc20ApprovalWorkflowRequest as dN, type Erc20TransferWorkflow as dO, type Erc20TransferWorkflowRequest as dP, type EstimateMarketBuyPriceRequest as dQ, type EstimateMarketPriceRequest as dR, type EstimateMarketSellPriceRequest as dS, type EventForSubscriptionSpec as dT, type EventForSubscriptionSpecs as dU, FetchBalanceAllowanceError as dV, type FetchBalanceAllowanceRequest as dW, FetchBuilderFeeRatesError as dX, type FetchBuilderFeeRatesRequest as dY, type FetchCommentsByIdRequest as dZ, type FetchEventLiveVolumeRequest as d_, type WalletDerivationConfig as da, type WebSocketCloseCode as db, type WebSocketEndpoint as dc, WebSocketKnownCloseCode as dd, WithdrawFromPerpsError as de, type WithdrawFromPerpsRequest as df, accountActions as dg, allActions as dh, analyticsActions as di, createPublicClient as dj, createSecureClient as dk, dataActions as dl, discoveryActions as dm, forkEnvironmentConfig as dn, makeErrorGuard as dp, perpsActions as dq, production as dr, rewardsActions as ds, rfqActions as dt, subscriptionsActions as du, tradingActions as dv, walletActions as dw, type CancelMarketOrdersRequest as dx, type CancelOrderRequest as dy, type CancelOrdersRequest as dz, type AcceptComboQuoteResult as e, type ListTeamsRequest as e$, type FetchEventTagsRequest as e0, FetchExecuteParamsError as e1, type FetchExecuteParamsRequest as e2, type FetchGaslessTransactionRequest as e3, type FetchLastTradePriceRequest as e4, type FetchLastTradePricesRequest as e5, FetchMarketInfoError as e6, type FetchMarketInfoRequest as e7, type FetchMarketRequest as e8, type FetchMarketTagsRequest as e9, type GaslessWorkflowRequest as eA, IsWalletDeployedError as eB, type IsWalletDeployedRequest as eC, type ListAccountTradesRequest as eD, type ListActivityRequest as eE, type ListBuilderLeaderboardRequest as eF, type ListBuilderTradesRequest as eG, type ListBuilderVolumeRequest as eH, type ListClosedPositionsRequest as eI, type ListComboActivityRequest as eJ, type ListComboMarketsRequest as eK, type ListComboPositionsRequest as eL, type ListCommentsByUserAddressRequest as eM, type ListCommentsRequest as eN, type ListCurrentRewardsRequest as eO, type ListEventsRequest as eP, ListMarketClarificationsError as eQ, type ListMarketClarificationsRequest as eR, type ListMarketHoldersRequest as eS, type ListMarketPositionsRequest as eT, type ListMarketRewardsRequest as eU, type ListMarketsRequest as eV, type ListOpenInterestRequest as eW, type ListOpenOrdersRequest as eX, type ListPositionsRequest as eY, type ListSeriesRequest as eZ, type ListTagsRequest as e_, type FetchMidpointRequest as ea, type FetchMidpointsRequest as eb, FetchNegRiskError as ec, type FetchNegRiskRequest as ed, type FetchOrderBookRequest as ee, type FetchOrderBooksRequest as ef, type FetchOrderRequest as eg, type FetchOrderScoringRequest as eh, type FetchOrdersScoringRequest as ei, type FetchPortfolioValueRequest as ej, type FetchPriceHistoryRequest as ek, type FetchPriceRequest as el, type FetchPricesRequest as em, type FetchPublicProfileRequest as en, type FetchRelatedTagResourcesRequest as eo, type FetchRelatedTagsRequest as ep, type FetchSeriesRequest as eq, type FetchSpreadRequest as er, type FetchSpreadsRequest as es, type FetchTagRequest as et, FetchTickSizeError as eu, type FetchTickSizeRequest as ev, type FetchTotalEarningsForUserForDayRequest as ew, type FetchTradedMarketCountRequest as ex, GaslessTransactionMetadataSchema as ey, type GaslessWorkflow as ez, type AccountIdentity as f, type PublicSubscriptionSpec as f$, type ListTraderLeaderboardRequest as f0, type ListTradesRequest as f1, type ListUserEarningsAndMarketsConfigRequest as f2, type ListUserEarningsForDayRequest as f3, type MarketEventType as f4, type MarketSubscription as f5, MergeComboPositionError as f6, MergeMarketPositionError as f7, type MergePositionsWorkflow as f8, type MergePositionsWorkflowRequest as f9, type PrepareMarketBuyOrderRequest as fA, type PrepareMarketOrderRequest as fB, type PrepareMarketSellOrderRequest as fC, PrepareMergeComboPositionError as fD, type PrepareMergeComboPositionRequest as fE, PrepareMergeMarketPositionError as fF, type PrepareMergeMarketPositionRequest as fG, PrepareMergePositionsError as fH, type PrepareMergePositionsRequest as fI, PreparePerpsDepositError as fJ, PrepareRedeemComboPositionError as fK, type PrepareRedeemComboPositionRequest as fL, type PrepareRedeemMarketPositionsByConditionIdRequest as fM, type PrepareRedeemMarketPositionsByMarketIdRequest as fN, PrepareRedeemMarketPositionsError as fO, type PrepareRedeemMarketPositionsRequest as fP, PrepareRedeemPositionsError as fQ, type PrepareRedeemPositionsRequest as fR, PrepareSplitComboPositionError as fS, type PrepareSplitComboPositionRequest as fT, PrepareSplitMarketPositionError as fU, type PrepareSplitMarketPositionRequest as fV, PrepareSplitPositionError as fW, type PrepareSplitPositionRequest as fX, PrepareTradingApprovalsError as fY, type PublicRealtimeEvent as fZ, type PublicRealtimeTopic as f_, type OrderDraft as fa, type OrderPostingWorkflow as fb, type OrderWorkflow as fc, type OrderWorkflowRequest as fd, type PerpsBboSubscription as fe, type PerpsBookSubscription as ff, type PerpsCandlesSubscription as fg, type PerpsDepositWorkflow as fh, type PerpsDepositWorkflowRequest as fi, type PerpsMarketDataEventType as fj, type PerpsMarketDataSubscription as fk, type PerpsStatisticsSubscription as fl, type PerpsStreamingCandleInterval as fm, type PerpsTickersSubscription as fn, type PerpsTradesSubscription as fo, type PostOrdersRequest as fp, PrepareCollateralReturnExecutionError as fq, PrepareErc1155ApprovalForAllError as fr, type PrepareErc1155ApprovalForAllRequest as fs, PrepareErc20ApprovalError as ft, type PrepareErc20ApprovalRequest as fu, PrepareErc20TransferError as fv, type PrepareErc20TransferRequest as fw, PrepareGaslessTransactionError as fx, type PrepareGaslessTransactionRequest as fy, type PrepareLimitOrderRequest as fz, type AnalyticsActions as g, fetchPerpsBook as g$, type RedeemPositionsWorkflow as g0, type RedeemPositionsWorkflowRequest as g1, ResolveConditionByTokenError as g2, type ResolveConditionByTokenRequest as g3, type RfqConfirmationRejectedErrorOptions as g4, type RfqExecutionUpdateEvent as g5, type SearchRequest as g6, type SearchResults as g7, type SecureRealtimeEvent as g8, type SecureRealtimeTopic as g9, downloadAccountingSnapshot as gA, dropNotifications as gB, estimateMarketPrice as gC, executeCollateralReturnPlan as gD, fetchBalanceAllowance as gE, fetchBuilderFeeRates as gF, fetchBuilderVolume as gG, fetchClosedOnlyMode as gH, fetchCommentsById as gI, fetchEvent as gJ, fetchEventLiveVolume as gK, fetchEventTags as gL, fetchExecuteParams as gM, fetchLastTradePrice as gN, fetchLastTradePrices as gO, fetchMarket as gP, fetchMarketInfo as gQ, fetchMarketTags as gR, fetchMidpoint as gS, fetchMidpoints as gT, fetchNegRisk as gU, fetchNotifications as gV, fetchOrder as gW, fetchOrderBook as gX, fetchOrderBooks as gY, fetchOrderScoring as gZ, fetchOrdersScoring as g_, type SecureSubscriptionSpec as ga, type SignedOrder as gb, SplitComboPositionError as gc, SplitMarketPositionError as gd, type SplitPositionWorkflow as ge, type SplitPositionWorkflowRequest as gf, type SportsEventType as gg, type SportsSubscription as gh, type SubscriptionHandle as gi, type TradingApprovalsWorkflow as gj, type TradingApprovalsWorkflowRequest as gk, UpdateBalanceAllowanceError as gl, type UpdateBalanceAllowanceRequest as gm, type UserEventType as gn, type UserSubscription as go, WaitForGaslessTransactionError as gp, type WaitForOrderFillSettlementRequest as gq, acceptComboQuote as gr, approveErc1155ForAll as gs, approveErc20 as gt, cancelAll as gu, cancelMarketOrders as gv, cancelOrder as gw, cancelOrders as gx, deployDepositWallet as gy, depositToPerps as gz, ApproveErc1155ForAllError as h, prepareErc20Transfer as h$, fetchPerpsFees as h0, fetchPerpsInstruments as h1, fetchPerpsTicker as h2, fetchPerpsTickers as h3, fetchPortfolioValue as h4, fetchPrice as h5, fetchPriceHistory as h6, fetchPrices as h7, fetchPublicProfile as h8, fetchRelatedTagResources as h9, listMarketPositions as hA, listMarketRewards as hB, listMarkets as hC, listOpenInterest as hD, listOpenOrders as hE, listPerpsCandles as hF, listPerpsFundingHistory as hG, listPerpsTrades as hH, listPositions as hI, listSeries as hJ, listTags as hK, listTeams as hL, listTraderLeaderboard as hM, listTrades as hN, listUserEarningsAndMarketsConfig as hO, listUserEarningsForDay as hP, mergeComboPosition as hQ, mergeMarketPosition as hR, mergePositions as hS, openPerpsSession as hT, openRfqSession as hU, planCollateralReturn as hV, postOrder as hW, postOrders as hX, prepareCollateralReturnExecution as hY, prepareErc1155ApprovalForAll as hZ, prepareErc20Approval as h_, fetchRelatedTags as ha, fetchRewardPercentages as hb, fetchRfqStatus as hc, fetchSeries as hd, fetchSpread as he, fetchSpreads as hf, fetchTag as hg, fetchTickSize as hh, fetchTotalEarningsForUserForDay as hi, fetchTradedMarketCount as hj, fetchTransaction as hk, isWalletDeployed as hl, listAccountTrades as hm, listActivity as hn, listBuilderLeaderboard as ho, listBuilderTrades as hp, listClosedPositions as hq, listComboActivity as hr, listComboMarkets as hs, listComboPositions as ht, listComments as hu, listCommentsByUserAddress as hv, listCurrentRewards as hw, listEvents as hx, listMarketClarifications as hy, listMarketHolders as hz, ApproveErc20Error as i, prepareGaslessTransaction as i0, prepareMergeComboPosition as i1, prepareMergeMarketPosition as i2, prepareMergePositions as i3, preparePerpsDeposit as i4, prepareRedeemComboPosition as i5, prepareRedeemMarketPositions as i6, prepareRedeemPositions as i7, prepareSplitComboPosition as i8, prepareSplitMarketPosition as i9, prepareSplitPosition as ia, prepareTradingApprovals as ib, redeemPositions as ic, requestComboQuote as id, resolveConditionByToken as ie, revokePerpsCredentials as ig, search as ih, setupTradingApprovals as ii, splitComboPosition as ij, splitMarketPosition as ik, splitPosition as il, subscribe as im, transferErc20 as io, updateBalanceAllowance as ip, waitForComboFill as iq, waitForOrderFillSettlement as ir, withdrawFromPerps as is, ArmPerpsAutoCancelError as j, type ArmPerpsAutoCancelRequest as k, AutoCancelDailyLimitError as l, BasePublicClient as m, BaseSecureClient as n, type BeginAuthenticationRequest as o, type CancelAllPerpsOrdersRequest as p, CancelMarketOrdersError as q, CancelOrderError as r, CancelOrdersError as s, type CancelPerpsOrderRequest as t, type CancelPerpsOrdersRequest as u, CancelledSigningError as v, type Client as w, type ClientActions as x, type ClientDecorator as y, type ClobEndpoints as z };