@fireballgg/sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +39 -0
  2. package/dist/abis/sparks.abi.json +195 -0
  3. package/dist/chunk-3GG7NNPX.js +2 -0
  4. package/dist/chunk-3GG7NNPX.js.map +1 -0
  5. package/dist/chunk-4C666HHU.js +2 -0
  6. package/dist/chunk-4C666HHU.js.map +1 -0
  7. package/dist/chunk-CAWVA63V.js +10 -0
  8. package/dist/chunk-CAWVA63V.js.map +1 -0
  9. package/dist/chunk-HSPNA3WS.js +40 -0
  10. package/dist/chunk-HSPNA3WS.js.map +1 -0
  11. package/dist/chunk-VFDUHPNG.js +2185 -0
  12. package/dist/chunk-VFDUHPNG.js.map +1 -0
  13. package/dist/chunk-VMT37ZHW.js +2 -0
  14. package/dist/chunk-VMT37ZHW.js.map +1 -0
  15. package/dist/chunk-ZBGOXQP5.js +4 -0
  16. package/dist/chunk-ZBGOXQP5.js.map +1 -0
  17. package/dist/data/checkpoints.json +22 -0
  18. package/dist/data/constants.json +9 -0
  19. package/dist/data/enemies.json +632 -0
  20. package/dist/data/fishing_cards.json +1152 -0
  21. package/dist/data/fishing_exchange_rates.json +236 -0
  22. package/dist/data/gear.json +11617 -0
  23. package/dist/data/hatchery.json +54 -0
  24. package/dist/data/items.json +6073 -0
  25. package/dist/data/recipes.json +9471 -0
  26. package/dist/fireball-api/index.d.ts +5 -0
  27. package/dist/fireball-api/index.js +2 -0
  28. package/dist/fireball-api/index.js.map +1 -0
  29. package/dist/gigaverse-api/index.d.ts +5 -0
  30. package/dist/gigaverse-api/index.js +2 -0
  31. package/dist/gigaverse-api/index.js.map +1 -0
  32. package/dist/index-BPihDahL.d.ts +2514 -0
  33. package/dist/index-D5hv4Edu.d.ts +2474 -0
  34. package/dist/index-DKZ1Igbv.d.ts +88 -0
  35. package/dist/index-DO_0xTs_.d.ts +7499 -0
  36. package/dist/index.d.ts +1691 -0
  37. package/dist/index.js +2 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/juiced-api/index.d.ts +1 -0
  40. package/dist/juiced-api/index.js +2 -0
  41. package/dist/juiced-api/index.js.map +1 -0
  42. package/dist/juiced-subgraph/index.d.ts +3 -0
  43. package/dist/juiced-subgraph/index.js +2 -0
  44. package/dist/juiced-subgraph/index.js.map +1 -0
  45. package/dist/logger/index.d.ts +56 -0
  46. package/dist/logger/index.js +2 -0
  47. package/dist/logger/index.js.map +1 -0
  48. package/package.json +125 -0
@@ -0,0 +1,1691 @@
1
+ import { E as EffectTriggerType, D as DungeonModel, a as DungeonType, L as LootSubType, F as FishingType, b as FishingModel, c as LootType, A as ActiveEffectType, Q as QuestItemType, d as AvailableDungeonsResponse, e as EnergyResponse, f as FishingStateResponse, G as GameAction, g as FishingCard, R as Rarity, C as Checkpoint, h as DungeonLegacyType, i as DungeonPreset, j as EggType, k as Faction, l as FishMoveStrategy, m as GameType, J as JobStatus, N as Node, n as NotificationType, o as RomMemory, p as RomTier, S as SparkTransactionType, q as GameInventoryEntity, r as GigaverseApi, s as ResourceType, t as RomEntity, u as ServiceType } from './index-D5hv4Edu.js';
2
+ export { v as Action, w as ActionType, x as DungeonGearSlot, y as EffectPlayerType, z as FishingAction, B as FishingGearSlot, H as GameOutcome, I as GearSlot, K as GearType, M as GigaverseApi, O as ItemType, P as LogLevel, T as LogType, U as LootAction, V as OtherAction, W as PetType, X as QuestType, Y as Scroll, Z as Skill, _ as SkillId, $ as StatusEffectType, a0 as ToolGearSlot } from './index-D5hv4Edu.js';
3
+ import { z } from 'zod';
4
+ import { Logger } from './logger/index.js';
5
+ export { i as FireballApi } from './index-DO_0xTs_.js';
6
+ export { i as JuicedSubgraph } from './index-BPihDahL.js';
7
+ export { i as JuicedApi } from './index-DKZ1Igbv.js';
8
+ import 'exponential-backoff';
9
+ import 'pino';
10
+ import 'pino-pretty';
11
+ import '@graphql-typed-document-node/core';
12
+ import 'graphql';
13
+ import 'graphql-request';
14
+
15
+ declare const GIGAVERSE_ENDPOINT = "https://gigaverse.io/api";
16
+ declare const SQS_ENDPOINT = "https://sqs.eu-central-1.amazonaws.com/260123625827/fireball-job-runner-prod";
17
+ declare const SQS_DLQ_ENDPOINT = "https://sqs.eu-central-1.amazonaws.com/260123625827/fireball-job-runner-dlq-prod";
18
+ declare const SQS_TEST_ENDPOINT = "https://sqs.eu-central-1.amazonaws.com/260123625827/fireball-job-runner-dev";
19
+ declare const DISCORD_URL = "https://discord.gg/fireball";
20
+ declare const ROMS_CONTRACT_ADDRESS = "0x59eec556cef447e13edf4bfd3d4433d8dad8a7a5";
21
+ declare const PETS_CONTRACT_ADDRESS = "0xd320831c876190c7ef79376ffcc889756f038e04";
22
+ declare const SPARKS_CONTRACT_ADDRESS = "0x13a59f08f11e38e4766bf206a31473a510c83475";
23
+ declare const SPARK_PRICE: bigint;
24
+ declare const SPARK_PRICE_IN_ETH = 0.000003;
25
+ declare const REFERRAL_PERCENTAGE: bigint;
26
+ declare const FIVE_MINUTES_FROM_NOW: number;
27
+ declare const TEN_MINUTES_FROM_NOW: number;
28
+ declare const FIFTEEN_MINUTES_FROM_NOW: number;
29
+ declare const DAILY_RESET_HOUR_UTC = 18;
30
+ declare const DAILY_RESET_MINUTE_UTC = 0;
31
+ declare const LEVEL_THRESHOLD = 26;
32
+ declare const DEFAULT_CRIT_PROTECTION = 5;
33
+ declare const MIN_CRIT_PROTECTION = 0;
34
+ declare const MAX_CRIT_PROTECTION = 50;
35
+ declare const CRIT_DAMAGE_MULTIPLIER = 2;
36
+ declare const DEFAULT_NERF_THRESHOLD = 20;
37
+ declare const MIN_NERF_THRESHOLD = -50;
38
+ declare const MAX_NERF_THRESHOLD = 50;
39
+ declare const RESTORE_CONSUMABLES_IDS: number[];
40
+ declare const HEALING_CONSUMABLES_IDS: number[];
41
+ declare const ARMOR_CONSUMABLES_IDS: number[];
42
+ declare const WEAK_CONSUMABLES_IDS: number[];
43
+ declare const VULNERABLE_CONSUMABLES_IDS: number[];
44
+ declare const BOOM_CONSUMABLES_IDS: number[];
45
+ declare const SEAWEED_ITEM_ID = 333;
46
+ declare const FACTION_DUST_ITEM_IDS: {
47
+ readonly CRUSADER: 73;
48
+ readonly OVERSEER: 74;
49
+ readonly ATHENA: 75;
50
+ readonly ARCHON: 76;
51
+ readonly FOXGLOVE: 77;
52
+ readonly SUMMONER: 78;
53
+ readonly CHOBO: 79;
54
+ readonly GIGUS: 101;
55
+ };
56
+ declare const NOOB_CHEST_RECIPE_ID = "700000";
57
+ declare const BLUE_POT_RECIPE_ID = "700001";
58
+ declare const TAN_POT_RECIPE_ID = "700002";
59
+ declare const JUICED_CHEST_RECIPE_ID = "700003";
60
+ declare const PAPER_HANDS_RECIPE_ID = "50234";
61
+ declare const ROCK_HANDS_RECIPE_ID = "50235";
62
+ declare const PAPER_HANDS_ID = 234;
63
+ declare const ROCK_HANDS_ID = 235;
64
+ declare const CHIMPU_LURE_ID = 573;
65
+ declare const DURABILITY_PER_USE = 2;
66
+ declare const PAPER_HANDS_BASE_DURABILITY = 12;
67
+ declare const ROCK_HANDS_BASE_DURABILITY = 24;
68
+ declare const MAX_REPAIRS_BEFORE_RESET = 1;
69
+ declare const RECIPE_LOOT_COUNTS: Record<string, number>;
70
+ declare const HATCHERY_FUEL_ITEM_ID = 576;
71
+ declare const HATCHERY_COMFORT_ITEM_ID = 578;
72
+ declare const GAME_ACTION_DELAY_MS = 100;
73
+ declare const GEAR_REPAIR_DELAY_MS = 5000;
74
+
75
+ type Recipe = {
76
+ docId: string;
77
+ ID_CID: string;
78
+ NAME_CID: string;
79
+ FACTION_CID_array: number[];
80
+ GEAR_TYPE_CID: number;
81
+ DURABILITY_CID: number;
82
+ TIER_CID: number;
83
+ UINT256_CID: number;
84
+ INPUT_NAMES_CID_array: string[];
85
+ INPUT_ID_CID_array: number[];
86
+ INPUT_AMOUNT_CID_array: number[];
87
+ LOOT_ID_CID_array: number[];
88
+ LOOT_AMOUNT_CID_array: number[];
89
+ LOOT_FULFILLER_ID_CID_array: string[];
90
+ TIME_BETWEEN_CID: number;
91
+ TAG_CID_array: string[];
92
+ SUCCESS_RATE_CID: number;
93
+ COOLDOWN_CID: number;
94
+ MAX_COMPLETIONS_CID: number;
95
+ ENERGY_CID: number;
96
+ IS_JUICED_CID: boolean;
97
+ JUICED_MULTIPLIER_CID: number;
98
+ IS_DAILY_CID: boolean;
99
+ IS_WEEKLY_CID: boolean;
100
+ };
101
+ type CheckpointType = {
102
+ docId: string;
103
+ ID_CID: string;
104
+ NAME_CID: string;
105
+ DESCRIPTION_CID: string;
106
+ INPUT_ID_CID_array: number[];
107
+ INPUT_AMOUNT_CID_array: number[];
108
+ UINT256_CID_array: number[];
109
+ MAX_COMPLETIONS_CID: number;
110
+ };
111
+ interface Gear {
112
+ id: number;
113
+ slot: number;
114
+ rarity: number;
115
+ durability: number;
116
+ docId: string;
117
+ repairCount?: number;
118
+ isGear?: boolean;
119
+ }
120
+ interface JobMessage {
121
+ id: string;
122
+ accountId: string;
123
+ completedRuns: number;
124
+ totalRuns: number;
125
+ type: number;
126
+ model: number;
127
+ isAutoclaimOn: boolean;
128
+ isAutorepairOn: boolean;
129
+ isJuiced: boolean;
130
+ consumables: number[] | null;
131
+ equipment?: string[];
132
+ }
133
+ interface Loot {
134
+ id: number;
135
+ id_array: number[];
136
+ rarity: number;
137
+ val1: number;
138
+ val2: number;
139
+ name: LootType;
140
+ }
141
+ type EquipmentOptimized = [
142
+ number,
143
+ number,
144
+ number,
145
+ LootSubType
146
+ ];
147
+ interface DungeonJobOptions {
148
+ model: DungeonModel;
149
+ type: DungeonType;
150
+ autorepair: boolean;
151
+ critProtection?: number;
152
+ nerfThreshold?: number;
153
+ skipLastRoom?: boolean;
154
+ isJuiced: boolean;
155
+ consumables: number[] | null;
156
+ tier?: number;
157
+ equipment?: string[];
158
+ aggression?: number;
159
+ }
160
+ interface FishingJobOptions {
161
+ type: FishingType;
162
+ model: FishingModel;
163
+ autorepair: boolean;
164
+ useJebaitor?: boolean;
165
+ }
166
+ type JobOptions = DungeonJobOptions | FishingJobOptions;
167
+ interface QuestItemScroll {
168
+ type: QuestItemType.SCROLL;
169
+ id: number;
170
+ amount: number;
171
+ }
172
+ interface QuestItemXP {
173
+ type: QuestItemType.XP;
174
+ amount: number;
175
+ }
176
+ type QuestItem = QuestItemScroll | QuestItemXP;
177
+ interface SparksUserData {
178
+ totalSparksPurchased: bigint | null;
179
+ periodSparksPurchased: bigint | null;
180
+ lastPeriodStart: bigint | null;
181
+ }
182
+ interface SparksContractData {
183
+ paused: boolean | null;
184
+ treasury: string | null;
185
+ periodSparkLimit: bigint | null;
186
+ limitPeriodDuration: bigint | null;
187
+ totalSparksSold: bigint | null;
188
+ totalEthReceived: bigint | null;
189
+ totalPayments: number | null;
190
+ }
191
+ declare const ALLOWED_TRIGGER_TYPES: readonly [EffectTriggerType.ON_DEATH, EffectTriggerType.ON_DAMAGE];
192
+ type AllowedTriggerType = (typeof ALLOWED_TRIGGER_TYPES)[number];
193
+ type OptimizedActiveEffect = [string, string, [ActiveEffectType, number][]];
194
+
195
+ declare const getDungeonNameWithEmoji: (dungeonType: DungeonType) => string;
196
+ /**
197
+ * Helper method to get the index of a GameAction in the values array
198
+ * @param action The GameAction to find the index for
199
+ * @returns The index (0 for ROCK, 1 for PAPER, 2 for SCISSOR) or -1 if not found
200
+ */
201
+ declare const getActionIndex: (action: GameAction) => number;
202
+ /**
203
+ * Helper method to get an enemy by its ID
204
+ * @param id The ID of the enemy to find
205
+ * @returns The enemy object or undefined if not found
206
+ */
207
+ declare const getEnemyById: (id: number) => {
208
+ docId: string;
209
+ ID_CID: string;
210
+ EQUIPMENT_HEAD_CID: number;
211
+ EQUIPMENT_BODY_CID: number;
212
+ NAME_CID: string;
213
+ LOOT_ID_CID: number;
214
+ MOVE_STATS_CID_array: number[];
215
+ } | undefined;
216
+ /**
217
+ * Helper method to get an enemy name by its ID
218
+ * @param id The ID of the enemy to find
219
+ * @returns The enemy name or "unknown enemy" if not found
220
+ */
221
+ declare const getEnemyNameById: (id: number) => string;
222
+ /**
223
+ * Returns the appropriate suffix (ATK or DEF) for upgrade loot types
224
+ * based on which value is non-zero
225
+ *
226
+ * @param lootType The type of loot
227
+ * @param val1 First value (typically ATK)
228
+ * @param val2 Second value (typically DEF)
229
+ * @returns The appropriate suffix string
230
+ */
231
+ declare function getLootTypeSuffix(lootType: LootType, val1: number, val2: number): string;
232
+ declare function getLootTypeSuffixOptimized(lootType: LootType, subType: LootSubType): string;
233
+ /**
234
+ * Formats a loot name with the appropriate name and suffix
235
+ *
236
+ * @param lootType The type of loot
237
+ * @param val1 First value (typically ATK)
238
+ * @param val2 Second value (typically DEF)
239
+ * @returns Formatted string representing the loot name
240
+ */
241
+ declare function formatLootName(lootType: LootType, val1: number, val2: number, minified?: boolean): string;
242
+ declare function formatLootNameOptimized(lootTypeIndex: number, subType: LootSubType): string;
243
+ declare function getLootSubType(lootType: LootType, val1: number): LootSubType;
244
+ /**
245
+ * Capitalizes the first letter of a string
246
+ *
247
+ * @param str The string to capitalize
248
+ * @returns The capitalized string
249
+ */
250
+ declare function capitalize(str: string): string;
251
+ /**
252
+ * Helper method to get an item by its ID
253
+ * @param id The ID of the item to find
254
+ * @returns The item object or undefined if not found
255
+ */
256
+ declare const getItemById: (id: number) => {
257
+ ID_CID: number;
258
+ docId: string;
259
+ NAME_CID: string;
260
+ DESCRIPTION_CID: string;
261
+ RARITY_CID: number;
262
+ RARITY_NAME: string;
263
+ IMG_URL_CID: string;
264
+ ICON_URL_CID: string;
265
+ TYPE_CID: string;
266
+ GUIDE_CID?: undefined;
267
+ SPRITE_SHEET_URL_CID?: undefined;
268
+ CARD_CID_array?: undefined;
269
+ itemEffect?: undefined;
270
+ SIZE_CID?: undefined;
271
+ START_TIMESTAMP_CID?: undefined;
272
+ END_TIMESTAMP_CID?: undefined;
273
+ VFX?: undefined;
274
+ IS_WEEKLY_CID?: undefined;
275
+ LOOT_TABLE_CID?: undefined;
276
+ } | {
277
+ ID_CID: number;
278
+ docId: string;
279
+ NAME_CID: string;
280
+ DESCRIPTION_CID: string;
281
+ RARITY_CID: number;
282
+ RARITY_NAME: string;
283
+ IMG_URL_CID: string;
284
+ ICON_URL_CID: string;
285
+ TYPE_CID: string;
286
+ GUIDE_CID: string;
287
+ SPRITE_SHEET_URL_CID?: undefined;
288
+ CARD_CID_array?: undefined;
289
+ itemEffect?: undefined;
290
+ SIZE_CID?: undefined;
291
+ START_TIMESTAMP_CID?: undefined;
292
+ END_TIMESTAMP_CID?: undefined;
293
+ VFX?: undefined;
294
+ IS_WEEKLY_CID?: undefined;
295
+ LOOT_TABLE_CID?: undefined;
296
+ } | {
297
+ ID_CID: number;
298
+ docId: string;
299
+ NAME_CID: string;
300
+ DESCRIPTION_CID: string;
301
+ RARITY_CID: number;
302
+ RARITY_NAME: string;
303
+ IMG_URL_CID: string;
304
+ ICON_URL_CID: string;
305
+ TYPE_CID: string;
306
+ SPRITE_SHEET_URL_CID: string;
307
+ GUIDE_CID?: undefined;
308
+ CARD_CID_array?: undefined;
309
+ itemEffect?: undefined;
310
+ SIZE_CID?: undefined;
311
+ START_TIMESTAMP_CID?: undefined;
312
+ END_TIMESTAMP_CID?: undefined;
313
+ VFX?: undefined;
314
+ IS_WEEKLY_CID?: undefined;
315
+ LOOT_TABLE_CID?: undefined;
316
+ } | {
317
+ ID_CID: number;
318
+ docId: string;
319
+ NAME_CID: string;
320
+ DESCRIPTION_CID: string;
321
+ RARITY_CID: number;
322
+ RARITY_NAME: string;
323
+ IMG_URL_CID: string;
324
+ ICON_URL_CID: string;
325
+ TYPE_CID: string;
326
+ CARD_CID_array: number[];
327
+ GUIDE_CID: string;
328
+ SPRITE_SHEET_URL_CID?: undefined;
329
+ itemEffect?: undefined;
330
+ SIZE_CID?: undefined;
331
+ START_TIMESTAMP_CID?: undefined;
332
+ END_TIMESTAMP_CID?: undefined;
333
+ VFX?: undefined;
334
+ IS_WEEKLY_CID?: undefined;
335
+ LOOT_TABLE_CID?: undefined;
336
+ } | {
337
+ ID_CID: number;
338
+ docId: string;
339
+ NAME_CID: string;
340
+ DESCRIPTION_CID: string;
341
+ RARITY_CID: number;
342
+ RARITY_NAME: string;
343
+ IMG_URL_CID: string;
344
+ ICON_URL_CID: string;
345
+ TYPE_CID: string;
346
+ GUIDE_CID: string;
347
+ itemEffect: {
348
+ effects: {
349
+ triggerType: string;
350
+ effects: {
351
+ type: string;
352
+ amount: number;
353
+ playerType: string;
354
+ statusType: string;
355
+ }[];
356
+ durabilityChange: number;
357
+ playerType: string;
358
+ }[];
359
+ };
360
+ SPRITE_SHEET_URL_CID?: undefined;
361
+ CARD_CID_array?: undefined;
362
+ SIZE_CID?: undefined;
363
+ START_TIMESTAMP_CID?: undefined;
364
+ END_TIMESTAMP_CID?: undefined;
365
+ VFX?: undefined;
366
+ IS_WEEKLY_CID?: undefined;
367
+ LOOT_TABLE_CID?: undefined;
368
+ } | {
369
+ ID_CID: number;
370
+ docId: string;
371
+ NAME_CID: string;
372
+ DESCRIPTION_CID: string;
373
+ RARITY_CID: number;
374
+ RARITY_NAME: string;
375
+ IMG_URL_CID: string;
376
+ ICON_URL_CID: string;
377
+ GUIDE_CID: string;
378
+ TYPE_CID?: undefined;
379
+ SPRITE_SHEET_URL_CID?: undefined;
380
+ CARD_CID_array?: undefined;
381
+ itemEffect?: undefined;
382
+ SIZE_CID?: undefined;
383
+ START_TIMESTAMP_CID?: undefined;
384
+ END_TIMESTAMP_CID?: undefined;
385
+ VFX?: undefined;
386
+ IS_WEEKLY_CID?: undefined;
387
+ LOOT_TABLE_CID?: undefined;
388
+ } | {
389
+ ID_CID: number;
390
+ docId: string;
391
+ NAME_CID: string;
392
+ RARITY_CID: number;
393
+ RARITY_NAME: string;
394
+ IMG_URL_CID: string;
395
+ ICON_URL_CID: string;
396
+ TYPE_CID: string;
397
+ DESCRIPTION_CID?: undefined;
398
+ GUIDE_CID?: undefined;
399
+ SPRITE_SHEET_URL_CID?: undefined;
400
+ CARD_CID_array?: undefined;
401
+ itemEffect?: undefined;
402
+ SIZE_CID?: undefined;
403
+ START_TIMESTAMP_CID?: undefined;
404
+ END_TIMESTAMP_CID?: undefined;
405
+ VFX?: undefined;
406
+ IS_WEEKLY_CID?: undefined;
407
+ LOOT_TABLE_CID?: undefined;
408
+ } | {
409
+ ID_CID: number;
410
+ docId: string;
411
+ NAME_CID: string;
412
+ RARITY_CID: number;
413
+ SPRITE_SHEET_URL_CID: string;
414
+ DESCRIPTION_CID?: undefined;
415
+ RARITY_NAME?: undefined;
416
+ IMG_URL_CID?: undefined;
417
+ ICON_URL_CID?: undefined;
418
+ TYPE_CID?: undefined;
419
+ GUIDE_CID?: undefined;
420
+ CARD_CID_array?: undefined;
421
+ itemEffect?: undefined;
422
+ SIZE_CID?: undefined;
423
+ START_TIMESTAMP_CID?: undefined;
424
+ END_TIMESTAMP_CID?: undefined;
425
+ VFX?: undefined;
426
+ IS_WEEKLY_CID?: undefined;
427
+ LOOT_TABLE_CID?: undefined;
428
+ } | {
429
+ ID_CID: number;
430
+ docId: string;
431
+ NAME_CID: string;
432
+ RARITY_CID: number;
433
+ RARITY_NAME: string;
434
+ IMG_URL_CID: string;
435
+ ICON_URL_CID: string;
436
+ TYPE_CID: string;
437
+ SIZE_CID: string;
438
+ GUIDE_CID: string;
439
+ DESCRIPTION_CID?: undefined;
440
+ SPRITE_SHEET_URL_CID?: undefined;
441
+ CARD_CID_array?: undefined;
442
+ itemEffect?: undefined;
443
+ START_TIMESTAMP_CID?: undefined;
444
+ END_TIMESTAMP_CID?: undefined;
445
+ VFX?: undefined;
446
+ IS_WEEKLY_CID?: undefined;
447
+ LOOT_TABLE_CID?: undefined;
448
+ } | {
449
+ ID_CID: number;
450
+ docId: string;
451
+ NAME_CID: string;
452
+ RARITY_CID: number;
453
+ RARITY_NAME: string;
454
+ IMG_URL_CID: string;
455
+ ICON_URL_CID: string;
456
+ TYPE_CID: string;
457
+ SIZE_CID: string;
458
+ START_TIMESTAMP_CID: number;
459
+ GUIDE_CID: string;
460
+ DESCRIPTION_CID?: undefined;
461
+ SPRITE_SHEET_URL_CID?: undefined;
462
+ CARD_CID_array?: undefined;
463
+ itemEffect?: undefined;
464
+ END_TIMESTAMP_CID?: undefined;
465
+ VFX?: undefined;
466
+ IS_WEEKLY_CID?: undefined;
467
+ LOOT_TABLE_CID?: undefined;
468
+ } | {
469
+ ID_CID: number;
470
+ docId: string;
471
+ NAME_CID: string;
472
+ RARITY_CID: number;
473
+ RARITY_NAME: string;
474
+ IMG_URL_CID: string;
475
+ ICON_URL_CID: string;
476
+ TYPE_CID: string;
477
+ SIZE_CID: string;
478
+ START_TIMESTAMP_CID: number;
479
+ END_TIMESTAMP_CID: number;
480
+ GUIDE_CID: string;
481
+ DESCRIPTION_CID?: undefined;
482
+ SPRITE_SHEET_URL_CID?: undefined;
483
+ CARD_CID_array?: undefined;
484
+ itemEffect?: undefined;
485
+ VFX?: undefined;
486
+ IS_WEEKLY_CID?: undefined;
487
+ LOOT_TABLE_CID?: undefined;
488
+ } | {
489
+ ID_CID: number;
490
+ docId: string;
491
+ NAME_CID: string;
492
+ RARITY_CID: number;
493
+ IMG_URL_CID: string;
494
+ ICON_URL_CID: string;
495
+ TYPE_CID: string;
496
+ SPRITE_SHEET_URL_CID: string;
497
+ DESCRIPTION_CID?: undefined;
498
+ RARITY_NAME?: undefined;
499
+ GUIDE_CID?: undefined;
500
+ CARD_CID_array?: undefined;
501
+ itemEffect?: undefined;
502
+ SIZE_CID?: undefined;
503
+ START_TIMESTAMP_CID?: undefined;
504
+ END_TIMESTAMP_CID?: undefined;
505
+ VFX?: undefined;
506
+ IS_WEEKLY_CID?: undefined;
507
+ LOOT_TABLE_CID?: undefined;
508
+ } | {
509
+ ID_CID: number;
510
+ docId: string;
511
+ NAME_CID: string;
512
+ RARITY_CID: number;
513
+ RARITY_NAME: string;
514
+ IMG_URL_CID: string;
515
+ ICON_URL_CID: string;
516
+ TYPE_CID: string;
517
+ SPRITE_SHEET_URL_CID: string;
518
+ DESCRIPTION_CID?: undefined;
519
+ GUIDE_CID?: undefined;
520
+ CARD_CID_array?: undefined;
521
+ itemEffect?: undefined;
522
+ SIZE_CID?: undefined;
523
+ START_TIMESTAMP_CID?: undefined;
524
+ END_TIMESTAMP_CID?: undefined;
525
+ VFX?: undefined;
526
+ IS_WEEKLY_CID?: undefined;
527
+ LOOT_TABLE_CID?: undefined;
528
+ } | {
529
+ ID_CID: number;
530
+ docId: string;
531
+ NAME_CID: string;
532
+ DESCRIPTION_CID: string;
533
+ RARITY_CID: number;
534
+ RARITY_NAME: string;
535
+ IMG_URL_CID: string;
536
+ ICON_URL_CID: string;
537
+ TYPE_CID: string;
538
+ CARD_CID_array: number[];
539
+ GUIDE_CID?: undefined;
540
+ SPRITE_SHEET_URL_CID?: undefined;
541
+ itemEffect?: undefined;
542
+ SIZE_CID?: undefined;
543
+ START_TIMESTAMP_CID?: undefined;
544
+ END_TIMESTAMP_CID?: undefined;
545
+ VFX?: undefined;
546
+ IS_WEEKLY_CID?: undefined;
547
+ LOOT_TABLE_CID?: undefined;
548
+ } | {
549
+ ID_CID: number;
550
+ docId: string;
551
+ NAME_CID: string;
552
+ DESCRIPTION_CID: string;
553
+ RARITY_CID: number;
554
+ IMG_URL_CID: string;
555
+ ICON_URL_CID: string;
556
+ TYPE_CID: string;
557
+ VFX: string;
558
+ SPRITE_SHEET_URL_CID: string;
559
+ RARITY_NAME?: undefined;
560
+ GUIDE_CID?: undefined;
561
+ CARD_CID_array?: undefined;
562
+ itemEffect?: undefined;
563
+ SIZE_CID?: undefined;
564
+ START_TIMESTAMP_CID?: undefined;
565
+ END_TIMESTAMP_CID?: undefined;
566
+ IS_WEEKLY_CID?: undefined;
567
+ LOOT_TABLE_CID?: undefined;
568
+ } | {
569
+ ID_CID: number;
570
+ docId: string;
571
+ NAME_CID: string;
572
+ DESCRIPTION_CID: string;
573
+ RARITY_CID: number;
574
+ RARITY_NAME: string;
575
+ IMG_URL_CID: string;
576
+ ICON_URL_CID: string;
577
+ TYPE_CID: string;
578
+ VFX: string;
579
+ SPRITE_SHEET_URL_CID: string;
580
+ GUIDE_CID?: undefined;
581
+ CARD_CID_array?: undefined;
582
+ itemEffect?: undefined;
583
+ SIZE_CID?: undefined;
584
+ START_TIMESTAMP_CID?: undefined;
585
+ END_TIMESTAMP_CID?: undefined;
586
+ IS_WEEKLY_CID?: undefined;
587
+ LOOT_TABLE_CID?: undefined;
588
+ } | {
589
+ ID_CID: number;
590
+ docId: string;
591
+ NAME_CID: string;
592
+ DESCRIPTION_CID: string;
593
+ RARITY_CID: number;
594
+ RARITY_NAME: string;
595
+ IMG_URL_CID: string;
596
+ ICON_URL_CID: string;
597
+ TYPE_CID: string;
598
+ IS_WEEKLY_CID: boolean;
599
+ GUIDE_CID: string;
600
+ SPRITE_SHEET_URL_CID?: undefined;
601
+ CARD_CID_array?: undefined;
602
+ itemEffect?: undefined;
603
+ SIZE_CID?: undefined;
604
+ START_TIMESTAMP_CID?: undefined;
605
+ END_TIMESTAMP_CID?: undefined;
606
+ VFX?: undefined;
607
+ LOOT_TABLE_CID?: undefined;
608
+ } | {
609
+ ID_CID: number;
610
+ docId: string;
611
+ NAME_CID: string;
612
+ RARITY_CID: number;
613
+ RARITY_NAME: string;
614
+ IMG_URL_CID: string;
615
+ ICON_URL_CID: string;
616
+ DESCRIPTION_CID?: undefined;
617
+ TYPE_CID?: undefined;
618
+ GUIDE_CID?: undefined;
619
+ SPRITE_SHEET_URL_CID?: undefined;
620
+ CARD_CID_array?: undefined;
621
+ itemEffect?: undefined;
622
+ SIZE_CID?: undefined;
623
+ START_TIMESTAMP_CID?: undefined;
624
+ END_TIMESTAMP_CID?: undefined;
625
+ VFX?: undefined;
626
+ IS_WEEKLY_CID?: undefined;
627
+ LOOT_TABLE_CID?: undefined;
628
+ } | {
629
+ ID_CID: number;
630
+ docId: string;
631
+ NAME_CID: string;
632
+ DESCRIPTION_CID: string;
633
+ RARITY_CID: number;
634
+ RARITY_NAME: string;
635
+ IMG_URL_CID: string;
636
+ ICON_URL_CID: string;
637
+ TYPE_CID: string;
638
+ LOOT_TABLE_CID: number;
639
+ GUIDE_CID: string;
640
+ SPRITE_SHEET_URL_CID?: undefined;
641
+ CARD_CID_array?: undefined;
642
+ itemEffect?: undefined;
643
+ SIZE_CID?: undefined;
644
+ START_TIMESTAMP_CID?: undefined;
645
+ END_TIMESTAMP_CID?: undefined;
646
+ VFX?: undefined;
647
+ IS_WEEKLY_CID?: undefined;
648
+ } | {
649
+ ID_CID: number;
650
+ docId: string;
651
+ NAME_CID: string;
652
+ DESCRIPTION_CID: string;
653
+ RARITY_CID: number;
654
+ RARITY_NAME: string;
655
+ IMG_URL_CID: string;
656
+ ICON_URL_CID: string;
657
+ TYPE_CID: string;
658
+ LOOT_TABLE_CID: number;
659
+ GUIDE_CID?: undefined;
660
+ SPRITE_SHEET_URL_CID?: undefined;
661
+ CARD_CID_array?: undefined;
662
+ itemEffect?: undefined;
663
+ SIZE_CID?: undefined;
664
+ START_TIMESTAMP_CID?: undefined;
665
+ END_TIMESTAMP_CID?: undefined;
666
+ VFX?: undefined;
667
+ IS_WEEKLY_CID?: undefined;
668
+ } | {
669
+ ID_CID: number;
670
+ docId: string;
671
+ NAME_CID: string;
672
+ RARITY_CID: number;
673
+ RARITY_NAME: string;
674
+ IMG_URL_CID: string;
675
+ ICON_URL_CID: string;
676
+ TYPE_CID: string;
677
+ LOOT_TABLE_CID: number;
678
+ DESCRIPTION_CID?: undefined;
679
+ GUIDE_CID?: undefined;
680
+ SPRITE_SHEET_URL_CID?: undefined;
681
+ CARD_CID_array?: undefined;
682
+ itemEffect?: undefined;
683
+ SIZE_CID?: undefined;
684
+ START_TIMESTAMP_CID?: undefined;
685
+ END_TIMESTAMP_CID?: undefined;
686
+ VFX?: undefined;
687
+ IS_WEEKLY_CID?: undefined;
688
+ } | {
689
+ ID_CID: number;
690
+ docId: string;
691
+ NAME_CID: string;
692
+ RARITY_CID: number;
693
+ RARITY_NAME: string;
694
+ IMG_URL_CID: string;
695
+ ICON_URL_CID: string;
696
+ TYPE_CID: string;
697
+ SPRITE_SHEET_URL_CID: string;
698
+ GUIDE_CID: string;
699
+ DESCRIPTION_CID?: undefined;
700
+ CARD_CID_array?: undefined;
701
+ itemEffect?: undefined;
702
+ SIZE_CID?: undefined;
703
+ START_TIMESTAMP_CID?: undefined;
704
+ END_TIMESTAMP_CID?: undefined;
705
+ VFX?: undefined;
706
+ IS_WEEKLY_CID?: undefined;
707
+ LOOT_TABLE_CID?: undefined;
708
+ } | {
709
+ ID_CID: number;
710
+ docId: string;
711
+ NAME_CID: string;
712
+ DESCRIPTION_CID: string;
713
+ RARITY_CID: number;
714
+ RARITY_NAME: string;
715
+ IMG_URL_CID: string;
716
+ ICON_URL_CID: string;
717
+ TYPE_CID: string;
718
+ SIZE_CID: string;
719
+ START_TIMESTAMP_CID: number;
720
+ END_TIMESTAMP_CID: number;
721
+ GUIDE_CID?: undefined;
722
+ SPRITE_SHEET_URL_CID?: undefined;
723
+ CARD_CID_array?: undefined;
724
+ itemEffect?: undefined;
725
+ VFX?: undefined;
726
+ IS_WEEKLY_CID?: undefined;
727
+ LOOT_TABLE_CID?: undefined;
728
+ } | {
729
+ ID_CID: number;
730
+ docId: string;
731
+ NAME_CID: string;
732
+ DESCRIPTION_CID: string;
733
+ RARITY_CID: number;
734
+ RARITY_NAME: string;
735
+ IMG_URL_CID: string;
736
+ ICON_URL_CID: string;
737
+ TYPE_CID?: undefined;
738
+ GUIDE_CID?: undefined;
739
+ SPRITE_SHEET_URL_CID?: undefined;
740
+ CARD_CID_array?: undefined;
741
+ itemEffect?: undefined;
742
+ SIZE_CID?: undefined;
743
+ START_TIMESTAMP_CID?: undefined;
744
+ END_TIMESTAMP_CID?: undefined;
745
+ VFX?: undefined;
746
+ IS_WEEKLY_CID?: undefined;
747
+ LOOT_TABLE_CID?: undefined;
748
+ } | {
749
+ ID_CID: number;
750
+ docId: string;
751
+ NAME_CID: string;
752
+ DESCRIPTION_CID: string;
753
+ RARITY_CID: number;
754
+ RARITY_NAME: string;
755
+ IMG_URL_CID: string;
756
+ ICON_URL_CID: string;
757
+ TYPE_CID: string;
758
+ SPRITE_SHEET_URL_CID: string;
759
+ GUIDE_CID: string;
760
+ CARD_CID_array?: undefined;
761
+ itemEffect?: undefined;
762
+ SIZE_CID?: undefined;
763
+ START_TIMESTAMP_CID?: undefined;
764
+ END_TIMESTAMP_CID?: undefined;
765
+ VFX?: undefined;
766
+ IS_WEEKLY_CID?: undefined;
767
+ LOOT_TABLE_CID?: undefined;
768
+ } | {
769
+ ID_CID: number;
770
+ docId: string;
771
+ NAME_CID: string;
772
+ RARITY_CID: number;
773
+ RARITY_NAME: string;
774
+ IMG_URL_CID: string;
775
+ ICON_URL_CID: string;
776
+ TYPE_CID: string;
777
+ GUIDE_CID: string;
778
+ DESCRIPTION_CID?: undefined;
779
+ SPRITE_SHEET_URL_CID?: undefined;
780
+ CARD_CID_array?: undefined;
781
+ itemEffect?: undefined;
782
+ SIZE_CID?: undefined;
783
+ START_TIMESTAMP_CID?: undefined;
784
+ END_TIMESTAMP_CID?: undefined;
785
+ VFX?: undefined;
786
+ IS_WEEKLY_CID?: undefined;
787
+ LOOT_TABLE_CID?: undefined;
788
+ } | undefined;
789
+ /**
790
+ * Helper method to get an item ID by its name
791
+ /**
792
+ * @param name The name of the item to find
793
+ * @returns The item ID or -1 if not found
794
+ */
795
+ declare const getItemIdByName: (name: string) => number;
796
+ /**
797
+ * Helper method to get an item name by its ID
798
+ * @param id The ID of the item to find
799
+ * @returns The item name or "unknown" if not found
800
+ */
801
+ declare const getItemNameById: (id: number) => string;
802
+ /**
803
+ * Helper method to format item with icon and name
804
+ * @param id The ID of the item
805
+ * @returns Formatted string with icon (if available) and name
806
+ */
807
+ declare const getItemIconById: (id: number) => string;
808
+ declare const getGearById: (id: number) => {
809
+ GAME_ITEM_ID_CID: number;
810
+ NAME_CID: string;
811
+ GEAR_TYPE_CID: number;
812
+ TIER_CID: number;
813
+ EQUIPPABLE_TO_CID: number;
814
+ DURABILITY_CID_array: number[];
815
+ itemEffects: {
816
+ effects: {
817
+ triggerType: string;
818
+ effects: {
819
+ type: string;
820
+ amount: number;
821
+ playerType: string;
822
+ statusType: string;
823
+ }[];
824
+ durabilityChange: number;
825
+ playerType: string;
826
+ }[];
827
+ }[];
828
+ repairCost: {
829
+ INPUT_ID_CID_array: number[];
830
+ INPUT_AMOUNT_CID_array: number[];
831
+ RESET_INPUT_ID_CID_array: number[];
832
+ RESET_INPUT_AMOUNT_CID_array: number[];
833
+ };
834
+ REPAIR_COUNT_CID: number;
835
+ LOOT_ID_CID: number;
836
+ LOOT_AMOUNT_CID: number;
837
+ TYPE_CID?: undefined;
838
+ } | {
839
+ GAME_ITEM_ID_CID: number;
840
+ NAME_CID: string;
841
+ TYPE_CID: number;
842
+ EQUIPPABLE_TO_CID: number;
843
+ DURABILITY_CID_array: number[];
844
+ itemEffects: {
845
+ effects: {
846
+ triggerType: string;
847
+ effects: {
848
+ type: string;
849
+ amount: number;
850
+ playerType: string;
851
+ statusType: string;
852
+ }[];
853
+ durabilityChange: number;
854
+ playerType: string;
855
+ }[];
856
+ }[];
857
+ repairCost: {
858
+ INPUT_ID_CID_array: number[];
859
+ INPUT_AMOUNT_CID_array: number[];
860
+ RESET_INPUT_ID_CID_array: number[];
861
+ RESET_INPUT_AMOUNT_CID_array: number[];
862
+ };
863
+ REPAIR_COUNT_CID: number;
864
+ GEAR_TYPE_CID?: undefined;
865
+ TIER_CID?: undefined;
866
+ LOOT_ID_CID?: undefined;
867
+ LOOT_AMOUNT_CID?: undefined;
868
+ } | {
869
+ GAME_ITEM_ID_CID: number;
870
+ NAME_CID: string;
871
+ GEAR_TYPE_CID: number;
872
+ TIER_CID: number;
873
+ EQUIPPABLE_TO_CID: number;
874
+ DURABILITY_CID_array: number[];
875
+ itemEffects: {
876
+ effects: {
877
+ triggerType: string;
878
+ effects: {
879
+ type: string;
880
+ amount: number;
881
+ playerType: string;
882
+ statusType: string;
883
+ }[];
884
+ durabilityChange: number;
885
+ playerType: string;
886
+ }[];
887
+ }[];
888
+ repairCost: never[];
889
+ REPAIR_COUNT_CID: number;
890
+ LOOT_ID_CID: number;
891
+ LOOT_AMOUNT_CID: number;
892
+ TYPE_CID?: undefined;
893
+ } | undefined;
894
+ /** Transform gear from raw DB array format [id, slot, rarity, durability, repairCount] to typed objects */
895
+ declare function parseGear(gear?: Gear[] | number[][]): Gear[];
896
+ /**
897
+ * Helper method to get the rarity of an item by its ID
898
+ * @param id The ID of the item
899
+ * @returns The rarity of the item
900
+ */
901
+ declare const getItemRarity: (id: number) => Rarity;
902
+ /**
903
+ * Delays execution for a specified number of milliseconds
904
+ * @param ms The number of milliseconds to delay
905
+ * @returns A promise that resolves after the specified delay
906
+ */
907
+ declare function delay(ms: number): Promise<void>;
908
+ /**
909
+ * Validates environment variables against a Zod schema
910
+ * @param schema The Zod schema to validate against
911
+ * @param env The environment object to validate (defaults to process.env)
912
+ * @returns The validated environment variables
913
+ */
914
+ declare function validateEnv<T extends z.ZodTypeAny>(schema: T, env?: NodeJS.ProcessEnv): z.infer<T>;
915
+ /**
916
+ * Checks if a noob has enough energy and hasn't reached daily limit for a dungeon type
917
+ * @param dungeons The dungeons data from legacyClient.getAvailableDungeons()
918
+ * @param energy The energy data from legacyClient.getNoobEnergy()
919
+ * @param dungeonType The dungeon type ID to check
920
+ * @returns Object with success status, message, energy info and progress info
921
+ */
922
+ declare function checkDungeonEligibility(dungeons: AvailableDungeonsResponse, energy: EnergyResponse, dungeonType: number, isJuiced?: boolean, isJuicedRun?: boolean): {
923
+ success: boolean;
924
+ message: string;
925
+ energyInfo: {
926
+ current: number;
927
+ max: number;
928
+ entryFee: number;
929
+ };
930
+ progressInfo: {
931
+ current: number;
932
+ max: number;
933
+ };
934
+ };
935
+ declare function checkFishingEligibility(state: FishingStateResponse, energy: EnergyResponse, type: FishingType, isJuiced?: boolean): {
936
+ success: boolean;
937
+ message: string;
938
+ energyInfo: {
939
+ current: number;
940
+ max: number;
941
+ entryFee: number;
942
+ };
943
+ progressInfo: {
944
+ current: number;
945
+ max: number;
946
+ };
947
+ };
948
+ declare const getRoomData: (currentRoom: number) => {
949
+ floor: number;
950
+ room: number;
951
+ normalized: string;
952
+ };
953
+ declare function getRecipe(id: number): Recipe;
954
+ declare function getCheckpoint(id: number): CheckpointType;
955
+ declare function getEnemyLevel(id: number, room: number): number;
956
+ declare function getEnemyLootId(id: number): number;
957
+ declare const getDungeonModelData: (model: DungeonModel) => {
958
+ name: string;
959
+ };
960
+ declare const getFishingModelData: (model: FishingModel) => {
961
+ name: string;
962
+ };
963
+ declare const getModelData: (model: DungeonModel | FishingModel) => {
964
+ name: string;
965
+ };
966
+ /**
967
+ * Helper method to get a fishing card by its ID
968
+ * @param id The ID of the fishing card to find
969
+ * @returns The fishing card object or undefined if not found
970
+ */
971
+ declare const getFishingCardById: (id: number) => FishingCard | undefined;
972
+ /**
973
+ * Calculates the total catch value for fishing drops in seaweed currency
974
+ * Uses fishing exchange rates and applies a multiplier for non-seaweed items
975
+ *
976
+ * @param drops Array of drops with itemId and amount
977
+ * @param options Optional configuration
978
+ * @param options.ratesMultiplier Multiplier applied to non-seaweed items (default: 1.5)
979
+ * @returns Total catch value in seaweed currency
980
+ *
981
+ * @example
982
+ * const drops = [
983
+ * { itemId: 333, amount: 50 }, // Seaweed
984
+ * { itemId: 123, amount: 2 } // Some fish
985
+ * ];
986
+ * const value = calculateFishingCatchValue(drops);
987
+ * // Returns: seaweed amount + (fish baseVal * amount * multiplier)
988
+ */
989
+ declare const calculateFishingCatchValue: (drops: {
990
+ itemId: number;
991
+ amount: number;
992
+ }[], options?: {
993
+ ratesMultiplier?: number;
994
+ }) => number;
995
+ /**
996
+ * Get the base seaweed value for a fish item
997
+ * @param itemId The fish item ID
998
+ * @returns The base seaweed value, or null if not found
999
+ */
1000
+ declare const getFishBaseSeaweedValue: (itemId: number) => number | null;
1001
+ /**
1002
+ * Get SQS endpoint URL, checking env first then falling back to hardcoded value
1003
+ */
1004
+ declare const getSqsEndpoint: () => string;
1005
+ /**
1006
+ * Get SQS DLQ endpoint URL, checking env first then falling back to hardcoded value
1007
+ */
1008
+ declare const getSqsDlqEndpoint: () => string;
1009
+ /**
1010
+ * Get SQS test endpoint URL, checking env first then falling back to hardcoded value
1011
+ */
1012
+ declare const getSqsTestEndpoint: () => string;
1013
+ /**
1014
+ * Get active SQS endpoint based on USE_TEST_SQS env var
1015
+ */
1016
+ declare const getActiveSqsEndpoint: () => string;
1017
+
1018
+ declare const GameActionIndexLookup: Record<GameAction, number>;
1019
+ declare const DungeonTypeNameLookup: Record<DungeonType, string>;
1020
+ declare const FishingTypeNameLookup: Record<FishingType, string>;
1021
+ declare const SparkTransactionTypeNameLookup: Record<SparkTransactionType, string>;
1022
+ declare const DungeonTypeMaxRoomLookup: Record<DungeonType, number>;
1023
+ declare const DungeonTypeMaxRunsLookup: Record<DungeonType, number>;
1024
+ declare const DungeonTypeJuicedMaxRunsLookup: Record<DungeonType, number>;
1025
+ declare const DungeonTypeEmojiLookup: Record<DungeonType, string>;
1026
+ declare const DungeonPresetAggressionLookup: Record<DungeonPreset, number>;
1027
+ declare const DungeonTypeCostLookup: Record<DungeonType, number>;
1028
+ declare const DungeonTypeLegacyLookup: Record<DungeonType, DungeonLegacyType>;
1029
+ declare const DungeonTypeCheckpointLookup: Record<DungeonType, Checkpoint | null>;
1030
+ declare const DungeonTypeJuicedLookup: Record<DungeonType, boolean>;
1031
+ declare const DungeonLegacyTypeNameLookup: Record<DungeonLegacyType, string>;
1032
+ declare const DungeonStatsNameLookup: Record<DungeonLegacyType, Record<number, string>>;
1033
+ declare const DungeonModelNameLookup: Record<DungeonModel, string>;
1034
+ declare const FishingModelNameLookup: Record<FishingModel, string>;
1035
+ declare const DungeonModelVersionLookup: Record<DungeonModel, number>;
1036
+ declare const FishingModelVersionLookup: Record<FishingModel, number>;
1037
+ declare const GameTypeNameLookup: Record<GameType, string>;
1038
+ declare const JobStatusNameLookup: Record<JobStatus, string>;
1039
+ declare const FishingTypeCostLookup: Record<FishingType, number>;
1040
+ declare const FishingTypeMaxRunsLookup: Record<FishingType, number>;
1041
+ declare const FishingTypeJuicedMaxRunsLookup: Record<FishingType, number>;
1042
+ declare const FishMoveStrategyNameLookup: Record<FishMoveStrategy, string>;
1043
+ declare const RomTierNameIndexLookup: Record<RomTier, number>;
1044
+ declare const RomMemoryIndexLookup: Record<RomMemory, number>;
1045
+ declare const RarityNameLookup: Record<Rarity, string>;
1046
+ declare const RarityShortLookup: Record<Rarity, string>;
1047
+ declare const LootTypeNameLookup: Record<LootType, string>;
1048
+ declare const LootTypeIndexLookup: Record<LootType, number>;
1049
+ declare const LootIndexTypeLookup: Record<number, LootType>;
1050
+ declare const GameActionNameLookup: Record<GameAction, string>;
1051
+ declare const NodeRecipeIdLookup: Record<Node, string>;
1052
+ declare const CheckpointRecipeIdLookup: Record<Checkpoint, string>;
1053
+ declare const FactionNameIdLookup: Record<string, Faction>;
1054
+ declare const FactionIdNameLookup: Record<Faction, string>;
1055
+ declare const FactionDustItemIdLookup: Record<Faction, number | null>;
1056
+ declare const EggRarityOrderLookup: Record<EggType, number>;
1057
+ declare const EggTypeLookup: Record<EggType, string>;
1058
+ declare const StatusEffectModifiers: {
1059
+ readonly Weak: {
1060
+ readonly attackReduction: 0.25;
1061
+ };
1062
+ readonly Vulnerable: {
1063
+ readonly damageIncrease: 0.25;
1064
+ };
1065
+ readonly Burn: {};
1066
+ };
1067
+ declare const NotificationTypeMetadataLookup: Record<NotificationType, {
1068
+ name: string;
1069
+ description: string;
1070
+ }>;
1071
+ declare const VoidStatsDescriptionLookup: Record<number, {
1072
+ name: string;
1073
+ description: string;
1074
+ }>;
1075
+
1076
+ /**
1077
+ * Type definitions for loadout items
1078
+ */
1079
+ type GearLoadoutItem = [number, number, number];
1080
+ type ConsumableLoadoutItem = [number];
1081
+ type LoadoutItem = GearLoadoutItem | ConsumableLoadoutItem;
1082
+
1083
+ /**
1084
+ * Auth-related shared types
1085
+ */
1086
+ /**
1087
+ * JWT payload for Discord OAuth state
1088
+ * Used for CSRF protection during the OAuth flow
1089
+ */
1090
+ interface DiscordOAuthStatePayload {
1091
+ /** Account ID (wallet address) */
1092
+ sub: string;
1093
+ /** Purpose claim to prevent token reuse */
1094
+ purpose: "discord_oauth";
1095
+ /** Issued at timestamp */
1096
+ iat: number;
1097
+ /** Expiration timestamp */
1098
+ exp: number;
1099
+ }
1100
+
1101
+ /**
1102
+ * Fishing skill progression mappings and utilities
1103
+ */
1104
+ declare const FISHING_FIRST_SKILL_SP_TO_LEVEL: Record<number, number>;
1105
+ declare const FISHING_OTHER_SKILLS_SP_TO_LEVEL: Record<number, number>;
1106
+ declare const FISHING_FIRST_SKILL_SP_REQUIREMENTS: number[];
1107
+ declare const FISHING_OTHER_SKILLS_SP_REQUIREMENTS: number[];
1108
+ /**
1109
+ * Get the actual level from skill points for fishing skills
1110
+ * @param skillPoints The number of skill points spent
1111
+ * @param isFirstSkill Whether this is the first skill (index 0)
1112
+ * @returns The actual level (0-10)
1113
+ */
1114
+ declare const getFishingLevelFromSP: (skillPoints: number, isFirstSkill: boolean) => number;
1115
+ /**
1116
+ * Get progress info for current fishing skill level
1117
+ * @param skillPoints The number of skill points spent
1118
+ * @param isFirstSkill Whether this is the first skill (index 0)
1119
+ * @returns Progress information including current level, next level, and progress percentage
1120
+ */
1121
+ declare const getFishingLevelProgress: (skillPoints: number, isFirstSkill: boolean) => {
1122
+ currentLevel: number;
1123
+ nextLevel: number;
1124
+ currentSP: number;
1125
+ requiredSP: number;
1126
+ progressPercent: number;
1127
+ };
1128
+ declare const FISHING_SKILL_INDICES: {
1129
+ readonly STAMINA: 0;
1130
+ readonly ROD_CONTROL: 1;
1131
+ readonly JEBAITOR: 2;
1132
+ readonly WEED_DEALER: 3;
1133
+ readonly TASTE: 4;
1134
+ readonly INTUITION: 5;
1135
+ readonly LUCK: 6;
1136
+ readonly STEADY_HANDS: 7;
1137
+ };
1138
+
1139
+ /**
1140
+ * Shared fishing utilities for selling fish across client, worker, and service
1141
+ */
1142
+
1143
+ declare const DEFAULT_VALUE_THRESHOLD_MULTIPLIER = 1.5;
1144
+ declare const DEFAULT_PRESERVE_FISH_AMOUNT = 1;
1145
+ /**
1146
+ * Fish with calculated selling information
1147
+ */
1148
+ interface FishToSell {
1149
+ id: number;
1150
+ name: string;
1151
+ quantity: number;
1152
+ rawValue: number;
1153
+ valueWithBonus: number;
1154
+ optimalBatchSize: number;
1155
+ estimatedTotal: number;
1156
+ tier?: number;
1157
+ baseExchangeValue: number;
1158
+ currentExchangeValue: number;
1159
+ meetsThreshold: boolean;
1160
+ }
1161
+ /**
1162
+ * Result of analyzing fish inventory
1163
+ */
1164
+ interface FishInventoryAnalysis {
1165
+ fishToSell: FishToSell[];
1166
+ skippedFish: Array<{
1167
+ id: number;
1168
+ name: string;
1169
+ reason: "zero_value" | "below_threshold" | "preserved";
1170
+ currentValue: number;
1171
+ baseValue: number;
1172
+ }>;
1173
+ totalEstimatedValue: number;
1174
+ totalFishCount: number;
1175
+ weedDealerLevel: number;
1176
+ weedDealerBonus: number;
1177
+ }
1178
+ /**
1179
+ * Exchange rate data from fishing state
1180
+ */
1181
+ interface ExchangeRate {
1182
+ id: number;
1183
+ value: number;
1184
+ baseVal: number;
1185
+ tier?: number;
1186
+ }
1187
+ /**
1188
+ * Calculate the Weed Dealer bonus from fishing skills
1189
+ * @param skills Array of skill data from Gigaverse API
1190
+ * @returns Object with level and bonus multiplier
1191
+ */
1192
+ declare function calculateWeedDealerBonus(skills: any[]): {
1193
+ level: number;
1194
+ bonus: number;
1195
+ };
1196
+ /**
1197
+ * Find the optimal batch size for selling fish to maximize value through rounding
1198
+ * @param valuePerFish The value per fish with Weed Dealer bonus
1199
+ * @param totalQuantity Total quantity available
1200
+ * @returns Optimal batch size and total value
1201
+ */
1202
+ declare function findOptimalBatchSize(valuePerFish: number, totalQuantity: number): {
1203
+ batchSize: number;
1204
+ totalValue: number;
1205
+ };
1206
+ /**
1207
+ * Filter inventory for fish items with balance > 0
1208
+ * @param inventory Game inventory entities
1209
+ * @returns Array of fish items
1210
+ */
1211
+ declare function filterFishFromInventory(inventory: GameInventoryEntity[]): GameInventoryEntity[];
1212
+ /**
1213
+ * Analyze fish inventory and determine what to sell
1214
+ * @param fishInventory Fish items from inventory
1215
+ * @param exchangeRates Exchange rate data from fishing state
1216
+ * @param weedDealerBonus Weed Dealer skill bonus multiplier
1217
+ * @param valueThresholdMultiplier Multiplier for determining if fish value is high enough to sell
1218
+ * @param preserveRarities Array of numbers indicating how many fish to preserve for each rarity. Pass empty array to sell all. 0 = sell all, >0 = preserve that amount.
1219
+ * @returns Analysis of what fish to sell
1220
+ */
1221
+ declare function analyzeFishInventory(fishInventory: GameInventoryEntity[], exchangeRates: ExchangeRate[], weedDealerBonus: number, valueThresholdMultiplier: number, preserveRarities: number[]): FishInventoryAnalysis;
1222
+ /**
1223
+ * Prepare fish batches for selling
1224
+ * @param fish Fish to sell with optimal batch size
1225
+ * @returns Array of batches to sell
1226
+ */
1227
+ declare function prepareFishBatches(fish: FishToSell): Array<{
1228
+ amount: number;
1229
+ expectedValue: number;
1230
+ }>;
1231
+ /**
1232
+ * Extract seaweed earned from sell response
1233
+ * @param gameItemBalanceChanges Array of item balance changes from sell response
1234
+ * @returns Amount of seaweed earned
1235
+ */
1236
+ declare function extractSeaweedEarned(gameItemBalanceChanges: any[]): number;
1237
+ /**
1238
+ * Calculate estimated fish inventory for display (simplified version for UI)
1239
+ * @param inventory Game inventory entities
1240
+ * @param exchangeRates Exchange rates from fishing state (required for accurate calculation)
1241
+ * @param skills Account skills array for calculating Weed Dealer bonus
1242
+ * @param preserveRarities Array of numbers indicating how many fish to preserve for each rarity. Pass empty array to sell all. 0 = sell all, >0 = preserve that amount.
1243
+ * @returns Simplified inventory info for UI display
1244
+ */
1245
+ declare function calculateFishInventoryDisplay(inventory: GameInventoryEntity[], exchangeRates: ExchangeRate[], skills?: any[], preserveRarities?: number[]): {
1246
+ hasSellableFish: boolean;
1247
+ totalFish: number;
1248
+ totalSellableFish: number;
1249
+ estimatedSeaweed: number;
1250
+ message: string;
1251
+ };
1252
+ /**
1253
+ * Result of selling fish
1254
+ */
1255
+ interface SellFishResult {
1256
+ success: boolean;
1257
+ fishId: number;
1258
+ amount: number;
1259
+ seaweed?: number;
1260
+ }
1261
+ /**
1262
+ * Complete result of selling all fish
1263
+ */
1264
+ interface SellAllFishResult {
1265
+ success: boolean;
1266
+ totalFishSold: number;
1267
+ totalSeaweedEarned: number;
1268
+ sellResults: SellFishResult[];
1269
+ analysis: FishInventoryAnalysis;
1270
+ }
1271
+ /**
1272
+ * Execute the complete fish selling flow
1273
+ *
1274
+ * NOTE: This function does NOT check spark balance or scroll access.
1275
+ * Access control (sparks, scrolls) is handled by the UseService GraphQL mutation
1276
+ * which is called after fish are sold.
1277
+ *
1278
+ * @param gigaverse Gigaverse API instance
1279
+ * @param accountId Account ID (wallet address)
1280
+ * @param jwt JWT token for authentication
1281
+ * @param tokenId Token ID for skill calculation
1282
+ * @param preserveRarities Array of numbers indicating how many fish to preserve for each rarity. Pass empty array to sell all. 0 = sell all, >0 = preserve that amount.
1283
+ * @returns Complete selling result
1284
+ */
1285
+ declare function executeFishSelling(gigaverse: GigaverseApi, accountId: string, jwt: string, tokenId: number, preserveRarities: number[]): Promise<SellAllFishResult>;
1286
+
1287
+ /**
1288
+ * Fish movement strategy detection
1289
+ *
1290
+ * Determines the fish movement pattern (CARDINAL, CORNERS, or PLUS)
1291
+ * based on observing the fish's previous and current positions.
1292
+ *
1293
+ * Used by both the fishing bot and the hint system (via API).
1294
+ */
1295
+
1296
+ /**
1297
+ * Determine fish movement strategy from observed positions.
1298
+ * Returns undefined if fish didn't move (can't determine from no movement).
1299
+ */
1300
+ declare function determineFishStrategy(prev: [number, number], current: [number, number]): FishMoveStrategy | undefined;
1301
+
1302
+ type ClaimResourceFunction = (params: {
1303
+ romId: string;
1304
+ resourceId: ResourceType;
1305
+ accountJwt: string;
1306
+ }) => Promise<{
1307
+ success: boolean;
1308
+ }>;
1309
+ interface EnergyData {
1310
+ currentEnergy: number;
1311
+ maxEnergy: number;
1312
+ romsEnergy: number;
1313
+ activeRoms: RomEntity[];
1314
+ }
1315
+ interface EnergyClaimOptions {
1316
+ gigaverseApi: GigaverseApi;
1317
+ accountId: string;
1318
+ accountJwt: string;
1319
+ energyRequired: number;
1320
+ claimResourceFunction?: ClaimResourceFunction;
1321
+ energyData?: EnergyData;
1322
+ }
1323
+ interface EnergyClaimResult {
1324
+ success: boolean;
1325
+ message: string;
1326
+ currentEnergy: number;
1327
+ romsEnergy: number;
1328
+ energyClaimed: number;
1329
+ }
1330
+ /**
1331
+ * Claims energy from ROMs if needed to meet the energy requirement
1332
+ * @param options Energy claiming configuration
1333
+ * @param options.energyData Optional energy data to avoid API calls if already available
1334
+ * @returns Result of the energy claiming operation
1335
+ */
1336
+ declare function claimEnergyIfNeeded(options: EnergyClaimOptions): Promise<EnergyClaimResult>;
1337
+
1338
+ declare const DUNGEON_SKILL_1_SP_TO_LEVEL: Record<number, number>;
1339
+ declare const DUNGEON_SKILL_2_SP_TO_LEVEL: Record<number, number>;
1340
+ declare const DUNGEON_SP_TO_LEVEL: Record<number, number>;
1341
+ declare const DUNGEON_SKILL_1_SP_REQUIREMENTS: number[];
1342
+ declare const DUNGEON_SKILL_2_SP_REQUIREMENTS: number[];
1343
+ declare const DUNGEON_SP_REQUIREMENTS: number[];
1344
+ declare const VOID_MAX_STATS_SP_TO_LEVEL: Record<number, number>;
1345
+ declare const VOID_MAX_STATS_SP_REQUIREMENTS: number[];
1346
+ /**
1347
+ * Get the actual level from skill points for dungeon skills
1348
+ * @param skillPoints - Total skill points allocated
1349
+ * @param skillId - Optional skill ID (1 for FIVE_THOUSAND, 2 for UNDERHAUL, 4 for VOID)
1350
+ * @param statIndex - Optional stat index (for VOID: 6,7 are Max HP/Armor, 0-5 are special stats)
1351
+ * @returns The calculated level (0-25 for most, 0-15 for Void Max HP/Armor)
1352
+ */
1353
+ declare const getDungeonLevelFromSP: (skillPoints: number, skillId?: number, statIndex?: number) => number;
1354
+ /**
1355
+ * Get progress info for current dungeon level
1356
+ * @param skillPoints - Total skill points allocated
1357
+ * @param skillId - Optional skill ID (1 for FIVE_THOUSAND, 2 for UNDERHAUL, 4 for VOID)
1358
+ * @param statIndex - Optional stat index (for VOID: 6,7 are Max HP/Armor, 0-5 are special stats)
1359
+ * @returns Progress information including current level, next level, current SP, required SP, and progress percentage
1360
+ */
1361
+ declare const getDungeonLevelProgress: (skillPoints: number, skillId?: number, statIndex?: number) => {
1362
+ currentLevel: number;
1363
+ nextLevel: number;
1364
+ currentSP: number;
1365
+ requiredSP: number;
1366
+ progressPercent: number;
1367
+ };
1368
+ /**
1369
+ * Get winrate for a specific skill/game type
1370
+ * @param skillId - The game/skill ID (1 for FIVE_THOUSAND, 2 for UNDERHAUL, 3 for FISHING)
1371
+ * @param stats - Stats object containing winrate fields
1372
+ * @returns The winrate as a number (0-100)
1373
+ */
1374
+ declare const getWinrate: (skillId: number, stats: {
1375
+ game1Winrate?: number | null;
1376
+ game2Winrate?: number | null;
1377
+ game3Winrate?: number | null;
1378
+ } | null | undefined) => number;
1379
+ /**
1380
+ * Get game count for a specific skill/game type
1381
+ * @param skillId - The game/skill ID (1 for FIVE_THOUSAND, 2 for UNDERHAUL, 3 for FISHING)
1382
+ * @param stats - Stats object containing game count fields
1383
+ * @returns The number of games played
1384
+ */
1385
+ declare const getGameCount: (skillId: number, stats: {
1386
+ game1Count?: number | null;
1387
+ game2Count?: number | null;
1388
+ game3Count?: number | null;
1389
+ } | null | undefined) => number;
1390
+
1391
+ /**
1392
+ * Hatchery Cost Calculator
1393
+ * Calculates estimated costs and time for egg hatching based on materials per tier
1394
+ */
1395
+ declare const HATCHERY_CRAFTING_RECIPES: {
1396
+ readonly 576: {
1397
+ readonly outputItemId: 576;
1398
+ readonly outputAmount: 3;
1399
+ readonly inputItemId: 21;
1400
+ readonly inputAmount: 3;
1401
+ readonly inputName: "Wood";
1402
+ };
1403
+ readonly 577: {
1404
+ readonly outputItemId: 577;
1405
+ readonly outputAmount: 3;
1406
+ readonly inputItemId: 61;
1407
+ readonly inputAmount: 3;
1408
+ readonly inputName: "Coal";
1409
+ };
1410
+ readonly 578: {
1411
+ readonly outputItemId: 578;
1412
+ readonly outputAmount: 1;
1413
+ readonly inputItemId: 23;
1414
+ readonly inputAmount: 2;
1415
+ readonly inputName: "Bone";
1416
+ };
1417
+ readonly 579: {
1418
+ readonly outputItemId: 579;
1419
+ readonly outputAmount: 1;
1420
+ readonly inputItemId: 22;
1421
+ readonly inputAmount: 2;
1422
+ readonly inputName: "Fiber";
1423
+ };
1424
+ readonly 580: {
1425
+ readonly outputItemId: 580;
1426
+ readonly outputAmount: 1;
1427
+ readonly inputItemId: 25;
1428
+ readonly inputAmount: 5;
1429
+ readonly inputName: "Stone";
1430
+ };
1431
+ };
1432
+ interface MaterialCost {
1433
+ itemId: number;
1434
+ itemName: string;
1435
+ amount: number;
1436
+ craftingInputId?: number;
1437
+ craftingInputName?: string;
1438
+ craftingInputAmount?: number;
1439
+ }
1440
+ interface FateCost {
1441
+ factionId: number;
1442
+ dustItemId: number;
1443
+ totalDust: number;
1444
+ levels: number[];
1445
+ }
1446
+ interface HatcheryCostEstimate {
1447
+ estimatedDays: number;
1448
+ temperatureCosts: MaterialCost[];
1449
+ comfortCosts: MaterialCost[];
1450
+ fateCosts: FateCost | null;
1451
+ totalRawMaterials: Map<number, {
1452
+ name: string;
1453
+ amount: number;
1454
+ }>;
1455
+ }
1456
+ /**
1457
+ * Calculate dust needed for a specific fate level
1458
+ * Starts at 5 dust for level 1, increases by 1 each level
1459
+ * Level 1: 5, Level 2: 6, Level 3: 7, ... Level 20: 24
1460
+ */
1461
+ declare function calculateFateDustForLevel(level: number): number;
1462
+ /**
1463
+ * Calculate total dust needed from current level to target level (single faction)
1464
+ */
1465
+ declare function calculateTotalFateDust(currentLevel: number, targetLevel: number): number;
1466
+ /**
1467
+ * Result for multi-faction cycling dust calculation
1468
+ */
1469
+ interface MultiFactionDustCost {
1470
+ /** Total dust needed across all factions */
1471
+ totalDust: number;
1472
+ /** Dust needed per faction, keyed by faction ID */
1473
+ dustPerFaction: Map<number, {
1474
+ factionId: number;
1475
+ dustItemId: number;
1476
+ amount: number;
1477
+ }>;
1478
+ /** Number of remaining fate levels to reach target */
1479
+ remainingLevels: number;
1480
+ }
1481
+ /**
1482
+ * Calculate dust needed with multi-faction cycling optimization.
1483
+ *
1484
+ * The hatchery handler now selects factions based on lowest dust cost, cycling through
1485
+ * configured factions to minimize total dust consumption. Each faction's cost starts at 5
1486
+ * and increases by 1 for each use of that specific faction.
1487
+ *
1488
+ * With cycling, factions are used evenly (lowest cost first):
1489
+ * - Example: 3 factions configured to reach fate 20 from 0
1490
+ * - Single faction: 5+6+7+...+24 = 290 dust
1491
+ * - 3 factions cycling: each faction used ~7 times at costs 5,6,7,8,9,10,11 = ~168 dust total
1492
+ *
1493
+ * Selection logic (matching backend `selectFactionByDust`):
1494
+ * - Primary: Pick faction with lowest current level (lowest dust cost)
1495
+ * - Tie-breaker: Pick faction with highest inventory
1496
+ *
1497
+ * @param currentFateByFaction - Array of current fate level per faction (index = faction index, 0 = none)
1498
+ * @param targetFate - Target total fate level
1499
+ * @param factionPriorities - Array of faction IDs in priority order
1500
+ * @param factionDustItemIdLookup - Lookup from faction ID to dust item ID
1501
+ * @param inventoryByFaction - Optional inventory amounts per faction (keyed by faction ID). Used as tie-breaker when costs are equal.
1502
+ */
1503
+ declare function calculateMultiFactionDustCost(currentFateByFaction: number[], targetFate: number, factionPriorities: number[], factionDustItemIdLookup: Record<number, number | null>, inventoryByFaction?: Record<number, number>): MultiFactionDustCost;
1504
+ /**
1505
+ * Calculate materials needed to reach a specific temperature tier (one-time cost)
1506
+ */
1507
+ declare function calculateTemperatureMaterials(currentTemp: number, targetTemp: number): MaterialCost[];
1508
+ /**
1509
+ * Calculate materials needed to reach a specific comfort tier (one-time cost)
1510
+ */
1511
+ declare function calculateComfortMaterials(currentComfort: number, targetComfort: number): MaterialCost[];
1512
+ /**
1513
+ * Calculate estimated cost for hatching an egg to completion
1514
+ * Includes both one-time costs (to reach thresholds) and recurring costs (to maintain them)
1515
+ */
1516
+ declare function calculateHatcheryCost(currentProgress: number, currentTemp: number, currentComfort: number, currentFate: number, targetTemp: number, targetComfort: number, targetFate: number, progressDailyRate: number, factionId?: number, dustItemId?: number): HatcheryCostEstimate;
1517
+
1518
+ declare const ROM_CLAIM_THRESHOLD = 0.9;
1519
+ interface RomServiceOptions {
1520
+ shouldConvertEnergy?: boolean;
1521
+ energyThreshold?: number;
1522
+ }
1523
+ interface LootCollectorServiceOptions {
1524
+ }
1525
+ interface FishingServiceOptions {
1526
+ preserveRarities?: number[];
1527
+ }
1528
+ interface EggThresholds {
1529
+ temperature: number;
1530
+ comfort: number;
1531
+ fate: number;
1532
+ factionId?: number;
1533
+ }
1534
+ type EggThresholdArray = [number, number, number, number, number[] | number | null];
1535
+ interface HatchingServiceOptions {
1536
+ eggThresholds?: EggThresholdArray[];
1537
+ defaultThresholds?: EggThresholds;
1538
+ maxRawMaterialsPerDay?: {
1539
+ wood?: number;
1540
+ coal?: number;
1541
+ bones?: number;
1542
+ fibre?: number;
1543
+ stone?: number;
1544
+ };
1545
+ }
1546
+ type ServiceOptions = RomServiceOptions | LootCollectorServiceOptions | FishingServiceOptions | HatchingServiceOptions;
1547
+ declare enum ServiceAction {
1548
+ SUBSCRIBE = "subscribe",
1549
+ UNSUBSCRIBE = "unsubscribe",
1550
+ UPDATE_OPTIONS = "updateOptions",
1551
+ REVEAL = "reveal"
1552
+ }
1553
+ interface ServiceMetadata {
1554
+ service_id?: number;
1555
+ operations?: number[][];
1556
+ /** True for manual user actions (e.g., clicking Sell button) - won't trigger reveal */
1557
+ manual?: boolean;
1558
+ /** True when Scroll of Fire provided free access for this transaction */
1559
+ free_access?: boolean;
1560
+ }
1561
+ declare const ServiceTypeNameLookup: Record<ServiceType, string>;
1562
+
1563
+ declare class AbortedError extends Error {
1564
+ constructor(message?: string);
1565
+ }
1566
+
1567
+ declare class InvalidMessageError extends Error {
1568
+ readonly metadata: Record<string, unknown>;
1569
+ constructor(message?: string, metadata?: Record<string, unknown>);
1570
+ }
1571
+
1572
+ type MessageId = string;
1573
+ type Primitive = string | number | boolean;
1574
+ type MessageMetadata = Record<string, Primitive>;
1575
+ type IMessageMetadata = {
1576
+ id: MessageId;
1577
+ metadata: MessageMetadata;
1578
+ correlationId?: string;
1579
+ };
1580
+ type IRawMessage = IMessageMetadata & {
1581
+ data: string;
1582
+ };
1583
+ type IMessage<TData> = IMessageMetadata & {
1584
+ data: TData;
1585
+ };
1586
+
1587
+ type MessageReceiveOptions = {
1588
+ maxNumberOfMessages: number;
1589
+ waitTimeSeconds: number;
1590
+ };
1591
+ type MessageVisibilityOptions = {
1592
+ messageId: MessageId;
1593
+ visibilityTimeoutInSeconds: number;
1594
+ };
1595
+ type MessageSendOptions = {
1596
+ data: string;
1597
+ delaySeconds?: number;
1598
+ };
1599
+ interface IQueue {
1600
+ receiveMessages(options?: MessageReceiveOptions): Promise<IRawMessage[]>;
1601
+ changeMessageVisibility(options: MessageVisibilityOptions): Promise<void>;
1602
+ deleteMessage(id: MessageId): Promise<void>;
1603
+ sendMessage(options: MessageSendOptions): Promise<void>;
1604
+ }
1605
+
1606
+ type ParseResult<T> = ValidParseResult<T> | InvalidParseResult;
1607
+ type ValidParseResult<T> = {
1608
+ success: true;
1609
+ data: T;
1610
+ };
1611
+ type InvalidParseResult = {
1612
+ success: false;
1613
+ errors: unknown[];
1614
+ };
1615
+ interface IMessageParser<T> {
1616
+ parse(message: string): ParseResult<T>;
1617
+ }
1618
+ declare function valid<T>(data: T): ValidParseResult<T>;
1619
+ declare function invalid(errors: unknown[]): InvalidParseResult;
1620
+
1621
+ type RawMessageHandleRequest = {
1622
+ message: IRawMessage;
1623
+ abortSignal: AbortSignal;
1624
+ };
1625
+ type MessageHandleRequest<T> = {
1626
+ message: IMessage<T>;
1627
+ abortSignal: AbortSignal;
1628
+ };
1629
+ interface IMessageHandler {
1630
+ handle(request: RawMessageHandleRequest): Promise<void>;
1631
+ }
1632
+ declare abstract class MessageHandler<T> implements IMessageHandler {
1633
+ protected readonly logger: Logger;
1634
+ protected readonly parser: IMessageParser<T>;
1635
+ protected constructor(logger: Logger, parser: IMessageParser<T>);
1636
+ handle(request: RawMessageHandleRequest): Promise<void>;
1637
+ private tryHandle;
1638
+ protected abstract handleMessage(message: MessageHandleRequest<T>): Promise<void>;
1639
+ protected getMessageContext(message: IMessage<T>): Record<string, Primitive>;
1640
+ private mapRawMessageToTypedMessage;
1641
+ }
1642
+
1643
+ type SqsQueueOptions = {
1644
+ region: string;
1645
+ queueUrl: string;
1646
+ /** Optional custom endpoint URL (e.g., for LocalStack) */
1647
+ endpoint?: string;
1648
+ };
1649
+ /**
1650
+ * SQS implementation of the IQueue interface.
1651
+ * Maps SQS messages to the standard IMessage format.
1652
+ */
1653
+ declare class SqsQueue implements IQueue {
1654
+ private readonly options;
1655
+ private readonly client;
1656
+ constructor(options: SqsQueueOptions);
1657
+ /**
1658
+ * Receive messages from the SQS queue
1659
+ * @param options - Message receive options including max messages and wait time
1660
+ * @returns Array of messages in IMessage format
1661
+ */
1662
+ receiveMessages(options?: MessageReceiveOptions): Promise<IRawMessage[]>;
1663
+ /**
1664
+ * Change the visibility timeout of a message
1665
+ * @param options - Message visibility options including message ID and visibility timeout in seconds
1666
+ */
1667
+ changeMessageVisibility(options: MessageVisibilityOptions): Promise<void>;
1668
+ /**
1669
+ * Delete a message from the queue
1670
+ * @param id - Message ID (receipt handle)
1671
+ */
1672
+ deleteMessage(id: MessageId): Promise<void>;
1673
+ /**
1674
+ * Send a message to the queue
1675
+ * @param options - Message send options including data and optional delay
1676
+ */
1677
+ sendMessage(options: MessageSendOptions): Promise<void>;
1678
+ /**
1679
+ * Map an SQS message to the IMessage format
1680
+ * The message ID is used as the ID, and the receipt handle is stored in metadata
1681
+ */
1682
+ private mapToMessage;
1683
+ }
1684
+
1685
+ declare class ZodMessageParser<T> implements IMessageParser<T> {
1686
+ private readonly schema;
1687
+ constructor(schema: z.Schema<T>);
1688
+ parse(message: string): ParseResult<T>;
1689
+ }
1690
+
1691
+ export { ALLOWED_TRIGGER_TYPES, ARMOR_CONSUMABLES_IDS, AbortedError, ActiveEffectType, type AllowedTriggerType, BLUE_POT_RECIPE_ID, BOOM_CONSUMABLES_IDS, CHIMPU_LURE_ID, CRIT_DAMAGE_MULTIPLIER, Checkpoint, CheckpointRecipeIdLookup, type CheckpointType, type ClaimResourceFunction, type ConsumableLoadoutItem, DAILY_RESET_HOUR_UTC, DAILY_RESET_MINUTE_UTC, DEFAULT_CRIT_PROTECTION, DEFAULT_NERF_THRESHOLD, DEFAULT_PRESERVE_FISH_AMOUNT, DEFAULT_VALUE_THRESHOLD_MULTIPLIER, DISCORD_URL, DUNGEON_SKILL_1_SP_REQUIREMENTS, DUNGEON_SKILL_1_SP_TO_LEVEL, DUNGEON_SKILL_2_SP_REQUIREMENTS, DUNGEON_SKILL_2_SP_TO_LEVEL, DUNGEON_SP_REQUIREMENTS, DUNGEON_SP_TO_LEVEL, DURABILITY_PER_USE, type DiscordOAuthStatePayload, type DungeonJobOptions, DungeonLegacyType, DungeonLegacyTypeNameLookup, DungeonModel, DungeonModelNameLookup, DungeonModelVersionLookup, DungeonPreset, DungeonPresetAggressionLookup, DungeonStatsNameLookup, DungeonType, DungeonTypeCheckpointLookup, DungeonTypeCostLookup, DungeonTypeEmojiLookup, DungeonTypeJuicedLookup, DungeonTypeJuicedMaxRunsLookup, DungeonTypeLegacyLookup, DungeonTypeMaxRoomLookup, DungeonTypeMaxRunsLookup, DungeonTypeNameLookup, EffectTriggerType, EggRarityOrderLookup, type EggThresholdArray, type EggThresholds, EggType, EggTypeLookup, type EnergyClaimOptions, type EnergyClaimResult, type EnergyData, type EquipmentOptimized, type ExchangeRate, FACTION_DUST_ITEM_IDS, FIFTEEN_MINUTES_FROM_NOW, FISHING_FIRST_SKILL_SP_REQUIREMENTS, FISHING_FIRST_SKILL_SP_TO_LEVEL, FISHING_OTHER_SKILLS_SP_REQUIREMENTS, FISHING_OTHER_SKILLS_SP_TO_LEVEL, FISHING_SKILL_INDICES, FIVE_MINUTES_FROM_NOW, Faction, FactionDustItemIdLookup, FactionIdNameLookup, FactionNameIdLookup, type FishInventoryAnalysis, FishMoveStrategy, FishMoveStrategyNameLookup, type FishToSell, type FishingJobOptions, FishingModel, FishingModelNameLookup, FishingModelVersionLookup, type FishingServiceOptions, FishingType, FishingTypeCostLookup, FishingTypeJuicedMaxRunsLookup, FishingTypeMaxRunsLookup, FishingTypeNameLookup, GAME_ACTION_DELAY_MS, GEAR_REPAIR_DELAY_MS, GIGAVERSE_ENDPOINT, GameAction, GameActionIndexLookup, GameActionNameLookup, GameType, GameTypeNameLookup, type Gear, type GearLoadoutItem, HATCHERY_COMFORT_ITEM_ID, HATCHERY_CRAFTING_RECIPES, HATCHERY_FUEL_ITEM_ID, HEALING_CONSUMABLES_IDS, type HatchingServiceOptions, type IMessage, type IMessageHandler, type IMessageMetadata, type IMessageParser, type IQueue, type IRawMessage, InvalidMessageError, type InvalidParseResult, JUICED_CHEST_RECIPE_ID, type JobMessage, type JobOptions, JobStatus, JobStatusNameLookup, LEVEL_THRESHOLD, type LoadoutItem, type Loot, type LootCollectorServiceOptions, LootIndexTypeLookup, LootSubType, LootType, LootTypeIndexLookup, LootTypeNameLookup, MAX_CRIT_PROTECTION, MAX_NERF_THRESHOLD, MAX_REPAIRS_BEFORE_RESET, MIN_CRIT_PROTECTION, MIN_NERF_THRESHOLD, type MessageHandleRequest, MessageHandler, type MessageId, type MessageMetadata, type MessageReceiveOptions, type MessageSendOptions, type MessageVisibilityOptions, type MultiFactionDustCost, NOOB_CHEST_RECIPE_ID, Node, NodeRecipeIdLookup, NotificationType, NotificationTypeMetadataLookup, type OptimizedActiveEffect, PAPER_HANDS_BASE_DURABILITY, PAPER_HANDS_ID, PAPER_HANDS_RECIPE_ID, PETS_CONTRACT_ADDRESS, type ParseResult, type Primitive, type QuestItem, type QuestItemScroll, QuestItemType, type QuestItemXP, RECIPE_LOOT_COUNTS, REFERRAL_PERCENTAGE, RESTORE_CONSUMABLES_IDS, ROCK_HANDS_BASE_DURABILITY, ROCK_HANDS_ID, ROCK_HANDS_RECIPE_ID, ROMS_CONTRACT_ADDRESS, ROM_CLAIM_THRESHOLD, Rarity, RarityNameLookup, RarityShortLookup, type RawMessageHandleRequest, type Recipe, ResourceType, RomMemory, RomMemoryIndexLookup, type RomServiceOptions, RomTier, RomTierNameIndexLookup, SEAWEED_ITEM_ID, SPARKS_CONTRACT_ADDRESS, SPARK_PRICE, SPARK_PRICE_IN_ETH, SQS_DLQ_ENDPOINT, SQS_ENDPOINT, SQS_TEST_ENDPOINT, type SellAllFishResult, type SellFishResult, ServiceAction, type ServiceMetadata, type ServiceOptions, ServiceType, ServiceTypeNameLookup, SparkTransactionType, SparkTransactionTypeNameLookup, type SparksContractData, type SparksUserData, SqsQueue, type SqsQueueOptions, StatusEffectModifiers, TAN_POT_RECIPE_ID, TEN_MINUTES_FROM_NOW, VOID_MAX_STATS_SP_REQUIREMENTS, VOID_MAX_STATS_SP_TO_LEVEL, VULNERABLE_CONSUMABLES_IDS, type ValidParseResult, VoidStatsDescriptionLookup, WEAK_CONSUMABLES_IDS, ZodMessageParser, analyzeFishInventory, calculateComfortMaterials, calculateFateDustForLevel, calculateFishInventoryDisplay, calculateFishingCatchValue, calculateHatcheryCost, calculateMultiFactionDustCost, calculateTemperatureMaterials, calculateTotalFateDust, calculateWeedDealerBonus, capitalize, checkDungeonEligibility, checkFishingEligibility, claimEnergyIfNeeded, delay, determineFishStrategy, executeFishSelling, extractSeaweedEarned, filterFishFromInventory, findOptimalBatchSize, formatLootName, formatLootNameOptimized, getActionIndex, getActiveSqsEndpoint, getCheckpoint, getDungeonLevelFromSP, getDungeonLevelProgress, getDungeonModelData, getDungeonNameWithEmoji, getEnemyById, getEnemyLevel, getEnemyLootId, getEnemyNameById, getFishBaseSeaweedValue, getFishingCardById, getFishingLevelFromSP, getFishingLevelProgress, getFishingModelData, getGameCount, getGearById, getItemById, getItemIconById, getItemIdByName, getItemNameById, getItemRarity, getLootSubType, getLootTypeSuffix, getLootTypeSuffixOptimized, getModelData, getRecipe, getRoomData, getSqsDlqEndpoint, getSqsEndpoint, getSqsTestEndpoint, getWinrate, invalid, parseGear, prepareFishBatches, valid, validateEnv };