import { Web3Auth } from “@web3auth/modal”;
const clientId = “clientid-from-web3authdashboard”;
export const web3auth = async() => {
try {
const web3auth = new Web3Auth({
clientId: clientId,
web3AuthNetwork: “testnet”,
chainConfig: {
chainNamespace: “eip155”,
chainId: “0x33”,
rpcTarget: “https://erpc.apothem.network”,
displayName: “XDC Testnet”,
blockExplorer: “https://apothem.xinfinscan.com”,
ticker: “TXDC”,
tickerName: “TXDC”,
},
});
await web3auth.initModal();
return web3auth;
} catch(error) {
console.log(“web3auth utils web3auth main code error :”,error);
}
}