Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fetch-deposit-wallet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/client": patch
---

Add `fetchDepositWallet`, a low-level action that resolves the Deposit Wallet address for a signer address: the existing deployed UUPS Deposit Wallet when there is one, or the signer's Beacon Deposit Wallet otherwise.
5 changes: 5 additions & 0 deletions .changeset/insufficient-allowance-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/client": patch
---

Add `InsufficientAllowanceError`, thrown when order posting is rejected because the account's balance or token allowance cannot fund the order. Previously this surfaced as a generic `RequestRejectedError` whose message had to be string-matched; the rejection is now typed at the posting boundary and included in the `PostOrderError`, `PostOrdersError`, `PlaceMarketOrderError`, and `PlaceLimitOrderError` unions. The internal allowance-recovery detection now uses the typed error.
5 changes: 5 additions & 0 deletions .changeset/react-base-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/client": patch
---

Add `createBaseClient`, a low-level factory that creates a client without bound action methods for consumers that call standalone actions directly and want per-action tree-shaking.
5 changes: 5 additions & 0 deletions .changeset/react-package-scaffold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/react": minor
---

Initial `@polymarket/react` release: `PolymarketProvider` with `createConfig`, read hooks with `skip` pausing, `usePolymarketClient`, and the discovery hooks `useMarket`, `useMarkets`, `useEvents`, and `useOrderBook`.
5 changes: 5 additions & 0 deletions .changeset/react-portfolio-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/react": minor
---

Add portfolio and account hooks: `usePositions`, `useClosedPositions`, `usePortfolioValue`, and `useActivity` read per-address public data with the `user` defaulting to the session wallet (paused while unauthenticated, explicit `user` works without a session); `useBalance`, `useNotifications`, `useOrder`, and `useTradingRestriction` read session-bound account state; `useDropNotifications` dismisses notifications; `useEstimatedMarketPrice` previews the price level a market order would cross at current book depth.
5 changes: 5 additions & 0 deletions .changeset/react-secure-client-seams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/client": patch
---

Add `createBaseSecureClient`, a low-level factory that restores an authenticated client from existing session credentials without bound action methods and without running an authentication workflow. Promote `beginAuthentication` to the public API and export the workflow request/response vocabulary types from the root entry point.
5 changes: 5 additions & 0 deletions .changeset/react-trading-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/react": minor
---

Add trading hooks: `usePlaceMarketOrder` and `usePlaceLimitOrder` drive the order posting workflows through the workflow handler with `step` progress state and no automatic allowance recovery — insufficient balance/allowance rejections surface as the typed `InsufficientAllowanceError` for the integrator to handle; `useSetupTradingApprovals` covers account readiness and allowance recovery through the gasless relayer; `useCancelOrder` cancels open orders. Write executions while unauthenticated reject with the new `UnauthenticatedError`.
5 changes: 5 additions & 0 deletions .changeset/react-trading-hub-hooks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/react": minor
---

Round out the trading-hub hook surface. Reads: `useEvent`, `usePriceHistory`, `useMidpoint`, `useLastTradePrice`, `useSearch` (grouped first-page results), `useTags`, `useRelatedTags`, `useComments`, `usePublicProfile`, `useMarketHolders`, and `useTraderLeaderboard`. Gasless lifecycle writes resolving at transaction confirmation: `useRedeemPositions` (claim winnings), `useSplitPosition`, `useMergePositions`, and `useTransfer` (withdraw). Account activation stays an explicit step: `useIsWalletDeployed` reads the session wallet's deployment status and `useDeployWallet` deploys it signature-free through the relayer.
5 changes: 5 additions & 0 deletions .changeset/react-wallet-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@polymarket/react": minor
---

Add wallet and session authentication: `useAuthentication` with workflow-handler-driven `authenticate()` and `logout()`, serializable `Session` with synchronous `initialSession` restore, the signature-only `WorkflowHandler` contract with cancellation, secure read hooks that pause until authenticated and end the session on 401, `useOpenOrders`, and the `@polymarket/react/viem` entry point with `useWorkflowHandler`.
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
- Each action in `packages/client/src/actions/` has a corresponding bound method in a decorator under `packages/client/src/decorators/`. When you change an action — its signature, parameter types, TSDoc, or examples — verify the matching decorator method is also updated. The decorator method is the public surface most consumers see.
- The `@polymarket/client` root entry point exports decorators, so new public client additions must be re-exported by the corresponding decorator module.
- Do not leak `ky` details outside of `ServiceClient`. Keep `ky` instances, types, and option shapes internal, and expose Polymarket-specific abstractions instead.
- Wallet-library integrations must stay isolated to their entry points and optional peer dependencies. If `viem` is an optional peer tied to the `viem` entry point, non-`viem` code paths must not import `viem`. Apply the same rule to future entry points for other wallet libraries such as Ethers, Privy, Safe SDK, or Turnkey.
- Wallet-library integrations must stay isolated to their entry points and optional peer dependencies. If `viem` is an optional peer tied to the `viem` entry point, non-`viem` code paths must not import `viem`, not even type-only imports. Apply the same rule to future entry points for other wallet libraries such as Ethers, Privy, Safe SDK, or Turnkey, and to every package in this repo, including `@polymarket/react`. Enforce this in review; do not add runtime tests for it.

## TypeScript config

Expand Down
Loading
Loading