From 2efb1d9fe68aabdc76f792aa24335510801067e0 Mon Sep 17 00:00:00 2001 From: tedison Date: Tue, 10 Dec 2024 16:05:59 -0500 Subject: [PATCH] Use controller presets --- client/package.json | 6 +-- .../src/hooks/context/starknet-provider.tsx | 13 +------ package.json | 3 +- pnpm-lock.yaml | 38 ++++++++----------- 4 files changed, 22 insertions(+), 38 deletions(-) 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 ab56691dc..2d0305058 100644 --- a/client/src/hooks/context/starknet-provider.tsx +++ b/client/src/hooks/context/starknet-provider.tsx @@ -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"], }, 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 8dfe5a1e0..6e2debf4e 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) @@ -1438,20 +1438,20 @@ packages: '@cartridge/account-wasm@0.5.3': resolution: {integrity: sha512-UZ37MOc4FFgngvcgxo0CpjRlmID7MN1x8Io2svQn7SDbaYPpJkrBNfGUcm+nhgDAkgDS3kTTYObzRBH8dXArAQ==} - '@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.3': resolution: {integrity: sha512-CvWENcVYrTqOPNIcARiiz96Bkyv/EkXkbJebUrUhUBTBuMs2EpMg39qD31mLHNUw62XxynEo6Zs4Zen5OWzE7g==} - '@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.3': resolution: {integrity: sha512-6nx5ZT1U9S38TvhgAjNC/oQrGgrqLiGFNwp0gbWwHZb1ktNp1j560ClOZ3NDQAdnQNUZ5uCdvxZp/XvrFYljvw==} - '@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==} @@ -1459,9 +1459,6 @@ packages: '@cartridge/presets@0.5.3': resolution: {integrity: sha512-97xKkqtBkQqz6F+apM6fA8d2t+y2RdXNOEduJmIzYbn8Vc7jo34/b/xYSfUHHGg2XWtKy4ovHBd98KhXwwtUTQ==} - '@cartridge/presets@0.5.4': - resolution: {integrity: sha512-kC2tcZ+dBv6NoQOnlWrb+WroulVWYVjQy7PP5v1+Q07LjJujzjNlyXG1pPU1BpJCGDbE16/qlbUujhYbBvnVgQ==} - '@cbor-extract/cbor-extract-darwin-arm64@2.2.0': resolution: {integrity: sha512-P7swiOAdF7aSi0H+tHtHtr6zrpF3aAq/W9FXx5HektRvLTM2O89xCyXF3pk7pLc7QpaY7AoaE8UowVf9QBdh3w==} cpu: [arm64] @@ -10702,7 +10699,7 @@ snapshots: '@cartridge/account-wasm@0.5.3': {} - '@cartridge/account-wasm@0.5.4': {} + '@cartridge/account-wasm@0.5.5': {} '@cartridge/connector@0.5.3(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: @@ -10717,9 +10714,9 @@ 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.6.3)': + '@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) + '@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: @@ -10745,11 +10742,10 @@ snapshots: transitivePeerDependencies: - encoding - '@cartridge/controller@0.5.4(encoding@0.1.13)': + '@cartridge/controller@0.5.5(encoding@0.1.13)': dependencies: - '@cartridge/account-wasm': 0.5.4 + '@cartridge/account-wasm': 0.5.5 '@cartridge/penpal': 6.2.3 - '@cartridge/presets': 0.5.4 '@starknet-io/types-js': 0.7.7 '@telegram-apps/sdk': 2.5.2 base64url: 3.0.1 @@ -10766,10 +10762,6 @@ snapshots: dependencies: '@starknet-io/types-js': 0.7.7 - '@cartridge/presets@0.5.4': - dependencies: - '@starknet-io/types-js': 0.7.7 - '@cbor-extract/cbor-extract-darwin-arm64@2.2.0': optional: true