@yaelouuu/fortnite-api 8.0.0 → 8.1.0

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.
package/README.md CHANGED
@@ -446,6 +446,31 @@ const history = await client.map.getHistory();
446
446
 
447
447
  ---
448
448
 
449
+ ### Sprites - **NEW**
450
+
451
+ Seasonal Sprites catalog (Chapter 7 Season 3 extraction mechanic) — every sprite family and variant with rarity, icons, boons, and **live drop rates**. Drop weights include Epic's live hotfix overlay, so Power-Hour / "More Gem Sprites!" rotations show up without waiting for a game update.
452
+
453
+ ```typescript
454
+ // Get the full catalog (families, variants, drop rates, level-up curve, event weight sets)
455
+ const catalog = await client.sprites.getSprites();
456
+ // catalog.data.sprites[0].variants[1].dropChancePercent -> e.g. 2 (% within the family)
457
+
458
+ // Only Gold variants across all families
459
+ const gold = await client.sprites.getSprites({ variant: "gold" });
460
+
461
+ // Search by name, filter by rarity
462
+ const ducks = await client.sprites.getSprites({ search: "duck" });
463
+ const legendaries = await client.sprites.getSprites({ rarity: "legendary" });
464
+
465
+ // One family — by family id, variant id, or display name
466
+ const duck = await client.sprites.getSprite("DuckSprite");
467
+
468
+ // All SpriteBoons perks with names and descriptions
469
+ const boons = await client.sprites.getBoons();
470
+ ```
471
+
472
+ ---
473
+
449
474
  ### Playlists - **NEW**
450
475
 
451
476
  Fortnite playlists and game modes.
package/dist/client.d.ts CHANGED
@@ -19,6 +19,7 @@ import { CosmeticsResource } from "./resources/cosmetics";
19
19
  import { CrewResource } from "./resources/crew";
20
20
  import { MapResource } from "./resources/map";
21
21
  import { PlaylistsResource } from "./resources/playlists";
22
+ import { SpritesResource } from "./resources/sprites";
22
23
  export interface ClientOptions {
23
24
  apiKey: string;
24
25
  baseUrl?: string;
@@ -47,6 +48,7 @@ export declare class FortniteAPI {
47
48
  crew: CrewResource;
48
49
  map: MapResource;
49
50
  playlists: PlaylistsResource;
51
+ sprites: SpritesResource;
50
52
  constructor(options: ClientOptions);
51
53
  /**
52
54
  * Internal method to make HTTP requests
package/dist/client.js CHANGED
@@ -23,6 +23,7 @@ const cosmetics_1 = require("./resources/cosmetics");
23
23
  const crew_1 = require("./resources/crew");
24
24
  const map_1 = require("./resources/map");
25
25
  const playlists_1 = require("./resources/playlists");
26
+ const sprites_1 = require("./resources/sprites");
26
27
  class FortniteAPI {
27
28
  constructor(options) {
28
29
  this.apiKey = options.apiKey;
@@ -50,6 +51,7 @@ class FortniteAPI {
50
51
  this.crew = new crew_1.CrewResource(this);
51
52
  this.map = new map_1.MapResource(this);
52
53
  this.playlists = new playlists_1.PlaylistsResource(this);
54
+ this.sprites = new sprites_1.SpritesResource(this);
53
55
  }
54
56
  /**
55
57
  * Internal method to make HTTP requests
@@ -0,0 +1,29 @@
1
+ import { FortniteAPI } from "../client";
2
+ import { SpritesResponse, SpriteResponse, SpriteBoonsResponse } from "../types";
3
+ export declare class SpritesResource {
4
+ private client;
5
+ constructor(client: FortniteAPI);
6
+ /**
7
+ * Get the full sprite catalog: families with nested variants, current + PAK-base
8
+ * drop weights, normalized drop chances, rarity, icons, boons, the level-up XP
9
+ * curve, and alternate event weight sets. Drop weights include Epic's live hotfix
10
+ * overlay, so Power-Hour / event rotations are reflected without a game update.
11
+ * @param options.search - Filter by sprite name or id (family or variant, contains match)
12
+ * @param options.rarity - Filter by rarity (e.g. epic, legendary)
13
+ * @param options.variant - Filter to one variant label across families (base, gold, candy, galaxy, gem, holofoil, cube)
14
+ */
15
+ getSprites(options?: {
16
+ search?: string;
17
+ rarity?: string;
18
+ variant?: string;
19
+ }): Promise<SpritesResponse>;
20
+ /**
21
+ * Get a single sprite family by family id (e.g. "DuckSprite"), variant id
22
+ * (e.g. "DuckSprite_Variant_Gold"), or display name (e.g. "Duck Sprite").
23
+ */
24
+ getSprite(id: string): Promise<SpriteResponse>;
25
+ /**
26
+ * Get all SpriteBoons perks with names and descriptions.
27
+ */
28
+ getBoons(): Promise<SpriteBoonsResponse>;
29
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SpritesResource = void 0;
4
+ class SpritesResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Get the full sprite catalog: families with nested variants, current + PAK-base
10
+ * drop weights, normalized drop chances, rarity, icons, boons, the level-up XP
11
+ * curve, and alternate event weight sets. Drop weights include Epic's live hotfix
12
+ * overlay, so Power-Hour / event rotations are reflected without a game update.
13
+ * @param options.search - Filter by sprite name or id (family or variant, contains match)
14
+ * @param options.rarity - Filter by rarity (e.g. epic, legendary)
15
+ * @param options.variant - Filter to one variant label across families (base, gold, candy, galaxy, gem, holofoil, cube)
16
+ */
17
+ async getSprites(options) {
18
+ const params = new URLSearchParams();
19
+ if (options?.search)
20
+ params.set("search", options.search);
21
+ if (options?.rarity)
22
+ params.set("rarity", options.rarity);
23
+ if (options?.variant)
24
+ params.set("variant", options.variant);
25
+ const query = params.toString() ? `?${params.toString()}` : "";
26
+ return this.client.request(`/sprites${query}`, {}, "v2");
27
+ }
28
+ /**
29
+ * Get a single sprite family by family id (e.g. "DuckSprite"), variant id
30
+ * (e.g. "DuckSprite_Variant_Gold"), or display name (e.g. "Duck Sprite").
31
+ */
32
+ async getSprite(id) {
33
+ return this.client.request(`/sprites/${encodeURIComponent(id)}`, {}, "v2");
34
+ }
35
+ /**
36
+ * Get all SpriteBoons perks with names and descriptions.
37
+ */
38
+ async getBoons() {
39
+ return this.client.request("/sprites/boons", {}, "v2");
40
+ }
41
+ }
42
+ exports.SpritesResource = SpritesResource;
@@ -1008,3 +1008,78 @@ export interface Playlist {
1008
1008
  lastModified?: string;
1009
1009
  [key: string]: any;
1010
1010
  }
1011
+ export interface SpriteImages {
1012
+ icon?: string | null;
1013
+ iconLarge?: string | null;
1014
+ }
1015
+ export interface SpriteBoonRef {
1016
+ id: string;
1017
+ chance?: number | null;
1018
+ }
1019
+ export interface SpriteVariant {
1020
+ id: string;
1021
+ /** Variant label: Base, Gold, Candy, Galaxy, Gem, Holofoil, Cube, ... */
1022
+ variant: string;
1023
+ name?: string | null;
1024
+ rarity?: string | null;
1025
+ /** False when the current hotfix disables the variant. */
1026
+ enabled: boolean;
1027
+ images?: SpriteImages | null;
1028
+ /** Weight as cooked in the game files (PAK). */
1029
+ baseWeight?: number | null;
1030
+ /** Weight after Epic's live hotfix overlay — what the game currently uses. */
1031
+ weight?: number | null;
1032
+ /** Current weight normalized within the family, percentage 0-100. */
1033
+ dropChancePercent?: number | null;
1034
+ boons: SpriteBoonRef[];
1035
+ }
1036
+ export interface SpriteFamily {
1037
+ id: string;
1038
+ name?: string | null;
1039
+ description?: string | null;
1040
+ /** Epic's own sprite-dex ordering number. */
1041
+ dexNumber?: number | null;
1042
+ rarity?: string | null;
1043
+ acquisitionHint?: string | null;
1044
+ extractRewardLootTier?: string | null;
1045
+ images?: SpriteImages | null;
1046
+ tags: string[];
1047
+ boons: SpriteBoonRef[];
1048
+ variants: SpriteVariant[];
1049
+ }
1050
+ export interface SpriteLevel {
1051
+ level: number;
1052
+ xp: number;
1053
+ }
1054
+ export interface SpriteEvent {
1055
+ name: string;
1056
+ weights: Record<string, number>;
1057
+ }
1058
+ export interface SpritesData {
1059
+ gameVersion: string;
1060
+ generated: string;
1061
+ /** True when the drop weights include the live CloudStorage hotfix overlay. */
1062
+ hotfixApplied: boolean;
1063
+ sprites: SpriteFamily[];
1064
+ /** Cumulative Sprite Dust thresholds per sprite level. */
1065
+ levelUpCurve: SpriteLevel[];
1066
+ /** Alternate weight sets from event hotfixes (Power Hours etc.). */
1067
+ events: SpriteEvent[];
1068
+ }
1069
+ export interface SpritesResponse {
1070
+ status: number;
1071
+ data: SpritesData;
1072
+ }
1073
+ export interface SpriteResponse {
1074
+ status: number;
1075
+ data: SpriteFamily;
1076
+ }
1077
+ export interface SpriteBoon {
1078
+ id: string;
1079
+ name?: string | null;
1080
+ description?: string | null;
1081
+ }
1082
+ export interface SpriteBoonsResponse {
1083
+ status: number;
1084
+ data: SpriteBoon[];
1085
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaelouuu/fortnite-api",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "SDK for Fortnite API - api-fortnite.com - Author : Yael Brinkert",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",