Skip to content

Commit

Permalink
Update to 0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Matth26 committed Oct 26, 2023
1 parent b32c7d3 commit 660965b
Show file tree
Hide file tree
Showing 6 changed files with 1,562 additions and 19 deletions.
Binary file modified bun.lockb
Binary file not shown.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
"codegen": "graphql-codegen"
},
"dependencies": {
"@dojoengine/core": "^0.0.17",
"@dojoengine/create-burner": "^0.0.17",
"@dojoengine/core": "0.1.30",
"@dojoengine/create-burner": "^0.1.3",
"@dojoengine/react": "^0.0.3",
"@latticexyz/recs": "^1.43.0",
"@latticexyz/utils": "^1.43.0",
"@dojoengine/utils": "^0.1.2",
"@latticexyz/react": "^2.0.0-next.9",
"@latticexyz/recs": "^2.0.0-next.9",
"@latticexyz/utils": "^2.0.0-next.9",
"@pixi/react": "^7.1.0",
"@pixi/react-animated": "^7.1.1",
"@pixi/sound": "^5.2.1",
Expand All @@ -33,7 +35,7 @@
"react-modal": "^3.16.1",
"react-share": "^4.4.1",
"rxjs": "^7.8.1",
"starknet": "^5.14.1",
"starknet": "^5.17.1",
"tailwindcss": "^3.3.3",
"zustand": "^4.4.1"
},
Expand Down
1 change: 0 additions & 1 deletion src/DojoContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const useDojo = () => {
const { create, list, get, account, select, isDeploying } = useBurner({
masterAccount: masterAccount,
accountClassHash: import.meta.env.VITE_PUBLIC_ACCOUNT_CLASS_HASH!,
nodeUrl: import.meta.env.VITE_PUBLIC_NODE_URL!,
});

return {
Expand Down
33 changes: 29 additions & 4 deletions src/dojo/createSystemCalls.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Components, EntityIndex, Schema, setComponent, updateComponent } from '@latticexyz/recs';
import { poseidonHashMany } from 'micro-starknet';
import { Account, Event, InvokeTransactionReceiptResponse, shortString } from 'starknet';
import { Account, Call, Event, InvokeTransactionReceiptResponse, shortString } from 'starknet';
import { TileType } from '../hooks/useComponentStates';
import { MobType } from '../ui/Mob';
import { ClientComponents } from './createClientComponents';
Expand All @@ -27,7 +27,17 @@ export function createSystemCalls(
set_turn: (mob: TileType) => void
) => {
try {
const tx = await execute(signer, 'Create', [ip, seed, pseudo]);
console.log(import.meta.env.VITE_PUBLIC_ACTIONS_ADDRESS);
console.log(import.meta.env.VITE_PUBLIC_WORLD_ADDRESS);
const calls: Call[] = [
{
contractAddress: import.meta.env.VITE_PUBLIC_ACTIONS_ADDRESS || '',
entrypoint: 'create',
calldata: [import.meta.env.VITE_PUBLIC_WORLD_ADDRESS, ip, seed, pseudo],
},
];

const tx = await execute(signer, calls);

// console.log(tx);
const receipt = (await signer.waitForTransaction(tx.transaction_hash, {
Expand Down Expand Up @@ -59,7 +69,15 @@ export function createSystemCalls(
set_turn: (mob: TileType) => void
) => {
try {
const tx = await execute(signer, 'Play', [ip, x, y]);
const calls: Call[] = [
{
contractAddress: import.meta.env.VITE_PUBLIC_ACTIONS_ADDRESS || '',
entrypoint: 'play',
calldata: [import.meta.env.VITE_PUBLIC_WORLD_ADDRESS, ip, x, y],
},
];

const tx = await execute(signer, calls);

// console.log(tx);
const receipt = (await signer.waitForTransaction(tx.transaction_hash, {
Expand Down Expand Up @@ -89,7 +107,14 @@ export function createSystemCalls(
set_turn: (mob: TileType) => void
) => {
try {
const tx = await execute(signer, 'Spawn', [ip]);
const calls: Call[] = [
{
contractAddress: import.meta.env.VITE_PUBLIC_ACTIONS_ADDRESS || '',
entrypoint: 'spawn',
calldata: [import.meta.env.VITE_PUBLIC_WORLD_ADDRESS, ip],
},
];
const tx = await execute(signer, calls);

// console.log(tx);
const receipt = (await signer.waitForTransaction(tx.transaction_hash, {
Expand Down
Loading

0 comments on commit 660965b

Please sign in to comment.