@polymarket/client 0.1.0-beta.8 → 0.1.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/README.md +1 -1
- package/dist/actions/index.d.ts +14 -14
- package/dist/actions/index.js +1 -1
- package/dist/chunk-3GYPYD7Z.js +2 -0
- package/dist/chunk-3GYPYD7Z.js.map +1 -0
- package/dist/chunk-TYJAXA3Y.js +6 -0
- package/dist/chunk-TYJAXA3Y.js.map +1 -0
- package/dist/chunk-Z6CZB4WP.js +2 -0
- package/dist/chunk-Z6CZB4WP.js.map +1 -0
- package/dist/ethers-v5.d.ts +1 -1
- package/dist/ethers-v5.js +1 -1
- package/dist/index.d.ts +15 -7
- 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-_kLx9-gD.d.ts → sports-Dm3yiYAe.d.ts} +13 -13
- package/dist/{types-5uGoLhNm.d.ts → types-CgIv7KE4.d.ts} +1782 -782
- package/dist/viem.d.ts +1 -1
- package/dist/viem.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-E2CLUN5M.js +0 -6
- package/dist/chunk-E2CLUN5M.js.map +0 -1
- package/dist/chunk-GZWA532J.js +0 -2
- package/dist/chunk-GZWA532J.js.map +0 -1
- package/dist/chunk-NTEPEJZK.js +0 -2
- package/dist/chunk-NTEPEJZK.js.map +0 -1
package/README.md
CHANGED
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { e as ApproveErc1155ForAllError, f as ApproveErc20Error, C as CancelAllError, j as CancelMarketOrdersError, c0 as CancelMarketOrdersRequest, k as CancelOrderError, c1 as CancelOrderRequest, l as CancelOrdersError, c2 as CancelOrdersRequest, c3 as CancelPerpsOrderRequest, c4 as CancelPerpsOrdersRequest, c5 as CommentsEventType, c6 as CommentsSubscription, c7 as CreatePerpsSessionRequest, c8 as CryptoPricesEventType, c9 as CryptoPricesSubscription, ca as DeployDepositWalletError, cb as DepositToPerpsError, cc as DepositToPerpsRequest, cd as DeprecatedTransactionHandle, t as DownloadAccountingSnapshotError, ce as DownloadAccountingSnapshotRequest, u as DropNotificationsError, cf as DropNotificationsRequest, cg as EquityPricesEventType, ch as EquityPricesSubscription, ci as Erc1155ApprovalForAllWorkflow, cj as Erc1155ApprovalForAllWorkflowRequest, ck as Erc20ApprovalWorkflow, cl as Erc20ApprovalWorkflowRequest, cm as Erc20TransferWorkflow, cn as Erc20TransferWorkflowRequest, co as EstimateMarketBuyPriceRequest, x as EstimateMarketPriceError, cp as EstimateMarketPriceRequest, cq as EstimateMarketSellPriceRequest, cr as EventForSubscriptionSpec, cs as EventForSubscriptionSpecs, ct as FetchBalanceAllowanceError, cu as FetchBalanceAllowanceRequest, cv as FetchBuilderFeeRatesError, cw as FetchBuilderFeeRatesRequest, F as FetchClosedOnlyModeError, y as FetchCommentsByIdError, cx as FetchCommentsByIdRequest, z as FetchEventError, G as FetchEventLiveVolumeError, cy as FetchEventLiveVolumeRequest, cz as FetchEventRequest, H as FetchEventTagsError, cA as FetchEventTagsRequest, cB as FetchExecuteParamsError, cC as FetchExecuteParamsRequest, cD as FetchGaslessTransactionRequest, I as FetchLastTradePriceError, cE as FetchLastTradePriceRequest, J as FetchLastTradePricesError, cF as FetchLastTradePricesRequest, K as FetchMarketError, cG as FetchMarketInfoError, cH as FetchMarketInfoRequest, cI as FetchMarketRequest, L as FetchMarketTagsError, cJ as FetchMarketTagsRequest, M as FetchMidpointError, cK as FetchMidpointRequest, N as FetchMidpointsError, cL as FetchMidpointsRequest, cM as FetchNegRiskError, cN as FetchNegRiskRequest, O as FetchNotificationsError, P as FetchOrderBookError, cO as FetchOrderBookRequest, Q as FetchOrderBooksError, cP as FetchOrderBooksRequest, R as FetchOrderError, cQ as FetchOrderRequest, V as FetchOrderScoringError, cR as FetchOrderScoringRequest, W as FetchOrdersScoringError, cS as FetchOrdersScoringRequest, cT as FetchPerpsAccountConfigRequest, cU as FetchPerpsBookError, cV as FetchPerpsBookRequest, cW as FetchPerpsFeesError, cX as FetchPerpsInstrumentsError, cY as FetchPerpsInstrumentsRequest, cZ as FetchPerpsOpenOrdersRequest, c_ as FetchPerpsOrdersRequest, c$ as FetchPerpsTickerError, d0 as FetchPerpsTickerRequest, d1 as FetchPerpsTickersError, d2 as FetchPerpsTickersRequest, X as FetchPortfolioValueError, d3 as FetchPortfolioValueRequest, Y as FetchPriceError, Z as FetchPriceHistoryError, d4 as FetchPriceHistoryRequest, d5 as FetchPriceRequest, _ as FetchPricesError, d6 as FetchPricesRequest, $ as FetchPublicProfileError, d7 as FetchPublicProfileRequest, a0 as FetchRelatedTagResourcesError, d8 as FetchRelatedTagResourcesRequest, a1 as FetchRelatedTagsError, d9 as FetchRelatedTagsRequest, a2 as FetchRewardPercentagesError, a3 as FetchSeriesError, da as FetchSeriesRequest, a4 as FetchSpreadError, db as FetchSpreadRequest, a5 as FetchSpreadsError, dc as FetchSpreadsRequest, a6 as FetchTagError, dd as FetchTagRequest, de as FetchTickSizeError, df as FetchTickSizeRequest, a7 as FetchTotalEarningsForUserForDayError, dg as FetchTotalEarningsForUserForDayRequest, a8 as FetchTradedMarketCountError, dh as FetchTradedMarketCountRequest, di as GaslessTransactionMetadataSchema, dj as GaslessWorkflow, dk as GaslessWorkflowRequest, dl as IsWalletDeployedError, dm as IsWalletDeployedRequest, aa as ListAccountTradesError, dn as ListAccountTradesRequest, ab as ListActivityError, dp as ListActivityRequest, ac as ListBuilderLeaderboardError, dq as ListBuilderLeaderboardRequest, ad as ListBuilderTradesError, dr as ListBuilderTradesRequest, ae as ListBuilderVolumeError, ds as ListBuilderVolumeRequest, af as ListClosedPositionsError, dt as ListClosedPositionsRequest, ag as ListComboMarketsError, du as ListComboMarketsRequest, ah as ListComboPositionsError, dv as ListComboPositionsRequest, ai as ListCommentsByUserAddressError, dw as ListCommentsByUserAddressRequest, aj as ListCommentsError, dx as ListCommentsRequest, ak as ListCurrentRewardsError, dy as ListCurrentRewardsRequest, al as ListEventsError, dz as ListEventsRequest, am as ListMarketHoldersError, dA as ListMarketHoldersRequest, an as ListMarketPositionsError, dB as ListMarketPositionsRequest, ao as ListMarketRewardsError, dC as ListMarketRewardsRequest, ap as ListMarketsError, dD as ListMarketsRequest, aq as ListOpenInterestError, dE as ListOpenInterestRequest, ar as ListOpenOrdersError, dF as ListOpenOrdersRequest, dG as ListPerpsCandlesError, dH as ListPerpsCandlesRequest, dI as ListPerpsDepositsRequest, dJ as ListPerpsEquityHistoryRequest, dK as ListPerpsFillsRequest, dL as ListPerpsFundingHistoryError, dM as ListPerpsFundingHistoryRequest, dN as ListPerpsFundingPaymentsRequest, dO as ListPerpsPnlHistoryRequest, dP as ListPerpsTradesError, dQ as ListPerpsTradesRequest, dR as ListPerpsWithdrawalsRequest, as as ListPositionsError, dS as ListPositionsRequest, at as ListSeriesError, dT as ListSeriesRequest, au as ListTagsError, dU as ListTagsRequest, av as ListTeamsError, dV as ListTeamsRequest, aw as ListTraderLeaderboardError, dW as ListTraderLeaderboardRequest, ax as ListTradesError, dX as ListTradesRequest, ay as ListUserEarningsAndMarketsConfigError, dY as ListUserEarningsAndMarketsConfigRequest, az as ListUserEarningsForDayError, dZ as ListUserEarningsForDayRequest, d_ as MarketEventType, d$ as MarketSubscription, e0 as MergeComboPositionError, e1 as MergeMarketPositionError, aA as MergePositionsError, e2 as MergePositionsWorkflow, e3 as MergePositionsWorkflowRequest, e4 as ModifyPerpsOrderRequest, e5 as ModifyPerpsOrdersRequest, e6 as OpenPerpsSessionError, e7 as OpenPerpsSessionRequest, aB as OpenRfqSessionError, e8 as OrderDraft, e9 as OrderPostingWorkflow, ea as OrderWorkflow, eb as OrderWorkflowRequest, ec as PerpsBboSubscription, ed as PerpsBookSubscription, ee as PerpsCandlesSubscription, ef as PerpsDepositWorkflow, eg as PerpsDepositWorkflowRequest, eh as PerpsMarketDataEventType, ei as PerpsMarketDataSubscription, aH as PerpsSession, ej as PerpsStatisticsSubscription, ek as PerpsStreamingCandleInterval, el as PerpsTickersSubscription, em as PerpsTradesSubscription, en as PlacePerpsOrderRequest, eo as PlacePerpsOrdersRequest, aI as PostOrderError, aJ as PostOrdersError, ep as PostOrdersRequest, eq as PrepareErc1155ApprovalForAllError, er as PrepareErc1155ApprovalForAllRequest, es as PrepareErc20ApprovalError, et as PrepareErc20ApprovalRequest, eu as PrepareErc20TransferError, ev as PrepareErc20TransferRequest, ew as PrepareGaslessTransactionError, ex as PrepareGaslessTransactionRequest, ey as PrepareLimitOrderRequest, ez as PrepareMarketBuyOrderRequest, eA as PrepareMarketOrderRequest, eB as PrepareMarketSellOrderRequest, eC as PrepareMergeComboPositionError, eD as PrepareMergeComboPositionRequest, eE as PrepareMergeMarketPositionError, eF as PrepareMergeMarketPositionRequest, eG as PrepareMergePositionsError, eH as PrepareMergePositionsRequest, eI as PreparePerpsDepositError, eJ as PrepareRedeemComboPositionError, eK as PrepareRedeemComboPositionRequest, eL as PrepareRedeemMarketPositionsByConditionIdRequest, eM as PrepareRedeemMarketPositionsByMarketIdRequest, eN as PrepareRedeemMarketPositionsError, eO as PrepareRedeemMarketPositionsRequest, eP as PrepareRedeemPositionsError, eQ as PrepareRedeemPositionsRequest, eR as PrepareSplitComboPositionError, eS as PrepareSplitComboPositionRequest, eT as PrepareSplitMarketPositionError, eU as PrepareSplitMarketPositionRequest, eV as PrepareSplitPositionError, eW as PrepareSplitPositionRequest, eX as PrepareTradingApprovalsError, eY as PublicRealtimeEvent, eZ as PublicRealtimeTopic, e_ as PublicSubscriptionSpec, aS as RedeemPositionsError, e$ as RedeemPositionsWorkflow, f0 as RedeemPositionsWorkflowRequest, f1 as ResolveConditionByTokenError, f2 as ResolveConditionByTokenRequest, f3 as ResumePerpsSessionRequest, f4 as RevokePerpsCredentialsError, f5 as RevokePerpsCredentialsRequest, aW as RfqCancelQuoteAck, aX as RfqCancelQuoteError, aY as RfqCancelQuoteRejectedError, aZ as RfqCancelQuoteRejectedErrorOptions, a_ as RfqConfirmationAck, a$ as RfqConfirmationError, b0 as RfqConfirmationRejectedError, f6 as RfqConfirmationRejectedErrorOptions, b1 as RfqConfirmationRequestEvent, b3 as RfqEvent, f7 as RfqExecutionUpdateEvent, b4 as RfqQuoteError, b5 as RfqQuoteReference, b6 as RfqQuoteRejectedError, b7 as RfqQuoteRejectedErrorOptions, b8 as RfqQuoteRequestEvent, b9 as RfqQuoteResponse, ba as RfqQuoteSource, bb as RfqSession, bc as RfqTradeEvent, bd as SearchError, f8 as SearchRequest, f9 as SearchResults, fa as SecureRealtimeEvent, fb as SecureRealtimeTopic, fc as SecureSubscriptionSpec, bw as SetupTradingApprovalsError, fd as SignedOrder, fe as SplitComboPositionError, ff as SplitMarketPositionError, bz as SplitPositionError, fg as SplitPositionWorkflow, fh as SplitPositionWorkflowRequest, fi as SportsEventType, fj as SportsSubscription, fk as SubscribeError, fl as SubscriptionHandle, fm as TradingApprovalsWorkflow, fn as TradingApprovalsWorkflowRequest, bE as TransferErc20Error, fo as UpdateBalanceAllowanceError, fp as UpdateBalanceAllowanceRequest, fq as UpdatePerpsLeverageRequest, fr as UpdatePerpsMarginRequest, fs as UserEventType, ft as UserSubscription, fu as WaitForGaslessTransactionError, fv as WithdrawFromPerpsError, fw as WithdrawFromPerpsRequest, fx as approveErc1155ForAll, fy as approveErc20, fz as cancelAll, fA as cancelMarketOrders, fB as cancelOrder, fC as cancelOrders, fD as deployDepositWallet, fE as depositToPerps, fF as downloadAccountingSnapshot, fG as dropNotifications, fH as estimateMarketPrice, fI as fetchBalanceAllowance, fJ as fetchBuilderFeeRates, fK as fetchBuilderVolume, fL as fetchClosedOnlyMode, fM as fetchCommentsById, fN as fetchEvent, fO as fetchEventLiveVolume, fP as fetchEventTags, fQ as fetchExecuteParams, fR as fetchLastTradePrice, fS as fetchLastTradePrices, fT as fetchMarket, fU as fetchMarketInfo, fV as fetchMarketTags, fW as fetchMidpoint, fX as fetchMidpoints, fY as fetchNegRisk, fZ as fetchNotifications, f_ as fetchOrder, f$ as fetchOrderBook, g0 as fetchOrderBooks, g1 as fetchOrderScoring, g2 as fetchOrdersScoring, g3 as fetchPerpsBook, g4 as fetchPerpsFees, g5 as fetchPerpsInstruments, g6 as fetchPerpsTicker, g7 as fetchPerpsTickers, g8 as fetchPortfolioValue, g9 as fetchPrice, ga as fetchPriceHistory, gb as fetchPrices, gc as fetchPublicProfile, gd as fetchRelatedTagResources, ge as fetchRelatedTags, gf as fetchRewardPercentages, gg as fetchSeries, gh as fetchSpread, gi as fetchSpreads, gj as fetchTag, gk as fetchTickSize, gl as fetchTotalEarningsForUserForDay, gm as fetchTradedMarketCount, gn as fetchTransaction, go as isWalletDeployed, gp as listAccountTrades, gq as listActivity, gr as listBuilderLeaderboard, gs as listBuilderTrades, gt as listClosedPositions, gu as listComboMarkets, gv as listComboPositions, gw as listComments, gx as listCommentsByUserAddress, gy as listCurrentRewards, gz as listEvents, gA as listMarketHolders, gB as listMarketPositions, gC as listMarketRewards, gD as listMarkets, gE as listOpenInterest, gF as listOpenOrders, gG as listPerpsCandles, gH as listPerpsFundingHistory, gI as listPerpsTrades, gJ as listPositions, gK as listSeries, gL as listTags, gM as listTeams, gN as listTraderLeaderboard, gO as listTrades, gP as listUserEarningsAndMarketsConfig, gQ as listUserEarningsForDay, gR as mergeComboPosition, gS as mergeMarketPosition, gT as mergePositions, gU as openPerpsSession, gV as openRfqSession, gW as postOrder, gX as postOrders, gY as prepareErc1155ApprovalForAll, gZ as prepareErc20Approval, g_ as prepareErc20Transfer, g$ as prepareGaslessTransaction, h0 as prepareMergeComboPosition, h1 as prepareMergeMarketPosition, h2 as prepareMergePositions, h3 as preparePerpsDeposit, h4 as prepareRedeemComboPosition, h5 as prepareRedeemMarketPositions, h6 as prepareRedeemPositions, h7 as prepareSplitComboPosition, h8 as prepareSplitMarketPosition, h9 as prepareSplitPosition, ha as prepareTradingApprovals, hb as redeemPositions, hc as resolveConditionByToken, hd as revokePerpsCredentials, he as search, hf as setupTradingApprovals, hg as splitComboPosition, hh as splitMarketPosition, hi as splitPosition, hj as subscribe, hk as transferErc20, hl as updateBalanceAllowance, hm as withdrawFromPerps } from '../types-5uGoLhNm.js';
|
|
1
|
+
import { bI as RateLimitError, bK as RequestRejectedError, cB as TransportError, cE as UnexpectedResponseError, cu as SigningError, B as BaseClient, h as BaseSecureClient } from '../types-CgIv7KE4.js';
|
|
2
|
+
export { e as ApproveErc1155ForAllError, f as ApproveErc20Error, C as CancelAllError, j as CancelAllPerpsOrdersRequest, k as CancelMarketOrdersError, d2 as CancelMarketOrdersRequest, l as CancelOrderError, d3 as CancelOrderRequest, m as CancelOrdersError, d4 as CancelOrdersRequest, n as CancelPerpsOrderRequest, o as CancelPerpsOrdersRequest, u as ComboPositionSort, d5 as CommentsEventType, d6 as CommentsSubscription, x as CreatePerpsSessionRequest, d7 as CryptoPricesEventType, d8 as CryptoPricesSubscription, d9 as DeployDepositWalletError, z as DepositToPerpsError, E as DepositToPerpsRequest, G as DownloadAccountingSnapshotError, da as DownloadAccountingSnapshotRequest, H as DropNotificationsError, db as DropNotificationsRequest, dc as EquityPricesEventType, dd as EquityPricesSubscription, de as Erc1155ApprovalForAllWorkflow, df as Erc1155ApprovalForAllWorkflowRequest, dg as Erc20ApprovalWorkflow, dh as Erc20ApprovalWorkflowRequest, di as Erc20TransferWorkflow, dj as Erc20TransferWorkflowRequest, dk as EstimateMarketBuyPriceRequest, L as EstimateMarketPriceError, dl as EstimateMarketPriceRequest, dm as EstimateMarketSellPriceRequest, dn as EventForSubscriptionSpec, dp as EventForSubscriptionSpecs, dq as FetchBalanceAllowanceError, dr as FetchBalanceAllowanceRequest, ds as FetchBuilderFeeRatesError, dt as FetchBuilderFeeRatesRequest, M as FetchClosedOnlyModeError, N as FetchCommentsByIdError, du as FetchCommentsByIdRequest, O as FetchEventError, P as FetchEventLiveVolumeError, dv as FetchEventLiveVolumeRequest, dw as FetchEventRequest, Q as FetchEventTagsError, dx as FetchEventTagsRequest, dy as FetchExecuteParamsError, dz as FetchExecuteParamsRequest, dA as FetchGaslessTransactionRequest, R as FetchLastTradePriceError, dB as FetchLastTradePriceRequest, V as FetchLastTradePricesError, dC as FetchLastTradePricesRequest, W as FetchMarketError, dD as FetchMarketInfoError, dE as FetchMarketInfoRequest, dF as FetchMarketRequest, X as FetchMarketTagsError, dG as FetchMarketTagsRequest, Y as FetchMidpointError, dH as FetchMidpointRequest, Z as FetchMidpointsError, dI as FetchMidpointsRequest, dJ as FetchNegRiskError, dK as FetchNegRiskRequest, _ as FetchNotificationsError, $ as FetchOrderBookError, dL as FetchOrderBookRequest, a0 as FetchOrderBooksError, dM as FetchOrderBooksRequest, a1 as FetchOrderError, dN as FetchOrderRequest, a2 as FetchOrderScoringError, dO as FetchOrderScoringRequest, a3 as FetchOrdersScoringError, dP as FetchOrdersScoringRequest, a4 as FetchPerpsAccountConfigRequest, a5 as FetchPerpsBookError, a6 as FetchPerpsBookRequest, a7 as FetchPerpsFeesError, a8 as FetchPerpsInstrumentsError, a9 as FetchPerpsInstrumentsRequest, aa as FetchPerpsOpenOrdersRequest, ab as FetchPerpsOrdersRequest, ac as FetchPerpsTickerError, ad as FetchPerpsTickerRequest, ae as FetchPerpsTickersError, af as FetchPerpsTickersRequest, ag as FetchPortfolioValueError, dQ as FetchPortfolioValueRequest, ah as FetchPriceError, ai as FetchPriceHistoryError, dR as FetchPriceHistoryRequest, dS as FetchPriceRequest, aj as FetchPricesError, dT as FetchPricesRequest, ak as FetchPublicProfileError, dU as FetchPublicProfileRequest, al as FetchRelatedTagResourcesError, dV as FetchRelatedTagResourcesRequest, am as FetchRelatedTagsError, dW as FetchRelatedTagsRequest, an as FetchRewardPercentagesError, ao as FetchSeriesError, dX as FetchSeriesRequest, ap as FetchSpreadError, dY as FetchSpreadRequest, aq as FetchSpreadsError, dZ as FetchSpreadsRequest, ar as FetchTagError, d_ as FetchTagRequest, d$ as FetchTickSizeError, e0 as FetchTickSizeRequest, as as FetchTotalEarningsForUserForDayError, e1 as FetchTotalEarningsForUserForDayRequest, at as FetchTradedMarketCountError, e2 as FetchTradedMarketCountRequest, e3 as GaslessTransactionMetadataSchema, e4 as GaslessWorkflow, e5 as GaslessWorkflowRequest, e6 as IsWalletDeployedError, e7 as IsWalletDeployedRequest, av as ListAccountTradesError, e8 as ListAccountTradesRequest, aw as ListActivityError, e9 as ListActivityRequest, ax as ListBuilderLeaderboardError, ea as ListBuilderLeaderboardRequest, ay as ListBuilderTradesError, eb as ListBuilderTradesRequest, az as ListBuilderVolumeError, ec as ListBuilderVolumeRequest, aA as ListClosedPositionsError, ed as ListClosedPositionsRequest, aB as ListComboActivityError, ee as ListComboActivityRequest, aC as ListComboMarketsError, ef as ListComboMarketsRequest, aD as ListComboPositionsError, eg as ListComboPositionsRequest, aE as ListCommentsByUserAddressError, eh as ListCommentsByUserAddressRequest, aF as ListCommentsError, ei as ListCommentsRequest, aG as ListCurrentRewardsError, ej as ListCurrentRewardsRequest, aH as ListEventsError, ek as ListEventsRequest, el as ListMarketClarificationsError, em as ListMarketClarificationsRequest, aI as ListMarketHoldersError, en as ListMarketHoldersRequest, aJ as ListMarketPositionsError, eo as ListMarketPositionsRequest, aK as ListMarketRewardsError, ep as ListMarketRewardsRequest, aL as ListMarketsError, eq as ListMarketsRequest, aM as ListOpenInterestError, er as ListOpenInterestRequest, aN as ListOpenOrdersError, es as ListOpenOrdersRequest, aO as ListPerpsCandlesError, aP as ListPerpsCandlesRequest, aQ as ListPerpsDepositsRequest, aR as ListPerpsEquityHistoryRequest, aS as ListPerpsFillsRequest, aT as ListPerpsFundingHistoryError, aU as ListPerpsFundingHistoryRequest, aV as ListPerpsFundingPaymentsRequest, aW as ListPerpsPnlHistoryRequest, aX as ListPerpsTradesError, aY as ListPerpsTradesRequest, aZ as ListPerpsWithdrawalsRequest, a_ as ListPositionsError, et as ListPositionsRequest, a$ as ListSeriesError, eu as ListSeriesRequest, b0 as ListTagsError, ev as ListTagsRequest, b1 as ListTeamsError, ew as ListTeamsRequest, b2 as ListTraderLeaderboardError, ex as ListTraderLeaderboardRequest, b3 as ListTradesError, ey as ListTradesRequest, b4 as ListUserEarningsAndMarketsConfigError, ez as ListUserEarningsAndMarketsConfigRequest, b5 as ListUserEarningsForDayError, eA as ListUserEarningsForDayRequest, eB as MarketEventType, eC as MarketSubscription, eD as MergeComboPositionError, eE as MergeMarketPositionError, b6 as MergePositionsError, eF as MergePositionsWorkflow, eG as MergePositionsWorkflowRequest, b7 as OpenPerpsSessionError, b8 as OpenPerpsSessionRequest, b9 as OpenRfqSessionError, eH as OrderDraft, eI as OrderPostingWorkflow, eJ as OrderWorkflow, eK as OrderWorkflowRequest, eL as PerpsBboSubscription, be as PerpsBookDepth, eM as PerpsBookSubscription, eN as PerpsCandlesSubscription, eO as PerpsDepositWorkflow, eP as PerpsDepositWorkflowRequest, eQ as PerpsMarketDataEventType, eR as PerpsMarketDataSubscription, bg as PerpsOrderRequest, bh as PerpsPlaceFokOrderRequest, bi as PerpsPlaceGtcOrderRequest, bj as PerpsPlaceIocOrderRequest, bk as PerpsPlacedTpSlOrder, bl as PerpsPlacedTpSlOrders, bm as PerpsPositionTpSlTrigger, bn as PerpsSession, bo as PerpsSessionAccountError, bp as PerpsSessionLifecycleError, bq as PerpsSessionTradingError, eS as PerpsStatisticsSubscription, eT as PerpsStreamingCandleInterval, eU as PerpsTickersSubscription, br as PerpsTpSlTrigger, eV as PerpsTradesSubscription, bs as PlacePerpsOrderRequest, bt as PlacePerpsOrderResult, bu as PlacePerpsOrderWithTpSlRequest, bv as PlacePerpsOrderWithTpSlResult, bw as PlacePerpsPositionTpSlRequest, bx as PlacePerpsPositionTpSlResult, by as PostOrderError, bz as PostOrdersError, eW as PostOrdersRequest, bA as PostPerpsOrdersRequest, eX as PrepareErc1155ApprovalForAllError, eY as PrepareErc1155ApprovalForAllRequest, eZ as PrepareErc20ApprovalError, e_ as PrepareErc20ApprovalRequest, e$ as PrepareErc20TransferError, f0 as PrepareErc20TransferRequest, f1 as PrepareGaslessTransactionError, f2 as PrepareGaslessTransactionRequest, f3 as PrepareLimitOrderRequest, f4 as PrepareMarketBuyOrderRequest, f5 as PrepareMarketOrderRequest, f6 as PrepareMarketSellOrderRequest, f7 as PrepareMergeComboPositionError, f8 as PrepareMergeComboPositionRequest, f9 as PrepareMergeMarketPositionError, fa as PrepareMergeMarketPositionRequest, fb as PrepareMergePositionsError, fc as PrepareMergePositionsRequest, fd as PreparePerpsDepositError, fe as PrepareRedeemComboPositionError, ff as PrepareRedeemComboPositionRequest, fg as PrepareRedeemMarketPositionsByConditionIdRequest, fh as PrepareRedeemMarketPositionsByMarketIdRequest, fi as PrepareRedeemMarketPositionsError, fj as PrepareRedeemMarketPositionsRequest, fk as PrepareRedeemPositionsError, fl as PrepareRedeemPositionsRequest, fm as PrepareSplitComboPositionError, fn as PrepareSplitComboPositionRequest, fo as PrepareSplitMarketPositionError, fp as PrepareSplitMarketPositionRequest, fq as PrepareSplitPositionError, fr as PrepareSplitPositionRequest, fs as PrepareTradingApprovalsError, ft as PublicRealtimeEvent, fu as PublicRealtimeTopic, fv as PublicSubscriptionSpec, bJ as RedeemPositionsError, fw as RedeemPositionsWorkflow, fx as RedeemPositionsWorkflowRequest, fy as ResolveConditionByTokenError, fz as ResolveConditionByTokenRequest, bN as ResumePerpsSessionRequest, bO as RevokePerpsCredentialsError, bP as RevokePerpsCredentialsRequest, bQ as RfqCancelQuoteAck, bR as RfqCancelQuoteError, bS as RfqCancelQuoteRejectedError, bT as RfqCancelQuoteRejectedErrorOptions, bU as RfqConfirmationAck, bV as RfqConfirmationError, bW as RfqConfirmationRejectedError, fA as RfqConfirmationRejectedErrorOptions, bX as RfqConfirmationRequestEvent, bZ as RfqEvent, fB as RfqExecutionUpdateEvent, b_ as RfqQuoteError, b$ as RfqQuoteReference, c0 as RfqQuoteRejectedError, c1 as RfqQuoteRejectedErrorOptions, c2 as RfqQuoteRequestEvent, c3 as RfqQuoteResponse, c4 as RfqQuoteSource, c5 as RfqSession, c6 as RfqTradeEvent, c7 as SearchError, fC as SearchRequest, fD as SearchResults, c8 as SearchSort, fE as SecureRealtimeEvent, fF as SecureRealtimeTopic, fG as SecureSubscriptionSpec, cs as SetupTradingApprovalsError, fH as SignedOrder, fI as SplitComboPositionError, fJ as SplitMarketPositionError, cv as SplitPositionError, fK as SplitPositionWorkflow, fL as SplitPositionWorkflowRequest, fM as SportsEventType, fN as SportsSubscription, fO as SubscribeError, fP as SubscriptionHandle, fQ as TradingApprovalsWorkflow, fR as TradingApprovalsWorkflowRequest, cA as TransferErc20Error, fS as UpdateBalanceAllowanceError, fT as UpdateBalanceAllowanceRequest, cF as UpdatePerpsLeverageError, cG as UpdatePerpsLeverageRequest, fU as UserEventType, fV as UserSubscription, fW as WaitForGaslessTransactionError, cM as WithdrawFromPerpsError, cN as WithdrawFromPerpsRequest, fX as approveErc1155ForAll, fY as approveErc20, fZ as cancelAll, f_ as cancelMarketOrders, f$ as cancelOrder, g0 as cancelOrders, g1 as deployDepositWallet, g2 as depositToPerps, g3 as downloadAccountingSnapshot, g4 as dropNotifications, g5 as estimateMarketPrice, g6 as fetchBalanceAllowance, g7 as fetchBuilderFeeRates, g8 as fetchBuilderVolume, g9 as fetchClosedOnlyMode, ga as fetchCommentsById, gb as fetchEvent, gc as fetchEventLiveVolume, gd as fetchEventTags, ge as fetchExecuteParams, gf as fetchLastTradePrice, gg as fetchLastTradePrices, gh as fetchMarket, gi as fetchMarketInfo, gj as fetchMarketTags, gk as fetchMidpoint, gl as fetchMidpoints, gm as fetchNegRisk, gn as fetchNotifications, go as fetchOrder, gp as fetchOrderBook, gq as fetchOrderBooks, gr as fetchOrderScoring, gs as fetchOrdersScoring, gt as fetchPerpsBook, gu as fetchPerpsFees, gv as fetchPerpsInstruments, gw as fetchPerpsTicker, gx as fetchPerpsTickers, gy as fetchPortfolioValue, gz as fetchPrice, gA as fetchPriceHistory, gB as fetchPrices, gC as fetchPublicProfile, gD as fetchRelatedTagResources, gE as fetchRelatedTags, gF as fetchRewardPercentages, gG as fetchSeries, gH as fetchSpread, gI as fetchSpreads, gJ as fetchTag, gK as fetchTickSize, gL as fetchTotalEarningsForUserForDay, gM as fetchTradedMarketCount, gN as fetchTransaction, gO as isWalletDeployed, gP as listAccountTrades, gQ as listActivity, gR as listBuilderLeaderboard, gS as listBuilderTrades, gT as listClosedPositions, gU as listComboActivity, gV as listComboMarkets, gW as listComboPositions, gX as listComments, gY as listCommentsByUserAddress, gZ as listCurrentRewards, g_ as listEvents, g$ as listMarketClarifications, h0 as listMarketHolders, h1 as listMarketPositions, h2 as listMarketRewards, h3 as listMarkets, h4 as listOpenInterest, h5 as listOpenOrders, h6 as listPerpsCandles, h7 as listPerpsFundingHistory, h8 as listPerpsTrades, h9 as listPositions, ha as listSeries, hb as listTags, hc as listTeams, hd as listTraderLeaderboard, he as listTrades, hf as listUserEarningsAndMarketsConfig, hg as listUserEarningsForDay, hh as mergeComboPosition, hi as mergeMarketPosition, hj as mergePositions, hk as openPerpsSession, hl as openRfqSession, hm as postOrder, hn as postOrders, ho as prepareErc1155ApprovalForAll, hp as prepareErc20Approval, hq as prepareErc20Transfer, hr as prepareGaslessTransaction, hs as prepareMergeComboPosition, ht as prepareMergeMarketPosition, hu as prepareMergePositions, hv as preparePerpsDeposit, hw as prepareRedeemComboPosition, hx as prepareRedeemMarketPositions, hy as prepareRedeemPositions, hz as prepareSplitComboPosition, hA as prepareSplitMarketPosition, hB as prepareSplitPosition, hC as prepareTradingApprovals, hD as redeemPositions, hE as resolveConditionByToken, hF as revokePerpsCredentials, hG as search, hH as setupTradingApprovals, hI as splitComboPosition, hJ as splitMarketPosition, hK as splitPosition, hL as subscribe, hM as transferErc20, hN as updateBalanceAllowance, hO as withdrawFromPerps } from '../types-CgIv7KE4.js';
|
|
3
3
|
import { ApiKey } from '@polymarket/bindings';
|
|
4
4
|
import { ApiKeyCreds, BuilderApiKeyCreds, BuilderApiKey } from '@polymarket/bindings/clob';
|
|
5
5
|
import { EvmAddress, EvmSignature } from '@polymarket/types';
|
|
6
|
-
export { C as CreateLimitOrderError, a as CreateMarketOrderError, F as FetchSportsMarketTypesError, L as ListSportsError, P as PlaceLimitOrderError, b as PlaceMarketOrderError, c as PrepareLimitOrderError, d as PrepareLimitOrderPostingError, e as PrepareMarketOrderError, f as PrepareMarketOrderPostingError, g as createLimitOrder, h as createMarketOrder, i as fetchSportsMarketTypes, l as listSports, p as placeLimitOrder, j as placeMarketOrder, k as prepareLimitOrder, m as prepareLimitOrderPosting, n as prepareMarketOrder, o as prepareMarketOrderPosting } from '../sports-
|
|
7
|
-
export { ComboPositionStatus } from '@polymarket/bindings/data';
|
|
6
|
+
export { C as CreateLimitOrderError, a as CreateMarketOrderError, F as FetchSportsMarketTypesError, L as ListSportsError, P as PlaceLimitOrderError, b as PlaceMarketOrderError, c as PrepareLimitOrderError, d as PrepareLimitOrderPostingError, e as PrepareMarketOrderError, f as PrepareMarketOrderPostingError, g as createLimitOrder, h as createMarketOrder, i as fetchSportsMarketTypes, l as listSports, p as placeLimitOrder, j as placeMarketOrder, k as prepareLimitOrder, m as prepareLimitOrderPosting, n as prepareMarketOrder, o as prepareMarketOrderPosting } from '../sports-Dm3yiYAe.js';
|
|
7
|
+
export { ComboActivityType, ComboPositionOutcome, ComboPositionStatus } from '@polymarket/bindings/data';
|
|
8
8
|
export { CommentsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, CryptoPricesEvent, CustomMarketEvent, EquityPricesEvent, MarketEvent, PerpsBboEvent, PerpsBookEvent, PerpsCandleEvent, PerpsMarketDataEvent, PerpsSessionEvent, PerpsStatisticEvent, PerpsTickerEvent, PerpsTradeEvent, SportsEvent, StandardMarketEvent, UserEvent } from '@polymarket/bindings/subscriptions';
|
|
9
|
-
export {
|
|
9
|
+
export { PerpsCancelOrderResult, PerpsPostOrderAck, PerpsUpdateLeverageResult } from '@polymarket/bindings/perps';
|
|
10
|
+
export { RfqConfirmationDecision, RfqConfirmationRequest, RfqDirection, RfqErrorCode, RfqExecutionStatus, RfqExecutionUpdate, RfqId, RfqKnownErrorCode, RfqQuoteId, RfqQuoteRequest, RfqRequestedSize, RfqRequestedSizeUnit, RfqRequestorPublicId, RfqSide, RfqTrade } from '@polymarket/bindings/rfq';
|
|
10
11
|
import '@polymarket/bindings/gamma';
|
|
11
12
|
import '@polymarket/bindings/relayer';
|
|
12
13
|
import 'zod';
|
|
13
|
-
import '@polymarket/bindings/perps';
|
|
14
14
|
import 'ox';
|
|
15
15
|
|
|
16
16
|
type ApiKeyAuthRequest = {
|
|
@@ -21,7 +21,7 @@ type ApiKeyAuthRequest = {
|
|
|
21
21
|
};
|
|
22
22
|
type CreateApiKeyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
23
23
|
declare const CreateApiKeyError: {
|
|
24
|
-
isError(error: unknown): error is
|
|
24
|
+
isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
* Creates a new API key from a signed L1 auth payload.
|
|
@@ -40,7 +40,7 @@ declare const CreateApiKeyError: {
|
|
|
40
40
|
declare function createApiKey(client: BaseClient, request: ApiKeyAuthRequest): Promise<ApiKeyCreds>;
|
|
41
41
|
type DeriveApiKeyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
42
42
|
declare const DeriveApiKeyError: {
|
|
43
|
-
isError(error: unknown): error is
|
|
43
|
+
isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Derives an existing API key from a signed L1 auth payload.
|
|
@@ -59,7 +59,7 @@ declare const DeriveApiKeyError: {
|
|
|
59
59
|
declare function deriveApiKey(client: BaseClient, request: ApiKeyAuthRequest): Promise<ApiKeyCreds>;
|
|
60
60
|
type CreateOrDeriveApiKeyError = RateLimitError | RequestRejectedError | TransportError | UnexpectedResponseError;
|
|
61
61
|
declare const CreateOrDeriveApiKeyError: {
|
|
62
|
-
isError(error: unknown): error is
|
|
62
|
+
isError(error: unknown): error is TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* Creates an API key and falls back to derivation when it already exists.
|
|
@@ -78,7 +78,7 @@ declare const CreateOrDeriveApiKeyError: {
|
|
|
78
78
|
declare function createOrDeriveApiKey(client: BaseClient, request: ApiKeyAuthRequest): Promise<ApiKeyCreds>;
|
|
79
79
|
type FetchApiKeysError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
|
|
80
80
|
declare const FetchApiKeysError: {
|
|
81
|
-
isError(error: unknown): error is
|
|
81
|
+
isError(error: unknown): error is SigningError | TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
82
82
|
};
|
|
83
83
|
/**
|
|
84
84
|
* Fetches all API keys associated with the authenticated client.
|
|
@@ -97,7 +97,7 @@ declare const FetchApiKeysError: {
|
|
|
97
97
|
declare function fetchApiKeys(client: BaseSecureClient): Promise<ApiKey[]>;
|
|
98
98
|
type DeleteApiKeyError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
|
|
99
99
|
declare const DeleteApiKeyError: {
|
|
100
|
-
isError(error: unknown): error is
|
|
100
|
+
isError(error: unknown): error is SigningError | TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
103
|
* Deletes the authenticated API key.
|
|
@@ -117,7 +117,7 @@ declare const DeleteApiKeyError: {
|
|
|
117
117
|
declare function deleteApiKey(client: BaseSecureClient): Promise<void>;
|
|
118
118
|
type CreateBuilderApiKeyError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
|
|
119
119
|
declare const CreateBuilderApiKeyError: {
|
|
120
|
-
isError(error: unknown): error is
|
|
120
|
+
isError(error: unknown): error is SigningError | TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
121
121
|
};
|
|
122
122
|
/**
|
|
123
123
|
* Creates a new builder API key for the authenticated client.
|
|
@@ -137,7 +137,7 @@ declare const CreateBuilderApiKeyError: {
|
|
|
137
137
|
declare function createBuilderApiKey(client: BaseSecureClient): Promise<BuilderApiKeyCreds>;
|
|
138
138
|
type FetchBuilderApiKeysError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
|
|
139
139
|
declare const FetchBuilderApiKeysError: {
|
|
140
|
-
isError(error: unknown): error is
|
|
140
|
+
isError(error: unknown): error is SigningError | TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
141
141
|
};
|
|
142
142
|
/**
|
|
143
143
|
* Fetches builder API keys associated with the authenticated client.
|
|
@@ -157,7 +157,7 @@ declare const FetchBuilderApiKeysError: {
|
|
|
157
157
|
declare function fetchBuilderApiKeys(client: BaseSecureClient): Promise<BuilderApiKey[]>;
|
|
158
158
|
type RevokeBuilderApiKeyError = RateLimitError | RequestRejectedError | SigningError | TransportError | UnexpectedResponseError;
|
|
159
159
|
declare const RevokeBuilderApiKeyError: {
|
|
160
|
-
isError(error: unknown): error is
|
|
160
|
+
isError(error: unknown): error is SigningError | TransportError | UnexpectedResponseError | RequestRejectedError | RateLimitError;
|
|
161
161
|
};
|
|
162
162
|
/**
|
|
163
163
|
* Revokes a builder API key.
|
package/dist/actions/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{Oa as ApproveErc1155ForAllError,Ka as ApproveErc20Error,Gc as CancelAllError,Ic as CancelMarketOrdersError,Cc as CancelOrderError,Ec as CancelOrdersError,sa as ComboActivityType,ce as ComboPositionOutcome,Rd as ComboPositionSort,de as ComboPositionStatus,Ua as CreateApiKeyError,cb as CreateBuilderApiKeyError,ed as CreateLimitOrderError,ad as CreateMarketOrderError,Ya as CreateOrDeriveApiKeyError,ab as DeleteApiKeyError,Ca as DeployDepositWalletError,Kd as DepositToPerpsError,Wa as DeriveApiKeyError,ae as DownloadAccountingSnapshotError,W as DropNotificationsError,Kc as EstimateMarketPriceError,_a as FetchApiKeysError,Y as FetchBalanceAllowanceError,eb as FetchBuilderApiKeysError,wb as FetchBuilderFeeRatesError,M as FetchClosedOnlyModeError,Wb as FetchCommentsByIdError,ac as FetchEventError,ec as FetchEventLiveVolumeError,cc as FetchEventTagsError,xa as FetchExecuteParamsError,Kb as FetchLastTradePriceError,Mb as FetchLastTradePricesError,sc as FetchMarketError,ub as FetchMarketInfoError,uc as FetchMarketTagsError,kb as FetchMidpointError,mb as FetchMidpointsError,qb as FetchNegRiskError,U as FetchNotificationsError,Cb as FetchOrderBookError,Eb as FetchOrderBooksError,Q as FetchOrderError,aa as FetchOrderScoringError,ca as FetchOrdersScoringError,xd as FetchPerpsBookError,Fd as FetchPerpsFeesError,rd as FetchPerpsInstrumentsError,td as FetchPerpsTickerError,vd as FetchPerpsTickersError,Yd as FetchPortfolioValueError,yb as FetchPriceError,Ob as FetchPriceHistoryError,Ab as FetchPricesError,Ke as FetchPublicProfileError,qf as FetchRelatedTagResourcesError,of as FetchRelatedTagsError,ka as FetchRewardPercentagesError,df as FetchSeriesError,hf as FetchSportsMarketTypesError,Gb as FetchSpreadError,Ib as FetchSpreadsError,mf as FetchTagError,ob as FetchTickSizeError,ga as FetchTotalEarningsForUserForDayError,_d as FetchTradedMarketCountError,Ba as GaslessTransactionMetadataSchema,za as IsWalletDeployedError,S as ListAccountTradesError,oa as ListActivityError,gc as ListBuilderLeaderboardError,ib as ListBuilderTradesError,ic as ListBuilderVolumeError,Ud as ListClosedPositionsError,qa as ListComboActivityError,qc as ListComboMarketsError,Wd as ListComboPositionsError,Yb as ListCommentsByUserAddressError,Ub as ListCommentsError,Qb as ListCurrentRewardsError,_b as ListEventsError,mc as ListMarketClarificationsError,wc as ListMarketHoldersError,Ac as ListMarketPositionsError,Sb as ListMarketRewardsError,oc as ListMarketsError,yc as ListOpenInterestError,O as ListOpenOrdersError,zd as ListPerpsCandlesError,Bd as ListPerpsFundingHistoryError,Dd as ListPerpsTradesError,Sd as ListPositionsError,bf as ListSeriesError,ff as ListSportsError,kf as ListTagsError,sf as ListTeamsError,kc as ListTraderLeaderboardError,ma as ListTradesError,ia as ListUserEarningsAndMarketsConfigError,ea as ListUserEarningsForDayError,Be as MergeComboPositionError,Ae as MergeMarketPositionError,ze as MergePositionsError,Hd as OpenPerpsSessionError,Se as OpenRfqSessionError,gd as PlaceLimitOrderError,cd as PlaceMarketOrderError,Nc as PostOrderError,Oc as PostOrdersError,Ma as PrepareErc1155ApprovalForAllError,Ia as PrepareErc20ApprovalError,uf as PrepareErc20TransferError,Fa as PrepareGaslessTransactionError,Wc as PrepareLimitOrderError,_c as PrepareLimitOrderPostingError,Uc as PrepareMarketOrderError,Yc as PrepareMarketOrderPostingError,je as PrepareMergeComboPositionError,ie as PrepareMergeMarketPositionError,he as PrepareMergePositionsError,Jd as PreparePerpsDepositError,me as PrepareRedeemComboPositionError,le as PrepareRedeemMarketPositionsError,ke as PrepareRedeemPositionsError,ge as PrepareSplitComboPositionError,fe as PrepareSplitMarketPositionError,ee as PrepareSplitPositionError,Qa as PrepareTradingApprovalsError,Ie as RedeemPositionsError,sb as ResolveConditionByTokenError,gb as RevokeBuilderApiKeyError,Id as RevokePerpsCredentialsError,Pe as RfqCancelQuoteError,Oe as RfqCancelQuoteRejectedError,Ue as RfqConfirmationDecision,Re as RfqConfirmationError,Qe as RfqConfirmationRejectedError,Ve as RfqDirection,We as RfqExecutionStatus,Xe as RfqKnownErrorCode,Ne as RfqQuoteError,Me as RfqQuoteRejectedError,Ye as RfqRequestedSizeUnit,Ze as RfqSide,$e as SearchError,_e as SearchSort,Sa as SetupTradingApprovalsError,se as SplitComboPositionError,re as SplitMarketPositionError,qe as SplitPositionError,wf as TransferErc20Error,_ as UpdateBalanceAllowanceError,pd as UpdatePerpsLeverageError,Ha as WaitForGaslessTransactionError,Ld as WithdrawFromPerpsError,Pa as approveErc1155ForAll,La as approveErc20,Hc as cancelAll,Jc as cancelMarketOrders,Dc as cancelOrder,Fc as cancelOrders,Va as createApiKey,db as createBuilderApiKey,fd as createLimitOrder,bd as createMarketOrder,Za as createOrDeriveApiKey,bb as deleteApiKey,Da as deployDepositWallet,Pd as depositToPerps,Xa as deriveApiKey,be as downloadAccountingSnapshot,X as dropNotifications,Lc as estimateMarketPrice,$a as fetchApiKeys,Z as fetchBalanceAllowance,fb as fetchBuilderApiKeys,xb as fetchBuilderFeeRates,jc as fetchBuilderVolume,N as fetchClosedOnlyMode,Xb as fetchCommentsById,bc as fetchEvent,fc as fetchEventLiveVolume,dc as fetchEventTags,ya as fetchExecuteParams,Lb as fetchLastTradePrice,Nb as fetchLastTradePrices,tc as fetchMarket,vb as fetchMarketInfo,vc as fetchMarketTags,lb as fetchMidpoint,nb as fetchMidpoints,rb as fetchNegRisk,V as fetchNotifications,R as fetchOrder,Db as fetchOrderBook,Fb as fetchOrderBooks,ba as fetchOrderScoring,da as fetchOrdersScoring,yd as fetchPerpsBook,Gd as fetchPerpsFees,sd as fetchPerpsInstruments,ud as fetchPerpsTicker,wd as fetchPerpsTickers,Zd as fetchPortfolioValue,zb as fetchPrice,Pb as fetchPriceHistory,Bb as fetchPrices,Le as fetchPublicProfile,rf as fetchRelatedTagResources,pf as fetchRelatedTags,la as fetchRewardPercentages,ef as fetchSeries,if as fetchSportsMarketTypes,Hb as fetchSpread,Jb as fetchSpreads,nf as fetchTag,pb as fetchTickSize,ha as fetchTotalEarningsForUserForDay,$d as fetchTradedMarketCount,Ea as fetchTransaction,Aa as isWalletDeployed,T as listAccountTrades,pa as listActivity,hc as listBuilderLeaderboard,jb as listBuilderTrades,Vd as listClosedPositions,ra as listComboActivity,rc as listComboMarkets,Xd as listComboPositions,Vb as listComments,Zb as listCommentsByUserAddress,Rb as listCurrentRewards,$b as listEvents,nc as listMarketClarifications,xc as listMarketHolders,Bc as listMarketPositions,Tb as listMarketRewards,pc as listMarkets,zc as listOpenInterest,P as listOpenOrders,Ad as listPerpsCandles,Cd as listPerpsFundingHistory,Ed as listPerpsTrades,Td as listPositions,cf as listSeries,gf as listSports,lf as listTags,tf as listTeams,lc as listTraderLeaderboard,na as listTrades,ja as listUserEarningsAndMarketsConfig,fa as listUserEarningsForDay,De as mergeComboPosition,Ce as mergeMarketPosition,Ee as mergePositions,Md as openPerpsSession,Te as openRfqSession,hd as placeLimitOrder,dd as placeMarketOrder,Pc as postOrder,Qc as postOrders,Na as prepareErc1155ApprovalForAll,Ja as prepareErc20Approval,vf as prepareErc20Transfer,Ga as prepareGaslessTransaction,Xc as prepareLimitOrder,$c as prepareLimitOrderPosting,Vc as prepareMarketOrder,Zc as prepareMarketOrderPosting,xe as prepareMergeComboPosition,we as prepareMergeMarketPosition,ye as prepareMergePositions,Od as preparePerpsDeposit,Ge as prepareRedeemComboPosition,Fe as prepareRedeemMarketPositions,He as prepareRedeemPositions,oe as prepareSplitComboPosition,ne as prepareSplitMarketPosition,pe as prepareSplitPosition,Ra as prepareTradingApprovals,Je as redeemPositions,tb as resolveConditionByToken,Mc as resolveEstimatedMarketPrice,hb as revokeBuilderApiKey,Nd as revokePerpsCredentials,af as search,Ta as setupTradingApprovals,Tc as signOrder,ue as splitComboPosition,te as splitMarketPosition,ve as splitPosition,jf as subscribe,xf as transferErc20,$ as updateBalanceAllowance,Qd as withdrawFromPerps}from'../chunk-Z6CZB4WP.js';import'../chunk-TYJAXA3Y.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"names":["TransportError","_TransportError","PolymarketError","message","options","error","TimeoutError","TransactionFailedError","CancelledSigningError","_CancelledSigningError","SigningError","_SigningError","msg"],"mappings":"gDAmDO,IAAMA,EAAN,MAAMC,CAAAA,SAAuBC,eAAgB,CACzC,KAAO,gBAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,CAAAA,CAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,CAAAA,CAASC,CAAO,EACxB,CAEA,OAAO,SAAA,CAAUC,EAAgC,CAC/C,OAAO,IAAIJ,CAAAA,CACTI,aAAiB,KAAA,CAAQA,CAAAA,CAAM,OAAA,CAAU,gBAAA,CACzC,CACE,KAAA,CAAOA,CACT,CACF,CACF,CACF,EA0FO,IAAMC,CAAAA,CAAN,cAA2BJ,eAAgB,CACvC,IAAA,CAAO,cAAA,CAEhB,YAAYC,CAAAA,CAAiBC,CAAAA,CAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,CAAAA,CAASC,CAAO,EACxB,CACF,CAAA,CAKaG,CAAAA,CAAN,cAAqCL,eAAgB,CACjD,IAAA,CAAO,wBAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,EAASC,CAAO,EACxB,CACF,CAAA,CAKaI,CAAAA,CAAN,MAAMC,CAAAA,SAA8BP,eAAgB,CAChD,IAAA,CAAO,uBAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,EAASC,CAAO,EACxB,CAEA,OAAO,UAAUC,CAAAA,CAAqC,CACpD,OAAO,IAAII,EAAsBJ,CAAAA,CAAM,OAAA,CAAS,CAC9C,KAAA,CAAOA,CACT,CAAC,CACH,CACF,MAkBaK,CAAAA,CAAN,MAAMC,CAAAA,SAAqBT,eAAgB,CACvC,IAAA,CAAO,cAAA,CAEhB,WAAA,CAAYC,CAAAA,CAAiBC,EAAwB,EAAC,CAAG,CACvD,KAAA,CAAMD,EAASC,CAAO,EACxB,CAEA,OAAO,UAAUC,CAAAA,CAAgBF,CAAAA,CAAgC,CAC/D,IAAMS,EACJT,CAAAA,GAAYE,CAAAA,YAAiB,KAAA,CAAQA,CAAAA,CAAM,QAAU,gBAAA,CAAA,CACvD,OAAO,IAAIM,CAAAA,CAAaC,EAAK,CAAE,KAAA,CAAOP,CAAM,CAAC,CAC/C,CACF","file":"chunk-3GYPYD7Z.js","sourcesContent":["import { PolymarketError } from '@polymarket/types';\nimport type { ZodError } from 'zod';\nimport {\n formatInputZodError,\n formatResponseZodError,\n type ResponseValidationContext,\n} from './validation';\n\n/**\n * Error thrown when an action input fails SDK validation before a request is\n * sent.\n */\nexport class UserInputError extends PolymarketError {\n override name = 'UserInputError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromZodError(error: ZodError): UserInputError {\n return new UserInputError(formatInputZodError(error), {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when a service response does not match the action's expected\n * response shape.\n */\nexport class UnexpectedResponseError extends PolymarketError {\n override name = 'UnexpectedResponseError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromZodError(\n error: ZodError,\n context: ResponseValidationContext,\n ): UnexpectedResponseError {\n return new UnexpectedResponseError(formatResponseZodError(error, context), {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when the SDK cannot complete a request because of a network or\n * runtime transport failure.\n */\nexport class TransportError extends PolymarketError {\n override name = 'TransportError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: unknown): TransportError {\n return new TransportError(\n error instanceof Error ? error.message : 'Request failed',\n {\n cause: error,\n },\n );\n }\n}\n\n/**\n * WebSocket close codes defined by RFC 6455 and the IANA WebSocket Close Code\n * Number registry. Codes 4000-4999 are reserved for application use and are\n * intentionally not modeled here.\n */\nexport enum WebSocketKnownCloseCode {\n NormalClosure = 1000,\n GoingAway = 1001,\n ProtocolError = 1002,\n UnsupportedData = 1003,\n /** Synthesized locally when the peer closed without a status code. */\n NoStatusReceived = 1005,\n /** Synthesized locally when the connection dropped without a close frame. */\n AbnormalClosure = 1006,\n InvalidFramePayload = 1007,\n PolicyViolation = 1008,\n MessageTooBig = 1009,\n InternalError = 1011,\n ServiceRestart = 1012,\n TryAgainLater = 1013,\n}\n\n/**\n * A WebSocket close code. Codes enumerated in\n * {@link WebSocketKnownCloseCode} are defined by RFC 6455; other values, such\n * as application-defined 4000-4999 codes, flow through as plain numbers.\n */\nexport type WebSocketCloseCode = WebSocketKnownCloseCode | (number & {});\n\nexport type ConnectionLostErrorOptions = {\n /** WebSocket close code reported for the lost connection. */\n code: WebSocketCloseCode;\n /** Close reason provided by the peer. Empty when none was sent. */\n reason: string;\n};\n\n/**\n * Error thrown when a live connection ends without the SDK requesting it.\n */\nexport class ConnectionLostError extends PolymarketError {\n override name = 'ConnectionLostError' as const;\n\n readonly code: WebSocketCloseCode;\n readonly reason: string;\n\n constructor(\n message: string,\n options: ErrorOptions & ConnectionLostErrorOptions,\n ) {\n super(message, options);\n this.code = options.code;\n this.reason = options.reason;\n }\n}\n\nexport type RequestRejectedErrorOptions = {\n status: number;\n};\n\n/**\n * Error thrown when a service responds with a non-success status other than\n * rate limiting.\n */\nexport class RequestRejectedError extends PolymarketError {\n override name = 'RequestRejectedError' as const;\n\n readonly status: number;\n\n constructor(\n message: string,\n options: ErrorOptions & RequestRejectedErrorOptions,\n ) {\n super(message, options);\n this.status = options.status;\n }\n}\n\n/**\n * Error thrown when the service rejects a request because the rate limit has\n * been exceeded.\n */\nexport class RateLimitError extends PolymarketError {\n override name = 'RateLimitError' as const;\n}\n\n/**\n * Error thrown when an async wait operation exceeds its allotted polling time.\n */\nexport class TimeoutError extends PolymarketError {\n override name = 'TimeoutError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when a submitted transaction reaches a terminal failure state.\n */\nexport class TransactionFailedError extends PolymarketError {\n override name = 'TransactionFailedError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when the user cancels a required wallet signing action.\n */\nexport class CancelledSigningError extends PolymarketError {\n override name = 'CancelledSigningError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: Error): CancelledSigningError {\n return new CancelledSigningError(error.message, {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when there is not enough resting market liquidity to satisfy the\n * requested execution semantics.\n */\nexport class InsufficientLiquidityError extends PolymarketError {\n override name = 'InsufficientLiquidityError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when the SDK cannot produce a required signature or\n * authentication payload.\n */\nexport class SigningError extends PolymarketError {\n override name = 'SigningError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: unknown, message?: string): SigningError {\n const msg =\n message ?? (error instanceof Error ? error.message : 'Signing failed');\n return new SigningError(msg, { cause: error });\n }\n}\n\nexport function makeErrorGuard<\n // biome-ignore lint/suspicious/noExplicitAny: constructor rest args require any[]\n TClasses extends ReadonlyArray<new (...args: any[]) => unknown>,\n>(\n ...classes: TClasses\n): { isError(error: unknown): error is InstanceType<TClasses[number]> } {\n return {\n isError(error: unknown): error is InstanceType<TClasses[number]> {\n return classes.some((c) => error instanceof c);\n },\n };\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {PolymarketError}from'@polymarket/types';var Z=/^[$A-Z_a-z][$\w]*$/;function i(e){let r=c(e.issues);return r.length===0?"It was not possible to determine a more specific reason.":["Fix the following issues:",p(r)].join(`
|
|
2
|
+
`)}function u(e,r){let s=c(e.issues);return s.length===0?["Received an incompatible API response.",`Endpoint: ${r.endpoint}`,"This usually means the API response shape changed in a breaking way or the SDK is outdated.","It was not possible to determine a more specific reason."].join(`
|
|
3
|
+
`):["Received an incompatible API response.",`Endpoint: ${r.endpoint}`,"This usually means the API response shape changed in a breaking way or the SDK is outdated.","Fix the following issues:",p(s)].join(`
|
|
4
|
+
`)}function p(e){return e.map(s=>s.path===null?`- ${s.message}`:`- ${s.path}: ${s.message}`).join(`
|
|
5
|
+
`)}function c(e){return d(e).slice(0,99)}function d(e,r=[]){let s=e.flatMap(n=>{let a=[...r,...n.path];return n.code==="invalid_union"?n.errors.flatMap(v=>d(v,a)):[{code:n.code,message:n.message,path:a.length===0?null:P(a)}]});return O(s)}function O(e){let r=new Set,s=[];for(let n of e){let a=`${n.code}:${n.path??""}:${n.message}`;r.has(a)||(r.add(a),s.push(n));}return s.sort(U)}function U(e,r){return e.path===null&&r.path!==null?-1:e.path!==null&&r.path===null?1:(e.path??"").localeCompare(r.path??"")}function P(e){return e.reduce((r,s)=>typeof s=="number"?`${r}[${s.toString()}]`:typeof s!="string"?r:s.includes('"')?`${r}["${s.replaceAll('"','\\"')}"]`:Z.test(s)?r.length===0?s:`${r}.${s}`:`${r}["${s}"]`,"")}var l=class e extends PolymarketError{name="UserInputError";constructor(r,s={}){super(r,s);}static fromZodError(r){return new e(i(r),{cause:r})}},m=class e extends PolymarketError{name="UnexpectedResponseError";constructor(r,s={}){super(r,s);}static fromZodError(r,s){return new e(u(r,s),{cause:r})}},f=class e extends PolymarketError{name="TransportError";constructor(r,s={}){super(r,s);}static fromError(r){return new e(r instanceof Error?r.message:"Request failed",{cause:r})}},T=(t=>(t[t.NormalClosure=1e3]="NormalClosure",t[t.GoingAway=1001]="GoingAway",t[t.ProtocolError=1002]="ProtocolError",t[t.UnsupportedData=1003]="UnsupportedData",t[t.NoStatusReceived=1005]="NoStatusReceived",t[t.AbnormalClosure=1006]="AbnormalClosure",t[t.InvalidFramePayload=1007]="InvalidFramePayload",t[t.PolicyViolation=1008]="PolicyViolation",t[t.MessageTooBig=1009]="MessageTooBig",t[t.InternalError=1011]="InternalError",t[t.ServiceRestart=1012]="ServiceRestart",t[t.TryAgainLater=1013]="TryAgainLater",t))(T||{}),g=class extends PolymarketError{name="ConnectionLostError";code;reason;constructor(r,s){super(r,s),this.code=s.code,this.reason=s.reason;}},E=class extends PolymarketError{name="RequestRejectedError";status;constructor(r,s){super(r,s),this.status=s.status;}},I=class extends PolymarketError{name="RateLimitError"},x=class extends PolymarketError{name="TimeoutError";constructor(r,s={}){super(r,s);}},y=class extends PolymarketError{name="TransactionFailedError";constructor(r,s={}){super(r,s);}},h=class e extends PolymarketError{name="CancelledSigningError";constructor(r,s={}){super(r,s);}static fromError(r){return new e(r.message,{cause:r})}},$=class extends PolymarketError{name="InsufficientLiquidityError";constructor(r,s={}){super(r,s);}},R=class e extends PolymarketError{name="SigningError";constructor(r,s={}){super(r,s);}static fromError(r,s){let n=s??(r instanceof Error?r.message:"Signing failed");return new e(n,{cause:r})}};function V(...e){return {isError(r){return e.some(s=>r instanceof s)}}}export{l as a,m as b,f as c,T as d,g as e,E as f,I as g,x as h,y as i,h as j,$ as k,R as l,V as m};//# sourceMappingURL=chunk-TYJAXA3Y.js.map
|
|
6
|
+
//# sourceMappingURL=chunk-TYJAXA3Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/validation.ts","../src/errors.ts"],"names":["identifierRegex","formatInputZodError","error","issues","flattenIssues","formatIssues","formatResponseZodError","context","issue","flattenIssueBranches","pathPrefix","flattened","path","branch","formatPath","dedupeIssues","seen","deduped","key","compareIssues","left","right","result","segment","UserInputError","_UserInputError","PolymarketError","message","options","UnexpectedResponseError","_UnexpectedResponseError","TransportError","_TransportError","WebSocketKnownCloseCode","ConnectionLostError","RequestRejectedError","RateLimitError","TimeoutError","TransactionFailedError","CancelledSigningError","_CancelledSigningError","InsufficientLiquidityError","SigningError","_SigningError","msg","makeErrorGuard","classes","c"],"mappings":"gDAGA,IAAMA,CAAAA,CAAkB,oBAAA,CAejB,SAASC,CAAAA,CAAoBC,CAAAA,CAAyB,CAC3D,IAAMC,CAAAA,CAASC,CAAAA,CAAcF,CAAAA,CAAM,MAAM,CAAA,CAEzC,OAAIC,CAAAA,CAAO,MAAA,GAAW,CAAA,CACb,0DAAA,CAGF,CAAC,2BAAA,CAA6BE,CAAAA,CAAaF,CAAM,CAAC,CAAA,CAAE,IAAA,CAAK;AAAA,CAAI,CACtE,CAKO,SAASG,CAAAA,CACdJ,CAAAA,CACAK,CAAAA,CACQ,CACR,IAAMJ,CAAAA,CAASC,CAAAA,CAAcF,CAAAA,CAAM,MAAM,CAAA,CAEzC,OAAIC,CAAAA,CAAO,MAAA,GAAW,CAAA,CACb,CACL,wCAAA,CACA,CAAA,UAAA,EAAaI,CAAAA,CAAQ,QAAQ,CAAA,CAAA,CAC7B,6FAAA,CACA,0DACF,CAAA,CAAE,IAAA,CAAK;AAAA,CAAI,CAAA,CAGN,CACL,wCAAA,CACA,CAAA,UAAA,EAAaA,CAAAA,CAAQ,QAAQ,CAAA,CAAA,CAC7B,6FAAA,CACA,2BAAA,CACAF,CAAAA,CAAaF,CAAM,CACrB,EAAE,IAAA,CAAK;AAAA,CAAI,CACb,CAEA,SAASE,CAAAA,CAAaF,CAAAA,CAA2C,CAS/D,OARcA,CAAAA,CAAO,GAAA,CAAKK,CAAAA,EACpBA,CAAAA,CAAM,IAAA,GAAS,KACV,CAAA,EAAA,EAAKA,CAAAA,CAAM,OAAO,CAAA,CAAA,CAGpB,CAAA,EAAA,EAAKA,CAAAA,CAAM,IAAI,CAAA,EAAA,EAAKA,CAAAA,CA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,IAAA,CAAMC,CAAAA,EAAM7C,CAAAA,YAAiB6C,CAAC,CAC/C,CACF,CACF","file":"chunk-TYJAXA3Y.js","sourcesContent":["import type { core, ZodError } from 'zod';\n\nconst maxIssuesInMessage = 99;\nconst identifierRegex = /^[$A-Z_a-z][$\\w]*$/;\n\ntype UserInputIssue = {\n code: string;\n message: string;\n path: string | null;\n};\n\nexport type ResponseValidationContext = {\n endpoint: string;\n};\n\n/**\n * Formats a `ZodError` into an SDK-oriented input validation message.\n */\nexport function formatInputZodError(error: ZodError): string {\n const issues = flattenIssues(error.issues);\n\n if (issues.length === 0) {\n return 'It was not possible to determine a more specific reason.';\n }\n\n return ['Fix the following issues:', formatIssues(issues)].join('\\n');\n}\n\n/**\n * Formats a `ZodError` into an SDK-oriented response validation message.\n */\nexport function formatResponseZodError(\n error: ZodError,\n context: ResponseValidationContext,\n): string {\n const issues = flattenIssues(error.issues);\n\n if (issues.length === 0) {\n return [\n 'Received an incompatible API response.',\n `Endpoint: ${context.endpoint}`,\n 'This usually means the API response shape changed in a breaking way or the SDK is outdated.',\n 'It was not possible to determine a more specific reason.',\n ].join('\\n');\n }\n\n return [\n 'Received an incompatible API response.',\n `Endpoint: ${context.endpoint}`,\n 'This usually means the API response shape changed in a breaking way or the SDK is outdated.',\n 'Fix the following issues:',\n formatIssues(issues),\n ].join('\\n');\n}\n\nfunction formatIssues(issues: readonly UserInputIssue[]): string {\n const lines = issues.map((issue) => {\n if (issue.path === null) {\n return `- ${issue.message}`;\n }\n\n return `- ${issue.path}: ${issue.message}`;\n });\n\n return lines.join('\\n');\n}\n\nfunction flattenIssues(issues: readonly core.$ZodIssue[]): UserInputIssue[] {\n return flattenIssueBranches(issues).slice(0, maxIssuesInMessage);\n}\n\nfunction flattenIssueBranches(\n issues: readonly core.$ZodIssue[],\n pathPrefix: readonly PropertyKey[] = [],\n): UserInputIssue[] {\n const flattened = issues.flatMap((issue) => {\n const path = [...pathPrefix, ...issue.path];\n\n if (issue.code === 'invalid_union') {\n return issue.errors.flatMap((branch) =>\n flattenIssueBranches(branch, path),\n );\n }\n\n return [\n {\n code: issue.code,\n message: issue.message,\n path: path.length === 0 ? null : formatPath(path),\n } satisfies UserInputIssue,\n ];\n });\n\n return dedupeIssues(flattened);\n}\n\nfunction dedupeIssues(issues: readonly UserInputIssue[]): UserInputIssue[] {\n const seen = new Set<string>();\n const deduped: UserInputIssue[] = [];\n\n for (const issue of issues) {\n const key = `${issue.code}:${issue.path ?? ''}:${issue.message}`;\n\n if (seen.has(key)) {\n continue;\n }\n\n seen.add(key);\n deduped.push(issue);\n }\n\n return deduped.sort(compareIssues);\n}\n\nfunction compareIssues(left: UserInputIssue, right: UserInputIssue): number {\n if (left.path === null && right.path !== null) {\n return -1;\n }\n\n if (left.path !== null && right.path === null) {\n return 1;\n }\n\n return (left.path ?? '').localeCompare(right.path ?? '');\n}\n\nfunction formatPath(path: readonly PropertyKey[]): string {\n return path.reduce<string>((result, segment) => {\n if (typeof segment === 'number') {\n return `${result}[${segment.toString()}]`;\n }\n\n if (typeof segment !== 'string') {\n return result;\n }\n\n if (segment.includes('\"')) {\n return `${result}[\"${segment.replaceAll('\"', '\\\\\"')}\"]`;\n }\n\n if (!identifierRegex.test(segment)) {\n return `${result}[\"${segment}\"]`;\n }\n\n if (result.length === 0) {\n return segment;\n }\n\n return `${result}.${segment}`;\n }, '');\n}\n","import { PolymarketError } from '@polymarket/types';\nimport type { ZodError } from 'zod';\nimport {\n formatInputZodError,\n formatResponseZodError,\n type ResponseValidationContext,\n} from './validation';\n\n/**\n * Error thrown when an action input fails SDK validation before a request is\n * sent.\n */\nexport class UserInputError extends PolymarketError {\n override name = 'UserInputError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromZodError(error: ZodError): UserInputError {\n return new UserInputError(formatInputZodError(error), {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when a service response does not match the action's expected\n * response shape.\n */\nexport class UnexpectedResponseError extends PolymarketError {\n override name = 'UnexpectedResponseError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromZodError(\n error: ZodError,\n context: ResponseValidationContext,\n ): UnexpectedResponseError {\n return new UnexpectedResponseError(formatResponseZodError(error, context), {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when the SDK cannot complete a request because of a network or\n * runtime transport failure.\n */\nexport class TransportError extends PolymarketError {\n override name = 'TransportError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: unknown): TransportError {\n return new TransportError(\n error instanceof Error ? error.message : 'Request failed',\n {\n cause: error,\n },\n );\n }\n}\n\n/**\n * WebSocket close codes defined by RFC 6455 and the IANA WebSocket Close Code\n * Number registry. Codes 4000-4999 are reserved for application use and are\n * intentionally not modeled here.\n */\nexport enum WebSocketKnownCloseCode {\n NormalClosure = 1000,\n GoingAway = 1001,\n ProtocolError = 1002,\n UnsupportedData = 1003,\n /** Synthesized locally when the peer closed without a status code. */\n NoStatusReceived = 1005,\n /** Synthesized locally when the connection dropped without a close frame. */\n AbnormalClosure = 1006,\n InvalidFramePayload = 1007,\n PolicyViolation = 1008,\n MessageTooBig = 1009,\n InternalError = 1011,\n ServiceRestart = 1012,\n TryAgainLater = 1013,\n}\n\n/**\n * A WebSocket close code. Codes enumerated in\n * {@link WebSocketKnownCloseCode} are defined by RFC 6455; other values, such\n * as application-defined 4000-4999 codes, flow through as plain numbers.\n */\nexport type WebSocketCloseCode = WebSocketKnownCloseCode | (number & {});\n\nexport type ConnectionLostErrorOptions = {\n /** WebSocket close code reported for the lost connection. */\n code: WebSocketCloseCode;\n /** Close reason provided by the peer. Empty when none was sent. */\n reason: string;\n};\n\n/**\n * Error thrown when a live connection ends without the SDK requesting it.\n */\nexport class ConnectionLostError extends PolymarketError {\n override name = 'ConnectionLostError' as const;\n\n readonly code: WebSocketCloseCode;\n readonly reason: string;\n\n constructor(\n message: string,\n options: ErrorOptions & ConnectionLostErrorOptions,\n ) {\n super(message, options);\n this.code = options.code;\n this.reason = options.reason;\n }\n}\n\nexport type RequestRejectedErrorOptions = {\n status: number;\n};\n\n/**\n * Error thrown when a service responds with a non-success status other than\n * rate limiting.\n */\nexport class RequestRejectedError extends PolymarketError {\n override name = 'RequestRejectedError' as const;\n\n readonly status: number;\n\n constructor(\n message: string,\n options: ErrorOptions & RequestRejectedErrorOptions,\n ) {\n super(message, options);\n this.status = options.status;\n }\n}\n\n/**\n * Error thrown when the service rejects a request because the rate limit has\n * been exceeded.\n */\nexport class RateLimitError extends PolymarketError {\n override name = 'RateLimitError' as const;\n}\n\n/**\n * Error thrown when an async wait operation exceeds its allotted polling time.\n */\nexport class TimeoutError extends PolymarketError {\n override name = 'TimeoutError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when a submitted transaction reaches a terminal failure state.\n */\nexport class TransactionFailedError extends PolymarketError {\n override name = 'TransactionFailedError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when the user cancels a required wallet signing action.\n */\nexport class CancelledSigningError extends PolymarketError {\n override name = 'CancelledSigningError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: Error): CancelledSigningError {\n return new CancelledSigningError(error.message, {\n cause: error,\n });\n }\n}\n\n/**\n * Error thrown when there is not enough resting market liquidity to satisfy the\n * requested execution semantics.\n */\nexport class InsufficientLiquidityError extends PolymarketError {\n override name = 'InsufficientLiquidityError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n}\n\n/**\n * Error thrown when the SDK cannot produce a required signature or\n * authentication payload.\n */\nexport class SigningError extends PolymarketError {\n override name = 'SigningError' as const;\n\n constructor(message: string, options: ErrorOptions = {}) {\n super(message, options);\n }\n\n static fromError(error: unknown, message?: string): SigningError {\n const msg =\n message ?? (error instanceof Error ? error.message : 'Signing failed');\n return new SigningError(msg, { cause: error });\n }\n}\n\nexport function makeErrorGuard<\n // biome-ignore lint/suspicious/noExplicitAny: constructor rest args require any[]\n TClasses extends ReadonlyArray<new (...args: any[]) => unknown>,\n>(\n ...classes: TClasses\n): { isError(error: unknown): error is InstanceType<TClasses[number]> } {\n return {\n isError(error: unknown): error is InstanceType<TClasses[number]> {\n return classes.some((c) => error instanceof c);\n },\n };\n}\n"]}
|