export type CreateApiPaymentsWalletAddressesValidateArgs = {body: {address: string, token: 'USDT' | 'USDC' | 'BTC' | 'LTC' | 'DOGE' | 'BCH', network?: ('ERC20' | 'TRC20' | 'BSC' | 'SOL' | 'TON' | 'BASE') | undefined}}; export type CreateApiPaymentsWalletAddressesValidateOptions = {baseUrl?: string | undefined, appId?: string | undefined, appSecret?: string | undefined, breetEnv?: string | undefined, fetch?: typeof fetch | undefined}; /** * Validate withdrawal address * * POST /payments/wallet-addresses/validate */ export const createApiPaymentsWalletAddressesValidate = async (args: CreateApiPaymentsWalletAddressesValidateArgs, options?: CreateApiPaymentsWalletAddressesValidateOptions) => { const {baseUrl = "https://api.breet.io/v1", fetch: fetchFn = fetch, appId, appSecret, breetEnv} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (appId !== undefined) headers.set("x-app-id", appId) if (appSecret !== undefined) headers.set("x-app-secret", appSecret) if (breetEnv !== undefined) headers.set("X-Breet-Env", breetEnv) const url = `${baseUrl.replace(/\/+$/, '')}/payments/wallet-addresses/validate${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 (await res.json()) as unknown };