@polymarket/client 0.2.0 → 0.3.0-beta.1
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 +4 -4
- 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-KZISI26J.js +2 -0
- package/dist/{chunk-3GYPYD7Z.js.map → chunk-KZISI26J.js.map} +1 -1
- package/dist/chunk-NJ2FDU52.js +3 -0
- package/dist/chunk-NJ2FDU52.js.map +1 -0
- package/dist/ethers-v5.d.ts +1 -1
- package/dist/ethers-v5.js +1 -1
- package/dist/index.d.ts +5 -5
- 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-CYYRGlQj.d.ts → sports-BrD6Dal5.d.ts} +1 -1
- package/dist/{types-vvy5wT5V.d.ts → types-BXOHrumK.d.ts} +160 -13
- package/dist/viem.d.ts +1 -1
- package/dist/viem.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-3GYPYD7Z.js +0 -2
- package/dist/chunk-FA3ZDOJN.js +0 -2
- package/dist/chunk-FA3ZDOJN.js.map +0 -1
- package/dist/chunk-TYJAXA3Y.js +0 -6
- package/dist/chunk-TYJAXA3Y.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 { 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-BXOHrumK.js';
|
|
3
3
|
import { SportsMarketTypesResponse, SportsMetadata } from '@polymarket/bindings/gamma';
|
|
4
4
|
|
|
5
5
|
type PrepareMarketOrderError = InsufficientLiquidityError | RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError | UserInputError;
|
|
@@ -10,8 +10,8 @@ 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, 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';
|
|
14
|
-
import { PerpsSessionEvent, CommentsEvent, CryptoPricesTopic, EquityPricesTopic, EquityPricesEvent, MarketEvent, StandardMarketEvent, UserEvent, SportsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, PerpsTradeEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsTickerEvent, PerpsStatisticEvent, CryptoPricesEvent, PerpsMarketDataEvent } from '@polymarket/bindings/subscriptions';
|
|
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';
|
|
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
|
|
|
17
17
|
type ResponseValidationContext = {
|
|
@@ -89,6 +89,11 @@ declare class ConnectionLostError extends PolymarketError {
|
|
|
89
89
|
}
|
|
90
90
|
type RequestRejectedErrorOptions = {
|
|
91
91
|
status: number;
|
|
92
|
+
/**
|
|
93
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
94
|
+
* provided one.
|
|
95
|
+
*/
|
|
96
|
+
retryAfter?: number;
|
|
92
97
|
};
|
|
93
98
|
/**
|
|
94
99
|
* Error thrown when a service responds with a non-success status other than
|
|
@@ -97,14 +102,32 @@ type RequestRejectedErrorOptions = {
|
|
|
97
102
|
declare class RequestRejectedError extends PolymarketError {
|
|
98
103
|
name: "RequestRejectedError";
|
|
99
104
|
readonly status: number;
|
|
105
|
+
/**
|
|
106
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
107
|
+
* provided one.
|
|
108
|
+
*/
|
|
109
|
+
readonly retryAfter?: number;
|
|
100
110
|
constructor(message: string, options: ErrorOptions & RequestRejectedErrorOptions);
|
|
101
111
|
}
|
|
112
|
+
type RateLimitErrorOptions = {
|
|
113
|
+
/**
|
|
114
|
+
* Server-requested delay in seconds before retrying, when the response
|
|
115
|
+
* provided one.
|
|
116
|
+
*/
|
|
117
|
+
retryAfter?: number;
|
|
118
|
+
};
|
|
102
119
|
/**
|
|
103
120
|
* Error thrown when the service rejects a request because the rate limit has
|
|
104
121
|
* been exceeded.
|
|
105
122
|
*/
|
|
106
123
|
declare class RateLimitError extends PolymarketError {
|
|
107
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);
|
|
108
131
|
}
|
|
109
132
|
/**
|
|
110
133
|
* Error thrown when an async wait operation exceeds its allotted polling time.
|
|
@@ -324,6 +347,7 @@ type Page<T> = {
|
|
|
324
347
|
*/
|
|
325
348
|
hasMore: boolean;
|
|
326
349
|
nextCursor?: PaginationCursor;
|
|
350
|
+
/** Total number of matching items across all pages. Only present when the service reports one. */
|
|
327
351
|
totalCount?: number;
|
|
328
352
|
};
|
|
329
353
|
type Paginated<T> = AsyncIterable<Page<T>> & {
|
|
@@ -2853,7 +2877,8 @@ type PublicSubscriptionsActions = {
|
|
|
2853
2877
|
* Starts one or more realtime subscriptions on this client.
|
|
2854
2878
|
*
|
|
2855
2879
|
* @throws {@link SubscribeError}
|
|
2856
|
-
* Thrown when
|
|
2880
|
+
* Thrown when a TWAP subscription requests an unsupported window or the
|
|
2881
|
+
* realtime connection fails.
|
|
2857
2882
|
*
|
|
2858
2883
|
* @example
|
|
2859
2884
|
* ```ts
|
|
@@ -2873,7 +2898,8 @@ type SecureSubscriptionsActions = {
|
|
|
2873
2898
|
* Starts one or more realtime subscriptions on this client.
|
|
2874
2899
|
*
|
|
2875
2900
|
* @throws {@link SubscribeError}
|
|
2876
|
-
* Thrown when
|
|
2901
|
+
* Thrown when a TWAP subscription requests an unsupported window or the
|
|
2902
|
+
* realtime connection fails.
|
|
2877
2903
|
*
|
|
2878
2904
|
* @example
|
|
2879
2905
|
* ```ts
|
|
@@ -6284,11 +6310,10 @@ type ListPerpsFillsRequest = {
|
|
|
6284
6310
|
start?: number;
|
|
6285
6311
|
/** Inclusive end timestamp in milliseconds. */
|
|
6286
6312
|
end?: number;
|
|
6313
|
+
/** Time sort direction. Defaults to newest fills first. */
|
|
6314
|
+
sort?: PerpsSortDirection;
|
|
6287
6315
|
/** Opaque cursor returned by a previous page. */
|
|
6288
6316
|
cursor?: PaginationCursor;
|
|
6289
|
-
} | {
|
|
6290
|
-
/** Opaque cursor returned by a previous page. */
|
|
6291
|
-
cursor: PaginationCursor;
|
|
6292
6317
|
};
|
|
6293
6318
|
/**
|
|
6294
6319
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
@@ -6374,6 +6399,44 @@ type ListPerpsPnlHistoryRequest = {
|
|
|
6374
6399
|
/** Opaque cursor returned by a previous page. */
|
|
6375
6400
|
cursor: PaginationCursor;
|
|
6376
6401
|
};
|
|
6402
|
+
/**
|
|
6403
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6404
|
+
*/
|
|
6405
|
+
type ListPerpsNotificationsRequest = {
|
|
6406
|
+
/**
|
|
6407
|
+
* Inclusive sequence lower bound used to backfill notifications missed
|
|
6408
|
+
* while disconnected. Use the `sequence` of the last notification event
|
|
6409
|
+
* processed before the gap. Follow-up pages keep the same bound
|
|
6410
|
+
* automatically. Merged results should be deduplicated by notification
|
|
6411
|
+
* id.
|
|
6412
|
+
*/
|
|
6413
|
+
sinceSeq?: number;
|
|
6414
|
+
/** Maximum number of notifications per page. */
|
|
6415
|
+
limit?: number;
|
|
6416
|
+
/** Opaque cursor returned by a previous page. */
|
|
6417
|
+
cursor?: PaginationCursor;
|
|
6418
|
+
} | {
|
|
6419
|
+
/** Opaque cursor returned by a previous page. */
|
|
6420
|
+
cursor: PaginationCursor;
|
|
6421
|
+
};
|
|
6422
|
+
/**
|
|
6423
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6424
|
+
*/
|
|
6425
|
+
type MarkPerpsNotificationsReadRequest = {
|
|
6426
|
+
/** Notification ids to mark read. */
|
|
6427
|
+
ids: string[];
|
|
6428
|
+
} | {
|
|
6429
|
+
/**
|
|
6430
|
+
* Mark every notification at or before this notification read,
|
|
6431
|
+
* inclusive.
|
|
6432
|
+
*/
|
|
6433
|
+
upTo: {
|
|
6434
|
+
/** Notification id. */
|
|
6435
|
+
id: string;
|
|
6436
|
+
/** Notification timestamp in milliseconds. */
|
|
6437
|
+
timestamp: number;
|
|
6438
|
+
};
|
|
6439
|
+
};
|
|
6377
6440
|
|
|
6378
6441
|
/**
|
|
6379
6442
|
* Good-til-cancelled Perps order.
|
|
@@ -6916,7 +6979,11 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
|
|
|
6916
6979
|
*/
|
|
6917
6980
|
fetchOrders(request?: FetchPerpsOrdersRequest): Promise<PerpsOrder[]>;
|
|
6918
6981
|
/**
|
|
6919
|
-
* Lists Perps fills
|
|
6982
|
+
* Lists Perps fills
|
|
6983
|
+
*
|
|
6984
|
+
* @remarks
|
|
6985
|
+
* Fills are returned newest first by default; set `sort` to change the
|
|
6986
|
+
* time direction. Page cursors are opaque values forwarded to the API.
|
|
6920
6987
|
*
|
|
6921
6988
|
* @throws {@link PerpsSessionAccountError}
|
|
6922
6989
|
* Thrown on failure.
|
|
@@ -6969,6 +7036,69 @@ declare class PerpsSession implements AsyncIterable<PerpsSessionEvent> {
|
|
|
6969
7036
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
6970
7037
|
*/
|
|
6971
7038
|
listPnlHistory(request: ListPerpsPnlHistoryRequest): Paginated<PerpsPnlPoint[]>;
|
|
7039
|
+
/**
|
|
7040
|
+
* Lists Perps notifications, newest first, with SDK-owned pagination.
|
|
7041
|
+
*
|
|
7042
|
+
* @remarks
|
|
7043
|
+
* After a `resync` session event, pass `sinceSeq` to backfill missed
|
|
7044
|
+
* notifications: anchor it at the `sequence` of the last notification event
|
|
7045
|
+
* processed before the gap and deduplicate merged results by notification
|
|
7046
|
+
* id. Follow-up pages keep the same `sinceSeq` bound automatically.
|
|
7047
|
+
*
|
|
7048
|
+
* Notifications with types unknown to this SDK version are omitted from
|
|
7049
|
+
* page items, so newly introduced notification kinds never fail the read.
|
|
7050
|
+
*
|
|
7051
|
+
* @example
|
|
7052
|
+
* ```ts
|
|
7053
|
+
* const page = await session.listNotifications().firstPage();
|
|
7054
|
+
* console.log(page.items.length);
|
|
7055
|
+
* ```
|
|
7056
|
+
*
|
|
7057
|
+
* @throws {@link PerpsSessionAccountError}
|
|
7058
|
+
* Thrown on failure.
|
|
7059
|
+
*
|
|
7060
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7061
|
+
*/
|
|
7062
|
+
listNotifications(request?: ListPerpsNotificationsRequest): Paginated<PerpsNotificationEntry[]>;
|
|
7063
|
+
/**
|
|
7064
|
+
* Fetches the account's count of unread Perps notifications.
|
|
7065
|
+
*
|
|
7066
|
+
* @example
|
|
7067
|
+
* ```ts
|
|
7068
|
+
* const unread = await session.fetchUnreadNotificationsCount();
|
|
7069
|
+
* ```
|
|
7070
|
+
*
|
|
7071
|
+
* @throws {@link PerpsSessionAccountError}
|
|
7072
|
+
* Thrown on failure.
|
|
7073
|
+
*
|
|
7074
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7075
|
+
*/
|
|
7076
|
+
fetchUnreadNotificationsCount(): Promise<number>;
|
|
7077
|
+
/**
|
|
7078
|
+
* Marks Perps notifications read, either by id or up to a notification.
|
|
7079
|
+
*
|
|
7080
|
+
* @remarks
|
|
7081
|
+
* Read state is account-scoped: only the authenticated account's
|
|
7082
|
+
* notifications can be marked read.
|
|
7083
|
+
*
|
|
7084
|
+
* @example
|
|
7085
|
+
* ```ts
|
|
7086
|
+
* await session.markNotificationsRead({ ids: [notification.id] });
|
|
7087
|
+
* ```
|
|
7088
|
+
*
|
|
7089
|
+
* @example
|
|
7090
|
+
* ```ts
|
|
7091
|
+
* await session.markNotificationsRead({
|
|
7092
|
+
* upTo: { id: entry.notification.id, timestamp: entry.timestamp },
|
|
7093
|
+
* });
|
|
7094
|
+
* ```
|
|
7095
|
+
*
|
|
7096
|
+
* @throws {@link PerpsSessionAccountError}
|
|
7097
|
+
* Thrown on failure.
|
|
7098
|
+
*
|
|
7099
|
+
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
7100
|
+
*/
|
|
7101
|
+
markNotificationsRead(request: MarkPerpsNotificationsReadRequest): Promise<void>;
|
|
6972
7102
|
/**
|
|
6973
7103
|
* Places one Perps order and resolves with the first matching orders update.
|
|
6974
7104
|
*
|
|
@@ -8137,6 +8267,13 @@ type CryptoPricesSubscription = {
|
|
|
8137
8267
|
topic: CryptoPricesTopic;
|
|
8138
8268
|
symbols?: readonly string[];
|
|
8139
8269
|
};
|
|
8270
|
+
type CryptoPricesChainlinkTwapSubscription = {
|
|
8271
|
+
topic: CryptoPricesChainlinkTwapTopic;
|
|
8272
|
+
/** Averaging window used to calculate each TWAP price. */
|
|
8273
|
+
windowSeconds: CryptoPricesChainlinkTwapWindowSeconds;
|
|
8274
|
+
/** Lowercase slash-delimited symbols, such as `btc/usd`. */
|
|
8275
|
+
symbols?: readonly string[];
|
|
8276
|
+
};
|
|
8140
8277
|
type EquityPricesSubscription = {
|
|
8141
8278
|
topic: EquityPricesTopic;
|
|
8142
8279
|
symbol: string;
|
|
@@ -8189,7 +8326,7 @@ type PerpsStatisticsSubscription = {
|
|
|
8189
8326
|
* @experimental This API may change in a breaking way in any release, including patch releases.
|
|
8190
8327
|
*/
|
|
8191
8328
|
type PerpsMarketDataSubscription = PerpsTradesSubscription | PerpsBboSubscription | PerpsBookSubscription | PerpsCandlesSubscription | PerpsTickersSubscription | PerpsStatisticsSubscription;
|
|
8192
|
-
type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | EquityPricesSubscription | PerpsMarketDataSubscription;
|
|
8329
|
+
type PublicSubscriptionSpec = MarketSubscription | SportsSubscription | CommentsSubscription | CryptoPricesSubscription | CryptoPricesChainlinkTwapSubscription | EquityPricesSubscription | PerpsMarketDataSubscription;
|
|
8193
8330
|
type SecureSubscriptionSpec = PublicSubscriptionSpec | UserSubscription;
|
|
8194
8331
|
type PublicRealtimeEvent = MarketEvent | SportsEvent | CommentsEvent | CryptoPricesEvent | EquityPricesEvent | PerpsMarketDataEvent;
|
|
8195
8332
|
type SecureRealtimeEvent = PublicRealtimeEvent | UserEvent;
|
|
@@ -8201,6 +8338,7 @@ type EventByTopic = {
|
|
|
8201
8338
|
comments: CommentsEvent;
|
|
8202
8339
|
'prices.crypto.binance': CryptoPricesBinanceEvent;
|
|
8203
8340
|
'prices.crypto.chainlink': CryptoPricesChainlinkEvent;
|
|
8341
|
+
'prices.crypto.chainlink.twap': CryptoPricesChainlinkTwapEvent;
|
|
8204
8342
|
'prices.equity.pyth': EquityPricesEvent;
|
|
8205
8343
|
'perps.trades': PerpsTradeEvent;
|
|
8206
8344
|
'perps.bbo': PerpsBboEvent;
|
|
@@ -8210,7 +8348,12 @@ type EventByTopic = {
|
|
|
8210
8348
|
'perps.statistics': PerpsStatisticEvent;
|
|
8211
8349
|
};
|
|
8212
8350
|
type EventForMarketSubscription<TSpec extends MarketSubscription> = 'customFeatureEnabled' extends keyof TSpec ? true extends TSpec['customFeatureEnabled'] ? MarketEvent : StandardMarketEvent : StandardMarketEvent;
|
|
8213
|
-
type
|
|
8351
|
+
type EventForCryptoPricesChainlinkTwapSubscription<TSpec extends CryptoPricesChainlinkTwapSubscription> = TSpec extends {
|
|
8352
|
+
windowSeconds: 30;
|
|
8353
|
+
} ? CryptoPricesChainlinkTwapThirtyEvent : TSpec extends {
|
|
8354
|
+
windowSeconds: 60;
|
|
8355
|
+
} ? CryptoPricesChainlinkTwapSixtyEvent : CryptoPricesChainlinkTwapEvent;
|
|
8356
|
+
type EventForSubscriptionSpec<TSpec extends SecureSubscriptionSpec> = TSpec extends MarketSubscription ? EventForMarketSubscription<TSpec> : TSpec extends CryptoPricesChainlinkTwapSubscription ? EventForCryptoPricesChainlinkTwapSubscription<TSpec> : TSpec extends {
|
|
8214
8357
|
topic: infer TTopic extends keyof EventByTopic;
|
|
8215
8358
|
} ? EventByTopic[TTopic] : never;
|
|
8216
8359
|
type EventForSubscriptionSpecs<TSubscriptions extends readonly SecureSubscriptionSpec[]> = EventForSubscriptionSpec<TSubscriptions[number]>;
|
|
@@ -8222,7 +8365,10 @@ type SubscriptionHandle<TEvent> = {
|
|
|
8222
8365
|
*/
|
|
8223
8366
|
close(): Promise<void>;
|
|
8224
8367
|
} & AsyncIterable<TEvent>;
|
|
8225
|
-
type SubscribeError = TransportError;
|
|
8368
|
+
type SubscribeError = TransportError | UserInputError;
|
|
8369
|
+
declare const SubscribeError: {
|
|
8370
|
+
isError(error: unknown): error is TransportError | UserInputError;
|
|
8371
|
+
};
|
|
8226
8372
|
/**
|
|
8227
8373
|
* Starts one or more realtime subscriptions on this client.
|
|
8228
8374
|
*
|
|
@@ -8230,7 +8376,8 @@ type SubscribeError = TransportError;
|
|
|
8230
8376
|
* This is a low-level function. Most SDK consumers should prefer the client instance API.
|
|
8231
8377
|
*
|
|
8232
8378
|
* @throws {@link SubscribeError}
|
|
8233
|
-
* Thrown when
|
|
8379
|
+
* Thrown when a TWAP subscription requests an unsupported window or the
|
|
8380
|
+
* realtime connection fails.
|
|
8234
8381
|
*
|
|
8235
8382
|
* @example
|
|
8236
8383
|
* ```ts
|
|
@@ -8590,4 +8737,4 @@ type Signer = {
|
|
|
8590
8737
|
sendTransaction(request: SignerTransactionRequest): Promise<TransactionHandle>;
|
|
8591
8738
|
};
|
|
8592
8739
|
|
|
8593
|
-
export { FetchMidpointError as $, type ApiKeyAuthorization as A, type BaseClient as B, CancelAllError as C, type DataActions as D, DepositToPerpsError as E, type DepositToPerpsRequest as F, type DiscoveryActions as G, DownloadAccountingSnapshotError as H, DropNotificationsError as I, type EnvironmentConfig as J, type EnvironmentConfigFork as K, type EnvironmentContracts as L, EstimateMarketPriceError as M, ExecuteCollateralReturnPlanError as N, type ExecuteCollateralReturnPlanRequest as O, FetchClosedOnlyModeError as P, FetchCommentsByIdError as Q, FetchEventError as R, type Signer as S, type TypedDataPayload as T, UserInputError as U, FetchEventLiveVolumeError as V, FetchEventTagsError as W, FetchLastTradePriceError as X, FetchLastTradePricesError as Y, FetchMarketError as Z, FetchMarketTagsError as _, type TypedData as a, type ListPerpsTradesRequest as a$, FetchMidpointsError as a0, FetchNotificationsError as a1, FetchOrderBookError as a2, FetchOrderBooksError as a3, FetchOrderError as a4, FetchOrderScoringError as a5, FetchOrdersScoringError as a6, type FetchPerpsAccountConfigRequest as a7, FetchPerpsBookError as a8, type FetchPerpsBookRequest as a9, ListBuilderLeaderboardError as aA, ListBuilderTradesError as aB, ListBuilderVolumeError as aC, ListClosedPositionsError as aD, ListComboActivityError as aE, ListComboMarketsError as aF, ListComboPositionsError as aG, ListCommentsByUserAddressError as aH, ListCommentsError as aI, ListCurrentRewardsError as aJ, ListEventsError as aK, ListMarketHoldersError as aL, ListMarketPositionsError as aM, ListMarketRewardsError as aN, ListMarketsError as aO, ListOpenInterestError as aP, ListOpenOrdersError as aQ, ListPerpsCandlesError as aR, type ListPerpsCandlesRequest as aS, type ListPerpsDepositsRequest as aT, type ListPerpsEquityHistoryRequest as aU, type ListPerpsFillsRequest as aV, ListPerpsFundingHistoryError as aW, type ListPerpsFundingHistoryRequest as aX, type ListPerpsFundingPaymentsRequest as aY, type ListPerpsPnlHistoryRequest as aZ, ListPerpsTradesError as a_, FetchPerpsFeesError as aa, FetchPerpsInstrumentsError as ab, type FetchPerpsInstrumentsRequest as ac, type FetchPerpsOpenOrdersRequest as ad, type FetchPerpsOrdersRequest as ae, FetchPerpsTickerError as af, type FetchPerpsTickerRequest as ag, FetchPerpsTickersError as ah, type FetchPerpsTickersRequest as ai, FetchPortfolioValueError as aj, FetchPriceError as ak, FetchPriceHistoryError as al, FetchPricesError as am, FetchPublicProfileError as an, FetchRelatedTagResourcesError as ao, FetchRelatedTagsError as ap, FetchRewardPercentagesError as aq, FetchSeriesError as ar, FetchSpreadError as as, FetchSpreadsError as at, FetchTagError as au, FetchTotalEarningsForUserForDayError as av, FetchTradedMarketCountError as aw, InsufficientLiquidityError as ax, ListAccountTradesError as ay, ListActivityError as az, type TransactionCall as b, type RfqConfirmationRequestEvent as b$, type ListPerpsWithdrawalsRequest as b0, ListPositionsError as b1, ListSeriesError as b2, ListTagsError as b3, ListTeamsError as b4, ListTraderLeaderboardError as b5, ListTradesError as b6, ListUserEarningsAndMarketsConfigError as b7, ListUserEarningsForDayError as b8, MergePositionsError as b9, type PlacePerpsPositionTpSlResult as bA, PlanCollateralReturnError as bB, PostOrderError as bC, PostOrdersError as bD, type PostPerpsOrdersRequest as bE, type PublicAccountActions as bF, type PublicActions as bG, type PublicClient as bH, type PublicClientOptions as bI, type PublicPerpsActions as bJ, type PublicRewardsActions as bK, type PublicSubscriptionsActions as bL, RateLimitError as bM, RedeemPositionsError as bN, RequestRejectedError as bO, type RequestRejectedErrorOptions as bP, type RestEndpoint as bQ, type ResumePerpsSessionRequest as bR, RevokePerpsCredentialsError as bS, type RevokePerpsCredentialsRequest as bT, type RfqCancelQuoteAck as bU, RfqCancelQuoteError as bV, RfqCancelQuoteRejectedError as bW, type RfqCancelQuoteRejectedErrorOptions as bX, type RfqConfirmationAck as bY, RfqConfirmationError as bZ, RfqConfirmationRejectedError as b_, OpenPerpsSessionError as ba, type OpenPerpsSessionRequest as bb, OpenRfqSessionError as bc, type Page as bd, PageSizeSchema as be, type Paginated as bf, type PerpsActions as bg, type PerpsBookDepth as bh, type PerpsEndpoints as bi, type PerpsOrderRequest as bj, type PerpsPlaceFokOrderRequest as bk, type PerpsPlaceGtcOrderRequest as bl, type PerpsPlaceIocOrderRequest as bm, type PerpsPlacedTpSlOrder as bn, type PerpsPlacedTpSlOrders as bo, type PerpsPositionTpSlTrigger as bp, PerpsSession as bq, type PerpsSessionAccountError as br, type PerpsSessionLifecycleError as bs, type PerpsSessionTradingError as bt, type PerpsTpSlTrigger as bu, type PlacePerpsOrderRequest as bv, type PlacePerpsOrderResult as bw, type PlacePerpsOrderWithTpSlRequest as bx, type PlacePerpsOrderWithTpSlResult as by, type PlacePerpsPositionTpSlRequest as bz, type AccountIdentity as c, perpsActions as c$, type RfqEvent as c0, RfqQuoteError as c1, type RfqQuoteReference as c2, RfqQuoteRejectedError as c3, type RfqQuoteRejectedErrorOptions as c4, type RfqQuoteRequestEvent as c5, type RfqQuoteResponse as c6, type RfqQuoteSource as c7, type RfqSession as c8, type RfqTradeEvent as c9, TransactionFailedError as cA, type TransactionHandle as cB, type TransactionOutcome as cC, TransferErc20Error as cD, TransportError as cE, type TypedDataDomain as cF, type TypedDataField as cG, UnexpectedResponseError as cH, UpdatePerpsLeverageError as cI, type UpdatePerpsLeverageRequest as cJ, WaitForOrderFillSettlementError as cK, WaitForTransactionError as cL, type WalletDerivationConfig as cM, type WebSocketCloseCode as cN, type WebSocketEndpoint as cO, WebSocketKnownCloseCode as cP, WithdrawFromPerpsError as cQ, type WithdrawFromPerpsRequest as cR, accountActions as cS, allActions as cT, analyticsActions as cU, createPublicClient as cV, createSecureClient as cW, dataActions as cX, discoveryActions as cY, forkEnvironmentConfig as cZ, makeErrorGuard as c_, SearchError as ca, SearchSort as cb, type SecureAccountActions as cc, type SecureActions as cd, type SecureClient as ce, type SecureClientOptions as cf, type SecureDownloadAccountingSnapshotRequest as cg, type SecureFetchPortfolioValueRequest as ch, type SecureFetchTradedMarketCountRequest as ci, type SecureListActivityRequest as cj, type SecureListClosedPositionsRequest as ck, type SecureListComboActivityRequest as cl, type SecureListComboPositionsRequest as cm, type SecureListPositionsRequest as cn, type SecurePerpsActions as co, type SecureRewardsActions as cp, type SecureRfqActions as cq, type SecureSubscriptionsActions as cr, type SecureTradingActions as cs, type SecureWalletActions as ct, SetupGaslessWalletError as cu, SetupTradingApprovalsError as cv, type SignerTransactionRequest as cw, SigningError as cx, SplitPositionError as cy, TimeoutError as cz, type AnalyticsActions as d, type FetchRelatedTagsRequest as d$, production as d0, rewardsActions as d1, rfqActions as d2, subscriptionsActions as d3, tradingActions as d4, walletActions as d5, type CancelMarketOrdersRequest as d6, type CancelOrderRequest as d7, type CancelOrdersRequest as d8, type CollateralReturnExecutionWorkflow as d9, type FetchEventLiveVolumeRequest as dA, type FetchEventRequest as dB, type FetchEventTagsRequest as dC, FetchExecuteParamsError as dD, type FetchExecuteParamsRequest as dE, type FetchGaslessTransactionRequest as dF, type FetchLastTradePriceRequest as dG, type FetchLastTradePricesRequest as dH, FetchMarketInfoError as dI, type FetchMarketInfoRequest as dJ, type FetchMarketRequest as dK, type FetchMarketTagsRequest as dL, type FetchMidpointRequest as dM, type FetchMidpointsRequest as dN, FetchNegRiskError as dO, type FetchNegRiskRequest as dP, type FetchOrderBookRequest as dQ, type FetchOrderBooksRequest as dR, type FetchOrderRequest as dS, type FetchOrderScoringRequest as dT, type FetchOrdersScoringRequest as dU, type FetchPortfolioValueRequest as dV, type FetchPriceHistoryRequest as dW, type FetchPriceRequest as dX, type FetchPricesRequest as dY, type FetchPublicProfileRequest as dZ, type FetchRelatedTagResourcesRequest as d_, type CommentsEventType as da, type CommentsSubscription as db, type CryptoPricesEventType as dc, type CryptoPricesSubscription as dd, DeployDepositWalletError as de, type DownloadAccountingSnapshotRequest as df, type DropNotificationsRequest as dg, type EquityPricesEventType as dh, type EquityPricesSubscription as di, type Erc1155ApprovalForAllWorkflow as dj, type Erc1155ApprovalForAllWorkflowRequest as dk, type Erc20ApprovalWorkflow as dl, type Erc20ApprovalWorkflowRequest as dm, type Erc20TransferWorkflow as dn, type Erc20TransferWorkflowRequest as dp, type EstimateMarketBuyPriceRequest as dq, type EstimateMarketPriceRequest as dr, type EstimateMarketSellPriceRequest as ds, type EventForSubscriptionSpec as dt, type EventForSubscriptionSpecs as du, FetchBalanceAllowanceError as dv, type FetchBalanceAllowanceRequest as dw, FetchBuilderFeeRatesError as dx, type FetchBuilderFeeRatesRequest as dy, type FetchCommentsByIdRequest as dz, ApproveErc1155ForAllError as e, type PostOrdersRequest as e$, type FetchSeriesRequest as e0, type FetchSpreadRequest as e1, type FetchSpreadsRequest as e2, type FetchTagRequest as e3, FetchTickSizeError as e4, type FetchTickSizeRequest as e5, type FetchTotalEarningsForUserForDayRequest as e6, type FetchTradedMarketCountRequest as e7, GaslessTransactionMetadataSchema as e8, type GaslessWorkflow as e9, type ListTagsRequest as eA, type ListTeamsRequest as eB, type ListTraderLeaderboardRequest as eC, type ListTradesRequest as eD, type ListUserEarningsAndMarketsConfigRequest as eE, type ListUserEarningsForDayRequest as eF, type MarketEventType as eG, type MarketSubscription as eH, MergeComboPositionError as eI, MergeMarketPositionError as eJ, type MergePositionsWorkflow as eK, type MergePositionsWorkflowRequest as eL, type OrderDraft as eM, type OrderPostingWorkflow as eN, type OrderWorkflow as eO, type OrderWorkflowRequest as eP, type PerpsBboSubscription as eQ, type PerpsBookSubscription as eR, type PerpsCandlesSubscription as eS, type PerpsDepositWorkflow as eT, type PerpsDepositWorkflowRequest as eU, type PerpsMarketDataEventType as eV, type PerpsMarketDataSubscription as eW, type PerpsStatisticsSubscription as eX, type PerpsStreamingCandleInterval as eY, type PerpsTickersSubscription as eZ, type PerpsTradesSubscription as e_, type GaslessWorkflowRequest as ea, IsWalletDeployedError as eb, type IsWalletDeployedRequest as ec, type ListAccountTradesRequest as ed, type ListActivityRequest as ee, type ListBuilderLeaderboardRequest as ef, type ListBuilderTradesRequest as eg, type ListBuilderVolumeRequest as eh, type ListClosedPositionsRequest as ei, type ListComboActivityRequest as ej, type ListComboMarketsRequest as ek, type ListComboPositionsRequest as el, type ListCommentsByUserAddressRequest as em, type ListCommentsRequest as en, type ListCurrentRewardsRequest as eo, type ListEventsRequest as ep, ListMarketClarificationsError as eq, type ListMarketClarificationsRequest as er, type ListMarketHoldersRequest as es, type ListMarketPositionsRequest as et, type ListMarketRewardsRequest as eu, type ListMarketsRequest as ev, type ListOpenInterestRequest as ew, type ListOpenOrdersRequest as ex, type ListPositionsRequest as ey, type ListSeriesRequest as ez, ApproveErc20Error as f, type UserSubscription as f$, PrepareCollateralReturnExecutionError as f0, PrepareErc1155ApprovalForAllError as f1, type PrepareErc1155ApprovalForAllRequest as f2, PrepareErc20ApprovalError as f3, type PrepareErc20ApprovalRequest as f4, PrepareErc20TransferError as f5, type PrepareErc20TransferRequest as f6, PrepareGaslessTransactionError as f7, type PrepareGaslessTransactionRequest as f8, type PrepareLimitOrderRequest as f9, type PublicRealtimeTopic as fA, type PublicSubscriptionSpec as fB, type RedeemPositionsWorkflow as fC, type RedeemPositionsWorkflowRequest as fD, ResolveConditionByTokenError as fE, type ResolveConditionByTokenRequest as fF, type RfqConfirmationRejectedErrorOptions as fG, type RfqExecutionUpdateEvent as fH, type SearchRequest as fI, type SearchResults as fJ, type SecureRealtimeEvent as fK, type SecureRealtimeTopic as fL, type SecureSubscriptionSpec as fM, type SignedOrder as fN, SplitComboPositionError as fO, SplitMarketPositionError as fP, type SplitPositionWorkflow as fQ, type SplitPositionWorkflowRequest as fR, type SportsEventType as fS, type SportsSubscription as fT, type SubscribeError as fU, type SubscriptionHandle as fV, type TradingApprovalsWorkflow as fW, type TradingApprovalsWorkflowRequest as fX, UpdateBalanceAllowanceError as fY, type UpdateBalanceAllowanceRequest as fZ, type UserEventType as f_, type PrepareMarketBuyOrderRequest as fa, type PrepareMarketOrderRequest as fb, type PrepareMarketSellOrderRequest as fc, PrepareMergeComboPositionError as fd, type PrepareMergeComboPositionRequest as fe, PrepareMergeMarketPositionError as ff, type PrepareMergeMarketPositionRequest as fg, PrepareMergePositionsError as fh, type PrepareMergePositionsRequest as fi, PreparePerpsDepositError as fj, PrepareRedeemComboPositionError as fk, type PrepareRedeemComboPositionRequest as fl, type PrepareRedeemMarketPositionsByConditionIdRequest as fm, type PrepareRedeemMarketPositionsByMarketIdRequest as fn, PrepareRedeemMarketPositionsError as fo, type PrepareRedeemMarketPositionsRequest as fp, PrepareRedeemPositionsError as fq, type PrepareRedeemPositionsRequest as fr, PrepareSplitComboPositionError as fs, type PrepareSplitComboPositionRequest as ft, PrepareSplitMarketPositionError as fu, type PrepareSplitMarketPositionRequest as fv, PrepareSplitPositionError as fw, type PrepareSplitPositionRequest as fx, PrepareTradingApprovalsError as fy, type PublicRealtimeEvent as fz, BasePublicClient as g, listClosedPositions as g$, WaitForGaslessTransactionError as g0, type WaitForOrderFillSettlementRequest as g1, approveErc1155ForAll as g2, approveErc20 as g3, cancelAll as g4, cancelMarketOrders as g5, cancelOrder as g6, cancelOrders as g7, deployDepositWallet as g8, depositToPerps as g9, fetchOrdersScoring as gA, fetchPerpsBook as gB, fetchPerpsFees as gC, fetchPerpsInstruments as gD, fetchPerpsTicker as gE, fetchPerpsTickers as gF, fetchPortfolioValue as gG, fetchPrice as gH, fetchPriceHistory as gI, fetchPrices as gJ, fetchPublicProfile as gK, fetchRelatedTagResources as gL, fetchRelatedTags as gM, fetchRewardPercentages as gN, fetchSeries as gO, fetchSpread as gP, fetchSpreads as gQ, fetchTag as gR, fetchTickSize as gS, fetchTotalEarningsForUserForDay as gT, fetchTradedMarketCount as gU, fetchTransaction as gV, isWalletDeployed as gW, listAccountTrades as gX, listActivity as gY, listBuilderLeaderboard as gZ, listBuilderTrades as g_, downloadAccountingSnapshot as ga, dropNotifications as gb, estimateMarketPrice as gc, executeCollateralReturnPlan as gd, fetchBalanceAllowance as ge, fetchBuilderFeeRates as gf, fetchBuilderVolume as gg, fetchClosedOnlyMode as gh, fetchCommentsById as gi, fetchEvent as gj, fetchEventLiveVolume as gk, fetchEventTags as gl, fetchExecuteParams as gm, fetchLastTradePrice as gn, fetchLastTradePrices as go, fetchMarket as gp, fetchMarketInfo as gq, fetchMarketTags as gr, fetchMidpoint as gs, fetchMidpoints as gt, fetchNegRisk as gu, fetchNotifications as gv, fetchOrder as gw, fetchOrderBook as gx, fetchOrderBooks as gy, fetchOrderScoring as gz, BaseSecureClient as h, listComboActivity as h0, listComboMarkets as h1, listComboPositions as h2, listComments as h3, listCommentsByUserAddress as h4, listCurrentRewards as h5, listEvents as h6, listMarketClarifications as h7, listMarketHolders as h8, listMarketPositions as h9, prepareErc20Transfer as hA, prepareGaslessTransaction as hB, prepareMergeComboPosition as hC, prepareMergeMarketPosition as hD, prepareMergePositions as hE, preparePerpsDeposit as hF, prepareRedeemComboPosition as hG, prepareRedeemMarketPositions as hH, prepareRedeemPositions as hI, prepareSplitComboPosition as hJ, prepareSplitMarketPosition as hK, prepareSplitPosition as hL, prepareTradingApprovals as hM, redeemPositions as hN, resolveConditionByToken as hO, revokePerpsCredentials as hP, search as hQ, setupTradingApprovals as hR, splitComboPosition as hS, splitMarketPosition as hT, splitPosition as hU, subscribe as hV, transferErc20 as hW, updateBalanceAllowance as hX, waitForOrderFillSettlement as hY, withdrawFromPerps as hZ, listMarketRewards as ha, listMarkets as hb, listOpenInterest as hc, listOpenOrders as hd, listPerpsCandles as he, listPerpsFundingHistory as hf, listPerpsTrades as hg, listPositions as hh, listSeries as hi, listTags as hj, listTeams as hk, listTraderLeaderboard as hl, listTrades as hm, listUserEarningsAndMarketsConfig as hn, listUserEarningsForDay as ho, mergeComboPosition as hp, mergeMarketPosition as hq, mergePositions as hr, openPerpsSession as hs, openRfqSession as ht, planCollateralReturn as hu, postOrder as hv, postOrders as hw, prepareCollateralReturnExecution as hx, prepareErc1155ApprovalForAll as hy, prepareErc20Approval 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 };
|
|
8740
|
+
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 };
|
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-
|
|
3
|
+
import { S as Signer } from './types-BXOHrumK.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-
|
|
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.1",
|
|
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.1",
|
|
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
|