Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Wagmi storage configurable (useful for web3:// + EVM Browser) #14

Open
nand2 opened this issue Nov 16, 2024 · 2 comments
Open

Make Wagmi storage configurable (useful for web3:// + EVM Browser) #14

nand2 opened this issue Nov 16, 2024 · 2 comments

Comments

@nand2
Copy link

nand2 commented Nov 16, 2024

Hi!

Would it be possible to make the Wagmi storage option configurable?

At the moment, in 2.wagmi.ts, Wagmi is configured with

    storage: createStorage({
      storage: cookieStorage,
    }),

I would like to override this config with :

    storage: window.location.protocol === 'web3:' ? null : createStorage({
      storage: cookieStorage,
    }),

Conceptually this would not be needed -- the web3:// protocol supports cookies and localStorage.
But at current development stage, the only native `web3:// native browser EVM Browser, has some features disabled (cookies, localStorage, cf web3-protocol/evm-browser#3 ) due to restrictions by electron.

(This + the use of the /#/ routing (for which you gave me configuration indications) are the two things I had to make to make web3://ocweb.eth work in EVM Browser)

Thanks for reviewing this!

@nand2 nand2 changed the title web3:// : make Wagmi storage dependant of protocol Make Wagmi storage configurable (useful for web3:// + EVM Browser) Nov 16, 2024
@jwahdatehagh
Copy link
Member

will look into it! also have an interest in making configuring RPCs a runtime option (e.g. adjust in settings).

one potential issue here is that it should also work in a node js (server) context where there is no window available.

@nand2
Copy link
Author

nand2 commented Nov 20, 2024

It would be good for my case even if the setting is static 🫡 (I would set it to null, so no wagmi storage for all cases)
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants