Replies: 1 comment
-
@SamsShow, you need to use the provider that you got from others when creating a new Example: const ethersProvider = new ethers.providers.Web3Provider(walletProvider);
const web3SignatureProvider = new Web3SignatureProvider(
ethersProvider!.provider
); In your case it would be const provider = new ethers.providers.Web3Provider(window.ethereum);
await provider.send("eth_requestAccounts", []);
const signer = provider.getSigner();
// Fixed here
this.signatureProvider = new Web3SignatureProvider(provider.provider);
this.requestClient = new RequestNetwork({
nodeConnectionConfig: {
baseURL: 'https://sepolia.gateway.request.network/',
},
signatureProvider: this.signatureProvider,
});
return this.requestClient;
} catch (error) {
console.error('Failed to initialize Request Network:', error);
throw error;
} |
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
-
Failed to initialize Request Network: TypeError: Cannot read properties of undefined (reading 'Web3Provider')
async initialize() {
try {
if (!window.ethereum) {
throw new Error('No Web3 provider found. Please install MetaMask.');
}
}
Beta Was this translation helpful? Give feedback.
All reactions