-
Notifications
You must be signed in to change notification settings - Fork 163
fix(solana): add support for Mobile Wallet Adapter in config provider #1368
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 59637ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 14 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 ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1368 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 864 864
Lines 18491 18519 +28
Branches 1649 1657 +8
=========================================
+ Hits 18491 18519 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
.changeset/tricky-rockets-build.md
Outdated
@@ -0,0 +1,6 @@ | |||
--- | |||
'@ant-design/web3-solana': patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
solana 这个包算是新增功能,应该是一个 minor
const autoRegisteredWallets = wallets | ||
.filter((w) => !providedWalletNames.includes(w.adapter.name)) | ||
.map<Wallet>((w) => { | ||
const adapter = w.adapter; | ||
|
||
// MWA is a special case, it's always ready | ||
if (adapter.name === MWA_WALLET_NAME) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
除了 name,还有更可靠的判断方法吗?
@@ -228,6 +246,12 @@ export const AntDesignWeb3ConfigProvider: React.FC< | |||
selectWallet(currentWalletName); | |||
}} | |||
connect={async (_wallet, options) => { | |||
// if the wallet is MWA, just call `connect`, it will pop up the mobile wallet immediately | |||
if (_wallet?.name === MWA_WALLET_NAME) { | |||
_wallet._standardWallet?.connect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个背后实现的逻辑是什么?是基于什么协议实现的?是会打开第三方 app 吗?
💡 Background and solution
🔗 Related issue link
fix #1367