From 4e8c3afda8fddca09f06144e16d82fff658f9314 Mon Sep 17 00:00:00 2001 From: Starknet Dev Date: Sat, 22 Jun 2024 10:34:05 +0100 Subject: [PATCH] fix indexer files --- indexer/src/adventurers.ts | 14 +------------- indexer/src/discoveries.ts | 4 +--- indexer/src/items.ts | 2 ++ indexer/src/utils/events.ts | 1 - 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/indexer/src/adventurers.ts b/indexer/src/adventurers.ts index 56e090fbc..cb7a434fa 100644 --- a/indexer/src/adventurers.ts +++ b/indexer/src/adventurers.ts @@ -11,7 +11,6 @@ import { parseDiscoveredHealth, parseStartGame, START_GAME, - PURCHASED_POTIONS, PURCHASED_ITEMS, ATTACKED_BY_BEAST, ADVENTURER_DIED, @@ -59,11 +58,10 @@ const filter = { { fromAddress: GAME, keys: [ADVENTURER_UPGRADED] }, { fromAddress: GAME, keys: [DISCOVERED_HEALTH] }, { fromAddress: GAME, keys: [DISCOVERED_GOLD] }, - { fromAddress: GAME, keys: [DISCOVERED_XP] }, + { fromAddress: GAME, keys: [DISCOVERED_LOOT] }, { fromAddress: GAME, keys: [DODGED_OBSTACLE] }, { fromAddress: GAME, keys: [HIT_BY_OBSTACLE] }, { fromAddress: GAME, keys: [DISCOVERED_BEAST] }, - { fromAddress: GAME, keys: [PURCHASED_POTIONS] }, { fromAddress: GAME, keys: [PURCHASED_ITEMS] }, { fromAddress: GAME, keys: [EQUIPPED_ITEMS] }, { fromAddress: GAME, keys: [DROPPED_ITEMS] }, @@ -207,16 +205,6 @@ export default function transform({ header, events }: Block) { }), ]; } - case PURCHASED_POTIONS: { - console.log("PURCHASED_POTIONS", "->", "ADVENTURER UPDATES"); - const { value } = parseDiscoveredXp(event.data, 0); - return [ - updateAdventurer({ - timestamp: new Date().toISOString(), - adventurerState: value.adventurerState, - }), - ]; - } case PURCHASED_ITEMS: { console.log("PURCHASED_ITEMS", "->", "ADVENTURER UPDATES"); const { value } = parsePurchasedItems(event.data, 0); diff --git a/indexer/src/discoveries.ts b/indexer/src/discoveries.ts index abac0f1f2..f4228f401 100644 --- a/indexer/src/discoveries.ts +++ b/indexer/src/discoveries.ts @@ -8,7 +8,6 @@ import { DISCOVERED_GOLD, DISCOVERED_HEALTH, DISCOVERED_LOOT, - DISCOVERED_XP, DODGED_OBSTACLE, HIT_BY_OBSTACLE, parseAmbushedByBeast, @@ -16,7 +15,6 @@ import { parseDiscoveredGold, parseDiscoveredHealth, parseDiscoveredLoot, - parseDiscoveredXp, parseHitByObstacle, } from "./utils/events.ts"; import { insertDiscovery } from "./utils/helpers.ts"; @@ -32,7 +30,7 @@ const filter = { events: [ { fromAddress: GAME, keys: [DISCOVERED_HEALTH] }, { fromAddress: GAME, keys: [DISCOVERED_GOLD] }, - { fromAddress: GAME, keys: [DISCOVERED_XP] }, + { fromAddress: GAME, keys: [DISCOVERED_LOOT] }, { fromAddress: GAME, keys: [HIT_BY_OBSTACLE] }, { fromAddress: GAME, keys: [DODGED_OBSTACLE] }, { fromAddress: GAME, keys: [AMBUSHED_BY_BEAST] }, diff --git a/indexer/src/items.ts b/indexer/src/items.ts index a5008021e..0408759cd 100644 --- a/indexer/src/items.ts +++ b/indexer/src/items.ts @@ -42,6 +42,8 @@ const filter = { events: [ { fromAddress: GAME, keys: [START_GAME] }, { fromAddress: GAME, keys: [PURCHASED_ITEMS] }, + { fromAddress: GAME, keys: [DISCOVERED_LOOT] }, + { fromAddress: GAME, keys: [EQUIPMENT_CHANGED] }, { fromAddress: GAME, keys: [EQUIPPED_ITEMS] }, { fromAddress: GAME, keys: [DROPPED_ITEMS] }, { fromAddress: GAME, keys: [HIT_BY_OBSTACLE] }, diff --git a/indexer/src/utils/events.ts b/indexer/src/utils/events.ts index 0cefd9372..eafed7516 100644 --- a/indexer/src/utils/events.ts +++ b/indexer/src/utils/events.ts @@ -37,7 +37,6 @@ export const ADVENTURER_DIED = eventKey("AdventurerDied"); export const FLEE_FAILED = eventKey("FleeFailed"); export const FLEE_SUCCEEDED = eventKey("FleeSucceeded"); -export const PURCHASED_POTIONS = eventKey("PurchasedPotions"); export const PURCHASED_ITEMS = eventKey("PurchasedItems"); export const UPGRADES_AVAILABLE = eventKey("UpgradesAvailable"); export const EQUIPPED_ITEMS = eventKey("EquippedItems");