export type TokenOwnershipSpamUpdatePayload = {assetId: string, spam: boolean}; export type UpdateTokensOwnershipSpamRequest = Array; export type UpdateApiNftsOwnershipTokensSpamArgs = {'X-End-User-Wallet-Id'?: string | undefined, 'Idempotency-Key'?: string | undefined, body: UpdateTokensOwnershipSpamRequest}; export type UpdateApiNftsOwnershipTokensSpamOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update tokens ownership spam property * * PUT /nfts/ownership/tokens/spam */ export const updateApiNftsOwnershipTokensSpam = async (args: UpdateApiNftsOwnershipTokensSpamArgs, options?: UpdateApiNftsOwnershipTokensSpamOptions) => { 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/spam${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 };