Comments (4)
Sorry, the app was erroneous, now fixed. And the error is not that console.log
don't work, but:
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'provider')
at readScore (App.tsx:76:1)
from web3-onboard.
Bug workaround:
useEffect(() => {
if (!wallet) {
return;
}
(async () => {
const provider = new ethers.BrowserProvider(wallet!.provider, 'any');
console.log('provider', provider);
const signer = await provider.getSigner();
console.log('signer', signer);
const address = await signer.getAddress()
console.log('address', address);
const message = "I certify that I am the owner of the Ethereum account\n" + address;
const signature = await signer.signMessage(message);
})()
}, [wallet]);
async function readScore() {
if (!wallet) {
await connect();
}
}
from web3-onboard.
@vporton thanks for posting!
I dont see this when working with our react demo project. We do something similar but not quite the same you can check it out here.
Let me know if this helps!
from web3-onboard.
Let me know if this helps!
It does not help, because it involves an additional user action to start the next action after connecting, instead of the ability to start an additional blockchain action (such as requesting from user a signature) automatically upon connecting.
BTW, code similar to my above code is buggy: It sometimes produces 4 asks for a signature instead of one.
from web3-onboard.
Related Issues (20)
- Sveltekit example does not work with vercel HOT 3
- How can I bypass account selection when refresh page?
- Merge
- Hola
- Sígueme
- Cesar
- [Feature]: enableMobileWalletLink for @coinbase/wallet-sdk HOT 2
- Non-existing Inter font was used HOT 2
- Walletconnect with coinbase wallet does not work from android device.
- injectedModule bug: "Cannot assign to read only property 'request' of object '[object Object]'" HOT 14
- Documentation mention wrong package `@web3-onboard/injected` HOT 4
- [Feature]: eip1271
- [BUG]: Event when user disconnects all wallets HOT 2
- [Feature]: Compatibility with Flutter
- thanks
- [Feature]: ALI Token Support
- connectWallet with autoSelect disables all wallets list
- [Feature]: Bloom Wallet Integration HOT 1
- curl -X GET "https://api.w3.org/ecosystems" -H "accept: application/json"
- WalletConnect not working with my custom evm chain
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web3-onboard.