nexth icon indicating copy to clipboard operation
nexth copied to clipboard

initial smart wallet example setup

Open hone1er opened this issue 9 months ago • 5 comments

Opening as a draft to get feedback

but this should be a working example of coinbase smart wallet integration

https://github.com/wslyvh/nexth/assets/24376928/a8d90964-82f5-47f3-b252-3412867b287c

https://github.com/wslyvh/nexth/assets/24376928/a5481b9e-0e07-4c0e-9767-231b0474d7ae

https://github.com/wslyvh/nexth/assets/24376928/3a270824-2335-4869-b3e7-8b4971b47b9a

Removed the Coinbase connector specific connect and disconnect buttons in favor of telling the user to use the coinbase wallet in web3Modal and added links to smart wallet repo and docs

Screenshot 2024-05-01 at 8 51 06 PM

hone1er avatar May 01 '24 10:05 hone1er

@hone1er is attempting to deploy a commit to the useWeb3 Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 01 '24 10:05 vercel[bot]

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@coinbase/[email protected] network +4 483 kB cb-felix-z
npm/@nomicfoundation/[email protected] filesystem +1 1.28 MB kanej
npm/[email protected] unsafe Transitive: environment, filesystem +61 11.8 MB vercel-release-bot
npm/[email protected] None 0 20.8 kB lydell
npm/[email protected] None 0 33.9 kB jounqin

🚮 Removed packages: npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@emotion/[email protected], npm/@eslint/[email protected], npm/@eslint/[email protected], npm/@humanwhocodes/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@metamask/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@nomicfoundation/[email protected], npm/@types/[email protected], npm/@wagmi/[email protected], npm/[email protected]

View full report↗︎

socket-security[bot] avatar May 01 '24 18:05 socket-security[bot]

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Install scripts npm/[email protected]

View full report↗︎

Next steps

What is an install script?

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

socket-security[bot] avatar May 01 '24 18:05 socket-security[bot]

This is great! Love it

I wonder a little bit if we should add it as an example page or as a more detailed, full example implementation. My thinking so far is that example/pages should demonstrate basic functionalities (send ether, transfer tokens, etc.) without requiring custom configurations, etc.

More detailed examples like this, which require different packages/configuration/etc. might be easier to maintain as fork or branch. There are a couple of other branches as examples (e.g. ethers instead of viem, using signature-recovery,etc.). We should probably keep a list of active examples on the readme so its easier to find tho.

In this case, I think you could replace the default connect/sign in flow, include a simple contract, NFT minting and provide the full E2E example and functionalities of smart wallets.

What do you think?

wslyvh avatar May 07 '24 14:05 wslyvh

This is great! Love it

I wonder a little bit if we should add it as an example page or as a more detailed, full example implementation. My thinking so far is that example/pages should demonstrate basic functionalities (send ether, transfer tokens, etc.) without requiring custom configurations, etc.

More detailed examples like this, which require different packages/configuration/etc. might be easier to maintain as fork or branch. There are a couple of other branches as examples (e.g. ethers instead of viem, using signature-recovery,etc.). We should probably keep a list of active examples on the readme so its easier to find tho.

In this case, I think you could replace the default connect/sign in flow, include a simple contract, NFT minting and provide the full E2E example and functionalities of smart wallets.

What do you think?

Sounds good to me! I'll get working on this soon. I was actually thinking the smart contract example should have a lot more documentation to it so i think breaking it out into it's own branch and getting more detailed is a great idea.

hone1er avatar May 09 '24 08:05 hone1er

Hi @hone1er just checking in and see if this is still something you'd like to contribute? I believe there have been a lot of advancements in smart contract wallets. Would love to see a Nexth example if you're up for it :)

wslyvh avatar Jun 27 '24 20:06 wslyvh

Hi @hone1er just checking in and see if this is still something you'd like to contribute? I believe there have been a lot of advancements in smart contract wallets. Would love to see a Nexth example if you're up for it :)

Hey @wslyvh ! Yeah my bad i've been working on some buildathon stuff and trying to get freelance work where i can. Lost my job recently lol if no one gets to some smart wallet examples before i get back to this i'd definitely still like to contribute

I've been working with the smart wallet a bit more lately plus wagmi and viem have experimental features already to make working with smart wallets easier so it should be a pretty smooth setup now. Might be a good idea to just close this branch and i'll start fresh with those new hooks and actions to integrate the smart wallet stuff

hone1er avatar Jun 30 '24 17:06 hone1er

Hi @hone1er I would love to see a proper Smart contract wallet example, but closing the PR for now.. Happy to chat, once you're ready for it :)

wslyvh avatar Aug 07 '24 09:08 wslyvh