visualizevalue / mint

An open source internet protocol enabling the creation and collection of digital artifacts on the Ethereum Virtual Machine
https://mint.vv.xyz
21 stars 1 forks source link

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

Open nand2 opened 6 days ago

nand2 commented 6 days ago

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 https://github.com/web3-protocol/evm-browser/issues/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!

jwahdatehagh commented 3 days ago

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 commented 2 days ago

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!