import type { OperationQueryParams, OperationRequestBody, OperationResponse, operations } from "@opensea/api-types"; import type { Camelize } from "../utils/case"; import type { WalletAuthFetcher } from "./fetcher"; type OperationName = keyof operations; export type WalletAuthRequest = Camelize>; export type WalletAuthResponse = Camelize>; export type WalletAuthQuery = Camelize>; /** Typed helpers for wallet-authenticated REST operations. */ export declare class WalletAuthAPI { private fetcher; constructor(fetcher: WalletAuthFetcher); getDropEligibility(slug: string): Promise<{ stages: { stageUuid: string; isEligible: boolean; price?: string | undefined; maxTotalMintableByWallet?: string | undefined; maxTotalMintableByWalletPerToken?: string | undefined; }[]; }>; getFavorites(address: string, query?: WalletAuthQuery<"get_profile_favorites">): Promise<{ nfts: { identifier: string; collection: string; contract: string; tokenStandard: string; name?: string | undefined; description?: string | undefined; imageUrl?: string | undefined; displayImageUrl?: string | undefined; displayAnimationUrl?: string | undefined; metadataUrl?: string | undefined; openseaUrl: string; updatedAt: string; isDisabled: boolean; isNsfw: boolean; originalImageUrl?: string | undefined; originalAnimationUrl?: string | undefined; traits: { traitType: string; displayType?: string | undefined; maxValue?: string | undefined; value: unknown; }[]; estimatedValueUsd?: number | undefined; decimals?: number | undefined; }[]; next?: string | undefined; }>; getTokenWatchlist(address: string): Promise<{ tokens: { address: string; chain: string; name: string; symbol: string; imageUrl?: string | undefined; usdPrice: string; decimals: number; openseaUrl: string; marketCapUsd?: number | undefined; volume24h?: number | undefined; priceChange24h?: number | undefined; holdersCount?: number | undefined; isVerified: boolean; createdAt?: number | undefined; genesisDate?: number | undefined; }[]; next?: string | undefined; }>; getPerpetualWatchlist(address: string): Promise<{ perpetuals: { id: string; name: string; symbol: string; imageUrl?: string | undefined; description?: string | undefined; createdAt?: number | undefined; chain: string; contractAddress: string; maxLeverage: number; decimals: number; assetId: string; version: number; categories: string[]; market?: string | undefined; stats?: { priceUsd?: number | undefined; priceChange24h?: number | undefined; volume24h?: number | undefined; markPrice?: number | undefined; oraclePrice?: number | undefined; fundingRate?: number | undefined; openInterest?: number | undefined; } | undefined; }[]; next?: string | undefined; }>; addWatchlistEntry(body: WalletAuthRequest<"add_watchlist_entry">): Promise<{ success: boolean; }>; removeWatchlistEntry(body: WalletAuthRequest<"remove_watchlist_entry">): Promise<{ success: boolean; }>; getAccountRelationship(addressOrUsername: string): Promise<{ isFollowing: boolean; isWatching: boolean; }>; getAccountFollowing(addressOrUsername: string, query?: WalletAuthQuery<"get_account_following">): Promise<{ profiles: { address: string; username?: string | undefined; displayName?: string | undefined; profileImageUrl?: string | undefined; isVerified: boolean; followerCount: number; nftPfp?: { contractAddress: string; tokenId: string; chain: string; collectionSlug?: string | undefined; imageUrl: string; isVerified: boolean; } | undefined; isFollowing: boolean; isWatching: boolean; }[]; next?: string | undefined; }>; getAccountFollowers(addressOrUsername: string, query?: WalletAuthQuery<"get_account_followers">): Promise<{ profiles: { address: string; username?: string | undefined; displayName?: string | undefined; profileImageUrl?: string | undefined; isVerified: boolean; followerCount: number; nftPfp?: { contractAddress: string; tokenId: string; chain: string; collectionSlug?: string | undefined; imageUrl: string; isVerified: boolean; } | undefined; isFollowing: boolean; isWatching: boolean; }[]; next?: string | undefined; }>; followAccount(addressOrUsername: string): Promise<{ status: string; }>; unfollowAccount(addressOrUsername: string): Promise<{ status: string; }>; watchAccount(addressOrUsername: string): Promise<{ status: string; }>; unwatchAccount(addressOrUsername: string): Promise<{ status: string; }>; listSavedTools(query?: WalletAuthQuery<"list_saved_tools">): Promise<{ tools: { id: string; toolId: string; registryChain: string; registryAddr: string; }[]; next?: string | undefined; }>; saveTool(body: WalletAuthRequest<"save_tool">): Promise<{ id: string; toolId: string; registryChain: string; registryAddr: string; }>; removeSavedTool(query: WalletAuthQuery<"unsave_tool">): Promise<{ removed: boolean; }>; /** * `CancelRequest` carries `offererSignature`, which is camelCase on the wire. * It is optional, so snake-casing it didn't fail the request — it just dropped * the signature, turning a signed cancel into an unsigned one. Sent verbatim. */ cancelOrder(chain: string, protocolAddress: string, orderHash: string, body?: WalletAuthRequest<"cancel_order">): Promise<{ lastSignatureIssuedValidUntil: string; }>; saveDropEdits(slug: string, body: WalletAuthRequest<"save_drop_edits">): Promise<{ success: boolean; }>; savePrerevealDropItem(slug: string, body: WalletAuthRequest<"save_prereveal_drop_item">): Promise<{ name: string; description?: string | undefined; imageUrl: string; mediaToken: string; mediaType?: string | undefined; }>; saveSelfMintDropItem(slug: string, body: WalletAuthRequest<"save_self_mint_drop_item">): Promise<{ to: string; data: string; value: string; chain: string; }>; updateSelfMintDropItem(slug: string, tokenId: string | number, body: WalletAuthRequest<"update_self_mint_drop_item">): Promise<{ to: string; data: string; value: string; chain: string; }>; updateDropItem(slug: string, tokenId: string | number, body: WalletAuthRequest<"update_drop_item">): Promise<{ tokenId: string; name?: string | undefined; description?: string | undefined; imageUrl: string; attributes: { traitType: string; value: string; }[]; mediaToken: string; contractStandard: string; externalUrl?: string | undefined; chain: string; contractAddress: string; }>; createDropItemMediaUpload(slug: string, body: WalletAuthRequest<"upload_drop_item_media">): Promise<{ url: string; method: "POST" | "PUT"; fields: { [x: string]: string; }; token: string; }[]>; saveDropItemMedia(slug: string, body: WalletAuthRequest<"save_drop_item_media">): Promise<{ success: boolean; }>; createDropAllowlistUpload(slug: string): Promise<{ url: string; method: "POST" | "PUT"; fields: { [x: string]: string; }; token: string; }>; validateDropAllowlist(slug: string, body: WalletAuthRequest<"validate_drop_allowlist">): Promise<{ token: string; }>; modifyCollection(slug: string, body: WalletAuthRequest<"modify_collection">): Promise<{ success: boolean; }>; updateCollectionMetadata(slug: string, body: WalletAuthRequest<"update_collection_metadata">): Promise<{ success: boolean; }>; setCollectionVisibility(slug: string, body: WalletAuthRequest<"set_collection_visibility">): Promise<{ success: boolean; }>; createCollectionImageUpload(slug: string, imageType: string, contentType: WalletAuthQuery<"upload_collection_image">["contentType"]): Promise<{ url: string; method: "POST" | "PUT"; fields: { [x: string]: string; }; token: string; }>; /** * `UpdateProfileSettingsRequest` is camelCase on the wire (`displayName`, * `externalUrl`, `profileImageToken`, `bannerImageToken`), so the body is sent * verbatim. Snake-casing it silently drops every field except `bio`, which * survives only because it is a single word — the request still returns 200, * so the loss is invisible to the caller. */ updateProfileSettings(body: WalletAuthRequest<"update_profile_settings">): Promise<{ displayName?: string | undefined; bio?: string | undefined; externalUrl?: string | undefined; }>; claimProfileUsername(body: WalletAuthRequest<"claim_profile_username">): Promise<{ success: boolean; }>; /** * `UploadProfileImageRequest` is camelCase on the wire (`imageType`, * `contentType`) and both are required, so snake-casing the body made this * call fail validation every time. Sent verbatim. */ createProfileImageUpload(body: WalletAuthRequest<"upload_profile_image">): Promise<{ url: string; method: "POST" | "PUT"; fields: { [x: string]: string; }; token: string; }>; /** * `SetNftPfpRequest` is camelCase on the wire (`contractAddress`, `tokenId`, * `collectionSlug`) and the first two are required, so snake-casing the body * made this call fail validation every time. Sent verbatim. */ setProfileNftPfp(body: WalletAuthRequest<"set_profile_nft_pfp">): Promise<{ contractAddress: string; tokenId: string; chain: string; collectionSlug?: string | undefined; imageUrl: string; isVerified: boolean; }>; clearProfileNftPfp(): Promise<{ success: boolean; }>; createProfileShelf(body: WalletAuthRequest<"create_profile_shelf">): Promise<{ id: string; accountAddress?: string | undefined; title: string; description?: string | undefined; displayOrder: number; items: { chain: string; contractAddress: string; tokenId: string; }[]; icon?: string | undefined; view?: string | undefined; singleItemShelfSide?: string | undefined; shelfItemMetadata: { [x: string]: { description?: string | undefined; }; }; }>; reorderProfileShelves(body: WalletAuthRequest<"reorder_profile_shelves">): Promise<{ success: boolean; }>; updateProfileShelf(shelfId: string, body: WalletAuthRequest<"update_profile_shelf">): Promise<{ id: string; accountAddress?: string | undefined; title: string; description?: string | undefined; displayOrder: number; items: { chain: string; contractAddress: string; tokenId: string; }[]; icon?: string | undefined; view?: string | undefined; singleItemShelfSide?: string | undefined; shelfItemMetadata: { [x: string]: { description?: string | undefined; }; }; }>; deleteProfileShelf(shelfId: string): Promise<{ success: boolean; }>; /** * `LinkWalletSiwxRequest` is camelCase on the wire. `chainArch` is required, so * snake-casing it made every call fail validation, and the nested SIWX `message` * keeps camelCase keys the server uses to rebuild the message the wallet signed. * Sent verbatim, matching the raw fetch in `auth/siwx.ts` that posts the same * operation. */ linkWallet(body: WalletAuthRequest<"link_wallet_with_siwx">): Promise<{ linkedWalletAddress: string; }>; unlinkWallet(wallet: string): Promise<{ success: boolean; }>; makeWalletPrivate(wallet: string): Promise<{ address: string; isPrivate: boolean; }>; makeWalletPublic(wallet: string): Promise<{ address: string; isPrivate: boolean; }>; /** * Declare the authenticated account an agent. Requires `write:wallets`. * * Independent of ownership: an agent nobody owns is valid. `changed` is * false when the account was already an agent, so a retry is * distinguishable from a real change. */ declareAgentAccount(): Promise<{ isAgent: boolean; changed: boolean; }>; /** * Withdraw the authenticated account's agent declaration. Requires * `write:wallets`. */ withdrawAgentAccountDeclaration(): Promise<{ isAgent: boolean; changed: boolean; }>; /** * Propose an agent ownership relationship. Requires `write:wallets`. * * `callerRole` says which side the caller is on: `AGENT` means "I am an * agent and the counterparty owns me". The caller's own account is never in * the body; it comes from the bearer token. * * Proposing a relationship that is already awaiting you confirms it, so a * client that cannot tell who moved first can just propose. */ proposeAgentRelationship(body: WalletAuthRequest<"propose_agent_relationship">): Promise<{ relation: { initiatorAddress?: string | undefined; counterpartyAddress?: string | undefined; agentAccountId: string; ownerAccountId: string; status: string; initiatedBy: string; awaitingConfirmationFrom?: string | undefined; createdAt: number; confirmedAt?: number | undefined; }; created: boolean; }>; /** * Confirm a relationship proposed to the authenticated account. Requires * `write:wallets`. An agent ends up with at most one confirmed owner. */ confirmAgentRelationship(body: WalletAuthRequest<"confirm_agent_relationship">): Promise<{ relation: { initiatorAddress?: string | undefined; counterpartyAddress?: string | undefined; agentAccountId: string; ownerAccountId: string; status: string; initiatedBy: string; awaitingConfirmationFrom?: string | undefined; createdAt: number; confirmedAt?: number | undefined; }; created: boolean; }>; /** * Withdraw a proposal or revoke a confirmed relationship. Requires * `write:wallets`. Either side may do this at any point, and it deletes the * relationship rather than marking it inactive. * * `removed` is false when no such relationship existed, which covers both a * counterparty you never proposed to and someone else's relationship. * * Sent as query parameters rather than a body on purpose: fetch, OkHttp and * urllib all drop DELETE bodies by default, and proxies may strip them. */ revokeAgentRelationship(query: WalletAuthQuery<"revoke_agent_relationship">): Promise<{ removed: boolean; }>; /** * List the authenticated account's own relationships. Requires * `read:wallets`, not `write:wallets`. * * Includes proposals still awaiting either side. Pending relationships show * up here only; a public profile shows confirmed ones alone. */ listOwnAgentRelationships(): Promise<{ relationships: { initiatorAddress?: string | undefined; counterpartyAddress?: string | undefined; agentAccountId: string; ownerAccountId: string; status: string; initiatedBy: string; awaitingConfirmationFrom?: string | undefined; createdAt: number; confirmedAt?: number | undefined; }[]; }>; } export {};