diff --git a/indexer/env-goerli b/indexer/env-goerli
index 0441e9ee4..317ad9930 100644
--- a/indexer/env-goerli
+++ b/indexer/env-goerli
@@ -1,3 +1,3 @@
-GAME="0x01263ecbc05e28d1e99f531894838db10b90cfcdd39d020642da1747a733a37a"
+GAME="0x03f2ac2c55abbf633123ddb72adc3472feefc4e962c4cedc16dda11a2ac8d1d4"
START=873000
MONGO_CONNECTION_STRING="mongodb://mongo:mongo@54.246.178.155:27017"
diff --git a/indexer/graphql/src/indexer/graphql.py b/indexer/graphql/src/indexer/graphql.py
index 276ced2ee..5f077b9ea 100644
--- a/indexer/graphql/src/indexer/graphql.py
+++ b/indexer/graphql/src/indexer/graphql.py
@@ -621,8 +621,6 @@ class AdventurersFilter:
id: Optional[FeltValueFilter] = None
lastAction: Optional[FeltValueFilter] = None
owner: Optional[HexValueFilter] = None
- classType: Optional[ClassFilter] = None
- homeRealm: Optional[FeltValueFilter] = None
name: Optional[StringFilter] = None
health: Optional[FeltValueFilter] = None
strength: Optional[FeltValueFilter] = None
@@ -643,6 +641,7 @@ class AdventurersFilter:
ring: Optional[FeltValueFilter] = None
beastHealth: Optional[FeltValueFilter] = None
statUpgrades: Optional[FeltValueFilter] = None
+ actionsPerBlock: Optional[FeltValueFilter] = None
gold: Optional[FeltValueFilter] = None
createdTime: Optional[OrderByInput] = None
lastUpdatedTime: Optional[DateTimeFilter] = None
@@ -750,8 +749,6 @@ class AdventurersOrderByInput:
id: Optional[OrderByInput] = None
lastAction: Optional[OrderByInput] = None
owner: Optional[OrderByInput] = None
- classType: Optional[OrderByInput] = None
- homeRealm: Optional[OrderByInput] = None
name: Optional[OrderByInput] = None
health: Optional[OrderByInput] = None
level: Optional[OrderByInput] = None
@@ -773,6 +770,7 @@ class AdventurersOrderByInput:
ring: Optional[OrderByInput] = None
beastHealth: Optional[OrderByInput] = None
statUpgrades: Optional[OrderByInput] = None
+ actionsPerBlock: Optional[OrderByInput] = None
gold: Optional[OrderByInput] = None
createdTime: Optional[OrderByInput] = None
lastUpdatedTime: Optional[OrderByInput] = None
@@ -881,8 +879,6 @@ class Adventurer:
id: Optional[FeltValue]
lastAction: Optional[FeltValue]
owner: Optional[HexValue]
- classType: Optional[ClassValue]
- homeRealm: Optional[FeltValue]
name: Optional[StringValue]
health: Optional[FeltValue]
strength: Optional[FeltValue]
@@ -903,6 +899,7 @@ class Adventurer:
ring: Optional[ItemValue]
beastHealth: Optional[FeltValue]
statUpgrades: Optional[FeltValue]
+ actionsPerBlock: Optional[FeltValue]
gold: Optional[FeltValue]
createdTime: Optional[str]
lastUpdatedTime: Optional[str]
@@ -914,8 +911,6 @@ def from_mongo(cls, data):
id=data["id"],
lastAction=data["lastAction"],
owner=data["owner"],
- classType=data["classType"],
- homeRealm=data["homeRealm"],
name=data["name"],
health=data["health"],
strength=data["strength"],
@@ -936,6 +931,7 @@ def from_mongo(cls, data):
ring=data["ring"],
beastHealth=data["beastHealth"],
statUpgrades=data["statUpgrades"],
+ actionsPerBlock=data["actionsPerBlock"],
gold=data["gold"],
createdTime=data["createdTime"],
lastUpdatedTime=data["lastUpdatedTime"],
diff --git a/indexer/src/adventurers.ts b/indexer/src/adventurers.ts
index c3710fef1..58e6642e7 100644
--- a/indexer/src/adventurers.ts
+++ b/indexer/src/adventurers.ts
@@ -97,15 +97,15 @@ export default function transform({ header, events }: Block) {
return events.flatMap(({ event }) => {
switch (event.keys[0]) {
case START_GAME: {
+ console.log("START_GAME", "->", "ADVENTURER UPDATES");
const { value } = parseStartGame(event.data, 0);
const as = value.adventurerState;
const am = value.adventurerMeta;
- console.log("START_GAME", "->", "ADVENTURER UPDATES");
return [
insertAdventurer({
id: as.adventurerId,
owner: as.owner,
- lastAction: as.adventurer.lastAction,
+ lastAction: as.adventurer.lastActionBlock,
health: as.adventurer.health,
xp: as.adventurer.xp,
strength: as.adventurer.stats.strength,
@@ -126,9 +126,8 @@ export default function transform({ header, events }: Block) {
ring: as.adventurer.ring.id,
beastHealth: as.adventurer.beastHealth,
statUpgrades: as.adventurer.statsPointsAvailable,
+ actionsPerBlock: as.adventurer.actionsPerBlock,
name: am.name,
- homeRealm: am.homeRealm,
- classType: am.class,
entropy: am.entropy,
createdTime: new Date().toISOString(),
lastUpdatedTime: new Date().toISOString(),
@@ -137,8 +136,8 @@ export default function transform({ header, events }: Block) {
];
}
case ADVENTURER_UPGRADED: {
- const { value } = parseAdventurerUpgraded(event.data, 0);
console.log("ADVENTURER_UPGRADED", "->", "ADVENTURER UPDATES");
+ const { value } = parseAdventurerUpgraded(event.data, 0);
return [
updateAdventurer({
adventurerState: value.adventurerStateWithBag.adventurerState,
@@ -147,8 +146,8 @@ export default function transform({ header, events }: Block) {
];
}
case DISCOVERED_HEALTH: {
- const { value } = parseDiscoveredHealth(event.data, 0);
console.log("DISCOVERED_HEALTH", "->", "ADVENTURER UPDATES");
+ const { value } = parseDiscoveredHealth(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -157,8 +156,8 @@ export default function transform({ header, events }: Block) {
];
}
case DISCOVERED_GOLD: {
- const { value } = parseDiscoveredGold(event.data, 0);
console.log("DISCOVERED_GOLD", "->", "ADVENTURER UPDATES");
+ const { value } = parseDiscoveredGold(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -167,8 +166,8 @@ export default function transform({ header, events }: Block) {
];
}
case DISCOVERED_XP: {
- const { value } = parseDiscoveredXp(event.data, 0);
console.log("DISCOVERED_XP", "->", "ADVENTURER UPDATES");
+ const { value } = parseDiscoveredXp(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -177,8 +176,8 @@ export default function transform({ header, events }: Block) {
];
}
case DODGED_OBSTACLE: {
- const { value } = parseDodgedObstacle(event.data, 0);
console.log("DODGED_OBSTACLE", "->", "ADVENTURER UPDATES");
+ const { value } = parseDodgedObstacle(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -187,8 +186,8 @@ export default function transform({ header, events }: Block) {
];
}
case HIT_BY_OBSTACLE: {
- const { value } = parseHitByObstacle(event.data, 0);
console.log("HIT_BY_OBSTACLE", "->", "ADVENTURER UPDATES");
+ const { value } = parseHitByObstacle(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -197,8 +196,8 @@ export default function transform({ header, events }: Block) {
];
}
case DISCOVERED_BEAST: {
- const { value } = parseDiscoveredBeast(event.data, 0);
console.log("DISCOVERED_BEAST", "->", "ADVENTURER UPDATES");
+ const { value } = parseDiscoveredBeast(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -207,8 +206,8 @@ export default function transform({ header, events }: Block) {
];
}
case PURCHASED_POTIONS: {
- const { value } = parseDiscoveredXp(event.data, 0);
console.log("PURCHASED_POTIONS", "->", "ADVENTURER UPDATES");
+ const { value } = parseDiscoveredXp(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -217,8 +216,8 @@ export default function transform({ header, events }: Block) {
];
}
case PURCHASED_ITEMS: {
- const { value } = parsePurchasedItems(event.data, 0);
console.log("PURCHASED_ITEMS", "->", "ADVENTURER UPDATES");
+ const { value } = parsePurchasedItems(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -227,8 +226,8 @@ export default function transform({ header, events }: Block) {
];
}
case EQUIPPED_ITEMS: {
- const { value } = parseEquippedItems(event.data, 0);
console.log("EQUIPPED_ITEMS", "->", "ADVENTURER UPDATES");
+ const { value } = parseEquippedItems(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -237,8 +236,8 @@ export default function transform({ header, events }: Block) {
];
}
case DROPPED_ITEMS: {
- const { value } = parseDroppedItems(event.data, 0);
console.log("DROPPED_ITEMS", "->", "ADVENTURER UPDATES");
+ const { value } = parseDroppedItems(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -247,8 +246,8 @@ export default function transform({ header, events }: Block) {
];
}
case ATTACKED_BEAST: {
- const { value } = parseAttackedByBeast(event.data, 0);
console.log("ATTACKED_BEAST", "->", "ADVENTURER UPDATES");
+ const { value } = parseAttackedByBeast(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -257,8 +256,8 @@ export default function transform({ header, events }: Block) {
];
}
case ATTACKED_BY_BEAST: {
- const { value } = parseAttackedByBeast(event.data, 0);
console.log("ATTACKED_BY_BEAST", "->", "ADVENTURER UPDATES");
+ const { value } = parseAttackedByBeast(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -267,8 +266,8 @@ export default function transform({ header, events }: Block) {
];
}
case AMBUSHED_BY_BEAST: {
- const { value } = parseAmbushedByBeast(event.data, 0);
console.log("AMBUSHED_BY_BEAST", "->", "ADVENTURER UPDATES");
+ const { value } = parseAmbushedByBeast(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -277,8 +276,8 @@ export default function transform({ header, events }: Block) {
];
}
case SLAYED_BEAST: {
- const { value } = parseSlayedBeast(event.data, 0);
console.log("SLAYED_BEAST", "->", "ADVENTURER UPDATES");
+ const { value } = parseSlayedBeast(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -287,8 +286,8 @@ export default function transform({ header, events }: Block) {
];
}
case ADVENTURER_DIED: {
- const { value } = parseAdventurerDied(event.data, 0);
console.log("ADVENTURER_DIED", "->", "ADVENTURER UPDATES");
+ const { value } = parseAdventurerDied(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -297,8 +296,8 @@ export default function transform({ header, events }: Block) {
];
}
case FLEE_FAILED: {
- const { value } = parseFleeFailed(event.data, 0);
console.log("FLEE_FAILED", "->", "ADVENTURER UPDATES");
+ const { value } = parseFleeFailed(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -307,8 +306,8 @@ export default function transform({ header, events }: Block) {
];
}
case FLEE_SUCCEEDED: {
- const { value } = parseFleeSucceeded(event.data, 0);
console.log("FLEE_SUCCEEDED", "->", "ADVENTURER UPDATES");
+ const { value } = parseFleeSucceeded(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -317,8 +316,8 @@ export default function transform({ header, events }: Block) {
];
}
case ITEMS_LEVELED_UP: {
- const { value } = parseItemsLeveledUp(event.data, 0);
console.log("ITEMS_LEVELED_UP", "->", "ADVENTURER UPDATES");
+ const { value } = parseItemsLeveledUp(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
@@ -327,8 +326,8 @@ export default function transform({ header, events }: Block) {
];
}
case UPGRADES_AVAILABLE: {
- const { value } = parseUpgradesAvailable(event.data, 0);
console.log("UPGRADES_AVAILABLE", "->", "ADVENTURER UPDATES");
+ const { value } = parseUpgradesAvailable(event.data, 0);
return [
updateAdventurer({
timestamp: new Date().toISOString(),
diff --git a/indexer/src/scores.ts b/indexer/src/scores.ts
index f463689f1..907814785 100644
--- a/indexer/src/scores.ts
+++ b/indexer/src/scores.ts
@@ -72,7 +72,6 @@ export default function transform({ header, events }: Block) {
updateTotalPayout({
adventurerId: fp.adventurerId,
owner: fp.address,
- rank: fp.rank,
timestamp: new Date().toISOString(),
newPayout: fp.amount,
})
@@ -83,7 +82,6 @@ export default function transform({ header, events }: Block) {
updateTotalPayout({
adventurerId: sp.adventurerId,
owner: sp.address,
- rank: sp.rank,
timestamp: new Date().toISOString(),
newPayout: sp.amount,
})
@@ -94,7 +92,6 @@ export default function transform({ header, events }: Block) {
updateTotalPayout({
adventurerId: tp.adventurerId,
owner: tp.address,
- rank: tp.rank,
timestamp: new Date().toISOString(),
newPayout: tp.amount,
})
diff --git a/indexer/src/utils/events.ts b/indexer/src/utils/events.ts
index 2be90bf33..438463a59 100644
--- a/indexer/src/utils/events.ts
+++ b/indexer/src/utils/events.ts
@@ -75,7 +75,7 @@ export const parseLootWithPrice = combineParsers({
});
export const parseAdventurer = combineParsers({
- lastAction: { index: 0, parser: parseU16 },
+ lastActionBlock: { index: 0, parser: parseU16 },
health: { index: 1, parser: parseU16 },
xp: { index: 2, parser: parseU16 },
stats: { index: 3, parser: parseStats },
@@ -90,12 +90,13 @@ export const parseAdventurer = combineParsers({
ring: { index: 12, parser: parseLootStatistics },
beastHealth: { index: 13, parser: parseU16 },
statsPointsAvailable: { index: 14, parser: parseU8 },
- mutated: { index: 15, parser: parseBoolean },
+ actionsPerBlock: { index: 15, parser: parseU8 },
+ mutated: { index: 16, parser: parseBoolean },
});
export const parseAdventurerState = combineParsers({
owner: { index: 0, parser: parseFelt252 },
- adventurerId: { index: 1, parser: parseU256 },
+ adventurerId: { index: 1, parser: parseFelt252 },
adventurer: { index: 2, parser: parseAdventurer },
});
@@ -170,9 +171,7 @@ export const parseAdventurerDied = combineParsers({
export const parseAdventurerMetadata = combineParsers({
name: { index: 0, parser: parseU128 },
- homeRealm: { index: 1, parser: parseU16 },
- class: { index: 2, parser: parseU8 },
- entropy: { index: 3, parser: parseU128 },
+ entropy: { index: 1, parser: parseU128 },
});
export const parseStartGame = combineParsers({
diff --git a/indexer/src/utils/helpers.ts b/indexer/src/utils/helpers.ts
index 5190ff928..61457838c 100644
--- a/indexer/src/utils/helpers.ts
+++ b/indexer/src/utils/helpers.ts
@@ -24,9 +24,8 @@ export function insertAdventurer({
ring,
beastHealth,
statUpgrades,
+ actionsPerBlock,
name,
- homeRealm,
- classType,
entropy,
createdTime,
lastUpdatedTime,
@@ -62,9 +61,8 @@ export function insertAdventurer({
ring: checkExistsInt(BigInt(ring)),
beastHealth: encodeIntAsBytes(BigInt(beastHealth)),
statUpgrades: checkExistsInt(BigInt(statUpgrades)),
+ actionsPerBlock: encodeIntAsBytes(BigInt(actionsPerBlock)),
name: checkExistsInt(BigInt(name)),
- homeRealm: checkExistsInt(BigInt(homeRealm)),
- classType: checkExistsInt(BigInt(classType)),
entropy: encodeIntAsBytes(BigInt(entropy)),
createdTime: createdTime,
lastUpdatedTime: lastUpdatedTime,
@@ -170,7 +168,7 @@ export function updateAdventurer({
$set: {
id: checkExistsInt(BigInt(adventurerState.adventurerId)),
owner: checkExistsInt(BigInt(adventurerState.owner)),
- lastAction: encodeIntAsBytes(BigInt(adventurer.lastAction)),
+ lastAction: encodeIntAsBytes(BigInt(adventurer.lastActionBlock)),
health: encodeIntAsBytes(BigInt(adventurer.health)),
xp: encodeIntAsBytes(BigInt(adventurer.xp)),
strength: encodeIntAsBytes(BigInt(adventurer.stats.strength)),
@@ -191,6 +189,7 @@ export function updateAdventurer({
ring: checkExistsInt(BigInt(adventurer.ring.id)),
beastHealth: encodeIntAsBytes(BigInt(adventurer.beastHealth)),
statUpgrades: encodeIntAsBytes(BigInt(adventurer.statsPointsAvailable)),
+ actionsPerBlock: encodeIntAsBytes(BigInt(adventurer.actionsPerBlock)),
lastUpdatedTime: timestamp,
timestamp,
},
@@ -546,7 +545,6 @@ export function insertHighScore({
export function updateTotalPayout({
adventurerId,
owner,
- rank,
timestamp,
newPayout,
}: any) {
diff --git a/ui/.env b/ui/.env
index e340c0723..e150e36c0 100644
--- a/ui/.env
+++ b/ui/.env
@@ -3,9 +3,9 @@ NEXT_PUBLIC_GOERLI_ARCADE_ACCOUNT_CLASS_HASH=0x0715b5e10bf63c36e69c402a81e1eb96b
NEXT_PUBLIC_MAINNET_ARCADE_ACCOUNT_CLASS_HASH=0x0
NEXT_PUBLIC_GOERLI_ETH_CONTRACT_ADDRESS=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
NEXT_PUBLIC_MAINNET_ETH_CONTRACT_ADDRESS=0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
-NEXT_PUBLIC_GOERLI_GAME_CONTRACT_ADDRESS=0x01263ecbc05e28d1e99f531894838db10b90cfcdd39d020642da1747a733a37a
+NEXT_PUBLIC_GOERLI_GAME_CONTRACT_ADDRESS=0x0229a6f42ae0bc258acf91b6e6d7f50e77608dbfb5a42e1c362f2041f9333fb5
NEXT_PUBLIC_MAINNET_GAME_CONTRACT_ADDRESS=0x0
-NEXT_PUBLIC_GOERLI_LORDS_CONTRACT_ADDRESS=0x059dac5df32cbce17b081399e97d90be5fba726f97f00638f838613d088e5a47
+NEXT_PUBLIC_GOERLI_LORDS_CONTRACT_ADDRESS=0x05e367ac160e5f90c5775089b582dfc987dd148a5a2f977c49def2a6644f724b
NEXT_PUBLIC_MAINNET_LORDS_CONTRACT_ADDRESS=0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49
NEXT_PUBLIC_RPC_GOERLI_ENDPOINT=https://starknet-goerli.infura.io/v3/6c536e8272f84d3ba63bf9f248c5e128
NEXT_PUBLIC_RPC_MAINNET_ENDPOINT=https://starknet-mainnet.infura.io/v3/6c536e8272f84d3ba63bf9f248c5e128
diff --git a/ui/src/app/components/CountDown.tsx b/ui/src/app/components/CountDown.tsx
index 1ae967131..820c7df65 100644
--- a/ui/src/app/components/CountDown.tsx
+++ b/ui/src/app/components/CountDown.tsx
@@ -12,11 +12,6 @@ export const HealthCountDown = ({ health }: any) => {
end: health,
delay: 1000,
duration: 5,
- // onReset: () => console.log("Resetted!"),
- // onUpdate: () => console.log("Updated!"),
- // onPauseResume: () => console.log("Paused or resumed!"),
- // onStart: ({ pauseResume }) => console.log(pauseResume),
- // onEnd: ({ pauseResume }) => console.log(pauseResume),
});
useEffect(() => {
@@ -58,7 +53,7 @@ export const PenaltyCountDown = ({
? formatDiscoveryTime
: formatBattleTime;
- const formatLastAction = convertTime(lastAction);
+ const formatLastAction = lastAction;
const targetTime = formatLastAction + penaltyTime * 1000;
useEffect(() => {
diff --git a/ui/src/app/components/actions/KillAdventurer.tsx b/ui/src/app/components/actions/KillAdventurer.tsx
index 8edb21960..99dce054a 100644
--- a/ui/src/app/components/actions/KillAdventurer.tsx
+++ b/ui/src/app/components/actions/KillAdventurer.tsx
@@ -30,7 +30,7 @@ export default function KillAdventurer() {
const slayIdleAdventurerTx = {
contractAddress: gameContract?.address ?? "",
entrypoint: "slay_idle_adventurer",
- calldata: [adventurerTarget, "0"],
+ calldata: [adventurerTarget],
metadata: `Slaying ${adventurerTarget}`,
};
diff --git a/ui/src/app/components/adventurer/Info.tsx b/ui/src/app/components/adventurer/Info.tsx
index c91a79e50..b25f4b33f 100644
--- a/ui/src/app/components/adventurer/Info.tsx
+++ b/ui/src/app/components/adventurer/Info.tsx
@@ -64,10 +64,9 @@ export default function Info({
if (gameContract) {
const dropItemsTx = {
contractAddress: gameContract?.address,
- entrypoint: "drop_items",
+ entrypoint: "drop",
calldata: [
adventurer?.id?.toString() ?? "",
- "0",
newDropItems.length.toString(),
...newDropItems,
],
@@ -150,15 +149,6 @@ export default function Info({
)}
-
- {formatAdventurer.classType}{" "}
-
- {
- getRealmNameById(formatAdventurer.homeRealm ?? 0)
- ?.properties.name
- }
-
-
diff --git a/ui/src/app/components/adventurer/InventoryDisplay.tsx b/ui/src/app/components/adventurer/InventoryDisplay.tsx
index c7acae021..01ed410b6 100644
--- a/ui/src/app/components/adventurer/InventoryDisplay.tsx
+++ b/ui/src/app/components/adventurer/InventoryDisplay.tsx
@@ -89,7 +89,6 @@ export const InventoryCard = ({
entrypoint: "equip",
calldata: [
adventurer?.id?.toString() ?? "",
- "0",
newEquipItems.length.toString(),
...newEquipItems,
],
diff --git a/ui/src/app/components/inventory/InventoryRow.tsx b/ui/src/app/components/inventory/InventoryRow.tsx
index f26d48bd2..66a2fa98b 100644
--- a/ui/src/app/components/inventory/InventoryRow.tsx
+++ b/ui/src/app/components/inventory/InventoryRow.tsx
@@ -50,7 +50,6 @@ export const InventoryRow = ({
entrypoint: "equip",
calldata: [
adventurer?.id?.toString() ?? "",
- "0",
equipItems.length,
...equipItems,
// getKeyFromValue(gameData.ITEMS, item) ?? "",
diff --git a/ui/src/app/components/leaderboard/LiveRow.tsx b/ui/src/app/components/leaderboard/LiveRow.tsx
index 656906de4..d5c3b7b15 100644
--- a/ui/src/app/components/leaderboard/LiveRow.tsx
+++ b/ui/src/app/components/leaderboard/LiveRow.tsx
@@ -64,7 +64,6 @@ const LiveLeaderboardRow = ({
formattedSlayedAdventurers.length.toString(),
...slayAdventurers,
adventurer?.id?.toString() ?? "0",
- "0",
],
metadata: `Slaying ${adventurer.name}`,
};
diff --git a/ui/src/app/components/navigation/TransactionCart.tsx b/ui/src/app/components/navigation/TransactionCart.tsx
index 4fe130f97..3d58a67a4 100644
--- a/ui/src/app/components/navigation/TransactionCart.tsx
+++ b/ui/src/app/components/navigation/TransactionCart.tsx
@@ -134,10 +134,10 @@ const TransactionCart = ({ buttonRef, multicall }: TransactionCartProps) => {
case "equip":
handleEquipItem();
break;
- case "drop_items":
+ case "drop":
handleDropItems();
break;
- case "upgrade_adventurer":
+ case "upgrade":
handleUpgradeAdventurer();
break;
case "slay_idle_adventurers":
@@ -235,7 +235,7 @@ const TransactionCart = ({ buttonRef, multicall }: TransactionCartProps) => {
))}
- ) : call.entrypoint === "drop_items" ? (
+ ) : call.entrypoint === "drop" ? (
{dropItems.map((item: string, index: number) => (
@@ -263,7 +263,7 @@ const TransactionCart = ({ buttonRef, multicall }: TransactionCartProps) => {
))}
- ) : call.entrypoint === "upgrade_adventurer" ? (
+ ) : call.entrypoint === "upgrade" ? (
{filteredStats.map(
([string, number], index: number) => (
@@ -370,10 +370,10 @@ const TransactionCart = ({ buttonRef, multicall }: TransactionCartProps) => {
if (call.entrypoint === "equip") {
setEquipItems([]);
}
- if (call.entrypoint === "drop_items") {
+ if (call.entrypoint === "drop") {
setDropItems([]);
}
- if (call.entrypoint === "upgrade_adventurer") {
+ if (call.entrypoint === "upgrade") {
setUpgrades({ ...ZeroUpgrade });
setPurchaseItems([]);
}
diff --git a/ui/src/app/components/upgrade/StatAttribute.tsx b/ui/src/app/components/upgrade/StatAttribute.tsx
index 81491fea7..69d31eded 100644
--- a/ui/src/app/components/upgrade/StatAttribute.tsx
+++ b/ui/src/app/components/upgrade/StatAttribute.tsx
@@ -57,7 +57,7 @@ export const StatAttribute = ({
if (
Object.values(upgrades).filter((value) => value !== 0).length === 0
) {
- removeEntrypointFromCalls("upgrade_adventurer");
+ removeEntrypointFromCalls("upgrade");
}
}
setButtonClicked(false);
diff --git a/ui/src/app/containers/InventoryScreen.tsx b/ui/src/app/containers/InventoryScreen.tsx
index f02c1b017..6274e6d07 100644
--- a/ui/src/app/containers/InventoryScreen.tsx
+++ b/ui/src/app/containers/InventoryScreen.tsx
@@ -67,7 +67,6 @@ export default function InventoryScreen() {
entrypoint: "equip",
calldata: [
adventurer?.id?.toString() ?? "",
- "0",
newEquipItems.length.toString(),
...newEquipItems,
],
@@ -87,10 +86,9 @@ export default function InventoryScreen() {
if (gameContract) {
const dropItemsTx = {
contractAddress: gameContract?.address,
- entrypoint: "drop_items",
+ entrypoint: "drop",
calldata: [
adventurer?.id?.toString() ?? "",
- "0",
newDropItems.length.toString(),
...newDropItems,
],
diff --git a/ui/src/app/containers/UpgradeScreen.tsx b/ui/src/app/containers/UpgradeScreen.tsx
index 397fef900..103df4091 100644
--- a/ui/src/app/containers/UpgradeScreen.tsx
+++ b/ui/src/app/containers/UpgradeScreen.tsx
@@ -227,13 +227,12 @@ export default function UpgradeScreen({ upgrade }: UpgradeScreenProps) {
potions?: number,
items?: any[]
) => {
- removeEntrypointFromCalls("upgrade_adventurer");
+ removeEntrypointFromCalls("upgrade");
const upgradeTx = {
contractAddress: gameContract?.address ?? "",
- entrypoint: "upgrade_adventurer",
+ entrypoint: "upgrade",
calldata: [
adventurer?.id?.toString() ?? "",
- "0",
potions ? potions.toString() : potionAmount.toString(),
currentUpgrades
? currentUpgrades["Strength"].toString()
diff --git a/ui/src/app/hooks/graphql/queries.ts b/ui/src/app/hooks/graphql/queries.ts
index 98e276440..0b184e1d4 100644
--- a/ui/src/app/hooks/graphql/queries.ts
+++ b/ui/src/app/hooks/graphql/queries.ts
@@ -4,8 +4,6 @@ const ADVENTURER_FIELDS = `
id
lastAction
owner
- classType
- homeRealm
name
health
strength
@@ -26,6 +24,7 @@ const ADVENTURER_FIELDS = `
ring
beastHealth
statUpgrades
+ actionsPerBlock
gold
createdTime
lastUpdatedTime
diff --git a/ui/src/app/hooks/graphql/types.ts b/ui/src/app/hooks/graphql/types.ts
index f35bfec97..382ee38bc 100644
--- a/ui/src/app/hooks/graphql/types.ts
+++ b/ui/src/app/hooks/graphql/types.ts
@@ -20,7 +20,6 @@ export type AdventurerQuery = {
lastAction: Maybe;
owner: Maybe;
race: Maybe;
- homeRealm: Maybe;
name: Maybe;
order: Maybe;
health: Maybe;
@@ -43,6 +42,7 @@ export type AdventurerQuery = {
beast: Maybe;
beastHealth: Maybe;
statUpgrades: Maybe;
+ actionsPerBlock: Maybe;
gold: Maybe;
createdTime: Maybe;
lastUpdatedTime: Maybe;
diff --git a/ui/src/app/lib/constants.ts b/ui/src/app/lib/constants.ts
index 54e4e15ce..9828706ee 100644
--- a/ui/src/app/lib/constants.ts
+++ b/ui/src/app/lib/constants.ts
@@ -39,9 +39,9 @@ export function getContracts() {
case "goerli":
return {
eth: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
- game: "0x01263ecbc05e28d1e99f531894838db10b90cfcdd39d020642da1747a733a37a",
+ game: "0x03f2ac2c55abbf633123ddb72adc3472feefc4e962c4cedc16dda11a2ac8d1d4",
lords:
- "0x059dac5df32cbce17b081399e97d90be5fba726f97f00638f838613d088e5a47",
+ "0x05e367ac160e5f90c5775089b582dfc987dd148a5a2f977c49def2a6644f724b",
};
case "mainnet":
return {
@@ -71,63 +71,6 @@ export function getAppUrl() {
}
}
-// export function getRPCUrl() {
-// switch (process.env.NEXT_PUBLIC_NETWORK) {
-// case "goerli":
-// return process.env.NEXT_PUBLIC_RPC_GOERLI_ENDPOINT;
-// case "mainnet":
-// return process.env.NEXT_PUBLIC_RPC_MAINNET_ENDPOINT;
-// default:
-// return "http://localhost:8000/graphql";
-// }
-// }
-
-// export function getGraphQLUrl() {
-// switch (process.env.NEXT_PUBLIC_NETWORK) {
-// case "goerli":
-// return "https://survivor-indexer.realms.world/goerli-graphql";
-// case "mainnet":
-// return "https://survivor-indexer.realms.world/graphql";
-// default:
-// return "http://localhost:8000/graphql";
-// }
-// }
-
-// export function getContracts() {
-// switch (process.env.NEXT_PUBLIC_NETWORK) {
-// case "goerli":
-// return {
-// eth: process.env.NEXT_PUBLIC_GOERLI_ETH_CONTRACT_ADDRESS,
-// game: process.env.NEXT_PUBLIC_GOERLI_GAME_CONTRACT_ADDRESS,
-// lords: process.env.NEXT_PUBLIC_GOERLI_LORDS_CONTRACT_ADDRESS,
-// };
-// case "mainnet":
-// return {
-// eth: process.env.NEXT_PUBLIC_MAINNET_ETH_CONTRACT_ADDRESS,
-// game: process.env.NEXT_PUBLIC_MAINNET_GAME_CONTRACT_ADDRESS,
-// lords: process.env.NEXT_PUBLIC_MAINNET_LORDS_CONTRACT_ADDRESS,
-// };
-// }
-// }
-
-// export function getArcadeClassHash() {
-// switch (process.env.NEXT_PUBLIC_NETWORK) {
-// case "goerli":
-// return process.env.NEXT_PUBLIC_GOERLI_ARCADE_ACCOUNT_CLASS_HASH;
-// case "mainnet":
-// return process.env.NEXT_PUBLIC_MAINNET_ARCADE_ACCOUNT_CLASS_HASH;
-// }
-// }
-
-// export function getAppUrl() {
-// switch (process.env.NEXT_PUBLIC_NETWORK) {
-// case "goerli":
-// return process.env.NEXT_PUBLIC_GOERLI_APP_URL;
-// case "mainnet":
-// return process.env.NEXT_PUBLIC_MAINNET_APP_URL;
-// }
-// }
-
export const notificationAnimations = [
{ name: "idle", startFrame: 0, frameCount: 4 },
{ name: "run", startFrame: 9, frameCount: 5 },
@@ -144,7 +87,7 @@ export const notificationAnimations = [
// ---- CONTRACT PARAMS
// Penalty time is 12 blocks, where each block is ~ 15 seconds
-export const penaltyTime = 12 * 15;
+export const penaltyTime = 420;
export const itemCharismaDiscount = 1;
export const itemBasePrice = 4;
export const itemMinimumPrice = 1;
diff --git a/ui/src/app/lib/utils/parseEvents.ts b/ui/src/app/lib/utils/parseEvents.ts
index acb659070..2eac86a0d 100644
--- a/ui/src/app/lib/utils/parseEvents.ts
+++ b/ui/src/app/lib/utils/parseEvents.ts
@@ -33,66 +33,64 @@ import { processData } from "./processData";
function parseAdventurerState(data: string[]) {
return {
owner: data[0],
- adventurerId: {
- low: parseInt(data[1]),
- high: parseInt(data[2]),
- },
+ adventurerId: parseInt(data[1]),
adventurer: {
- lastAction: parseInt(data[3]),
- health: parseInt(data[4]),
- xp: parseInt(data[5]),
+ lastAction: parseInt(data[2]),
+ health: parseInt(data[3]),
+ xp: parseInt(data[4]),
stats: {
- strength: parseInt(data[6]),
- dexterity: parseInt(data[7]),
- vitality: parseInt(data[8]),
- intelligence: parseInt(data[9]),
- wisdom: parseInt(data[10]),
- charisma: parseInt(data[11]),
- luck: parseInt(data[12]),
+ strength: parseInt(data[5]),
+ dexterity: parseInt(data[6]),
+ vitality: parseInt(data[7]),
+ intelligence: parseInt(data[8]),
+ wisdom: parseInt(data[9]),
+ charisma: parseInt(data[10]),
+ luck: parseInt(data[11]),
},
- gold: parseInt(data[13]),
+ gold: parseInt(data[12]),
weapon: {
- id: parseInt(data[14]),
- xp: parseInt(data[15]),
- metadata: parseInt(data[16]),
+ id: parseInt(data[13]),
+ xp: parseInt(data[14]),
+ metadata: parseInt(data[15]),
},
chest: {
- id: parseInt(data[17]),
- xp: parseInt(data[18]),
- metadata: parseInt(data[19]),
+ id: parseInt(data[16]),
+ xp: parseInt(data[17]),
+ metadata: parseInt(data[18]),
},
head: {
- id: parseInt(data[20]),
- xp: parseInt(data[21]),
- metadata: parseInt(data[22]),
+ id: parseInt(data[19]),
+ xp: parseInt(data[20]),
+ metadata: parseInt(data[21]),
},
waist: {
- id: parseInt(data[23]),
- xp: parseInt(data[24]),
- metadata: parseInt(data[25]),
+ id: parseInt(data[22]),
+ xp: parseInt(data[23]),
+ metadata: parseInt(data[24]),
},
foot: {
- id: parseInt(data[26]),
- xp: parseInt(data[27]),
- metadata: parseInt(data[28]),
+ id: parseInt(data[25]),
+ xp: parseInt(data[26]),
+ metadata: parseInt(data[27]),
},
hand: {
- id: parseInt(data[29]),
- xp: parseInt(data[30]),
- metadata: parseInt(data[31]),
+ id: parseInt(data[28]),
+ xp: parseInt(data[29]),
+ metadata: parseInt(data[30]),
},
neck: {
- id: parseInt(data[32]),
- xp: parseInt(data[33]),
- metadata: parseInt(data[34]),
+ id: parseInt(data[31]),
+ xp: parseInt(data[32]),
+ metadata: parseInt(data[33]),
},
ring: {
- id: parseInt(data[35]),
- xp: parseInt(data[36]),
- metadata: parseInt(data[37]),
+ id: parseInt(data[34]),
+ xp: parseInt(data[35]),
+ metadata: parseInt(data[36]),
},
- beastHealth: parseInt(data[38]),
- statPointsAvailable: parseInt(data[39]),
+ beastHealth: parseInt(data[37]),
+ statPointsAvailable: parseInt(data[38]),
+ actionsPerBlock: parseInt(data[39]),
mutated: convertToBoolean(parseInt(data[40])),
},
};
@@ -233,9 +231,7 @@ export async function parseEvents(
adventurerState: parseAdventurerState(raw.data.slice(0, 40)),
adventurerMeta: {
name: parseInt(raw.data[41]),
- homeRealm: parseInt(raw.data[42]),
- class: parseInt(raw.data[43]),
- entropy: parseInt(raw.data[44]),
+ entropy: parseInt(raw.data[42]),
},
};
const startGameEvent = processData(
@@ -579,7 +575,7 @@ export async function parseEvents(
case "DroppedItems":
const itemIds = [];
// Skip array length
- const itemsData = raw.data.slice(76);
+ const itemsData = raw.data.slice(77);
for (let i = 0; i < itemsData.length; i++) {
itemIds.push(parseInt(itemsData[i]));
}
diff --git a/ui/src/app/lib/utils/processData.ts b/ui/src/app/lib/utils/processData.ts
index 7b5372bd8..044d7bc28 100644
--- a/ui/src/app/lib/utils/processData.ts
+++ b/ui/src/app/lib/utils/processData.ts
@@ -60,7 +60,7 @@ type EventData =
function processAdventurerState(data: any, currentAdventurer?: any) {
const gameData = new GameData();
const updateAdventurerDoc: Adventurer = {
- id: data.adventurerState["adventurerId"].low,
+ id: data.adventurerState["adventurerId"],
owner: data.adventurerState["owner"],
lastAction: data.adventurerState["adventurer"]["lastAction"],
health: data.adventurerState["adventurer"]["health"],
@@ -83,9 +83,8 @@ function processAdventurerState(data: any, currentAdventurer?: any) {
ring: gameData.ITEMS[data.adventurerState["adventurer"]["ring"]["id"]],
beastHealth: data.adventurerState["adventurer"]["beastHealth"],
statUpgrades: data.adventurerState["adventurer"]["statPointsAvailable"],
+ actionsPerBlock: data.adventurerState["adventurer"]["actionsPerBlock"],
name: currentAdventurer["name"],
- homeRealm: currentAdventurer["homeRealm"],
- classType: currentAdventurer["classType"],
entropy: currentAdventurer["entropy"],
createdTime: currentAdventurer.createdTime,
lastUpdatedTime: new Date(), // Use this date for now though it is block_timestamp in indexer
@@ -100,7 +99,7 @@ export function processPurchases(data: any, adventurerState: any) {
for (let item of data) {
purchasedItems.push({
item: gameData.ITEMS[item.item.id],
- adventurerId: adventurerState["adventurerId"].low,
+ adventurerId: adventurerState["adventurerId"],
owner: true,
equipped: false,
ownerAddress: adventurerState["owner"],
@@ -158,7 +157,7 @@ export function processData(
case "StartGame":
const startGameEvent = event as StartGameEvent;
const updateAdventurerDoc: Adventurer = {
- id: startGameEvent.adventurerState["adventurerId"].low,
+ id: startGameEvent.adventurerState["adventurerId"],
owner: startGameEvent.adventurerState["owner"],
lastAction: startGameEvent.adventurerState["adventurer"]["lastAction"],
health: startGameEvent.adventurerState["adventurer"]["health"],
@@ -207,9 +206,9 @@ export function processData(
startGameEvent.adventurerState["adventurer"]["beastHealth"],
statUpgrades:
startGameEvent.adventurerState["adventurer"]["statPointsAvailable"],
+ actionsPerBlock:
+ startGameEvent.adventurerState["adventurer"]["actionsPerBlock"],
name: feltToString(startGameEvent.adventurerMeta["name"]),
- homeRealm: startGameEvent.adventurerMeta["homeRealm"],
- classType: gameData.CLASSES[startGameEvent.adventurerMeta["class"]],
entropy: startGameEvent.adventurerMeta["entropy"],
createdTime: new Date(),
lastUpdatedTime: new Date(), // Use this date for now though it is block_timestamp in indexer
@@ -230,7 +229,7 @@ export function processData(
);
const discoverHealthData = {
txHash: txHash,
- adventurerId: discoveredHealthEvent.adventurerState["adventurerId"].low,
+ adventurerId: discoveredHealthEvent.adventurerState["adventurerId"],
adventurerHealth:
discoveredHealthEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[3],
@@ -263,7 +262,7 @@ export function processData(
);
const discoverGoldData = {
txHash: txHash,
- adventurerId: discoveredGoldEvent.adventurerState["adventurerId"].low,
+ adventurerId: discoveredGoldEvent.adventurerState["adventurerId"],
adventurerHealth:
discoveredGoldEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[3],
@@ -297,7 +296,7 @@ export function processData(
);
const discoverXPData = {
txHash: txHash,
- adventurerId: discoveredXPEvent.adventurerState["adventurerId"].low,
+ adventurerId: discoveredXPEvent.adventurerState["adventurerId"],
adventurerHealth:
discoveredXPEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[3],
@@ -331,7 +330,7 @@ export function processData(
);
const dodgedObstacleData = {
txHash: txHash,
- adventurerId: dodgedObstacleEvent.adventurerState["adventurerId"].low,
+ adventurerId: dodgedObstacleEvent.adventurerState["adventurerId"],
adventurerHealth:
dodgedObstacleEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[2],
@@ -369,7 +368,7 @@ export function processData(
);
const hitByObstacleData = {
txHash: txHash,
- adventurerId: hitByObstacleEvent.adventurerState["adventurerId"].low,
+ adventurerId: hitByObstacleEvent.adventurerState["adventurerId"],
adventurerHealth:
hitByObstacleEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[2],
@@ -407,7 +406,7 @@ export function processData(
);
const discoveredBeastData = {
txHash: txHash,
- adventurerId: discoveredBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: discoveredBeastEvent.adventurerState["adventurerId"],
adventurerHealth:
discoveredBeastEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[1],
@@ -459,7 +458,7 @@ export function processData(
discoveredBeastEvent.beastSpecs["specials"]["special3"]
],
seed: discoveredBeastEvent.seed,
- adventurerId: discoveredBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: discoveredBeastEvent.adventurerState["adventurerId"],
slainOnTime: null,
createdTime: new Date(),
lastUpdatedTime: new Date(),
@@ -478,7 +477,7 @@ export function processData(
);
const ambushedByBeastData = {
txHash: txHash,
- adventurerId: ambushedByBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: ambushedByBeastEvent.adventurerState["adventurerId"],
adventurerHealth:
ambushedByBeastEvent.adventurerState["adventurer"]["health"],
discoveryType: gameData.DISCOVERY_TYPES[1],
@@ -530,7 +529,7 @@ export function processData(
ambushedByBeastEvent.beastSpecs["specials"]["special3"]
],
seed: ambushedByBeastEvent.seed,
- adventurerId: ambushedByBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: ambushedByBeastEvent.adventurerState["adventurerId"],
slainOnTime: null,
createdTime: new Date(),
lastUpdatedTime: new Date(),
@@ -555,7 +554,7 @@ export function processData(
ambushedByBeastEvent.beastSpecs["specials"]["special3"]
],
seed: ambushedByBeastEvent.seed,
- adventurerId: ambushedByBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: ambushedByBeastEvent.adventurerState["adventurerId"],
adventurerHealth:
ambushedByBeastEvent.adventurerState["adventurer"]["health"],
attacker: "Beast",
@@ -602,7 +601,7 @@ export function processData(
attackedBeastEvent.beastSpecs["specials"]["special3"]
],
seed: attackedBeastEvent.seed,
- adventurerId: attackedBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: attackedBeastEvent.adventurerState["adventurerId"],
adventurerHealth:
attackedBeastEvent.adventurerState["adventurer"]["health"],
attacker: "Adventurer",
@@ -644,7 +643,7 @@ export function processData(
attackedByBeastEvent.beastSpecs["specials"]["special3"]
],
seed: attackedByBeastEvent.seed,
- adventurerId: attackedByBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: attackedByBeastEvent.adventurerState["adventurerId"],
adventurerHealth:
attackedByBeastEvent.adventurerState["adventurer"]["health"],
attacker: "Beast",
@@ -686,7 +685,7 @@ export function processData(
slayedBeastEvent.beastSpecs["specials"]["special3"]
],
seed: slayedBeastEvent.seed,
- adventurerId: slayedBeastEvent.adventurerState["adventurerId"].low,
+ adventurerId: slayedBeastEvent.adventurerState["adventurerId"],
adventurerHealth:
slayedBeastEvent.adventurerState["adventurer"]["health"],
attacker: "Adventurer",
@@ -729,7 +728,7 @@ export function processData(
fleeFailedEvent.beastSpecs["specials"]["special3"]
],
seed: fleeFailedEvent.seed,
- adventurerId: fleeFailedEvent.adventurerState["adventurerId"].low,
+ adventurerId: fleeFailedEvent.adventurerState["adventurerId"],
adventurerHealth:
fleeFailedEvent.adventurerState["adventurer"]["health"],
attacker: "Adventurer",
@@ -771,7 +770,7 @@ export function processData(
fleeSucceededEvent.beastSpecs["specials"]["special3"]
],
seed: fleeSucceededEvent.seed,
- adventurerId: fleeSucceededEvent.adventurerState["adventurerId"].low,
+ adventurerId: fleeSucceededEvent.adventurerState["adventurerId"],
adventurerHealth:
fleeSucceededEvent.adventurerState["adventurer"]["health"],
attacker: "Adventurer",
@@ -896,7 +895,7 @@ export function processData(
special2: null,
special3: null,
seed: 0,
- adventurerId: idleDeathPenaltyEvent.adventurerState["adventurerId"].low,
+ adventurerId: idleDeathPenaltyEvent.adventurerState["adventurerId"],
adventurerHealth:
idleDeathPenaltyEvent.adventurerState["adventurer"]["health"],
attacker: null,
@@ -914,7 +913,7 @@ export function processData(
};
const penaltyDiscoveryData = {
txHash: txHash,
- adventurerId: idleDeathPenaltyEvent.adventurerState["adventurerId"].low,
+ adventurerId: idleDeathPenaltyEvent.adventurerState["adventurerId"],
adventurerHealth:
idleDeathPenaltyEvent.adventurerState["adventurer"]["health"],
discoveryType: null,
diff --git a/ui/src/app/lib/utils/syscalls.ts b/ui/src/app/lib/utils/syscalls.ts
index c273a9c55..c353578b1 100644
--- a/ui/src/app/lib/utils/syscalls.ts
+++ b/ui/src/app/lib/utils/syscalls.ts
@@ -248,14 +248,11 @@ export function syscalls({
const mintAdventurerTx = {
contractAddress: gameContract?.address ?? "",
- entrypoint: "start",
+ entrypoint: "new_game",
calldata: [
"0x0628d41075659afebfc27aa2aab36237b08ee0b112debd01e56d037f64f6082a",
getKeyFromValue(gameData.ITEMS, formData.startingWeapon) ?? "",
stringToFelt(formData.name).toString(),
- getRandomNumber(8000),
- "1",
- "1",
],
};
@@ -367,7 +364,7 @@ export function syscalls({
const exploreTx = {
contractAddress: gameContract?.address ?? "",
entrypoint: "explore",
- calldata: [adventurer?.id?.toString() ?? "", "0", till_beast ? "1" : "0"],
+ calldata: [adventurer?.id?.toString() ?? "", till_beast ? "1" : "0"],
};
addToCalls(exploreTx);
@@ -616,7 +613,7 @@ export function syscalls({
const attackTx = {
contractAddress: gameContract?.address ?? "",
entrypoint: "attack",
- calldata: [adventurer?.id?.toString() ?? "", "0", tillDeath ? "1" : "0"],
+ calldata: [adventurer?.id?.toString() ?? "", tillDeath ? "1" : "0"],
};
addToCalls(attackTx);
@@ -848,7 +845,7 @@ export function syscalls({
const fleeTx = {
contractAddress: gameContract?.address ?? "",
entrypoint: "flee",
- calldata: [adventurer?.id?.toString() ?? "", "0", tillDeath ? "1" : "0"],
+ calldata: [adventurer?.id?.toString() ?? "", tillDeath ? "1" : "0"],
};
addToCalls(fleeTx);
diff --git a/ui/src/app/types/events.ts b/ui/src/app/types/events.ts
index 580975629..83b329deb 100644
--- a/ui/src/app/types/events.ts
+++ b/ui/src/app/types/events.ts
@@ -1,15 +1,9 @@
type u128 = number;
-type u256 = {
- low: u128;
- high: u128;
-};
type u16 = number;
type u8 = number;
type AdventurerMetadata = {
name: u128;
- homeRealm: u16;
- class: u8;
entropy: u128;
};
@@ -45,6 +39,7 @@ type Adventurer = {
ring: LootStatistics;
beastHealth: u16;
statPointsAvailable: u8;
+ actionsPerBlock: u8;
mutated: boolean;
};
@@ -109,7 +104,7 @@ type ContractAddress = any; // This needs to be defined or imported from its sou
export type AdventurerState = {
owner: ContractAddress;
- adventurerId: u256;
+ adventurerId: u128;
adventurer: Adventurer;
};