File tree Expand file tree Collapse file tree 5 files changed +11
-7
lines changed
apps/portal/src/app/nebula/plugins/openai Expand file tree Collapse file tree 5 files changed +11
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " thirdweb " : patch
3
+ ---
4
+
5
+ Allow connecting wallets without setting them as active with useConnect
File renamed without changes.
Original file line number Diff line number Diff line change 3
3
import type React from "react" ;
4
4
import { createContext , useContext } from "react" ;
5
5
import type { ThirdwebClient } from "../../../client/client.js" ;
6
- import { isAddress } from "../../../utils/address.js" ;
7
6
/**
8
7
* Props for the <AccountProvider /> component
9
8
* @component
@@ -53,9 +52,6 @@ export function AccountProvider(
53
52
"AccountProvider: No address passed. Ensure an address is always provided to the AccountProvider" ,
54
53
) ;
55
54
}
56
- if ( ! isAddress ( props . address ) ) {
57
- throw new Error ( `AccountProvider: Invalid address: ${ props . address } ` ) ;
58
- }
59
55
return (
60
56
< AccountProviderContext . Provider value = { props } >
61
57
{ props . children }
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export function useWalletName(props: {
24
24
/**
25
25
* @internal Exported for tests only
26
26
*/
27
- function getQueryKeys ( props : {
27
+ export function getQueryKeys ( props : {
28
28
id : WalletId ;
29
29
formatFn ?: ( str : string ) => string ;
30
30
} ) {
@@ -41,7 +41,7 @@ function getQueryKeys(props: {
41
41
/**
42
42
* @internal Exported for tests only
43
43
*/
44
- async function fetchWalletName ( props : {
44
+ export async function fetchWalletName ( props : {
45
45
id : WalletId ;
46
46
formatFn ?: ( str : string ) => string ;
47
47
} ) {
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export type ConnectionManager = ReturnType<typeof createConnectionManager>;
24
24
export type ConnectManagerOptions = {
25
25
client : ThirdwebClient ;
26
26
accountAbstraction ?: SmartWalletOptions ;
27
+ setWalletAsActive ?: boolean ;
27
28
onConnect ?: ( wallet : Wallet ) => void ;
28
29
} ;
29
30
@@ -146,7 +147,9 @@ export function createConnectionManager(storage: AsyncStorage) {
146
147
// add personal wallet to connected wallets list even if it's not the active one
147
148
addConnectedWallet ( wallet ) ;
148
149
149
- handleSetActiveWallet ( activeWallet ) ;
150
+ if ( options ?. setWalletAsActive !== false ) {
151
+ handleSetActiveWallet ( activeWallet ) ;
152
+ }
150
153
151
154
wallet . subscribe ( "accountChanged" , async ( ) => {
152
155
// We reimplement connect here to prevent memory leaks
You can’t perform that action at this time.
0 commit comments