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: logics to set default chain #2787

Merged
merged 4 commits into from
Sep 3, 2024
Merged

Conversation

enesozturk
Copy link
Contributor

@enesozturk enesozturk commented Sep 3, 2024

Description

In the ethers/ethers5/solana adapters, we are not setting the default caip network when users pass chain object to defaultChain parameter for the createWeb3Modal.

Besides, fixes a few other things:

  • Due to multi-chain architecture, checkIfSupportedNetwork is running false since the requested caip networks are false at first (before adapters initialized). This causing users to see Unsupported Network page when they open the AppKit for the first time.
  • We are rendering the network image before the network image is being fetched. Thus, the network image is getting empty. Added event listeners of AssetsController and update the network image when they are stored.

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

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

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

Copy link

vercel bot commented Sep 3, 2024

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

Name Status Preview Updated (UTC)
web3modal-gallery ✅ Ready (Inspect) Visit Preview Sep 3, 2024 0:37am
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Sep 3, 2024 0:37am

@enesozturk enesozturk changed the title fix/default chain set logics fix: logics to set default chain Sep 3, 2024
Copy link
Contributor

github-actions bot commented Sep 3, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 86.76% 3189 / 13453
🔵 Statements 86.76% 3189 / 13453
🔵 Functions 161.44% 236 / 723
🔵 Branches 215.12999999999997% 430 / 847
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/base/adapters/evm/ethers/client.ts 0% 0% 0% 0% 1, 15-19, 42, 47, 50, 52, 57, 104, 106, 108, 110, 116, 127, 129, 135, 137, 139, 142-143, 145-147, 149-153, 155-167, 169-183, 185-188, 190-195, 197-200, 202-207, 209-211, 214-217, 219, 221-222, 225-229, 231-236, 238-249, 251-254, 256-261, 263, 265, 267-273, 275-276, 279-283, 287, 289-314, 316-327, 329-332, 334-338, 340-341, 343-368, 370-373, 375-384, 386-387, 389, 391, 393-394, 396-398, 400-402, 404-409, 411-413, 415-416, 418-419, 421-423, 425-427, 429-436, 438-441, 443-444, 446-447, 449-451, 453-455, 457-459, 461-463, 465-467, 469-470, 472-478, 480-482, 484-485, 487-488, 490-494, 496-499, 501, 503-505, 507-508, 510-513, 515-518, 520-523, 525-527, 529, 531-533, 535-537, 544-548, 550-555, 557-558, 561-564, 566, 568-570, 572-574, 576-579, 582-583, 585-589, 592-599, 601-604, 606-607, 609-610, 612-614, 616-620, 622-623, 625-627, 629-631, 633-635, 637-639, 641-643, 645-646, 648-650, 652-668, 671-674, 676-677, 679-682, 684-686, 688-699, 701, 703-704, 706-713, 715-721, 723-725, 727-735, 737-738, 740-755, 757-759, 761-765, 767-769, 771-773, 775-781, 783-785, 787-798, 800-810, 812-823, 825-839, 841-843, 845-861, 863-864, 866-882, 884-903, 905-906, 908-916, 918-919, 921-928, 930-943, 945-946, 948-954, 956-961, 963-967, 969-974, 976-977, 979-981, 983-986, 988-996, 998-1006, 1008-1013, 1015-1022, 1024-1037, 1039-1047, 1049-1054, 1056-1061, 1063-1066, 1068-1076, 1078-1083, 1085-1090, 1092-1111, 1113-1120, 1122-1123, 1125-1132, 1134-1140, 1142-1145, 1147-1151, 1153-1167, 1169-1177, 1179-1184, 1186-1187, 1189-1192, 1194-1197, 1199-1203, 1205-1211, 1213-1219, 1221-1222, 1224-1252, 1254-1266, 1268-1269, 1271-1276, 1278-1279, 1281-1288, 1290-1303, 1305-1308, 1310-1317, 1319-1323, 1325-1327, 1329-1333, 1335-1354, 1356-1366, 1368-1372, 1374-1375, 1377-1383, 1385-1404, 1406-1420, 1422-1428, 1430-1451, 1453-1471, 1473-1475, 1477-1490, 1492-1493, 1495-1506, 1508-1522, 1524-1534, 1536-1537, 1539-1541, 1543-1553, 1555-1565, 1567-1571, 1573-1585, 1587-1590, 1592-1596, 1598-1605
packages/base/adapters/evm/ethers5/client.ts 0% 0% 0% 0% 1, 14-17, 26, 31-32, 36, 41, 88, 90, 94, 96, 102, 104, 108, 118, 120, 122, 124-125, 127-129, 131-135, 137-149, 151-165, 167-170, 172-177, 179-182, 184-189, 191-193, 195, 197-198, 201-205, 207-212, 214-225, 227-230, 232-237, 239, 241, 243-249, 251-252, 255-259, 263, 265-290, 292-301, 303-306, 308-312, 314-315, 317-340, 342-345, 347-358, 360-361, 363-364, 366, 368-370, 372-374, 376-378, 380-387, 389-390, 392-393, 395-398, 400-403, 405-408, 410-412, 414, 416-418, 420-422, 429-433, 435-440, 442-443, 445-447, 449-451, 453-455, 458-461, 463-464, 469-470, 472-476, 479-486, 488-491, 493-494, 496-497, 499-501, 503-505, 507-509, 511-513, 515-517, 519-521, 523-525, 527-530, 532-538, 541-544, 546-547, 549-555, 557-567, 569, 571-572, 574-582, 584-585, 587-602, 604-606, 608-612, 614-616, 618-620, 622-628, 630-632, 634-645, 647-657, 659-678, 680-681, 683-699, 701-703, 705-721, 723-742, 744-745, 747-755, 757-758, 760-767, 769-782, 784-785, 787-789, 791-794, 796-801, 803-807, 809-814, 816-817, 819-821, 823-826, 828-836, 838-846, 848-853, 855-857, 859-861, 863-866, 868-881, 883-891, 893-896, 898-900, 902-904, 906-909, 911-918, 920-925, 927-932, 934-953, 955-962, 964-965, 967-974, 976-982, 984-987, 989-993, 995-1009, 1011-1019, 1021-1024, 1026, 1028-1029, 1031, 1033-1034, 1036-1040, 1042-1048, 1050-1056, 1058-1059, 1061-1088, 1090-1102, 1104-1105, 1107-1112, 1114-1115, 1117-1124, 1126-1137, 1139-1142, 1144-1156, 1158-1160, 1162-1166, 1168-1173, 1175-1188, 1190-1194, 1196-1197, 1199-1205, 1207-1226, 1228-1242, 1244-1250, 1252-1273, 1275-1293, 1295-1297, 1299-1312, 1314-1315, 1317-1328, 1330-1344, 1346-1356, 1358-1359, 1361-1363, 1365-1375, 1377-1387, 1389-1393, 1395-1407, 1409-1412, 1414-1418, 1420-1427, 1429-1435, 1437-1439, 1441-1448
packages/base/adapters/evm/wagmi/client.ts 0% 0% 0% 0% 1-2, 21, 23-24, 38, 40-41, 47-48, 50-51, 54, 70, 72, 77, 79, 85, 87, 89, 91, 93-94, 96-98, 100-102, 104-106, 108-111, 113-116, 118-123, 125-126, 128-130, 132-134, 136-138, 140-142, 144, 148-150, 152-155, 157-158, 160-166, 169, 172-175, 177-182, 184-195, 197-206, 208, 210, 212-215, 221-224, 226-227, 229-231, 233, 235, 237-238, 240, 242-243, 245-246, 248-250, 252-253, 255-258, 260-262, 264-267, 269-270, 272-273, 275-282, 284-286, 288-289, 291-302, 304-305, 307-316, 318-319, 321, 323-324, 326-329, 331-338, 340-341, 343-347, 349-351, 353-358, 360-364, 366-367, 369-371, 373-376, 378-379, 381, 383-385, 387-390, 392-394, 396-398, 400-405, 407-427, 430-437, 440-452, 454-460, 471-472, 474-489, 492-506, 508-509, 511-530, 532-535, 537-540, 542-553, 555-558, 560-565, 567-591, 593-601, 603-606, 608-611, 613-614, 617-637, 639-643, 645, 647, 649-667, 669-672, 679-693, 695-703, 705-711, 713, 715-717, 719-736, 738-746, 748-749, 751-758, 760-766, 768-774, 776-793, 795-797, 799-812, 814-824
packages/base/adapters/solana/web3js/client.ts 0% 0% 0% 0% 1, 9-11, 13, 16-17, 36-38, 44-45, 49, 66-67, 69, 71, 73, 77, 85, 89, 91, 93-94, 96-98, 100, 102, 104, 106-112, 114-123, 125-129, 131-135, 137-142, 144-148, 150-152, 154, 156-157, 159-162, 164-166, 168-169, 171-173, 175-179, 181, 183-184, 186, 193, 195, 197, 199, 201, 203-205, 207-208, 210, 212-214, 216, 218, 220, 222-224, 226-231, 233-236, 238-240, 242-243, 245-247, 249-251, 253-255, 257-259, 261-262, 264-266, 268-274, 276-289, 291-293, 295-297, 299-301, 303-305, 307-309, 312-314, 316-331, 333-335, 337-341, 343-349, 351-354, 356-358, 360-362, 364-369, 371-386, 388-389, 391-393, 395-398, 400-402, 404-407, 409-412, 414-419, 421-427, 429-442, 444-446, 448-451, 454-456, 458-461, 463-468, 470, 472, 474-479, 481, 489-492, 494-510, 512-519, 522-525, 527-532, 535-538, 540-547, 549-551, 553-559, 561-569, 571-577, 579-582, 584-585, 587-595, 597-600, 602-618, 620-622, 624-625, 627-629, 631-634, 636-637, 639-648, 650-652
packages/core/src/controllers/NetworkController.ts 60.69% 59.37% 68.42% 60.69% 44-45, 51-54, 56-65, 72, 74-77, 89-90, 109-111, 113-115, 117, 119-120, 122-126, 136-142, 155-156, 159, 161-163, 165, 177-180, 196, 199-200, 215-216, 218-220, 222-223, 225, 227-231, 233-234, 241-242, 254-255, 273-274, 277-278, 291-292, 302, 304-306, 308-309, 313
Generated in workflow #5923

Copy link
Contributor

github-actions bot commented Sep 3, 2024

♻️ Vite-Size ♻️

Size Difference

Size (kb) Gzip (kb)
Total Diff. 🔺+0.379 🔺+0.129

Current Size

Name Size (kb) Gzip (kb)
assets/index-AyQbJiHp.js 1475.023 417.543
assets/noble-curves.js 31.941 12.78
assets/2.19.6_bufferutil.js 2.789 1.325
assets/index.js 161.83 59.283
assets/index2.js 102.249 29.113
assets/index3.js 304.389 87.28
assets/walletconnect-ethereum-provider.js 278.197 80.094
assets/index4.js 11.601 3.213
assets/w3m-modal.js 6.992 2.509
assets/index5.js 12.674 4.696
assets/hooks.module.js 74.776 25.684
assets/walletconnect-modal-ui.js 112.43 34.328
index.html 0.329 0.236
Total Size 2575.22 758.084

Base Size

Name Size (kb) Gzip (kb)
assets/index-Dv6uDWQ5.js 1474.644 417.411
assets/noble-curves.js 31.941 12.78
assets/2.19.6_bufferutil.js 2.789 1.326
assets/index.js 161.83 59.283
assets/index2.js 102.249 29.113
assets/index3.js 304.389 87.281
assets/walletconnect-ethereum-provider.js 278.197 80.093
assets/index4.js 11.601 3.213
assets/w3m-modal.js 6.992 2.509
assets/index5.js 12.674 4.697
assets/hooks.module.js 74.776 25.685
assets/walletconnect-modal-ui.js 112.43 34.327
index.html 0.329 0.237
Total Size 2574.841 757.955

packages/base/adapters/solana/web3js/client.ts Outdated Show resolved Hide resolved
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.

2 participants