From 45dc6c44f057758bf9819c219d7b3e0876af7243 Mon Sep 17 00:00:00 2001 From: BenRey Date: Fri, 26 Jul 2024 08:53:21 +0200 Subject: [PATCH] Fix client from network --- src/lib/massa-react/hooks/useWriteSmartContract.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib/massa-react/hooks/useWriteSmartContract.tsx b/src/lib/massa-react/hooks/useWriteSmartContract.tsx index 7c754f5d..1cc7cdfe 100644 --- a/src/lib/massa-react/hooks/useWriteSmartContract.tsx +++ b/src/lib/massa-react/hooks/useWriteSmartContract.tsx @@ -11,7 +11,6 @@ import { JsonRPCClient, Mas, MAX_GAS_CALL, - NETWORKS, Operation, OperationStatus, } from '@massalabs/massa-web3'; @@ -89,11 +88,11 @@ export function useWriteSmartContract( async function clientFromNetwork() { const network = await provider.getNetwork(); switch (network) { - case NETWORKS.buildnet: + case 'buildnet': return JsonRPCClient.buildnet(); - case NETWORKS.mainnet: + case 'mainnet': return JsonRPCClient.mainnet(); - case NETWORKS.testnet: + case 'testnet': return JsonRPCClient.testnet(); default: throw new Error('Unsupported network');