html pure js help #3276
Unanswered
Rickshanelorie
asked this question in
Developer Support
Replies: 2 comments
-
hi @Rickshanelorie do you mean to keep track of connection? You can use the watchAccount wagmi action to subscrite to account changes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
how can i set the empty string address for my wallet connect this what i was using help " let address = ""; "
import {
EthereumClient,
w3mConnectors,
w3mProvider,
WagmiCore,
WagmiCoreChains,
WagmiCoreConnectors
} from "https://unpkg.com/@web3modal/[email protected]";
import { Web3Modal } from "https://unpkg.com/@web3modal/[email protected]";
// 0. Import wagmi dependencies
const { bscTestnet, bsc } = WagmiCoreChains;
const { configureChains, createConfig } = WagmiCore;
// 1. Define chains
const chains = [ bscTestnet, bsc ];
const projectId = "b47b978a9df1c500b5f865a4c5e7c3dc";
// 2. Configure wagmi client
const { publicClient } = configureChains(chains, [w3mProvider({ projectId })]);
const wagmiConfig = createConfig({
autoConnect: true,
connectors: [
...w3mConnectors({ chains, version: 2, projectId }),
new WagmiCoreConnectors.CoinbaseWalletConnector({
chains,
options: {
appName: "html wagmi example",
},
}),
],
publicClient,
});
// 3. Create ethereum and modal clients
const ethereumClient = new EthereumClient(wagmiConfig, chains);
export const web3Modal = new Web3Modal(
{
projectId,
walletImages: {
safe: "https://pbs.twimg.com/profile_images/1566773491764023297/IvmCdGnM_400x400.jpg",
},
},
ethereumClient
);
const { getAccount } = WagmiCore
Beta Was this translation helpful? Give feedback.
All reactions