From 3b94cce5f0813f34db65210fb0842de47e3df3bd Mon Sep 17 00:00:00 2001 From: Quentin Burg Date: Mon, 11 Sep 2023 09:44:21 +0200 Subject: [PATCH] :construction: try to fix CI --- batcher-ui/src/contexts/wallet.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/batcher-ui/src/contexts/wallet.tsx b/batcher-ui/src/contexts/wallet.tsx index 0152c3a8..4ac362fe 100644 --- a/batcher-ui/src/contexts/wallet.tsx +++ b/batcher-ui/src/contexts/wallet.tsx @@ -1,9 +1,10 @@ import { TezosToolkit } from '@taquito/taquito'; import React, { createContext, useEffect, useReducer } from 'react'; import { BeaconWallet } from '@taquito/beacon-wallet'; -import { AccountInfo, NetworkType } from '@airgap/beacon-sdk'; +import { AccountInfo } from '@airgap/beacon-sdk'; import { useTezosToolkit } from './tezos-toolkit'; import { getByKey, setByKey } from 'src/utils/local-storage'; +import { NetworkType } from '@airgap/beacon-types'; type WalletState = { wallet: BeaconWallet | undefined; @@ -33,6 +34,7 @@ const connectWallet = async (tezos: TezosToolkit | undefined) => { if (!tezos) return Promise.reject('ERROR'); const wallet = new BeaconWallet({ name: 'batcher', + // @ts-ignore preferredNetwork: process.env.NEXT_PUBLIC_NETWORK_TARGET === 'GHOSTNET' ? NetworkType.GHOSTNET @@ -43,7 +45,11 @@ const connectWallet = async (tezos: TezosToolkit | undefined) => { await wallet.requestPermissions({ network: { - type: NetworkType.GHOSTNET, + // @ts-ignore + type: + process.env.NEXT_PUBLIC_NETWORK_TARGET === 'GHOSTNET' + ? NetworkType.GHOSTNET + : NetworkType.MAINNET, rpcUrl: process.env.NEXT_PUBLIC_TEZOS_NODE_URI, }, }); @@ -118,6 +124,7 @@ export const WalletProvider = ({ children }: { children: React.ReactNode }) => { if (userAddress) { const wallet = new BeaconWallet({ name: 'batcher', + // @ts-ignore preferredNetwork: process.env.NEXT_PUBLIC_NETWORK_TARGET === 'GHOSTNET' ? NetworkType.GHOSTNET