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: {
5757 let client : ThirdwebClient | undefined ;
5858 let authToken : string | null = null ;
5959
60- const resolveSmartAccountOptionsFromEcosystem = async ( options : {
60+ const resolveSmartAccountOptionsFromEcosystem = async ( options ? : {
6161 chain ?: Chain ;
6262 } ) => {
6363 if ( ecosystem ) {
@@ -78,7 +78,7 @@ export function createInAppWallet(args: {
7878 // default to 4337
7979 const { defaultChainId } = ecosystemOptions . smartAccountOptions ;
8080 const preferredChain =
81- options . chain ??
81+ options ? .chain ??
8282 ( defaultChainId ? getCachedChain ( defaultChainId ) : undefined ) ;
8383 if ( ! preferredChain ) {
8484 throw new Error (
@@ -108,7 +108,7 @@ export function createInAppWallet(args: {
108108 ecosystem ,
109109 ) ;
110110
111- await resolveSmartAccountOptionsFromEcosystem ( options ) ;
111+ await resolveSmartAccountOptionsFromEcosystem ( ) ;
112112
113113 const {
114114 account : connectedAccount ,
@@ -145,7 +145,7 @@ export function createInAppWallet(args: {
145145 ecosystem ,
146146 ) ;
147147
148- await resolveSmartAccountOptionsFromEcosystem ( options ) ;
148+ await resolveSmartAccountOptionsFromEcosystem ( ) ;
149149
150150 const {
151151 account : connectedAccount ,
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export async function connectSmartAccount(
8080 connectionOptions : SmartWalletConnectionOptions ,
8181 creationOptions : SmartWalletOptions ,
8282) : Promise < [ Account , Chain ] > {
83- const { personalAccount, client, chain : connectChain } = connectionOptions ;
83+ const { personalAccount, client } = connectionOptions ;
8484
8585 if ( ! personalAccount ) {
8686 throw new Error (
@@ -89,7 +89,7 @@ export async function connectSmartAccount(
8989 }
9090
9191 const options = creationOptions ;
92- const chain = connectChain ?? options . chain ;
92+ const chain = creationOptions . chain ;
9393 const sponsorGas =
9494 "gasless" in options ? options . gasless : options . sponsorGas ;
9595 if ( await isZkSyncChain ( chain ) ) {
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ export function smartWallet(
229229 const { connectSmartAccount } = await import ( "./index.js" ) ;
230230 const [ connectedAccount , connectedChain ] = await connectSmartAccount (
231231 { ...lastConnectOptions , chain : newChain } ,
232- createOptions ,
232+ { ... createOptions , chain : newChain } ,
233233 ) ;
234234 // set the states
235235 account = connectedAccount ;
You can’t perform that action at this time.
0 commit comments