import type { AuthenticateOptions, AuthNonceResponse, AuthSigner, AuthToken, AuthTokenResponse, OpenSeaAuthConfig } from "./types"; export type { AccountType, ChainArch, CreateSiwxMessageOptions, LinkWalletWithSiwxOptions, ParseSiwxMessageResult, } from "./siwx"; export { chainArchToAccountType, createSiwxMessage, linkWalletWithSiwx, parseSiwxMessage, requestSiwxNonce, } from "./siwx"; export type { AuthenticateOptions, AuthNonceResponse, AuthSigner, AuthToken, AuthTokenResponse, OpenSeaAuthConfig, }; /** * SIWE-based authentication helper for OpenSea. * * Establishes a browser-style wallet session, creates a one-day scoped token, * and exchanges that token for the short-lived JWT used by REST and MCP. Token * management remains bound to the wallet session, while automatic JWT refresh * uses the scoped token. * * @example * ```ts * import { OpenSeaAuth } from "@opensea/sdk" * * const auth = new OpenSeaAuth() * const token = await auth.authenticate(signer, { * scopes: ["read:eligibility", "write:orders"], * }) * const freshToken = await auth.getValidToken() * await auth.revoke(freshToken.accessToken) * ``` * * @category Authentication */ export declare class OpenSeaAuth { private readonly apiBaseUrl; private cachedToken; private scopedTokenId; private sessionCookies; constructor(config?: OpenSeaAuthConfig); /** Run the current SIWE, scoped-token creation, and token-exchange flow. */ authenticate(signer: AuthSigner, options?: AuthenticateOptions): Promise; /** Return a valid JWT, exchanging the stored scoped token when needed. */ getValidToken(): Promise; /** Revoke the scoped token backing the current JWT. */ revoke(accessToken: string): Promise; /** Request a single-use SIWE nonce. */ requestNonce(): Promise; private verifySignature; private createScopedToken; private exchangeScopedToken; private cleanupScopedToken; private refreshSession; } /** * Build the SIWE message accepted by the current OpenSea wallet-auth API. * The scopes argument remains for compatibility; webauth authorizes PAT scopes * on token creation and does not accept them in this session proof. */ export declare function generateSiweMessage(address: string, _scopes: string[], nonce: string, _apiBaseUrl: string, chainId?: number): string;