diff --git a/web/package.json b/web/package.json index 984f9d42..a136e3ca 100644 --- a/web/package.json +++ b/web/package.json @@ -18,7 +18,7 @@ "create-events": "./bin/generateEvents.cjs" }, "dependencies": { - "@cartridge/connector": "^0.3.28", + "@cartridge/connector": "^0.3.30", "@chakra-ui/anatomy": "^2.1.1", "@chakra-ui/react": "^2.8.1", "@dojoengine/core": "0.7.4", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index fd9a09d5..d93c935d 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@cartridge/connector': - specifier: ^0.3.28 - version: 0.3.28(encoding@0.1.13)(get-starknet-core@3.2.0(starknet@6.2.0(encoding@0.1.13)))(react@18.2.0) + specifier: ^0.3.30 + version: 0.3.30(encoding@0.1.13)(get-starknet-core@3.2.0(starknet@6.2.0(encoding@0.1.13)))(react@18.2.0) '@chakra-ui/anatomy': specifier: ^2.1.1 version: 2.2.2 @@ -813,11 +813,11 @@ packages: resolution: {integrity: sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==} engines: {node: '>=6.9.0'} - '@cartridge/connector@0.3.28': - resolution: {integrity: sha512-BdjxApxXZlk6dArkPuYjTo12kSfvGvAwu8GxTgpZ4hhFqvfQslPMwAWnMpCoTeeDTvBiLcAt5SHWDaIFgcqMwA==} + '@cartridge/connector@0.3.30': + resolution: {integrity: sha512-N7IKaB+wJWtchkcsmSbfDupSuqp1F21EPc0jFmYUNt/qimVbFhLId2x/bMiTOxVhO6roBtyYbo7E0XLeWcKlkA==} - '@cartridge/controller@0.3.28': - resolution: {integrity: sha512-QO2Fyer55QThpkhje91g1mbCMQA9KgJIiEbaizUc5xCfau47F0eOBlF+9fxxqC6NobXNzPNqxf2TgVK87MqwRA==} + '@cartridge/controller@0.3.30': + resolution: {integrity: sha512-TIKaUROLny3M9I2pXLBjUI1WzgBHvAhMsgYcTBOHzDSn/f2pyGL3RuiEJT6X3fg5LHDH0hook2CYhvDEmqxzqQ==} '@cartridge/penpal@6.2.3': resolution: {integrity: sha512-K8h9VqBfFPXcAFQNnvgBnejF/dp7249pS4jXu3NhNYR6JqMQxtcrDqfnPmJvbF4ECEBs+8Z2UiwlRQiKt5nNsg==} @@ -6429,9 +6429,9 @@ snapshots: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - '@cartridge/connector@0.3.28(encoding@0.1.13)(get-starknet-core@3.2.0(starknet@6.2.0(encoding@0.1.13)))(react@18.2.0)': + '@cartridge/connector@0.3.30(encoding@0.1.13)(get-starknet-core@3.2.0(starknet@6.2.0(encoding@0.1.13)))(react@18.2.0)': dependencies: - '@cartridge/controller': 0.3.28(encoding@0.1.13) + '@cartridge/controller': 0.3.30(encoding@0.1.13) '@starknet-react/core': 2.4.0(get-starknet-core@3.2.0(starknet@6.2.0(encoding@0.1.13)))(react@18.2.0)(starknet@6.9.0(encoding@0.1.13)) starknet: 6.9.0(encoding@0.1.13) typescript: 5.4.5 @@ -6440,7 +6440,7 @@ snapshots: - get-starknet-core - react - '@cartridge/controller@0.3.28(encoding@0.1.13)': + '@cartridge/controller@0.3.30(encoding@0.1.13)': dependencies: '@cartridge/penpal': 6.2.3 base64url: 3.0.1 diff --git a/web/src/components/wallet/StarknetProvider.tsx b/web/src/components/wallet/StarknetProvider.tsx index a3ced781..657a875d 100644 --- a/web/src/components/wallet/StarknetProvider.tsx +++ b/web/src/components/wallet/StarknetProvider.tsx @@ -16,7 +16,7 @@ import { useNetwork, } from "@starknet-react/core"; import { ReactNode, useState } from "react"; -import { RpcProvider } from "starknet"; +import { RpcProvider, shortString } from "starknet"; import CartridgeConnector from "@cartridge/connector"; export const walletInstallLinks = { @@ -49,7 +49,6 @@ export function customJsonRpcProvider(selectedChain: DojoChainConfig): ChainProv } function getConnectorsForChain(selectedChain: DojoChainConfig) { - switch (selectedChain.name) { case "SEPOLIA": return [cartridgeConnector]; @@ -93,11 +92,13 @@ import manifestRyoSepolia from "../../manifests/ryosepolia/manifest.json"; const cartridgeConnector = new CartridgeConnector( [ { - target: manifestRyoSepolia.contracts.find((c) => c.name === "rollyourown::_mocks::paper_mock::paper_mock")!.address, + target: manifestRyoSepolia.contracts.find((c) => c.name === "rollyourown::_mocks::paper_mock::paper_mock")! + .address, method: "faucet", }, { - target: manifestRyoSepolia.contracts.find((c) => c.name === "rollyourown::_mocks::paper_mock::paper_mock")!.address, + target: manifestRyoSepolia.contracts.find((c) => c.name === "rollyourown::_mocks::paper_mock::paper_mock")! + .address, method: "approve", }, { @@ -121,9 +122,17 @@ const cartridgeConnector = new CartridgeConnector( .address, method: "register_score", }, + { + target: manifestRyoSepolia.contracts.find((c) => c.name === "rollyourown::systems::laundromat::laundromat")! + .address, + method: "claim", + }, ], { url: "https://x.cartridge.gg", theme: "dope-wars", + paymaster: { + caller: shortString.encodeShortString("ANY_CALLER"), + }, }, ) as unknown as InjectedConnector;