export type TokenOwnershipStatusUpdatePayload = {assetId: string, status: 'LISTED' | 'ARCHIVED'}; export type UpdateTokensOwnershipStatusRequest = Array; export type UpdateApiNftsOwnershipTokensStatusArgs = {'X-End-User-Wallet-Id'?: string | undefined, 'Idempotency-Key'?: string | undefined, body: UpdateTokensOwnershipStatusRequest}; export type UpdateApiNftsOwnershipTokensStatusOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update tokens ownership status * * PUT /nfts/ownership/tokens/status */ export const updateApiNftsOwnershipTokensStatus = async (args: UpdateApiNftsOwnershipTokensStatusArgs, options?: UpdateApiNftsOwnershipTokensStatusOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-End-User-Wallet-Id'] != null) headers.set("X-End-User-Wallet-Id", String(args['X-End-User-Wallet-Id'])) if (args['Idempotency-Key'] != null) headers.set("Idempotency-Key", String(args['Idempotency-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/nfts/ownership/tokens/status${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };