export type ChainIdentifier = 'base' | 'ethereum' | 'zora' | 'arbitrum' | 'sei' | 'avalanche' | 'polygon' | 'optimism' | 'ape_chain' | 'flow' | 'soneium' | 'ronin' | 'bera_chain' | 'solana' | 'shape' | 'unichain' | 'gunzilla' | 'abstract' | 'animechain' | 'hyperevm' | 'somnia' | 'monad' | 'hyperliquid' | 'megaeth' | 'ink' | 'robinhood' | 'stablechain'; export type GetApiApiV2AccountAddressTokenActivityArgs = {address: string, chains?: Array | undefined, tokens?: Array | undefined, type?: Array | undefined, limit?: number | undefined, next?: string | undefined}; export type GetApiApiV2AccountAddressTokenActivityOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get account token activity * * GET /api/v2/account/{address}/token-activity */ export const getApiApiV2AccountAddressTokenActivity = async (args: GetApiApiV2AccountAddressTokenActivityArgs, options?: GetApiApiV2AccountAddressTokenActivityOptions) => { const {baseUrl = "https://api.opensea.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") for (const item of args.chains ?? []) query.append("chains", String(item)) for (const item of args.tokens ?? []) query.append("tokens", String(item)) for (const item of args.type ?? []) query.append("type", String(item)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.next != null) query.append("next", String(args.next)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/account/${encodeURIComponent(String(args.address))}/token-activity${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };