Skip to content

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

gin-lsl
Copy link
Collaborator

@gin-lsl gin-lsl commented Mar 7, 2025

💡 Background and solution

🔗 Related issue link

fix #1367

Copy link

changeset-bot bot commented Mar 7, 2025

🦋 Changeset detected

Latest commit: 59637ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@ant-design/web3-common Minor
@ant-design/web3-solana Minor
@ant-design/web3 Minor
@ant-design/web3-assets Patch
@ant-design/web3-bitcoin Patch
@ant-design/web3-eth-web3js Patch
@ant-design/web3-ethers-v5 Patch
@ant-design/web3-ethers Patch
@ant-design/web3-sui Patch
@ant-design/web3-ton Patch
@ant-design/web3-wagmi Patch
@example/eth-web3js Patch
@example/ethers-v5 Patch
@example/ethers Patch

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

Copy link

vercel bot commented Mar 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ant-design-web3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2025 5:15pm

Copy link

github-actions bot commented Mar 7, 2025

Preview is ready

Copy link

codecov bot commented Mar 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (f896c57) to head (b78dc70).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gin-lsl gin-lsl marked this pull request as ready for review March 13, 2025 12:29
@@ -0,0 +1,6 @@
---
'@ant-design/web3-solana': patch
Copy link
Collaborator

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) {
Copy link
Collaborator

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();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个背后实现的逻辑是什么?是基于什么协议实现的?是会打开第三方 app 吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants