You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`src/scopes.ts`|`OPENSEA_SCOPES` — OAuth-style API scope string constants |
26
28
|`src/sdk/base.ts`|`BaseOpenSeaSDK` — shared logic for both providers |
27
29
|`src/sdk/fulfillment.ts`| Order fulfillment (buy, sell, match) via Seaport |
28
30
|`src/sdk/orders.ts`| Create and manage listings and offers |
@@ -41,7 +43,7 @@ pnpm run check-types # TypeScript type checking (stricter tsconfig)
41
43
42
44
When reviewing changes to this package, verify:
43
45
44
-
1.**Chain enum sync**: The `Chain` enum in `src/types.ts` has a compile-time check (`_AssertAPIChainsCovered`) ensuring every `ChainIdentifier` from `@opensea/api-types` maps to a `Chain` value. When adding a chain, also update `scripts/chain-data.json` at the **monorepo root**, run `pnpm sync-chains` from the monorepo root, and update `getListingPaymentToken` / `getOfferPaymentToken` / `getNativeWrapTokenAddress`.
46
+
1.**Chain enum sync**: The `Chain` enum in `src/types.ts` has a compile-time check (`_AssertAPIChainsCovered`) ensuring every `ChainIdentifier` from `@opensea/api-types` maps to a `Chain` value. `getOfferPaymentToken` and `getListingPaymentToken` use exhaustive `switch` statements whose `default` branch assigns `chain` to a `never` binding, so `pnpm check-types` fails if a new `Chain` is added without a payment-token case — either map it to a real token or mark it unsupported explicitly (like `Chain.Solana` / `Chain.Hyperliquid`, which throw a clear "not supported" error). `getNativeWrapTokenAddress` delegates to `getOfferPaymentToken` except for `Chain.Polygon`, so it is covered automatically unless the wrap token differs from the offer token. `test/utils/chain.spec.ts` also iterates every `Chain` value at runtime as a second guard and runs in `pnpm test`. When adding a chain, also update `scripts/chain-data.json` at the **monorepo root** and run `pnpm sync-chains` from the monorepo root.
45
47
46
48
2.**Dual provider support**: Both `OpenSeaSDK` (ethers) and `OpenSeaViemSDK` (viem) must work. Changes to `BaseOpenSeaSDK` affect both. If adding provider-specific logic, ensure both adapters in `src/provider/` are updated.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,35 @@
1
1
# @opensea/sdk
2
2
3
+
## 11.2.0
4
+
5
+
### Minor Changes
6
+
7
+
- ef89be8: Add SIWE authentication helpers: `OpenSeaAuth` class with authenticate, getValidToken, and revoke methods. Support `authToken` and `authBaseUrl` in `OpenSeaAPIConfig` for wallet-authenticated endpoints.
8
+
- e61a57c: Add `OpenSeaOAuth` OAuth 2.1 helper (authorization-code + PKCE, device authorization grant, refresh, and revoke) for keyless login against the OpenSea authorization server. Exposes `OpenSeaOAuthConfig`, `OAuthToken`, and related types, plus a `decodeJwtPayload` utility for reading token claims.
9
+
- ef89be8: Add `OPENSEA_SCOPES`, `OpenSeaScope`, and `ALL_SCOPES` exports — scope constants derived from the OpenAPI spec's `AuthScope` schema (via `@opensea/api-types`), with compile-time assertions that fail the build if they drift from the spec.
10
+
- c460fc1: Add wallet trading P&L methods to `OpenSeaAPI`: `getWalletPnl`,
11
+
`getWalletClosedPositions`, and `getWalletTokenTransfers`, with camelized
12
+
`WalletPnlResponse`, `ClosedPositionsResponse`, and
13
+
`PositionTokenTransfersResponse` types plus `WalletClosedPositionsArgs` /
14
+
`WalletTokenTransfersArgs` query args.
15
+
16
+
### Patch Changes
17
+
18
+
- b816727: Add missing chain payment-token mappings for Soneium and AnimeChain, and make Solana/Hyperliquid fail fast with clear unsupported-chain errors for OpenSea Seaport offer/listing helpers. This fixes the chain helper drift tracked in ProjectOpenSea/opensea-js#1975.
19
+
- c9d8cb1: Recreate the community fixes from ProjectOpenSea/opensea-js#1974 and ProjectOpenSea/opensea-js#1976: validate `amount` before `parseUnits` in `_getPriceParameters`, and reject `cancelOrders` batches that mix protocol addresses. Also add a runtime chain-helper exhaustiveness guard so new `Chain` values are consciously categorized.
20
+
- e59df7f: Sync OpenAPI spec: add tool activity endpoint, `robinhood` chain, `source`/`collection` search filters, `calldata_suffix` on fulfillment, SIWX wallet-link endpoint (`POST /api/v2/accounts/wallets/siwx` with `LinkWalletSiwxRequest`/`WalletLinkResponse`), re-published `GET /api/v2/account/{address}/favorites`, and the new `write:wallets` auth scope (also added to the SDK's `OPENSEA_SCOPES`)
0 commit comments