export type AccountAuthorizationRequest = {signedFields: {accountAddress: string, authorizedAccountAddress: string, salt: string, idsId: string, signedAtMillis: number}, signature: string, alias?: string | undefined}; export type UpdateApiApiV1TradeAccountsAuthorizeArgs = {body: AccountAuthorizationRequest}; export type UpdateApiApiV1TradeAccountsAuthorizeOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * /trade/accounts/authorize * * PUT /api/v1/trade/accounts/authorize */ export const updateApiApiV1TradeAccountsAuthorize = async (args: UpdateApiApiV1TradeAccountsAuthorizeArgs, options?: UpdateApiApiV1TradeAccountsAuthorizeOptions) => { const {baseUrl = "https://trade.api.sui-staging.bluefin.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/trade/accounts/authorize${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 };