export type CreateApiConnectedAccountsAccountIdAllowlistSyncArgs = {'Idempotency-Key'?: string | undefined, accountId: string}; export type CreateApiConnectedAccountsAccountIdAllowlistSyncOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sync allowlist for connected account * * POST /connected_accounts/{accountId}/allowlist/sync */ export const createApiConnectedAccountsAccountIdAllowlistSync = async (args: CreateApiConnectedAccountsAccountIdAllowlistSyncArgs, options?: CreateApiConnectedAccountsAccountIdAllowlistSyncOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Idempotency-Key'] != null) headers.set("Idempotency-Key", String(args['Idempotency-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/connected_accounts/${encodeURIComponent(String(args.accountId))}/allowlist/sync${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };