@polymarket/client 0.1.0 → 0.3.0-beta.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/actions/index.d.ts +5 -5
- package/dist/actions/index.js +1 -1
- package/dist/chunk-4LDMO37Q.js +6 -0
- package/dist/chunk-4LDMO37Q.js.map +1 -0
- package/dist/chunk-BYPXVDER.js +2 -0
- package/dist/chunk-BYPXVDER.js.map +1 -0
- package/dist/chunk-KZISI26J.js +2 -0
- package/dist/{chunk-3GYPYD7Z.js.map → chunk-KZISI26J.js.map} +1 -1
- package/dist/ethers-v5.d.ts +2 -2
- package/dist/ethers-v5.js +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/node.js +1 -1
- package/dist/privy.js +1 -1
- package/dist/{sports-Dm3yiYAe.d.ts → sports-06gcFYkj.d.ts} +1 -1
- package/dist/{types-CgIv7KE4.d.ts → types-CJLEdIu5.d.ts} +279 -16
- package/dist/viem.d.ts +2 -2
- package/dist/viem.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3GYPYD7Z.js +0 -2
- package/dist/chunk-TYJAXA3Y.js +0 -6
- package/dist/chunk-TYJAXA3Y.js.map +0 -1
- package/dist/chunk-Z6CZB4WP.js +0 -2
- package/dist/chunk-Z6CZB4WP.js.map +0 -1
package/dist/node.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {e}from'./chunk-
|
|
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")}}};
|
|
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-
|
|
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
|
|
2
2
|
//# sourceMappingURL=privy.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrderResponse } from '@polymarket/bindings/clob';
|
|
2
|
-
import {
|
|
2
|
+
import { bN as RateLimitError, bQ as RequestRejectedError, cz as SigningError, cH as TransportError, cK as UnexpectedResponseError, U as UserInputError, ay as InsufficientLiquidityError, h as BaseSecureClient, fc as PrepareLimitOrderRequest, eR as OrderWorkflow, eQ as OrderPostingWorkflow, fe as PrepareMarketOrderRequest, p as CancelledSigningError, bD as PostOrderError, cC as TimeoutError, cD as TransactionFailedError, fQ as SignedOrder, B as BaseClient } from './types-CJLEdIu5.js';
|
|
3
3
|
import { SportsMarketTypesResponse, SportsMetadata } from '@polymarket/bindings/gamma';
|
|
4
4
|
|
|
5
5
|
type PrepareMarketOrderError = InsufficientLiquidityError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as _polymarket_bindings from '@polymarket/bindings';
|
|
2
|
-
import { PaginationCursor, DecimalString, OrderSide, OrderType, TokenId, BuilderCode, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue, PositionId, TransactionId } from '@polymarket/bindings';
|
|
3
|
-
import { PolymarketError, HexString, EvmAddress, EvmSignature, NonEmptyArray, Prettify, Erc1271Signature, TxHash } from '@polymarket/types';
|
|
2
|
+
import { PaginationCursor, DecimalString, OrderSide, OrderType, TokenId, BuilderCode, TxHash, EvmAddress as EvmAddress$1, CtfConditionId, TickSizeValue, PositionId, TransactionId } from '@polymarket/bindings';
|
|
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';
|
|
6
6
|
import { ZodError, z } from 'zod';
|
|
7
7
|
import * as _polymarket_bindings_clob from '@polymarket/bindings/clob';
|
|
8
|
-
import { ClobTrade, NotificationsResponse, BuilderTrade, Midpoints, Prices, OrderBook, Spreads, LastTradePrice, LastTradePriceForToken, PriceHistoryPoint, CurrentReward, MarketReward, OrdersScoringResponse, UserEarning, TotalUserEarning, UserRewardsEarning, RewardsPercentages, CancelOrdersResponse, SignatureType, OrderResponse, OrderResponses, OpenOrder, ApiKeyCreds, BalanceAllowanceResponse, BuilderFeeRates, MarketInfo } from '@polymarket/bindings/clob';
|
|
8
|
+
import { ClobTrade, NotificationsResponse, BuilderTrade, Midpoints, Prices, OrderBook, Spreads, LastTradePrice, LastTradePriceForToken, PriceHistoryPoint, CurrentReward, MarketReward, OrdersScoringResponse, UserEarning, TotalUserEarning, UserRewardsEarning, RewardsPercentages, CancelOrdersResponse, SignatureType, OrderResponse, OrderResponses, AcceptedOrderResponse, OpenOrder, ApiKeyCreds, BalanceAllowanceResponse, BuilderFeeRates, MarketInfo } from '@polymarket/bindings/clob';
|
|
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
|
-
import
|
|
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';
|
|
12
13
|
import { PerpsInstrument, PerpsTicker, PerpsBook, PerpsCandle, PerpsFundingRate, PerpsPublicTrade, PerpsFeeScheduleEntry, PerpsWithdrawalId, PerpsDepositStatus, PerpsWithdrawalStatus, PerpsPnlInterval, PerpsDecimalInput, PerpsTimeInForce, PerpsCredentials, PerpsBalance, PerpsPortfolio, PerpsAccountStats, PerpsAccountConfig, PerpsOrder, PerpsAccountFill, PerpsAccountFundingPayment, PerpsDeposit, PerpsWithdrawal, PerpsEquityPoint, PerpsPnlPoint, PerpsOrderId, PerpsPostOrderAck, PerpsCancelOrderResult, PerpsUpdateLeverageResult, PerpsInstrumentCategory, PerpsKlineInterval } from '@polymarket/bindings/perps';
|
|
13
|
-
import { PerpsSessionEvent, CommentsEvent, CryptoPricesTopic, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, PerpsTradeEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsTickerEvent, PerpsStatisticEvent, CryptoPricesEvent, PerpsMarketDataEvent } from '@polymarket/bindings/subscriptions';
|
|
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';
|
|
14
15
|
import { Hex } from 'ox';
|
|
15
16
|
|
|
16
17
|
type ResponseValidationContext = {
|
|
@@ -88,6 +89,11 @@ declare class ConnectionLostError extends PolymarketError {
|
|
|
88
89
|
}
|
|
89
90
|
type RequestRejectedErrorOptions = {
|
|
90
91
|
status: number;
|
|
92
|
+
/**
|
|
93
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
94
|
+
* provided one.
|
|
95
|
+
*/
|
|
96
|
+
retryAfter?: number;
|
|
91
97
|
};
|
|
92
98
|
/**
|
|
93
99
|
* Error thrown when a service responds with a non-success status other than
|
|
@@ -96,14 +102,32 @@ type RequestRejectedErrorOptions = {
|
|
|
96
102
|
declare class RequestRejectedError extends PolymarketError {
|
|
97
103
|
name: "RequestRejectedError";
|
|
98
104
|
readonly status: number;
|
|
105
|
+
/**
|
|
106
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
107
|
+
* provided one.
|
|
108
|
+
*/
|
|
109
|
+
readonly retryAfter?: number;
|
|
99
110
|
constructor(message: string, options: ErrorOptions & RequestRejectedErrorOptions);
|
|
100
111
|
}
|
|
112
|
+
type RateLimitErrorOptions = {
|
|
113
|
+
/**
|
|
114
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
115
|
+
* provided one.
|
|
116
|
+
*/
|
|
117
|
+
retryAfter?: number;
|
|
118
|
+
};
|
|
101
119
|
/**
|
|
102
120
|
* Error thrown when the service rejects a request because the rate limit has
|
|
103
121
|
* been exceeded.
|
|
104
122
|
*/
|
|
105
123
|
declare class RateLimitError extends PolymarketError {
|
|
106
124
|
name: "RateLimitError";
|
|
125
|
+
/**
|
|
126
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
127
|
+
* provided one.
|
|
128
|
+
*/
|
|
129
|
+
readonly retryAfter?: number;
|
|
130
|
+
constructor(message: string, options?: ErrorOptions & RateLimitErrorOptions);
|
|
107
131
|
}
|
|
108
132
|
/**
|
|
109
133
|
* Error thrown when an async wait operation exceeds its allotted polling time.
|
|
@@ -314,8 +338,16 @@ declare const WaitForGaslessTransactionError: {
|
|
|
314
338
|
declare const PageSizeSchema: z.ZodNumber;
|
|
315
339
|
type Page<T> = {
|
|
316
340
|
items: T;
|
|
341
|
+
/**
|
|
342
|
+
* Whether another page may be available.
|
|
343
|
+
*
|
|
344
|
+
* On methods without a server-provided continuation signal, a full page
|
|
345
|
+
* reports `true` and the follow-up request returns an empty final page when
|
|
346
|
+
* the collection ended exactly on a page boundary.
|
|
347
|
+
*/
|
|
317
348
|
hasMore: boolean;
|
|
318
349
|
nextCursor?: PaginationCursor;
|
|
350
|
+
/** Total number of matching items across all pages. Only present when the service reports one. */
|
|
319
351
|
totalCount?: number;
|
|
320
352
|
};
|
|
321
353
|
type Paginated<T> = AsyncIterable<Page<T>> & {
|
|
@@ -2845,7 +2877,8 @@ type PublicSubscriptionsActions = {
|
|
|
2845
2877
|
* Starts one or more realtime subscriptions on this client.
|
|
2846
2878
|
*
|
|
2847
2879
|
* @throws {@link SubscribeError}
|
|
2848
|
-
* Thrown when
|
|
2880
|
+
* Thrown when a TWAP subscription requests an unsupported window or the
|
|
2881
|
+
* realtime connection fails.
|
|
2849
2882
|
*
|
|
2850
2883
|
* @example
|
|
2851
2884
|
* ```ts
|
|
@@ -2865,7 +2898,8 @@ type SecureSubscriptionsActions = {
|
|
|
2865
2898
|
* Starts one or more realtime subscriptions on this client.
|
|
2866
2899
|
*
|
|
2867
2900
|
* @throws {@link SubscribeError}
|
|
2868
|
-
* Thrown when
|
|
2901
|
+
* Thrown when a TWAP subscription requests an unsupported window or the
|
|
2902
|
+
* realtime connection fails.
|
|
2869
2903
|
*
|
|
2870
2904
|
* @example
|
|
2871
2905
|
* ```ts
|
|
@@ -3242,6 +3276,52 @@ declare function postOrder(client: BaseSecureClient): (order: SignedOrder) => Pr
|
|
|
3242
3276
|
*/
|
|
3243
3277
|
declare function postOrders(client: BaseSecureClient): (orders: PostOrdersRequest) => Promise<OrderResponses>;
|
|
3244
3278
|
|
|
3279
|
+
type WaitForOrderFillSettlementRequest = {
|
|
3280
|
+
/**
|
|
3281
|
+
* Maximum time to wait for the order's fills to settle, in milliseconds.
|
|
3282
|
+
* Defaults to 30000.
|
|
3283
|
+
*/
|
|
3284
|
+
timeoutMs?: number;
|
|
3285
|
+
};
|
|
3286
|
+
type WaitForOrderFillSettlementError = RateLimitError | RequestRejectedError | SigningError | TimeoutError | TransactionFailedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
3287
|
+
declare const WaitForOrderFillSettlementError: {
|
|
3288
|
+
isError(error: unknown): error is SigningError | TransportError | TransactionFailedError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError | TimeoutError;
|
|
3289
|
+
};
|
|
3290
|
+
/**
|
|
3291
|
+
* Waits until every fill listed in an order response reaches a terminal
|
|
3292
|
+
* settlement outcome and returns the settlement transaction hashes.
|
|
3293
|
+
*
|
|
3294
|
+
* @remarks
|
|
3295
|
+
* Settlement covers the fills listed in this order response, identified by the
|
|
3296
|
+
* response's `tradeIds`. These are the fills that happened immediately when
|
|
3297
|
+
* the order was accepted. It does not wait for later fills of any remaining
|
|
3298
|
+
* quantity resting on the book; subscribe to the `user` channel to follow
|
|
3299
|
+
* those.
|
|
3300
|
+
*
|
|
3301
|
+
* Orders without fill identifiers resolve immediately to any transaction
|
|
3302
|
+
* hashes carried by the order response, or an empty array. In the rare case
|
|
3303
|
+
* where some fills fail execution, the settled fills' hashes are still
|
|
3304
|
+
* returned; the failed fills simply contribute no hash.
|
|
3305
|
+
*
|
|
3306
|
+
* @example
|
|
3307
|
+
* ```ts
|
|
3308
|
+
* const response = await client.placeMarketOrder({
|
|
3309
|
+
* amount: 10,
|
|
3310
|
+
* side: OrderSide.BUY,
|
|
3311
|
+
* tokenId: '123',
|
|
3312
|
+
* });
|
|
3313
|
+
*
|
|
3314
|
+
* if (response.ok) {
|
|
3315
|
+
* const hashes = await waitForOrderFillSettlement(client, response);
|
|
3316
|
+
* }
|
|
3317
|
+
* ```
|
|
3318
|
+
*
|
|
3319
|
+
* @throws {@link WaitForOrderFillSettlementError}
|
|
3320
|
+
* Thrown on failure: a timeout while fills are still settling, or every fill
|
|
3321
|
+
* failing execution. The order placement itself is unaffected.
|
|
3322
|
+
*/
|
|
3323
|
+
declare function waitForOrderFillSettlement(client: BaseSecureClient, order: AcceptedOrderResponse, request?: WaitForOrderFillSettlementRequest): Promise<TxHash[]>;
|
|
3324
|
+
|
|
3245
3325
|
type SecureTradingActions = {
|
|
3246
3326
|
/**
|
|
3247
3327
|
* Creates a signed market order for the authenticated account.
|
|
@@ -3272,6 +3352,11 @@ type SecureTradingActions = {
|
|
|
3272
3352
|
/**
|
|
3273
3353
|
* Creates and posts a market order for the authenticated account.
|
|
3274
3354
|
*
|
|
3355
|
+
* @remarks
|
|
3356
|
+
* Settlement happens asynchronously, so a matched response is not
|
|
3357
|
+
* guaranteed to carry settlement transaction hashes. Use
|
|
3358
|
+
* `waitForOrderFillSettlement` to obtain them reliably.
|
|
3359
|
+
*
|
|
3275
3360
|
* @throws {@link PlaceMarketOrderError}
|
|
3276
3361
|
* Thrown on failure.
|
|
3277
3362
|
*
|
|
@@ -3297,6 +3382,20 @@ type SecureTradingActions = {
|
|
|
3297
3382
|
*
|
|
3298
3383
|
* // response: OrderResponse
|
|
3299
3384
|
* ```
|
|
3385
|
+
*
|
|
3386
|
+
* @example Market buy followed to settlement
|
|
3387
|
+
* ```ts
|
|
3388
|
+
* const response = await client.placeMarketOrder({
|
|
3389
|
+
* amount: 10,
|
|
3390
|
+
* side: OrderSide.BUY,
|
|
3391
|
+
* tokenId: '123',
|
|
3392
|
+
* });
|
|
3393
|
+
*
|
|
3394
|
+
* if (response.ok) {
|
|
3395
|
+
* const hashes = await client.waitForOrderFillSettlement(response);
|
|
3396
|
+
* // hashes: TxHash[]
|
|
3397
|
+
* }
|
|
3398
|
+
* ```
|
|
3300
3399
|
*/
|
|
3301
3400
|
placeMarketOrder(request: PrepareMarketOrderRequest): Promise<OrderResponse>;
|
|
3302
3401
|
/**
|
|
@@ -3374,6 +3473,35 @@ type SecureTradingActions = {
|
|
|
3374
3473
|
* ```
|
|
3375
3474
|
*/
|
|
3376
3475
|
postOrders(orders: PostOrdersRequest): Promise<OrderResponses>;
|
|
3476
|
+
/**
|
|
3477
|
+
* Waits until every fill listed in an order response reaches a terminal
|
|
3478
|
+
* settlement outcome and returns the settlement transaction hashes.
|
|
3479
|
+
*
|
|
3480
|
+
* @remarks
|
|
3481
|
+
* Settlement covers the fills listed in this order response. These are the
|
|
3482
|
+
* fills that happened immediately when the order was accepted. It does not
|
|
3483
|
+
* wait for later fills of any remaining quantity resting on the book;
|
|
3484
|
+
* subscribe to the `user` channel to follow those.
|
|
3485
|
+
*
|
|
3486
|
+
* @throws {@link WaitForOrderFillSettlementError}
|
|
3487
|
+
* Thrown on failure: a timeout while fills are still settling, or every
|
|
3488
|
+
* fill failing execution. The order placement itself is unaffected.
|
|
3489
|
+
*
|
|
3490
|
+
* @example
|
|
3491
|
+
* ```ts
|
|
3492
|
+
* const response = await client.placeMarketOrder({
|
|
3493
|
+
* amount: 10,
|
|
3494
|
+
* side: OrderSide.BUY,
|
|
3495
|
+
* tokenId: '123',
|
|
3496
|
+
* });
|
|
3497
|
+
*
|
|
3498
|
+
* if (response.ok) {
|
|
3499
|
+
* const hashes = await client.waitForOrderFillSettlement(response);
|
|
3500
|
+
* // hashes: TxHash[]
|
|
3501
|
+
* }
|
|
3502
|
+
* ```
|
|
3503
|
+
*/
|
|
3504
|
+
waitForOrderFillSettlement(order: AcceptedOrderResponse, request?: WaitForOrderFillSettlementRequest): Promise<TxHash$1[]>;
|
|
3377
3505
|
/**
|
|
3378
3506
|
* Cancels a single open order for the authenticated account.
|
|
3379
3507
|
*
|
|
@@ -3659,6 +3787,58 @@ type SecureWalletActions = {
|
|
|
3659
3787
|
* ```
|
|
3660
3788
|
*/
|
|
3661
3789
|
redeemPositions(request: PrepareRedeemPositionsRequest): Promise<TransactionHandle>;
|
|
3790
|
+
/**
|
|
3791
|
+
* Plans a collateral return for the authenticated account.
|
|
3792
|
+
*
|
|
3793
|
+
* The returned plan is an inspectable artifact: review the collateral it
|
|
3794
|
+
* releases, the inputs it consumes, and the residual-position impact, and
|
|
3795
|
+
* apply any application-specific limits before executing it with
|
|
3796
|
+
* {@link SecureWalletActions.executeCollateralReturnPlan | executeCollateralReturnPlan}.
|
|
3797
|
+
* A truncated plan is one executable chunk of a larger return; execute and
|
|
3798
|
+
* confirm it before requesting the next plan.
|
|
3799
|
+
*
|
|
3800
|
+
* @throws {@link PlanCollateralReturnError}
|
|
3801
|
+
* Thrown on failure.
|
|
3802
|
+
*
|
|
3803
|
+
* @example
|
|
3804
|
+
* ```ts
|
|
3805
|
+
* let plan: CollateralReturnPlanResponse;
|
|
3806
|
+
*
|
|
3807
|
+
* do {
|
|
3808
|
+
* plan = await client.planCollateralReturn();
|
|
3809
|
+
*
|
|
3810
|
+
* // Inspect the return and residual-position impact, and apply any
|
|
3811
|
+
* // application-specific limits before signing.
|
|
3812
|
+
* const handle = await client.executeCollateralReturnPlan({ plan });
|
|
3813
|
+
* await handle.wait();
|
|
3814
|
+
* } while (plan.truncated);
|
|
3815
|
+
* ```
|
|
3816
|
+
*/
|
|
3817
|
+
planCollateralReturn(): Promise<CollateralReturnPlanResponse>;
|
|
3818
|
+
/**
|
|
3819
|
+
* Executes a collateral return plan for the authenticated account.
|
|
3820
|
+
*
|
|
3821
|
+
* Execution signs and submits the exact call carried by the plan; nothing is
|
|
3822
|
+
* recomputed on the client, and no approval transactions are run implicitly.
|
|
3823
|
+
* Confirmation stays explicit through the returned handle's `wait()`.
|
|
3824
|
+
*
|
|
3825
|
+
* If wallet state changed since the plan was created, the service rejects
|
|
3826
|
+
* the submission; request a fresh plan and execute that instead.
|
|
3827
|
+
*
|
|
3828
|
+
* @throws {@link ExecuteCollateralReturnPlanError}
|
|
3829
|
+
* Thrown on failure.
|
|
3830
|
+
*
|
|
3831
|
+
* @example
|
|
3832
|
+
* ```ts
|
|
3833
|
+
* const plan = await client.planCollateralReturn();
|
|
3834
|
+
*
|
|
3835
|
+
* const handle = await client.executeCollateralReturnPlan({ plan });
|
|
3836
|
+
* const outcome = await handle.wait();
|
|
3837
|
+
*
|
|
3838
|
+
* // outcome.transactionHash: TxHash
|
|
3839
|
+
* ```
|
|
3840
|
+
*/
|
|
3841
|
+
executeCollateralReturnPlan(request: ExecuteCollateralReturnPlanRequest): Promise<TransactionHandle>;
|
|
3662
3842
|
};
|
|
3663
3843
|
declare function walletActions(client: BaseSecureClient): SecureWalletActions;
|
|
3664
3844
|
|
|
@@ -3688,7 +3868,9 @@ type ClobEndpoints = RestEndpoint & {
|
|
|
3688
3868
|
market: WebSocketEndpoint;
|
|
3689
3869
|
user: WebSocketEndpoint;
|
|
3690
3870
|
};
|
|
3691
|
-
type
|
|
3871
|
+
type CombosEndpoints = RestEndpoint & WebSocketEndpoint & {
|
|
3872
|
+
collateralReturn: RestEndpoint;
|
|
3873
|
+
};
|
|
3692
3874
|
/**
|
|
3693
3875
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
3694
3876
|
*/
|
|
@@ -3728,7 +3910,9 @@ type EnvironmentConfigFork = {
|
|
|
3728
3910
|
relayer?: Partial<RestEndpoint>;
|
|
3729
3911
|
gamma?: Partial<RestEndpoint>;
|
|
3730
3912
|
data?: Partial<RestEndpoint>;
|
|
3731
|
-
|
|
3913
|
+
combos?: EnvironmentConfigForkEndpoint & {
|
|
3914
|
+
collateralReturn?: Partial<RestEndpoint>;
|
|
3915
|
+
};
|
|
3732
3916
|
perps?: EnvironmentConfigForkEndpoint;
|
|
3733
3917
|
rtds?: Partial<WebSocketEndpoint>;
|
|
3734
3918
|
sports?: Partial<WebSocketEndpoint>;
|
|
@@ -5142,6 +5326,68 @@ declare const ListMarketRewardsError: {
|
|
|
5142
5326
|
*/
|
|
5143
5327
|
declare function listMarketRewards(client: BaseClient, request: ListMarketRewardsRequest): Paginated<MarketReward[]>;
|
|
5144
5328
|
|
|
5329
|
+
type PlanCollateralReturnError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
5330
|
+
declare const PlanCollateralReturnError: {
|
|
5331
|
+
isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
5332
|
+
};
|
|
5333
|
+
/**
|
|
5334
|
+
* Plans a collateral return for the authenticated account.
|
|
5335
|
+
*
|
|
5336
|
+
* @remarks
|
|
5337
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5338
|
+
*
|
|
5339
|
+
* @throws {@link PlanCollateralReturnError}
|
|
5340
|
+
* Thrown on failure.
|
|
5341
|
+
*/
|
|
5342
|
+
declare function planCollateralReturn(client: BaseSecureClient): Promise<CollateralReturnPlanResponse>;
|
|
5343
|
+
declare const ExecuteCollateralReturnPlanRequestSchema: z.ZodObject<{
|
|
5344
|
+
plan: z.ZodObject<{
|
|
5345
|
+
planHash: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
5346
|
+
chainId: z.ZodNumber;
|
|
5347
|
+
wallet: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
5348
|
+
routerCall: z.ZodPipe<z.ZodObject<{
|
|
5349
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress$1, string>>;
|
|
5350
|
+
data: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
5351
|
+
}, z.core.$strip>, z.ZodTransform<_polymarket_bindings_combos.CollateralReturnRouterCall, {
|
|
5352
|
+
to: EvmAddress$1;
|
|
5353
|
+
data: `0x${string}`;
|
|
5354
|
+
}>>;
|
|
5355
|
+
}, z.core.$loose>;
|
|
5356
|
+
}, z.core.$strip>;
|
|
5357
|
+
type ExecuteCollateralReturnPlanRequest = z.infer<typeof ExecuteCollateralReturnPlanRequestSchema>;
|
|
5358
|
+
type CollateralReturnExecutionWorkflow = AsyncGenerator<GaslessWorkflowRequest, TransactionHandle, EvmAddress$1 | EvmSignature | TransactionHandle>;
|
|
5359
|
+
type PrepareCollateralReturnExecutionError = RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError;
|
|
5360
|
+
declare const PrepareCollateralReturnExecutionError: {
|
|
5361
|
+
isError(error: unknown): error is TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError;
|
|
5362
|
+
};
|
|
5363
|
+
/**
|
|
5364
|
+
* Starts a collateral return execution workflow for a previously requested
|
|
5365
|
+
* plan.
|
|
5366
|
+
*
|
|
5367
|
+
* The workflow signs and submits the exact call carried by the plan.
|
|
5368
|
+
*
|
|
5369
|
+
* @remarks
|
|
5370
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5371
|
+
*
|
|
5372
|
+
* @throws {@link PrepareCollateralReturnExecutionError}
|
|
5373
|
+
* Thrown on failure.
|
|
5374
|
+
*/
|
|
5375
|
+
declare function prepareCollateralReturnExecution(client: BaseSecureClient, request: ExecuteCollateralReturnPlanRequest): Promise<CollateralReturnExecutionWorkflow>;
|
|
5376
|
+
type ExecuteCollateralReturnPlanError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError | UserInputError | CancelledSigningError | SigningError;
|
|
5377
|
+
declare const ExecuteCollateralReturnPlanError: {
|
|
5378
|
+
isError(error: unknown): error is SigningError | CancelledSigningError | TransportError | UserInputError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
5379
|
+
};
|
|
5380
|
+
/**
|
|
5381
|
+
* Executes a collateral return plan for the authenticated account.
|
|
5382
|
+
*
|
|
5383
|
+
* @remarks
|
|
5384
|
+
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
5385
|
+
*
|
|
5386
|
+
* @throws {@link ExecuteCollateralReturnPlanError}
|
|
5387
|
+
* Thrown on failure.
|
|
5388
|
+
*/
|
|
5389
|
+
declare function executeCollateralReturnPlan(client: BaseSecureClient, request: ExecuteCollateralReturnPlanRequest): Promise<TransactionHandle>;
|
|
5390
|
+
|
|
5145
5391
|
declare const ListCommentsRequestSchema: z.ZodObject<{
|
|
5146
5392
|
ascending: z.ZodOptional<z.ZodBoolean>;
|
|
5147
5393
|
cursor: z.ZodOptional<z.ZodCustom<_polymarket_bindings.PaginationCursor, _polymarket_bindings.PaginationCursor>>;
|
|
@@ -7917,6 +8163,13 @@ type CryptoPricesSubscription = {
|
|
|
7917
8163
|
topic: CryptoPricesTopic;
|
|
7918
8164
|
symbols?: readonly string[];
|
|
7919
8165
|
};
|
|
8166
|
+
type CryptoPricesChainlinkTwapSubscription = {
|
|
8167
|
+
topic: CryptoPricesChainlinkTwapTopic;
|
|
8168
|
+
/** Averaging window used to calculate each TWAP price. */
|
|
8169
|
+
windowSeconds: CryptoPricesChainlinkTwapWindowSeconds;
|
|
8170
|
+
/** Lowercase slash-delimited symbols, such as `btc/usd`. */
|
|
8171
|
+
symbols?: readonly string[];
|
|
8172
|
+
};
|
|
7920
8173
|
type EquityPricesSubscription = {
|
|
7921
8174
|
topic: EquityPricesTopic;
|
|
7922
8175
|
symbol: string;
|
|
@@ -7969,7 +8222,7 @@ type PerpsStatisticsSubscription = {
|
|
|
7969
8222
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7970
8223
|
*/
|
|
7971
8224
|
type PerpsMarketDataSubscription = PerpsTradesSubscription | PerpsBboSubscription | PerpsBookSubscription | PerpsCandlesSubscription | PerpsTickersSubscription | PerpsStatisticsSubscription;
|
|
7972
|
-
type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | EquityPricesSubscription | PerpsMarketDataSubscription;
|
|
8225
|
+
type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | CryptoPricesChainlinkTwapSubscription | EquityPricesSubscription | PerpsMarketDataSubscription;
|
|
7973
8226
|
type SecureSubscriptionSpec = PublicSubscriptionSpec | UserSubscription;
|
|
7974
8227
|
type PublicRealtimeEvent = MarketEvent | SportsEvent | CommentsEvent | CryptoPricesEvent | EquityPricesEvent | PerpsMarketDataEvent;
|
|
7975
8228
|
type SecureRealtimeEvent = PublicRealtimeEvent | UserEvent;
|
|
@@ -7981,6 +8234,7 @@ type EventByTopic = {
|
|
|
7981
8234
|
comments: CommentsEvent;
|
|
7982
8235
|
'prices.crypto.binance': CryptoPricesBinanceEvent;
|
|
7983
8236
|
'prices.crypto.chainlink': CryptoPricesChainlinkEvent;
|
|
8237
|
+
'prices.crypto.chainlink.twap': CryptoPricesChainlinkTwapEvent;
|
|
7984
8238
|
'prices.equity.pyth': EquityPricesEvent;
|
|
7985
8239
|
'perps.trades': PerpsTradeEvent;
|
|
7986
8240
|
'perps.bbo': PerpsBboEvent;
|
|
@@ -7990,7 +8244,12 @@ type EventByTopic = {
|
|
|
7990
8244
|
'perps.statistics': PerpsStatisticEvent;
|
|
7991
8245
|
};
|
|
7992
8246
|
type EventForMarketSubscription<TSpec extends MarketSubscription> = 'customFeatureEnabled' extends keyof TSpec ? true extends TSpec['customFeatureEnabled'] ? MarketEvent : StandardMarketEvent : StandardMarketEvent;
|
|
7993
|
-
type
|
|
8247
|
+
type EventForCryptoPricesChainlinkTwapSubscription<TSpec extends CryptoPricesChainlinkTwapSubscription> = TSpec extends {
|
|
8248
|
+
windowSeconds: 30;
|
|
8249
|
+
} ? CryptoPricesChainlinkTwapThirtyEvent : TSpec extends {
|
|
8250
|
+
windowSeconds: 60;
|
|
8251
|
+
} ? CryptoPricesChainlinkTwapSixtyEvent : CryptoPricesChainlinkTwapEvent;
|
|
8252
|
+
type EventForSubscriptionSpec<TSpec extends SecureSubscriptionSpec> = TSpec extends MarketSubscription ? EventForMarketSubscription<TSpec> : TSpec extends CryptoPricesChainlinkTwapSubscription ? EventForCryptoPricesChainlinkTwapSubscription<TSpec> : TSpec extends {
|
|
7994
8253
|
topic: infer TTopic extends keyof EventByTopic;
|
|
7995
8254
|
} ? EventByTopic[TTopic] : never;
|
|
7996
8255
|
type EventForSubscriptionSpecs<TSubscriptions extends readonly SecureSubscriptionSpec[]> = EventForSubscriptionSpec<TSubscriptions[number]>;
|
|
@@ -8002,7 +8261,10 @@ type SubscriptionHandle<TEvent> = {
|
|
|
8002
8261
|
*/
|
|
8003
8262
|
close(): Promise<void>;
|
|
8004
8263
|
} & AsyncIterable<TEvent>;
|
|
8005
|
-
type SubscribeError = TransportError;
|
|
8264
|
+
type SubscribeError = TransportError | UserInputError;
|
|
8265
|
+
declare const SubscribeError: {
|
|
8266
|
+
isError(error: unknown): error is TransportError | UserInputError;
|
|
8267
|
+
};
|
|
8006
8268
|
/**
|
|
8007
8269
|
* Starts one or more realtime subscriptions on this client.
|
|
8008
8270
|
*
|
|
@@ -8010,7 +8272,8 @@ type SubscribeError = TransportError;
|
|
|
8010
8272
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
8011
8273
|
*
|
|
8012
8274
|
* @throws {@link SubscribeError}
|
|
8013
|
-
* Thrown when
|
|
8275
|
+
* Thrown when a TWAP subscription requests an unsupported window or the
|
|
8276
|
+
* realtime connection fails.
|
|
8014
8277
|
*
|
|
8015
8278
|
* @example
|
|
8016
8279
|
* ```ts
|
|
@@ -8334,7 +8597,7 @@ type TransactionOutcome = {
|
|
|
8334
8597
|
/**
|
|
8335
8598
|
* The hash of the settled transaction.
|
|
8336
8599
|
*/
|
|
8337
|
-
transactionHash: TxHash;
|
|
8600
|
+
transactionHash: TxHash$1;
|
|
8338
8601
|
/**
|
|
8339
8602
|
* The unique identifier of the settled transaction when submitted through the Polymarket API,
|
|
8340
8603
|
* or null if the transaction was submitted directly to the blockchain.
|
|
@@ -8349,7 +8612,7 @@ interface TransactionHandle {
|
|
|
8349
8612
|
/**
|
|
8350
8613
|
* The hash of the submitted transaction, or null if the transaction is pending submission.
|
|
8351
8614
|
*/
|
|
8352
|
-
readonly transactionHash: TxHash | null;
|
|
8615
|
+
readonly transactionHash: TxHash$1 | null;
|
|
8353
8616
|
/**
|
|
8354
8617
|
* The unique identifier of the submitted transaction when submitted through the Polymarket API,
|
|
8355
8618
|
* or null if the transaction was submitted directly to the blockchain.
|
|
@@ -8370,4 +8633,4 @@ type Signer = {
|
|
|
8370
8633
|
sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
|
|
8371
8634
|
};
|
|
8372
8635
|
|
|
8373
|
-
export { FetchOrderBookError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type DataActions as D, type DepositToPerpsRequest as E, type DiscoveryActions as F, DownloadAccountingSnapshotError as G, DropNotificationsError as H, type EnvironmentConfig as I, type EnvironmentConfigFork as J, type EnvironmentContracts as K, EstimateMarketPriceError as L, FetchClosedOnlyModeError as M, FetchCommentsByIdError as N, FetchEventError as O, FetchEventLiveVolumeError as P, FetchEventTagsError as Q, FetchLastTradePriceError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchLastTradePricesError as V, FetchMarketError as W, FetchMarketTagsError as X, FetchMidpointError as Y, FetchMidpointsError as Z, FetchNotificationsError as _, type TypedData as a, ListSeriesError as a$, FetchOrderBooksError as a0, FetchOrderError as a1, FetchOrderScoringError as a2, FetchOrdersScoringError as a3, type FetchPerpsAccountConfigRequest as a4, FetchPerpsBookError as a5, type FetchPerpsBookRequest as a6, FetchPerpsFeesError as a7, FetchPerpsInstrumentsError as a8, type FetchPerpsInstrumentsRequest as a9, ListClosedPositionsError as aA, ListComboActivityError as aB, ListComboMarketsError as aC, ListComboPositionsError as aD, ListCommentsByUserAddressError as aE, ListCommentsError as aF, ListCurrentRewardsError as aG, ListEventsError as aH, ListMarketHoldersError as aI, ListMarketPositionsError as aJ, ListMarketRewardsError as aK, ListMarketsError as aL, ListOpenInterestError as aM, ListOpenOrdersError as aN, ListPerpsCandlesError as aO, type ListPerpsCandlesRequest as aP, type ListPerpsDepositsRequest as aQ, type ListPerpsEquityHistoryRequest as aR, type ListPerpsFillsRequest as aS, ListPerpsFundingHistoryError as aT, type ListPerpsFundingHistoryRequest as aU, type ListPerpsFundingPaymentsRequest as aV, type ListPerpsPnlHistoryRequest as aW, ListPerpsTradesError as aX, type ListPerpsTradesRequest as aY, type ListPerpsWithdrawalsRequest as aZ, ListPositionsError as a_, type FetchPerpsOpenOrdersRequest as aa, type FetchPerpsOrdersRequest as ab, FetchPerpsTickerError as ac, type FetchPerpsTickerRequest as ad, FetchPerpsTickersError as ae, type FetchPerpsTickersRequest as af, FetchPortfolioValueError as ag, FetchPriceError as ah, FetchPriceHistoryError as ai, FetchPricesError as aj, FetchPublicProfileError as ak, FetchRelatedTagResourcesError as al, FetchRelatedTagsError as am, FetchRewardPercentagesError as an, FetchSeriesError as ao, FetchSpreadError as ap, FetchSpreadsError as aq, FetchTagError as ar, FetchTotalEarningsForUserForDayError as as, FetchTradedMarketCountError as at, InsufficientLiquidityError as au, ListAccountTradesError as av, ListActivityError as aw, ListBuilderLeaderboardError as ax, ListBuilderTradesError as ay, ListBuilderVolumeError as az, type TransactionCall as b, type RfqQuoteReference as b$, ListTagsError as b0, ListTeamsError as b1, ListTraderLeaderboardError as b2, ListTradesError as b3, ListUserEarningsAndMarketsConfigError as b4, ListUserEarningsForDayError as b5, MergePositionsError as b6, OpenPerpsSessionError as b7, type OpenPerpsSessionRequest as b8, OpenRfqSessionError as b9, type PostPerpsOrdersRequest as bA, type PublicAccountActions as bB, type PublicActions as bC, type PublicClient as bD, type PublicClientOptions as bE, type PublicPerpsActions as bF, type PublicRewardsActions as bG, type PublicSubscriptionsActions as bH, RateLimitError as bI, RedeemPositionsError as bJ, RequestRejectedError as bK, type RequestRejectedErrorOptions as bL, type RestEndpoint as bM, type ResumePerpsSessionRequest as bN, RevokePerpsCredentialsError as bO, type RevokePerpsCredentialsRequest as bP, type RfqCancelQuoteAck as bQ, RfqCancelQuoteError as bR, RfqCancelQuoteRejectedError as bS, type RfqCancelQuoteRejectedErrorOptions as bT, type RfqConfirmationAck as bU, RfqConfirmationError as bV, RfqConfirmationRejectedError as bW, type RfqConfirmationRequestEvent as bX, type RfqEndpoints as bY, type RfqEvent as bZ, RfqQuoteError as b_, type Page as ba, PageSizeSchema as bb, type Paginated as bc, type PerpsActions as bd, type PerpsBookDepth as be, type PerpsEndpoints as bf, type PerpsOrderRequest as bg, type PerpsPlaceFokOrderRequest as bh, type PerpsPlaceGtcOrderRequest as bi, type PerpsPlaceIocOrderRequest as bj, type PerpsPlacedTpSlOrder as bk, type PerpsPlacedTpSlOrders as bl, type PerpsPositionTpSlTrigger as bm, PerpsSession as bn, type PerpsSessionAccountError as bo, type PerpsSessionLifecycleError as bp, type PerpsSessionTradingError as bq, type PerpsTpSlTrigger as br, type PlacePerpsOrderRequest as bs, type PlacePerpsOrderResult as bt, type PlacePerpsOrderWithTpSlRequest as bu, type PlacePerpsOrderWithTpSlResult as bv, type PlacePerpsPositionTpSlRequest as bw, type PlacePerpsPositionTpSlResult as bx, PostOrderError as by, PostOrdersError as bz, type AccountIdentity as c, subscriptionsActions as c$, RfqQuoteRejectedError as c0, type RfqQuoteRejectedErrorOptions as c1, type RfqQuoteRequestEvent as c2, type RfqQuoteResponse as c3, type RfqQuoteSource as c4, type RfqSession as c5, type RfqTradeEvent as c6, SearchError as c7, SearchSort as c8, type SecureAccountActions as c9, TransferErc20Error as cA, TransportError as cB, type TypedDataDomain as cC, type TypedDataField as cD, UnexpectedResponseError as cE, UpdatePerpsLeverageError as cF, type UpdatePerpsLeverageRequest as cG, WaitForTransactionError as cH, type WalletDerivationConfig as cI, type WebSocketCloseCode as cJ, type WebSocketEndpoint as cK, WebSocketKnownCloseCode as cL, WithdrawFromPerpsError as cM, type WithdrawFromPerpsRequest as cN, accountActions as cO, allActions as cP, analyticsActions as cQ, createPublicClient as cR, createSecureClient as cS, dataActions as cT, discoveryActions as cU, forkEnvironmentConfig as cV, makeErrorGuard as cW, perpsActions as cX, production as cY, rewardsActions as cZ, rfqActions as c_, type SecureActions as ca, type SecureClient as cb, type SecureClientOptions as cc, type SecureDownloadAccountingSnapshotRequest as cd, type SecureFetchPortfolioValueRequest as ce, type SecureFetchTradedMarketCountRequest as cf, type SecureListActivityRequest as cg, type SecureListClosedPositionsRequest as ch, type SecureListComboActivityRequest as ci, type SecureListComboPositionsRequest as cj, type SecureListPositionsRequest as ck, type SecurePerpsActions as cl, type SecureRewardsActions as cm, type SecureRfqActions as cn, type SecureSubscriptionsActions as co, type SecureTradingActions as cp, type SecureWalletActions as cq, SetupGaslessWalletError as cr, SetupTradingApprovalsError as cs, type SignerTransactionRequest as ct, SigningError as cu, SplitPositionError as cv, TimeoutError as cw, TransactionFailedError as cx, type TransactionHandle as cy, type TransactionOutcome as cz, type AnalyticsActions as d, FetchTickSizeError as d$, tradingActions as d0, walletActions as d1, type CancelMarketOrdersRequest as d2, type CancelOrderRequest as d3, type CancelOrdersRequest as d4, type CommentsEventType as d5, type CommentsSubscription as d6, type CryptoPricesEventType as d7, type CryptoPricesSubscription as d8, DeployDepositWalletError as d9, type FetchGaslessTransactionRequest as dA, type FetchLastTradePriceRequest as dB, type FetchLastTradePricesRequest as dC, FetchMarketInfoError as dD, type FetchMarketInfoRequest as dE, type FetchMarketRequest as dF, type FetchMarketTagsRequest as dG, type FetchMidpointRequest as dH, type FetchMidpointsRequest as dI, FetchNegRiskError as dJ, type FetchNegRiskRequest as dK, type FetchOrderBookRequest as dL, type FetchOrderBooksRequest as dM, type FetchOrderRequest as dN, type FetchOrderScoringRequest as dO, type FetchOrdersScoringRequest as dP, type FetchPortfolioValueRequest as dQ, type FetchPriceHistoryRequest as dR, type FetchPriceRequest as dS, type FetchPricesRequest as dT, type FetchPublicProfileRequest as dU, type FetchRelatedTagResourcesRequest as dV, type FetchRelatedTagsRequest as dW, type FetchSeriesRequest as dX, type FetchSpreadRequest as dY, type FetchSpreadsRequest as dZ, type FetchTagRequest as d_, type DownloadAccountingSnapshotRequest as da, type DropNotificationsRequest as db, type EquityPricesEventType as dc, type EquityPricesSubscription as dd, type Erc1155ApprovalForAllWorkflow as de, type Erc1155ApprovalForAllWorkflowRequest as df, type Erc20ApprovalWorkflow as dg, type Erc20ApprovalWorkflowRequest as dh, type Erc20TransferWorkflow as di, type Erc20TransferWorkflowRequest as dj, type EstimateMarketBuyPriceRequest as dk, type EstimateMarketPriceRequest as dl, type EstimateMarketSellPriceRequest as dm, type EventForSubscriptionSpec as dn, type EventForSubscriptionSpecs as dp, FetchBalanceAllowanceError as dq, type FetchBalanceAllowanceRequest as dr, FetchBuilderFeeRatesError as ds, type FetchBuilderFeeRatesRequest as dt, type FetchCommentsByIdRequest as du, type FetchEventLiveVolumeRequest as dv, type FetchEventRequest as dw, type FetchEventTagsRequest as dx, FetchExecuteParamsError as dy, type FetchExecuteParamsRequest as dz, ApproveErc1155ForAllError as e, PrepareErc20TransferError as e$, type FetchTickSizeRequest as e0, type FetchTotalEarningsForUserForDayRequest as e1, type FetchTradedMarketCountRequest as e2, GaslessTransactionMetadataSchema as e3, type GaslessWorkflow as e4, type GaslessWorkflowRequest as e5, IsWalletDeployedError as e6, type IsWalletDeployedRequest as e7, type ListAccountTradesRequest as e8, type ListActivityRequest as e9, type ListUserEarningsForDayRequest as eA, type MarketEventType as eB, type MarketSubscription as eC, MergeComboPositionError as eD, MergeMarketPositionError as eE, type MergePositionsWorkflow as eF, type MergePositionsWorkflowRequest as eG, type OrderDraft as eH, type OrderPostingWorkflow as eI, type OrderWorkflow as eJ, type OrderWorkflowRequest as eK, type PerpsBboSubscription as eL, type PerpsBookSubscription as eM, type PerpsCandlesSubscription as eN, type PerpsDepositWorkflow as eO, type PerpsDepositWorkflowRequest as eP, type PerpsMarketDataEventType as eQ, type PerpsMarketDataSubscription as eR, type PerpsStatisticsSubscription as eS, type PerpsStreamingCandleInterval as eT, type PerpsTickersSubscription as eU, type PerpsTradesSubscription as eV, type PostOrdersRequest as eW, PrepareErc1155ApprovalForAllError as eX, type PrepareErc1155ApprovalForAllRequest as eY, PrepareErc20ApprovalError as eZ, type PrepareErc20ApprovalRequest as e_, type ListBuilderLeaderboardRequest as ea, type ListBuilderTradesRequest as eb, type ListBuilderVolumeRequest as ec, type ListClosedPositionsRequest as ed, type ListComboActivityRequest as ee, type ListComboMarketsRequest as ef, type ListComboPositionsRequest as eg, type ListCommentsByUserAddressRequest as eh, type ListCommentsRequest as ei, type ListCurrentRewardsRequest as ej, type ListEventsRequest as ek, ListMarketClarificationsError as el, type ListMarketClarificationsRequest as em, type ListMarketHoldersRequest as en, type ListMarketPositionsRequest as eo, type ListMarketRewardsRequest as ep, type ListMarketsRequest as eq, type ListOpenInterestRequest as er, type ListOpenOrdersRequest as es, type ListPositionsRequest as et, type ListSeriesRequest as eu, type ListTagsRequest as ev, type ListTeamsRequest as ew, type ListTraderLeaderboardRequest as ex, type ListTradesRequest as ey, type ListUserEarningsAndMarketsConfigRequest as ez, ApproveErc20Error as f, cancelOrder as f$, type PrepareErc20TransferRequest as f0, PrepareGaslessTransactionError as f1, type PrepareGaslessTransactionRequest as f2, type PrepareLimitOrderRequest as f3, type PrepareMarketBuyOrderRequest as f4, type PrepareMarketOrderRequest as f5, type PrepareMarketSellOrderRequest as f6, PrepareMergeComboPositionError as f7, type PrepareMergeComboPositionRequest as f8, PrepareMergeMarketPositionError as f9, type RfqConfirmationRejectedErrorOptions as fA, type RfqExecutionUpdateEvent as fB, type SearchRequest as fC, type SearchResults as fD, type SecureRealtimeEvent as fE, type SecureRealtimeTopic as fF, type SecureSubscriptionSpec as fG, type SignedOrder as fH, SplitComboPositionError as fI, SplitMarketPositionError as fJ, type SplitPositionWorkflow as fK, type SplitPositionWorkflowRequest as fL, type SportsEventType as fM, type SportsSubscription as fN, type SubscribeError as fO, type SubscriptionHandle as fP, type TradingApprovalsWorkflow as fQ, type TradingApprovalsWorkflowRequest as fR, UpdateBalanceAllowanceError as fS, type UpdateBalanceAllowanceRequest as fT, type UserEventType as fU, type UserSubscription as fV, WaitForGaslessTransactionError as fW, approveErc1155ForAll as fX, approveErc20 as fY, cancelAll as fZ, cancelMarketOrders as f_, type PrepareMergeMarketPositionRequest as fa, PrepareMergePositionsError as fb, type PrepareMergePositionsRequest as fc, PreparePerpsDepositError as fd, PrepareRedeemComboPositionError as fe, type PrepareRedeemComboPositionRequest as ff, type PrepareRedeemMarketPositionsByConditionIdRequest as fg, type PrepareRedeemMarketPositionsByMarketIdRequest as fh, PrepareRedeemMarketPositionsError as fi, type PrepareRedeemMarketPositionsRequest as fj, PrepareRedeemPositionsError as fk, type PrepareRedeemPositionsRequest as fl, PrepareSplitComboPositionError as fm, type PrepareSplitComboPositionRequest as fn, PrepareSplitMarketPositionError as fo, type PrepareSplitMarketPositionRequest as fp, PrepareSplitPositionError as fq, type PrepareSplitPositionRequest as fr, PrepareTradingApprovalsError as fs, type PublicRealtimeEvent as ft, type PublicRealtimeTopic as fu, type PublicSubscriptionSpec as fv, type RedeemPositionsWorkflow as fw, type RedeemPositionsWorkflowRequest as fx, ResolveConditionByTokenError as fy, type ResolveConditionByTokenRequest as fz, BasePublicClient as g, listMarketClarifications as g$, cancelOrders as g0, deployDepositWallet as g1, depositToPerps as g2, downloadAccountingSnapshot as g3, dropNotifications as g4, estimateMarketPrice as g5, fetchBalanceAllowance as g6, fetchBuilderFeeRates as g7, fetchBuilderVolume as g8, fetchClosedOnlyMode as g9, fetchPriceHistory as gA, fetchPrices as gB, fetchPublicProfile as gC, fetchRelatedTagResources as gD, fetchRelatedTags as gE, fetchRewardPercentages as gF, fetchSeries as gG, fetchSpread as gH, fetchSpreads as gI, fetchTag as gJ, fetchTickSize as gK, fetchTotalEarningsForUserForDay as gL, fetchTradedMarketCount as gM, fetchTransaction as gN, isWalletDeployed as gO, listAccountTrades as gP, listActivity as gQ, listBuilderLeaderboard as gR, listBuilderTrades as gS, listClosedPositions as gT, listComboActivity as gU, listComboMarkets as gV, listComboPositions as gW, listComments as gX, listCommentsByUserAddress as gY, listCurrentRewards as gZ, listEvents as g_, fetchCommentsById as ga, fetchEvent as gb, fetchEventLiveVolume as gc, fetchEventTags as gd, fetchExecuteParams as ge, fetchLastTradePrice as gf, fetchLastTradePrices as gg, fetchMarket as gh, fetchMarketInfo as gi, fetchMarketTags as gj, fetchMidpoint as gk, fetchMidpoints as gl, fetchNegRisk as gm, fetchNotifications as gn, fetchOrder as go, fetchOrderBook as gp, fetchOrderBooks as gq, fetchOrderScoring as gr, fetchOrdersScoring as gs, fetchPerpsBook as gt, fetchPerpsFees as gu, fetchPerpsInstruments as gv, fetchPerpsTicker as gw, fetchPerpsTickers as gx, fetchPortfolioValue as gy, fetchPrice as gz, BaseSecureClient as h, listMarketHolders as h0, listMarketPositions as h1, listMarketRewards as h2, listMarkets as h3, listOpenInterest as h4, listOpenOrders as h5, listPerpsCandles as h6, listPerpsFundingHistory as h7, listPerpsTrades as h8, listPositions as h9, prepareSplitMarketPosition as hA, prepareSplitPosition as hB, prepareTradingApprovals as hC, redeemPositions as hD, resolveConditionByToken as hE, revokePerpsCredentials as hF, search as hG, setupTradingApprovals as hH, splitComboPosition as hI, splitMarketPosition as hJ, splitPosition as hK, subscribe as hL, transferErc20 as hM, updateBalanceAllowance as hN, withdrawFromPerps as hO, listSeries as ha, listTags as hb, listTeams as hc, listTraderLeaderboard as hd, listTrades as he, listUserEarningsAndMarketsConfig as hf, listUserEarningsForDay as hg, mergeComboPosition as hh, mergeMarketPosition as hi, mergePositions as hj, openPerpsSession as hk, openRfqSession as hl, postOrder as hm, postOrders as hn, prepareErc1155ApprovalForAll as ho, prepareErc20Approval as hp, prepareErc20Transfer as hq, prepareGaslessTransaction as hr, prepareMergeComboPosition as hs, prepareMergeMarketPosition as ht, prepareMergePositions as hu, preparePerpsDeposit as hv, prepareRedeemComboPosition as hw, prepareRedeemMarketPositions as hx, prepareRedeemPositions as hy, prepareSplitComboPosition as hz, type BeginAuthenticationRequest as i, 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, ConnectionLostError as v, type ConnectionLostErrorOptions as w, type CreatePerpsSessionRequest as x, CreateSecureClientError as y, DepositToPerpsError as z };
|
|
8636
|
+
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, ListPerpsTradesError 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 ListPerpsPnlHistoryRequest 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, RfqConfirmationError as b$, type ListPerpsTradesRequest as b0, type ListPerpsWithdrawalsRequest as b1, ListPositionsError as b2, ListSeriesError as b3, ListTagsError as b4, ListTeamsError as b5, ListTraderLeaderboardError as b6, ListTradesError as b7, ListUserEarningsAndMarketsConfigError as b8, ListUserEarningsForDayError as b9, type PlacePerpsPositionTpSlRequest as bA, type PlacePerpsPositionTpSlResult as bB, PlanCollateralReturnError as bC, PostOrderError as bD, PostOrdersError as bE, type PostPerpsOrdersRequest as bF, type PublicAccountActions as bG, type PublicActions as bH, type PublicClient as bI, type PublicClientOptions as bJ, type PublicPerpsActions as bK, type PublicRewardsActions as bL, type PublicSubscriptionsActions as bM, RateLimitError as bN, type RateLimitErrorOptions as bO, RedeemPositionsError as bP, RequestRejectedError as bQ, type RequestRejectedErrorOptions as bR, type RestEndpoint as bS, type ResumePerpsSessionRequest as bT, RevokePerpsCredentialsError as bU, type RevokePerpsCredentialsRequest as bV, type RfqCancelQuoteAck as bW, RfqCancelQuoteError as bX, RfqCancelQuoteRejectedError as bY, type RfqCancelQuoteRejectedErrorOptions as bZ, type RfqConfirmationAck as b_, MergePositionsError as ba, OpenPerpsSessionError as bb, type OpenPerpsSessionRequest as bc, OpenRfqSessionError as bd, type Page as be, PageSizeSchema as bf, type Paginated as bg, type PerpsActions as bh, type PerpsBookDepth as bi, type PerpsEndpoints as bj, type PerpsOrderRequest as bk, type PerpsPlaceFokOrderRequest as bl, type PerpsPlaceGtcOrderRequest as bm, type PerpsPlaceIocOrderRequest as bn, type PerpsPlacedTpSlOrder as bo, type PerpsPlacedTpSlOrders as bp, type PerpsPositionTpSlTrigger as bq, PerpsSession as br, type PerpsSessionAccountError as bs, type PerpsSessionLifecycleError as bt, type PerpsSessionTradingError as bu, type PerpsTpSlTrigger as bv, type PlacePerpsOrderRequest as bw, type PlacePerpsOrderResult as bx, type PlacePerpsOrderWithTpSlRequest as by, type PlacePerpsOrderWithTpSlResult as bz, type AccountIdentity as c, discoveryActions as c$, RfqConfirmationRejectedError as c0, type RfqConfirmationRequestEvent as c1, type RfqEvent as c2, RfqQuoteError as c3, type RfqQuoteReference as c4, RfqQuoteRejectedError as c5, type RfqQuoteRejectedErrorOptions as c6, type RfqQuoteRequestEvent as c7, type RfqQuoteResponse as c8, type RfqQuoteSource as c9, SplitPositionError as cA, SubscribeError as cB, TimeoutError as cC, TransactionFailedError as cD, type TransactionHandle as cE, type TransactionOutcome as cF, TransferErc20Error as cG, TransportError as cH, type TypedDataDomain as cI, type TypedDataField as cJ, UnexpectedResponseError as cK, UpdatePerpsLeverageError as cL, type UpdatePerpsLeverageRequest as cM, WaitForOrderFillSettlementError as cN, WaitForTransactionError as cO, type WalletDerivationConfig as cP, type WebSocketCloseCode as cQ, type WebSocketEndpoint as cR, WebSocketKnownCloseCode as cS, WithdrawFromPerpsError as cT, type WithdrawFromPerpsRequest as cU, accountActions as cV, allActions as cW, analyticsActions as cX, createPublicClient as cY, createSecureClient as cZ, dataActions as c_, type RfqSession as ca, type RfqTradeEvent as cb, SearchError as cc, SearchSort as cd, type SecureAccountActions as ce, type SecureActions as cf, type SecureClient as cg, type SecureClientOptions as ch, type SecureDownloadAccountingSnapshotRequest as ci, type SecureFetchPortfolioValueRequest as cj, type SecureFetchTradedMarketCountRequest as ck, type SecureListActivityRequest as cl, type SecureListClosedPositionsRequest as cm, type SecureListComboActivityRequest as cn, type SecureListComboPositionsRequest as co, type SecureListPositionsRequest as cp, type SecurePerpsActions as cq, type SecureRewardsActions as cr, type SecureRfqActions as cs, type SecureSubscriptionsActions as ct, type SecureTradingActions as cu, type SecureWalletActions as cv, SetupGaslessWalletError as cw, SetupTradingApprovalsError as cx, type SignerTransactionRequest as cy, SigningError as cz, type AnalyticsActions as d, type FetchPricesRequest as d$, forkEnvironmentConfig as d0, makeErrorGuard as d1, perpsActions as d2, production as d3, rewardsActions as d4, rfqActions as d5, subscriptionsActions as d6, tradingActions as d7, walletActions as d8, type CancelMarketOrdersRequest as d9, FetchBuilderFeeRatesError as dA, type FetchBuilderFeeRatesRequest as dB, type FetchCommentsByIdRequest as dC, type FetchEventLiveVolumeRequest as dD, type FetchEventRequest as dE, type FetchEventTagsRequest as dF, FetchExecuteParamsError as dG, type FetchExecuteParamsRequest as dH, type FetchGaslessTransactionRequest as dI, type FetchLastTradePriceRequest as dJ, type FetchLastTradePricesRequest as dK, FetchMarketInfoError as dL, type FetchMarketInfoRequest as dM, type FetchMarketRequest as dN, type FetchMarketTagsRequest as dO, type FetchMidpointRequest as dP, type FetchMidpointsRequest as dQ, FetchNegRiskError as dR, type FetchNegRiskRequest as dS, type FetchOrderBookRequest as dT, type FetchOrderBooksRequest as dU, type FetchOrderRequest as dV, type FetchOrderScoringRequest as dW, type FetchOrdersScoringRequest as dX, type FetchPortfolioValueRequest as dY, type FetchPriceHistoryRequest as dZ, type FetchPriceRequest as d_, type CancelOrderRequest as da, type CancelOrdersRequest as db, type CollateralReturnExecutionWorkflow as dc, type CommentsEventType as dd, type CommentsSubscription as de, type CryptoPricesEventType as df, type CryptoPricesSubscription as dg, DeployDepositWalletError as dh, type DownloadAccountingSnapshotRequest as di, type DropNotificationsRequest as dj, type EquityPricesEventType as dk, type EquityPricesSubscription as dl, type Erc1155ApprovalForAllWorkflow as dm, type Erc1155ApprovalForAllWorkflowRequest as dn, type Erc20ApprovalWorkflow as dp, type Erc20ApprovalWorkflowRequest as dq, type Erc20TransferWorkflow as dr, type Erc20TransferWorkflowRequest as ds, type EstimateMarketBuyPriceRequest as dt, type EstimateMarketPriceRequest as du, type EstimateMarketSellPriceRequest as dv, type EventForSubscriptionSpec as dw, type EventForSubscriptionSpecs as dx, FetchBalanceAllowanceError as dy, type FetchBalanceAllowanceRequest as dz, ApproveErc1155ForAllError as e, type PerpsStreamingCandleInterval as e$, type FetchPublicProfileRequest as e0, type FetchRelatedTagResourcesRequest as e1, type FetchRelatedTagsRequest as e2, type FetchSeriesRequest as e3, type FetchSpreadRequest as e4, type FetchSpreadsRequest as e5, type FetchTagRequest as e6, FetchTickSizeError as e7, type FetchTickSizeRequest as e8, type FetchTotalEarningsForUserForDayRequest as e9, type ListOpenOrdersRequest as eA, type ListPositionsRequest as eB, type ListSeriesRequest as eC, type ListTagsRequest as eD, type ListTeamsRequest as eE, type ListTraderLeaderboardRequest as eF, type ListTradesRequest as eG, type ListUserEarningsAndMarketsConfigRequest as eH, type ListUserEarningsForDayRequest as eI, type MarketEventType as eJ, type MarketSubscription as eK, MergeComboPositionError as eL, MergeMarketPositionError as eM, type MergePositionsWorkflow as eN, type MergePositionsWorkflowRequest as eO, type OrderDraft as eP, type OrderPostingWorkflow as eQ, type OrderWorkflow as eR, type OrderWorkflowRequest as eS, type PerpsBboSubscription as eT, type PerpsBookSubscription as eU, type PerpsCandlesSubscription as eV, type PerpsDepositWorkflow as eW, type PerpsDepositWorkflowRequest as eX, type PerpsMarketDataEventType as eY, type PerpsMarketDataSubscription as eZ, type PerpsStatisticsSubscription as e_, type FetchTradedMarketCountRequest as ea, GaslessTransactionMetadataSchema as eb, type GaslessWorkflow as ec, type GaslessWorkflowRequest as ed, IsWalletDeployedError as ee, type IsWalletDeployedRequest as ef, type ListAccountTradesRequest as eg, type ListActivityRequest as eh, type ListBuilderLeaderboardRequest as ei, type ListBuilderTradesRequest as ej, type ListBuilderVolumeRequest as ek, type ListClosedPositionsRequest as el, type ListComboActivityRequest as em, type ListComboMarketsRequest as en, type ListComboPositionsRequest as eo, type ListCommentsByUserAddressRequest as ep, type ListCommentsRequest as eq, type ListCurrentRewardsRequest as er, type ListEventsRequest as es, ListMarketClarificationsError as et, type ListMarketClarificationsRequest as eu, type ListMarketHoldersRequest as ev, type ListMarketPositionsRequest as ew, type ListMarketRewardsRequest as ex, type ListMarketsRequest as ey, type ListOpenInterestRequest as ez, ApproveErc20Error as f, type UpdateBalanceAllowanceRequest as f$, type PerpsTickersSubscription as f0, type PerpsTradesSubscription as f1, type PostOrdersRequest as f2, PrepareCollateralReturnExecutionError as f3, PrepareErc1155ApprovalForAllError as f4, type PrepareErc1155ApprovalForAllRequest as f5, PrepareErc20ApprovalError as f6, type PrepareErc20ApprovalRequest as f7, PrepareErc20TransferError as f8, type PrepareErc20TransferRequest as f9, type PrepareSplitPositionRequest as fA, PrepareTradingApprovalsError as fB, type PublicRealtimeEvent as fC, type PublicRealtimeTopic as fD, type PublicSubscriptionSpec as fE, type RedeemPositionsWorkflow as fF, type RedeemPositionsWorkflowRequest as fG, ResolveConditionByTokenError as fH, type ResolveConditionByTokenRequest as fI, type RfqConfirmationRejectedErrorOptions as fJ, type RfqExecutionUpdateEvent as fK, type SearchRequest as fL, type SearchResults as fM, type SecureRealtimeEvent as fN, type SecureRealtimeTopic as fO, type SecureSubscriptionSpec as fP, type SignedOrder as fQ, SplitComboPositionError as fR, SplitMarketPositionError as fS, type SplitPositionWorkflow as fT, type SplitPositionWorkflowRequest as fU, type SportsEventType as fV, type SportsSubscription as fW, type SubscriptionHandle as fX, type TradingApprovalsWorkflow as fY, type TradingApprovalsWorkflowRequest as fZ, UpdateBalanceAllowanceError as f_, PrepareGaslessTransactionError as fa, type PrepareGaslessTransactionRequest as fb, type PrepareLimitOrderRequest as fc, type PrepareMarketBuyOrderRequest as fd, type PrepareMarketOrderRequest as fe, type PrepareMarketSellOrderRequest as ff, PrepareMergeComboPositionError as fg, type PrepareMergeComboPositionRequest as fh, PrepareMergeMarketPositionError as fi, type PrepareMergeMarketPositionRequest as fj, PrepareMergePositionsError as fk, type PrepareMergePositionsRequest as fl, PreparePerpsDepositError as fm, PrepareRedeemComboPositionError as fn, type PrepareRedeemComboPositionRequest as fo, type PrepareRedeemMarketPositionsByConditionIdRequest as fp, type PrepareRedeemMarketPositionsByMarketIdRequest as fq, PrepareRedeemMarketPositionsError as fr, type PrepareRedeemMarketPositionsRequest as fs, PrepareRedeemPositionsError as ft, type PrepareRedeemPositionsRequest as fu, PrepareSplitComboPositionError as fv, type PrepareSplitComboPositionRequest as fw, PrepareSplitMarketPositionError as fx, type PrepareSplitMarketPositionRequest as fy, PrepareSplitPositionError as fz, BasePublicClient as g, listBuilderLeaderboard as g$, type UserEventType as g0, type UserSubscription as g1, WaitForGaslessTransactionError as g2, type WaitForOrderFillSettlementRequest as g3, approveErc1155ForAll as g4, approveErc20 as g5, cancelAll as g6, cancelMarketOrders as g7, cancelOrder as g8, cancelOrders as g9, fetchOrderBooks as gA, fetchOrderScoring as gB, fetchOrdersScoring as gC, fetchPerpsBook as gD, fetchPerpsFees as gE, fetchPerpsInstruments as gF, fetchPerpsTicker as gG, fetchPerpsTickers as gH, fetchPortfolioValue as gI, fetchPrice as gJ, fetchPriceHistory as gK, fetchPrices as gL, fetchPublicProfile as gM, fetchRelatedTagResources as gN, fetchRelatedTags as gO, fetchRewardPercentages as gP, fetchSeries as gQ, fetchSpread as gR, fetchSpreads as gS, fetchTag as gT, fetchTickSize as gU, fetchTotalEarningsForUserForDay as gV, fetchTradedMarketCount as gW, fetchTransaction as gX, isWalletDeployed as gY, listAccountTrades as gZ, listActivity as g_, deployDepositWallet as ga, depositToPerps as gb, downloadAccountingSnapshot as gc, dropNotifications as gd, estimateMarketPrice as ge, executeCollateralReturnPlan as gf, fetchBalanceAllowance as gg, fetchBuilderFeeRates as gh, fetchBuilderVolume as gi, fetchClosedOnlyMode as gj, fetchCommentsById as gk, fetchEvent as gl, fetchEventLiveVolume as gm, fetchEventTags as gn, fetchExecuteParams as go, fetchLastTradePrice as gp, fetchLastTradePrices as gq, fetchMarket as gr, fetchMarketInfo as gs, fetchMarketTags as gt, fetchMidpoint as gu, fetchMidpoints as gv, fetchNegRisk as gw, fetchNotifications as gx, fetchOrder as gy, fetchOrderBook as gz, BaseSecureClient as h, withdrawFromPerps as h$, listBuilderTrades as h0, listClosedPositions as h1, listComboActivity as h2, listComboMarkets as h3, listComboPositions as h4, listComments as h5, listCommentsByUserAddress as h6, listCurrentRewards as h7, listEvents as h8, listMarketClarifications as h9, prepareErc1155ApprovalForAll as hA, prepareErc20Approval as hB, prepareErc20Transfer as hC, prepareGaslessTransaction as hD, prepareMergeComboPosition as hE, prepareMergeMarketPosition as hF, prepareMergePositions as hG, preparePerpsDeposit as hH, prepareRedeemComboPosition as hI, prepareRedeemMarketPositions as hJ, prepareRedeemPositions as hK, prepareSplitComboPosition as hL, prepareSplitMarketPosition as hM, prepareSplitPosition as hN, prepareTradingApprovals as hO, redeemPositions as hP, resolveConditionByToken as hQ, revokePerpsCredentials as hR, search as hS, setupTradingApprovals as hT, splitComboPosition as hU, splitMarketPosition as hV, splitPosition as hW, subscribe as hX, transferErc20 as hY, updateBalanceAllowance as hZ, waitForOrderFillSettlement as h_, listMarketHolders as ha, listMarketPositions as hb, listMarketRewards as hc, listMarkets as hd, listOpenInterest as he, listOpenOrders as hf, listPerpsCandles as hg, listPerpsFundingHistory as hh, listPerpsTrades as hi, listPositions as hj, listSeries as hk, listTags as hl, listTeams as hm, listTraderLeaderboard as hn, listTrades as ho, listUserEarningsAndMarketsConfig as hp, listUserEarningsForDay as hq, mergeComboPosition as hr, mergeMarketPosition as hs, mergePositions as ht, openPerpsSession as hu, openRfqSession as hv, planCollateralReturn as hw, postOrder as hx, postOrders as hy, prepareCollateralReturnExecution as hz, type BeginAuthenticationRequest as i, 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 };
|
package/dist/viem.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { PrivateKey } from '@polymarket/types';
|
|
2
2
|
import { Chain, Transport, WalletClient } from 'viem';
|
|
3
|
-
import { S as Signer } from './types-
|
|
3
|
+
import { S as Signer } from './types-CJLEdIu5.js';
|
|
4
4
|
import '@polymarket/bindings';
|
|
5
5
|
import '@polymarket/bindings/gamma';
|
|
6
6
|
import '@polymarket/bindings/relayer';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import '@polymarket/bindings/clob';
|
|
9
9
|
import '@polymarket/bindings/data';
|
|
10
|
-
import '@polymarket/bindings/
|
|
10
|
+
import '@polymarket/bindings/combos';
|
|
11
11
|
import '@polymarket/bindings/perps';
|
|
12
12
|
import '@polymarket/bindings/subscriptions';
|
|
13
13
|
import 'ox';
|
package/dist/viem.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {a,l,j,i,h,c as c$1}from'./chunk-
|
|
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
|
|
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
|
+
"version": "0.3.0-beta.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.
|
|
96
|
+
"@polymarket/bindings": "0.3.0-beta.0",
|
|
97
97
|
"@polymarket/types": "0.1.0"
|
|
98
98
|
},
|
|
99
99
|
"publishConfig": {
|
package/dist/chunk-3GYPYD7Z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {PolymarketError}from'@polymarket/types';var e=class t extends PolymarketError{name="TransportError";constructor(r,s={}){super(r,s);}static fromError(r){return new t(r instanceof Error?r.message:"Request failed",{cause:r})}};var a=class extends PolymarketError{name="TimeoutError";constructor(r,s={}){super(r,s);}},o=class extends PolymarketError{name="TransactionFailedError";constructor(r,s={}){super(r,s);}},i=class t extends PolymarketError{name="CancelledSigningError";constructor(r,s={}){super(r,s);}static fromError(r){return new t(r.message,{cause:r})}};var u=class t extends PolymarketError{name="SigningError";constructor(r,s={}){super(r,s);}static fromError(r,s){let p=s??(r instanceof Error?r.message:"Signing failed");return new t(p,{cause:r})}};export{e as a,a as b,o as c,i as d,u as e};//# sourceMappingURL=chunk-3GYPYD7Z.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-3GYPYD7Z.js.map
|