-
Notifications
You must be signed in to change notification settings - Fork 149
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
feat(solana): Add Solflare (metamask snap) wallet #786
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: f91b951 The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #786 +/- ##
===========================================
- Coverage 100.00% 99.98% -0.02%
===========================================
Files 708 713 +5
Lines 21455 21592 +137
Branches 1214 1222 +8
===========================================
+ Hits 21455 21589 +134
- Misses 0 3 +3 ☔ View full report in Codecov by Sentry. |
@gin-lsl You can run the @gin-lsl 可以在本地运行 |
Snaps API 的核心是三类:
文档:https://docs.metamask.io/snaps/reference/snaps-api |
这个可以先等一等,现在的体验感觉不好。 |
钱包加一个 |
a35978b
to
3fcfa9a
Compare
目前还是有问题。 上次更新添加了 (当然这个也不是万能的,如果用户的 metamask 没有安装 solana 的 snap,那么这里就不会出现。 如果按照 @jeasonstudio 说的形式,大概是这样的形式: |
要确认两个问题:
|
目前确实会重复出现,这个应该需要特殊处理下。 |
逻辑应该是这样的:
|
3fcfa9a
to
7b38bd7
Compare
看 adapter 们的代码发现了个问题,Adapter 都是在构造函数中开始检测插件是否可用的。目前的代码,调用它们的构造函数太早,可能导致检测到了但是 WalletProvider 中却没有。 所以这个 pr 中,SolanaProvider 实现逻辑稍微修改了下。 同时目前也可以实现 如果配置了 autoAddRegisteredWallets 自动检测,则一定能检测出 metamask snap 钱包。 |
不过还是需要一个 SolflareSnapAdapter,用于检测 Metamask 没有安装 Snap 时的情况。 (目前这个 adapter 里面,Solflare 自己的钱包和 snap 绑定比较重..) |
a7207da
to
f91b951
Compare
[中文版模板 / Chinese template]
💡 Background and solution
添加 Solflare Wallet, 实现通过 MetaMask Snaps 连接 Solana。钱包名和图标等需要再讨论下。
在 Solana/More Wallet Demo 可体验
🔗 Related issue link