{"version":3,"sources":["../src/index.ts","../src/chains-generated.ts","../src/auth-scopes-generated.ts"],"sourcesContent":["/**\n * @opensea/api-types\n *\n * Auto-generated TypeScript types from the OpenSea API v2 OpenAPI spec.\n * Re-run `pnpm --filter @opensea/api-types run build` after updating\n * opensea-api.json.\n *\n * These are wire shapes, in snake_case. `@opensea/sdk` rewrites response keys\n * to camelCase, so a type from this package does not describe a value an SDK\n * method returned: use the matching `@opensea/sdk` type, or `Camelize<T>` from\n * `@opensea/sdk`. See \"Response casing\" in the SDK README.\n *\n * Schema types (everything under `components.schemas`) are re-exported from\n * `./schemas-generated.ts`, which is regenerated from the spec on every\n * build. That eliminates the manual-curation gap — when the spec gains a\n * new schema, downstream consumers can import it immediately with no\n * intermediate step. Hand-written sections below cover the things the\n * generator can't infer mechanically (operations helpers, response\n * envelopes, namespace re-exports).\n */\n\nexport type { components, operations, paths } from \"./generated.js\"\n\nimport type { components, operations } from \"./generated.js\"\n\n// ── Namespace re-export ─────────────────────────────────────────────\n\n/**\n * The full `components.schemas` namespace. Useful when you want to look up\n * a schema dynamically (e.g. `Schemas[\"SomeRequest\"]`) instead of via the\n * named export.\n *\n * Wire shapes, in snake_case. An SDK return value is the camelCase view of\n * one of these, not one of these.\n */\nexport type Schemas = components[\"schemas\"]\n\n// ── Auto-generated schema types ─────────────────────────────────────\n// Every `components.schemas.*` entry from opensea-api.json is exported by\n// name from ./schemas-generated. Regenerate via `pnpm run generate`.\n\nexport * from \"./schemas-generated.js\"\n\n// ── Auto-generated runtime values ───────────────────────────────────\n// Regenerate both via `pnpm run generate`.\n//\n// AUTH_SCOPES is scope metadata (names, descriptions, groups, endpoints, and\n// MCP tools) derived from the spec's AuthScope schema extensions.\n//\n// CHAIN_IDENTIFIERS is the chain slugs from the spec's ChainIdentifier enum,\n// which openapi-typescript emits as a type-only union.\n\nimport { CHAIN_IDENTIFIERS } from \"./chains-generated.js\"\nimport type { ChainIdentifier } from \"./schemas-generated.js\"\n\nexport { AUTH_SCOPES, type AuthScopeInfo } from \"./auth-scopes-generated.js\"\nexport { CHAIN_IDENTIFIERS }\n\n/**\n * Narrow an arbitrary string to a `ChainIdentifier`.\n *\n * `CHAIN_IDENTIFIERS.includes(value)` on its own does not type-check for a\n * plain `string`, because the array is a readonly tuple of literals and\n * `Array.prototype.includes` wants an argument of the element type. Callers\n * would each write the widening cast this does once.\n */\nexport function isChainIdentifier(value: string): value is ChainIdentifier {\n  return (CHAIN_IDENTIFIERS as readonly string[]).includes(value)\n}\n\n// ── Response envelopes (components.responses) ───────────────────────\n// These live under `components.responses`, not `components.schemas`, so\n// they aren't covered by the auto-generated schema exports.\n\nexport type Responses = components[\"responses\"]\nexport type BadRequest = Responses[\"BadRequest\"]\nexport type Unauthorized = Responses[\"Unauthorized\"]\nexport type NotFound = Responses[\"NotFound\"]\nexport type RateLimit = Responses[\"RateLimit\"]\nexport type InternalError = Responses[\"InternalError\"]\n\n// ── Operation helpers ───────────────────────────────────────────────\n// Use these to extract request/response types for specific operations.\n\ntype OperationContentBody<T> = T extends {\n  content: { \"application/json\": infer R }\n}\n  ? R\n  : T extends { content: { \"*/*\": infer R } }\n    ? R\n    : T extends { content: { \"multipart/form-data\": infer R } }\n      ? R\n      : never\n\n/** Extract the successful (200) response body type for a given operation. */\nexport type OperationResponse<T extends keyof operations> =\n  operations[T] extends { responses: { 200: infer R } }\n    ? OperationContentBody<R>\n    : never\n\n/** Extract the request body type for a given operation */\nexport type OperationRequestBody<T extends keyof operations> =\n  operations[T] extends { requestBody: infer R }\n    ? OperationContentBody<R>\n    : never\n\n/** Extract the path parameters type for a given operation */\nexport type OperationPathParams<T extends keyof operations> =\n  operations[T] extends { parameters: { path: infer R } } ? R : never\n\n/** Extract the query parameters type for a given operation */\nexport type OperationQueryParams<T extends keyof operations> = NonNullable<\n  operations[T][\"parameters\"][\"query\"]\n>\n","/* eslint-disable */\n// AUTO-GENERATED. Do not edit by hand.\n// Regenerate with: pnpm --filter @opensea/api-types run generate\n//\n// Runtime chain list derived from the OpenAPI spec's `ChainIdentifier` schema,\n// which openapi-typescript emits as a type-only union.\n\nimport type { ChainIdentifier } from \"./schemas-generated.js\"\n\n/**\n * Every chain identifier the OpenSea API accepts, in spec order.\n *\n * The `satisfies` clause rejects a member the union does not have, and the\n * assertion below rejects a union member the array is missing, so the two\n * generated artifacts fail the type-check the moment they disagree.\n */\nexport const CHAIN_IDENTIFIERS = [\n  \"blast\",\n  \"base\",\n  \"ethereum\",\n  \"zora\",\n  \"arbitrum\",\n  \"sei\",\n  \"avalanche\",\n  \"polygon\",\n  \"optimism\",\n  \"ape_chain\",\n  \"flow\",\n  \"b3\",\n  \"soneium\",\n  \"ronin\",\n  \"bera_chain\",\n  \"solana\",\n  \"shape\",\n  \"unichain\",\n  \"gunzilla\",\n  \"abstract\",\n  \"animechain\",\n  \"hyperevm\",\n  \"somnia\",\n  \"monad\",\n  \"hyperliquid\",\n  \"megaeth\",\n  \"ink\",\n  \"robinhood\",\n  \"stablechain\",\n  \"arc\",\n] as const satisfies readonly ChainIdentifier[]\n\ntype _AssertEveryChainIdentifierListed =\n  ChainIdentifier extends (typeof CHAIN_IDENTIFIERS)[number] ? true : never\n\nconst _assertEveryChainIdentifierListed: _AssertEveryChainIdentifierListed = true\n","/* eslint-disable */\n// AUTO-GENERATED — do not edit by hand.\n// Regenerate with: pnpm --filter @opensea/api-types run generate\n//\n// Runtime scope metadata derived from the OpenAPI spec's `AuthScope` schema\n// (`enum` plus aligned `x-enum-*` metadata arrays), which os2-core\n// emits from its canonical `auth/scopes.json`.\n\nimport type { AuthScope } from \"./schemas-generated.js\"\n\n/** Per-scope metadata for every OpenSea API auth scope, in spec order. */\nexport const AUTH_SCOPES = [\n  {\n    name: \"read:eligibility\",\n    displayName: \"Check drop eligibility\",\n    description: \"Check drop eligibility for authenticated wallet\",\n    group: \"read\",\n    endpoints: [\"/api/v2/drops/{slug}/eligibility\"],\n    mcpTools: [\"check_drop_eligibility\"],\n  },\n  {\n    name: \"read:favorites\",\n    displayName: \"View favorites and watchlist\",\n    description: \"View favorites and watchlist for authenticated account\",\n    group: \"read\",\n    endpoints: [\"/api/v2/account/{address}/favorites\",\"/api/v2/account/{address}/token_watchlist\",\"/api/v2/account/{address}/perpetual_watchlist\"],\n    mcpTools: [\"get_favorites\"],\n  },\n  {\n    name: \"read:social\",\n    displayName: \"View social relationships\",\n    description: \"View follows, watches, followers, and following for the authenticated account\",\n    group: \"read\",\n    endpoints: [\"/api/v2/accounts/{address_or_username}/relationship\",\"/api/v2/accounts/{address_or_username}/followers\",\"/api/v2/accounts/{address_or_username}/following\"],\n    mcpTools: [\"view_social_graph\"],\n  },\n  {\n    name: \"read:tools\",\n    displayName: \"View saved tools and toolkits\",\n    description: \"View saved tools and toolkits for the authenticated account\",\n    group: \"read\",\n    endpoints: [\"/api/v2/saved-tools\",\"/api/v2/toolkits\",\"/api/v2/toolkits/{toolkit_slug}\"],\n    mcpTools: [\"list_saved_tools\",\"list_toolkits\",\"get_toolkit\"],\n  },\n  {\n    name: \"read:wallets\",\n    displayName: \"View linked wallets and agent relationships\",\n    description: \"View wallet state for the authenticated account, currently agent ownership relationships including pending proposals\",\n    group: \"read\",\n    endpoints: [\"/api/v2/accounts/agent-relationships\"],\n    mcpTools: [\"get_agent_relationships\"],\n  },\n  {\n    name: \"write:favorites\",\n    displayName: \"Manage favorites and watchlist\",\n    description: \"Add and remove favorites and watchlist entries for authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/watchlist\"],\n    mcpTools: [\"manage_watchlist\"],\n  },\n  {\n    name: \"write:social\",\n    displayName: \"Manage social relationships\",\n    description: \"Follow, unfollow, watch, and unwatch profiles, and link or unlink an X account, for the authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/accounts/{address_or_username}/follow\",\"/api/v2/accounts/{address_or_username}/watch\",\"/api/v2/accounts/social/x/link\",\"/api/v2/accounts/social/x/link/{link_id}\",\"/api/v2/accounts/social/x\"],\n    mcpTools: [\"manage_social_graph\",\"link_x_account\"],\n  },\n  {\n    name: \"write:tools\",\n    displayName: \"Manage saved tools and toolkits\",\n    description: \"Save and remove tools and manage toolkits for the authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/saved-tools\",\"/api/v2/toolkits\",\"/api/v2/toolkits/{toolkit_id}/save\"],\n    mcpTools: [\"save_tool\",\"unsave_tool\",\"create_toolkit\",\"save_toolkit\",\"unsave_toolkit\"],\n  },\n  {\n    name: \"write:orders\",\n    displayName: \"Cancel orders\",\n    description: \"Cancel orders on behalf of authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/orders/chain/{chain}/protocol/{protocol_address}/{order_hash}/cancel\"],\n    mcpTools: [\"cancel_orders\"],\n  },\n  {\n    name: \"write:drops\",\n    displayName: \"Creator Studio drop management\",\n    description: \"Manage Creator Studio drops for authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/drops/{slug}\",\"/api/v2/drops/{slug}/allowlist\",\"/api/v2/drops/{slug}/allowlist/validate\",\"/api/v2/drops/{slug}/prereveal-item\",\"/api/v2/drops/{slug}/items\",\"/api/v2/drops/{slug}/items/media\",\"/api/v2/drops/{slug}/items/media/save\",\"/api/v2/drops/{slug}/items/{token_id}\"],\n    mcpTools: [\"manage_drops\"],\n  },\n  {\n    name: \"write:collections\",\n    displayName: \"Collection metadata editing\",\n    description: \"Modify collection metadata for authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/collections/{slug}\",\"/api/v2/collections/{slug}/metadata\",\"/api/v2/collections/{slug}/visibility\",\"/api/v2/collections/{slug}/images/{image_type}\"],\n    mcpTools: [\"manage_collections\"],\n  },\n  {\n    name: \"write:profile\",\n    displayName: \"Profile editing\",\n    description: \"Modify profile settings for authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/profile\",\"/api/v2/profile/username\",\"/api/v2/profile/images\",\"/api/v2/profile/nft-pfp\",\"/api/v2/profile/shelves\",\"/api/v2/profile/shelves/{shelf_id}\"],\n    mcpTools: [\"manage_profile\"],\n  },\n  {\n    name: \"write:wallets\",\n    displayName: \"Manage linked wallets\",\n    description: \"Link, unlink, manage wallet visibility, and declare agent relationships for the authenticated account\",\n    group: \"write\",\n    endpoints: [\"/api/v2/accounts/agent\",\"/api/v2/accounts/agent-relationships\",\"/api/v2/accounts/agent-relationships/confirm\",\"/api/v2/accounts/wallets/siwx\",\"/api/v2/accounts/wallets/{wallet}\",\"/api/v2/accounts/wallets/{wallet}/private\"],\n    mcpTools: [\"manage_wallets\",\"manage_agent_account\"],\n  },\n] as const satisfies readonly {\n  name: AuthScope\n  displayName: string\n  description: string\n  group: string\n  endpoints: readonly string[]\n  mcpTools: readonly string[]\n}[]\n\n/** Metadata describing a single OpenSea API auth scope. */\nexport type AuthScopeInfo = (typeof AUTH_SCOPES)[number]\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBO,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACpCO,IAAM,cAAc;AAAA,EACzB;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,OAAO;AAAA,IACP,WAAW,CAAC,kCAAkC;AAAA,IAC9C,UAAU,CAAC,wBAAwB;AAAA,EACrC;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aAAa;AAAA,IACb,OAAO;AAAA,IACP,WAAW,CAAC,uCAAsC,6CAA4C,+CAA+C;AAAA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