diff --git a/client/package.json b/client/package.json index 1ab9c7206..d69af3fb3 100644 --- a/client/package.json +++ b/client/package.json @@ -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", @@ -104,4 +104,4 @@ "vitest": "^2.0.5", "workbox-window": "^7.3.0" } -} +} \ No newline at end of file diff --git a/client/src/hooks/context/starknet-provider.tsx b/client/src/hooks/context/starknet-provider.tsx index ac45e9994..7bcb01a0d 100644 --- a/client/src/hooks/context/starknet-provider.tsx +++ b/client/src/hooks/context/starknet-provider.tsx @@ -5,10 +5,10 @@ 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 { mainnetPolicies } from "./mainnet-policies"; import { policies } from "./policies"; import { signingPolicy } from "./signing-policy"; +const preset: string = "eternum"; const theme: string = "eternum"; const slot: string = env.VITE_PUBLIC_SLOT; const namespace: string = "s0_eternum"; @@ -20,19 +20,30 @@ const vrfPolicy = { description: "Allows requesting random numbers from the VRF provider", }; -const signingPolicies = env.VITE_PUBLIC_CHAIN === "mainnet" ? mainnetPolicies : policies; - -const controller = new ControllerConnector({ - rpc: env.VITE_PUBLIC_NODE_URL, - namespace, - slot, - policies: [...signingPolicies, ...signingPolicy, vrfPolicy], - theme, - tokens: { - erc20: ["0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49"], - }, - colorMode, -}); +const controller = + env.VITE_PUBLIC_CHAIN === "mainnet" + ? new ControllerConnector({ + rpc: env.VITE_PUBLIC_NODE_URL, + namespace, + slot, + preset, + tokens: { + erc20: ["0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49"], + }, + colorMode, + }) + : new ControllerConnector({ + rpc: env.VITE_PUBLIC_NODE_URL, + namespace, + slot, + preset, + policies: [...signingPolicy, ...policies, vrfPolicy], + theme, + tokens: { + erc20: ["0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a533b49"], + }, + colorMode, + }); export function StarknetProvider({ children }: { children: React.ReactNode }) { const rpc = useCallback(() => { diff --git a/package.json b/package.json index 5bf893d42..6e8342c8a 100644 --- a/package.json +++ b/package.json @@ -31,5 +31,6 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "tailwindcss": "^3.4.1" - } + }, + "packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 767c2eda9..033831bc9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -131,11 +131,11 @@ importers: specifier: workspace:^ version: link:../sdk/packages/eternum '@cartridge/connector': - specifier: 0.5.4 - version: 0.5.4(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.6.3) + specifier: 0.5.5 + version: 0.5.5(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.6.3) '@cartridge/controller': - specifier: 0.5.4 - version: 0.5.4(encoding@0.1.13) + specifier: 0.5.5 + version: 0.5.5(encoding@0.1.13) '@dojoengine/core': specifier: 1.0.1 version: 1.0.1(starknet@6.11.0(encoding@0.1.13))(typescript@5.6.3) @@ -422,7 +422,7 @@ importers: version: 0.5.4(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.7.2) '@cartridge/controller': specifier: ^0.5.3 - version: 0.5.4(encoding@0.1.13) + version: 0.5.5(encoding@0.1.13) '@dojoengine/core': specifier: 1.0.1 version: 1.0.1(starknet@6.11.0(encoding@0.1.13))(typescript@5.7.2) @@ -1456,12 +1456,21 @@ packages: '@cartridge/account-wasm@0.5.4': resolution: {integrity: sha512-vi08BWNp2kflrEWLsqaIwrMajUOtIeRZlTFAGyJ3ejcaFNMlx0VzgwRCTiRtoh6MSa/WtUIlTjshmFUyHMd/CQ==} + '@cartridge/account-wasm@0.5.5': + resolution: {integrity: sha512-ZMfkYz+J8zrpxM+UJGf7IxKwmS0HcCFBSrdBD4Sa2h5cGxfoKiJ2RFeHFDKKgOAluMwO6X06S847pK+AI9UIpg==} + '@cartridge/connector@0.5.4': resolution: {integrity: sha512-UqOGzRqP2rLsw1TQ6ZswUM/Uf35IFKTOZBkshenVOS6n4QEdgQKUVKDKW71lr6O2/w0uXU6fGxiBSQ3V+Pn23A==} + '@cartridge/connector@0.5.5': + resolution: {integrity: sha512-EsnS09gdNAq7fr2CS/6IyOPxaFyzijBvqK5gQ6+tRQlVK7FwSb+dejIyaoUzxiKrK5tYWg6hrQKHad0kZyXvAQ==} + '@cartridge/controller@0.5.4': resolution: {integrity: sha512-8wwcA8GwLTWf/uNU5kf07BoLj1SYRR0EdRCBx55FQmc6MxX1TNto6H0shLIAV2iehXYE/zjqX24GN930gSqm7Q==} + '@cartridge/controller@0.5.5': + resolution: {integrity: sha512-obgYLgmBTGbx7d4WS/9NRvTDru22n0E1h8BFhlQIJbrCxoNhrVYtSeKrc1J1rrVkkVrepD2p/XzFLvJ/vp70wg==} + '@cartridge/penpal@6.2.3': resolution: {integrity: sha512-K8h9VqBfFPXcAFQNnvgBnejF/dp7249pS4jXu3NhNYR6JqMQxtcrDqfnPmJvbF4ECEBs+8Z2UiwlRQiKt5nNsg==} @@ -10873,10 +10882,12 @@ snapshots: '@cartridge/account-wasm@0.5.4': {} - '@cartridge/connector@0.5.4(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.6.3)': + '@cartridge/account-wasm@0.5.5': {} + + '@cartridge/connector@0.5.4(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.7.2)': dependencies: '@cartridge/controller': 0.5.4(encoding@0.1.13) - '@starknet-react/core': 3.5.0(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(starknet@6.11.0(encoding@0.1.13))(typescript@5.6.3) + '@starknet-react/core': 3.5.0(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(starknet@6.11.0(encoding@0.1.13))(typescript@5.7.2) starknet: 6.11.0(encoding@0.1.13) transitivePeerDependencies: - bufferutil @@ -10886,10 +10897,10 @@ snapshots: - typescript - utf-8-validate - '@cartridge/connector@0.5.4(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.7.2)': + '@cartridge/connector@0.5.5(encoding@0.1.13)(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(typescript@5.6.3)': dependencies: - '@cartridge/controller': 0.5.4(encoding@0.1.13) - '@starknet-react/core': 3.5.0(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(starknet@6.11.0(encoding@0.1.13))(typescript@5.7.2) + '@cartridge/controller': 0.5.5(encoding@0.1.13) + '@starknet-react/core': 3.5.0(get-starknet-core@3.3.4(starknet@6.11.0(encoding@0.1.13)))(react@18.3.1)(starknet@6.11.0(encoding@0.1.13))(typescript@5.6.3) starknet: 6.11.0(encoding@0.1.13) transitivePeerDependencies: - bufferutil @@ -10914,6 +10925,20 @@ snapshots: transitivePeerDependencies: - encoding + '@cartridge/controller@0.5.5(encoding@0.1.13)': + dependencies: + '@cartridge/account-wasm': 0.5.5 + '@cartridge/penpal': 6.2.3 + '@starknet-io/types-js': 0.7.7 + '@telegram-apps/sdk': 2.5.2 + base64url: 3.0.1 + cbor-x: 1.6.0 + fast-deep-equal: 3.1.3 + query-string: 7.1.3 + starknet: 6.11.0(encoding@0.1.13) + transitivePeerDependencies: + - encoding + '@cartridge/penpal@6.2.3': {} '@cartridge/presets@0.5.4':