Skip to content

Commit

Permalink
Use controller presets
Browse files Browse the repository at this point in the history
  • Loading branch information
edisontim committed Dec 10, 2024
1 parent cdd1c79 commit 2efb1d9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 38 deletions.
6 changes: 3 additions & 3 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
},
"dependencies": {
"@bibliothecadao/eternum": "workspace:^",
"@cartridge/connector": "0.5.4",
"@cartridge/controller": "0.5.4",
"@cartridge/connector": "0.5.5",
"@cartridge/controller": "0.5.5",
"@dojoengine/core": "1.0.1",
"@dojoengine/create-burner": "1.0.1",
"@dojoengine/react": "1.0.1",
Expand Down Expand Up @@ -104,4 +104,4 @@
"vitest": "^2.0.5",
"workbox-window": "^7.3.0"
}
}
}
13 changes: 2 additions & 11 deletions client/src/hooks/context/starknet-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,17 @@ import { ColorMode } from "@cartridge/controller";
import { mainnet, sepolia } from "@starknet-react/chains";
import { Connector, StarknetConfig, jsonRpcProvider, voyager } from "@starknet-react/core";
import { env } from "../../../env";
import { policies } from "./policies";
import { signingPolicy } from "./signing-policy";

const theme: string = "eternum";
const preset: string = "eternum";
const slot: string = env.VITE_PUBLIC_SLOT;
const namespace: string = "s0_eternum";
const colorMode: ColorMode = "dark";

const vrfPolicy = {
target: "0x051fea4450da9d6aee758bdeba88b2f665bcbf549d2c61421aa724e9ac0ced8f",
method: "request_random",
description: "Allows requesting random numbers from the VRF provider",
};

const controller = new ControllerConnector({
rpc: env.VITE_PUBLIC_NODE_URL,
namespace,
slot,
policies: [...policies, ...signingPolicy, vrfPolicy],
theme,
preset,
tokens: {
erc20: ["0x0342ad5cc14002c005a5cedcfce2bd3af98d5e7fb79e9bf949b3a91cf145d72e"],
},
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.1"
}
},
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
}
38 changes: 15 additions & 23 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2efb1d9

Please sign in to comment.