aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/fairysouls.ts
blob: 67de0ddb533ff77cc6ac92fe41c92928c3b9ce20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import * as constants from '../../constants.js'

export interface FairySouls {
	total: number
	/** The number of fairy souls that haven't been exchanged yet */
	unexchanged: number
	exchanges: number
	/** The highest possible number of total fairy souls */
	max: number
}

export async function cleanFairySouls(data: any): Promise<FairySouls> {
	const { max_fairy_souls } = await constants.fetchConstantValues()
	return {
		total: data?.fairy_souls_collected ?? 0,
		unexchanged: data?.fairy_souls ?? 0,
		exchanges: data?.fairy_exchanges ?? 0,
		max: max_fairy_souls ?? 0,
	}
}