Skip to content

Commit

Permalink
feat: ethers adapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Space-Bean committed Oct 21, 2024
1 parent d23c2eb commit c388eeb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions projects/ui/src/util/wagmi/ethersAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { useMemo } from 'react';
import type { Account, Chain, Client, Transport } from 'viem';
import { Config, useClient, useConnectorClient } from 'wagmi';

const netlifyContext = import.meta.env.VITE_NETLIFY_CONTEXT;
const IS_DEVELOPMENT_ENV = netlifyContext !== 'production' && netlifyContext !== "deploy-preview";
const SHOW_DEV = import.meta.env.VITE_SHOW_DEV_CHAINS;

const fallbackChain = {
chainId: IS_DEVELOPMENT_ENV ? ChainId.LOCALHOST : ChainId.ARBITRUM_MAINNET,
name: IS_DEVELOPMENT_ENV ? 'locahost:8545' : 'arbitrum',
chainId: SHOW_DEV ? ChainId.LOCALHOST : ChainId.ARBITRUM_MAINNET,
name: SHOW_DEV ? 'locahost:8545' : 'arbitrum',
} as const;

export function clientToProvider(client: Client<Transport, Chain>) {
Expand Down

0 comments on commit c388eeb

Please sign in to comment.