ArweaveWalletConnector icon indicating copy to clipboard operation
ArweaveWalletConnector copied to clipboard

open to a re-name?

Open DougAnderson444 opened this issue 3 years ago • 3 comments

JF, since this connector could be used for wallets outside of Arweave, would you be open to renaming it to Web3-Wallet-Connector?

DougAnderson444 avatar Jan 17 '22 18:01 DougAnderson444

For sure! I have to check out which way would be best to expand the project. Another option could be to extract the generalized part of the connector in its own module, and all project specific implementations using the current naming scheme 🤔

The only constraint to watch out for is that multiple project specific implementations should extend the same Connector class in order to share their active connections with each others when talking to the same provider url. For example, if you have a ArweaveWebWallet instance along with what would be an extension providing additional specific methods, and both are connected to the same url, they would share the same iframe and popup, avoiding any overhead

jfbeats avatar Jan 17 '22 21:01 jfbeats

implementations should extend the same Connector class in order to share their active connections with each others when talking to the same provider url

Totally agree. The way I was doing this is by extending the wallet handler on the wallet side with a Proxy, that way all the available additional methods are instantly available to the Connector :)

For example, if you have a ArweaveWebWallet instance along with what would be an extension providing additional specific methods, and both are connected to the same url, they would share the same iframe and popup, avoiding any overhead

Personally I think extensions are a thing of the past. I was intending on others being able to extend our type of web wallet via library plugins (like Rollup?). The idea would be if you want to use the Web3 wallet for a purpose or chain other than what already exists, you could come along and add an extension/plugin to the existing web wallet and make you own deployment.

I'm doing this already so when it's done I'll have an example to share with you

DougAnderson444 avatar Jan 19 '22 11:01 DougAnderson444

Yea, extension in the sense of inheritance with child classes, for example: ArweaveWallet extends Connector and OtherWallet extends Connector Both could be used in parallel in the same dapp and those two must extend the exact same Connector class with shared static properties to avoid overhead. The best way to manage it would be to have all 3 in different packages Connector, ArweaveWallet and OtherWallet, if the latter two will still share the same Connector. I would guess that it works when using the same dependency version but I think it's best to have it figured out before expanding the scope of the project in a specific way. Could work off of dependency injection or mixins pattern, but I like that people integrating it wouldn't have to worry about any of that

jfbeats avatar Jan 29 '22 13:01 jfbeats