You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
Hi everyone, i'm currently writing a starter kit at Ledger to have a minimal dapp bootstrap, where i'm trying to cover some basic dapp feature usecase (like, getting a value, setting a value, listening to a value change on a contract).
as shown in this GIF, i've currently made that the dapp is only "opened" after you actually log-in with the ledger or the MetaMask extension.
One of the "feature" i'm trying to reach now, is to have the app showing things even if you are not logged in, basically having a read-only mode – pushing the "log in" at the very end, when you actually want to do a set value (or whatever contract call).
I've successfully reached that by just doing:
however, what should happen when user logs in? a simple implementation is just to trash & replace the web3 instance by the new one, but that kinda means having to "reset" the UI (and wait the same data to come again).
Ideally, I was thinking, what about you can engine.addProvider(aMoreExtendedSubproviderThatAddSupportForMoreThings) ? so we keep using the FetchSubprovider but just adding the missing pieces (the part about getAccounts and signTransaction, ..)
Moreover, I've notice the MetaMask don't support the watch() mode, there is no event going through, but I believe that's a known bug (can't find again the issue). I'm not finding a way to combine FetchSubprovider with metamask however (only thing I know is you can new Web3(web3.currentProvider), is there a way to use web3.currentProvider as a subprovider in combination of Fetch?)
sorry for the multi-questions thread thing. I would be happy to discuss it somewhere else if more appropriate.
If there is no solution for this, I'm probably going to try the simple "trash & replace" approach for now.
Thanks
The text was updated successfully, but these errors were encountered:
Currently there is no providerSubprovider like what would allow you to chain subproviders together and fall back to a normal provider, but this would be a practical way to compose your own subproviders with a fallback to MetaMask.
We have had some issues with events/logs/watch, (see here), but you may be able to work around by reloading, or waiting for our next release.
If you don't want to wait for that, and don't want to trash providers, a third architecture would be to add your own hooked-wallet-subprovider in such a way that it lists whatever account is currently "logged in" and conditionally signs with whichever strategy has been chosen.
Hi everyone, i'm currently writing a starter kit at Ledger to have a minimal dapp bootstrap, where i'm trying to cover some basic dapp feature usecase (like, getting a value, setting a value, listening to a value change on a contract).
as shown in this GIF, i've currently made that the dapp is only "opened" after you actually log-in with the ledger or the MetaMask extension.
One of the "feature" i'm trying to reach now, is to have the app showing things even if you are not logged in, basically having a read-only mode – pushing the "log in" at the very end, when you actually want to do a
set value
(or whatever contract call).I've successfully reached that by just doing:
however, what should happen when user logs in? a simple implementation is just to trash & replace the web3 instance by the new one, but that kinda means having to "reset" the UI (and wait the same data to come again).
Ideally, I was thinking, what about you can
engine.addProvider(aMoreExtendedSubproviderThatAddSupportForMoreThings)
? so we keep using theFetchSubprovider
but just adding the missing pieces (the part about getAccounts and signTransaction, ..)Moreover, I've notice the MetaMask don't support the watch() mode, there is no event going through, but I believe that's a known bug (can't find again the issue). I'm not finding a way to combine FetchSubprovider with metamask however (only thing I know is you can
new Web3(web3.currentProvider)
, is there a way to useweb3.currentProvider
as a subprovider in combination of Fetch?)sorry for the multi-questions thread thing. I would be happy to discuss it somewhere else if more appropriate.
If there is no solution for this, I'm probably going to try the simple "trash & replace" approach for now.
Thanks
The text was updated successfully, but these errors were encountered: