Skip to content

Commit 61b85dc

Browse files
committed
Release v12.0.0
Origin-SHA: 93f028c503642e7e8e8e08080074ef23ea95cc05
1 parent 5be5f2b commit 61b85dc

20 files changed

Lines changed: 1022 additions & 763 deletions

AGENTS.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,8 @@ pnpm run lint
2727
3. **Dual provider support**. Changes to `BaseOpenSeaSDK` affect both ethers and viem paths; update both provider adapters if provider-specific logic changes.
2828
4. **OAuth token contract**. `OpenSeaOAuth` requests `offline_access`; refresh responses may omit rotation — keep the previous refresh token. The top-level `wallet` JWT claim is wallet identity; `sub` is an account id.
2929
5. **No secret leakage**. API keys live in `OpenSeaAPIConfig.apiKey`; never log them.
30-
6. **Stream stays on its own subpath**. `EventType`, `Trait`, `TraitOfferEvent`,
31-
and `CollectionOfferEvent` exist in both surfaces with different shapes, so
32-
`src/stream/` must never be re-exported from `src/index.ts`.
33-
7. **The stream transport is internal**. `src/stream/transport/` is not exported
34-
from `src/stream/index.ts`. Stream API v2 will not speak Phoenix Channels, so
35-
the interface must stay free to change without a breaking release. Client code
36-
talks to `StreamTransport`, never to `PhoenixChannelsTransport` directly.
37-
8. **No dependency for the stream client**. `@opensea/sdk/stream` resolves to six
38-
local files and nothing else. Verify with a require-graph walk before adding
39-
any import there.
30+
6. **Auth scopes are coupled to the spec in both directions**. `src/scopes.ts` asserts at compile time that `OPENSEA_SCOPES` matches `AuthScope` from `@opensea/api-types`, so a new scope has to land in the spec and in the constant in the same commit, and that commit cannot pass the `Mirror layout` gate until api-types publishes. Read [Spec changes and release order](../../AGENTS.md#spec-changes-and-release-order) before starting.
31+
7. **Stream client is subpath-only and dependency-free**. `src/stream/` is exported from `./stream` and never from `src/index.ts``EventType`, `Trait`, `TraitOfferEvent`, and `CollectionOfferEvent` exist in both surfaces with different shapes. `src/stream/transport/` stays internal so a non-Phoenix Stream v2 can replace it without a breaking release; client code uses `StreamTransport`, never `PhoenixChannelsTransport`. The built entry resolves to six local files with zero external requires, so check the require graph before adding an import. Live tests are in `test/integration/stream.spec.ts` and need real network access, see `test/README-integration.md`.
4032

4133
## Conventions
4234

CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
# @opensea/sdk
22

3+
## 12.0.0
4+
5+
### Major Changes
6+
7+
- 75aa2c2: **Breaking:** removes the retired wallet-level agent designation.
8+
9+
SDK: `WalletAuthAPI.markWalletAsAgent` and `WalletAuthAPI.removeWalletAgentDesignation` are gone. CLI: `opensea accounts mark-agent` and `opensea accounts remove-agent`, along with `client.accounts.markAgent` and `client.accounts.removeAgent` on `OpenSeaCLI`.
10+
11+
The endpoints they called, `PUT` and `DELETE /api/v2/accounts/wallets/{wallet}/agent`, no longer exist. os2-core removed them in ProjectOpenSea/os2-core#52946: over the 7 days before that, every `PUT` was rejected with 403 by a kill switch and no wallet's agent flag changed at all. Keeping the methods would mean shipping calls that 404.
12+
13+
An agent is an account, not a flag on a wallet. Use `declareAgentAccount`, `withdrawAgentAccountDeclaration`, and the `proposeAgentRelationship` / `confirmAgentRelationship` / `revokeAgentRelationship` handshake, or the `opensea agent` command group. Both are unchanged by this release.
14+
15+
`WalletAgentStatusResponse` is no longer re-exported from the CLI's `types/api`, since the schema goes away with the next spec sync.
16+
17+
### Minor Changes
18+
19+
- 6c0ee99: Add SDK and CLI support for agent accounts, so an agent can declare itself and complete the ownership handshake without hand-rolling HTTP.
20+
21+
An agent is an account, not a flag on a wallet. Ownership is a relationship between two accounts, mutually confirmed. It is a declaration, not an authorization: naming an account as your agent grants it no ability to act for you. It is self-reported and OpenSea does not verify it. An agent can have no owner at all, and at most one confirmed owner. Either side may withdraw or revoke at any time, which deletes the relationship. Only confirmed relationships are public.
22+
23+
SDK, on `WalletAuthAPI`: `declareAgentAccount`, `withdrawAgentAccountDeclaration`, `proposeAgentRelationship`, `confirmAgentRelationship`, `revokeAgentRelationship`, and `listOwnAgentRelationships`. `AccountsAPI.getAgentProfileRelationships` already covered the public read.
24+
25+
CLI, a new `agent` group: `declare`, `withdraw`, `propose`, `confirm`, `revoke`, `list`, and `profile`, plus a matching `client.agent` namespace on `OpenSeaCLI`.
26+
27+
The scopes differ, which is easy to get wrong. Every write takes `write:wallets` but listing your own relationships takes `read:wallets`, so a client driving the whole handshake must request both or the list call returns 403. `read:wallets` is now in `OPENSEA_SCOPES`, so the default OAuth grant carries it.
28+
29+
The OpenAPI snapshot is refreshed to generate all of this. That also picks up `read:wallets` in `AuthScope`, which was already live in the scope registry but missing from the committed snapshot, so `scripts/check-auth-scope-drift.mjs` was failing on main beforehand.
30+
31+
`AgentProfileRelationshipsResponse` no longer surfaces `agent_owner_profile` or `public_agent_wallets`. Both read the retired wallet-level designation, are permanently null and empty, and are removed by os2-core AGE-51. Read `agentOwner` and `agents` instead.
32+
33+
`markWalletAsAgent` and `removeWalletAgentDesignation` are deprecated. They set a flag on a wallet rather than declaring an account, and the server now rejects new designations; only the removal still works, so an account that set the old flag can clear it.
34+
35+
### Patch Changes
36+
37+
- ddadb41: Replace five hand-rolled API types with the generated ones from `@opensea/api-types`.
38+
39+
`packages/cli/AGENTS.md` and `packages/api-types/AGENTS.md` both say never to hand-roll API request or response types, but these five predate the rule and duplicated schemas the spec already covered.
40+
41+
In the SDK: `GetChainsResponse` becomes `Camelize<ChainListResponse>`, `DropMintRequest` and `DropMintResponse` become `Camelize<>` of the identically named generated schemas, `ResolveAccountResponse` becomes `Camelize<AccountResolveResponse>`, and `ValidateMetadataResponse` becomes `Camelize<>` of the generated schema, which decomposes into `ValidateMetadataAssetIdentifier`, `ValidateMetadataDetails`, `ValidateMetadataAttribute` and `MetadataIngestionError`. In the CLI: `ValidateMetadataResponse` becomes a `Schemas[...]` re-export, the one declared violation in a file that is otherwise all re-exports.
42+
43+
No shape change. Each replacement was diffed field by field against the spec, including required and optional, and they match exactly, so this is types-only with no runtime or behavioral effect. Four of the five were already correct re-exports in the CLI and hand-rolled only in the SDK, so the two packages had disagreed about the same names.
44+
45+
- cfbb465: `onItemReceivedOffer` is now a no-op. The Stream API does not emit `item_received_offer` and never has, so the method only ever registered a handler that could not fire. Confirmed against production: four minutes on `collection:*` delivered 736k events across ten event names and this was not among them, while every other type appeared within 1.8s.
46+
47+
Item-level offers arrive as `item_received_bid`, which carries an identical payload. Use `onItemReceivedBid`.
48+
49+
The method stays callable so existing code compiles and runs unchanged, and it no longer opens a connection for a topic that yields nothing. `EventType.ITEM_RECEIVED_OFFER`, `ItemReceivedOfferEvent`, and `ItemReceivedOfferEventPayload` are kept for source compatibility but marked deprecated and hidden from the generated docs.
50+
51+
- 6e77b5e: `fulfillOrder` now appends the attribution suffix the fulfillment endpoints return, so fills built by the SDK are attributed to OpenSea onchain. They were not before: the API returns `calldata_suffix` (the first four bytes of `keccak256("api.opensea.io")`) and carries it as trailing calldata on its own transactions, but the SDK re-encodes the call from `input_data` and signed that instead, which dropped it. Seaport reads its arguments from offsets and ignores trailing bytes, so the suffix does not affect execution. A missing or malformed suffix is ignored rather than raised.
52+
53+
Private listings are unaffected. They are fulfilled locally through seaport-js and never receive API calldata, so there is no suffix to re-attach. `fulfillPrivateOrder` already takes a `domain` for that purpose; `fulfillOrder` neither accepts nor forwards one, so private fills through it stay unattributed.
54+
55+
`FulfillmentDataResponse` is now derived from `@opensea/api-types` instead of hand-rolled. It had drifted: no `calldataSuffix`, no `valueHex`, four `inputData` members against the spec's seven, and a basic-order member named `basicOrderParameters` where the API sends `parameters`, so that branch never matched and the fallback built the arguments instead. Same result for a single-field struct, so no behavior change there.
56+
57+
- f74c0be: Deduplicate Stream API payload types and logging internals without changing the public API.
58+
- Updated dependencies [5fdac00]
59+
- @opensea/api-types@0.8.10
60+
361
## 11.9.0
462

563
### Minor Changes

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ try {
8282
authToken: token.accessToken,
8383
})
8484
await api.walletAuth.getFavorites(await signer.getAddress(), { limit: 10 })
85-
await api.walletAuth.markWalletAsAgent(await signer.getAddress())
86-
await api.walletAuth.removeWalletAgentDesignation(await signer.getAddress())
85+
await api.walletAuth.declareAgentAccount()
8786
} finally {
8887
await auth.revoke(token.accessToken)
8988
}

developerDocs/stream-migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ seaport, and no third-party runtime code.
145145
## What did not change
146146

147147
- Every `on*` method: `onItemListed`, `onItemSold`, `onItemTransferred`,
148-
`onItemMetadataUpdated`, `onItemCancelled`, `onItemReceivedOffer`,
149-
`onItemReceivedBid`, `onCollectionOffer`, `onTraitOffer`,
148+
`onItemMetadataUpdated`, `onItemCancelled`, `onItemReceivedBid`,
149+
`onCollectionOffer`, `onTraitOffer`,
150150
`onOrderInvalidate`, `onOrderRevalidate`, and `onEvents`.
151151
- Every event and payload type, unchanged field for field.
152152
- `EventType`, `LogLevel`, `Network`, `OnClientEvent`, and `Callback`.

0 commit comments

Comments
 (0)