Skip to content
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

fix: appkit basic multichain #3658

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

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Jan 15, 2025

Description

When initializing AppKit without adapters there were 2 issues:

  • Screen opened pointed to regular connect WC screen.
  • On mobile, auth options were displayed and there was no adapter to handle them

There's an additional issue on reloading and switching networks, where currently connected providers would not be recognized as connected.

Changes:

  • Point to correct screen when opening without adapters
  • Fix connect option management on w3m-connect-view to not display auth options when no adapters are present
  • Simplifies switchNetwork logic and delegates to adapter base class to handle special cases
  • Sets auth connector provider and connection state on all namespaces when reconnecting.

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

Closes APKT-2030

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

zoruka and others added 30 commits January 10, 2025 20:30
…Fix tests. Fix issue where no adapters would open regular WCconnect screen
@tomiir tomiir marked this pull request as ready for review January 15, 2025 16:38
@tomiir tomiir requested a review from zoruka January 15, 2025 16:40
Copy link

linear bot commented Jan 15, 2025

@tomiir
Copy link
Collaborator Author

tomiir commented Jan 15, 2025

Supersedes #3648

Copy link
Contributor

github-actions bot commented Jan 15, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.53% 19483 / 28428
🔵 Statements 68.53% 19483 / 28428
🔵 Functions 59.09% 1696 / 2870
🔵 Branches 79.66% 3424 / 4298
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/adapters/wagmi/src/client.ts 73.45% 58.42% 73.52% 73.45% 124-150, 175, 237-241, 247-250, 281, 283, 312-313, 364-367, 372-373, 383-384, 423-424, 435, 455, 460-475, 478-509, 519-520, 524-525, 542-553, 592, 596-597, 619-620, 628-629, 634-635, 639-644, 651-652, 660-661, 666-667, 676-677, 685-686, 691-692, 698-705
packages/appkit/src/client.ts 62.45% 83.71% 77.17% 62.45% 173-174, 203-204, 219-220, 223-224, 239-242, 245-248, 268-269, 272-273, 289-306, 309-318, 589-590, 593-596, 599-600, 603-604, 607-608, 611-612, 619-623, 686-689, 716-717, 731-732, 741-742, 745-746, 751-752, 769-770, 791-807, 834-845, 848-885, 888-893, 909-913, 926-937, 940-959, 962-968, 971-981, 984-996, 999-1001, 1004-1006, 1009-1011, 1014-1016, 1019-1026, 1031-1061, 1065-1084, 1092-1106, 1109-1116, 1119-1133, 1139, 1143, 1157, 1170-1171, 1179, 1182-1185, 1188-1194, 1204-1205, 1234-1261, 1269-1272, 1276, 1292-1302, 1311-1312, 1317, 1323-1341, 1347-1354, 1365-1373, 1378-1387, 1390-1400, 1403-1483, 1486-1506, 1525, 1532, 1549, 1562, 1599, 1622-1629, 1631-1642, 1645-1653, 1671-1672, 1689-1705, 1720-1724, 1755-1759, 1780-1781, 1786-1787, 1789-1790, 1795-1798, 1809-1810, 1849-1853, 1878-1879, 1903-1904, 1933-1934, 1938-1939, 2028, 2030-2032, 300-805
packages/wallet/index.ts 100% 100% 100% 100%
packages/wallet/src/W3mFrameConstants.ts 100% 100% 100% 100%
Generated in workflow #9014 for commit 4a2e62c by the Vitest Coverage Report Action

@@ -609,6 +610,7 @@ export class WagmiAdapter extends AdapterBlueprint {
}

public override async switchNetwork(params: AdapterBlueprint.SwitchNetworkParams) {
await super.switchNetwork(params)
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting 👀

address,
chainId: caipNetwork.id,
chainNamespace: caipNetwork.chainNamespace
})
}
}
} else {
this.setCaipNetwork(caipNetwork)
} catch (error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

should we remove (error) part ?

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

Successfully merging this pull request may close these issues.

3 participants