File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed
packages/thirdweb/src/wallets Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Fix ecosystem wallet connection with default chains
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ export function createInAppWallet(args: {
57
57
let client : ThirdwebClient | undefined ;
58
58
let authToken : string | null = null ;
59
59
60
- const resolveSmartAccountOptionsFromEcosystem = async ( options : {
60
+ const resolveSmartAccountOptionsFromEcosystem = async ( options ? : {
61
61
chain ?: Chain ;
62
62
} ) => {
63
63
if ( ecosystem ) {
@@ -78,7 +78,7 @@ export function createInAppWallet(args: {
78
78
// default to 4337
79
79
const { defaultChainId } = ecosystemOptions . smartAccountOptions ;
80
80
const preferredChain =
81
- options . chain ??
81
+ options ? .chain ??
82
82
( defaultChainId ? getCachedChain ( defaultChainId ) : undefined ) ;
83
83
if ( ! preferredChain ) {
84
84
throw new Error (
@@ -108,7 +108,7 @@ export function createInAppWallet(args: {
108
108
ecosystem ,
109
109
) ;
110
110
111
- await resolveSmartAccountOptionsFromEcosystem ( options ) ;
111
+ await resolveSmartAccountOptionsFromEcosystem ( ) ;
112
112
113
113
const {
114
114
account : connectedAccount ,
@@ -145,7 +145,7 @@ export function createInAppWallet(args: {
145
145
ecosystem ,
146
146
) ;
147
147
148
- await resolveSmartAccountOptionsFromEcosystem ( options ) ;
148
+ await resolveSmartAccountOptionsFromEcosystem ( ) ;
149
149
150
150
const {
151
151
account : connectedAccount ,
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export async function connectSmartAccount(
80
80
connectionOptions : SmartWalletConnectionOptions ,
81
81
creationOptions : SmartWalletOptions ,
82
82
) : Promise < [ Account , Chain ] > {
83
- const { personalAccount, client, chain : connectChain } = connectionOptions ;
83
+ const { personalAccount, client } = connectionOptions ;
84
84
85
85
if ( ! personalAccount ) {
86
86
throw new Error (
@@ -89,7 +89,7 @@ export async function connectSmartAccount(
89
89
}
90
90
91
91
const options = creationOptions ;
92
- const chain = connectChain ?? options . chain ;
92
+ const chain = creationOptions . chain ;
93
93
const sponsorGas =
94
94
"gasless" in options ? options . gasless : options . sponsorGas ;
95
95
if ( await isZkSyncChain ( chain ) ) {
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ export function smartWallet(
229
229
const { connectSmartAccount } = await import ( "./index.js" ) ;
230
230
const [ connectedAccount , connectedChain ] = await connectSmartAccount (
231
231
{ ...lastConnectOptions , chain : newChain } ,
232
- createOptions ,
232
+ { ... createOptions , chain : newChain } ,
233
233
) ;
234
234
// set the states
235
235
account = connectedAccount ;
You can’t perform that action at this time.
0 commit comments