Skip to content

Commit 6a0704a

Browse files
Connect to current wallet chain when connecting other wallets in PayEmbed (#6621)
1 parent 2ef8f2a commit 6a0704a

File tree

8 files changed

+211
-151
lines changed

8 files changed

+211
-151
lines changed

.changeset/funny-months-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Connect to current wallet chain when connecting other wallets in PayEmbed

apps/dashboard/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
"eslint": "8.57.0",
136136
"eslint-config-biome": "1.9.4",
137137
"eslint-plugin-react-compiler": "19.0.0-beta-40c6c23-20250301",
138-
"eslint-plugin-storybook": "0.11.6",
138+
"eslint-plugin-storybook": "0.12.0",
139139
"knip": "5.46.0",
140140
"next-sitemap": "^4.2.3",
141141
"postcss": "8.5.3",

apps/playground-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"typecheck": "tsc --noEmit"
1515
},
1616
"dependencies": {
17-
"@abstract-foundation/agw-client": "^1.4.2",
17+
"@abstract-foundation/agw-client": "^1.6.2",
1818
"@abstract-foundation/agw-react": "^1.5.4",
1919
"@hookform/resolvers": "^3.9.1",
2020
"@radix-ui/react-accordion": "^1.2.3",

packages/thirdweb/.size-limit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
"name": "thirdweb (cjs)",
1010
"path": "./dist/cjs/exports/thirdweb.js",
11-
"limit": "131 kB"
11+
"limit": "135 kB"
1212
},
1313
{
1414
"name": "thirdweb (minimal + tree-shaking)",

packages/thirdweb/package.json

Lines changed: 23 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -137,66 +137,26 @@
137137
},
138138
"typesVersions": {
139139
"*": {
140-
"adapters/*": [
141-
"./dist/types/exports/adapters/*.d.ts"
142-
],
143-
"auth": [
144-
"./dist/types/exports/auth.d.ts"
145-
],
146-
"chains": [
147-
"./dist/types/exports/chains.d.ts"
148-
],
149-
"contract": [
150-
"./dist/types/exports/contract.d.ts"
151-
],
152-
"deploys": [
153-
"./dist/types/exports/deploys.d.ts"
154-
],
155-
"event": [
156-
"./dist/types/exports/event.d.ts"
157-
],
158-
"extensions/*": [
159-
"./dist/types/exports/extensions/*.d.ts"
160-
],
161-
"pay": [
162-
"./dist/types/exports/pay.d.ts"
163-
],
164-
"react": [
165-
"./dist/types/exports/react.d.ts"
166-
],
167-
"react-native": [
168-
"./dist/types/exports/react-native.d.ts"
169-
],
170-
"rpc": [
171-
"./dist/types/exports/rpc.d.ts"
172-
],
173-
"storage": [
174-
"./dist/types/exports/storage.d.ts"
175-
],
176-
"transaction": [
177-
"./dist/types/exports/transaction.d.ts"
178-
],
179-
"utils": [
180-
"./dist/types/exports/utils.d.ts"
181-
],
182-
"wallets": [
183-
"./dist/types/exports/wallets.d.ts"
184-
],
185-
"wallets/*": [
186-
"./dist/types/exports/wallets/*.d.ts"
187-
],
188-
"modules": [
189-
"./dist/types/exports/modules.d.ts"
190-
],
191-
"social": [
192-
"./dist/types/exports/social.d.ts"
193-
],
194-
"ai": [
195-
"./dist/types/exports/ai.d.ts"
196-
],
197-
"bridge": [
198-
"./dist/types/exports/bridge.d.ts"
199-
]
140+
"adapters/*": ["./dist/types/exports/adapters/*.d.ts"],
141+
"auth": ["./dist/types/exports/auth.d.ts"],
142+
"chains": ["./dist/types/exports/chains.d.ts"],
143+
"contract": ["./dist/types/exports/contract.d.ts"],
144+
"deploys": ["./dist/types/exports/deploys.d.ts"],
145+
"event": ["./dist/types/exports/event.d.ts"],
146+
"extensions/*": ["./dist/types/exports/extensions/*.d.ts"],
147+
"pay": ["./dist/types/exports/pay.d.ts"],
148+
"react": ["./dist/types/exports/react.d.ts"],
149+
"react-native": ["./dist/types/exports/react-native.d.ts"],
150+
"rpc": ["./dist/types/exports/rpc.d.ts"],
151+
"storage": ["./dist/types/exports/storage.d.ts"],
152+
"transaction": ["./dist/types/exports/transaction.d.ts"],
153+
"utils": ["./dist/types/exports/utils.d.ts"],
154+
"wallets": ["./dist/types/exports/wallets.d.ts"],
155+
"wallets/*": ["./dist/types/exports/wallets/*.d.ts"],
156+
"modules": ["./dist/types/exports/modules.d.ts"],
157+
"social": ["./dist/types/exports/social.d.ts"],
158+
"ai": ["./dist/types/exports/ai.d.ts"],
159+
"bridge": ["./dist/types/exports/bridge.d.ts"]
200160
}
201161
},
202162
"browser": {
@@ -235,11 +195,11 @@
235195
"mipd": "0.0.7",
236196
"open": "10.1.0",
237197
"ora": "8.2.0",
238-
"ox": "0.6.10",
198+
"ox": "0.6.11",
239199
"prompts": "2.4.2",
240200
"toml": "3.0.0",
241201
"uqr": "0.1.2",
242-
"viem": "2.23.10"
202+
"viem": "2.24.2"
243203
},
244204
"peerDependencies": {
245205
"@aws-sdk/client-lambda": "^3",
@@ -391,7 +351,7 @@
391351
"typedoc": "0.27.9",
392352
"typedoc-better-json": "0.9.4",
393353
"typescript": "5.8.2",
394-
"vite": "6.2.1",
354+
"vite": "6.2.4",
395355
"vitest": "3.0.9"
396356
}
397357
}

packages/thirdweb/src/adapters/viem-legacy.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe("walletClient.toViem", () => {
153153
[UnknownRpcError: An unknown RPC error occurred.
154154
155155
Details: Can't switch chains because only an account was passed to 'viemAdapter.walletClient.toViem()', please pass a connected wallet instance instead.
156-
Version: viem@2.23.10]
156+
Version: viem@2.24.2]
157157
`);
158158
});
159159
});

packages/thirdweb/src/react/web/ui/ConnectWallet/screens/WalletSwitcherConnectionScreen.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { Wallet } from "../../../../../wallets/interfaces/wallet.js";
55
import type { SmartWalletOptions } from "../../../../../wallets/smart/types.js";
66
import type { AppMetadata } from "../../../../../wallets/types.js";
77
import type { WalletId } from "../../../../../wallets/wallet-types.js";
8+
import { useActiveWalletChain } from "../../../../core/hooks/wallets/useActiveWalletChain.js";
89
import { useConnectedWallets } from "../../../../core/hooks/wallets/useConnectedWallets.js";
910
import { ConnectModalContent } from "../Modal/ConnectModalContent.js";
1011
import { useSetupScreen } from "../Modal/screen.js";
@@ -34,6 +35,7 @@ export type WalletSwitcherConnectionScreenProps = {
3435
export function WalletSwitcherConnectionScreen(
3536
props: WalletSwitcherConnectionScreenProps,
3637
) {
38+
const walletChain = useActiveWalletChain();
3739
const connectedWallets = useConnectedWallets();
3840
const wallets =
3941
props.wallets ||
@@ -52,7 +54,7 @@ export function WalletSwitcherConnectionScreen(
5254
<ConnectModalContent
5355
accountAbstraction={props.accountAbstraction}
5456
auth={undefined}
55-
chain={props.chain}
57+
chain={props.chain || walletChain}
5658
chains={props.chains}
5759
client={props.client}
5860
connectLocale={props.connectLocale}

0 commit comments

Comments
 (0)