I have a PnP Web Application EVM Based Chain sapphire_devnet Project under base plan
I want to test if from response of the lookup url I can get the same evm wallet address after logging in in my app, Ive tried many approaches since there’s no much documentation nor examples of this topic, I had to reach at this forum for some help, this is the lookup link using email_passwordless:
Response:
{
"data": {
"evmAddress": "0x95ab4ade8bE591D47FB95710B5bE7DF1820Da6ed",
"X": "3b471d50be0dc15e82600366753a53ce28c2249dabacfbad2809d14a9e91014a",
"Y": "6c712d9ad16fc34b123eee2baf30cc2679f2b3d69ec26ba6cea96d705c654ef8",
"isMfaEnabled": false
},
"success": true
}
And this is my app configuration:
Im trying to wrap the connector into wagmi
export const config = createConfig({
chains: process.env.REACT_APP_USE_CHAIN === 'polygon' ? [polygon] : [arbitrumSepolia],
transports: { [arbitrumSepolia.id]: http(), [polygon.id]: http() },
connectors: [SocialWeb3AuthConnector()],
});
Where SocialWeb3AuthConnector:
// Web3Auth Libraries
import { Web3AuthConnector } from '@web3auth/web3auth-wagmi-connector';
import { Web3Auth } from '@web3auth/modal';
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider';
import { CHAIN_NAMESPACES, WEB3AUTH_NETWORK } from '@web3auth/base';
import { AuthAdapter } from '@web3auth/auth-adapter';
export default function SocialWeb3AuthConnector() {
// Create Web3Auth Instance
const name = "Darwin Evolution";
const clientId = "BGOuHe9fhDfK1KJSUHsTOvHENWCCoepmOAI531fLTf53-eq8qxvR4PO4akTaoysbUGBAXaDeNaxTsq0uaZTrT7M"
const chainConfig = {
logo: "https://web3auth.io/images/web3authlog.png",
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: process.env.REACT_APP_USE_CHAIN === "polygon" ? "0x89" : "0x66eee",
rpcTarget: process.env.REACT_APP_USE_CHAIN === "polygon" ? process.env.REACT_APP_ALCHEMY_POLYGON_API_KEY as string : process.env.REACT_APP_QUICKNODE_ARBITRUM_SEPOLIA_API_KEY as string,
displayName: process.env.REACT_APP_USE_CHAIN === "polygon" ? "Polygon Mainnet" : "Arbitrum Sepolia",
blockExplorerUrl: process.env.REACT_APP_USE_CHAIN === "polygon" ? process.env.REACT_APP_MATIC_SCAN as string : process.env.REACT_APP_SEPOLIA_SCAN as string,
ticker: process.env.REACT_APP_USE_CHAIN === "polygon" ? "MATIC" : "ETH",
tickerName: process.env.REACT_APP_USE_CHAIN === "polygon" ? "Polygon" : "Arbitrum Sepolia",
};
const privateKeyProvider = new EthereumPrivateKeyProvider({ config: { chainConfig } });
const web3AuthInstance = new Web3Auth({
clientId,
chainConfig,
privateKeyProvider,
uiConfig: {
appName: name,
loginMethodsOrder: ["google", "github"],
defaultLanguage: "en",
modalZIndex: "2147483647",
logoLight: "https://web3auth.io/images/web3authlog.png",
logoDark: "https://web3auth.io/images/web3authlogodark.png",
uxMode: "redirect",
mode: "light",
},
web3AuthNetwork:
process.env.REACT_APP_USE_CHAIN === 'polygon'
? WEB3AUTH_NETWORK.SAPPHIRE_MAINNET
: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
enableLogging: true
});
const authAdapter = new AuthAdapter({
adapterSettings: {
loginConfig: {
email_passwordless: {
verifier: "Darwin", // Pass the Verifier name here. eg. aggregate-sapphire
typeOfLogin: "email_passwordless"
},
google: {
verifier: "DarwinGoole",
typeOfLogin: "google"
}
},
},
});
web3AuthInstance.configureAdapter(authAdapter);
return Web3AuthConnector({
web3AuthInstance
});
}
Trying to use both passwordless or google Im still getting a different wallet address
Any help would be much appreciated