@polymarket/client 0.1.0-beta.3 → 0.1.0-beta.5
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 +3 -3
- package/dist/actions/index.js +1 -1
- package/dist/chunk-2ZZDFOKL.js +2 -0
- package/dist/chunk-2ZZDFOKL.js.map +1 -0
- package/dist/ethers-v5.d.ts +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{sports-BIOQ9MxA.d.ts → sports-DNd7kOz2.d.ts} +1 -1
- package/dist/{types-CYRIvfiu.d.ts → types-DLNcPNT6.d.ts} +99 -12
- package/dist/viem.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunk-RX3J5EHP.js +0 -2
- package/dist/chunk-RX3J5EHP.js.map +0 -1
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { e as ApproveErc1155ForAllError, f as ApproveErc20Error, C as CancelAllError, j as CancelMarketOrdersError, bN as CancelMarketOrdersRequest, k as CancelOrderError, bO as CancelOrderRequest, l as CancelOrdersError, bP as CancelOrdersRequest, bQ as CommentsEventType, bR as CommentsSubscription, bS as CryptoPricesEventType, bT as CryptoPricesSubscription, bU as DeployDepositWalletError, bV as DeprecatedTransactionHandle, s as DownloadAccountingSnapshotError, bW as DownloadAccountingSnapshotRequest, t as DropNotificationsError, bX as DropNotificationsRequest, bY as EquityPricesEventType, bZ as EquityPricesSubscription, b_ as Erc1155ApprovalForAllWorkflow, b$ as Erc1155ApprovalForAllWorkflowRequest, c0 as Erc20ApprovalWorkflow, c1 as Erc20ApprovalWorkflowRequest, c2 as Erc20TransferWorkflow, c3 as Erc20TransferWorkflowRequest, c4 as EstimateMarketBuyPriceRequest, u as EstimateMarketPriceError, c5 as EstimateMarketPriceRequest, c6 as EstimateMarketSellPriceRequest, c7 as EventForSubscriptionSpec, c8 as EventForSubscriptionSpecs, c9 as FetchBalanceAllowanceError, ca as FetchBalanceAllowanceRequest, cb as FetchBuilderFeeRatesError, cc as FetchBuilderFeeRatesRequest, F as FetchClosedOnlyModeError, v as FetchCommentsByIdError, cd as FetchCommentsByIdRequest, w as FetchEventError, x as FetchEventLiveVolumeError, ce as FetchEventLiveVolumeRequest, cf as FetchEventRequest, y as FetchEventTagsError, cg as FetchEventTagsRequest, ch as FetchExecuteParamsError, ci as FetchExecuteParamsRequest, cj as FetchGaslessTransactionRequest, z as FetchLastTradePriceError, ck as FetchLastTradePriceRequest, G as FetchLastTradePricesError, cl as FetchLastTradePricesRequest, H as FetchMarketError, cm as FetchMarketInfoError, cn as FetchMarketInfoRequest, co as FetchMarketRequest, I as FetchMarketTagsError, cp as FetchMarketTagsRequest, J as FetchMidpointError, cq as FetchMidpointRequest, K as FetchMidpointsError, cr as FetchMidpointsRequest, cs as FetchNegRiskError, ct as FetchNegRiskRequest, L as FetchNotificationsError, M as FetchOrderBookError, cu as FetchOrderBookRequest, N as FetchOrderBooksError, cv as FetchOrderBooksRequest, O as FetchOrderError, cw as FetchOrderRequest, P as FetchOrderScoringError, cx as FetchOrderScoringRequest, Q as FetchOrdersScoringError, cy as FetchOrdersScoringRequest, R as FetchPortfolioValueError, cz as FetchPortfolioValueRequest, V as FetchPriceError, W as FetchPriceHistoryError, cA as FetchPriceHistoryRequest, cB as FetchPriceRequest, X as FetchPricesError, cC as FetchPricesRequest, Y as FetchPublicProfileError, cD as FetchPublicProfileRequest, Z as FetchRelatedTagResourcesError, cE as FetchRelatedTagResourcesRequest, _ as FetchRelatedTagsError, cF as FetchRelatedTagsRequest, $ as FetchRewardPercentagesError, a0 as FetchSeriesError, cG as FetchSeriesRequest, a1 as FetchSpreadError, cH as FetchSpreadRequest, a2 as FetchSpreadsError, cI as FetchSpreadsRequest, a3 as FetchTagError, cJ as FetchTagRequest, cK as FetchTickSizeError, cL as FetchTickSizeRequest, a4 as FetchTotalEarningsForUserForDayError, cM as FetchTotalEarningsForUserForDayRequest, a5 as FetchTradedMarketCountError, cN as FetchTradedMarketCountRequest, cO as GaslessTransactionMetadataSchema, cP as GaslessWorkflow, cQ as GaslessWorkflowRequest, cR as IsWalletDeployedError, cS as IsWalletDeployedRequest, a7 as ListAccountTradesError, cT as ListAccountTradesRequest, a8 as ListActivityError, cU as ListActivityRequest, a9 as ListBuilderLeaderboardError, cV as ListBuilderLeaderboardRequest, aa as ListBuilderTradesError, cW as ListBuilderTradesRequest, ab as ListBuilderVolumeError, cX as ListBuilderVolumeRequest, ac as ListClosedPositionsError, cY as ListClosedPositionsRequest, ad as ListComboPositionsError, cZ as ListComboPositionsRequest, ae as ListCommentsByUserAddressError, c_ as ListCommentsByUserAddressRequest, af as ListCommentsError, c$ as ListCommentsRequest, ag as ListCurrentRewardsError, d0 as ListCurrentRewardsRequest, ah as ListEventsError, d1 as ListEventsRequest, ai as ListMarketHoldersError, d2 as ListMarketHoldersRequest, aj as ListMarketPositionsError, d3 as ListMarketPositionsRequest, ak as ListMarketRewardsError, d4 as ListMarketRewardsRequest, al as ListMarketsError, d5 as ListMarketsRequest, am as ListOpenInterestError, d6 as ListOpenInterestRequest, an as ListOpenOrdersError, d7 as ListOpenOrdersRequest, ao as ListPositionsError, d8 as ListPositionsRequest, ap as ListSeriesError, d9 as ListSeriesRequest, aq as ListTagsError, da as ListTagsRequest, ar as ListTeamsError, db as ListTeamsRequest, as as ListTraderLeaderboardError, dc as ListTraderLeaderboardRequest, at as ListTradesError, dd as ListTradesRequest, au as ListUserEarningsAndMarketsConfigError, de as ListUserEarningsAndMarketsConfigRequest, av as ListUserEarningsForDayError, df as ListUserEarningsForDayRequest, dg as MarketEventType, dh as MarketSubscription, di as MergeComboPositionError, dj as MergeMarketPositionError, aw as MergePositionsError, dk as MergePositionsWorkflow, dl as MergePositionsWorkflowRequest, ax as OpenRfqSessionError, dm as OrderDraft, dn as OrderPostingWorkflow, dp as OrderWorkflow, dq as OrderWorkflowRequest, aB as PostOrderError, aC as PostOrdersError, dr as PostOrdersRequest, ds as PrepareErc1155ApprovalForAllError, dt as PrepareErc1155ApprovalForAllRequest, du as PrepareErc20ApprovalError, dv as PrepareErc20ApprovalRequest, dw as PrepareErc20TransferError, dx as PrepareErc20TransferRequest, dy as PrepareGaslessTransactionError, dz as PrepareGaslessTransactionRequest, dA as PrepareLimitOrderRequest, dB as PrepareMarketBuyOrderRequest, dC as PrepareMarketOrderRequest, dD as PrepareMarketSellOrderRequest, dE as PrepareMergeComboPositionError, dF as PrepareMergeComboPositionRequest, dG as PrepareMergeMarketPositionError, dH as PrepareMergeMarketPositionRequest, dI as PrepareMergePositionsError, dJ as PrepareMergePositionsRequest, dK as PrepareRedeemComboPositionError, dL as PrepareRedeemComboPositionRequest, dM as PrepareRedeemMarketPositionsByConditionIdRequest, dN as PrepareRedeemMarketPositionsByMarketIdRequest, dO as PrepareRedeemMarketPositionsError, dP as PrepareRedeemMarketPositionsRequest, dQ as PrepareRedeemPositionsError, dR as PrepareRedeemPositionsRequest, dS as PrepareSplitComboPositionError, dT as PrepareSplitComboPositionRequest, dU as PrepareSplitMarketPositionError, dV as PrepareSplitMarketPositionRequest, dW as PrepareSplitPositionError, dX as PrepareSplitPositionRequest, dY as PrepareTradingApprovalsError, dZ as PublicRealtimeEvent, d_ as PublicRealtimeTopic, d$ as PublicSubscriptionSpec, aK as RedeemPositionsError, e0 as RedeemPositionsWorkflow, e1 as RedeemPositionsWorkflowRequest, e2 as ResolveConditionByTokenError, e3 as ResolveConditionByTokenRequest, aN as RfqCancelQuoteAck, aO as RfqCancelQuoteError, aP as RfqCancelQuoteRejectedError, aQ as RfqCancelQuoteRejectedErrorOptions, aR as RfqConfirmationAck, aS as RfqConfirmationError, aT as RfqConfirmationRejectedError, e4 as RfqConfirmationRejectedErrorOptions, aU as RfqConfirmationRequestEvent, aV as RfqEvent, e5 as RfqExecutionUpdateEvent, aW as RfqQuoteError, aX as RfqQuoteReference, aY as RfqQuoteRejectedError, aZ as RfqQuoteRejectedErrorOptions, a_ as RfqQuoteRequestEvent, a$ as RfqQuoteResponse, b0 as RfqQuoteSource, b1 as RfqSession, b2 as SearchError, e6 as SearchRequest, e7 as SearchResults, e8 as SecureRealtimeEvent, e9 as SecureRealtimeTopic, ea as SecureSubscriptionSpec, bk as SetupTradingApprovalsError, eb as SignedOrder, ec as SplitComboPositionError, ed as SplitMarketPositionError, bn as SplitPositionError, ee as SplitPositionWorkflow, ef as SplitPositionWorkflowRequest, eg as SportsEventType, eh as SportsSubscription, ei as SubscribeError, ej as SubscriptionHandle, ek as TradingApprovalsWorkflow, el as TradingApprovalsWorkflowRequest, bs as TransferErc20Error, em as UpdateBalanceAllowanceError, en as UpdateBalanceAllowanceRequest, eo as UserEventType, ep as UserSubscription, eq as WaitForGaslessTransactionError, er as approveErc1155ForAll, es as approveErc20, et as cancelAll, eu as cancelMarketOrders, ev as cancelOrder, ew as cancelOrders, ex as deployDepositWallet, ey as downloadAccountingSnapshot, ez as dropNotifications, eA as estimateMarketPrice, eB as fetchBalanceAllowance, eC as fetchBuilderFeeRates, eD as fetchBuilderVolume, eE as fetchClosedOnlyMode, eF as fetchCommentsById, eG as fetchEvent, eH as fetchEventLiveVolume, eI as fetchEventTags, eJ as fetchExecuteParams, eK as fetchLastTradePrice, eL as fetchLastTradePrices, eM as fetchMarket, eN as fetchMarketInfo, eO as fetchMarketTags, eP as fetchMidpoint, eQ as fetchMidpoints, eR as fetchNegRisk, eS as fetchNotifications, eT as fetchOrder, eU as fetchOrderBook, eV as fetchOrderBooks, eW as fetchOrderScoring, eX as fetchOrdersScoring, eY as fetchPortfolioValue, eZ as fetchPrice, e_ as fetchPriceHistory, e$ as fetchPrices, f0 as fetchPublicProfile, f1 as fetchRelatedTagResources, f2 as fetchRelatedTags, f3 as fetchRewardPercentages, f4 as fetchSeries, f5 as fetchSpread, f6 as fetchSpreads, f7 as fetchTag, f8 as fetchTickSize, f9 as fetchTotalEarningsForUserForDay, fa as fetchTradedMarketCount, fb as fetchTransaction, fc as isWalletDeployed, fd as listAccountTrades, fe as listActivity, ff as listBuilderLeaderboard, fg as listBuilderTrades, fh as listClosedPositions, fi as listComboPositions, fj as listComments, fk as listCommentsByUserAddress, fl as listCurrentRewards, fm as listEvents, fn as listMarketHolders, fo as listMarketPositions, fp as listMarketRewards, fq as listMarkets, fr as listOpenInterest, fs as listOpenOrders, ft as listPositions, fu as listSeries, fv as listTags, fw as listTeams, fx as listTraderLeaderboard, fy as listTrades, fz as listUserEarningsAndMarketsConfig, fA as listUserEarningsForDay, fB as mergeComboPosition, fC as mergeMarketPosition, fD as mergePositions, fE as openRfqSession, fF as postOrder, fG as postOrders, fH as prepareErc1155ApprovalForAll, fI as prepareErc20Approval, fJ as prepareErc20Transfer, fK as prepareGaslessTransaction, fL as prepareMergeComboPosition, fM as prepareMergeMarketPosition, fN as prepareMergePositions, fO as prepareRedeemComboPosition, fP as prepareRedeemMarketPositions, fQ as prepareRedeemPositions, fR as prepareSplitComboPosition, fS as prepareSplitMarketPosition, fT as prepareSplitPosition, fU as prepareTradingApprovals, fV as redeemPositions, fW as resolveConditionByToken, fX as search, fY as setupTradingApprovals, fZ as splitComboPosition, f_ as splitMarketPosition, f$ as splitPosition, g0 as subscribe, g1 as transferErc20, g2 as updateBalanceAllowance } from '../types-CYRIvfiu.js';
|
|
1
|
+
import { aK as RateLimitError, aM as RequestRejectedError, bu as TransportError, bx as UnexpectedResponseError, bn as SigningError, B as BaseClient, h as BaseSecureClient } from '../types-DLNcPNT6.js';
|
|
2
|
+
export { e as ApproveErc1155ForAllError, f as ApproveErc20Error, C as CancelAllError, j as CancelMarketOrdersError, bO as CancelMarketOrdersRequest, k as CancelOrderError, bP as CancelOrderRequest, l as CancelOrdersError, bQ as CancelOrdersRequest, bR as CommentsEventType, bS as CommentsSubscription, bT as CryptoPricesEventType, bU as CryptoPricesSubscription, bV as DeployDepositWalletError, bW as DeprecatedTransactionHandle, s as DownloadAccountingSnapshotError, bX as DownloadAccountingSnapshotRequest, t as DropNotificationsError, bY as DropNotificationsRequest, bZ as EquityPricesEventType, b_ as EquityPricesSubscription, b$ as Erc1155ApprovalForAllWorkflow, c0 as Erc1155ApprovalForAllWorkflowRequest, c1 as Erc20ApprovalWorkflow, c2 as Erc20ApprovalWorkflowRequest, c3 as Erc20TransferWorkflow, c4 as Erc20TransferWorkflowRequest, c5 as EstimateMarketBuyPriceRequest, u as EstimateMarketPriceError, c6 as EstimateMarketPriceRequest, c7 as EstimateMarketSellPriceRequest, c8 as EventForSubscriptionSpec, c9 as EventForSubscriptionSpecs, ca as FetchBalanceAllowanceError, cb as FetchBalanceAllowanceRequest, cc as FetchBuilderFeeRatesError, cd as FetchBuilderFeeRatesRequest, F as FetchClosedOnlyModeError, v as FetchCommentsByIdError, ce as FetchCommentsByIdRequest, w as FetchEventError, x as FetchEventLiveVolumeError, cf as FetchEventLiveVolumeRequest, cg as FetchEventRequest, y as FetchEventTagsError, ch as FetchEventTagsRequest, ci as FetchExecuteParamsError, cj as FetchExecuteParamsRequest, ck as FetchGaslessTransactionRequest, z as FetchLastTradePriceError, cl as FetchLastTradePriceRequest, G as FetchLastTradePricesError, cm as FetchLastTradePricesRequest, H as FetchMarketError, cn as FetchMarketInfoError, co as FetchMarketInfoRequest, cp as FetchMarketRequest, I as FetchMarketTagsError, cq as FetchMarketTagsRequest, J as FetchMidpointError, cr as FetchMidpointRequest, K as FetchMidpointsError, cs as FetchMidpointsRequest, ct as FetchNegRiskError, cu as FetchNegRiskRequest, L as FetchNotificationsError, M as FetchOrderBookError, cv as FetchOrderBookRequest, N as FetchOrderBooksError, cw as FetchOrderBooksRequest, O as FetchOrderError, cx as FetchOrderRequest, P as FetchOrderScoringError, cy as FetchOrderScoringRequest, Q as FetchOrdersScoringError, cz as FetchOrdersScoringRequest, R as FetchPortfolioValueError, cA as FetchPortfolioValueRequest, V as FetchPriceError, W as FetchPriceHistoryError, cB as FetchPriceHistoryRequest, cC as FetchPriceRequest, X as FetchPricesError, cD as FetchPricesRequest, Y as FetchPublicProfileError, cE as FetchPublicProfileRequest, Z as FetchRelatedTagResourcesError, cF as FetchRelatedTagResourcesRequest, _ as FetchRelatedTagsError, cG as FetchRelatedTagsRequest, $ as FetchRewardPercentagesError, a0 as FetchSeriesError, cH as FetchSeriesRequest, a1 as FetchSpreadError, cI as FetchSpreadRequest, a2 as FetchSpreadsError, cJ as FetchSpreadsRequest, a3 as FetchTagError, cK as FetchTagRequest, cL as FetchTickSizeError, cM as FetchTickSizeRequest, a4 as FetchTotalEarningsForUserForDayError, cN as FetchTotalEarningsForUserForDayRequest, a5 as FetchTradedMarketCountError, cO as FetchTradedMarketCountRequest, cP as GaslessTransactionMetadataSchema, cQ as GaslessWorkflow, cR as GaslessWorkflowRequest, cS as IsWalletDeployedError, cT as IsWalletDeployedRequest, a7 as ListAccountTradesError, cU as ListAccountTradesRequest, a8 as ListActivityError, cV as ListActivityRequest, a9 as ListBuilderLeaderboardError, cW as ListBuilderLeaderboardRequest, aa as ListBuilderTradesError, cX as ListBuilderTradesRequest, ab as ListBuilderVolumeError, cY as ListBuilderVolumeRequest, ac as ListClosedPositionsError, cZ as ListClosedPositionsRequest, ad as ListComboMarketsError, c_ as ListComboMarketsRequest, ae as ListComboPositionsError, c$ as ListComboPositionsRequest, af as ListCommentsByUserAddressError, d0 as ListCommentsByUserAddressRequest, ag as ListCommentsError, d1 as ListCommentsRequest, ah as ListCurrentRewardsError, d2 as ListCurrentRewardsRequest, ai as ListEventsError, d3 as ListEventsRequest, aj as ListMarketHoldersError, d4 as ListMarketHoldersRequest, ak as ListMarketPositionsError, d5 as ListMarketPositionsRequest, al as ListMarketRewardsError, d6 as ListMarketRewardsRequest, am as ListMarketsError, d7 as ListMarketsRequest, an as ListOpenInterestError, d8 as ListOpenInterestRequest, ao as ListOpenOrdersError, d9 as ListOpenOrdersRequest, ap as ListPositionsError, da as ListPositionsRequest, aq as ListSeriesError, db as ListSeriesRequest, ar as ListTagsError, dc as ListTagsRequest, as as ListTeamsError, dd as ListTeamsRequest, at as ListTraderLeaderboardError, de as ListTraderLeaderboardRequest, au as ListTradesError, df as ListTradesRequest, av as ListUserEarningsAndMarketsConfigError, dg as ListUserEarningsAndMarketsConfigRequest, aw as ListUserEarningsForDayError, dh as ListUserEarningsForDayRequest, di as MarketEventType, dj as MarketSubscription, dk as MergeComboPositionError, dl as MergeMarketPositionError, ax as MergePositionsError, dm as MergePositionsWorkflow, dn as MergePositionsWorkflowRequest, ay as OpenRfqSessionError, dp as OrderDraft, dq as OrderPostingWorkflow, dr as OrderWorkflow, ds as OrderWorkflowRequest, aC as PostOrderError, aD as PostOrdersError, dt as PostOrdersRequest, du as PrepareErc1155ApprovalForAllError, dv as PrepareErc1155ApprovalForAllRequest, dw as PrepareErc20ApprovalError, dx as PrepareErc20ApprovalRequest, dy as PrepareErc20TransferError, dz as PrepareErc20TransferRequest, dA as PrepareGaslessTransactionError, dB as PrepareGaslessTransactionRequest, dC as PrepareLimitOrderRequest, dD as PrepareMarketBuyOrderRequest, dE as PrepareMarketOrderRequest, dF as PrepareMarketSellOrderRequest, dG as PrepareMergeComboPositionError, dH as PrepareMergeComboPositionRequest, dI as PrepareMergeMarketPositionError, dJ as PrepareMergeMarketPositionRequest, dK as PrepareMergePositionsError, dL as PrepareMergePositionsRequest, dM as PrepareRedeemComboPositionError, dN as PrepareRedeemComboPositionRequest, dO as PrepareRedeemMarketPositionsByConditionIdRequest, dP as PrepareRedeemMarketPositionsByMarketIdRequest, dQ as PrepareRedeemMarketPositionsError, dR as PrepareRedeemMarketPositionsRequest, dS as PrepareRedeemPositionsError, dT as PrepareRedeemPositionsRequest, dU as PrepareSplitComboPositionError, dV as PrepareSplitComboPositionRequest, dW as PrepareSplitMarketPositionError, dX as PrepareSplitMarketPositionRequest, dY as PrepareSplitPositionError, dZ as PrepareSplitPositionRequest, d_ as PrepareTradingApprovalsError, d$ as PublicRealtimeEvent, e0 as PublicRealtimeTopic, e1 as PublicSubscriptionSpec, aL as RedeemPositionsError, e2 as RedeemPositionsWorkflow, e3 as RedeemPositionsWorkflowRequest, e4 as ResolveConditionByTokenError, e5 as ResolveConditionByTokenRequest, aO as RfqCancelQuoteAck, aP as RfqCancelQuoteError, aQ as RfqCancelQuoteRejectedError, aR as RfqCancelQuoteRejectedErrorOptions, aS as RfqConfirmationAck, aT as RfqConfirmationError, aU as RfqConfirmationRejectedError, e6 as RfqConfirmationRejectedErrorOptions, aV as RfqConfirmationRequestEvent, aW as RfqEvent, e7 as RfqExecutionUpdateEvent, aX as RfqQuoteError, aY as RfqQuoteReference, aZ as RfqQuoteRejectedError, a_ as RfqQuoteRejectedErrorOptions, a$ as RfqQuoteRequestEvent, b0 as RfqQuoteResponse, b1 as RfqQuoteSource, b2 as RfqSession, b3 as SearchError, e8 as SearchRequest, e9 as SearchResults, ea as SecureRealtimeEvent, eb as SecureRealtimeTopic, ec as SecureSubscriptionSpec, bl as SetupTradingApprovalsError, ed as SignedOrder, ee as SplitComboPositionError, ef as SplitMarketPositionError, bo as SplitPositionError, eg as SplitPositionWorkflow, eh as SplitPositionWorkflowRequest, ei as SportsEventType, ej as SportsSubscription, ek as SubscribeError, el as SubscriptionHandle, em as TradingApprovalsWorkflow, en as TradingApprovalsWorkflowRequest, bt as TransferErc20Error, eo as UpdateBalanceAllowanceError, ep as UpdateBalanceAllowanceRequest, eq as UserEventType, er as UserSubscription, es as WaitForGaslessTransactionError, et as approveErc1155ForAll, eu as approveErc20, ev as cancelAll, ew as cancelMarketOrders, ex as cancelOrder, ey as cancelOrders, ez as deployDepositWallet, eA as downloadAccountingSnapshot, eB as dropNotifications, eC as estimateMarketPrice, eD as fetchBalanceAllowance, eE as fetchBuilderFeeRates, eF as fetchBuilderVolume, eG as fetchClosedOnlyMode, eH as fetchCommentsById, eI as fetchEvent, eJ as fetchEventLiveVolume, eK as fetchEventTags, eL as fetchExecuteParams, eM as fetchLastTradePrice, eN as fetchLastTradePrices, eO as fetchMarket, eP as fetchMarketInfo, eQ as fetchMarketTags, eR as fetchMidpoint, eS as fetchMidpoints, eT as fetchNegRisk, eU as fetchNotifications, eV as fetchOrder, eW as fetchOrderBook, eX as fetchOrderBooks, eY as fetchOrderScoring, eZ as fetchOrdersScoring, e_ as fetchPortfolioValue, e$ as fetchPrice, f0 as fetchPriceHistory, f1 as fetchPrices, f2 as fetchPublicProfile, f3 as fetchRelatedTagResources, f4 as fetchRelatedTags, f5 as fetchRewardPercentages, f6 as fetchSeries, f7 as fetchSpread, f8 as fetchSpreads, f9 as fetchTag, fa as fetchTickSize, fb as fetchTotalEarningsForUserForDay, fc as fetchTradedMarketCount, fd as fetchTransaction, fe as isWalletDeployed, ff as listAccountTrades, fg as listActivity, fh as listBuilderLeaderboard, fi as listBuilderTrades, fj as listClosedPositions, fk as listComboMarkets, fl as listComboPositions, fm as listComments, fn as listCommentsByUserAddress, fo as listCurrentRewards, fp as listEvents, fq as listMarketHolders, fr as listMarketPositions, fs as listMarketRewards, ft as listMarkets, fu as listOpenInterest, fv as listOpenOrders, fw as listPositions, fx as listSeries, fy as listTags, fz as listTeams, fA as listTraderLeaderboard, fB as listTrades, fC as listUserEarningsAndMarketsConfig, fD as listUserEarningsForDay, fE as mergeComboPosition, fF as mergeMarketPosition, fG as mergePositions, fH as openRfqSession, fI as postOrder, fJ as postOrders, fK as prepareErc1155ApprovalForAll, fL as prepareErc20Approval, fM as prepareErc20Transfer, fN as prepareGaslessTransaction, fO as prepareMergeComboPosition, fP as prepareMergeMarketPosition, fQ as prepareMergePositions, fR as prepareRedeemComboPosition, fS as prepareRedeemMarketPositions, fT as prepareRedeemPositions, fU as prepareSplitComboPosition, fV as prepareSplitMarketPosition, fW as prepareSplitPosition, fX as prepareTradingApprovals, fY as redeemPositions, fZ as resolveConditionByToken, f_ as search, f$ as setupTradingApprovals, g0 as splitComboPosition, g1 as splitMarketPosition, g2 as splitPosition, g3 as subscribe, g4 as transferErc20, g5 as updateBalanceAllowance } from '../types-DLNcPNT6.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-
|
|
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-DNd7kOz2.js';
|
|
7
7
|
export { ComboPositionStatus } from '@polymarket/bindings/data';
|
|
8
8
|
export { CommentsEvent, CryptoPricesBinanceEvent, CryptoPricesChainlinkEvent, CryptoPricesEvent, CustomMarketEvent, EquityPricesEvent, MarketEvent, SportsEvent, StandardMarketEvent, UserEvent } from '@polymarket/bindings/subscriptions';
|
|
9
9
|
export { RfqConfirmationDecision, RfqConfirmationRequest, RfqDirection, RfqErrorCode, RfqExecutionStatus, RfqExecutionUpdate, RfqId, RfqQuoteId, RfqQuoteRequest, RfqRequestedSize, RfqRequestedSizeUnit, RfqRequestorPublicId, RfqSide } from '@polymarket/bindings/rfq';
|
package/dist/actions/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{Ya as ApproveErc1155ForAllError,Ua as ApproveErc20Error,
|
|
1
|
+
export{Ya as ApproveErc1155ForAllError,Ua as ApproveErc20Error,yc as CancelAllError,Ac as CancelMarketOrdersError,uc as CancelOrderError,wc as CancelOrdersError,md as ComboPositionStatus,E as CreateApiKeyError,O as CreateBuilderApiKeyError,Yc as CreateLimitOrderError,Uc as CreateMarketOrderError,I as CreateOrDeriveApiKeyError,M as DeleteApiKeyError,ea as DeployDepositWalletError,G as DeriveApiKeyError,kd as DownloadAccountingSnapshotError,ua as DropNotificationsError,Cc as EstimateMarketPriceError,K as FetchApiKeysError,wa as FetchBalanceAllowanceError,Q as FetchBuilderApiKeysError,qb as FetchBuilderFeeRatesError,ka as FetchClosedOnlyModeError,Qb as FetchCommentsByIdError,Wb as FetchEventError,_b as FetchEventLiveVolumeError,Yb as FetchEventTagsError,$ as FetchExecuteParamsError,Eb as FetchLastTradePriceError,Gb as FetchLastTradePricesError,kc as FetchMarketError,ob as FetchMarketInfoError,mc as FetchMarketTagsError,eb as FetchMidpointError,gb as FetchMidpointsError,kb as FetchNegRiskError,sa as FetchNotificationsError,wb as FetchOrderBookError,yb as FetchOrderBooksError,oa as FetchOrderError,Aa as FetchOrderScoringError,Ca as FetchOrdersScoringError,gd as FetchPortfolioValueError,sb as FetchPriceError,Ib as FetchPriceHistoryError,ub as FetchPricesError,Td as FetchPublicProfileError,ye as FetchRelatedTagResourcesError,we as FetchRelatedTagsError,Ka as FetchRewardPercentagesError,le as FetchSeriesError,pe as FetchSportsMarketTypesError,Ab as FetchSpreadError,Cb as FetchSpreadsError,ue as FetchTagError,ib as FetchTickSizeError,Ga as FetchTotalEarningsForUserForDayError,id as FetchTradedMarketCountError,da as GaslessTransactionMetadataSchema,ba as IsWalletDeployedError,qa as ListAccountTradesError,Oa as ListActivityError,ac as ListBuilderLeaderboardError,cb as ListBuilderTradesError,cc as ListBuilderVolumeError,cd as ListClosedPositionsError,ic as ListComboMarketsError,dd as ListComboPositionsError,Sb as ListCommentsByUserAddressError,Ob as ListCommentsError,Kb as ListCurrentRewardsError,Ub as ListEventsError,oc as ListMarketHoldersError,sc as ListMarketPositionsError,Mb as ListMarketRewardsError,gc as ListMarketsError,qc as ListOpenInterestError,ma as ListOpenOrdersError,ad as ListPositionsError,je as ListSeriesError,ne as ListSportsError,se as ListTagsError,Ae as ListTeamsError,ec as ListTraderLeaderboardError,Ma as ListTradesError,Ia as ListUserEarningsAndMarketsConfigError,Ea as ListUserEarningsForDayError,Kd as MergeComboPositionError,Jd as MergeMarketPositionError,Id as MergePositionsError,$d as OpenRfqSessionError,_c as PlaceLimitOrderError,Wc as PlaceMarketOrderError,Fc as PostOrderError,Gc as PostOrdersError,Wa as PrepareErc1155ApprovalForAllError,Sa as PrepareErc20ApprovalError,Ce as PrepareErc20TransferError,ha as PrepareGaslessTransactionError,Oc as PrepareLimitOrderError,Sc as PrepareLimitOrderPostingError,Mc as PrepareMarketOrderError,Qc as PrepareMarketOrderPostingError,sd as PrepareMergeComboPositionError,rd as PrepareMergeMarketPositionError,qd as PrepareMergePositionsError,vd as PrepareRedeemComboPositionError,ud as PrepareRedeemMarketPositionsError,td as PrepareRedeemPositionsError,pd as PrepareSplitComboPositionError,od as PrepareSplitMarketPositionError,nd as PrepareSplitPositionError,_a as PrepareTradingApprovalsError,Rd as RedeemPositionsError,mb as ResolveConditionByTokenError,S as RevokeBuilderApiKeyError,Yd as RfqCancelQuoteError,Xd as RfqCancelQuoteRejectedError,be as RfqConfirmationDecision,_d as RfqConfirmationError,Zd as RfqConfirmationRejectedError,ce as RfqDirection,de as RfqErrorCode,ee as RfqExecutionStatus,Wd as RfqQuoteError,Vd as RfqQuoteRejectedError,fe as RfqRequestedSizeUnit,ge as RfqSide,he as SearchError,ab as SetupTradingApprovalsError,Bd as SplitComboPositionError,Ad as SplitMarketPositionError,zd as SplitPositionError,Ee as TransferErc20Error,ya as UpdateBalanceAllowanceError,ja as WaitForGaslessTransactionError,Za as approveErc1155ForAll,Va as approveErc20,zc as cancelAll,Bc as cancelMarketOrders,vc as cancelOrder,xc as cancelOrders,F as createApiKey,P as createBuilderApiKey,Zc as createLimitOrder,Vc as createMarketOrder,J as createOrDeriveApiKey,N as deleteApiKey,fa as deployDepositWallet,H as deriveApiKey,ld as downloadAccountingSnapshot,va as dropNotifications,Dc as estimateMarketPrice,L as fetchApiKeys,xa as fetchBalanceAllowance,R as fetchBuilderApiKeys,rb as fetchBuilderFeeRates,dc as fetchBuilderVolume,la as fetchClosedOnlyMode,Rb as fetchCommentsById,Xb as fetchEvent,$b as fetchEventLiveVolume,Zb as fetchEventTags,aa as fetchExecuteParams,Fb as fetchLastTradePrice,Hb as fetchLastTradePrices,lc as fetchMarket,pb as fetchMarketInfo,nc as fetchMarketTags,fb as fetchMidpoint,hb as fetchMidpoints,lb as fetchNegRisk,ta as fetchNotifications,pa as fetchOrder,xb as fetchOrderBook,zb as fetchOrderBooks,Ba as fetchOrderScoring,Da as fetchOrdersScoring,hd as fetchPortfolioValue,tb as fetchPrice,Jb as fetchPriceHistory,vb as fetchPrices,Ud as fetchPublicProfile,ze as fetchRelatedTagResources,xe as fetchRelatedTags,La as fetchRewardPercentages,me as fetchSeries,qe as fetchSportsMarketTypes,Bb as fetchSpread,Db as fetchSpreads,ve as fetchTag,jb as fetchTickSize,Ha as fetchTotalEarningsForUserForDay,jd as fetchTradedMarketCount,ga as fetchTransaction,ca as isWalletDeployed,ra as listAccountTrades,Pa as listActivity,bc as listBuilderLeaderboard,db as listBuilderTrades,ed as listClosedPositions,jc as listComboMarkets,fd as listComboPositions,Pb as listComments,Tb as listCommentsByUserAddress,Lb as listCurrentRewards,Vb as listEvents,pc as listMarketHolders,tc as listMarketPositions,Nb as listMarketRewards,hc as listMarkets,rc as listOpenInterest,na as listOpenOrders,bd as listPositions,ke as listSeries,oe as listSports,te as listTags,Be as listTeams,fc as listTraderLeaderboard,Na as listTrades,Ja as listUserEarningsAndMarketsConfig,Fa as listUserEarningsForDay,Md as mergeComboPosition,Ld as mergeMarketPosition,Nd as mergePositions,ae as openRfqSession,$c as placeLimitOrder,Xc as placeMarketOrder,Hc as postOrder,Ic as postOrders,Xa as prepareErc1155ApprovalForAll,Ta as prepareErc20Approval,De as prepareErc20Transfer,ia as prepareGaslessTransaction,Pc as prepareLimitOrder,Tc as prepareLimitOrderPosting,Nc as prepareMarketOrder,Rc as prepareMarketOrderPosting,Gd as prepareMergeComboPosition,Fd as prepareMergeMarketPosition,Hd as prepareMergePositions,Pd as prepareRedeemComboPosition,Od as prepareRedeemMarketPositions,Qd as prepareRedeemPositions,xd as prepareSplitComboPosition,wd as prepareSplitMarketPosition,yd as prepareSplitPosition,$a as prepareTradingApprovals,Sd as redeemPositions,nb as resolveConditionByToken,Ec as resolveEstimatedMarketPrice,T as revokeBuilderApiKey,ie as search,bb as setupTradingApprovals,Lc as signOrder,Dd as splitComboPosition,Cd as splitMarketPosition,Ed as splitPosition,re as subscribe,Fe as transferErc20,za as updateBalanceAllowance}from'../chunk-2ZZDFOKL.js';import'../chunk-E2CLUN5M.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {k,e,d,j as j$1,c,b,a,f as f$1,g,h,i}from'./chunk-E2CLUN5M.js';import {PaginationCursorSchema,TransactionIdSchema,EvmAddressSchema,BuilderCodeSchema,TokenIdSchema,CtfConditionIdSchema,OrderSideSchema,CommentParentEntityTypeSchema,EventIdSchema,CommentIdSchema,IsoDateTimeStringSchema,IsoCalendarDateStringSchema,PositionIdSchema,OrderType,PositiveDecimalNumberSchema,OrderSide,ComboConditionIdSchema,MarketIdSchema,toComboConditionId,toPositionId,toPaginationCursor}from'@polymarket/bindings';import {AssetTypeSchema,PriceHistoryIntervalSchema,SignatureType,AssetType,ClosedOnlyModeSchema,OpenOrdersPageSchema,END_CURSOR,OpenOrderSchema,ClobTradesPageSchema,NotificationsResponseSchema,BalanceAllowanceResponseSchema,OrderScoringResponseSchema,OrdersScoringResponseSchema,UserEarningsPageSchema,TotalUserEarningsResponseSchema,UserRewardsEarningsPageSchema,RewardsPercentagesSchema,ApiKeyCredsSchema,ApiKeysResponseSchema,BuilderApiKeyCredsSchema,BuilderApiKeysResponseSchema,PaginatedBuilderTradesSchema,MidpointSchema,MidpointsSchema,FetchTickSizeResponseSchema,FetchNegRiskResponseSchema,ResolveConditionByTokenResponseSchema,FetchMarketInfoResponseSchema,FetchBuilderFeeRatesResponseSchema,PriceSchema,PricesSchema,FetchOrderBookResponseSchema,OrderBooksSchema,SpreadSchema,SpreadsSchema,LastTradePriceSchema,LastTradePricesSchema,PriceHistorySchema,PaginatedCurrentRewardsSchema,PaginatedMarketRewardsSchema,CancelOrdersResponseSchema,OrderResponseSchema,OrderResponsesSchema}from'@polymarket/bindings/clob';import {isHexString,expectNonEmptyArray,PolymarketError,isSameEvmAddress,never,unwrap,invariant,expectEvmAddress,delay,expectEvmSignature,expectHexString,ZERO_ADDRESS,expectErc1271Signature,isPresent,ok,err,ResultAsync}from'@polymarket/types';import {z as z$1}from'zod';import {WalletType,SeriesIdSchema,ListCommentsResponseSchema,ListEventsKeysetResponseSchema,EventSchema,FetchEventTagsResponseSchema,ListMarketsKeysetResponseSchema,FetchMarketTagsResponseSchema,MarketSchema,PublicProfileSchema,PublicSearchResponseSchema,ListSeriesResponseSchema,SeriesSchema,ListSportsMetadataResponseSchema,SportsMarketTypesResponseSchema,ListTagsResponseSchema,TagSchema,ListRelatedTagsResponseSchema,ListRelatedTagResourcesResponseSchema,ListTeamsResponseSchema}from'@polymarket/bindings/gamma';import {AbiFunction,Hash,Bytes,AbiParameters,TypedData,ContractAddress}from'ox';import Zr from'ky';import {SideSchema,ActivityTypeSchema,TimePeriodSchema,LeaderboardOrderBySchema,LeaderboardCategorySchema,ComboPositionStatusSchema,ListTradesResponseSchema,ListActivityResponseSchema,FetchEventLiveVolumeResponseSchema,ListBuilderLeaderboardResponseSchema,ListBuilderVolumeResponseSchema,ListTraderLeaderboardResponseSchema,ListMarketHoldersResponseSchema,ListOpenInterestResponseSchema,ListMarketPositionsResponseSchema,ListPositionsResponseSchema,ListClosedPositionsResponseSchema,ListComboPositionsResponseSchema,FetchPortfolioValueResponseSchema,TradedSchema}from'@polymarket/bindings/data';export{ComboPositionStatus as md}from'@polymarket/bindings/data';import {RelayerTransactionType,RelayerExecuteRequestSchema,RelayerTransactionState,RelayerExecuteParamsSchema,RelayerDeployedResponseSchema,GaslessTransactionSchema,RelayerExecuteResponseSchema}from'@polymarket/bindings/relayer';import {ListComboMarketsResponseSchema}from'@polymarket/bindings/rfq';export{RfqConfirmationDecision as be,RfqDirection as ce,RfqErrorCode as de,RfqExecutionStatus as ee,RfqRequestedSizeUnit as fe,RfqSide as ge}from'@polymarket/bindings/rfq';import Ud from'it-merge';function l(e,r){let t=r.safeParse(e);if(t.success)return t.data;throw a.fromZodError(t.error)}var I=z$1.number().int().positive(),Yr=z$1.object({offset:z$1.number().int().min(0),pageSize:I});function C(e,r,t=[]){function o(){return {async firstPage(){return {items:t,hasMore:false}},from(){return o()},async*[Symbol.asyncIterator](){}}}function n(c=r){return {firstPage(){return unwrap(e(c))},from(a){return a===void 0?o():n(a)},async*[Symbol.asyncIterator](){let a=c;for(;;){let y=await unwrap(e(a));if(yield y,!y.hasMore)return;a=y.nextCursor;}}}}return n()}function v(e){return toPaginationCursor(btoa(JSON.stringify(Yr.parse(e))))}function O(e,r){if(e===void 0)return {offset:0,pageSize:r};try{return Yr.parse(JSON.parse(atob(e)))}catch(t){throw new a("Invalid pagination cursor",{cause:t})}}function f(e){return function(t){return ResultAsync.fromPromise(t.json(),()=>new b(`Received non-JSON response from ${t.url}`)).andThen(o=>bn(t.url,e,o))}}function Qr(e){return ResultAsync.fromPromise(e.blob(),()=>new b(`Received unreadable binary response from ${e.url}`))}function bn(e,r,t){let o=r.safeParse(t);return o.success?ok(o.data):err(b.fromZodError(o.error,{endpoint:e}))}var Xr=class{#e;constructor({url:r}){this.#e=r;}async ethCall(r){let t=await this.#r({jsonrpc:"2.0",id:1,method:"eth_call",params:[{to:r.to,data:r.data},"latest"]});if("error"in t)throw new d(`JSON-RPC eth_call failed: ${t.error.message}`,{cause:t.error,status:200});if(typeof t.result!="string")throw new b("Expected JSON-RPC eth_call result to be a hex string");if(!nt(t.result))throw new b("Expected JSON-RPC eth_call result to be a hex string");return t.result}async ethCallBatch(r){if(r.length===0)return [];let t=await this.#t(r.map((n,c)=>({jsonrpc:"2.0",id:c+1,method:"eth_call",params:[{to:n.to,data:n.data},"latest"]}))),o=new Map;for(let n of t){if("error"in n&&n.id===null)throw new d(`JSON-RPC eth_call failed: ${n.error.message}`,{cause:n.error,status:200});n.id!==null&&o.set(n.id,n);}return r.map((n,c)=>{let a=c+1,y=o.get(a);if(y===void 0)throw new b("Expected JSON-RPC batch response for every request");if("error"in y)throw new d(`JSON-RPC eth_call failed: ${y.error.message}`,{cause:y.error,status:200});return In(y.result)})}async#r(r){let t;try{t=await Zr.post(this.#e,{json:r,throwHttpErrors:!1});}catch(n){throw c.fromError(n)}if(!t.ok)throw new d(`JSON-RPC request to ${this.#e} failed with status ${t.status}`,{status:t.status});let o;try{o=await t.json();}catch(n){throw new b("Expected JSON-RPC response body to be JSON",{cause:n})}if(!et(o))throw new b("Unexpected JSON-RPC response shape");return o}async#t(r){let t;try{t=await Zr.post(this.#e,{json:r,throwHttpErrors:!1});}catch(n){throw c.fromError(n)}if(!t.ok)throw new d(`JSON-RPC request to ${this.#e} failed with status ${t.status}`,{status:t.status});let o;try{o=await t.json();}catch(n){throw new b("Expected JSON-RPC response body to be JSON",{cause:n})}if(!Array.isArray(o)||!o.every(n=>et(n)))throw new b("Unexpected JSON-RPC response shape");return o}};function rt(e){if(!(e instanceof d)||!tt(e.cause))return false;let r=[e.cause.message,qn(e.cause.data)].join(" ").toLowerCase();return (e.cause.code===3||e.cause.code===-32e3||e.cause.code===-32003||e.cause.code===-32015||e.cause.code===-32603)&&(r.includes("execution reverted")||r.includes("revert")||r.includes("invalid opcode"))}function et(e){return !ot(e)||e.jsonrpc!=="2.0"?false:"error"in e?tt(e.error):"result"in e}function tt(e){return ot(e)&&typeof e.code=="number"&&typeof e.message=="string"}function ot(e){return typeof e=="object"&&e!==null}function nt(e){return /^0x[a-fA-F0-9]*$/.test(e)}function In(e){if(typeof e!="string"||!nt(e))throw new b("Expected JSON-RPC eth_call result to be a hex string");return e}function qn(e){if(e===void 0)return "";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return ""}}function Su(e,r,t){return {signer:r,wallet:t,walletType:Vn(e,r,t)}}function ee(e){switch(e){case WalletType.EOA:return SignatureType.EOA;case WalletType.POLY_PROXY:return SignatureType.POLY_PROXY;case WalletType.GNOSIS_SAFE:return SignatureType.POLY_GNOSIS_SAFE;case WalletType.DEPOSIT_WALLET:return SignatureType.POLY_1271}}function at(e){let r=ee(e.walletType);return {maker:e.wallet,signatureType:r,signer:r===SignatureType.POLY_1271?e.wallet:e.signer}}var vn="3d3d606380380380913d393d73%s5af4602a57600080fd5b602d8060366000396000f3363d3d373d3d3d363d73%s5af43d82803e903d91602b57fd5bf352e831dd00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000";function On(e){let r=vn.replace("%s",e.proxyFactory.slice(2).toLowerCase()).replace("%s",e.proxyImplementation.slice(2).toLowerCase());return expectHexString(Hash.keccak256(`0x${r}`))}function Ln(e,r){return expectEvmAddress(ContractAddress.fromCreate2({bytecodeHash:On(r),from:r.proxyFactory,salt:Hash.keccak256(AbiParameters.encodePacked(["address"],[e]))}))}function wn(e,r){return expectEvmAddress(ContractAddress.fromCreate2({bytecodeHash:r.safeInitCodeHash,from:r.safeFactory,salt:Hash.keccak256(AbiParameters.encode([{name:"address",type:"address"}],[e]))}))}var Mn="0xcc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3",Bn="0x5155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076",Fn=0x61003d3d8160233d3973n;function st(e,r){let t=expectHexString(`0x${e.slice(2).padStart(64,"0")}`),o=AbiParameters.encode([{type:"address"},{type:"bytes32"}],[r.depositWalletFactory,t]);return expectEvmAddress(ContractAddress.fromCreate2({bytecodeHash:Wn(r.depositWalletImplementation,o),from:r.depositWalletFactory,salt:Hash.keccak256(o)}))}var Un="0xb3582b35133d50545afa5036515af43d6000803e604d573d6000fd5b3d6000f3",zn="0x1b60e01b36527fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6c",Dn="0x60195155f3363d3d373d3d363d602036600436635c60da",jn=0x6100523d8160233d3973n,Hn="0x49493a4d";function it(e,r){let t=expectHexString(`0x${e.slice(2).padStart(64,"0")}`),o=AbiParameters.encode([{type:"address"},{type:"bytes32"}],[r.depositWalletFactory,t]);return expectEvmAddress(ContractAddress.fromCreate2({bytecodeHash:_n(r.depositWalletBeacon,o),from:r.depositWalletFactory,salt:Hash.keccak256(o)}))}function Wn(e,r){let t=BigInt((r.length-2)/2),o=Fn+(t<<56n);return expectHexString(Hash.keccak256(Bytes.concat(Bytes.fromNumber(o,{size:10}),Bytes.fromHex(e),Bytes.fromHex("0x6009"),Bytes.fromHex(Bn),Bytes.fromHex(Mn),Bytes.fromHex(r)),{as:"Hex"}))}function _n(e,r){let t=BigInt((r.length-2)/2),o=jn+(t<<56n);return expectHexString(Hash.keccak256(Bytes.concat(Bytes.fromNumber(o,{size:10}),Bytes.fromHex(e),Bytes.fromHex(Dn),Bytes.fromHex(zn),Bytes.fromHex(Un),Bytes.fromHex(r)),{as:"Hex"}))}async function Nn(e,r){try{let t=await e.ethCall({to:r,data:Hn});return $n(t)}catch(t){if(rt(t))return ZERO_ADDRESS;throw t}}async function Gn(e,r){let t=await Nn(e,r);return !isSameEvmAddress(t,ZERO_ADDRESS)}async function pt(e,r,t){return await Gn(e,t.depositWalletFactory)?it(r,t):st(r,t)}function $n(e){return e.length<66?ZERO_ADDRESS:expectEvmAddress(`0x${e.slice(-40)}`)}function Vn(e,r,t){if(isSameEvmAddress(t,r))return WalletType.EOA;let o=e.walletDerivation;if(isSameEvmAddress(t,it(r,o)))return WalletType.DEPOSIT_WALLET;if(isSameEvmAddress(t,st(r,o)))return WalletType.DEPOSIT_WALLET;if(isSameEvmAddress(t,wn(r,o)))return WalletType.GNOSIS_SAFE;if(isSameEvmAddress(t,Ln(r,o)))return WalletType.POLY_PROXY;never(`Wallet ${t} does not match the signer ${r} or any supported deterministic wallet address.`);}function R(e,r){if(Kn(r))return Yn(e,r.exceptions);let t=new URLSearchParams;for(let[o,n]of Object.entries(r)){let c=e[o];if(c!==void 0){if(ct(c)){for(let a of c)t.append(n,fe(a));continue}t.append(n,fe(c));}}return t}function S(e={}){return {format:"snake_case",exceptions:e}}function w(e){let r=new URLSearchParams;for(let[t,o]of Object.entries(e))if(o!==void 0){if(Array.isArray(o)){r.append(t,o.map(fe).join(","));continue}r.append(t,fe(o));}return r}function Kn(e){return "format"in e}function Yn(e,r){let t=new URLSearchParams;for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let c=r[o]??Jn(o);if(ct(n)){for(let a of n)t.append(c,fe(a));continue}t.append(c,fe(n));}return t}function ct(e){return Array.isArray(e)}function Jn(e){return e.replace(/[A-Z]/g,r=>`_${r.toLowerCase()}`)}function fe(e){return String(e)}var Lu=k(e,d,j$1,c,b);async function wu(e){return (await unwrap(e.secureClob.get("/auth/ban-status/closed-only").andThen(f(ClosedOnlyModeSchema)))).closedOnly}var ca=z$1.object({tokenId:z$1.string().optional(),cursor:PaginationCursorSchema.optional(),id:z$1.string().optional(),market:z$1.string().optional()}).default({}),Mu=k(e,d,j$1,c,b,a);function Bu(e,r){let{cursor:t,...o}=l(r,ca);return C(n=>e.secureClob.get("/data/orders",{params:R({...o,nextCursor:n},S({tokenId:"asset_id"}))}).andThen(f(OpenOrdersPageSchema)).map(c=>({items:c.data,hasMore:c.nextCursor!==END_CURSOR,nextCursor:c.nextCursor===END_CURSOR?void 0:toPaginationCursor(c.nextCursor),totalCount:c.count})),t)}var da=z$1.object({orderId:z$1.string()}),Fu=k(e,d,j$1,c,b,a);async function Uu(e,r){let t=l(r,da);return unwrap(e.secureClob.get(`/data/order/${t.orderId}`).andThen(f(OpenOrderSchema)))}var ua={after:z$1.string().optional(),tokenId:z$1.string().optional(),before:z$1.string().optional(),cursor:PaginationCursorSchema.optional(),id:z$1.string().optional(),makerAddress:z$1.string().optional(),market:z$1.string().optional()},ma=z$1.object(ua).default({}),zu=k(e,d,j$1,c,b,a);function Du(e,r){let{cursor:t,...o}=l(r,ma);return C(n=>e.secureClob.get("/data/trades",{params:R({...o,nextCursor:n},S({tokenId:"asset_id"}))}).andThen(f(ClobTradesPageSchema)).map(c=>({items:c.data,hasMore:c.nextCursor!==END_CURSOR,nextCursor:c.nextCursor===END_CURSOR?void 0:toPaginationCursor(c.nextCursor),totalCount:c.count})),t)}var ju=k(e,d,j$1,c,b),la=z$1.object({ids:z$1.array(z$1.string()).min(1)});async function Hu(e){let r=ee(e.account.walletType);return unwrap(e.secureClob.get("/notifications",{params:R({signatureType:r},S())}).andThen(f(NotificationsResponseSchema)))}var Wu=k(e,d,j$1,c,b,a);async function _u(e,r){let t=l(r,la),o=ee(e.account.walletType),n=R({ids:t.ids.join(","),signatureType:o},S());await unwrap(e.secureClob.del("/notifications",{params:n}));}var fa=z$1.object({assetType:AssetTypeSchema,tokenId:z$1.string().optional()}),Nu=k(e,d,j$1,c,b,a);async function sr(e,r){let t=l(r,fa),o=ee(e.account.walletType);return unwrap(e.secureClob.get("/balance-allowance",{params:R({...t,signatureType:o},S())}).andThen(f(BalanceAllowanceResponseSchema)))}var ya=z$1.object({assetType:AssetTypeSchema,tokenId:z$1.string().optional()}),Gu=k(e,d,j$1,c,b,a);async function ut(e,r){let t=l(r,ya),o=ee(e.account.walletType),n=R({...t,signatureType:o},S());return await unwrap(e.secureClob.get("/balance-allowance/update",{params:n})),sr(e,t)}var Ea=z$1.object({orderId:z$1.string()}),$u=k(e,d,j$1,c,b,a);async function Vu(e,r){let t=l(r,Ea);return (await unwrap(e.secureClob.get("/order-scoring",{params:R(t,S())}).andThen(f(OrderScoringResponseSchema)))).scoring}var ga=z$1.object({orderIds:z$1.array(z$1.string())}),Ku=k(e,d,j$1,c,b,a);async function Yu(e,r){let o=l(r,ga).orderIds;return unwrap(e.secureClob.post("/orders-scoring",{json:o}).andThen(f(OrdersScoringResponseSchema)))}var mt=z$1.object({cursor:PaginationCursorSchema.optional(),date:z$1.string()}),Ju=k(e,d,j$1,c,b,a);function Qu(e,r){let{cursor:t,...o}=l(r,mt),n=ee(e.account.walletType);return C(c=>e.secureClob.get("/rewards/user",{params:R({...o,nextCursor:c,signatureType:n},S())}).andThen(f(UserEarningsPageSchema)).map(a=>({items:a.data,hasMore:a.nextCursor!==END_CURSOR,nextCursor:a.nextCursor===END_CURSOR?void 0:toPaginationCursor(a.nextCursor),totalCount:a.count})),t)}var Zu=k(e,d,j$1,c,b,a);async function Xu(e,r){let t=l(r,mt),o=ee(e.account.walletType);return unwrap(e.secureClob.get("/rewards/user/total",{params:R({...t,signatureType:o},S())}).andThen(f(TotalUserEarningsResponseSchema)))}var Ra=z$1.object({cursor:PaginationCursorSchema.optional(),date:z$1.string(),noCompetition:z$1.boolean().optional(),orderBy:z$1.string().optional(),pageSize:I.max(500).default(100),position:z$1.string().optional()}),em=k(e,d,j$1,c,b,a);function rm(e,r){let{cursor:t,...o}=l(r,Ra),n=ee(e.account.walletType);return C(c=>e.secureClob.get("/rewards/user/markets",{params:R({...o,nextCursor:c,signatureType:n},S())}).andThen(f(UserRewardsEarningsPageSchema)).map(a=>({items:a.data,hasMore:a.nextCursor!==END_CURSOR,nextCursor:a.nextCursor===END_CURSOR?void 0:toPaginationCursor(a.nextCursor),totalCount:a.count})),t)}var tm=k(e,d,j$1,c,b);async function om(e){let r=ee(e.account.walletType);return unwrap(e.secureClob.get("/rewards/user/percentages",{params:R({signatureType:r},S())}).andThen(f(RewardsPercentagesSchema)))}var Ta=z$1.enum(["TIMESTAMP","TOKENS","CASH"]),Pa=z$1.enum(["ASC","DESC"]),Ca=z$1.enum(["CASH","TOKENS"]),ka=z$1.object({cursor:PaginationCursorSchema.optional(),pageSize:I.default(20),takerOnly:z$1.boolean().optional(),filterType:Ca.optional(),filterAmount:z$1.number().optional(),market:z$1.array(z$1.string()).optional(),eventId:z$1.array(z$1.number().int()).optional(),user:z$1.string().optional(),side:SideSchema.optional()}).refine(e=>!(e.market&&e.eventId),{message:"Provide market or eventId, not both",path:["eventId"]}).refine(e=>e.filterType===void 0==(e.filterAmount===void 0),{message:"Provide filterType and filterAmount together",path:["filterAmount"]}),ba=z$1.object({cursor:PaginationCursorSchema.optional(),pageSize:I.default(20),user:z$1.string(),market:z$1.array(z$1.string()).optional(),eventId:z$1.array(z$1.number().int()).optional(),type:z$1.array(ActivityTypeSchema).optional(),start:z$1.number().int().optional(),end:z$1.number().int().optional(),sortBy:Ta.optional(),sortDirection:Pa.optional(),side:SideSchema.optional()}).refine(e=>!(e.market&&e.eventId),{message:"Provide market or eventId, not both",path:["eventId"]}),lm=k(e,d,c,b,a);function fm(e,r={}){let{cursor:t,pageSize:o,...n}=l(r,ka);return C(c=>{let a=O(c,o);return e.data.get("/trades",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListTradesResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var ym=k(e,d,c,b,a);function Em(e,r){let{cursor:t,pageSize:o,...n}=l(r,ba);return C(c=>{let a=O(c,o);return e.data.get("/activity",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListActivityResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var qa=64,Aa=/^0x[0-9a-fA-F]{62}$/,va=/^0x[0-9a-fA-F]{64}$/,ir="0x0000000000000000000000000000000000000000000000000000000000000000",Oa=AbiFunction.from("function approve(address spender, uint256 amount)"),Et=AbiFunction.from("function allowance(address owner, address spender) view returns (uint256)"),La=AbiFunction.from("function transfer(address recipient, uint256 amount)"),wa=AbiFunction.from("function setApprovalForAll(address operator, bool approved)"),gt=AbiFunction.from("function isApprovedForAll(address account, address operator) view returns (bool)"),Rt=AbiFunction.from("function balanceOf(address account, uint256 id) view returns (uint256)"),St=AbiFunction.from("function balanceOfBatch(address[] accounts, uint256[] ids) view returns (uint256[])"),Ma=AbiFunction.from("function splitPosition(address collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] partition, uint256 amount)"),Ba=AbiFunction.from("function mergePositions(address collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] partition, uint256 amount)"),Fa=AbiFunction.from("function redeemPositions(address collateralToken, bytes32 parentCollectionId, bytes32 conditionId, uint256[] indexSets)"),Ua=AbiFunction.from("function split(bytes31 conditionId, uint256 amount)"),za=AbiFunction.from("function merge(bytes31 conditionId, uint256 amount)"),Da=AbiFunction.from("function redeem(bytes31 conditionId, uint256 outcomeIndex, uint256 amount)"),ja=AbiFunction.from("function prepareCondition(uint256[] legs) returns (bytes31)"),Ha=AbiFunction.from("function multiSend(bytes)"),Wa=AbiFunction.from("function proxy((uint8 typeCode, address to, uint256 value, bytes data)[] calls) returns (bytes[])"),ht=[1n,2n],_a=[1n,2n],$=(1n<<256n)-1n,xm=k(a);function He(e,r,t){if(t<0n)throw new a("Approval amount must be non-negative");if(t>$)throw new a("Approval amount exceeds uint256 range");return {data:Na(r,t),to:e}}function xt(e,r,t){return {data:AbiFunction.encodeData(Et,[r,t]),to:e}}function Tt(e){return AbiFunction.decodeResult(Et,e)}function We(e,r,t){return {data:Ga(r,t),to:e}}function Pt(e,r,t){return {data:AbiFunction.encodeData(gt,[r,t]),to:e}}function Ct(e){return AbiFunction.decodeResult(gt,e)}function kt(e,r,t){return {data:AbiFunction.encodeData(Rt,[r,ie(BigInt(t),"Position ID")]),to:e}}function bt(e){return AbiFunction.decodeResult(Rt,e)}function pr(e,r,t){return {data:AbiFunction.encodeData(St,[t.map(()=>r),t.map(o=>ie(BigInt(o),"id"))]),to:e}}function cr(e){return AbiFunction.decodeResult(St,e)}var Tm=k(a);function dr(e,r,t){if(t<0n)throw new a("Transfer amount must be non-negative");if(t>$)throw new a("Transfer amount exceeds uint256 range");return {data:$a(r,t),to:e}}var Pm=k(a),Cm=k(a);function It(e,r,t,o){return {data:Va(r,t,o),to:e}}var km=k(a);function qt(e,r,t,o){return {data:Ka(r,t,o),to:e}}function At(e,r,t){return {data:Ya(r,t),to:e}}var bm=k(a);function vt(e,r,t){return {data:AbiFunction.encodeData(Ua,[mr(r),ie(t,"Split amount")]),to:e}}var Im=k(a);function Ot(e,r,t){return {data:AbiFunction.encodeData(za,[mr(r),ie(t,"Merge amount")]),to:e}}var qm=k(a);function Lt(e,r,t,o){return {data:AbiFunction.encodeData(Da,[mr(r),BigInt(Ja(t)),ie(o,"Redeem amount")]),to:e}}var Am=k(a);function ur(e,r){return {data:AbiFunction.encodeData(ja,[r.map(t=>ie(t,"Leg position ID"))]),to:e}}function Na(e,r){return invariant(r>=0n,"Approval amount must be non-negative"),AbiFunction.encodeData(Oa,[e,r])}function Ga(e,r){return AbiFunction.encodeData(wa,[e,r])}function $a(e,r){return AbiFunction.encodeData(La,[e,r])}function Va(e,r,t){return AbiFunction.encodeData(Ma,[e,ir,r,ht,ie(t,"Split amount")])}function Ka(e,r,t){return AbiFunction.encodeData(Ba,[e,ir,r,ht,ie(t,"Merge amount")])}function Ya(e,r){return AbiFunction.encodeData(Fa,[e,ir,r,_a])}function ie(e,r){if(e<0n)throw new a(`${r} must be non-negative`);if(e>$)throw new a(`${r} exceeds uint256 range`);return e}function mr(e){if(Aa.test(e))return e.toLowerCase();if(va.test(e)){let r=e.toLowerCase();if(r.endsWith("00")||r.endsWith("01"))return r.slice(0,qa)}throw new a("Protocol v2 condition ID must be bytes31, or bytes32 with a binary outcome byte")}function Ja(e){if(e!==0&&e!==1)throw new a("Protocol v2 outcome index must be 0 or 1");return e}function wt(e){return AbiFunction.encodeData(Wa,[e.map(r=>({typeCode:1,to:r.to,value:r.value??0n,data:r.data}))])}function Mt(e){let r=e.map(t=>Qa(t));return AbiFunction.encodeData(Ha,[r.length===0?"0x":AbiParameters.encodePacked(Array.from({length:r.length},()=>"bytes"),r)])}function Qa(e){let r=e.value??0n;return AbiParameters.encodePacked(["uint8","address","uint256","uint256","bytes"],[0,e.to,r,BigInt((e.data.length-2)/2),e.data])}var wm=k(e,d,f$1,g,c,b,a);function z(e,r="Expected a TransactionHandle"){return invariant(typeof e=="object"&&e!==null&&"transactionHash"in e&&"transactionId"in e&&"wait"in e&&typeof e.wait=="function",r),e}k(h,j$1);k(h,j$1);function zm(e){return async function(t){let o=await t.next();for(;!o.done;)try{switch(o.value.kind){case "requestAddress":o=await t.next(await e.getAddress());break;case "signAuthMessage":o=await t.next(await e.signTypedData(o.value.payload));break}}catch(n){o=await t.throw(n);}return o.value}}function F(e){return async function(t){let o=await t.next();for(;!o.done;)try{switch(o.value.kind){case "requestAddress":o=await t.next(await e.getAddress());break;case "signGaslessTypedData":case "signOrder":o=await t.next(await e.signTypedData(o.value.payload));break;case "signGaslessMessage":o=await t.next(await e.signMessage(o.value.payload));break;case "sendErc20ApprovalTransaction":case "sendErc1155ApprovalForAllTransaction":case "sendErc20TransferTransaction":case "sendMergePositionsTransaction":case "sendRedeemPositionsTransaction":case "sendSplitPositionTransaction":o=await t.next(await e.sendTransaction(o.value.request));break}}catch(n){o=await t.throw(n);}return o.value}}function Bt(){return {kind:"requestAddress"}}function D(e,r){return {chainId:e,...r}}var ds=[{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],us=[{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"operation",type:"uint8"},{name:"safeTxGas",type:"uint256"},{name:"baseGas",type:"uint256"},{name:"gasPrice",type:"uint256"},{name:"gasToken",type:"address"},{name:"refundReceiver",type:"address"},{name:"nonce",type:"uint256"}],ms="DepositWallet",ls="1",fs=600,ys=[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}],Es=[{name:"wallet",type:"address"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"},{name:"calls",type:"Call[]"}],gs=z$1.object({address:z$1.string(),type:z$1.enum(RelayerTransactionType)}),Xm=k(e,d,c,b,a);async function Er(e,r){let t=l(r,gs);return unwrap(e.relayer.get("/v1/account/transactions/params",{params:R(t,{address:"address",type:"type"})}).andThen(f(RelayerExecuteParamsSchema)))}var Rs=z$1.object({transactionId:TransactionIdSchema}),Ss=z$1.object({wallet:EvmAddressSchema,type:z$1.enum(WalletType)}),el=k(e,d,c,b,a);async function rl(e,r){let t=await hs(e,r);return t.type===WalletType.EOA?false:unwrap(e.relayer.get("/deployed",{params:R({address:t.wallet,type:t.type===WalletType.DEPOSIT_WALLET?RelayerTransactionType.WALLET:void 0},{address:"address",type:"type"})}).andThen(f(RelayerDeployedResponseSchema)).map(({deployed:o})=>o))}async function hs(e,r){if(r!==void 0)return l(r,Ss);if(!e.isSecureClient())throw new a("Gasless readiness inference requires a secure client. Pass a wallet and type when using a public client.");return e.account.walletType!==WalletType.EOA?{wallet:e.account.wallet,type:e.account.walletType}:{wallet:await pt(e.rpc,e.account.signer,e.environment.walletDerivation),type:WalletType.DEPOSIT_WALLET}}var j=z$1.string().max(500),Ft=10,tl=k(e,d,c,b,a);async function ol(e){return invariant(e.supportsGasless,"Deposit Wallet deployment requires a Relayer API Key or Builder API Key in the client configuration."),Ge(e,{from:e.account.signer,metadata:"Deploy Deposit Wallet",to:e.environment.walletDerivation.depositWalletFactory,type:RelayerTransactionType.WALLET_CREATE})}async function xs(e,r){let t=l(r,Rs);return unwrap(e.relayer.get(`/v1/account/transactions/${t.transactionId}`).andThen(f(GaslessTransactionSchema)))}var Ts=z$1.object({data:z$1.custom(isHexString),to:EvmAddressSchema,value:z$1.bigint().optional()}),Ps=z$1.object({calls:z$1.array(Ts).min(1).transform(e=>expectNonEmptyArray(e)),metadata:j}),nl=k(e,d,c,b,a);async function G(e,r){let t=l(r,Ps);return invariant(e.supportsGasless,"Gasless transactions require a Relayer API Key or Builder API Key in the client configuration."),invariant(e.account.walletType===WalletType.GNOSIS_SAFE||e.account.walletType===WalletType.POLY_PROXY||e.account.walletType===WalletType.DEPOSIT_WALLET,"Gasless transaction preparation supports Deposit Wallet, Safe-backed, and proxy-backed accounts"),async function*(){let o=expectEvmAddress(yield Bt());invariant(o===e.account.signer,"Wallet client address does not match the authenticated signer");for(let n=0;n<=Ft;n+=1)try{switch(e.account.walletType){case WalletType.POLY_PROXY:return yield*Cs(e,t);case WalletType.DEPOSIT_WALLET:return yield*ks(e,t);case WalletType.GNOSIS_SAFE:return yield*bs(e,t)}invariant(!1,"Unsupported wallet type for gasless transaction");}catch(c){if(!Is(c)||n===Ft)throw c;await delay(e.environment.relayerPollFrequencyMs);}invariant(false,"Expected gasless transaction retry loop to return");}.call(null)}async function*Cs(e,r){let t=await Er(e,{address:e.account.signer,type:RelayerTransactionType.PROXY}),o=e.environment.walletDerivation.proxyFactory,n=wt(r.calls),c="0",a="0",y="10000000",x=e.environment.relayHub,qe=ZERO_ADDRESS,xn=Ms(e.account.signer,o,n,c,a,y,t.nonce,x,qe),Tn=expectEvmSignature(yield Dt(xn));return Ge(e,{data:n,from:e.account.signer,metadata:r.metadata,nonce:t.nonce,proxyWallet:e.account.wallet,signature:Tn,signatureParams:{gasLimit:y,gasPrice:a,relay:qe,relayHub:x,relayerFee:c},to:o,type:RelayerTransactionType.PROXY})}async function*ks(e,r){let t=await Er(e,{address:e.account.signer,type:RelayerTransactionType.WALLET}),o=r.calls.map(qs),n=`${Math.floor(Date.now()/1e3)+fs}`,c=expectEvmSignature(yield ws(As({calls:o,chainId:e.environment.chainId,deadline:n,nonce:t.nonce,wallet:e.account.wallet}))),a={depositWalletParams:{calls:o,deadline:n,depositWallet:e.account.wallet},from:e.account.signer,metadata:r.metadata,nonce:t.nonce,signature:c,to:e.environment.walletDerivation.depositWalletFactory,type:RelayerTransactionType.WALLET};return Ge(e,a)}async function*bs(e,r){let t=await Er(e,{address:e.account.signer,type:RelayerTransactionType.SAFE}),o=vs(r.calls,e.environment.safeMultisend),n=Ls({chainId:e.environment.chainId,data:o.data,nonce:t.nonce,operation:o.operation,safeAddress:e.account.wallet,to:o.to,value:o.value}),c=expectEvmSignature(yield Dt(expectHexString(TypedData.getSignPayload(n))));return Ge(e,{data:o.data,from:e.account.signer,metadata:r.metadata,nonce:t.nonce,proxyWallet:e.account.wallet,signature:Bs(c),signatureParams:Os(o.operation),to:o.to,type:RelayerTransactionType.SAFE,value:o.value>0n?`${o.value}`:void 0})}async function Ge(e,r){let t=l(r,RelayerExecuteRequestSchema),o=await unwrap(e.relayer.post("/submit",{json:t}).andThen(f(RelayerExecuteResponseSchema)));return new lr(e,o)}function Is(e$1){if(e$1 instanceof e)return true;if(!(e$1 instanceof d)||e$1.status!==400)return false;if(/wallet busy/i.test(e$1.message)&&/active action/i.test(e$1.message)||/wallet has in-flight action/i.test(e$1.message))return true;let r=/batch nonce\s+(\d+)\s+does not match on-chain nonce\s+(\d+)/i.exec(e$1.message);if(r===null)return false;let t=r[1],o=r[2];return t===void 0||o===void 0?false:BigInt(t)<BigInt(o)}function qs(e){return {data:e.data,target:e.to,value:`${e.value??0n}`}}function As(e){return {domain:{chainId:e.chainId,name:ms,verifyingContract:e.wallet,version:ls},message:{calls:e.calls.map(r=>({data:r.data,target:r.target,value:BigInt(r.value)})),deadline:BigInt(e.deadline),nonce:BigInt(e.nonce),wallet:e.wallet},primaryType:"Batch",types:{Batch:Es,Call:ys}}}function vs(e,r){if(e.length===1){let[t]=e;return {data:t.data,operation:0,to:t.to,value:t.value??0n}}return {data:Mt(e),operation:1,to:r,value:0n}}function Os(e){return {baseGas:"0",gasPrice:"0",gasToken:ZERO_ADDRESS,operation:`${e}`,refundReceiver:ZERO_ADDRESS,safeTxnGas:"0"}}function Ls(e){return {domain:{chainId:e.chainId,verifyingContract:e.safeAddress},message:{baseGas:0n,data:e.data,gasPrice:0n,gasToken:ZERO_ADDRESS,nonce:BigInt(e.nonce),operation:e.operation,refundReceiver:ZERO_ADDRESS,safeTxGas:0n,to:e.to,value:e.value},primaryType:"SafeTx",types:{EIP712Domain:ds,SafeTx:us}}}function Dt(e){return {kind:"signGaslessMessage",payload:e}}function ws(e){return {kind:"signGaslessTypedData",payload:e}}function Ms(e,r,t,o,n,c,a,y,x){return expectHexString(Hash.keccak256(Bytes.concat(Bytes.fromString("rlx:"),Bytes.fromHex(e),Bytes.fromHex(r),Bytes.fromHex(t),Bytes.fromNumber(BigInt(o),{size:32}),Bytes.fromNumber(BigInt(n),{size:32}),Bytes.fromNumber(BigInt(c),{size:32}),Bytes.fromNumber(BigInt(a),{size:32}),Bytes.fromHex(y),Bytes.fromHex(x)),{as:"Hex"}))}function Bs(e){let r=e.slice(2),t=Number.parseInt(r.slice(128,130),16),o=t===0||t===1?t+31:t===27||t===28?t+4:t;return expectHexString(`0x${r.slice(0,128)}${o.toString(16).padStart(2,"0")}`)}var al=k(e,d,c,b,a,f$1,g),lr=class{#e;transactionHash;transactionId;constructor(r,t){this.#e=r,this.transactionHash=t.transactionHash,this.transactionId=t.transactionId;}async wait(){let r=0;for(;r<this.#e.environment.relayerMaxPolls;){let t=await xs(this.#e,{transactionId:this.transactionId});if(t.state===RelayerTransactionState.STATE_MINED||t.state===RelayerTransactionState.STATE_CONFIRMED){let o=t.transactionHash??this.transactionHash;if(o===null)throw new b("Expected submitted transaction to have a transaction hash once settled");return {transactionHash:o,transactionId:t.transactionId}}if(t.state===RelayerTransactionState.STATE_FAILED||t.state===RelayerTransactionState.STATE_INVALID)throw new g(t.errorMsg??`Transaction ${t.transactionId} reached terminal state ${t.state}`);r+=1,await delay(this.#e.environment.relayerPollFrequencyMs);}throw new f$1(`Timed out waiting for transaction ${this.transactionId} to settle`)}};var Fs=z$1.object({amount:z$1.union([z$1.bigint(),z$1.literal("max")]),metadata:j.optional(),spenderAddress:EvmAddressSchema,tokenAddress:EvmAddressSchema}),El=k(a);async function Us(e,r){let t=l(r,Fs),o=t.amount==="max"?$:t.amount;return async function*(){return e.account.walletType===WalletType.EOA?z(yield Wt(D(e.environment.chainId,He(t.tokenAddress,t.spenderAddress,o)))):yield*await G(e,{calls:[He(t.tokenAddress,t.spenderAddress,o)],metadata:t.metadata??`Approve ${t.amount} of ${t.tokenAddress} to ${t.spenderAddress}`})}.call(null)}var gl=k(h,e,d,j$1,c,b,a);function jt(e,r){return Us(e,r).then(F(e.signer))}var zs=z$1.object({approved:z$1.boolean().default(true),metadata:j.optional(),operatorAddress:EvmAddressSchema,tokenAddress:EvmAddressSchema}),Rl=k(a);async function Ds(e,r){let t=l(r,zs);return async function*(){return e.account.walletType===WalletType.EOA?z(yield _t(D(e.environment.chainId,We(t.tokenAddress,t.operatorAddress,t.approved)))):yield*await G(e,{calls:[We(t.tokenAddress,t.operatorAddress,t.approved)],metadata:t.metadata??`${t.approved?"Approve":"Revoke"} ${t.operatorAddress} on ${t.tokenAddress}`})}.call(null)}var Sl=k(h,e,d,j$1,c,b,a);function Ht(e,r){return Ds(e,r).then(F(e.signer))}var hl=k(d,c,b,a);async function js(e){let r=await Ws(e),t=r.erc20.map(n=>He(n.tokenAddress,n.spenderAddress,n.amount)),o=r.erc1155.map(n=>We(n.tokenAddress,n.operatorAddress,true));return async function*(){if(t.length===0&&o.length===0)return;if(e.account.walletType===WalletType.EOA){for(let c of t)await z(yield Wt(D(e.environment.chainId,c))).wait();for(let c of o)await z(yield _t(D(e.environment.chainId,c))).wait();return}await(yield*await G(e,{calls:[...t,...o],metadata:"Trading setup approvals"})).wait();}.call(null)}var xl=k(h,e,d,j$1,f$1,g,c,b,a);function Tl(e){return js(e).then(F(e.signer)).then(Hs)}function Hs(){return {transactionHash:null,transactionId:null,wait:async()=>{}}}async function Ws(e){let r=_s(e),t=[...r.erc20.map(a=>xt(a.tokenAddress,e.account.wallet,a.spenderAddress)),...r.erc1155.map(a=>Pt(a.tokenAddress,e.account.wallet,a.operatorAddress))],o=await e.rpc.ethCallBatch(t),n=o.slice(0,r.erc20.length),c=o.slice(r.erc20.length);return {erc20:r.erc20.filter((a,y)=>Tt(n[y])<a.amount),erc1155:r.erc1155.filter((a,y)=>!Ct(c[y]))}}function _s(e){return {erc20:[{amount:$,spenderAddress:e.environment.standardExchange,tokenAddress:e.environment.collateralToken},{amount:$,spenderAddress:e.environment.negRiskExchange,tokenAddress:e.environment.collateralToken},{amount:$,spenderAddress:e.environment.negRiskAdapter,tokenAddress:e.environment.collateralToken},{amount:$,spenderAddress:e.environment.collateralAdapter,tokenAddress:e.environment.collateralToken},{amount:$,spenderAddress:e.environment.negRiskCollateralAdapter,tokenAddress:e.environment.collateralToken},{amount:$,spenderAddress:e.environment.protocolV2Router,tokenAddress:e.environment.collateralToken},{amount:$,spenderAddress:e.environment.exchangeV3,tokenAddress:e.environment.collateralToken}],erc1155:[{operatorAddress:e.environment.standardExchange,tokenAddress:e.environment.conditionalTokens},{operatorAddress:e.environment.negRiskExchange,tokenAddress:e.environment.conditionalTokens},{operatorAddress:e.environment.negRiskAdapter,tokenAddress:e.environment.conditionalTokens},{operatorAddress:e.environment.collateralAdapter,tokenAddress:e.environment.conditionalTokens},{operatorAddress:e.environment.negRiskCollateralAdapter,tokenAddress:e.environment.conditionalTokens},{operatorAddress:e.environment.autoRedeemOperator,tokenAddress:e.environment.conditionalTokens},{operatorAddress:e.environment.protocolV2Router,tokenAddress:e.environment.positionManager},{operatorAddress:e.environment.exchangeV3,tokenAddress:e.environment.positionManager},{operatorAddress:e.environment.autoRedeemOperator,tokenAddress:e.environment.positionManager}]}}function Wt(e){return {kind:"sendErc20ApprovalTransaction",request:e}}function _t(e){return {kind:"sendErc1155ApprovalForAllTransaction",request:e}}var Al=k(e,d,c,b);async function Vs(e,r){return unwrap(e.clob.post("/auth/api-key",{headers:$t(r)}).andThen(f(ApiKeyCredsSchema)))}var vl=k(e,d,c,b);async function Ks(e,r){return unwrap(e.clob.get("/auth/derive-api-key",{headers:$t(r)}).andThen(f(ApiKeyCredsSchema)))}var Ol=k(e,d,c,b);async function Ll(e,r){try{return await Vs(e,r)}catch(t){if(!(t instanceof d)||t.status!==400)throw t}return Ks(e,r)}var wl=k(e,d,j$1,c,b);async function Ml(e){return (await unwrap(e.secureClob.get("/auth/api-keys").andThen(f(ApiKeysResponseSchema)))).apiKeys}var Bl=k(e,d,j$1,c,b);async function Fl(e){await unwrap(e.secureClob.del("/auth/api-key").andThen(f(z$1.literal("OK"))));}var Ul=k(e,d,j$1,c,b);async function zl(e){return unwrap(e.secureClob.post("/auth/builder-api-key").andThen(f(BuilderApiKeyCredsSchema)))}var Dl=k(e,d,j$1,c,b);async function jl(e){return unwrap(e.secureClob.get("/auth/builder-api-key").andThen(f(BuilderApiKeysResponseSchema)))}var Hl=k(e,d,j$1,c,b);async function Wl(e){await unwrap(e.clob.del("/auth/builder-api-key").andThen(f(z$1.literal("OK"))));}function $t(e){return {POLY_ADDRESS:e.address,POLY_NONCE:`${e.nonce}`,POLY_SIGNATURE:e.signature,POLY_TIMESTAMP:`${e.timestamp}`}}var Xs=z$1.object({after:z$1.string().optional(),before:z$1.string().optional(),builderCode:BuilderCodeSchema,cursor:PaginationCursorSchema.optional(),id:z$1.string().optional(),market:z$1.string().optional(),tokenId:z$1.string().optional()}),Zl=k(e,d,c,b,a);function Xl(e,r){let{cursor:t,...o}=l(r,Xs);return C(n=>e.clob.get("/builder/trades",{params:R({...o,nextCursor:n},S({builderCode:"builder_code",tokenId:"asset_id"}))}).andThen(f(PaginatedBuilderTradesSchema)).map(c=>({items:c.data,hasMore:c.nextCursor!==END_CURSOR,nextCursor:c.nextCursor===END_CURSOR?void 0:toPaginationCursor(c.nextCursor),totalCount:c.count})),t)}var xi=z$1.object({tokenId:z$1.string()}),uf=k(e,d,c,b,a);async function mf(e,r){let t=l(r,xi);return (await unwrap(e.clob.get("/midpoint",{params:R(t,S())}).andThen(f(MidpointSchema)))).mid}var Ti=z$1.array(z$1.object({tokenId:z$1.string()})).min(1),lf=k(e,d,c,b,a);async function ff(e,r){let t=l(r,Ti);return unwrap(e.clob.post("midpoints",{json:Ke(t)}).andThen(f(MidpointsSchema)))}var Pi=z$1.object({tokenId:z$1.string()}),yf=k(e,d,c,b,a);async function Re(e,r){let t=l(r,Pi);return (await unwrap(e.clob.get("/tick-size",{params:R(t,S())}).andThen(f(FetchTickSizeResponseSchema)))).minimumTickSize}var Ci=z$1.object({tokenId:z$1.string()}),Ef=k(e,d,c,b,a);async function Se(e,r){let t=l(r,Ci);return (await unwrap(e.clob.get("/neg-risk",{params:R(t,S())}).andThen(f(FetchNegRiskResponseSchema)))).negRisk}var ki=z$1.object({tokenId:TokenIdSchema}),gf=k(e,d,c,b,a);async function Zt(e,r){let t=l(r,ki);return unwrap(e.clob.get(`/markets-by-token/${t.tokenId}`).andThen(f(ResolveConditionByTokenResponseSchema)))}var bi=z$1.object({conditionId:CtfConditionIdSchema}),Rf=k(e,d,c,b,a);async function Xt(e,r){let t=l(r,bi);return unwrap(e.clob.get(`/clob-markets/${t.conditionId}`).andThen(f(FetchMarketInfoResponseSchema)))}var Ii=z$1.object({builderCode:BuilderCodeSchema}),Sf=k(e,d,c,b,a);async function eo(e,r){let t=l(r,Ii);return unwrap(e.clob.get(`/fees/builder-fees/${t.builderCode}`).andThen(f(FetchBuilderFeeRatesResponseSchema)).mapErr(o=>o instanceof d&&o.status===404?new a(`Unknown builder code: ${t.builderCode}`,{cause:o}):o))}var qi=z$1.object({tokenId:z$1.string(),side:OrderSideSchema}),hf=k(e,d,c,b,a);async function xf(e,r){let t=l(r,qi);return (await unwrap(e.clob.get("/price",{params:R(t,S())}).andThen(f(PriceSchema)))).price}var Ai=z$1.array(z$1.object({tokenId:z$1.string(),side:OrderSideSchema})).min(1),Tf=k(e,d,c,b,a);async function Pf(e,r){let t=l(r,Ai);return unwrap(e.clob.post("prices",{json:Di(t)}).andThen(f(PricesSchema)))}var vi=z$1.object({tokenId:z$1.string()}),Cf=k(e,d,c,b,a);async function ro(e,r){let t=l(r,vi);return unwrap(e.clob.get("/book",{params:R(t,S())}).andThen(f(FetchOrderBookResponseSchema)))}var Oi=z$1.array(z$1.object({tokenId:z$1.string()})).min(1),kf=k(e,d,c,b,a);async function bf(e,r){let t=l(r,Oi);return unwrap(e.clob.post("books",{json:Ke(t)}).andThen(f(OrderBooksSchema)))}var Li=z$1.object({tokenId:z$1.string()}),If=k(e,d,c,b,a);async function qf(e,r){let t=l(r,Li);return (await unwrap(e.clob.get("/spread",{params:R(t,S())}).andThen(f(SpreadSchema)))).spread}var wi=z$1.array(z$1.object({tokenId:z$1.string()})).min(1),Af=k(e,d,c,b,a);async function vf(e,r){let t=l(r,wi);return unwrap(e.clob.post("spreads",{json:Ke(t)}).andThen(f(SpreadsSchema)))}var Mi=z$1.object({tokenId:z$1.string()}),Of=k(e,d,c,b,a);async function Lf(e,r){let t=l(r,Mi);return unwrap(e.clob.get("/last-trade-price",{params:R(t,S())}).andThen(f(LastTradePriceSchema)))}var Bi=z$1.array(z$1.object({tokenId:z$1.string()})).min(1),wf=k(e,d,c,b,a);async function Mf(e,r){let t=l(r,Bi);return unwrap(e.clob.post("last-trades-prices",{json:Ke(t)}).andThen(f(LastTradePricesSchema)))}var Fi=z$1.object({tokenId:z$1.string(),startTs:z$1.number().int().optional(),endTs:z$1.number().int().optional(),fidelity:z$1.number().int().positive().optional(),interval:PriceHistoryIntervalSchema.optional()}),Bf=k(e,d,c,b,a);async function Ff(e,r){let t=l(r,Fi);return (await unwrap(e.clob.get("/prices-history",{params:R(t,{tokenId:"market",startTs:"startTs",endTs:"endTs",fidelity:"fidelity",interval:"interval"})}).andThen(f(PriceHistorySchema)))).history}var Ui=z$1.object({cursor:PaginationCursorSchema.optional(),sponsored:z$1.boolean().optional()}).default({}),Uf=k(e,d,c,b,a);function zf(e,r={}){let{cursor:t,...o}=l(r,Ui);return C(n=>e.clob.get("/rewards/markets/current",{params:R({...o,nextCursor:n},S())}).andThen(f(PaginatedCurrentRewardsSchema)).map(c=>({items:c.data,hasMore:c.nextCursor!==END_CURSOR,nextCursor:c.nextCursor===END_CURSOR?void 0:toPaginationCursor(c.nextCursor),totalCount:c.count})),t)}var zi=z$1.object({conditionId:CtfConditionIdSchema,cursor:PaginationCursorSchema.optional(),sponsored:z$1.boolean().optional()}),Df=k(e,d,c,b,a);function jf(e,r){let{cursor:t,...o}=l(r,zi);return C(n=>e.clob.get(`rewards/markets/${o.conditionId}`,{params:R({nextCursor:n,sponsored:o.sponsored},S())}).andThen(f(PaginatedMarketRewardsSchema)).map(c=>({items:c.data,hasMore:c.nextCursor!==END_CURSOR,nextCursor:c.nextCursor===END_CURSOR?void 0:toPaginationCursor(c.nextCursor),totalCount:c.count})),t)}function Ke(e){return e.map(({tokenId:r})=>({token_id:r}))}function Di(e){return e.map(({tokenId:r,side:t})=>({token_id:r,side:t}))}var Gi=z$1.object({ascending:z$1.boolean().optional(),cursor:PaginationCursorSchema.optional(),pageSize:I.default(20),getPositions:z$1.boolean().optional(),holdersOnly:z$1.boolean().optional(),order:z$1.string().optional(),parentEntityId:z$1.union([EventIdSchema,SeriesIdSchema]),parentEntityType:CommentParentEntityTypeSchema}),$i=z$1.object({getPositions:z$1.boolean().optional(),id:CommentIdSchema}),Vi=z$1.object({address:z$1.string(),ascending:z$1.boolean().optional(),cursor:PaginationCursorSchema.optional(),order:z$1.string().optional(),pageSize:I.default(20)}),Qf=k(e,d,c,b,a);function Zf(e,r){let{cursor:t,pageSize:o,...n}=l(r,Gi);return C(c=>{let a=O(c,o);return e.gamma.get("/comments",{params:R({ascending:n.ascending,getPositions:n.getPositions,holdersOnly:n.holdersOnly,limit:a.pageSize+1,offset:a.offset,order:n.order,parentEntityId:n.parentEntityId,parentEntityType:n.parentEntityType},S())}).andThen(f(ListCommentsResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var Xf=k(e,d,c,b,a);async function ey(e,r){let t=l(r,$i);return unwrap(e.gamma.get(`comments/${t.id}`,{params:R({getPositions:t.getPositions},S())}).andThen(f(ListCommentsResponseSchema)))}var ry=k(e,d,c,b,a);function ty(e,r){let{address:t,cursor:o,pageSize:n,...c}=l(r,Vi);return C(a=>{let y=O(a,n);return e.gamma.get(`comments/user_address/${t}`,{params:R({ascending:c.ascending,limit:y.pageSize+1,offset:y.offset,order:c.order},S())}).andThen(f(ListCommentsResponseSchema)).map(x=>{let qe=x.length>y.pageSize;return {items:x.slice(0,y.pageSize),hasMore:qe,nextCursor:qe?v({offset:y.offset+y.pageSize,pageSize:y.pageSize}):void 0}})},o)}function Ye(e,r){let t;try{t=new URL(e);}catch(y){throw new a("Expected a valid Polymarket URL.",{cause:y})}if(t.protocol!=="https:"||t.hostname!=="polymarket.com"&&t.hostname!=="www.polymarket.com")throw new a("Expected a valid Polymarket URL.");let[o,n,...c]=t.pathname.split("/").filter(Boolean),a$1=c[0];if(r==="market"&&o==="event"&&n!==void 0&&c.length<=1)return a$1??n;if(o!==r||n===void 0||c.length>0)throw new a(`Expected a Polymarket ${r} URL.`);return n}var Xi=z$1.object({ascending:z$1.boolean().optional(),closed:z$1.boolean().default(false),cursor:PaginationCursorSchema.optional(),pageSize:I.optional(),cyom:z$1.boolean().optional(),endDateMax:IsoDateTimeStringSchema.optional(),endDateMin:IsoDateTimeStringSchema.optional(),ended:z$1.boolean().optional(),eventDate:IsoCalendarDateStringSchema.optional(),eventWeek:z$1.number().int().optional(),excludeTagIds:z$1.array(z$1.number().int()).optional(),featured:z$1.boolean().optional(),featuredOrder:z$1.boolean().optional(),gameIds:z$1.array(z$1.number().int()).optional(),ids:z$1.array(z$1.number().int()).optional(),includeBestLines:z$1.boolean().optional(),includeChat:z$1.boolean().optional(),includeChildren:z$1.boolean().optional(),includeTemplate:z$1.boolean().optional(),liquidityMax:z$1.number().optional(),liquidityMin:z$1.number().optional(),live:z$1.boolean().optional(),locale:z$1.string().optional(),order:z$1.string().optional(),parentEventId:z$1.number().int().optional(),partnerSlug:z$1.string().optional(),recurrence:z$1.enum(["daily","weekly","monthly"]).optional(),relatedTags:z$1.boolean().optional(),seriesIds:z$1.array(z$1.number().int()).optional(),slug:z$1.array(z$1.string()).optional(),startDateMax:IsoDateTimeStringSchema.optional(),startDateMin:IsoDateTimeStringSchema.optional(),startTimeMax:IsoDateTimeStringSchema.optional(),startTimeMin:IsoDateTimeStringSchema.optional(),tagIds:z$1.array(z$1.number().int()).optional(),tagMatch:z$1.enum(["any","all"]).optional(),tagSlug:z$1.string().optional(),titleSearch:z$1.string().optional(),volumeMax:z$1.number().optional(),volumeMin:z$1.number().optional()}),ep=z$1.union([z$1.object({id:z$1.string(),includeBestLines:z$1.boolean().optional(),includeChat:z$1.boolean().optional(),includeTemplate:z$1.boolean().optional(),locale:z$1.string().optional()}),z$1.object({slug:z$1.string(),includeBestLines:z$1.boolean().optional(),includeChat:z$1.boolean().optional(),includeTemplate:z$1.boolean().optional(),locale:z$1.string().optional()}),z$1.object({url:z$1.string(),includeBestLines:z$1.boolean().optional(),includeChat:z$1.boolean().optional(),includeTemplate:z$1.boolean().optional(),locale:z$1.string().optional()})]),rp=z$1.object({id:z$1.string()}),tp=z$1.object({id:z$1.string()}),gy=k(e,d,c,b,a);function Ry(e,r={}){let t=l(r,Xi);return C(o=>e.gamma.get("/events/keyset",{params:op({...t,cursor:o??t.cursor})}).andThen(f(ListEventsKeysetResponseSchema)).map(n=>({items:n.items,hasMore:n.nextCursor!==void 0,nextCursor:n.nextCursor})),t.cursor)}var Sy=k(e,d,c,b,a);async function hy(e,r){let t=l(r,ep);if("id"in t)return unwrap(e.gamma.get(`events/${t.id}`,{params:np(t)}).andThen(f(EventSchema)));let o="url"in t?Ye(t.url,"event"):t.slug;return unwrap(e.gamma.get(`events/slug/${o}`,{params:ap(t)}).andThen(f(EventSchema)))}var xy=k(e,d,c,b,a);async function Ty(e,r){let t=l(r,rp);return unwrap(e.gamma.get(`events/${t.id}/tags`).andThen(f(FetchEventTagsResponseSchema)))}var Py=k(e,d,c,b,a);async function Cy(e,r){let t=l(r,tp);return unwrap(e.data.get("/live-volume",{params:w(t)}).andThen(f(FetchEventLiveVolumeResponseSchema)))}function op(e){return R(e,S({cursor:"after_cursor",excludeTagIds:"exclude_tag_id",gameIds:"game_id",ids:"id",pageSize:"limit",seriesIds:"series_id",tagIds:"tag_id"}))}function np(e){return R({includeBestLines:e.includeBestLines,includeChat:e.includeChat,includeTemplate:e.includeTemplate,locale:e.locale},S())}function ap(e){return R({includeBestLines:e.includeBestLines,includeChat:e.includeChat,includeTemplate:e.includeTemplate,locale:e.locale},S())}var mp=z$1.object({cursor:PaginationCursorSchema.optional(),pageSize:I.default(20),timePeriod:TimePeriodSchema.optional()}),lp=z$1.object({timePeriod:TimePeriodSchema.optional()}),fp=z$1.object({category:LeaderboardCategorySchema.optional(),cursor:PaginationCursorSchema.optional(),pageSize:I.default(20),timePeriod:TimePeriodSchema.optional(),orderBy:LeaderboardOrderBySchema.optional(),user:z$1.string().optional(),userName:z$1.string().optional()}),By=k(e,d,c,b,a);function Fy(e,r={}){let{cursor:t,pageSize:o,...n}=l(r,mp);return C(c=>{let a=O(c,o);return e.data.get("/v1/builders/leaderboard",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListBuilderLeaderboardResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var Uy=k(e,d,c,b,a);async function zy(e,r={}){let t=l(r,lp);return unwrap(e.data.get("/v1/builders/volume",{params:w(t)}).andThen(f(ListBuilderVolumeResponseSchema)))}var Dy=k(e,d,c,b,a);function jy(e,r={}){let{cursor:t,pageSize:o,...n}=l(r,fp);return C(c=>{let a=O(c,o);return e.data.get("/v1/leaderboard",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListTraderLeaderboardResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var Tp=z$1.object({ascending:z$1.boolean().optional(),closed:z$1.boolean().optional(),clobTokenIds:z$1.array(z$1.string()).optional(),cursor:PaginationCursorSchema.optional(),pageSize:I.optional(),conditionIds:z$1.array(CtfConditionIdSchema).optional(),cyom:z$1.boolean().optional(),decimalized:z$1.boolean().optional(),endDateMax:IsoDateTimeStringSchema.optional(),endDateMin:IsoDateTimeStringSchema.optional(),gameId:z$1.string().optional(),ids:z$1.array(z$1.number().int()).optional(),includeTag:z$1.boolean().optional(),liquidityNumMax:z$1.number().optional(),liquidityNumMin:z$1.number().optional(),locale:z$1.string().optional(),marketMakerAddresses:z$1.array(z$1.string()).optional(),order:z$1.string().optional(),positionIds:z$1.array(PositionIdSchema).optional(),questionIds:z$1.array(z$1.string()).optional(),relatedTags:z$1.boolean().optional(),rfqEnabled:z$1.boolean().optional(),rewardsMinSize:z$1.number().optional(),slug:z$1.array(z$1.string()).optional(),sportsMarketTypes:z$1.array(z$1.string()).optional(),startDateMax:IsoDateTimeStringSchema.optional(),startDateMin:IsoDateTimeStringSchema.optional(),tagId:z$1.number().int().optional(),tagMatch:z$1.enum(["any","all"]).optional(),umaResolutionStatus:z$1.string().optional(),volumeNumMax:z$1.number().optional(),volumeNumMin:z$1.number().optional()}),Pp=z$1.object({id:z$1.string(),includeTag:z$1.boolean().optional(),locale:z$1.string().optional()}),Cp=z$1.object({slug:z$1.string(),includeTag:z$1.boolean().optional(),locale:z$1.string().optional()}),kp=z$1.object({url:z$1.string(),includeTag:z$1.boolean().optional(),locale:z$1.string().optional()}),bp=z$1.union([Pp,Cp,kp]),Ip=z$1.object({id:z$1.string()}),qp=z$1.object({limit:z$1.number().int().optional(),market:z$1.array(z$1.string()),minBalance:z$1.number().int().optional()}),Ap=z$1.object({market:z$1.array(z$1.string()).optional()}),vp=z$1.enum(["OPEN","CLOSED","ALL"]),Op=z$1.enum(["TOKENS","CASH_PNL","REALIZED_PNL","TOTAL_PNL"]),Lp=z$1.enum(["ASC","DESC"]),wp=z$1.object({cursor:PaginationCursorSchema.optional(),market:z$1.string(),pageSize:I.default(20),user:z$1.string().optional(),status:vp.optional(),sortBy:Op.optional(),sortDirection:Lp.optional()}),eE=k(e,d,c,b,a);function po(e,r={}){let t=l(r,Tp);return C(o=>e.gamma.get("/markets/keyset",{params:Bp({...t,cursor:o??t.cursor})}).andThen(f(ListMarketsKeysetResponseSchema)).map(n=>({items:n.items,hasMore:n.nextCursor!==void 0,nextCursor:n.nextCursor})),t.cursor)}var Mp=z$1.object({cursor:PaginationCursorSchema.optional(),pageSize:I.max(100).optional(),exclude:z$1.array(CtfConditionIdSchema).optional()}),rE=k(e,d,c,b,a);function tE(e,r={}){let t=l(r,Mp);return C(o=>e.rfq.get("/v1/rfq/combo-markets",{params:Fp({...t,cursor:o??t.cursor})}).andThen(f(ListComboMarketsResponseSchema)).map(n=>({items:n.markets,hasMore:n.nextCursor!==void 0,nextCursor:n.nextCursor})),t.cursor)}var oE=k(e,d,c,b,a);async function nE(e,r){let t=l(r,bp);return "id"in t?Up(e,t):"url"in t?ao(e,{includeTag:t.includeTag,locale:t.locale,slug:Ye(t.url,"market")}):ao(e,t)}var aE=k(e,d,c,b,a);async function sE(e,r){let t=l(r,Ip);return unwrap(e.gamma.get(`markets/${t.id}/tags`).andThen(f(FetchMarketTagsResponseSchema)))}var iE=k(e,d,c,b,a);async function pE(e,r){let t=l(r,qp);return unwrap(e.data.get("/holders",{params:w(t)}).andThen(f(ListMarketHoldersResponseSchema)))}var cE=k(e,d,c,b,a);async function dE(e,r={}){let t=l(r,Ap);return unwrap(e.data.get("/oi",{params:w(t)}).andThen(f(ListOpenInterestResponseSchema)))}var uE=k(e,d,c,b,a);function mE(e,r){let{cursor:t,pageSize:o,...n}=l(r,wp);return C(c=>{let a=O(c,o);return e.data.get("/v1/market-positions",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListMarketPositionsResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}function Bp(e){return R(e,S({cursor:"after_cursor",ids:"id",marketMakerAddresses:"market_maker_address",pageSize:"limit"}))}function Fp(e){return R({cursor:e.cursor,exclude:e.exclude?.join(","),pageSize:e.pageSize},{cursor:"cursor",exclude:"exclude",pageSize:"limit"})}async function ao(e,r){return unwrap(e.gamma.get(`markets/slug/${r.slug}`,{params:R({includeTag:r.includeTag,locale:r.locale},S())}).andThen(f(MarketSchema)))}async function Up(e,r){return unwrap(e.gamma.get(`markets/${r.id}`,{params:R({includeTag:r.includeTag,locale:r.locale},S())}).andThen(f(MarketSchema)))}var jp=z$1.object({orderId:z$1.string()}),Hp=z$1.object({orderIds:z$1.array(z$1.string()).min(1).max(3e3)}),Wp=z$1.object({tokenId:z$1.string().optional(),market:z$1.string().optional()}).refine(e=>e.market!==void 0||e.tokenId!==void 0,{message:"At least one of market or tokenId is required.",path:["market"]}),hE=k(d,e,j$1,c,b,a);async function xE(e,r){let t=l(r,jp);return Ze(e,"/order",{orderID:t.orderId})}var TE=k(d,e,j$1,c,b,a);async function PE(e,r){let t=l(r,Hp);return Ze(e,"/orders",t.orderIds)}var CE=k(d,e,j$1,c,b);async function kE(e){return Ze(e,"/cancel-all")}var bE=k(d,e,j$1,c,b,a);async function IE(e,r){let t=l(r,Wp);return Ze(e,"/cancel-market-orders",{asset_id:t.tokenId,market:t.market})}async function Ze(e,r,t){return unwrap(e.secureClob.del(r,{json:t}).andThen(f(CancelOrdersResponseSchema)))}var uo=z$1.object({tokenId:z$1.string(),orderType:z$1.union([z$1.literal(OrderType.FAK),z$1.literal(OrderType.FOK)]).default(OrderType.FOK)}),Np=z$1.discriminatedUnion("side",[uo.extend({side:z$1.literal(OrderSide.BUY),amount:PositiveDecimalNumberSchema}),uo.extend({side:z$1.literal(OrderSide.SELL),shares:PositiveDecimalNumberSchema})]),BE=k(i,e,d,c,b,a);async function FE(e,r){let t=l(r,Np),o=await Re(e,{tokenId:t.tokenId}),n=t.side===OrderSide.BUY?t.amount:t.shares;return xr(e,{amount:n,orderType:t.orderType,side:t.side,tickSize:o,tokenId:t.tokenId})}async function xr(e,r){let t=await ro(e,{tokenId:r.tokenId}),o=r.side===OrderSide.BUY?$p(t.asks,r.amount,r.orderType):Vp(t.bids,r.amount,r.orderType);return invariant(Gp(o,r.tickSize),`Resolved market price fell outside the valid range for tick size ${r.tickSize}.`),o}function Gp(e,r){return e>=r&&e<=1-r}function $p(e,r,t){if(e.length===0)throw new i("No resting liquidity.");let o=0;for(let c=e.length-1;c>=0;c-=1){let a=e[c];if(a!==void 0&&(o+=Number.parseFloat(a.size)*Number.parseFloat(a.price),o>=r))return Number.parseFloat(a.price)}if(t===OrderType.FOK)throw new i("Insufficient liquidity for full fill.");let n=e[0];return Number.parseFloat(n.price)}function Vp(e,r,t){if(e.length===0)throw new i("No resting liquidity.");let o=0;for(let c=e.length-1;c>=0;c-=1){let a=e[c];if(a!==void 0&&(o+=Number.parseFloat(a.size),o>=r))return Number.parseFloat(a.price)}if(t===OrderType.FOK)throw new i("Insufficient liquidity for full fill.");let n=e[0];return Number.parseFloat(n.price)}var Qp=z$1.array(z$1.custom()).min(1).max(15),GE=k(e,d,j$1,c,b),$E=k(e,d,j$1,c,b,a);function er(e){return async function(t){let o=yo(e,t);return unwrap(e.secureClob.post("/order",{json:o}).andThen(f(OrderResponseSchema)))}}function VE(e){return async function(t){let n=l(t,Qp).map(c=>yo(e,c));return unwrap(e.secureClob.post("/orders",{json:n}).andThen(f(OrderResponsesSchema)))}}function yo(e,r){return invariant(r.postOnly!==true||r.orderType===OrderType.GTC||r.orderType===OrderType.GTD,"Post-only orders are only supported for GTC and GTD order types."),{deferExec:false,order:{builder:r.builder,expiration:`${r.expiration}`,maker:r.maker,makerAmount:r.makerAmount,metadata:r.metadata,salt:Number.parseInt(r.salt,10),side:r.side,signature:r.signature,signatureType:r.signatureType,signer:r.signer,takerAmount:r.takerAmount,timestamp:r.timestamp,tokenId:r.tokenId},orderType:r.orderType,owner:e.credentials.key,...r.postOnly===true?{postOnly:true}:{}}}function Fe(e){switch(e){case .1:return {amount:3,price:1,size:2};case .01:return {amount:4,price:2,size:2};case .001:return {amount:5,price:3,size:2};case 1e-4:return {amount:6,price:4,size:2}}invariant(false,`Unsupported tick size: ${e}`);}function xe(e,r){return r?e.environment.negRiskExchange:e.environment.standardExchange}function te(e){return BigInt(Math.round(e*10**6))}function oe(e,r){return _(e)<=r?e:Math.floor(e*10**r)/10**r}function Te(e,r){return _(e)<=r?e:Math.ceil(e*10**r)/10**r}function Tr(e,r){return _(e)<=r?e:Math.round(e*10**r)/10**r}function _(e){if(typeof e=="number"&&Number.isInteger(e))return 0;let[r="",t]=e.toString().toLowerCase().split("e"),[,o=""]=r.split("."),n=o.length;if(t===void 0)return n;let c=Number.parseInt(t,10);return Math.max(0,n-c)}var Ro=z$1.strictObject({tokenId:TokenIdSchema,price:PositiveDecimalNumberSchema,size:PositiveDecimalNumberSchema,side:OrderSideSchema,builderCode:BuilderCodeSchema.optional(),postOnly:z$1.boolean().default(false),expiration:z$1.number().int().nonnegative().optional()}).superRefine((e,r)=>{if(e.expiration!==void 0){let t=Math.floor(Date.now()/1e3)+60;e.expiration<t&&r.addIssue({code:"custom",message:"Expiration must be at least 60 seconds in the future.",path:["expiration"]});}});async function So(e,r){let t=await oc(e,{price:r.price,tokenId:r.tokenId}),o=nc({price:t.price,side:r.side,size:r.size,tickSize:t.tickSize});return {builderCode:r.builderCode,chainId:e.environment.chainId,exchangeAddress:t.exchangeAddress,expiration:r.expiration??0,funderAddress:t.funderAddress,offeredAmount:o.offeredAmount,orderType:r.expiration===void 0?OrderType.GTC:OrderType.GTD,side:r.side,signer:t.signerAddress,requestedAmount:o.requestedAmount,tokenId:r.tokenId}}async function oc(e,r){let t=e.account,o=await Re(e,{tokenId:r.tokenId}),n=await Se(e,{tokenId:r.tokenId});return {exchangeAddress:xe(e,n),funderAddress:t.wallet,negRisk:n,price:ac(r.price,o),signerAddress:t.signer,tickSize:o}}function nc(e){let r=Fe(e.tickSize),t=Tr(e.price,r.price);if(e.side===OrderSide.BUY){let c=oe(e.size,r.size),a=c*t;return _(a)>r.amount&&(a=Te(a,r.amount+4),_(a)>r.amount&&(a=oe(a,r.amount))),{offeredAmount:te(a),requestedAmount:te(c)}}let o=oe(e.size,r.size),n=o*t;return _(n)>r.amount&&(n=Te(n,r.amount+4),_(n)>r.amount&&(n=oe(n,r.amount))),{offeredAmount:te(o),requestedAmount:te(n)}}function ac(e,r){let t=Fe(r);if(e<r||e>1-r)throw new a(`Price must be between ${r} and ${1-r} for tick size ${r}.`);if(_(e)>t.price)throw new a(`Price must conform to tick size ${r} with at most ${t.price} decimal places.`);return Tr(e,t.price)}var ho=z$1.object({tokenId:TokenIdSchema,builderCode:BuilderCodeSchema.optional(),orderType:z$1.union([z$1.literal(OrderType.FAK),z$1.literal(OrderType.FOK)]).default(OrderType.FAK)}),xo=z$1.discriminatedUnion("side",[ho.extend({side:z$1.literal(OrderSide.BUY),amount:PositiveDecimalNumberSchema,maxSpend:PositiveDecimalNumberSchema.optional()}),ho.extend({side:z$1.literal(OrderSide.SELL),shares:PositiveDecimalNumberSchema})]);async function To(e,r){let t=await pc(e,r),o=cc({amount:t.resolvedAmount,price:t.price,side:r.side,tickSize:t.tickSize});return {builderCode:r.builderCode,chainId:e.environment.chainId,exchangeAddress:t.exchangeAddress,expiration:0,funderAddress:t.funderAddress,offeredAmount:o.offeredAmount,orderType:r.orderType,side:r.side,signer:t.signerAddress,requestedAmount:o.requestedAmount,tokenId:r.tokenId}}async function pc(e,r){let t=e.account,o=await Re(e,{tokenId:r.tokenId}),n=r.side===OrderSide.BUY?r.amount:r.shares,c=await xr(e,{amount:n,orderType:r.orderType,side:r.side,tickSize:o,tokenId:r.tokenId}),a=await Se(e,{tokenId:r.tokenId}),y=await dc(e,{amount:n,builderCode:r.builderCode,maxSpend:r.side===OrderSide.BUY?r.maxSpend:void 0,price:c,side:r.side,tokenId:r.tokenId});return {exchangeAddress:xe(e,a),funderAddress:t.wallet,negRisk:a,price:c,resolvedAmount:y,signerAddress:t.signer,tickSize:o}}function cc(e){let r=Fe(e.tickSize),t=oe(e.price,r.price),o=oe(e.amount,r.size);if(e.side===OrderSide.BUY){let c=o/t;return _(c)>r.amount&&(c=Te(c,r.amount+4),_(c)>r.amount&&(c=oe(c,r.amount))),{offeredAmount:te(o),requestedAmount:te(c)}}let n=o*t;return _(n)>r.amount&&(n=Te(n,r.amount+4),_(n)>r.amount&&(n=oe(n,r.amount))),{offeredAmount:te(o),requestedAmount:te(n)}}async function dc(e,r){if(r.side!==OrderSide.BUY||r.maxSpend===void 0)return r.amount;let[t,o]=await Promise.all([uc(e,r.tokenId),mc(e,r.builderCode)]);return lc({amount:r.amount,builderTakerFeeRate:o,platformFeeExponent:t.exponent,platformFeeRate:t.rate,maxSpend:r.maxSpend,price:r.price})}async function uc(e,r){let t=await Zt(e,{tokenId:r});return (await Xt(e,{conditionId:t})).feeInfo}async function mc(e,r){return r===void 0?0:(await eo(e,{builderCode:r})).taker}function lc(e){let r=e.platformFeeRate*(e.price*(1-e.price))**e.platformFeeExponent,t=e.amount/e.price*r,o=e.amount+t+e.amount*e.builderTakerFeeRate;return e.maxSpend<=o?e.maxSpend/(1+r/e.price+e.builderTakerFeeRate):e.amount}var Po="0x0000000000000000000000000000000000000000000000000000000000000000";function br(e,r){let t=at(r);return {builder:e.builderCode??Po,chainId:e.chainId,exchangeAddress:e.exchangeAddress,expiration:e.expiration,maker:t.maker,makerAmount:e.offeredAmount.toString(),metadata:Po,orderType:e.orderType,salt:fc().toString(),side:e.side,signatureType:t.signatureType,signer:t.signer,takerAmount:e.requestedAmount.toString(),timestamp:Date.now().toString(),tokenId:e.tokenId}}function Ir(e,r){let{chainId:t,exchangeAddress:o,...n}=e;return {...n,signature:r}}function fc(){let e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),BigInt(`0x${Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}`)&(1n<<53n)-1n}var bo="Polymarket CTF Exchange",gc="DepositWallet",Rc="1",qr="0x0000000000000000000000000000000000000000000000000000000000000000",Ar="Order(uint256 salt,address maker,address signer,uint256 tokenId,uint256 makerAmount,uint256 takerAmount,uint8 side,uint8 signatureType,uint256 timestamp,bytes32 metadata,bytes32 builder)",Sc=Hash.keccak256(Bytes.fromString(Ar),{as:"Hex"}),hc=Hash.keccak256(Bytes.fromString("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),{as:"Hex"}),xc=Hash.keccak256(Bytes.fromString(bo),{as:"Hex"}),Tc=[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Io=[{name:"salt",type:"uint256"},{name:"maker",type:"address"},{name:"signer",type:"address"},{name:"tokenId",type:"uint256"},{name:"makerAmount",type:"uint256"},{name:"takerAmount",type:"uint256"},{name:"side",type:"uint8"},{name:"signatureType",type:"uint8"},{name:"timestamp",type:"uint256"},{name:"metadata",type:"bytes32"},{name:"builder",type:"bytes32"}],Pc=[{name:"contents",type:"Order"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"}];function qo(e){let r=Cc(e.domain,e.order);return e.order.signatureType!==SignatureType.POLY_1271?r:{domain:Oo(e.domain),message:{chainId:e.domain.chainId,contents:r.message,name:gc,salt:qr,verifyingContract:e.order.signer,version:Rc},primaryType:"TypedDataSign",types:{Order:Io,TypedDataSign:Pc}}}function Ao(e){if(e.order.signatureType!==SignatureType.POLY_1271)return e.signature;let r=Bytes.toHex(Bytes.fromString(Ar)),t=Ar.length.toString(16).padStart(4,"0");return expectErc1271Signature(`0x${e.signature.slice(2)}${kc(e.domain).slice(2)}${bc(e.order).slice(2)}${r.slice(2)}${t}`)}function vo(e){return {builder:e.builder??qr,maker:e.maker,makerAmount:BigInt(e.makerAmount),metadata:e.metadata??qr,salt:BigInt(e.salt),side:qc(e.side),signatureType:e.signatureType,signer:e.signer,takerAmount:BigInt(e.takerAmount),timestamp:BigInt(e.timestamp),tokenId:BigInt(e.tokenId)}}function Cc(e,r){return {domain:Oo(e),message:vo(r),primaryType:"Order",types:{EIP712Domain:Tc,Order:Io}}}function Oo(e){return {chainId:e.chainId,name:bo,verifyingContract:e.exchange,version:e.protocolVersion}}function kc(e){return expectHexString(Hash.keccak256(AbiParameters.encode([{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"address"}],[hc,xc,Ic(e.protocolVersion),BigInt(e.chainId),e.exchange]),{as:"Hex"}))}function bc(e){let r=vo(e);return expectHexString(Hash.keccak256(AbiParameters.encode([{type:"bytes32"},{type:"uint256"},{type:"address"},{type:"address"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint8"},{type:"uint8"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[Sc,r.salt,r.maker,r.signer,r.tokenId,r.makerAmount,r.takerAmount,r.side,r.signatureType,r.timestamp,r.metadata,r.builder]),{as:"Hex"}))}function Ic(e){return expectHexString(Hash.keccak256(Bytes.fromString(e),{as:"Hex"}))}function qc(e){return e===0||e===1?e:e===OrderSide.BUY?0:1}function Or(e){return qo({domain:Lo(e),order:e})}function Lr(e,r){return Ao({domain:Lo(e),order:e,signature:r})}function Lo(e){return {chainId:e.chainId,exchange:e.exchangeAddress,protocolVersion:"2"}}function wr(e){return {kind:"signOrder",payload:e}}var Ac=k(i,e,d,j$1,c,b,a);async function Mr(e,r){let t=l(r,xo);return async function*(){let o=await To(e,t),n=br(o,e.account),c=expectEvmSignature(yield wr(Or(n)));return Ir(n,Lr(n,c))}.call(null)}var vc=k(e,d,j$1,c,b,a);async function Br(e,r){let t=l(r,Ro);return async function*(){let o=await So(e,t),n=br(o,e.account),c=expectEvmSignature(yield wr(Or(n))),a=Ir(n,Lr(n,c));return t.postOnly===true?{...a,postOnly:true}:a}.call(null)}var Lg=Ac;async function wg(e,r){return Mo(e,Mr(e,r))}var Mg=vc;async function Bg(e,r){return Mo(e,Br(e,r))}async function Mo(e,r){let t=await r;return async function*(){let o=yield*t;return er(e)(o)}.call(null)}async function Uo(e,r){let t=r.side===OrderSide.BUY?AssetType.COLLATERAL:AssetType.CONDITIONAL,{allowances:o}=await sr(e,r.side===OrderSide.BUY?{assetType:t}:{assetType:t,tokenId:r.tokenId});return Lc(o,r.spenderAddress)}function Lc(e,r){return Object.entries(e).find(([o])=>isSameEvmAddress(o,r))?.[1]??0n}var Xg=k(h,i,e,d,j$1,c,b,a);function wc(e,r){return Mr(e,r).then(F(e.signer))}var eR=k(h,i,e,d,j$1,f$1,g,c,b,a);function rR(e,r){return wc(e,r).then(t=>Do(e,t))}var tR=k(h,e,d,j$1,c,b,a);function Mc(e,r){return Br(e,r).then(F(e.signer))}var oR=k(h,e,d,j$1,f$1,g,c,b,a);function nR(e,r){return Mc(e,r).then(t=>Do(e,t))}async function Do(e,r){let t=er(e);try{return await t(r)}catch(o){if(!Fc(o))throw o;let n=await Bc(e,r,t);if(n===void 0)throw o;return n}}async function Bc(e,r,t){return await Uc(e,r)?t(r):void 0}function Fc(e){return e instanceof d&&e.status===400&&e.message.includes("allowance is not enough")}async function Uc(e,r){let t=await Se(e,{tokenId:r.tokenId}),o=xe(e,t),n=BigInt(r.makerAmount);return await Uo(e,{spenderAddress:o,side:r.side,tokenId:r.tokenId})>=n?false:(await(r.side===OrderSide.BUY?await jt(e,{amount:"max",spenderAddress:o,tokenAddress:e.environment.collateralToken}):await Ht(e,{operatorAddress:o,tokenAddress:e.environment.conditionalTokens})).wait(),await ut(e,{assetType:r.side===OrderSide.BUY?AssetType.COLLATERAL:AssetType.CONDITIONAL,tokenId:r.side===OrderSide.SELL?r.tokenId:void 0}),true)}var $c=z$1.enum(["CURRENT","INITIAL","TOKENS","CASHPNL","PERCENTPNL","TITLE","RESOLVING","PRICE","AVGPRICE"]),jo=z$1.enum(["ASC","DESC"]),Vc=z$1.enum(["REALIZEDPNL","TITLE","PRICE","AVGPRICE","TIMESTAMP"]),Kc=z$1.object({cursor:PaginationCursorSchema.optional(),user:z$1.string(),market:z$1.array(z$1.string()).optional(),eventId:z$1.array(z$1.number().int()).optional(),sizeThreshold:z$1.number().optional(),redeemable:z$1.boolean().optional(),mergeable:z$1.boolean().optional(),pageSize:I.default(20),sortBy:$c.optional(),sortDirection:jo.optional(),title:z$1.string().max(100).optional()}).refine(e=>!(e.market&&e.eventId),{message:"Provide market or eventId, not both",path:["eventId"]}),Yc=z$1.object({cursor:PaginationCursorSchema.optional(),user:z$1.string(),market:z$1.array(z$1.string()).optional(),title:z$1.string().max(100).optional(),eventId:z$1.array(z$1.number().int()).optional(),pageSize:I.default(20),sortBy:Vc.optional(),sortDirection:jo.optional()}).refine(e=>!(e.market&&e.eventId),{message:"Provide market or eventId, not both",path:["eventId"]}),Jc=z$1.object({cursor:PaginationCursorSchema.optional(),user:z$1.string(),pageSize:I.default(20),status:ComboPositionStatusSchema.optional(),conditionId:ComboConditionIdSchema.optional(),positionId:PositionIdSchema.optional()}),Qc=z$1.object({user:z$1.string(),market:z$1.array(z$1.string()).optional()}),Zc=z$1.object({user:z$1.string()}),Xc=z$1.object({user:z$1.string()}),yR=k(e,d,c,b,a);function ER(e,r){let{cursor:t,pageSize:o,...n}=l(r,Kc);return C(c=>{let a=O(c,o);return e.data.get("/positions",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListPositionsResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var gR=k(e,d,c,b,a),RR=k(e,d,c,b,a);function SR(e,r){let{cursor:t,pageSize:o,...n}=l(r,Yc);return C(c=>{let a=O(c,o);return e.data.get("/closed-positions",{params:w({...n,limit:a.pageSize+1,offset:a.offset})}).andThen(f(ListClosedPositionsResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}function hR(e,r){let{cursor:t,pageSize:o,...n}=l(r,Jc);return C(c=>{let a=O(c,o);return e.data.get("/v1/positions/combos",{params:R({...n,limit:a.pageSize+1,offset:a.offset},S({conditionId:"combo_condition_id",positionId:"combo_position_id"}))}).andThen(f(ListComboPositionsResponseSchema)).map(y=>{let x=y.combos.length>a.pageSize;return {items:y.combos.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var xR=k(e,d,c,b,a);async function TR(e,r){let t=l(r,Qc);return unwrap(e.data.get("/value",{params:w(t)}).andThen(f(FetchPortfolioValueResponseSchema)))}var PR=k(e,d,c,b,a);async function CR(e,r){let t=l(r,Zc);return unwrap(e.data.get("/traded",{params:w(t)}).andThen(f(TradedSchema)))}var kR=k(e,d,c,b,a);async function bR(e,r){let t=l(r,Xc);return unwrap(e.data.get("/v1/accounting/snapshot",{params:w(t)}).andThen(Qr))}var Go=32,$o=3n,_o=50,rd=(1n<<256n)-1n;function Dr(e){let r=AbiParameters.encode([{name:"legs",type:"uint256[]"}],[e]),t=Hash.keccak256(AbiParameters.encode([{name:"moduleId",type:"uint256"},{name:"data",type:"bytes"}],[$o,r])),o=toComboConditionId(`0x03${t.slice(34)}0000000000000000000000000000`);return {conditionId:o,positionIds:[toPositionId(BigInt(`${o}00`).toString()),toPositionId(BigInt(`${o}01`).toString())]}}function Vo(e){if(e.length===0||e.length>_o)throw new a(`Combo legs must include 1 to ${_o} position IDs`);let r=e.map(t=>{let o=Yo(t),n=o.toString(16).padStart(Go*2,"0"),c=Number.parseInt(n.slice(0,2),16),a$1=Number.parseInt(n.slice(-2),16);if(c!==1&&c!==2||a$1>1)throw new a("Combo legs must be binary or neg-risk YES/NO position IDs");return {value:o,conditionId:n.slice(0,-2)}});r.sort((t,o)=>t.value<o.value?-1:t.value>o.value?1:0);for(let t=1;t<r.length;t+=1){let o=r[t-1],n=r[t];if(o===void 0||n===void 0)throw new a("Invalid combo leg set");if(o.value===n.value)throw new a("Combo legs must not contain duplicate position IDs");if(o.conditionId===n.conditionId)throw new a("Combo legs must not contain both outcomes for the same condition")}return r.map(t=>t.value)}function Ko(e){let t=Yo(e).toString(16).padStart(Go*2,"0"),o=BigInt(`0x${t.slice(0,2)}`),n=Number.parseInt(t.slice(-2),16);if(o!==$o)throw new a("Combo position ID must use the combinatorial module");if(n!==0&&n!==1)throw new a("Combo position ID must be a YES/NO position ID");return {conditionId:toComboConditionId(`0x${t.slice(0,-2)}`),outcomeIndex:n}}function Yo(e){let r=e.trim(),t;if(r.length===0)throw new a("Position ID must be a uint256 value");try{t=BigInt(r);}catch{throw new a("Position ID must be a uint256 value")}if(t<0n||t>rd)throw new a("Position ID must be a uint256 value");return t}var Jo=z$1.object({amount:z$1.bigint().min(0n),conditionId:CtfConditionIdSchema,metadata:j.optional()}),od=z$1.object({amount:z$1.bigint().positive(),legs:z$1.array(PositionIdSchema).min(1).max(50),metadata:j.optional()}),Qo=z$1.array(PositionIdSchema).min(1).max(50).transform(Vo),nd=z$1.object({amount:z$1.bigint().positive(),legs:Qo,metadata:j.optional()}),ad=z$1.union([Jo.extend({legs:z$1.never().optional()}),od.extend({conditionId:z$1.never().optional()})]),Zo=k(e,d,c,b,a),$R=Zo,VR=Zo,Xo=k(e,d,c,b,a),KR=Xo,YR=Xo,en=k(e,d,c,b,a),JR=en,QR=en;async function rn(e,r){let t=l(r,Jo),o=await _r(e,{conditionId:t.conditionId}),n=It(o.adapterAddress,e.environment.collateralToken,o.conditionId,t.amount);return async function*(){return e.account.walletType===WalletType.EOA?z(yield jr(D(e.environment.chainId,n))):yield*await G(e,{calls:[n],metadata:t.metadata??`Split ${t.amount} positions for market ${o.marketId} (condition ${o.conditionId})`})}.call(null)}async function tn(e,r){let t=l(r,nd),o=ur(e.environment.combinatorialModule,t.legs),n=Dr(t.legs),c=vt(e.environment.protocolV2Router,n.conditionId,t.amount);return async function*(){return e.account.walletType===WalletType.EOA?(await z(yield jr(D(e.environment.chainId,o))).wait(),z(yield jr(D(e.environment.chainId,c)))):yield*await G(e,{calls:[o,c],metadata:t.metadata??`Split ${t.amount} combo positions for condition ${n.conditionId}`})}.call(null)}async function sd(e,r){let t=l(r,ad);return t.legs!==void 0?tn(e,t):rn(e,t)}var on=k(h,e,d,j$1,f$1,g,c,b,a),ZR=on,XR=on;function eS(e,r){return rn(e,r).then(F(e.signer))}function rS(e,r){return tn(e,r).then(F(e.signer))}function tS(e,r){return sd(e,r).then(F(e.signer))}var nn=z$1.object({amount:z$1.union([z$1.bigint().positive(),z$1.literal("max")]),conditionId:CtfConditionIdSchema,metadata:j.optional()}),id=z$1.object({amount:z$1.union([z$1.bigint().positive(),z$1.literal("max")]),legs:z$1.array(PositionIdSchema).min(1).max(50),metadata:j.optional()}),pd=z$1.object({amount:z$1.union([z$1.bigint().positive(),z$1.literal("max")]),legs:Qo,metadata:j.optional()}),cd=z$1.union([nn.extend({legs:z$1.never().optional()}),id.extend({conditionId:z$1.never().optional()})]);async function an(e,r){let t=l(r,nn),o=await _r(e,{conditionId:t.conditionId}),n=cr(await e.rpc.ethCall(pr(o.positionErc1155Address,e.account.wallet,o.tokenIds))),c=ln(o.conditionId,n,t.amount),a=qt(o.adapterAddress,e.environment.collateralToken,o.conditionId,c);return async function*(){return e.account.walletType===WalletType.EOA?z(yield Hr(D(e.environment.chainId,a))):yield*await G(e,{calls:[a],metadata:t.metadata??`Merge ${c} positions for market ${o.marketId} (condition ${o.conditionId})`})}.call(null)}async function sn(e,r){let t=l(r,pd),o=ur(e.environment.combinatorialModule,t.legs),n=Dr(t.legs),c=cr(await e.rpc.ethCall(pr(e.environment.positionManager,e.account.wallet,n.positionIds))),a=ln(n.conditionId,c,t.amount),y=Ot(e.environment.protocolV2Router,n.conditionId,a);return async function*(){return e.account.walletType===WalletType.EOA?(await z(yield Hr(D(e.environment.chainId,o))).wait(),z(yield Hr(D(e.environment.chainId,y)))):yield*await G(e,{calls:[o,y],metadata:t.metadata??`Merge ${a} combo positions for condition ${n.conditionId}`})}.call(null)}async function dd(e,r){let t=l(r,cd);return t.legs!==void 0?sn(e,t):an(e,t)}var pn=k(h,e,d,j$1,f$1,g,c,b,a),oS=pn,nS=pn;function aS(e,r){return an(e,r).then(F(e.signer))}function sS(e,r){return sn(e,r).then(F(e.signer))}function iS(e,r){return dd(e,r).then(F(e.signer))}var cn=z$1.object({conditionId:CtfConditionIdSchema,marketId:z$1.never().optional(),amount:z$1.never().optional(),positionId:z$1.never().optional(),metadata:j.optional()}),dn=z$1.object({conditionId:z$1.never().optional(),marketId:MarketIdSchema,amount:z$1.never().optional(),positionId:z$1.never().optional(),metadata:j.optional()}),ud=z$1.union([cn,dn]),un=z$1.object({positionId:PositionIdSchema,conditionId:z$1.never().optional(),marketId:z$1.never().optional(),metadata:j.optional()}),md=z$1.union([cn,dn,un]);async function ld(e,r){let t=l(r,ud),o=await _r(e,t.conditionId!==void 0?{conditionId:t.conditionId}:{marketId:t.marketId}),n=At(o.adapterAddress,e.environment.collateralToken,o.conditionId);return async function*(){return e.account.walletType===WalletType.EOA?z(yield mn(D(e.environment.chainId,n))):yield*await G(e,{calls:[n],metadata:t.metadata??`Redeem positions for market ${o.marketId} (condition ${o.conditionId})`})}.call(null)}async function fd(e,r){let t=l(r,un),o=Ko(t.positionId),n=bt(await e.rpc.ethCall(kt(e.environment.positionManager,e.account.wallet,t.positionId)));if(n===0n)throw new a("Combo position has no balance to redeem");let c=Lt(e.environment.protocolV2Router,o.conditionId,o.outcomeIndex,n);return async function*(){return e.account.walletType===WalletType.EOA?z(yield mn(D(e.environment.chainId,c))):yield*await G(e,{calls:[c],metadata:t.metadata??`Redeem combo position ${t.positionId}`})}.call(null)}async function yd(e,r){let t=l(r,md);return t.positionId!==void 0?fd(e,t):ld(e,t)}var pS=k(h,e,d,j$1,c,b,a);function cS(e,r){return yd(e,r).then(F(e.signer))}function jr(e){return {kind:"sendSplitPositionTransaction",request:e}}function Hr(e){return {kind:"sendMergePositionsTransaction",request:e}}function mn(e){return {kind:"sendRedeemPositionsTransaction",request:e}}async function _r(e,r){let t=r.conditionId!==void 0?`condition ${r.conditionId}`:`market ${r.marketId}`,n=(await po(e,r.conditionId!==void 0?{conditionIds:[r.conditionId],pageSize:1}:{ids:[Ed(r.marketId)],pageSize:1}).firstPage()).items;invariant(n.length===1,`Expected exactly one ${t}`);let c=n[0];invariant(c!==void 0,`No market found for ${t}`);let a=gd(c,t);return {...a,adapterAddress:a.negRisk?e.environment.negRiskCollateralAdapter:e.environment.collateralAdapter,positionErc1155Address:a.negRisk?e.environment.negRiskAdapter:e.environment.conditionalTokens}}function Ed(e){let r=Number(e);if(!Number.isInteger(r))throw new a(`Market ID must be an integer, received ${e}`);return r}function gd(e,r){if(!isPresent(e.conditionId))throw new b(`Missing condition ID for ${r}`);if(!isPresent(e.state.negRisk))throw new b(`Missing negative-risk flag for ${r}`);let t=e.outcomes.yes.tokenId,o=e.outcomes.no.tokenId;if(!isPresent(t)||!isPresent(o))throw new b(`Missing market token IDs for ${r}`);return {marketId:e.id,conditionId:e.conditionId,negRisk:e.state.negRisk,tokenIds:[t,o]}}function ln(e,r,t){let o=Rd(r);if(o===0n)throw new a(`You have no complementary positions to merge for condition ${e}`);if(t==="max")return o;if(t>o)throw new a(`Requested merge amount ${t} exceeds the maximum mergeable amount ${o} for condition ${e}`);return t}function Rd(e){if(e.length!==2)throw new b("Expected two position balances");let[r,t]=e;return invariant(r!==void 0,"Expected YES position balance"),invariant(t!==void 0,"Expected NO position balance"),r<t?r:t}var Pd=z$1.object({address:z$1.string()}),RS=k(e,d,c,b,a);async function SS(e,r){let t=l(r,Pd);return unwrap(e.gamma.get("/public-profile",{params:R(t,S())}).andThen(f(PublicProfileSchema)).orElse(o=>o instanceof d&&o.status===404?ok(null):err(o)))}var Nr=class extends PolymarketError{name="RfqQuoteRejectedError";code;rfqId;constructor(r,t){super(r,t),this.code=t.code,this.rfqId=t.rfqId;}},PS=k(Nr,j$1,f$1,c,a),Gr=class extends PolymarketError{name="RfqCancelQuoteRejectedError";code;rfqId;quoteId;constructor(r,t){super(r,t),this.code=t.code,this.rfqId=t.rfqId,this.quoteId=t.quoteId;}},CS=k(Gr,f$1,c),$r=class extends PolymarketError{name="RfqConfirmationRejectedError";code;rfqId;quoteId;constructor(r,t){super(r,t),this.code=t.code,this.rfqId=t.rfqId,this.quoteId=t.quoteId;}},kS=k($r,f$1,c),bS=k(c);async function IS(e){return e.webSockets.rfqQuoter.connect()}var bd=z$1.object({q:z$1.string().trim().min(1),ascending:z$1.boolean().optional(),cache:z$1.boolean().optional(),cursor:PaginationCursorSchema.optional(),eventsStatus:z$1.string().min(1).optional(),eventsTag:z$1.array(z$1.string()).optional(),excludeTagIds:z$1.array(z$1.number().int()).optional(),keepClosedMarkets:z$1.number().int().optional(),optimized:z$1.boolean().optional(),pageSize:I.default(10),presets:z$1.array(z$1.string()).optional(),recurrence:z$1.enum(["daily","weekly","monthly"]).optional(),searchProfiles:z$1.boolean().optional(),searchTags:z$1.boolean().optional(),sort:z$1.string().min(1).optional()}),NS=k(e,d,c,b,a);function GS(e,r){let{cursor:t,pageSize:o,...n}=l(r,bd);return C(c=>{let a=O(c,o);return e.gamma.get("/public-search",{params:R({...n,limitPerType:a.pageSize,page:a.offset},S({excludeTagIds:"exclude_tag_id"}))}).andThen(f(PublicSearchResponseSchema)).map(y=>({items:Id(y),hasMore:y.pagination?.hasMore??false,totalCount:y.pagination?.totalResults??void 0,nextCursor:y.pagination?.hasMore?v({offset:a.offset+1,pageSize:a.pageSize}):void 0}))},t??v({offset:1,pageSize:o}),{events:[],profiles:[],tags:[]})}function Id(e){return {events:e.events??[],profiles:e.profiles??[],tags:e.tags??[]}}var Ld=z$1.object({ascending:z$1.boolean().optional(),closed:z$1.boolean().optional(),cursor:PaginationCursorSchema.optional(),excludeEvents:z$1.boolean().optional(),locale:z$1.string().optional(),order:z$1.string().optional(),pageSize:I.default(20),recurrence:z$1.enum(["daily","weekly","monthly"]).optional(),slug:z$1.array(z$1.string()).optional()}),wd=z$1.object({id:z$1.string(),locale:z$1.string().optional()}),th=k(e,d,c,b,a);function oh(e,r={}){let{cursor:t,pageSize:o,...n}=l(r,Ld);return C(c=>{let a=O(c,o);return e.gamma.get("/series",{params:R({...n,limit:a.pageSize+1,offset:a.offset},S())}).andThen(f(ListSeriesResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var nh=k(e,d,c,b,a);async function ah(e,r){let t=l(r,wd);return unwrap(e.gamma.get(`series/${t.id}`,{params:R({locale:t.locale},S())}).andThen(f(SeriesSchema)))}var uh=k(e,d,c,b);async function mh(e){return unwrap(e.gamma.get("/sports").andThen(f(ListSportsMetadataResponseSchema)))}var lh=k(e,d,c,b);async function fh(e){return unwrap(e.gamma.get("/sports/market-types").andThen(f(SportsMarketTypesResponseSchema)))}async function Rh(e,r){let t=await Promise.all(r.map(o=>zd(e,o)));return Dd(t)}function zd(e,r){switch(r.topic){case "market":return e.webSockets.clobMarket.subscribe(r);case "sports":return e.webSockets.sports.subscribe(r);case "comments":case "prices.crypto.binance":case "prices.crypto.chainlink":case "prices.equity.pyth":return e.webSockets.rtds.subscribe(r);case "user":return invariant(e.isSecureClient(),"A 'user' subscription requires a secure client instance."),e.webSockets.clobUser.subscribe(r)}}function Dd(e){let r;async function t(){r===void 0&&(r=Promise.all(e.map(n=>n.close())).then(()=>{})),await r;}let o=Ud(...e);return {close:t,[Symbol.asyncIterator](){return o[Symbol.asyncIterator]()}}}var Wd=z$1.object({ascending:z$1.boolean().optional(),cursor:PaginationCursorSchema.optional(),includeTemplate:z$1.boolean().optional(),isCarousel:z$1.boolean().optional(),locale:z$1.string().optional(),order:z$1.string().optional(),pageSize:I.default(20)}),_d=z$1.union([z$1.object({id:z$1.string(),includeTemplate:z$1.boolean().optional(),locale:z$1.string().optional()}),z$1.object({slug:z$1.string(),locale:z$1.string().optional()})]),Nd=z$1.object({id:z$1.string(),omitEmpty:z$1.boolean().optional(),status:z$1.enum(["active","closed","all"]).optional()}),Gd=z$1.object({slug:z$1.string()}),$d=z$1.object({id:z$1.string(),locale:z$1.string().optional(),omitEmpty:z$1.boolean().optional(),status:z$1.enum(["active","closed","all"]).optional()}),Vd=z$1.object({locale:z$1.string().optional(),slug:z$1.string(),omitEmpty:z$1.boolean().optional(),status:z$1.enum(["active","closed","all"]).optional()}),Ah=k(e,d,c,b,a);function vh(e,r={}){let{cursor:t,pageSize:o,...n}=l(r,Wd);return C(c=>{let a=O(c,o);return e.gamma.get("/tags",{params:R({...n,limit:a.pageSize+1,offset:a.offset},S())}).andThen(f(ListTagsResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var Oh=k(e,d,c,b,a);async function Lh(e,r){let t=l(r,_d);return "id"in t?unwrap(e.gamma.get(`tags/${t.id}`,{params:R({includeTemplate:t.includeTemplate,locale:t.locale},S())}).andThen(f(TagSchema))):unwrap(e.gamma.get(`tags/slug/${t.slug}`,{params:R({locale:t.locale},S())}).andThen(f(TagSchema)))}var wh=k(e,d,c,b,a);async function Mh(e,r){if("id"in r){let o=l(r,Nd);return unwrap(e.gamma.get(`tags/${o.id}/related-tags`,{params:R({omitEmpty:o.omitEmpty,status:o.status},S())}).andThen(f(ListRelatedTagsResponseSchema)))}let t=l(r,Gd);return unwrap(e.gamma.get(`tags/slug/${t.slug}/related-tags`).andThen(f(ListRelatedTagsResponseSchema)))}var Bh=k(e,d,c,b,a);async function Fh(e,r){if("id"in r){let o=l(r,$d);return unwrap(e.gamma.get(`tags/${o.id}/related-tags/tags`,{params:R({locale:o.locale,omitEmpty:o.omitEmpty,status:o.status},S())}).andThen(f(ListRelatedTagResourcesResponseSchema)))}let t=l(r,Vd);return unwrap(e.gamma.get(`tags/slug/${t.slug}/related-tags/tags`,{params:R({locale:t.locale,omitEmpty:t.omitEmpty,status:t.status},S())}).andThen(f(ListRelatedTagResourcesResponseSchema)))}var Jd=z$1.object({abbreviation:z$1.array(z$1.string()).optional(),ascending:z$1.boolean().optional(),cursor:PaginationCursorSchema.optional(),league:z$1.array(z$1.string()).optional(),name:z$1.array(z$1.string()).optional(),order:z$1.string().optional(),pageSize:I.default(20),providerId:z$1.array(z$1.number().int()).optional()}),$h=k(e,d,c,b,a);function Vh(e,r={}){let{cursor:t,pageSize:o,...n}=l(r,Jd);return C(c=>{let a=O(c,o);return e.gamma.get("/teams",{params:R({...n,limit:a.pageSize+1,offset:a.offset},S({providerId:"provider_id"}))}).andThen(f(ListTeamsResponseSchema)).map(y=>{let x=y.length>a.pageSize;return {items:y.slice(0,a.pageSize),hasMore:x,nextCursor:x?v({offset:a.offset+a.pageSize,pageSize:a.pageSize}):void 0}})},t)}var Zd=z$1.object({amount:z$1.bigint(),metadata:j.optional(),recipientAddress:EvmAddressSchema,tokenAddress:EvmAddressSchema}),nx=k(a);async function Xd(e,r){let t=l(r,Zd);return async function*(){return e.account.walletType===WalletType.EOA?z(yield eu(D(e.environment.chainId,dr(t.tokenAddress,t.recipientAddress,t.amount)))):yield*await G(e,{calls:[dr(t.tokenAddress,t.recipientAddress,t.amount)],metadata:t.metadata??`Transfer ${t.amount} of ${t.tokenAddress} to ${t.recipientAddress}`})}.call(null)}var ax=k(h,e,d,j$1,c,b,a);function sx(e,r){return Xd(e,r).then(F(e.signer))}function eu(e){return {kind:"sendErc20TransferTransaction",request:e}}export{Xm as $,js as $a,Cy as $b,nR as $c,bS as $d,Am as A,$u as Aa,If as Ab,bE as Ac,ZR as Ad,$h as Ae,ur as B,Vu as Ba,qf as Bb,IE as Bc,XR as Bd,Vh as Be,wt as C,Ku as Ca,Af as Cb,BE as Cc,eS as Cd,nx as Ce,Mt as D,Yu as Da,vf as Db,FE as Dc,rS as Dd,Xd as De,Al as E,Ju as Ea,Of as Eb,xr as Ec,tS as Ed,ax as Ee,Vs as F,Qu as Fa,Lf as Fb,GE as Fc,an as Fd,sx as Fe,vl as G,Zu as Ga,wf as Gb,$E as Gc,sn as Gd,Ks as H,Xu as Ha,Mf as Hb,er as Hc,dd as Hd,Ol as I,em as Ia,Bf as Ib,VE as Ic,pn as Id,Ll as J,rm as Ja,Ff as Jb,qo as Jc,oS as Jd,wl as K,tm as Ka,Uf as Kb,Ao as Kc,nS as Kd,Ml as L,om as La,zf as Lb,wr as Lc,aS as Ld,Bl as M,lm as Ma,Df as Mb,Ac as Mc,sS as Md,Fl as N,fm as Na,jf as Nb,Mr as Nc,iS as Nd,Ul as O,ym as Oa,Qf as Ob,vc as Oc,ld as Od,zl as P,Em as Pa,Zf as Pb,Br as Pc,fd as Pd,Dl as Q,wm as Qa,Xf as Qb,Lg as Qc,yd as Qd,jl as R,z as Ra,ey as Rb,wg as Rc,pS as Rd,Hl as S,El as Sa,ry as Sb,Mg as Sc,cS as Sd,Wl as T,Us as Ta,ty as Tb,Bg as Tc,RS as Td,l as U,gl as Ua,gy as Ub,Xg as Uc,SS as Ud,Xr as V,jt as Va,Ry as Vb,wc as Vc,Nr as Vd,Su as W,Rl as Wa,Sy as Wb,eR as Wc,PS as Wd,at as X,Ds as Xa,hy as Xb,rR as Xc,Gr as Xd,pt as Y,Sl as Ya,xy as Yb,tR as Yc,CS as Yd,zm as Z,Ht as Za,Ty as Zb,Mc as Zc,$r as Zd,Bt as _,hl as _a,Py as _b,oR as _c,kS as _d,$ as a,Er as aa,xl as ab,By as ac,yR as ad,IS as ae,xm as b,el as ba,Tl as bb,Fy as bc,ER as bd,He as c,rl as ca,Zl as cb,Uy as cc,gR as cd,xt as d,j as da,Xl as db,zy as dc,RR as dd,Tt as e,tl as ea,uf as eb,Dy as ec,SR as ed,We as f,ol as fa,mf as fb,jy as fc,hR as fd,Pt as g,xs as ga,lf as gb,eE as gc,xR as gd,Ct as h,nl as ha,ff as hb,po as hc,TR as hd,NS as he,kt as i,G as ia,yf as ib,rE as ic,PR as id,GS as ie,bt as j,al as ja,Re as jb,tE as jc,CR as jd,th as je,pr as k,Lu as ka,Ef as kb,oE as kc,kR as kd,oh as ke,cr as l,wu as la,Se as lb,nE as lc,bR as ld,nh as le,Tm as m,Mu as ma,gf as mb,aE as mc,ah as me,dr as n,Bu as na,Zt as nb,sE as nc,Zo as nd,uh as ne,Pm as o,Fu as oa,Rf as ob,iE as oc,$R as od,mh as oe,Cm as p,Uu as pa,Xt as pb,pE as pc,VR as pd,lh as pe,It as q,zu as qa,Sf as qb,cE as qc,Xo as qd,fh as qe,km as r,Du as ra,eo as rb,dE as rc,KR as rd,Rh as re,qt as s,ju as sa,hf as sb,uE as sc,YR as sd,Ah as se,At as t,Hu as ta,xf as tb,mE as tc,en as td,vh as te,bm as u,Wu as ua,Tf as ub,hE as uc,JR as ud,Oh as ue,vt as v,_u as va,Pf as vb,xE as vc,QR as vd,Lh as ve,Im as w,Nu as wa,Cf as wb,TE as wc,rn as wd,wh as we,Ot as x,sr as xa,ro as xb,PE as xc,tn as xd,Mh as xe,qm as y,Gu as ya,kf as yb,CE as yc,sd as yd,Bh as ye,Lt as z,ut as za,bf as zb,kE as zc,on as zd,Fh as ze};//# sourceMappingURL=chunk-2ZZDFOKL.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-2ZZDFOKL.js.map
|