@liberfi.io/react-predict 0.3.33 → 0.3.34

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.
@@ -800,6 +800,13 @@ interface CreateOrderInput {
800
800
  * Defaults to the signer address when not provided.
801
801
  */
802
802
  funderAddress?: string;
803
+ /**
804
+ * Builder code (bytes32 hex, 0x-prefixed) for builder-rebate attribution.
805
+ * Only honoured on CLOB V2 (POLY_1271 / deposit-wallet) orders — the V2
806
+ * order struct carries a native `builder` field. Legacy V1 orders have no
807
+ * builder field, so this is ignored there.
808
+ */
809
+ builderCode?: string;
803
810
  }
804
811
  /** Response from `GET /api/v1/kyc/kalshi?wallet_address=...`. */
805
812
  interface DFlowKYCStatus {
@@ -808,15 +815,40 @@ interface DFlowKYCStatus {
808
815
  /** URL to redirect the user to for KYC onboarding (provided by server config). */
809
816
  kyc_url: string;
810
817
  }
818
+ /**
819
+ * Which Polymarket wallet model a user is on.
820
+ * - `safe`: legacy Gnosis Safe (signatureType=2, USDC.e, V1 exchanges).
821
+ * - `deposit`: CLOB V2 deposit wallet / ERC-1967 proxy
822
+ * (signatureType=3 / POLY_1271, pUSD, V2 exchanges).
823
+ */
824
+ type PolymarketWalletKind = "safe" | "deposit";
811
825
  /** Response from `GET /api/v1/setup/polymarket?wallet_address=...`. */
812
826
  interface PolymarketSetupStatus {
813
827
  wallet_address: string;
828
+ /** Active wallet model the caller should drive. */
829
+ wallet_kind: PolymarketWalletKind;
830
+ /** Legacy Safe fields. */
814
831
  safe_address?: string;
815
832
  safe_deployed: boolean;
833
+ /** Deposit wallet (CLOB V2) fields. */
834
+ deposit_wallet_address?: string;
835
+ deposit_wallet_deployed: boolean;
816
836
  token_approved: boolean;
817
- /** True when safe_deployed && token_approved. */
837
+ /** True when the active wallet is deployed && token_approved. */
818
838
  verified: boolean;
819
839
  }
840
+ /** Request body for `POST /api/v1/setup/polymarket/deposit/deploy`. */
841
+ interface PolymarketDepositWalletDeployRequest {
842
+ wallet_address: string;
843
+ }
844
+ /** Response from `POST /api/v1/setup/polymarket/deposit/deploy`. */
845
+ interface PolymarketDepositWalletDeployResponse {
846
+ deposit_wallet_address: string;
847
+ deposit_wallet_deployed: boolean;
848
+ transaction_id?: string;
849
+ /** Relayer transaction state, e.g. "STATE_CONFIRMED". */
850
+ status: string;
851
+ }
820
852
  /** WebSocket subscription channel. */
821
853
  type WsChannel = "orderbook" | "prices" | "trades";
822
854
  /** WebSocket connection lifecycle status. */
@@ -898,6 +930,20 @@ interface TickSizeResponse {
898
930
  interface FeeRateResponse {
899
931
  base_fee: number;
900
932
  }
933
+ /**
934
+ * Builder-attribution config from `GET /api/v1/referral/config`. The front-end
935
+ * attaches {@link RebateConfig.builder_code} to CLOB V2 orders (when
936
+ * {@link RebateConfig.builder_enabled}) so fills are credited to our builder
937
+ * program for rebates.
938
+ */
939
+ interface RebateConfig {
940
+ builder_enabled: boolean;
941
+ /** Builder code (bytes32 hex, 0x-prefixed). Empty when not configured. */
942
+ builder_code: string;
943
+ builder_taker_fee_bps: number;
944
+ builder_maker_fee_bps: number;
945
+ commission_ratio: number;
946
+ }
901
947
  /** Aggregate statistics for all open prediction events. */
902
948
  interface EventStats {
903
949
  total_events: number;
@@ -1108,6 +1154,12 @@ declare class PredictClient {
1108
1154
  getPolymarketTickSize(tokenId: string): Promise<TickSizeResponse>;
1109
1155
  /** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
1110
1156
  getPolymarketFeeRate(tokenId: string): Promise<FeeRateResponse>;
1157
+ /**
1158
+ * Builder-attribution / rebate config. Maps to `GET /api/v1/referral/config`.
1159
+ * The front-end uses `builder_code` (when `builder_enabled`) to attribute
1160
+ * CLOB V2 orders to our builder program.
1161
+ */
1162
+ getRebateConfig(): Promise<RebateConfig>;
1111
1163
  /** Maps to `POST /api/v1/orders/kalshi/quote`. */
1112
1164
  createDFlowQuote(body: DFlowQuoteRequest): Promise<DFlowQuoteResponse>;
1113
1165
  /** Maps to `POST /api/v1/orders/kalshi/submit`. */
@@ -1130,6 +1182,16 @@ declare class PredictClient {
1130
1182
  * Maps to `POST /api/v1/setup/polymarket`.
1131
1183
  */
1132
1184
  runPolymarketSetup(walletAddress: string): Promise<PolymarketSetupStatus>;
1185
+ /**
1186
+ * Deploy a Polymarket CLOB V2 deposit wallet (gasless WALLET-CREATE).
1187
+ *
1188
+ * No user signature is required — the relayer deploys the per-user
1189
+ * ERC-1967 proxy and the server waits until it is confirmed on-chain.
1190
+ * Used for new (non-Safe) users on the POLY_1271 path.
1191
+ *
1192
+ * Maps to `POST /api/v1/setup/polymarket/deposit/deploy`.
1193
+ */
1194
+ deployPolymarketDepositWallet(walletAddress: string): Promise<PolymarketDepositWalletDeployResponse>;
1133
1195
  /**
1134
1196
  * List cross-platform matched event groups with inline aggregate stats.
1135
1197
  *
@@ -1796,4 +1858,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
1796
1858
  */
1797
1859
  declare function getPolymarketSharesPrecision(tickSize: string): number;
1798
1860
 
1799
- export { type WsConnectionStatus as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStats as E, type DFlowQuoteResponse as F, type DFlowSubmitResponse as G, type DFlowSubmitRequest as H, type DFlowKYCStatus as I, type PolymarketSetupStatus as J, type WithdrawBuildRequest as K, type ListEventsParams as L, type MatchesParams as M, type WithdrawSubmitResponse as N, type Orderbook as O, PredictClient as P, type WithdrawSubmitRequest as Q, type WithdrawStatusResponse as R, type SimilarEventsParams as S, type PolymarketDepositAddresses as T, type PolymarketSupportedAsset as U, type PolymarketWithdrawResponse as V, type WithdrawBuildResponse as W, type PolymarketWithdrawRequest as X, type PolymarketRedeemResponse as Y, type TickSizeResponse as Z, type FeeRateResponse as _, PredictWsClient as a, type ResolveEventsParamsInput as a$, type WsDataMessage as a0, type WsPriceEvent as a1, type WsOrderbookEvent as a2, type WsTradeEvent as a3, type CreateOrderInput as a4, createPredictClient as a5, createPredictWsClient as a6, type PredictWsClientConfig as a7, type ProviderMeta as a8, type PredictTag as a9, type MatchGroupEntry as aA, type MatchGroupMarket as aB, type MatchSortField as aC, type MatchesStats as aD, type MatchConfidenceTier as aE, type SignalTag as aF, type MatchLeg as aG, type MatchMarketFlat as aH, type WsChannel as aI, type WsChannelEvent as aJ, type WsClientMessage as aK, type WsSubscribeMessage as aL, type WsPingMessage as aM, type WsServerMessage as aN, type WsPongMessage as aO, type WsSubscribedMessage as aP, type WsErrorCode as aQ, type WsErrorMessage as aR, type PolymarketRedeemPrepareInput as aS, type PolymarketRedeemPrepareResponse as aT, type PolymarketRedeemInput as aU, eventQueryKey as aV, fetchEvent as aW, resolveTagSlug as aX, resolveEventsParams as aY, infiniteEventsQueryKey as aZ, fetchEventsPage as a_, type SettlementSource as aa, type MarketStatus as ab, type MarketResult as ac, type MarketOutcome as ad, type OrderbookLevel as ae, type TradeType as af, type EventSummary as ag, type MarketSummary as ah, type PredictCommentProfile as ai, type PricePoint as aj, type PredictPosition as ak, type OrderStatus as al, type OrderSide as am, type DFlowOrderContext as an, type PolymarketOrderType as ao, type DepositBuildRequest as ap, type DepositBuildResponse as aq, type DepositSubmitRequest as ar, type DepositSubmitResponse as as, type DepositStatusResponse as at, type UnsignedTx as au, type PolymarketBridgeToken as av, type PolymarketSupportedAssetsResponse as aw, type PolymarketWithdrawPrepareRequest as ax, type PolymarketWithdrawPrepareResponse as ay, type MatchStatus as az, type PredictPage as b, type TagSlugSelection as b0, marketQueryKey as b1, fetchMarket as b2, matchesQueryKey as b3, matchQueryKey as b4, fetchMatchesPage as b5, matchMarketsQueryKey as b6, fetchMatchMarketsPage as b7, CLOB_AUTH_DOMAIN as b8, CLOB_AUTH_TYPES as b9, buildClobAuthMessage as ba, hmacSha256Base64 as bb, buildPolymarketL2Headers as bc, derivePolymarketApiKey as bd, type HttpMethod as be, type PolymarketL2HeadersInput as bf, type PolymarketL2Headers as bg, type BuildClobAuthMessageInput as bh, CTF_EXCHANGE_ADDRESS as bi, NEG_RISK_CTF_EXCHANGE_ADDRESS as bj, USDC_ADDRESS as bk, POLYGON_CHAIN_ID as bl, buildCtfExchangeDomain as bm, CTF_ORDER_TYPES as bn, ORDER_TYPE as bo, SIDE as bp, buildOrderMessage as bq, buildSignedOrder as br, buildClobPayload as bs, getPolymarketSharesPrecision as bt, type ClobOrderPayload as bu, type BuildOrderMessageInput as bv, type OrderMessage as bw, type SignedOrder as bx, DEFAULT_PAGE_SIZE as by, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type ListMarketTradesParams as h, type PredictTrade as i, type PriceHistoryRange as j, type PriceHistoryResponse as k, type ListCandlesticksParams as l, type ListCommentsParams as m, type PredictComment as n, type PositionsResponse as o, type ListOrdersParams as p, type PredictOrder as q, type ListOrdersMultiParams as r, type PredictOrdersResponse as s, type CancelOrderResult as t, type MatchGroupPage as u, type MatchGroup as v, type MatchMarketParams as w, type MatchMarketPage as x, type ListTradesParams as y, type ListTradesMultiParams as z };
1861
+ export { type FeeRateResponse as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStats as E, type DFlowQuoteResponse as F, type DFlowSubmitResponse as G, type DFlowSubmitRequest as H, type DFlowKYCStatus as I, type PolymarketSetupStatus as J, type PolymarketDepositWalletDeployResponse as K, type ListEventsParams as L, type MatchesParams as M, type WithdrawBuildRequest as N, type Orderbook as O, PredictClient as P, type WithdrawSubmitResponse as Q, type WithdrawSubmitRequest as R, type SimilarEventsParams as S, type WithdrawStatusResponse as T, type PolymarketDepositAddresses as U, type PolymarketSupportedAsset as V, type WithdrawBuildResponse as W, type PolymarketWithdrawResponse as X, type PolymarketWithdrawRequest as Y, type PolymarketRedeemResponse as Z, type TickSizeResponse as _, PredictWsClient as a, resolveTagSlug as a$, type RebateConfig as a0, type WsConnectionStatus as a1, type WsDataMessage as a2, type WsPriceEvent as a3, type WsOrderbookEvent as a4, type WsTradeEvent as a5, type CreateOrderInput as a6, createPredictClient as a7, createPredictWsClient as a8, type PredictWsClientConfig as a9, type PolymarketSupportedAssetsResponse as aA, type PolymarketWithdrawPrepareRequest as aB, type PolymarketWithdrawPrepareResponse as aC, type MatchStatus as aD, type MatchGroupEntry as aE, type MatchGroupMarket as aF, type MatchSortField as aG, type MatchesStats as aH, type MatchConfidenceTier as aI, type SignalTag as aJ, type MatchLeg as aK, type MatchMarketFlat as aL, type WsChannel as aM, type WsChannelEvent as aN, type WsClientMessage as aO, type WsSubscribeMessage as aP, type WsPingMessage as aQ, type WsServerMessage as aR, type WsPongMessage as aS, type WsSubscribedMessage as aT, type WsErrorCode as aU, type WsErrorMessage as aV, type PolymarketRedeemPrepareInput as aW, type PolymarketRedeemPrepareResponse as aX, type PolymarketRedeemInput as aY, eventQueryKey as aZ, fetchEvent as a_, type ProviderMeta as aa, type PredictTag as ab, type SettlementSource as ac, type MarketStatus as ad, type MarketResult as ae, type MarketOutcome as af, type OrderbookLevel as ag, type TradeType as ah, type EventSummary as ai, type MarketSummary as aj, type PredictCommentProfile as ak, type PricePoint as al, type PredictPosition as am, type OrderStatus as an, type OrderSide as ao, type DFlowOrderContext as ap, type PolymarketOrderType as aq, type PolymarketWalletKind as ar, type PolymarketDepositWalletDeployRequest as as, type DepositBuildRequest as at, type DepositBuildResponse as au, type DepositSubmitRequest as av, type DepositSubmitResponse as aw, type DepositStatusResponse as ax, type UnsignedTx as ay, type PolymarketBridgeToken as az, type PredictPage as b, resolveEventsParams as b0, infiniteEventsQueryKey as b1, fetchEventsPage as b2, type ResolveEventsParamsInput as b3, type TagSlugSelection as b4, marketQueryKey as b5, fetchMarket as b6, matchesQueryKey as b7, matchQueryKey as b8, fetchMatchesPage as b9, type OrderMessage as bA, type SignedOrder as bB, DEFAULT_PAGE_SIZE as bC, matchMarketsQueryKey as ba, fetchMatchMarketsPage as bb, CLOB_AUTH_DOMAIN as bc, CLOB_AUTH_TYPES as bd, buildClobAuthMessage as be, hmacSha256Base64 as bf, buildPolymarketL2Headers as bg, derivePolymarketApiKey as bh, type HttpMethod as bi, type PolymarketL2HeadersInput as bj, type PolymarketL2Headers as bk, type BuildClobAuthMessageInput as bl, CTF_EXCHANGE_ADDRESS as bm, NEG_RISK_CTF_EXCHANGE_ADDRESS as bn, USDC_ADDRESS as bo, POLYGON_CHAIN_ID as bp, buildCtfExchangeDomain as bq, CTF_ORDER_TYPES as br, ORDER_TYPE as bs, SIDE as bt, buildOrderMessage as bu, buildSignedOrder as bv, buildClobPayload as bw, getPolymarketSharesPrecision as bx, type ClobOrderPayload as by, type BuildOrderMessageInput as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type ListMarketTradesParams as h, type PredictTrade as i, type PriceHistoryRange as j, type PriceHistoryResponse as k, type ListCandlesticksParams as l, type ListCommentsParams as m, type PredictComment as n, type PositionsResponse as o, type ListOrdersParams as p, type PredictOrder as q, type ListOrdersMultiParams as r, type PredictOrdersResponse as s, type CancelOrderResult as t, type MatchGroupPage as u, type MatchGroup as v, type MatchMarketParams as w, type MatchMarketPage as x, type ListTradesParams as y, type ListTradesMultiParams as z };
@@ -800,6 +800,13 @@ interface CreateOrderInput {
800
800
  * Defaults to the signer address when not provided.
801
801
  */
802
802
  funderAddress?: string;
803
+ /**
804
+ * Builder code (bytes32 hex, 0x-prefixed) for builder-rebate attribution.
805
+ * Only honoured on CLOB V2 (POLY_1271 / deposit-wallet) orders — the V2
806
+ * order struct carries a native `builder` field. Legacy V1 orders have no
807
+ * builder field, so this is ignored there.
808
+ */
809
+ builderCode?: string;
803
810
  }
804
811
  /** Response from `GET /api/v1/kyc/kalshi?wallet_address=...`. */
805
812
  interface DFlowKYCStatus {
@@ -808,15 +815,40 @@ interface DFlowKYCStatus {
808
815
  /** URL to redirect the user to for KYC onboarding (provided by server config). */
809
816
  kyc_url: string;
810
817
  }
818
+ /**
819
+ * Which Polymarket wallet model a user is on.
820
+ * - `safe`: legacy Gnosis Safe (signatureType=2, USDC.e, V1 exchanges).
821
+ * - `deposit`: CLOB V2 deposit wallet / ERC-1967 proxy
822
+ * (signatureType=3 / POLY_1271, pUSD, V2 exchanges).
823
+ */
824
+ type PolymarketWalletKind = "safe" | "deposit";
811
825
  /** Response from `GET /api/v1/setup/polymarket?wallet_address=...`. */
812
826
  interface PolymarketSetupStatus {
813
827
  wallet_address: string;
828
+ /** Active wallet model the caller should drive. */
829
+ wallet_kind: PolymarketWalletKind;
830
+ /** Legacy Safe fields. */
814
831
  safe_address?: string;
815
832
  safe_deployed: boolean;
833
+ /** Deposit wallet (CLOB V2) fields. */
834
+ deposit_wallet_address?: string;
835
+ deposit_wallet_deployed: boolean;
816
836
  token_approved: boolean;
817
- /** True when safe_deployed && token_approved. */
837
+ /** True when the active wallet is deployed && token_approved. */
818
838
  verified: boolean;
819
839
  }
840
+ /** Request body for `POST /api/v1/setup/polymarket/deposit/deploy`. */
841
+ interface PolymarketDepositWalletDeployRequest {
842
+ wallet_address: string;
843
+ }
844
+ /** Response from `POST /api/v1/setup/polymarket/deposit/deploy`. */
845
+ interface PolymarketDepositWalletDeployResponse {
846
+ deposit_wallet_address: string;
847
+ deposit_wallet_deployed: boolean;
848
+ transaction_id?: string;
849
+ /** Relayer transaction state, e.g. "STATE_CONFIRMED". */
850
+ status: string;
851
+ }
820
852
  /** WebSocket subscription channel. */
821
853
  type WsChannel = "orderbook" | "prices" | "trades";
822
854
  /** WebSocket connection lifecycle status. */
@@ -898,6 +930,20 @@ interface TickSizeResponse {
898
930
  interface FeeRateResponse {
899
931
  base_fee: number;
900
932
  }
933
+ /**
934
+ * Builder-attribution config from `GET /api/v1/referral/config`. The front-end
935
+ * attaches {@link RebateConfig.builder_code} to CLOB V2 orders (when
936
+ * {@link RebateConfig.builder_enabled}) so fills are credited to our builder
937
+ * program for rebates.
938
+ */
939
+ interface RebateConfig {
940
+ builder_enabled: boolean;
941
+ /** Builder code (bytes32 hex, 0x-prefixed). Empty when not configured. */
942
+ builder_code: string;
943
+ builder_taker_fee_bps: number;
944
+ builder_maker_fee_bps: number;
945
+ commission_ratio: number;
946
+ }
901
947
  /** Aggregate statistics for all open prediction events. */
902
948
  interface EventStats {
903
949
  total_events: number;
@@ -1108,6 +1154,12 @@ declare class PredictClient {
1108
1154
  getPolymarketTickSize(tokenId: string): Promise<TickSizeResponse>;
1109
1155
  /** Maps to `GET /api/v1/polymarket/fee-rate?token_id=xxx`. */
1110
1156
  getPolymarketFeeRate(tokenId: string): Promise<FeeRateResponse>;
1157
+ /**
1158
+ * Builder-attribution / rebate config. Maps to `GET /api/v1/referral/config`.
1159
+ * The front-end uses `builder_code` (when `builder_enabled`) to attribute
1160
+ * CLOB V2 orders to our builder program.
1161
+ */
1162
+ getRebateConfig(): Promise<RebateConfig>;
1111
1163
  /** Maps to `POST /api/v1/orders/kalshi/quote`. */
1112
1164
  createDFlowQuote(body: DFlowQuoteRequest): Promise<DFlowQuoteResponse>;
1113
1165
  /** Maps to `POST /api/v1/orders/kalshi/submit`. */
@@ -1130,6 +1182,16 @@ declare class PredictClient {
1130
1182
  * Maps to `POST /api/v1/setup/polymarket`.
1131
1183
  */
1132
1184
  runPolymarketSetup(walletAddress: string): Promise<PolymarketSetupStatus>;
1185
+ /**
1186
+ * Deploy a Polymarket CLOB V2 deposit wallet (gasless WALLET-CREATE).
1187
+ *
1188
+ * No user signature is required — the relayer deploys the per-user
1189
+ * ERC-1967 proxy and the server waits until it is confirmed on-chain.
1190
+ * Used for new (non-Safe) users on the POLY_1271 path.
1191
+ *
1192
+ * Maps to `POST /api/v1/setup/polymarket/deposit/deploy`.
1193
+ */
1194
+ deployPolymarketDepositWallet(walletAddress: string): Promise<PolymarketDepositWalletDeployResponse>;
1133
1195
  /**
1134
1196
  * List cross-platform matched event groups with inline aggregate stats.
1135
1197
  *
@@ -1796,4 +1858,4 @@ declare function buildClobPayload(signedOrder: SignedOrder, owner: string): Clob
1796
1858
  */
1797
1859
  declare function getPolymarketSharesPrecision(tickSize: string): number;
1798
1860
 
1799
- export { type WsConnectionStatus as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStats as E, type DFlowQuoteResponse as F, type DFlowSubmitResponse as G, type DFlowSubmitRequest as H, type DFlowKYCStatus as I, type PolymarketSetupStatus as J, type WithdrawBuildRequest as K, type ListEventsParams as L, type MatchesParams as M, type WithdrawSubmitResponse as N, type Orderbook as O, PredictClient as P, type WithdrawSubmitRequest as Q, type WithdrawStatusResponse as R, type SimilarEventsParams as S, type PolymarketDepositAddresses as T, type PolymarketSupportedAsset as U, type PolymarketWithdrawResponse as V, type WithdrawBuildResponse as W, type PolymarketWithdrawRequest as X, type PolymarketRedeemResponse as Y, type TickSizeResponse as Z, type FeeRateResponse as _, PredictWsClient as a, type ResolveEventsParamsInput as a$, type WsDataMessage as a0, type WsPriceEvent as a1, type WsOrderbookEvent as a2, type WsTradeEvent as a3, type CreateOrderInput as a4, createPredictClient as a5, createPredictWsClient as a6, type PredictWsClientConfig as a7, type ProviderMeta as a8, type PredictTag as a9, type MatchGroupEntry as aA, type MatchGroupMarket as aB, type MatchSortField as aC, type MatchesStats as aD, type MatchConfidenceTier as aE, type SignalTag as aF, type MatchLeg as aG, type MatchMarketFlat as aH, type WsChannel as aI, type WsChannelEvent as aJ, type WsClientMessage as aK, type WsSubscribeMessage as aL, type WsPingMessage as aM, type WsServerMessage as aN, type WsPongMessage as aO, type WsSubscribedMessage as aP, type WsErrorCode as aQ, type WsErrorMessage as aR, type PolymarketRedeemPrepareInput as aS, type PolymarketRedeemPrepareResponse as aT, type PolymarketRedeemInput as aU, eventQueryKey as aV, fetchEvent as aW, resolveTagSlug as aX, resolveEventsParams as aY, infiniteEventsQueryKey as aZ, fetchEventsPage as a_, type SettlementSource as aa, type MarketStatus as ab, type MarketResult as ac, type MarketOutcome as ad, type OrderbookLevel as ae, type TradeType as af, type EventSummary as ag, type MarketSummary as ah, type PredictCommentProfile as ai, type PricePoint as aj, type PredictPosition as ak, type OrderStatus as al, type OrderSide as am, type DFlowOrderContext as an, type PolymarketOrderType as ao, type DepositBuildRequest as ap, type DepositBuildResponse as aq, type DepositSubmitRequest as ar, type DepositSubmitResponse as as, type DepositStatusResponse as at, type UnsignedTx as au, type PolymarketBridgeToken as av, type PolymarketSupportedAssetsResponse as aw, type PolymarketWithdrawPrepareRequest as ax, type PolymarketWithdrawPrepareResponse as ay, type MatchStatus as az, type PredictPage as b, type TagSlugSelection as b0, marketQueryKey as b1, fetchMarket as b2, matchesQueryKey as b3, matchQueryKey as b4, fetchMatchesPage as b5, matchMarketsQueryKey as b6, fetchMatchMarketsPage as b7, CLOB_AUTH_DOMAIN as b8, CLOB_AUTH_TYPES as b9, buildClobAuthMessage as ba, hmacSha256Base64 as bb, buildPolymarketL2Headers as bc, derivePolymarketApiKey as bd, type HttpMethod as be, type PolymarketL2HeadersInput as bf, type PolymarketL2Headers as bg, type BuildClobAuthMessageInput as bh, CTF_EXCHANGE_ADDRESS as bi, NEG_RISK_CTF_EXCHANGE_ADDRESS as bj, USDC_ADDRESS as bk, POLYGON_CHAIN_ID as bl, buildCtfExchangeDomain as bm, CTF_ORDER_TYPES as bn, ORDER_TYPE as bo, SIDE as bp, buildOrderMessage as bq, buildSignedOrder as br, buildClobPayload as bs, getPolymarketSharesPrecision as bt, type ClobOrderPayload as bu, type BuildOrderMessageInput as bv, type OrderMessage as bw, type SignedOrder as bx, DEFAULT_PAGE_SIZE as by, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type ListMarketTradesParams as h, type PredictTrade as i, type PriceHistoryRange as j, type PriceHistoryResponse as k, type ListCandlesticksParams as l, type ListCommentsParams as m, type PredictComment as n, type PositionsResponse as o, type ListOrdersParams as p, type PredictOrder as q, type ListOrdersMultiParams as r, type PredictOrdersResponse as s, type CancelOrderResult as t, type MatchGroupPage as u, type MatchGroup as v, type MatchMarketParams as w, type MatchMarketPage as x, type ListTradesParams as y, type ListTradesMultiParams as z };
1861
+ export { type FeeRateResponse as $, type AvailableSharesResponse as A, type BalanceResponse as B, type Candlestick as C, type DFlowQuoteRequest as D, type EventStats as E, type DFlowQuoteResponse as F, type DFlowSubmitResponse as G, type DFlowSubmitRequest as H, type DFlowKYCStatus as I, type PolymarketSetupStatus as J, type PolymarketDepositWalletDeployResponse as K, type ListEventsParams as L, type MatchesParams as M, type WithdrawBuildRequest as N, type Orderbook as O, PredictClient as P, type WithdrawSubmitResponse as Q, type WithdrawSubmitRequest as R, type SimilarEventsParams as S, type WithdrawStatusResponse as T, type PolymarketDepositAddresses as U, type PolymarketSupportedAsset as V, type WithdrawBuildResponse as W, type PolymarketWithdrawResponse as X, type PolymarketWithdrawRequest as Y, type PolymarketRedeemResponse as Z, type TickSizeResponse as _, PredictWsClient as a, resolveTagSlug as a$, type RebateConfig as a0, type WsConnectionStatus as a1, type WsDataMessage as a2, type WsPriceEvent as a3, type WsOrderbookEvent as a4, type WsTradeEvent as a5, type CreateOrderInput as a6, createPredictClient as a7, createPredictWsClient as a8, type PredictWsClientConfig as a9, type PolymarketSupportedAssetsResponse as aA, type PolymarketWithdrawPrepareRequest as aB, type PolymarketWithdrawPrepareResponse as aC, type MatchStatus as aD, type MatchGroupEntry as aE, type MatchGroupMarket as aF, type MatchSortField as aG, type MatchesStats as aH, type MatchConfidenceTier as aI, type SignalTag as aJ, type MatchLeg as aK, type MatchMarketFlat as aL, type WsChannel as aM, type WsChannelEvent as aN, type WsClientMessage as aO, type WsSubscribeMessage as aP, type WsPingMessage as aQ, type WsServerMessage as aR, type WsPongMessage as aS, type WsSubscribedMessage as aT, type WsErrorCode as aU, type WsErrorMessage as aV, type PolymarketRedeemPrepareInput as aW, type PolymarketRedeemPrepareResponse as aX, type PolymarketRedeemInput as aY, eventQueryKey as aZ, fetchEvent as a_, type ProviderMeta as aa, type PredictTag as ab, type SettlementSource as ac, type MarketStatus as ad, type MarketResult as ae, type MarketOutcome as af, type OrderbookLevel as ag, type TradeType as ah, type EventSummary as ai, type MarketSummary as aj, type PredictCommentProfile as ak, type PricePoint as al, type PredictPosition as am, type OrderStatus as an, type OrderSide as ao, type DFlowOrderContext as ap, type PolymarketOrderType as aq, type PolymarketWalletKind as ar, type PolymarketDepositWalletDeployRequest as as, type DepositBuildRequest as at, type DepositBuildResponse as au, type DepositSubmitRequest as av, type DepositSubmitResponse as aw, type DepositStatusResponse as ax, type UnsignedTx as ay, type PolymarketBridgeToken as az, type PredictPage as b, resolveEventsParams as b0, infiniteEventsQueryKey as b1, fetchEventsPage as b2, type ResolveEventsParamsInput as b3, type TagSlugSelection as b4, marketQueryKey as b5, fetchMarket as b6, matchesQueryKey as b7, matchQueryKey as b8, fetchMatchesPage as b9, type OrderMessage as bA, type SignedOrder as bB, DEFAULT_PAGE_SIZE as bC, matchMarketsQueryKey as ba, fetchMatchMarketsPage as bb, CLOB_AUTH_DOMAIN as bc, CLOB_AUTH_TYPES as bd, buildClobAuthMessage as be, hmacSha256Base64 as bf, buildPolymarketL2Headers as bg, derivePolymarketApiKey as bh, type HttpMethod as bi, type PolymarketL2HeadersInput as bj, type PolymarketL2Headers as bk, type BuildClobAuthMessageInput as bl, CTF_EXCHANGE_ADDRESS as bm, NEG_RISK_CTF_EXCHANGE_ADDRESS as bn, USDC_ADDRESS as bo, POLYGON_CHAIN_ID as bp, buildCtfExchangeDomain as bq, CTF_ORDER_TYPES as br, ORDER_TYPE as bs, SIDE as bt, buildOrderMessage as bu, buildSignedOrder as bv, buildClobPayload as bw, getPolymarketSharesPrecision as bx, type ClobOrderPayload as by, type BuildOrderMessageInput as bz, type PredictEvent as c, type ProviderSource as d, type EventStatus as e, type EventSortField as f, type PredictMarket as g, type ListMarketTradesParams as h, type PredictTrade as i, type PriceHistoryRange as j, type PriceHistoryResponse as k, type ListCandlesticksParams as l, type ListCommentsParams as m, type PredictComment as n, type PositionsResponse as o, type ListOrdersParams as p, type PredictOrder as q, type ListOrdersMultiParams as r, type PredictOrdersResponse as s, type CancelOrderResult as t, type MatchGroupPage as u, type MatchGroup as v, type MatchMarketParams as w, type MatchMarketPage as x, type ListTradesParams as y, type ListTradesMultiParams as z };
package/dist/server.d.mts CHANGED
@@ -1 +1 @@
1
- export { B as BalanceResponse, bh as BuildClobAuthMessageInput, bv as BuildOrderMessageInput, b8 as CLOB_AUTH_DOMAIN, b9 as CLOB_AUTH_TYPES, bi as CTF_EXCHANGE_ADDRESS, bn as CTF_ORDER_TYPES, t as CancelOrderResult, C as Candlestick, bu as ClobOrderPayload, a4 as CreateOrderInput, by as DEFAULT_PAGE_SIZE, an as DFlowOrderContext, D as DFlowQuoteRequest, F as DFlowQuoteResponse, H as DFlowSubmitRequest, G as DFlowSubmitResponse, ap as DepositBuildRequest, aq as DepositBuildResponse, at as DepositStatusResponse, ar as DepositSubmitRequest, as as DepositSubmitResponse, f as EventSortField, e as EventStatus, ag as EventSummary, be as HttpMethod, l as ListCandlesticksParams, L as ListEventsParams, h as ListMarketTradesParams, p as ListOrdersParams, y as ListTradesParams, ad as MarketOutcome, ac as MarketResult, ab as MarketStatus, ah as MarketSummary, aE as MatchConfidenceTier, v as MatchGroup, aA as MatchGroupEntry, aB as MatchGroupMarket, u as MatchGroupPage, aG as MatchLeg, aH as MatchMarketFlat, x as MatchMarketPage, w as MatchMarketParams, aC as MatchSortField, az as MatchStatus, M as MatchesParams, aD as MatchesStats, bj as NEG_RISK_CTF_EXCHANGE_ADDRESS, bo as ORDER_TYPE, bw as OrderMessage, am as OrderSide, al as OrderStatus, O as Orderbook, ae as OrderbookLevel, bl as POLYGON_CHAIN_ID, bg as PolymarketL2Headers, bf as PolymarketL2HeadersInput, ao as PolymarketOrderType, o as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, q as PredictOrder, b as PredictPage, ak as PredictPosition, a9 as PredictTag, i as PredictTrade, a as PredictWsClient, a7 as PredictWsClientConfig, j as PriceHistoryRange, k as PriceHistoryResponse, aj as PricePoint, a8 as ProviderMeta, d as ProviderSource, a$ as ResolveEventsParamsInput, bp as SIDE, aa as SettlementSource, aF as SignalTag, bx as SignedOrder, S as SimilarEventsParams, b0 as TagSlugSelection, af as TradeType, bk as USDC_ADDRESS, au as UnsignedTx, aI as WsChannel, aJ as WsChannelEvent, aK as WsClientMessage, $ as WsConnectionStatus, a0 as WsDataMessage, aQ as WsErrorCode, aR as WsErrorMessage, a2 as WsOrderbookEvent, aM as WsPingMessage, aO as WsPongMessage, a1 as WsPriceEvent, aN as WsServerMessage, aL as WsSubscribeMessage, aP as WsSubscribedMessage, a3 as WsTradeEvent, ba as buildClobAuthMessage, bs as buildClobPayload, bm as buildCtfExchangeDomain, bq as buildOrderMessage, bc as buildPolymarketL2Headers, br as buildSignedOrder, a5 as createPredictClient, a6 as createPredictWsClient, bd as derivePolymarketApiKey, aV as eventQueryKey, aW as fetchEvent, a_ as fetchEventsPage, b2 as fetchMarket, b7 as fetchMatchMarketsPage, b5 as fetchMatchesPage, bb as hmacSha256Base64, aZ as infiniteEventsQueryKey, b1 as marketQueryKey, b6 as matchMarketsQueryKey, b4 as matchQueryKey, b3 as matchesQueryKey, aY as resolveEventsParams, aX as resolveTagSlug } from './server-FZwoxwxh.mjs';
1
+ export { B as BalanceResponse, bl as BuildClobAuthMessageInput, bz as BuildOrderMessageInput, bc as CLOB_AUTH_DOMAIN, bd as CLOB_AUTH_TYPES, bm as CTF_EXCHANGE_ADDRESS, br as CTF_ORDER_TYPES, t as CancelOrderResult, C as Candlestick, by as ClobOrderPayload, a6 as CreateOrderInput, bC as DEFAULT_PAGE_SIZE, ap as DFlowOrderContext, D as DFlowQuoteRequest, F as DFlowQuoteResponse, H as DFlowSubmitRequest, G as DFlowSubmitResponse, at as DepositBuildRequest, au as DepositBuildResponse, ax as DepositStatusResponse, av as DepositSubmitRequest, aw as DepositSubmitResponse, f as EventSortField, e as EventStatus, ai as EventSummary, bi as HttpMethod, l as ListCandlesticksParams, L as ListEventsParams, h as ListMarketTradesParams, p as ListOrdersParams, y as ListTradesParams, af as MarketOutcome, ae as MarketResult, ad as MarketStatus, aj as MarketSummary, aI as MatchConfidenceTier, v as MatchGroup, aE as MatchGroupEntry, aF as MatchGroupMarket, u as MatchGroupPage, aK as MatchLeg, aL as MatchMarketFlat, x as MatchMarketPage, w as MatchMarketParams, aG as MatchSortField, aD as MatchStatus, M as MatchesParams, aH as MatchesStats, bn as NEG_RISK_CTF_EXCHANGE_ADDRESS, bs as ORDER_TYPE, bA as OrderMessage, ao as OrderSide, an as OrderStatus, O as Orderbook, ag as OrderbookLevel, bp as POLYGON_CHAIN_ID, bk as PolymarketL2Headers, bj as PolymarketL2HeadersInput, aq as PolymarketOrderType, o as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, q as PredictOrder, b as PredictPage, am as PredictPosition, ab as PredictTag, i as PredictTrade, a as PredictWsClient, a9 as PredictWsClientConfig, j as PriceHistoryRange, k as PriceHistoryResponse, al as PricePoint, aa as ProviderMeta, d as ProviderSource, b3 as ResolveEventsParamsInput, bt as SIDE, ac as SettlementSource, aJ as SignalTag, bB as SignedOrder, S as SimilarEventsParams, b4 as TagSlugSelection, ah as TradeType, bo as USDC_ADDRESS, ay as UnsignedTx, aM as WsChannel, aN as WsChannelEvent, aO as WsClientMessage, a1 as WsConnectionStatus, a2 as WsDataMessage, aU as WsErrorCode, aV as WsErrorMessage, a4 as WsOrderbookEvent, aQ as WsPingMessage, aS as WsPongMessage, a3 as WsPriceEvent, aR as WsServerMessage, aP as WsSubscribeMessage, aT as WsSubscribedMessage, a5 as WsTradeEvent, be as buildClobAuthMessage, bw as buildClobPayload, bq as buildCtfExchangeDomain, bu as buildOrderMessage, bg as buildPolymarketL2Headers, bv as buildSignedOrder, a7 as createPredictClient, a8 as createPredictWsClient, bh as derivePolymarketApiKey, aZ as eventQueryKey, a_ as fetchEvent, b2 as fetchEventsPage, b6 as fetchMarket, bb as fetchMatchMarketsPage, b9 as fetchMatchesPage, bf as hmacSha256Base64, b1 as infiniteEventsQueryKey, b5 as marketQueryKey, ba as matchMarketsQueryKey, b8 as matchQueryKey, b7 as matchesQueryKey, b0 as resolveEventsParams, a$ as resolveTagSlug } from './server-DfzGla54.mjs';
package/dist/server.d.ts CHANGED
@@ -1 +1 @@
1
- export { B as BalanceResponse, bh as BuildClobAuthMessageInput, bv as BuildOrderMessageInput, b8 as CLOB_AUTH_DOMAIN, b9 as CLOB_AUTH_TYPES, bi as CTF_EXCHANGE_ADDRESS, bn as CTF_ORDER_TYPES, t as CancelOrderResult, C as Candlestick, bu as ClobOrderPayload, a4 as CreateOrderInput, by as DEFAULT_PAGE_SIZE, an as DFlowOrderContext, D as DFlowQuoteRequest, F as DFlowQuoteResponse, H as DFlowSubmitRequest, G as DFlowSubmitResponse, ap as DepositBuildRequest, aq as DepositBuildResponse, at as DepositStatusResponse, ar as DepositSubmitRequest, as as DepositSubmitResponse, f as EventSortField, e as EventStatus, ag as EventSummary, be as HttpMethod, l as ListCandlesticksParams, L as ListEventsParams, h as ListMarketTradesParams, p as ListOrdersParams, y as ListTradesParams, ad as MarketOutcome, ac as MarketResult, ab as MarketStatus, ah as MarketSummary, aE as MatchConfidenceTier, v as MatchGroup, aA as MatchGroupEntry, aB as MatchGroupMarket, u as MatchGroupPage, aG as MatchLeg, aH as MatchMarketFlat, x as MatchMarketPage, w as MatchMarketParams, aC as MatchSortField, az as MatchStatus, M as MatchesParams, aD as MatchesStats, bj as NEG_RISK_CTF_EXCHANGE_ADDRESS, bo as ORDER_TYPE, bw as OrderMessage, am as OrderSide, al as OrderStatus, O as Orderbook, ae as OrderbookLevel, bl as POLYGON_CHAIN_ID, bg as PolymarketL2Headers, bf as PolymarketL2HeadersInput, ao as PolymarketOrderType, o as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, q as PredictOrder, b as PredictPage, ak as PredictPosition, a9 as PredictTag, i as PredictTrade, a as PredictWsClient, a7 as PredictWsClientConfig, j as PriceHistoryRange, k as PriceHistoryResponse, aj as PricePoint, a8 as ProviderMeta, d as ProviderSource, a$ as ResolveEventsParamsInput, bp as SIDE, aa as SettlementSource, aF as SignalTag, bx as SignedOrder, S as SimilarEventsParams, b0 as TagSlugSelection, af as TradeType, bk as USDC_ADDRESS, au as UnsignedTx, aI as WsChannel, aJ as WsChannelEvent, aK as WsClientMessage, $ as WsConnectionStatus, a0 as WsDataMessage, aQ as WsErrorCode, aR as WsErrorMessage, a2 as WsOrderbookEvent, aM as WsPingMessage, aO as WsPongMessage, a1 as WsPriceEvent, aN as WsServerMessage, aL as WsSubscribeMessage, aP as WsSubscribedMessage, a3 as WsTradeEvent, ba as buildClobAuthMessage, bs as buildClobPayload, bm as buildCtfExchangeDomain, bq as buildOrderMessage, bc as buildPolymarketL2Headers, br as buildSignedOrder, a5 as createPredictClient, a6 as createPredictWsClient, bd as derivePolymarketApiKey, aV as eventQueryKey, aW as fetchEvent, a_ as fetchEventsPage, b2 as fetchMarket, b7 as fetchMatchMarketsPage, b5 as fetchMatchesPage, bb as hmacSha256Base64, aZ as infiniteEventsQueryKey, b1 as marketQueryKey, b6 as matchMarketsQueryKey, b4 as matchQueryKey, b3 as matchesQueryKey, aY as resolveEventsParams, aX as resolveTagSlug } from './server-FZwoxwxh.js';
1
+ export { B as BalanceResponse, bl as BuildClobAuthMessageInput, bz as BuildOrderMessageInput, bc as CLOB_AUTH_DOMAIN, bd as CLOB_AUTH_TYPES, bm as CTF_EXCHANGE_ADDRESS, br as CTF_ORDER_TYPES, t as CancelOrderResult, C as Candlestick, by as ClobOrderPayload, a6 as CreateOrderInput, bC as DEFAULT_PAGE_SIZE, ap as DFlowOrderContext, D as DFlowQuoteRequest, F as DFlowQuoteResponse, H as DFlowSubmitRequest, G as DFlowSubmitResponse, at as DepositBuildRequest, au as DepositBuildResponse, ax as DepositStatusResponse, av as DepositSubmitRequest, aw as DepositSubmitResponse, f as EventSortField, e as EventStatus, ai as EventSummary, bi as HttpMethod, l as ListCandlesticksParams, L as ListEventsParams, h as ListMarketTradesParams, p as ListOrdersParams, y as ListTradesParams, af as MarketOutcome, ae as MarketResult, ad as MarketStatus, aj as MarketSummary, aI as MatchConfidenceTier, v as MatchGroup, aE as MatchGroupEntry, aF as MatchGroupMarket, u as MatchGroupPage, aK as MatchLeg, aL as MatchMarketFlat, x as MatchMarketPage, w as MatchMarketParams, aG as MatchSortField, aD as MatchStatus, M as MatchesParams, aH as MatchesStats, bn as NEG_RISK_CTF_EXCHANGE_ADDRESS, bs as ORDER_TYPE, bA as OrderMessage, ao as OrderSide, an as OrderStatus, O as Orderbook, ag as OrderbookLevel, bp as POLYGON_CHAIN_ID, bk as PolymarketL2Headers, bj as PolymarketL2HeadersInput, aq as PolymarketOrderType, o as PositionsResponse, P as PredictClient, c as PredictEvent, g as PredictMarket, q as PredictOrder, b as PredictPage, am as PredictPosition, ab as PredictTag, i as PredictTrade, a as PredictWsClient, a9 as PredictWsClientConfig, j as PriceHistoryRange, k as PriceHistoryResponse, al as PricePoint, aa as ProviderMeta, d as ProviderSource, b3 as ResolveEventsParamsInput, bt as SIDE, ac as SettlementSource, aJ as SignalTag, bB as SignedOrder, S as SimilarEventsParams, b4 as TagSlugSelection, ah as TradeType, bo as USDC_ADDRESS, ay as UnsignedTx, aM as WsChannel, aN as WsChannelEvent, aO as WsClientMessage, a1 as WsConnectionStatus, a2 as WsDataMessage, aU as WsErrorCode, aV as WsErrorMessage, a4 as WsOrderbookEvent, aQ as WsPingMessage, aS as WsPongMessage, a3 as WsPriceEvent, aR as WsServerMessage, aP as WsSubscribeMessage, aT as WsSubscribedMessage, a5 as WsTradeEvent, be as buildClobAuthMessage, bw as buildClobPayload, bq as buildCtfExchangeDomain, bu as buildOrderMessage, bg as buildPolymarketL2Headers, bv as buildSignedOrder, a7 as createPredictClient, a8 as createPredictWsClient, bh as derivePolymarketApiKey, aZ as eventQueryKey, a_ as fetchEvent, b2 as fetchEventsPage, b6 as fetchMarket, bb as fetchMatchMarketsPage, b9 as fetchMatchesPage, bf as hmacSha256Base64, b1 as infiniteEventsQueryKey, b5 as marketQueryKey, ba as matchMarketsQueryKey, b8 as matchQueryKey, b7 as matchesQueryKey, b0 as resolveEventsParams, a$ as resolveTagSlug } from './server-DfzGla54.js';
package/dist/server.js CHANGED
@@ -359,6 +359,15 @@ var PredictClient = class {
359
359
  const url = `${this.endpoint}/api/v1/polymarket/fee-rate?token_id=${encodeURIComponent(tokenId)}`;
360
360
  return await utils.httpGet(url);
361
361
  }
362
+ /**
363
+ * Builder-attribution / rebate config. Maps to `GET /api/v1/referral/config`.
364
+ * The front-end uses `builder_code` (when `builder_enabled`) to attribute
365
+ * CLOB V2 orders to our builder program.
366
+ */
367
+ async getRebateConfig() {
368
+ const url = `${this.endpoint}/api/v1/referral/config`;
369
+ return await utils.httpGet(url);
370
+ }
362
371
  // -------------------------------------------------------------------------
363
372
  // DFlow trading
364
373
  // -------------------------------------------------------------------------
@@ -409,6 +418,21 @@ var PredictClient = class {
409
418
  wallet_address: walletAddress
410
419
  });
411
420
  }
421
+ /**
422
+ * Deploy a Polymarket CLOB V2 deposit wallet (gasless WALLET-CREATE).
423
+ *
424
+ * No user signature is required — the relayer deploys the per-user
425
+ * ERC-1967 proxy and the server waits until it is confirmed on-chain.
426
+ * Used for new (non-Safe) users on the POLY_1271 path.
427
+ *
428
+ * Maps to `POST /api/v1/setup/polymarket/deposit/deploy`.
429
+ */
430
+ async deployPolymarketDepositWallet(walletAddress) {
431
+ const url = `${this.endpoint}/api/v1/setup/polymarket/deposit/deploy`;
432
+ return await utils.httpPost(url, {
433
+ wallet_address: walletAddress
434
+ });
435
+ }
412
436
  // -------------------------------------------------------------------------
413
437
  // Cross-platform matches
414
438
  // -------------------------------------------------------------------------