generated from blockmatic-icebox/powerstack
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12c1776
commit a69a60e
Showing
16 changed files
with
204 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use client' | ||
import { useConnect, useConnectors } from 'wagmi' | ||
import { Button } from './ui/button' | ||
|
||
export function ConnectWalletButton() { | ||
const connectors = useConnectors() | ||
const { connect} = useConnect() | ||
|
||
const handleConnect = async () => { | ||
// Find the WalletConnect connector | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const walletConnectConnector = connectors.find(connector => connector.id === 'walletConnect') | ||
if (walletConnectConnector) { | ||
await connect({ connector: walletConnectConnector }) | ||
} | ||
} | ||
|
||
return ( | ||
<div> | ||
<Button onClick={handleConnect} disabled={false}> | ||
Connect Wallet | ||
</Button> | ||
{/* {error && <p style={{ color: 'red' }}>{error.message}</p>} */} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
import { ReactNode } from 'react'; | ||
import { | ||
getDefaultWallets, | ||
RainbowKitProvider, | ||
} from '@rainbow-me/rainbowkit'; | ||
import { configureChains, createConfig, WagmiConfig } from 'wagmi'; | ||
import { publicProvider } from 'wagmi/providers/public'; | ||
import {eosEvmTestnet} from 'smartsale-chains' | ||
|
||
const { chains, publicClient } = configureChains( | ||
[eosEvmTestnet], [publicProvider()] | ||
); | ||
import { createConfig, WagmiProvider } from 'wagmi'; | ||
import { eosEvmTestnet } from 'smartsale-chains' | ||
import { walletConnect } from 'wagmi/connectors' | ||
import { http } from 'viem'; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
|
||
const { connectors } = getDefaultWallets({ | ||
appName: 'Bitcash USDT Faucet', | ||
projectId: 'YOUR_PROJECT_ID', | ||
chains | ||
}); | ||
const queryClient = new QueryClient() | ||
|
||
const wagmiConfig = createConfig({ | ||
autoConnect: true, | ||
connectors, | ||
publicClient | ||
chains: [eosEvmTestnet], | ||
connectors: [ | ||
walletConnect({ | ||
projectId: "25a868c834c1003aa0f0b69aba0ae056", | ||
// metadata: { | ||
// name: 'SmartSale Faucet', | ||
// description: 'SmartSale Faucet' | ||
// } | ||
}), | ||
], | ||
transports: { | ||
[eosEvmTestnet.id]: http(), | ||
}, | ||
}) | ||
|
||
export function Providers({children}:{children: ReactNode}) { | ||
|
||
return ( | ||
<WagmiConfig config={wagmiConfig}> | ||
<RainbowKitProvider chains={chains}> | ||
{children} | ||
</RainbowKitProvider> | ||
</WagmiConfig> | ||
<QueryClientProvider client={queryClient}> | ||
<WagmiProvider config={wagmiConfig}> | ||
{children} | ||
</WagmiProvider> | ||
</QueryClientProvider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use client' | ||
import { useConnect, useConnectors } from 'wagmi' | ||
import { Button } from '@/components/ui/button' | ||
|
||
export function ConnectWalletButton() { | ||
const connectors = useConnectors() | ||
const { connect } = useConnect() | ||
|
||
const handleConnect = async () => { | ||
// Find the WalletConnect connector | ||
const walletConnectConnector = connectors.find( | ||
connector => connector.id === 'walletConnect' | ||
) | ||
if (walletConnectConnector) { | ||
await connect({ connector: walletConnectConnector }) | ||
} | ||
} | ||
|
||
return ( | ||
<div> | ||
<Button onClick={handleConnect} disabled={false}> | ||
Connect Wallet | ||
</Button> | ||
{/* {error && <p style={{ color: 'red' }}>{error.message}</p>} */} | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.