@polymarket/client 0.3.0 → 0.5.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.
package/dist/node.js CHANGED
@@ -1,3 +1,3 @@
1
- import {e}from'./chunk-KZISI26J.js';import g from'process';import {invariant}from'@polymarket/types';async function u(t,e,r,i,n){let s=`${e}${r}${i}`;n!==void 0&&(s+=n);let y=await globalThis.crypto.subtle.importKey("raw",l(t),{name:"HMAC",hash:"SHA-256"},false,["sign"]),c=await globalThis.crypto.subtle.sign("HMAC",y,new TextEncoder().encode(s));return f(d(c))}function l(t){let e=t.replace(/-/g,"+").replace(/_/g,"/").replace(/[^A-Za-z0-9+/=]/g,""),r=atob(e),i=new Uint8Array(r.length);for(let n=0;n<r.length;n+=1)i[n]=r.charCodeAt(n);return i.buffer}function d(t){let e=new Uint8Array(t),r="";for(let i of e)r+=String.fromCharCode(i);return btoa(r)}function f(t){return t.replace(/\+/g,"-").replace(/\//g,"_")}invariant(g.release.name==="node","The @polymarket/client/node entrypoint requires a Node.js runtime.");invariant(typeof window>"u"&&typeof document>"u","The @polymarket/client/node entrypoint cannot be imported in a browser-like runtime.");function K(t){return new o(t)}var o=class{#e;constructor(e){this.#e=e;}get isBuilderKey(){return true}get supportGasless(){return true}async authorize(e){return this.#r(e)}async#r(e$1){try{let r=Math.floor(Date.now()/1e3);return {POLY_BUILDER_API_KEY:this.#e.key,POLY_BUILDER_PASSPHRASE:this.#e.passphrase,POLY_BUILDER_SIGNATURE:await u(this.#e.secret,r,e$1.method,e$1.path,e$1.body),POLY_BUILDER_TIMESTAMP:`${r}`}}catch(r){throw e.fromError(r,"Could not sign the builder-authenticated request")}}};
1
+ import {e}from'./chunk-E5XS4GYG.js';import g from'process';import {invariant}from'@polymarket/types';async function u(t,e,r,i,n){let s=`${e}${r}${i}`;n!==void 0&&(s+=n);let y=await globalThis.crypto.subtle.importKey("raw",l(t),{name:"HMAC",hash:"SHA-256"},false,["sign"]),c=await globalThis.crypto.subtle.sign("HMAC",y,new TextEncoder().encode(s));return f(d(c))}function l(t){let e=t.replace(/-/g,"+").replace(/_/g,"/").replace(/[^A-Za-z0-9+/=]/g,""),r=atob(e),i=new Uint8Array(r.length);for(let n=0;n<r.length;n+=1)i[n]=r.charCodeAt(n);return i.buffer}function d(t){let e=new Uint8Array(t),r="";for(let i of e)r+=String.fromCharCode(i);return btoa(r)}function f(t){return t.replace(/\+/g,"-").replace(/\//g,"_")}invariant(g.release.name==="node","The @polymarket/client/node entrypoint requires a Node.js runtime.");invariant(typeof window>"u"&&typeof document>"u","The @polymarket/client/node entrypoint cannot be imported in a browser-like runtime.");function K(t){return new o(t)}var o=class{#e;constructor(e){this.#e=e;}get isBuilderKey(){return true}get supportGasless(){return true}async authorize(e){return this.#r(e)}async#r(e$1){try{let r=Math.floor(Date.now()/1e3);return {POLY_BUILDER_API_KEY:this.#e.key,POLY_BUILDER_PASSPHRASE:this.#e.passphrase,POLY_BUILDER_SIGNATURE:await u(this.#e.secret,r,e$1.method,e$1.path,e$1.body),POLY_BUILDER_TIMESTAMP:`${r}`}}catch(r){throw e.fromError(r,"Could not sign the builder-authenticated request")}}};
2
2
  export{K as builderApiKey};//# sourceMappingURL=node.js.map
3
3
  //# sourceMappingURL=node.js.map
package/dist/privy.js CHANGED
@@ -1,2 +1,2 @@
1
- import {e as e$1,d,c,b as b$1,a}from'./chunk-KZISI26J.js';import h from'process';import {invariant,expectEvmAddress,expectTxHash,expectEvmSignature,never}from'@polymarket/types';import {Hex}from'ox';import {createPublicClient,http,WaitForTransactionReceiptTimeoutError}from'viem';import {waitForTransactionReceipt}from'viem/actions';import*as E from'viem/chains';invariant(h.release.name==="node","The @polymarket/client/privy entrypoint requires a Node.js runtime.");invariant(typeof window>"u"&&typeof document>"u","The @polymarket/client/privy entrypoint cannot be imported in a browser-like runtime.");var P=Object.values(E);function D(r){return {getAddress(){return b(r)},signTypedData(t){return A(r,t)},signMessage(t){return H(r,t)},async sendTransaction(t){return new o(await I(r,t),t.chainId)}}}async function b(r){try{let t=await r.privy.wallets().get(r.walletId);return expectEvmAddress(t.address)}catch(t){throw e$1.fromError(t,"Could not resolve signer address")}}async function I(r,t){try{let n=await r.privy.wallets().ethereum().sendTransaction(r.walletId,{authorization_context:r.authorizationContext,caip2:`eip155:${t.chainId}`,params:{transaction:{chain_id:t.chainId,data:t.data,to:t.to,value:t.value?.toString()}}});return expectTxHash(n.hash)}catch(n){s(n);}}async function A(r,t){try{let n=await r.privy.wallets().ethereum().signTypedData(r.walletId,{authorization_context:r.authorizationContext,params:{typed_data:{domain:e(t.domain),message:e(t.message),primary_type:t.primaryType,types:t.types}}});return expectEvmSignature(n.signature)}catch(n){s(n);}}async function H(r,t){try{let n=await r.privy.wallets().ethereum().signMessage(r.walletId,{authorization_context:r.authorizationContext,message:Hex.toBytes(t)});return expectEvmSignature(n.signature)}catch(n){s(n);}}function e(r){return typeof r=="bigint"?`${r}`:Array.isArray(r)?r.map(t=>e(t)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).flatMap(([t,n])=>n===void 0?[]:[[t,e(n)]])):r}function s(r){throw i(r)?new d("User rejected the signing request",{cause:r}):e$1.fromError(r)}function i(r,t=new Set){if(t.has(r)||r===null||typeof r!="object")return false;t.add(r);let n=r;return n.code===4001||n.code==="ACTION_REJECTED"||n.name==="APIUserAbortError"||i(n.error,t)||i(n.cause,t)}var o=class{transactionId=null;#r;#t;constructor(t,n){this.#r=n,this.#t=t;}get transactionHash(){return this.#t}async wait(){try{let t=await waitForTransactionReceipt(createPublicClient({chain:S(this.#r),transport:http()}),{hash:this.#t}),n=expectTxHash(t.transactionHash);if(this.#t=n,t.status==="reverted")throw new c(`Transaction ${n} reverted`);return {transactionHash:n,transactionId:null}}catch(t){throw t instanceof WaitForTransactionReceiptTimeoutError?new b$1(`Timed out waiting for transaction ${this.#t} to settle`,{cause:t}):a.fromError(t)}}};function S(r){let t=P.find(n=>n.id===r);if(t!==void 0)return t;never(`Unsupported chain ID for direct Privy transaction wait: ${r}`);}export{D as signerFrom};//# sourceMappingURL=privy.js.map
1
+ import {e as e$1,d,c,b as b$1,a}from'./chunk-E5XS4GYG.js';import h from'process';import {invariant,expectEvmAddress,expectTxHash,expectEvmSignature,never}from'@polymarket/types';import {Hex}from'ox';import {createPublicClient,http,WaitForTransactionReceiptTimeoutError}from'viem';import {waitForTransactionReceipt}from'viem/actions';import*as E from'viem/chains';invariant(h.release.name==="node","The @polymarket/client/privy entrypoint requires a Node.js runtime.");invariant(typeof window>"u"&&typeof document>"u","The @polymarket/client/privy entrypoint cannot be imported in a browser-like runtime.");var P=Object.values(E);function D(r){return {getAddress(){return b(r)},signTypedData(t){return A(r,t)},signMessage(t){return H(r,t)},async sendTransaction(t){return new o(await I(r,t),t.chainId)}}}async function b(r){try{let t=await r.privy.wallets().get(r.walletId);return expectEvmAddress(t.address)}catch(t){throw e$1.fromError(t,"Could not resolve signer address")}}async function I(r,t){try{let n=await r.privy.wallets().ethereum().sendTransaction(r.walletId,{authorization_context:r.authorizationContext,caip2:`eip155:${t.chainId}`,params:{transaction:{chain_id:t.chainId,data:t.data,to:t.to,value:t.value?.toString()}}});return expectTxHash(n.hash)}catch(n){s(n);}}async function A(r,t){try{let n=await r.privy.wallets().ethereum().signTypedData(r.walletId,{authorization_context:r.authorizationContext,params:{typed_data:{domain:e(t.domain),message:e(t.message),primary_type:t.primaryType,types:t.types}}});return expectEvmSignature(n.signature)}catch(n){s(n);}}async function H(r,t){try{let n=await r.privy.wallets().ethereum().signMessage(r.walletId,{authorization_context:r.authorizationContext,message:Hex.toBytes(t)});return expectEvmSignature(n.signature)}catch(n){s(n);}}function e(r){return typeof r=="bigint"?`${r}`:Array.isArray(r)?r.map(t=>e(t)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).flatMap(([t,n])=>n===void 0?[]:[[t,e(n)]])):r}function s(r){throw i(r)?new d("User rejected the signing request",{cause:r}):e$1.fromError(r)}function i(r,t=new Set){if(t.has(r)||r===null||typeof r!="object")return false;t.add(r);let n=r;return n.code===4001||n.code==="ACTION_REJECTED"||n.name==="APIUserAbortError"||i(n.error,t)||i(n.cause,t)}var o=class{transactionId=null;#r;#t;constructor(t,n){this.#r=n,this.#t=t;}get transactionHash(){return this.#t}async wait(){try{let t=await waitForTransactionReceipt(createPublicClient({chain:S(this.#r),transport:http()}),{hash:this.#t}),n=expectTxHash(t.transactionHash);if(this.#t=n,t.status==="reverted")throw new c(`Transaction ${n} reverted`);return {transactionHash:n,transactionId:null}}catch(t){throw t instanceof WaitForTransactionReceiptTimeoutError?new b$1(`Timed out waiting for transaction ${this.#t} to settle`,{cause:t}):a.fromError(t)}}};function S(r){let t=P.find(n=>n.id===r);if(t!==void 0)return t;never(`Unsupported chain ID for direct Privy transaction wait: ${r}`);}export{D as signerFrom};//# sourceMappingURL=privy.js.map
2
2
  //# sourceMappingURL=privy.js.map
@@ -1,5 +1,5 @@
1
1
  import { OrderResponse } from '@polymarket/bindings/clob';
2
- import { bP as RateLimitError, bS as RequestRejectedError, cB as SigningError, cJ as TransportError, cM as UnexpectedResponseError, U as UserInputError, ay as InsufficientLiquidityError, h as BaseSecureClient, fe as PrepareLimitOrderRequest, eT as OrderWorkflow, eS as OrderPostingWorkflow, fg as PrepareMarketOrderRequest, p as CancelledSigningError, bF as PostOrderError, cE as TimeoutError, cF as TransactionFailedError, fS as SignedOrder, B as BaseClient } from './types-BzzqPJTs.js';
2
+ import { bT as RateLimitError, bW as RequestRejectedError, cF as SigningError, cN as TransportError, cQ as UnexpectedResponseError, U as UserInputError, aC as InsufficientLiquidityError, k as BaseSecureClient, fk as PrepareLimitOrderRequest, eZ as OrderWorkflow, eY as OrderPostingWorkflow, fm as PrepareMarketOrderRequest, s as CancelledSigningError, bJ as PostOrderError, cI as TimeoutError, cJ as TransactionFailedError, fY as SignedOrder, B as BaseClient } from './types-BBaRrND2.js';
3
3
  import { SportsMarketTypesResponse, SportsMetadata } from '@polymarket/bindings/gamma';
4
4
 
5
5
  type PrepareMarketOrderError = InsufficientLiquidityError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
@@ -10,7 +10,7 @@ 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
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';
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
 
@@ -159,6 +159,18 @@ declare class InsufficientLiquidityError extends PolymarketError {
159
159
  name: "InsufficientLiquidityError";
160
160
  constructor(message: string, options?: ErrorOptions);
161
161
  }
162
+ /**
163
+ * Error thrown when arming auto-cancel is rejected because the account has
164
+ * reached its daily auto-cancel trigger limit. Arming is rejected until the
165
+ * daily counter resets at the next UTC midnight; clearing an existing
166
+ * schedule is always allowed.
167
+ *
168
+ * @experimental This API may change in a breaking way in any release, including patch releases.
169
+ */
170
+ declare class AutoCancelDailyLimitError extends PolymarketError {
171
+ name: "AutoCancelDailyLimitError";
172
+ constructor(message: string, options?: ErrorOptions);
173
+ }
162
174
  /**
163
175
  * Error thrown when the SDK cannot produce a required signature or
164
176
  * authentication payload.
@@ -3114,18 +3126,17 @@ type PrepareMarketBuyOrderRequest = BasePrepareMarketOrderRequest & {
3114
3126
  * Desired USD notional to buy, before market and builder taker fees.
3115
3127
  *
3116
3128
  * By default, the SDK prepares the order for this full buy amount and applicable
3117
- * fees are paid on top. Set `maxSpend` when the total USD spent, including
3118
- * fees, must not exceed a cap.
3129
+ * fees are paid on top. Set `maxSpend` to let the SDK resize the amount against
3130
+ * an estimated all-in spend target.
3119
3131
  */
3120
3132
  amount: number | string;
3121
3133
  /**
3122
- * Optional all-in USD spend cap for BUY market orders, including market and
3123
- * builder taker fees.
3134
+ * Optional estimated all-in USD spend target for BUY market orders, including
3135
+ * market and builder taker fees.
3124
3136
  *
3125
3137
  * When provided, the SDK keeps `amount` unchanged if `maxSpend` covers the
3126
- * requested buy amount plus fees. If fees would make total spend exceed this
3127
- * cap, the SDK reduces the signed buy amount so total spend fits within
3128
- * `maxSpend`.
3138
+ * requested buy amount plus estimated fees. Otherwise, the SDK reduces the
3139
+ * signed buy amount using the order price and recently resolved fee rates.
3129
3140
  *
3130
3141
  * Set `maxSpend` equal to `amount` when the requested amount should include
3131
3142
  * fees. Leave it unset to pay fees on top of `amount`.
@@ -3321,8 +3332,7 @@ declare const WaitForOrderFillSettlementError: {
3321
3332
  * ```
3322
3333
  *
3323
3334
  * @throws {@link WaitForOrderFillSettlementError}
3324
- * Thrown on failure: a timeout while fills are still settling, or every fill
3325
- * failing execution. The order placement itself is unaffected.
3335
+ * Thrown on failure.
3326
3336
  */
3327
3337
  declare function waitForOrderFillSettlement(client: BaseSecureClient, order: AcceptedOrderResponse, request?: WaitForOrderFillSettlementRequest): Promise<TxHash[]>;
3328
3338
 
@@ -3488,8 +3498,7 @@ type SecureTradingActions = {
3488
3498
  * subscribe to the `user` channel to follow those.
3489
3499
  *
3490
3500
  * @throws {@link WaitForOrderFillSettlementError}
3491
- * Thrown on failure: a timeout while fills are still settling, or every
3492
- * fill failing execution. The order placement itself is unaffected.
3501
+ * Thrown on failure.
3493
3502
  *
3494
3503
  * @example
3495
3504
  * ```ts
@@ -6557,7 +6566,7 @@ type PlacePerpsOrderRequest = {
6557
6566
  postOnly?: boolean;
6558
6567
  /** Whether the order may only reduce or close an existing position. */
6559
6568
  reduceOnly?: boolean;
6560
- /** Optional caller-supplied idempotency identifier. */
6569
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6561
6570
  clientOrderId?: string;
6562
6571
  /** Optional command expiration timestamp in milliseconds. */
6563
6572
  expiresAt?: number;
@@ -6577,7 +6586,7 @@ type PlacePerpsOrderRequest = {
6577
6586
  postOnly?: never;
6578
6587
  /** Whether the order may only reduce or close an existing position. */
6579
6588
  reduceOnly?: boolean;
6580
- /** Optional caller-supplied idempotency identifier. */
6589
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6581
6590
  clientOrderId?: string;
6582
6591
  /** Optional command expiration timestamp in milliseconds. */
6583
6592
  expiresAt?: number;
@@ -6597,7 +6606,7 @@ type PlacePerpsOrderRequest = {
6597
6606
  postOnly?: never;
6598
6607
  /** Whether the order may only reduce or close an existing position. */
6599
6608
  reduceOnly?: boolean;
6600
- /** Optional caller-supplied idempotency identifier. */
6609
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6601
6610
  clientOrderId?: string;
6602
6611
  /** Optional command expiration timestamp in milliseconds. */
6603
6612
  expiresAt?: number;
@@ -6622,7 +6631,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6622
6631
  postOnly?: boolean;
6623
6632
  /** Whether the order may only reduce or close an existing position. */
6624
6633
  reduceOnly?: boolean;
6625
- /** Optional caller-supplied idempotency identifier. */
6634
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6626
6635
  clientOrderId?: string;
6627
6636
  /** Optional command expiration timestamp in milliseconds. */
6628
6637
  expiresAt?: number;
@@ -6645,7 +6654,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6645
6654
  postOnly?: boolean;
6646
6655
  /** Whether the order may only reduce or close an existing position. */
6647
6656
  reduceOnly?: boolean;
6648
- /** Optional caller-supplied idempotency identifier. */
6657
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6649
6658
  clientOrderId?: string;
6650
6659
  /** Optional command expiration timestamp in milliseconds. */
6651
6660
  expiresAt?: number;
@@ -6667,7 +6676,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6667
6676
  postOnly?: never;
6668
6677
  /** Whether the order may only reduce or close an existing position. */
6669
6678
  reduceOnly?: boolean;
6670
- /** Optional caller-supplied idempotency identifier. */
6679
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6671
6680
  clientOrderId?: string;
6672
6681
  /** Optional command expiration timestamp in milliseconds. */
6673
6682
  expiresAt?: number;
@@ -6689,7 +6698,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6689
6698
  postOnly?: never;
6690
6699
  /** Whether the order may only reduce or close an existing position. */
6691
6700
  reduceOnly?: boolean;
6692
- /** Optional caller-supplied idempotency identifier. */
6701
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6693
6702
  clientOrderId?: string;
6694
6703
  /** Optional command expiration timestamp in milliseconds. */
6695
6704
  expiresAt?: number;
@@ -6711,7 +6720,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6711
6720
  postOnly?: never;
6712
6721
  /** Whether the order may only reduce or close an existing position. */
6713
6722
  reduceOnly?: boolean;
6714
- /** Optional caller-supplied idempotency identifier. */
6723
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6715
6724
  clientOrderId?: string;
6716
6725
  /** Optional command expiration timestamp in milliseconds. */
6717
6726
  expiresAt?: number;
@@ -6733,7 +6742,7 @@ type PlacePerpsOrderWithTpSlRequest = {
6733
6742
  postOnly?: never;
6734
6743
  /** Whether the order may only reduce or close an existing position. */
6735
6744
  reduceOnly?: boolean;
6736
- /** Optional caller-supplied idempotency identifier. */
6745
+ /** Optional caller-supplied idempotency identifier. Generated when omitted. */
6737
6746
  clientOrderId?: string;
6738
6747
  /** Optional command expiration timestamp in milliseconds. */
6739
6748
  expiresAt?: number;
@@ -6742,6 +6751,31 @@ type PlacePerpsOrderWithTpSlRequest = {
6742
6751
  /** Stop-loss trigger to place with the entry order. */
6743
6752
  stopLoss: PerpsTpSlTrigger;
6744
6753
  };
6754
+ /**
6755
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6756
+ */
6757
+ type PerpsPlacedTpSlOrder = {
6758
+ orderId: PerpsOrderId;
6759
+ };
6760
+ /**
6761
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6762
+ */
6763
+ type PerpsPlacedTpSlOrders = {
6764
+ takeProfit?: PerpsPlacedTpSlOrder;
6765
+ stopLoss?: PerpsPlacedTpSlOrder;
6766
+ };
6767
+ /**
6768
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6769
+ */
6770
+ type PlacePerpsOrderResult = {
6771
+ order: PerpsOrder;
6772
+ };
6773
+ /**
6774
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6775
+ */
6776
+ type PlacePerpsOrderWithTpSlResult = PlacePerpsOrderResult & {
6777
+ tpSl: PerpsPlacedTpSlOrders;
6778
+ };
6745
6779
  /**
6746
6780
  * @experimental This API may change in a breaking way in any release, including patch releases.
6747
6781
  */
@@ -6764,6 +6798,12 @@ type PlacePerpsPositionTpSlRequest = {
6764
6798
  /** Optional command expiration timestamp in milliseconds. */
6765
6799
  expiresAt?: number;
6766
6800
  };
6801
+ /**
6802
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6803
+ */
6804
+ type PlacePerpsPositionTpSlResult = {
6805
+ tpSl: PerpsPlacedTpSlOrders;
6806
+ };
6767
6807
  /**
6768
6808
  * @experimental This API may change in a breaking way in any release, including patch releases.
6769
6809
  */
@@ -6805,6 +6845,35 @@ type CancelAllPerpsOrdersRequest = {
6805
6845
  /** Optional command expiration timestamp in milliseconds. */
6806
6846
  expiresAt?: number;
6807
6847
  };
6848
+ /**
6849
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6850
+ */
6851
+ type ArmPerpsAutoCancelRequest = {
6852
+ /**
6853
+ * Unix timestamp in milliseconds at which all open orders are cancelled.
6854
+ * Must be at least five seconds in the future.
6855
+ */
6856
+ cancelAt: number;
6857
+ /** Optional command expiration timestamp in milliseconds. */
6858
+ expiresAt?: number;
6859
+ };
6860
+ /**
6861
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6862
+ */
6863
+ type ArmPerpsAutoCancelError = AutoCancelDailyLimitError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6864
+ /**
6865
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6866
+ */
6867
+ declare const ArmPerpsAutoCancelError: {
6868
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | AutoCancelDailyLimitError;
6869
+ };
6870
+ /**
6871
+ * @experimental This API may change in a breaking way in any release, including patch releases.
6872
+ */
6873
+ type DisarmPerpsAutoCancelRequest = {
6874
+ /** Optional command expiration timestamp in milliseconds. */
6875
+ expiresAt?: number;
6876
+ };
6808
6877
  /**
6809
6878
  * @experimental This API may change in a breaking way in any release, including patch releases.
6810
6879
  */
@@ -6826,61 +6895,51 @@ type UpdatePerpsLeverageError = RequestRejectedError | SigningError | TransportE
6826
6895
  declare const UpdatePerpsLeverageError: {
6827
6896
  isError(error: unknown): error is SigningError | TransportError | UserInputError | RequestRejectedError;
6828
6897
  };
6829
-
6830
6898
  /**
6899
+ * Request parameters for adjusting isolated margin on a Perps position.
6900
+ *
6831
6901
  * @experimental This API may change in a breaking way in any release, including patch releases.
6832
6902
  */
6833
- type PerpsSessionOptions = {
6834
- chainId: number;
6835
- credentials: PerpsCredentials;
6836
- headers?: Record<string, string>;
6837
- onClose: (session: PerpsSession) => void;
6838
- restUrl: string;
6839
- wsUrl: string;
6903
+ type UpdatePerpsMarginRequest = {
6904
+ /** Perps instrument identifier whose isolated margin should be adjusted. */
6905
+ instrumentId: number;
6906
+ /** Margin adjustment. Positive values add margin; negative values remove it. */
6907
+ amount: PerpsDecimalInput;
6840
6908
  };
6841
6909
  /**
6842
6910
  * @experimental This API may change in a breaking way in any release, including patch releases.
6843
6911
  */
6844
- type PerpsSessionLifecycleError = RequestRejectedError | TransportError;
6845
- /**
6846
- * @experimental This API may change in a breaking way in any release, including patch releases.
6847
- */
6848
- type PerpsSessionAccountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
6849
- /**
6850
- * @experimental This API may change in a breaking way in any release, including patch releases.
6851
- */
6852
- type PerpsSessionTradingError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
6912
+ type UpdatePerpsMarginError = RequestRejectedError | SigningError | TransportError | UserInputError;
6853
6913
  /**
6854
6914
  * @experimental This API may change in a breaking way in any release, including patch releases.
6855
6915
  */
6856
- type PerpsPlacedTpSlOrder = {
6857
- orderId: PerpsOrderId;
6916
+ declare const UpdatePerpsMarginError: {
6917
+ isError(error: unknown): error is SigningError | TransportError | UserInputError | RequestRejectedError;
6858
6918
  };
6919
+
6859
6920
  /**
6860
6921
  * @experimental This API may change in a breaking way in any release, including patch releases.
6861
6922
  */
6862
- type PerpsPlacedTpSlOrders = {
6863
- takeProfit?: PerpsPlacedTpSlOrder;
6864
- stopLoss?: PerpsPlacedTpSlOrder;
6923
+ type PerpsSessionOptions = {
6924
+ chainId: number;
6925
+ credentials: PerpsCredentials;
6926
+ headers?: Record<string, string>;
6927
+ onClose: (session: PerpsSession) => void;
6928
+ restUrl: string;
6929
+ wsUrl: string;
6865
6930
  };
6866
6931
  /**
6867
6932
  * @experimental This API may change in a breaking way in any release, including patch releases.
6868
6933
  */
6869
- type PlacePerpsOrderResult = {
6870
- order: PerpsOrder;
6871
- };
6934
+ type PerpsSessionLifecycleError = RequestRejectedError | TransportError;
6872
6935
  /**
6873
6936
  * @experimental This API may change in a breaking way in any release, including patch releases.
6874
6937
  */
6875
- type PlacePerpsOrderWithTpSlResult = PlacePerpsOrderResult & {
6876
- tpSl: PerpsPlacedTpSlOrders;
6877
- };
6938
+ type PerpsSessionAccountError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
6878
6939
  /**
6879
6940
  * @experimental This API may change in a breaking way in any release, including patch releases.
6880
6941
  */
6881
- type PlacePerpsPositionTpSlResult = {
6882
- tpSl: PerpsPlacedTpSlOrders;
6883
- };
6942
+ type PerpsSessionTradingError = RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransportError | UnexpectedResponseError | UserInputError;
6884
6943
  /**
6885
6944
  * @experimental This API may change in a breaking way in any release, including patch releases.
6886
6945
  */
@@ -6964,6 +7023,17 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
6964
7023
  * @experimental This API may change in a breaking way in any release, including patch releases.
6965
7024
  */
6966
7025
  fetchAccountConfig(request?: FetchPerpsAccountConfigRequest): Promise<PerpsAccountConfig[]>;
7026
+ /**
7027
+ * Fetches the auto-cancel status for the authenticated account, including
7028
+ * the armed deadline, today's trigger count, the daily trigger limit, and
7029
+ * when the daily counter resets.
7030
+ *
7031
+ * @throws {@link PerpsSessionAccountError}
7032
+ * Thrown on failure.
7033
+ *
7034
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7035
+ */
7036
+ fetchAutoCancelStatus(): Promise<PerpsAutoCancelStatus>;
6967
7037
  /**
6968
7038
  * Fetches currently open Perps orders, optionally filtered by instrument.
6969
7039
  *
@@ -7213,6 +7283,54 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
7213
7283
  * @experimental This API may change in a breaking way in any release, including patch releases.
7214
7284
  */
7215
7285
  cancelAllOrders(request?: CancelAllPerpsOrdersRequest): Promise<void>;
7286
+ /**
7287
+ * Arms the auto-cancel switch that cancels all open Perps orders for the
7288
+ * authenticated account at `cancelAt`.
7289
+ *
7290
+ * @remarks
7291
+ * The switch is one-shot: once it fires and open orders are cancelled, the
7292
+ * schedule clears itself and orders placed afterwards are unprotected.
7293
+ * Re-arm periodically to keep protection active. Arming again replaces the
7294
+ * previous schedule, and `cancelAt` must be at least five seconds in the
7295
+ * future. Accounts may only trigger auto-cancel a limited number of times
7296
+ * per UTC day; use {@link PerpsSession.fetchAutoCancelStatus} to inspect the
7297
+ * limit, today's trigger count, and when the counter resets.
7298
+ *
7299
+ * @example
7300
+ * ```ts
7301
+ * // Keep a 60-second dead man's switch alive by re-arming every 20 seconds.
7302
+ * await session.armAutoCancel({ cancelAt: Date.now() + 60_000 });
7303
+ * const rearm = setInterval(() => {
7304
+ * // A missed re-arm is fail-safe: the previously armed switch still fires.
7305
+ * session.armAutoCancel({ cancelAt: Date.now() + 60_000 }).catch(() => {});
7306
+ * }, 20_000);
7307
+ *
7308
+ * // On graceful shutdown, stop re-arming and disarm the schedule.
7309
+ * clearInterval(rearm);
7310
+ * await session.disarmAutoCancel();
7311
+ * ```
7312
+ *
7313
+ * @throws {@link ArmPerpsAutoCancelError}
7314
+ * Thrown on failure, including `AutoCancelDailyLimitError` when the daily
7315
+ * trigger limit has been reached.
7316
+ *
7317
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7318
+ */
7319
+ armAutoCancel(request: ArmPerpsAutoCancelRequest): Promise<void>;
7320
+ /**
7321
+ * Disarms the auto-cancel schedule for the authenticated account without
7322
+ * triggering it.
7323
+ *
7324
+ * @remarks
7325
+ * Disarming is always allowed, even when the daily trigger limit has been
7326
+ * reached.
7327
+ *
7328
+ * @throws {@link PerpsSessionTradingError}
7329
+ * Thrown on failure.
7330
+ *
7331
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7332
+ */
7333
+ disarmAutoCancel(request?: DisarmPerpsAutoCancelRequest): Promise<void>;
7216
7334
  /**
7217
7335
  * Updates Perps leverage and margin mode for an instrument.
7218
7336
  *
@@ -7231,6 +7349,26 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
7231
7349
  * @experimental This API may change in a breaking way in any release, including patch releases.
7232
7350
  */
7233
7351
  updateLeverage(request: UpdatePerpsLeverageRequest): Promise<PerpsUpdateLeverageResult>;
7352
+ /**
7353
+ * Adjusts isolated margin for an instrument position.
7354
+ *
7355
+ * @remarks
7356
+ * A positive amount adds isolated margin. A negative amount removes it.
7357
+ *
7358
+ * @example
7359
+ * ```ts
7360
+ * await session.updateMargin({
7361
+ * instrumentId: 1,
7362
+ * amount: '100.25',
7363
+ * });
7364
+ * ```
7365
+ *
7366
+ * @throws {@link UpdatePerpsMarginError}
7367
+ * Thrown on failure.
7368
+ *
7369
+ * @experimental This API may change in a breaking way in any release, including patch releases.
7370
+ */
7371
+ updateMargin(request: UpdatePerpsMarginRequest): Promise<void>;
7234
7372
  }
7235
7373
 
7236
7374
  type PerpsPublicReadError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
@@ -8740,4 +8878,4 @@ type Signer = {
8740
8878
  sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
8741
8879
  };
8742
8880
 
8743
- 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, createSecureClient 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, WaitForOrderFillSettlementError as cP, WaitForTransactionError as cQ, type WalletDerivationConfig as cR, type WebSocketCloseCode as cS, type WebSocketEndpoint as cT, WebSocketKnownCloseCode as cU, WithdrawFromPerpsError as cV, type WithdrawFromPerpsRequest as cW, accountActions as cX, allActions as cY, analyticsActions as cZ, createPublicClient 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 FetchPriceHistoryRequest as d$, dataActions as d0, discoveryActions as d1, forkEnvironmentConfig as d2, makeErrorGuard as d3, perpsActions as d4, production as d5, rewardsActions as d6, rfqActions as d7, subscriptionsActions as d8, tradingActions as d9, FetchBalanceAllowanceError as dA, type FetchBalanceAllowanceRequest as dB, FetchBuilderFeeRatesError as dC, type FetchBuilderFeeRatesRequest as dD, type FetchCommentsByIdRequest as dE, type FetchEventLiveVolumeRequest as dF, type FetchEventRequest as dG, type FetchEventTagsRequest as dH, FetchExecuteParamsError as dI, type FetchExecuteParamsRequest as dJ, type FetchGaslessTransactionRequest as dK, type FetchLastTradePriceRequest as dL, type FetchLastTradePricesRequest as dM, FetchMarketInfoError as dN, type FetchMarketInfoRequest as dO, type FetchMarketRequest as dP, type FetchMarketTagsRequest as dQ, type FetchMidpointRequest as dR, type FetchMidpointsRequest as dS, FetchNegRiskError as dT, type FetchNegRiskRequest as dU, type FetchOrderBookRequest as dV, type FetchOrderBooksRequest as dW, type FetchOrderRequest as dX, type FetchOrderScoringRequest as dY, type FetchOrdersScoringRequest as dZ, type FetchPortfolioValueRequest as d_, walletActions as da, type CancelMarketOrdersRequest as db, type CancelOrderRequest as dc, type CancelOrdersRequest as dd, type CollateralReturnExecutionWorkflow as de, type CommentsEventType as df, type CommentsSubscription as dg, type CryptoPricesEventType as dh, type CryptoPricesSubscription as di, DeployDepositWalletError as dj, type DownloadAccountingSnapshotRequest as dk, type DropNotificationsRequest as dl, type EquityPricesEventType as dm, type EquityPricesSubscription as dn, type Erc1155ApprovalForAllWorkflow as dp, type Erc1155ApprovalForAllWorkflowRequest as dq, type Erc20ApprovalWorkflow as dr, type Erc20ApprovalWorkflowRequest as ds, type Erc20TransferWorkflow as dt, type Erc20TransferWorkflowRequest as du, type EstimateMarketBuyPriceRequest as dv, type EstimateMarketPriceRequest as dw, type EstimateMarketSellPriceRequest as dx, type EventForSubscriptionSpec as dy, type EventForSubscriptionSpecs as dz, ApproveErc1155ForAllError as e, type PerpsMarketDataSubscription as e$, type FetchPriceRequest as e0, type FetchPricesRequest as e1, type FetchPublicProfileRequest as e2, type FetchRelatedTagResourcesRequest as e3, type FetchRelatedTagsRequest as e4, type FetchSeriesRequest as e5, type FetchSpreadRequest as e6, type FetchSpreadsRequest as e7, type FetchTagRequest as e8, FetchTickSizeError as e9, type ListMarketsRequest as eA, type ListOpenInterestRequest as eB, type ListOpenOrdersRequest as eC, type ListPositionsRequest as eD, type ListSeriesRequest as eE, type ListTagsRequest as eF, type ListTeamsRequest as eG, type ListTraderLeaderboardRequest as eH, type ListTradesRequest as eI, type ListUserEarningsAndMarketsConfigRequest as eJ, type ListUserEarningsForDayRequest as eK, type MarketEventType as eL, type MarketSubscription as eM, MergeComboPositionError as eN, MergeMarketPositionError as eO, type MergePositionsWorkflow as eP, type MergePositionsWorkflowRequest as eQ, type OrderDraft as eR, type OrderPostingWorkflow as eS, type OrderWorkflow as eT, type OrderWorkflowRequest as eU, type PerpsBboSubscription as eV, type PerpsBookSubscription as eW, type PerpsCandlesSubscription as eX, type PerpsDepositWorkflow as eY, type PerpsDepositWorkflowRequest as eZ, type PerpsMarketDataEventType as e_, type FetchTickSizeRequest as ea, type FetchTotalEarningsForUserForDayRequest as eb, type FetchTradedMarketCountRequest as ec, GaslessTransactionMetadataSchema as ed, type GaslessWorkflow as ee, type GaslessWorkflowRequest as ef, IsWalletDeployedError as eg, type IsWalletDeployedRequest as eh, type ListAccountTradesRequest as ei, type ListActivityRequest as ej, type ListBuilderLeaderboardRequest as ek, type ListBuilderTradesRequest as el, type ListBuilderVolumeRequest as em, type ListClosedPositionsRequest as en, type ListComboActivityRequest as eo, type ListComboMarketsRequest as ep, type ListComboPositionsRequest as eq, type ListCommentsByUserAddressRequest as er, type ListCommentsRequest as es, type ListCurrentRewardsRequest as et, type ListEventsRequest as eu, ListMarketClarificationsError as ev, type ListMarketClarificationsRequest as ew, type ListMarketHoldersRequest as ex, type ListMarketPositionsRequest as ey, type ListMarketRewardsRequest as ez, ApproveErc20Error as f, type TradingApprovalsWorkflowRequest as f$, type PerpsStatisticsSubscription as f0, type PerpsStreamingCandleInterval as f1, type PerpsTickersSubscription as f2, type PerpsTradesSubscription as f3, type PostOrdersRequest as f4, PrepareCollateralReturnExecutionError as f5, PrepareErc1155ApprovalForAllError as f6, type PrepareErc1155ApprovalForAllRequest as f7, PrepareErc20ApprovalError as f8, type PrepareErc20ApprovalRequest as f9, type PrepareSplitMarketPositionRequest as fA, PrepareSplitPositionError as fB, type PrepareSplitPositionRequest as fC, PrepareTradingApprovalsError as fD, type PublicRealtimeEvent as fE, type PublicRealtimeTopic as fF, type PublicSubscriptionSpec as fG, type RedeemPositionsWorkflow as fH, type RedeemPositionsWorkflowRequest as fI, ResolveConditionByTokenError as fJ, type ResolveConditionByTokenRequest as fK, type RfqConfirmationRejectedErrorOptions as fL, type RfqExecutionUpdateEvent as fM, type SearchRequest as fN, type SearchResults as fO, type SecureRealtimeEvent as fP, type SecureRealtimeTopic as fQ, type SecureSubscriptionSpec as fR, type SignedOrder as fS, SplitComboPositionError as fT, SplitMarketPositionError as fU, type SplitPositionWorkflow as fV, type SplitPositionWorkflowRequest as fW, type SportsEventType as fX, type SportsSubscription as fY, type SubscriptionHandle as fZ, type TradingApprovalsWorkflow as f_, PrepareErc20TransferError as fa, type PrepareErc20TransferRequest as fb, PrepareGaslessTransactionError as fc, type PrepareGaslessTransactionRequest as fd, type PrepareLimitOrderRequest as fe, type PrepareMarketBuyOrderRequest as ff, type PrepareMarketOrderRequest as fg, type PrepareMarketSellOrderRequest as fh, PrepareMergeComboPositionError as fi, type PrepareMergeComboPositionRequest as fj, PrepareMergeMarketPositionError as fk, type PrepareMergeMarketPositionRequest as fl, PrepareMergePositionsError as fm, type PrepareMergePositionsRequest as fn, PreparePerpsDepositError as fo, PrepareRedeemComboPositionError as fp, type PrepareRedeemComboPositionRequest as fq, type PrepareRedeemMarketPositionsByConditionIdRequest as fr, type PrepareRedeemMarketPositionsByMarketIdRequest as fs, PrepareRedeemMarketPositionsError as ft, type PrepareRedeemMarketPositionsRequest as fu, PrepareRedeemPositionsError as fv, type PrepareRedeemPositionsRequest as fw, PrepareSplitComboPositionError as fx, type PrepareSplitComboPositionRequest as fy, PrepareSplitMarketPositionError as fz, BasePublicClient as g, listAccountTrades as g$, UpdateBalanceAllowanceError as g0, type UpdateBalanceAllowanceRequest as g1, type UserEventType as g2, type UserSubscription as g3, WaitForGaslessTransactionError as g4, type WaitForOrderFillSettlementRequest as g5, approveErc1155ForAll as g6, approveErc20 as g7, cancelAll as g8, cancelMarketOrders as g9, fetchOrder as gA, fetchOrderBook as gB, fetchOrderBooks as gC, fetchOrderScoring as gD, fetchOrdersScoring as gE, fetchPerpsBook as gF, fetchPerpsFees as gG, fetchPerpsInstruments as gH, fetchPerpsTicker as gI, fetchPerpsTickers as gJ, fetchPortfolioValue as gK, fetchPrice as gL, fetchPriceHistory as gM, fetchPrices as gN, fetchPublicProfile as gO, fetchRelatedTagResources as gP, fetchRelatedTags as gQ, fetchRewardPercentages as gR, fetchSeries as gS, fetchSpread as gT, fetchSpreads as gU, fetchTag as gV, fetchTickSize as gW, fetchTotalEarningsForUserForDay as gX, fetchTradedMarketCount as gY, fetchTransaction as gZ, isWalletDeployed as g_, cancelOrder as ga, cancelOrders as gb, deployDepositWallet as gc, depositToPerps as gd, downloadAccountingSnapshot as ge, dropNotifications as gf, estimateMarketPrice as gg, executeCollateralReturnPlan as gh, fetchBalanceAllowance as gi, fetchBuilderFeeRates as gj, fetchBuilderVolume as gk, fetchClosedOnlyMode as gl, fetchCommentsById as gm, fetchEvent as gn, fetchEventLiveVolume as go, fetchEventTags as gp, fetchExecuteParams as gq, fetchLastTradePrice as gr, fetchLastTradePrices as gs, fetchMarket as gt, fetchMarketInfo as gu, fetchMarketTags as gv, fetchMidpoint as gw, fetchMidpoints as gx, fetchNegRisk as gy, fetchNotifications as gz, BaseSecureClient as h, updateBalanceAllowance as h$, listActivity as h0, listBuilderLeaderboard as h1, listBuilderTrades as h2, listClosedPositions as h3, listComboActivity as h4, listComboMarkets as h5, listComboPositions as h6, listComments as h7, listCommentsByUserAddress as h8, listCurrentRewards as h9, postOrders as hA, prepareCollateralReturnExecution as hB, prepareErc1155ApprovalForAll as hC, prepareErc20Approval as hD, prepareErc20Transfer as hE, prepareGaslessTransaction as hF, prepareMergeComboPosition as hG, prepareMergeMarketPosition as hH, prepareMergePositions as hI, preparePerpsDeposit as hJ, prepareRedeemComboPosition as hK, prepareRedeemMarketPositions as hL, prepareRedeemPositions as hM, prepareSplitComboPosition as hN, prepareSplitMarketPosition as hO, prepareSplitPosition as hP, prepareTradingApprovals as hQ, redeemPositions as hR, resolveConditionByToken as hS, revokePerpsCredentials as hT, search as hU, setupTradingApprovals as hV, splitComboPosition as hW, splitMarketPosition as hX, splitPosition as hY, subscribe as hZ, transferErc20 as h_, listEvents as ha, listMarketClarifications as hb, listMarketHolders as hc, listMarketPositions as hd, listMarketRewards as he, listMarkets as hf, listOpenInterest as hg, listOpenOrders as hh, listPerpsCandles as hi, listPerpsFundingHistory as hj, listPerpsTrades as hk, listPositions as hl, listSeries as hm, listTags as hn, listTeams as ho, listTraderLeaderboard as hp, listTrades as hq, listUserEarningsAndMarketsConfig as hr, listUserEarningsForDay as hs, mergeComboPosition as ht, mergeMarketPosition as hu, mergePositions as hv, openPerpsSession as hw, openRfqSession as hx, planCollateralReturn as hy, postOrder as hz, type BeginAuthenticationRequest as i, waitForOrderFillSettlement as i0, withdrawFromPerps as i1, 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 };
8881
+ export { FetchEventTagsError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type ConnectionLostErrorOptions as D, type CreatePerpsSessionRequest as E, CreateSecureClientError as F, type CryptoPricesChainlinkTwapSubscription as G, type DataActions as H, DepositToPerpsError as I, type DepositToPerpsRequest as J, type DisarmPerpsAutoCancelRequest as K, type DiscoveryActions as L, DownloadAccountingSnapshotError as M, DropNotificationsError as N, type EnvironmentConfig as O, type EnvironmentConfigFork as P, type EnvironmentContracts as Q, EstimateMarketPriceError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, ExecuteCollateralReturnPlanError as V, type ExecuteCollateralReturnPlanRequest as W, FetchClosedOnlyModeError as X, FetchCommentsByIdError as Y, FetchEventError as Z, FetchEventLiveVolumeError as _, type TypedData as a, ListPerpsFundingHistoryError as a$, FetchLastTradePriceError as a0, FetchLastTradePricesError as a1, FetchMarketError as a2, FetchMarketTagsError as a3, FetchMidpointError as a4, FetchMidpointsError as a5, FetchNotificationsError as a6, FetchOrderBookError as a7, FetchOrderBooksError as a8, FetchOrderError as a9, FetchTotalEarningsForUserForDayError as aA, FetchTradedMarketCountError as aB, InsufficientLiquidityError as aC, ListAccountTradesError as aD, ListActivityError as aE, ListBuilderLeaderboardError as aF, ListBuilderTradesError as aG, ListBuilderVolumeError as aH, ListClosedPositionsError as aI, ListComboActivityError as aJ, ListComboMarketsError as aK, ListComboPositionsError as aL, ListCommentsByUserAddressError as aM, ListCommentsError as aN, ListCurrentRewardsError as aO, ListEventsError as aP, ListMarketHoldersError as aQ, ListMarketPositionsError as aR, ListMarketRewardsError as aS, ListMarketsError as aT, ListOpenInterestError as aU, ListOpenOrdersError as aV, ListPerpsCandlesError as aW, type ListPerpsCandlesRequest as aX, type ListPerpsDepositsRequest as aY, type ListPerpsEquityHistoryRequest as aZ, type ListPerpsFillsRequest as a_, FetchOrderScoringError as aa, FetchOrdersScoringError as ab, type FetchPerpsAccountConfigRequest as ac, FetchPerpsBookError as ad, type FetchPerpsBookRequest as ae, FetchPerpsFeesError as af, FetchPerpsInstrumentsError as ag, type FetchPerpsInstrumentsRequest as ah, type FetchPerpsOpenOrdersRequest as ai, type FetchPerpsOrdersRequest as aj, FetchPerpsTickerError as ak, type FetchPerpsTickerRequest as al, FetchPerpsTickersError as am, type FetchPerpsTickersRequest as an, FetchPortfolioValueError as ao, FetchPriceError as ap, FetchPriceHistoryError as aq, FetchPricesError as ar, FetchPublicProfileError as as, FetchRelatedTagResourcesError as at, FetchRelatedTagsError as au, FetchRewardPercentagesError as av, FetchSeriesError as aw, FetchSpreadError as ax, FetchSpreadsError as ay, FetchTagError as az, type TransactionCall as b, type RevokePerpsCredentialsRequest as b$, type ListPerpsFundingHistoryRequest as b0, type ListPerpsFundingPaymentsRequest as b1, type ListPerpsNotificationsRequest as b2, type ListPerpsPnlHistoryRequest as b3, ListPerpsTradesError as b4, type ListPerpsTradesRequest as b5, type ListPerpsWithdrawalsRequest as b6, ListPositionsError as b7, ListSeriesError as b8, ListTagsError as b9, type PerpsSessionTradingError as bA, type PerpsTpSlTrigger as bB, type PlacePerpsOrderRequest as bC, type PlacePerpsOrderResult as bD, type PlacePerpsOrderWithTpSlRequest as bE, type PlacePerpsOrderWithTpSlResult as bF, type PlacePerpsPositionTpSlRequest as bG, type PlacePerpsPositionTpSlResult as bH, PlanCollateralReturnError as bI, PostOrderError as bJ, PostOrdersError as bK, type PostPerpsOrdersRequest as bL, type PublicAccountActions as bM, type PublicActions as bN, type PublicClient as bO, type PublicClientOptions as bP, type PublicPerpsActions as bQ, type PublicRewardsActions as bR, type PublicSubscriptionsActions as bS, RateLimitError as bT, type RateLimitErrorOptions as bU, RedeemPositionsError as bV, RequestRejectedError as bW, type RequestRejectedErrorOptions as bX, type RestEndpoint as bY, type ResumePerpsSessionRequest as bZ, RevokePerpsCredentialsError as b_, ListTeamsError as ba, ListTraderLeaderboardError as bb, ListTradesError as bc, ListUserEarningsAndMarketsConfigError as bd, ListUserEarningsForDayError as be, type MarkPerpsNotificationsReadRequest as bf, MergePositionsError as bg, OpenPerpsSessionError as bh, type OpenPerpsSessionRequest as bi, OpenRfqSessionError as bj, type Page as bk, PageSizeSchema as bl, type Paginated as bm, type PerpsActions as bn, type PerpsBookDepth as bo, type PerpsEndpoints as bp, type PerpsOrderRequest as bq, type PerpsPlaceFokOrderRequest as br, type PerpsPlaceGtcOrderRequest as bs, type PerpsPlaceIocOrderRequest as bt, type PerpsPlacedTpSlOrder as bu, type PerpsPlacedTpSlOrders as bv, type PerpsPositionTpSlTrigger as bw, PerpsSession as bx, type PerpsSessionAccountError as by, type PerpsSessionLifecycleError as bz, type AccountIdentity as c, WithdrawFromPerpsError as c$, type RfqCancelQuoteAck as c0, RfqCancelQuoteError as c1, RfqCancelQuoteRejectedError as c2, type RfqCancelQuoteRejectedErrorOptions as c3, type RfqConfirmationAck as c4, RfqConfirmationError as c5, RfqConfirmationRejectedError as c6, type RfqConfirmationRequestEvent as c7, type RfqEvent as c8, RfqQuoteError as c9, type SecureTradingActions as cA, type SecureWalletActions as cB, SetupGaslessWalletError as cC, SetupTradingApprovalsError as cD, type SignerTransactionRequest as cE, SigningError as cF, SplitPositionError as cG, SubscribeError as cH, TimeoutError as cI, TransactionFailedError as cJ, type TransactionHandle as cK, type TransactionOutcome as cL, TransferErc20Error as cM, TransportError as cN, type TypedDataDomain as cO, type TypedDataField as cP, UnexpectedResponseError as cQ, UpdatePerpsLeverageError as cR, type UpdatePerpsLeverageRequest as cS, UpdatePerpsMarginError as cT, type UpdatePerpsMarginRequest as cU, WaitForOrderFillSettlementError as cV, WaitForTransactionError as cW, type WalletDerivationConfig as cX, type WebSocketCloseCode as cY, type WebSocketEndpoint as cZ, WebSocketKnownCloseCode as c_, type RfqQuoteReference as ca, RfqQuoteRejectedError as cb, type RfqQuoteRejectedErrorOptions as cc, type RfqQuoteRequestEvent as cd, type RfqQuoteResponse as ce, type RfqQuoteSource as cf, type RfqSession as cg, type RfqTradeEvent as ch, SearchError as ci, SearchSort as cj, type SecureAccountActions as ck, type SecureActions as cl, type SecureClient as cm, type SecureClientOptions as cn, type SecureDownloadAccountingSnapshotRequest as co, type SecureFetchPortfolioValueRequest as cp, type SecureFetchTradedMarketCountRequest as cq, type SecureListActivityRequest as cr, type SecureListClosedPositionsRequest as cs, type SecureListComboActivityRequest as ct, type SecureListComboPositionsRequest as cu, type SecureListPositionsRequest as cv, type SecurePerpsActions as cw, type SecureRewardsActions as cx, type SecureRfqActions as cy, type SecureSubscriptionsActions as cz, type AnalyticsActions as d, type FetchOrderBookRequest as d$, type WithdrawFromPerpsRequest as d0, accountActions as d1, allActions as d2, analyticsActions as d3, createPublicClient as d4, createSecureClient as d5, dataActions as d6, discoveryActions as d7, forkEnvironmentConfig as d8, makeErrorGuard as d9, type Erc20TransferWorkflowRequest as dA, type EstimateMarketBuyPriceRequest as dB, type EstimateMarketPriceRequest as dC, type EstimateMarketSellPriceRequest as dD, type EventForSubscriptionSpec as dE, type EventForSubscriptionSpecs as dF, FetchBalanceAllowanceError as dG, type FetchBalanceAllowanceRequest as dH, FetchBuilderFeeRatesError as dI, type FetchBuilderFeeRatesRequest as dJ, type FetchCommentsByIdRequest as dK, type FetchEventLiveVolumeRequest as dL, type FetchEventRequest as dM, type FetchEventTagsRequest as dN, FetchExecuteParamsError as dO, type FetchExecuteParamsRequest as dP, type FetchGaslessTransactionRequest as dQ, type FetchLastTradePriceRequest as dR, type FetchLastTradePricesRequest as dS, FetchMarketInfoError as dT, type FetchMarketInfoRequest as dU, type FetchMarketRequest as dV, type FetchMarketTagsRequest as dW, type FetchMidpointRequest as dX, type FetchMidpointsRequest as dY, FetchNegRiskError as dZ, type FetchNegRiskRequest as d_, perpsActions as da, production as db, rewardsActions as dc, rfqActions as dd, subscriptionsActions as de, tradingActions as df, walletActions as dg, type CancelMarketOrdersRequest as dh, type CancelOrderRequest as di, type CancelOrdersRequest as dj, type CollateralReturnExecutionWorkflow as dk, type CommentsEventType as dl, type CommentsSubscription as dm, type CryptoPricesEventType as dn, type CryptoPricesSubscription as dp, DeployDepositWalletError as dq, type DownloadAccountingSnapshotRequest as dr, type DropNotificationsRequest as ds, type EquityPricesEventType as dt, type EquityPricesSubscription as du, type Erc1155ApprovalForAllWorkflow as dv, type Erc1155ApprovalForAllWorkflowRequest as dw, type Erc20ApprovalWorkflow as dx, type Erc20ApprovalWorkflowRequest as dy, type Erc20TransferWorkflow as dz, ApproveErc1155ForAllError as e, type PerpsBboSubscription as e$, type FetchOrderBooksRequest as e0, type FetchOrderRequest as e1, type FetchOrderScoringRequest as e2, type FetchOrdersScoringRequest as e3, type FetchPortfolioValueRequest as e4, type FetchPriceHistoryRequest as e5, type FetchPriceRequest as e6, type FetchPricesRequest as e7, type FetchPublicProfileRequest as e8, type FetchRelatedTagResourcesRequest as e9, type ListEventsRequest as eA, ListMarketClarificationsError as eB, type ListMarketClarificationsRequest as eC, type ListMarketHoldersRequest as eD, type ListMarketPositionsRequest as eE, type ListMarketRewardsRequest as eF, type ListMarketsRequest as eG, type ListOpenInterestRequest as eH, type ListOpenOrdersRequest as eI, type ListPositionsRequest as eJ, type ListSeriesRequest as eK, type ListTagsRequest as eL, type ListTeamsRequest as eM, type ListTraderLeaderboardRequest as eN, type ListTradesRequest as eO, type ListUserEarningsAndMarketsConfigRequest as eP, type ListUserEarningsForDayRequest as eQ, type MarketEventType as eR, type MarketSubscription as eS, MergeComboPositionError as eT, MergeMarketPositionError as eU, type MergePositionsWorkflow as eV, type MergePositionsWorkflowRequest as eW, type OrderDraft as eX, type OrderPostingWorkflow as eY, type OrderWorkflow as eZ, type OrderWorkflowRequest as e_, type FetchRelatedTagsRequest as ea, type FetchSeriesRequest as eb, type FetchSpreadRequest as ec, type FetchSpreadsRequest as ed, type FetchTagRequest as ee, FetchTickSizeError as ef, type FetchTickSizeRequest as eg, type FetchTotalEarningsForUserForDayRequest as eh, type FetchTradedMarketCountRequest as ei, GaslessTransactionMetadataSchema as ej, type GaslessWorkflow as ek, type GaslessWorkflowRequest as el, IsWalletDeployedError as em, type IsWalletDeployedRequest as en, type ListAccountTradesRequest as eo, type ListActivityRequest as ep, type ListBuilderLeaderboardRequest as eq, type ListBuilderTradesRequest as er, type ListBuilderVolumeRequest as es, type ListClosedPositionsRequest as et, type ListComboActivityRequest as eu, type ListComboMarketsRequest as ev, type ListComboPositionsRequest as ew, type ListCommentsByUserAddressRequest as ex, type ListCommentsRequest as ey, type ListCurrentRewardsRequest as ez, ApproveErc20Error as f, type SplitPositionWorkflow as f$, type PerpsBookSubscription as f0, type PerpsCandlesSubscription as f1, type PerpsDepositWorkflow as f2, type PerpsDepositWorkflowRequest as f3, type PerpsMarketDataEventType as f4, type PerpsMarketDataSubscription as f5, type PerpsStatisticsSubscription as f6, type PerpsStreamingCandleInterval as f7, type PerpsTickersSubscription as f8, type PerpsTradesSubscription as f9, type PrepareRedeemMarketPositionsRequest as fA, PrepareRedeemPositionsError as fB, type PrepareRedeemPositionsRequest as fC, PrepareSplitComboPositionError as fD, type PrepareSplitComboPositionRequest as fE, PrepareSplitMarketPositionError as fF, type PrepareSplitMarketPositionRequest as fG, PrepareSplitPositionError as fH, type PrepareSplitPositionRequest as fI, PrepareTradingApprovalsError as fJ, type PublicRealtimeEvent as fK, type PublicRealtimeTopic as fL, type PublicSubscriptionSpec as fM, type RedeemPositionsWorkflow as fN, type RedeemPositionsWorkflowRequest as fO, ResolveConditionByTokenError as fP, type ResolveConditionByTokenRequest as fQ, type RfqConfirmationRejectedErrorOptions as fR, type RfqExecutionUpdateEvent as fS, type SearchRequest as fT, type SearchResults as fU, type SecureRealtimeEvent as fV, type SecureRealtimeTopic as fW, type SecureSubscriptionSpec as fX, type SignedOrder as fY, SplitComboPositionError as fZ, SplitMarketPositionError as f_, type PostOrdersRequest as fa, PrepareCollateralReturnExecutionError as fb, PrepareErc1155ApprovalForAllError as fc, type PrepareErc1155ApprovalForAllRequest as fd, PrepareErc20ApprovalError as fe, type PrepareErc20ApprovalRequest as ff, PrepareErc20TransferError as fg, type PrepareErc20TransferRequest as fh, PrepareGaslessTransactionError as fi, type PrepareGaslessTransactionRequest as fj, type PrepareLimitOrderRequest as fk, type PrepareMarketBuyOrderRequest as fl, type PrepareMarketOrderRequest as fm, type PrepareMarketSellOrderRequest as fn, PrepareMergeComboPositionError as fo, type PrepareMergeComboPositionRequest as fp, PrepareMergeMarketPositionError as fq, type PrepareMergeMarketPositionRequest as fr, PrepareMergePositionsError as fs, type PrepareMergePositionsRequest as ft, PreparePerpsDepositError as fu, PrepareRedeemComboPositionError as fv, type PrepareRedeemComboPositionRequest as fw, type PrepareRedeemMarketPositionsByConditionIdRequest as fx, type PrepareRedeemMarketPositionsByMarketIdRequest as fy, PrepareRedeemMarketPositionsError as fz, ArmPerpsAutoCancelError as g, fetchTag as g$, type SplitPositionWorkflowRequest as g0, type SportsEventType as g1, type SportsSubscription as g2, type SubscriptionHandle as g3, type TradingApprovalsWorkflow as g4, type TradingApprovalsWorkflowRequest as g5, UpdateBalanceAllowanceError as g6, type UpdateBalanceAllowanceRequest as g7, type UserEventType as g8, type UserSubscription as g9, fetchMarketInfo as gA, fetchMarketTags as gB, fetchMidpoint as gC, fetchMidpoints as gD, fetchNegRisk as gE, fetchNotifications as gF, fetchOrder as gG, fetchOrderBook as gH, fetchOrderBooks as gI, fetchOrderScoring as gJ, fetchOrdersScoring as gK, fetchPerpsBook as gL, fetchPerpsFees as gM, fetchPerpsInstruments as gN, fetchPerpsTicker as gO, fetchPerpsTickers as gP, fetchPortfolioValue as gQ, fetchPrice as gR, fetchPriceHistory as gS, fetchPrices as gT, fetchPublicProfile as gU, fetchRelatedTagResources as gV, fetchRelatedTags as gW, fetchRewardPercentages as gX, fetchSeries as gY, fetchSpread as gZ, fetchSpreads as g_, WaitForGaslessTransactionError as ga, type WaitForOrderFillSettlementRequest as gb, approveErc1155ForAll as gc, approveErc20 as gd, cancelAll as ge, cancelMarketOrders as gf, cancelOrder as gg, cancelOrders as gh, deployDepositWallet as gi, depositToPerps as gj, downloadAccountingSnapshot as gk, dropNotifications as gl, estimateMarketPrice as gm, executeCollateralReturnPlan as gn, fetchBalanceAllowance as go, fetchBuilderFeeRates as gp, fetchBuilderVolume as gq, fetchClosedOnlyMode as gr, fetchCommentsById as gs, fetchEvent as gt, fetchEventLiveVolume as gu, fetchEventTags as gv, fetchExecuteParams as gw, fetchLastTradePrice as gx, fetchLastTradePrices as gy, fetchMarket as gz, type ArmPerpsAutoCancelRequest as h, setupTradingApprovals as h$, fetchTickSize as h0, fetchTotalEarningsForUserForDay as h1, fetchTradedMarketCount as h2, fetchTransaction as h3, isWalletDeployed as h4, listAccountTrades as h5, listActivity as h6, listBuilderLeaderboard as h7, listBuilderTrades as h8, listClosedPositions as h9, mergeMarketPosition as hA, mergePositions as hB, openPerpsSession as hC, openRfqSession as hD, planCollateralReturn as hE, postOrder as hF, postOrders as hG, prepareCollateralReturnExecution as hH, prepareErc1155ApprovalForAll as hI, prepareErc20Approval as hJ, prepareErc20Transfer as hK, prepareGaslessTransaction as hL, prepareMergeComboPosition as hM, prepareMergeMarketPosition as hN, prepareMergePositions as hO, preparePerpsDeposit as hP, prepareRedeemComboPosition as hQ, prepareRedeemMarketPositions as hR, prepareRedeemPositions as hS, prepareSplitComboPosition as hT, prepareSplitMarketPosition as hU, prepareSplitPosition as hV, prepareTradingApprovals as hW, redeemPositions as hX, resolveConditionByToken as hY, revokePerpsCredentials as hZ, search as h_, listComboActivity as ha, listComboMarkets as hb, listComboPositions as hc, listComments as hd, listCommentsByUserAddress as he, listCurrentRewards as hf, listEvents as hg, listMarketClarifications as hh, listMarketHolders as hi, listMarketPositions as hj, listMarketRewards as hk, listMarkets as hl, listOpenInterest as hm, listOpenOrders as hn, listPerpsCandles as ho, listPerpsFundingHistory as hp, listPerpsTrades as hq, listPositions as hr, listSeries as hs, listTags as ht, listTeams as hu, listTraderLeaderboard as hv, listTrades as hw, listUserEarningsAndMarketsConfig as hx, listUserEarningsForDay as hy, mergeComboPosition as hz, AutoCancelDailyLimitError as i, splitComboPosition as i0, splitMarketPosition as i1, splitPosition as i2, subscribe as i3, transferErc20 as i4, updateBalanceAllowance as i5, waitForOrderFillSettlement as i6, withdrawFromPerps as i7, BasePublicClient as j, BaseSecureClient as k, type BeginAuthenticationRequest as l, type CancelAllPerpsOrdersRequest as m, CancelMarketOrdersError as n, CancelOrderError as o, CancelOrdersError as p, type CancelPerpsOrderRequest as q, type CancelPerpsOrdersRequest as r, CancelledSigningError as s, type Client as t, type ClientActions as u, type ClientDecorator as v, type ClobEndpoints as w, ComboPositionSort as x, type CombosEndpoints as y, ConnectionLostError as z };
package/dist/viem.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { PrivateKey } from '@polymarket/types';
2
2
  import { Chain, Transport, WalletClient } from 'viem';
3
- import { S as Signer } from './types-BzzqPJTs.js';
3
+ import { S as Signer } from './types-BBaRrND2.js';
4
4
  import '@polymarket/bindings';
5
5
  import '@polymarket/bindings/gamma';
6
6
  import '@polymarket/bindings/relayer';
package/dist/viem.js CHANGED
@@ -1,2 +1,2 @@
1
- import {a,l,j,i,h,c as c$1}from'./chunk-4LDMO37Q.js';import {invariant,expectEvmAddress,expectEvmSignature,isPrivateKey,expectTxHash}from'@polymarket/types';import {createWalletClient,http,UserRejectedRequestError,TransactionExecutionError,WaitForTransactionReceiptTimeoutError}from'viem';import {privateKeyToAccount}from'viem/accounts';import {waitForTransactionReceipt}from'viem/actions';import {polygon}from'viem/chains';function H(t){return t.account!==void 0}function q(t){invariant(H(t),"Wallet client with account is required");let n=t.account,e=expectEvmAddress(typeof t.account=="string"?t.account:t.account.address);return {getAddress(){return Promise.resolve(e)},async signTypedData(r){return expectEvmSignature(await I(t,{account:n,...r}))},async signMessage(r){return expectEvmSignature(await R(t,{account:n,message:{raw:r}}))},async sendTransaction({chainId:r,...f}){await K(t,r);let m=await A(t,{account:n,...f});return new s(m,t)}}}function b(t,n={}){if(!isPrivateKey(t))throw new a("Expected a hex-encoded 32-byte private key.");return q(createWalletClient({account:privateKeyToAccount(t),chain:n.chain??polygon,transport:n.transport??http()}))}async function A(t,n){try{let e=await t.sendTransaction(n);return expectTxHash(e)}catch(e){c(e);}}async function K(t,n){try{let e=t.chain?.id??await t.getChainId();if(e!==n)throw new l(`Wallet client is connected to chain ${e}, expected ${n}`)}catch(e){throw e instanceof l?e:l.fromError(e,"Could not resolve wallet client chain ID")}}async function I(t,n){try{return await t.signTypedData(n)}catch(e){c(e);}}async function R(t,n){try{return await t.signMessage(n)}catch(e){c(e);}}function c(t){if(t instanceof UserRejectedRequestError)throw j.fromError(t);if(t instanceof TransactionExecutionError){let n=t.walk(e=>e instanceof UserRejectedRequestError);if(n)throw j.fromError(n)}throw l.fromError(t)}var s=class{transactionId=null;#t;#n;constructor(n,e){this.#t=expectTxHash(n),this.#n=e;}get transactionHash(){return this.#t}async wait(){try{let n=await waitForTransactionReceipt(this.#n,{hash:this.#t}),e=expectTxHash(n.transactionHash);if(this.#t=e,n.status==="reverted")throw new i(`Transaction ${e} reverted`);return {transactionHash:e,transactionId:null}}catch(n){throw n instanceof WaitForTransactionReceiptTimeoutError?new h(`Timed out waiting for transaction ${this.#t} to settle`,{cause:n}):c$1.fromError(n)}}};export{b as privateKey,q as signerFrom};//# sourceMappingURL=viem.js.map
1
+ import {a,m,j,i,h,c as c$1}from'./chunk-MIRUWWDK.js';import {invariant,expectEvmAddress,expectEvmSignature,isPrivateKey,expectTxHash}from'@polymarket/types';import {createWalletClient,http,UserRejectedRequestError,TransactionExecutionError,WaitForTransactionReceiptTimeoutError}from'viem';import {privateKeyToAccount}from'viem/accounts';import {waitForTransactionReceipt}from'viem/actions';import {polygon}from'viem/chains';function H(t){return t.account!==void 0}function q(t){invariant(H(t),"Wallet client with account is required");let n=t.account,e=expectEvmAddress(typeof t.account=="string"?t.account:t.account.address);return {getAddress(){return Promise.resolve(e)},async signTypedData(r){return expectEvmSignature(await I(t,{account:n,...r}))},async signMessage(r){return expectEvmSignature(await R(t,{account:n,message:{raw:r}}))},async sendTransaction({chainId:r,...f}){await K(t,r);let m=await A(t,{account:n,...f});return new s(m,t)}}}function b(t,n={}){if(!isPrivateKey(t))throw new a("Expected a hex-encoded 32-byte private key.");return q(createWalletClient({account:privateKeyToAccount(t),chain:n.chain??polygon,transport:n.transport??http()}))}async function A(t,n){try{let e=await t.sendTransaction(n);return expectTxHash(e)}catch(e){c(e);}}async function K(t,n){try{let e=t.chain?.id??await t.getChainId();if(e!==n)throw new m(`Wallet client is connected to chain ${e}, expected ${n}`)}catch(e){throw e instanceof m?e:m.fromError(e,"Could not resolve wallet client chain ID")}}async function I(t,n){try{return await t.signTypedData(n)}catch(e){c(e);}}async function R(t,n){try{return await t.signMessage(n)}catch(e){c(e);}}function c(t){if(t instanceof UserRejectedRequestError)throw j.fromError(t);if(t instanceof TransactionExecutionError){let n=t.walk(e=>e instanceof UserRejectedRequestError);if(n)throw j.fromError(n)}throw m.fromError(t)}var s=class{transactionId=null;#t;#n;constructor(n,e){this.#t=expectTxHash(n),this.#n=e;}get transactionHash(){return this.#t}async wait(){try{let n=await waitForTransactionReceipt(this.#n,{hash:this.#t}),e=expectTxHash(n.transactionHash);if(this.#t=e,n.status==="reverted")throw new i(`Transaction ${e} reverted`);return {transactionHash:e,transactionId:null}}catch(n){throw n instanceof WaitForTransactionReceiptTimeoutError?new h(`Timed out waiting for transaction ${this.#t} to settle`,{cause:n}):c$1.fromError(n)}}};export{b as privateKey,q as signerFrom};//# sourceMappingURL=viem.js.map
2
2
  //# sourceMappingURL=viem.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polymarket/client",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "The Polymarket TypeScript client",
5
5
  "repository": {
6
6
  "type": "git",
@@ -93,7 +93,7 @@
93
93
  "ky": "^1.14.3",
94
94
  "ox": "^0.14.16",
95
95
  "zod": "^4.3.6",
96
- "@polymarket/bindings": "0.3.0",
96
+ "@polymarket/bindings": "0.5.0",
97
97
  "@polymarket/types": "0.1.0"
98
98
  },
99
99
  "publishConfig": {
@@ -1,6 +0,0 @@
1
- import {PolymarketError}from'@polymarket/types';var v=/^[$A-Z_a-z][$\w]*$/;function i(s){let r=c(s.issues);return r.length===0?"It was not possible to determine a more specific reason.":["Fix the following issues:",p(r)].join(`
2
- `)}function u(s,r){let e=c(s.issues);return e.length===0?["Received an incompatible API response.",`Endpoint: ${r.endpoint}`,"This usually means the API response shape changed in a breaking way or the SDK is outdated.","It was not possible to determine a more specific reason."].join(`
3
- `):["Received an incompatible API response.",`Endpoint: ${r.endpoint}`,"This usually means the API response shape changed in a breaking way or the SDK is outdated.","Fix the following issues:",p(e)].join(`
4
- `)}function p(s){return s.map(e=>e.path===null?`- ${e.message}`:`- ${e.path}: ${e.message}`).join(`
5
- `)}function c(s){return d(s).slice(0,99)}function d(s,r=[]){let e=s.flatMap(n=>{let a=[...r,...n.path];return n.code==="invalid_union"?n.errors.flatMap(A=>d(A,a)):[{code:n.code,message:n.message,path:a.length===0?null:U(a)}]});return O(e)}function O(s){let r=new Set,e=[];for(let n of s){let a=`${n.code}:${n.path??""}:${n.message}`;r.has(a)||(r.add(a),e.push(n));}return e.sort(Z)}function Z(s,r){return s.path===null&&r.path!==null?-1:s.path!==null&&r.path===null?1:(s.path??"").localeCompare(r.path??"")}function U(s){return s.reduce((r,e)=>typeof e=="number"?`${r}[${e.toString()}]`:typeof e!="string"?r:e.includes('"')?`${r}["${e.replaceAll('"','\\"')}"]`:v.test(e)?r.length===0?e:`${r}.${e}`:`${r}["${e}"]`,"")}var m=class s extends PolymarketError{name="UserInputError";constructor(r,e={}){super(r,e);}static fromZodError(r){return new s(i(r),{cause:r})}},l=class s extends PolymarketError{name="UnexpectedResponseError";constructor(r,e={}){super(r,e);}static fromZodError(r,e){return new s(u(r,e),{cause:r})}},f=class s extends PolymarketError{name="TransportError";constructor(r,e={}){super(r,e);}static fromError(r){return new s(r instanceof Error?r.message:"Request failed",{cause:r})}},P=(t=>(t[t.NormalClosure=1e3]="NormalClosure",t[t.GoingAway=1001]="GoingAway",t[t.ProtocolError=1002]="ProtocolError",t[t.UnsupportedData=1003]="UnsupportedData",t[t.NoStatusReceived=1005]="NoStatusReceived",t[t.AbnormalClosure=1006]="AbnormalClosure",t[t.InvalidFramePayload=1007]="InvalidFramePayload",t[t.PolicyViolation=1008]="PolicyViolation",t[t.MessageTooBig=1009]="MessageTooBig",t[t.InternalError=1011]="InternalError",t[t.ServiceRestart=1012]="ServiceRestart",t[t.TryAgainLater=1013]="TryAgainLater",t))(P||{}),g=class extends PolymarketError{name="ConnectionLostError";code;reason;constructor(r,e){super(r,e),this.code=e.code,this.reason=e.reason;}},y=class extends PolymarketError{name="RequestRejectedError";status;retryAfter;constructor(r,e){super(r,e),this.status=e.status,this.retryAfter=e.retryAfter;}},E=class extends PolymarketError{name="RateLimitError";retryAfter;constructor(r,e={}){super(r,e),this.retryAfter=e.retryAfter;}},I=class extends PolymarketError{name="TimeoutError";constructor(r,e={}){super(r,e);}},x=class extends PolymarketError{name="TransactionFailedError";constructor(r,e={}){super(r,e);}},h=class s extends PolymarketError{name="CancelledSigningError";constructor(r,e={}){super(r,e);}static fromError(r){return new s(r.message,{cause:r})}},$=class extends PolymarketError{name="InsufficientLiquidityError";constructor(r,e={}){super(r,e);}},R=class s extends PolymarketError{name="SigningError";constructor(r,e={}){super(r,e);}static fromError(r,e){let n=e??(r instanceof Error?r.message:"Signing failed");return new s(n,{cause:r})}};function M(...s){return {isError(r){return s.some(e=>r instanceof e)}}}export{m as a,l as b,f as c,P as d,g as e,y as f,E as g,I as h,x as i,h as j,$ as k,R as l,M as m};//# sourceMappingURL=chunk-4LDMO37Q.js.map
6
- //# sourceMappingURL=chunk-4LDMO37Q.js.map