Skip to content

Commit 356c48e

Browse files
authored
Merge branch 'main' into chore/khizr-fixes-2-REOWN-4657
2 parents 0db1ee3 + ccf0dcb commit 356c48e

125 files changed

Lines changed: 3598 additions & 319 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/expose-approved-networks.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.changeset/fiery-carrots-grin.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
'@reown/appkit-utils': patch
3+
'@reown/appkit': patch
4+
'@reown/appkit-cdn': patch
5+
'@reown/appkit-cli': patch
6+
'@reown/appkit-codemod': patch
7+
'@reown/appkit-common': patch
8+
'@reown/appkit-core': patch
9+
'@reown/appkit-experimental': patch
10+
'@reown/appkit-pay': patch
11+
'@reown/appkit-polyfills': patch
12+
'@reown/appkit-scaffold-ui': patch
13+
'@reown/appkit-siwe': patch
14+
'@reown/appkit-siwx': patch
15+
'@reown/appkit-testing': patch
16+
'@reown/appkit-ui': patch
17+
'@reown/appkit-universal-connector': patch
18+
'@reown/appkit-wallet-button': patch
19+
'@reown/appkit-wallet': patch
20+
'@reown/appkit-controllers': patch
21+
'@reown/appkit-adapter-bitcoin': patch
22+
'@reown/appkit-adapter-ethers': patch
23+
'@reown/appkit-adapter-ethers5': patch
24+
'@reown/appkit-adapter-solana': patch
25+
'@reown/appkit-adapter-ton': patch
26+
'@reown/appkit-adapter-tron': patch
27+
'@reown/appkit-adapter-wagmi': patch
28+
---
29+
30+
fix: persist the universal-link base as the WalletConnect deeplink choice when `experimental_preferUniversalLinks` is enabled, so session-request re-opens (handled by universal-provider) use the wallet's universal link instead of falling back to its native custom scheme

.changeset/tough-foxes-hunt.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default [
2121
{
2222
name: '@reown/appkit/react',
2323
path: 'packages/appkit/dist/esm/exports/react.js',
24-
limit: '235 KB', // Current: ~222 KB (5% buffer)
24+
limit: '236 KB', // Current: ~235 KB
2525
gzip: true
2626
},
2727
{

apps/laboratory/src/components/AppKitInfoMultiChain.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ export function AppKitInfoMultiChain({
1818
)
1919
const solanaAdapter = config?.adapters?.find(adapter => adapter === 'solana')
2020
const bitcoinAdapter = config?.adapters?.find(adapter => adapter === 'bitcoin')
21+
const tonAdapter = config?.adapters?.find(adapter => adapter === 'ton')
22+
const tronAdapter = config?.adapters?.find(adapter => adapter === 'tron')
2123

2224
const currentAccount = useAppKitAccount()
2325
const evmAccount = useAppKitAccount({ namespace: 'eip155' })
2426
const solanaAccount = useAppKitAccount({ namespace: 'solana' })
2527
const bitcoinAccount = useAppKitAccount({ namespace: 'bip122' })
28+
const tonAccount = useAppKitAccount({ namespace: 'ton' })
29+
const tronAccount = useAppKitAccount({ namespace: 'tron' })
2630

2731
return (
2832
<>
@@ -35,6 +39,8 @@ export function AppKitInfoMultiChain({
3539
{evmAdapter && <AccountCard account={evmAccount} namespace="eip155" />}
3640
{solanaAdapter && <AccountCard account={solanaAccount} namespace="solana" />}
3741
{bitcoinAdapter && <AccountCard account={bitcoinAccount} namespace="bip122" />}
42+
{tonAdapter && <AccountCard account={tonAccount} namespace="ton" />}
43+
{tronAdapter && <AccountCard account={tronAccount} namespace="tron" />}
3844
</Grid>
3945
<Grid templateColumns={{ base: 'repeat(1, 1fr)', md: 'repeat(2, 1fr)' }} gap={4}>
4046
<AccountCard account={currentAccount} />

apps/laboratory/src/constants/appKitConfigs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ export const appKitConfigs = {
385385
// ----- Custom Variants ------------------------------
386386
'siwx-default': {
387387
...commonAppKitConfig,
388-
adapters: ['ethers', 'solana', 'bitcoin'],
388+
adapters: ['ethers', 'solana', 'bitcoin', 'tron'],
389389
networks: ConstantsUtil.AllNetworks,
390390
siwx: new DefaultSIWX()
391391
},

apps/laboratory/tests/shared/pages/ModalPage.ts

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -924,30 +924,38 @@ export class ModalPage {
924924
}
925925

926926
async clickOpenWebApp() {
927-
let url = ''
928-
929927
const openButton = this.page.getByTestId('w3m-connecting-widget-secondary-button')
930928
await expect(openButton).toBeVisible()
931929
await expect(openButton).toHaveText('Open')
932930

933-
while (!url) {
934-
await openButton.click()
935-
await this.page.waitForTimeout(500)
936-
937-
const pages = this.page.context().pages()
938-
939-
// Check if more than 1 tab is open
940-
if (pages.length > 1) {
941-
const lastTab = pages[pages.length - 1]
942-
943-
if (lastTab) {
944-
url = lastTab.url()
945-
break
946-
}
931+
/*
932+
* Patch window.open to capture the URL synchronously at the moment AppKit
933+
* calls it. Reading lastTab.url() after the click races against external
934+
* redirects (e.g. some wallets' webapp_link points to chromewebstore.google.com
935+
* which immediately redirects to a Google consent page, dropping the ?uri= param).
936+
*/
937+
await this.page.evaluate(() => {
938+
const original = window.open
939+
;(window as unknown as { __capturedOpenUrl: string }).__capturedOpenUrl = ''
940+
window.open = function open(...args: Parameters<typeof window.open>) {
941+
;(window as unknown as { __capturedOpenUrl: string }).__capturedOpenUrl = String(
942+
args[0] ?? ''
943+
)
944+
945+
return original.apply(this, args)
947946
}
948-
}
947+
})
949948

950-
return url
949+
await openButton.click()
950+
await this.page.waitForFunction(
951+
() => (window as unknown as { __capturedOpenUrl: string }).__capturedOpenUrl !== '',
952+
undefined,
953+
{ timeout: 10_000 }
954+
)
955+
956+
return this.page.evaluate(
957+
() => (window as unknown as { __capturedOpenUrl: string }).__capturedOpenUrl
958+
)
951959
}
952960

953961
async search(value: string) {

apps/laboratory/tests/shared/validators/ModalValidator.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,22 @@ export class ModalValidator {
310310

311311
async expectOpenButton({ disabled }: { disabled: boolean }) {
312312
const secondaryButton = this.page.getByTestId('w3m-connecting-widget-secondary-button')
313-
if (disabled) {
314-
await expect(secondaryButton).toHaveAttribute('disabled')
315-
} else {
316-
await expect(secondaryButton).not.toHaveAttribute('disabled')
317-
}
313+
314+
await expect
315+
.poll(
316+
() =>
317+
secondaryButton.evaluate((el: Element) => {
318+
const btn = el.shadowRoot?.querySelector('button') as HTMLButtonElement | null
319+
if (btn) {
320+
return btn.disabled
321+
}
322+
const attr = el.getAttribute('disabled')
323+
324+
return attr !== null && attr !== 'false'
325+
}),
326+
{ timeout: 60000 }
327+
)
328+
.toBe(disabled)
318329
}
319330

320331
async expectTryAgainButton() {

examples/html-headless/index.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>AppKit Headless (vanilla) Example</title>
7+
<link rel="stylesheet" href="/src/main.css" />
8+
</head>
9+
<body>
10+
<main class="page">
11+
<h1 class="title">AppKit Headless — vanilla JS</h1>
12+
<p class="subtitle">
13+
A custom wallet modal driven entirely by the imperative AppKit client API (<code
14+
>appKit.fetchWallets</code
15+
>
16+
/ <code>getWalletList</code> / <code>subscribeWalletList</code> /
17+
<code>connectWallet</code>) — no React, no AppKit modal.
18+
</p>
19+
20+
<!-- Connected account -->
21+
<section id="account" class="account" hidden>
22+
<span id="account-address" class="account__address"></span>
23+
<button id="disconnect" class="btn btn--outline">Disconnect</button>
24+
</section>
25+
26+
<!-- Open the custom wallet modal -->
27+
<button id="open" class="btn">Connect wallet</button>
28+
29+
<!-- Custom headless wallet modal -->
30+
<div id="modal" class="modal" hidden>
31+
<div class="modal__backdrop" data-close></div>
32+
<div class="modal__card">
33+
<div class="modal__header">
34+
<h2>Select a wallet</h2>
35+
<button class="modal__close" data-close>&times;</button>
36+
</div>
37+
<!-- Wallet list with infinite loading -->
38+
<div id="wallet-list" class="wallet-list"></div>
39+
<p id="list-status" class="wallet-list__status"></p>
40+
</div>
41+
</div>
42+
</main>
43+
44+
<script type="module" src="/src/main.js"></script>
45+
</body>
46+
</html>

0 commit comments

Comments
 (0)