mirror of
https://github.com/logos-messaging/OpChan.git
synced 2026-01-02 12:53:10 +00:00
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import { AppKitOptions } from '@reown/appkit';
|
|
import { BitcoinAdapter } from '@reown/appkit-adapter-bitcoin';
|
|
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';
|
|
import { createStorage } from 'wagmi';
|
|
import { mainnet, bitcoin, AppKitNetwork } from '@reown/appkit/networks';
|
|
import { environment } from '../utils/environment';
|
|
|
|
const networks: [AppKitNetwork, ...AppKitNetwork[]] = [mainnet, bitcoin];
|
|
|
|
const projectId =
|
|
environment.reownProjectId ||
|
|
process.env.VITE_REOWN_SECRET ||
|
|
'2ead96ea166a03e5ab50e5c190532e72';
|
|
|
|
if (!projectId) {
|
|
throw new Error(
|
|
'Reown project ID is not defined. Please set it via config.reownProjectId, VITE_REOWN_SECRET environment variable, or use the default.'
|
|
);
|
|
}
|
|
|
|
export const wagmiAdapter = new WagmiAdapter({
|
|
storage: createStorage({ storage: localStorage }),
|
|
ssr: false, // Set to false for Vite/React apps
|
|
projectId,
|
|
networks,
|
|
});
|
|
|
|
// Export the Wagmi config for the provider
|
|
export const config = wagmiAdapter.wagmiConfig;
|
|
|
|
export const bitcoinAdapter = new BitcoinAdapter({
|
|
projectId,
|
|
});
|
|
|
|
const metadata = {
|
|
name: 'OpChan',
|
|
description: 'Decentralized forum powered by Bitcoin Ordinals',
|
|
url:
|
|
process.env.NODE_ENV === 'production'
|
|
? 'https://opchan.app'
|
|
: 'http://localhost:8080',
|
|
icons: ['https://opchan.com/logo.png'],
|
|
};
|
|
|
|
export const appkitConfig: AppKitOptions = {
|
|
adapters: [wagmiAdapter, bitcoinAdapter],
|
|
networks,
|
|
metadata,
|
|
projectId,
|
|
features: {
|
|
analytics: false,
|
|
socials: false,
|
|
allWallets: false,
|
|
},
|
|
enableWalletConnect: false,
|
|
};
|