export type ApiClaimingType = 'all' | 'referral' | 'cashback' | 'staking' | 'rewards_stonfi' | 'rewards_dedust' | 'coffee_dex' | 'boost'; export type ApiClaimTransferRequest = {from: string, to: string, type: ApiClaimingType, tokens: Array}; export type CreateApiV1ClaimTransferArgs = {body: ApiClaimTransferRequest}; export type CreateApiV1ClaimTransferOptions = {baseUrl?: string | undefined, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Transfer available in claim-center tokens from one account to another. For internal usage only * * POST /v1/claim/transfer */ export const createApiV1ClaimTransfer = async (args: CreateApiV1ClaimTransferArgs, options?: CreateApiV1ClaimTransferOptions) => { const {baseUrl = "https://backend.swap.coffee", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKey !== undefined) headers.set("X-Api-Key", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/claim/transfer${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 };