export type ApiJettonVerification = 'BLACKLISTED' | 'UNKNOWN' | 'COMMUNITY' | 'WHITELISTED'; export type ApiJettonUpdateVerificationRequest = {verification: ApiJettonVerification, interface_name?: string | undefined, include_hash?: boolean | undefined}; export type UpdateApiApiV3JettonsAddressVerificationArgs = {address: string, body: ApiJettonUpdateVerificationRequest}; export type UpdateApiApiV3JettonsAddressVerificationOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update jetton verification status * * PUT /api/v3/jettons/{address}/verification */ export const updateApiApiV3JettonsAddressVerification = async (args: UpdateApiApiV3JettonsAddressVerificationArgs, options?: UpdateApiApiV3JettonsAddressVerificationOptions) => { const {baseUrl = "https://tokens.swap.coffee", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/jettons/${encodeURIComponent(String(args.address))}/verification${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 };