export type VirtualAccountDepositInstructionsRequest = {customerId: string, customerPhoneNumber?: string | undefined, destinationCurrencyCode: string, destinationWalletAddress: string, paymentMethodType: 'ACH' | 'SEPA' | 'PIX' | 'MOBILE_MONEY', serviceProvider: 'NOAH' | 'DUENETWORK', sourceCurrencyCode: string}; export type CreateApiPaymentsVirtualAccountDepositInstructionsArgs = {'X-Idempotency-Key'?: string | undefined, body: VirtualAccountDepositInstructionsRequest}; export type CreateApiPaymentsVirtualAccountDepositInstructionsOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create or retrieve standing virtual-account onramp deposit instructions * * POST /payments/virtual-account/deposit-instructions */ export const createApiPaymentsVirtualAccountDepositInstructions = async (args: CreateApiPaymentsVirtualAccountDepositInstructionsArgs, options?: CreateApiPaymentsVirtualAccountDepositInstructionsOptions) => { const {baseUrl = "https://api-sb.meld.io", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (args['X-Idempotency-Key'] != null) headers.set("X-Idempotency-Key", String(args['X-Idempotency-Key'])) if (ApiKeyAuth !== undefined) headers.set("Authorization", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/payments/virtual-account/deposit-instructions${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 res.blob() };