aboutsummaryrefslogtreecommitdiff
path: root/src/cleaners/skyblock/fairysouls.ts
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-02-16 23:07:23 -0600
committermat <github@matdoes.dev>2022-02-16 23:07:23 -0600
commitff6dcfbe52cc325fce1acd3cb4f160d233967eec (patch)
tree02587128aa05ba4fd32652ff5de7a463864a0656 /src/cleaners/skyblock/fairysouls.ts
parent0c3a4d5e791be8fb9c34d55c13797c9f33871ca4 (diff)
downloadskyblock-api-ff6dcfbe52cc325fce1acd3cb4f160d233967eec.tar.gz
skyblock-api-ff6dcfbe52cc325fce1acd3cb4f160d233967eec.tar.bz2
skyblock-api-ff6dcfbe52cc325fce1acd3cb4f160d233967eec.zip
return max fairy souls and max minions in member
makes it so we don't have to fetch /constants from the frontend
Diffstat (limited to 'src/cleaners/skyblock/fairysouls.ts')
-rw-r--r--src/cleaners/skyblock/fairysouls.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cleaners/skyblock/fairysouls.ts b/src/cleaners/skyblock/fairysouls.ts
index 11bbc9e..29c8502 100644
--- a/src/cleaners/skyblock/fairysouls.ts
+++ b/src/cleaners/skyblock/fairysouls.ts
@@ -1,14 +1,20 @@
+import * as constants from '../../constants'
+
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 function cleanFairySouls(data: any): FairySouls {
+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,
}
} \ No newline at end of file