sui
sui copied to clipboard
wallet-ext: consider adding an event to indicate to dapps the wallet API was injected
During the dogfooding we saw the following message even when Sui Wallet was installed.

This happened because the dapp was initialised before the DappInterface.
~~We can change the demo dapp to use something like this:~~ Done in #3009
const useSuiWallet = () => {
const [wallet, setWallet] = useState(null);
useEffect(() => {
const cb = () => setWallet(window.suiWallet || null);
window.addEventListener('load', cb);
return () => {
window.removeEventListener('load', cb);
};
});
return wallet;
};
Maybe also trigger a custom event eg suiApiInjected
when the interface is injected, from the injection script
Dapp part is fixed. Also pushed the changed to s3 -> http://sui-wallet-demo.s3-website-us-east-1.amazonaws.com/
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This is no longer relevant with the new wallet standard interface + wallet adapters.