export type CreateApiDepositAddressesDepositAddressIdUpdateV2Args = {depositAddressId: string, 'x-api-key'?: string | undefined, 'x-dev-portal-key'?: string | undefined, body: {isEnabled?: boolean | undefined, fixedRate?: (string | null) | undefined, subsidizeFees?: boolean | undefined, sponsoredFeeComponents?: (Array<'execution' | 'swap' | 'relay' | 'app' | 'rent'>) | undefined, maxSubsidizationAmount?: (string | null) | undefined}}; export type CreateApiDepositAddressesDepositAddressIdUpdateV2Options = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a Deposit Address V2 that the caller's integrator owns. Omitted fields keep their current value. New pricing applies to deposits quoted after the update. A first deposit that matches the original quote keeps that quote until it expires. * * POST /deposit-addresses/{depositAddressId}/update/v2 */ export const createApiDepositAddressesDepositAddressIdUpdateV2 = async (args: CreateApiDepositAddressesDepositAddressIdUpdateV2Args, options?: CreateApiDepositAddressesDepositAddressIdUpdateV2Options) => { const {baseUrl = "https://api.relay.link", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) if (args['x-dev-portal-key'] != null) headers.set("x-dev-portal-key", String(args['x-dev-portal-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/deposit-addresses/${encodeURIComponent(String(args.depositAddressId))}/update/v2${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };