Appearance
Documentation / react-auth / ConnectorManager
Class: ConnectorManager
Extends
EventEmitter
<ConnectorManagerEvents
>
Constructors
new ConnectorManager(privyAppId, walletConnectCloudProjectId, rpcConfig, chains, defaultChain, store, walletList, shouldEnforceDefaultChainOnConnect, privyAppName)
new ConnectorManager(
privyAppId
,walletConnectCloudProjectId
,rpcConfig
,chains
,defaultChain
,store
,walletList
,shouldEnforceDefaultChainOnConnect
,privyAppName
):ConnectorManager
Parameters
• privyAppId: string
• walletConnectCloudProjectId: string
• rpcConfig: RpcConfig
• chains: Chain
[]
• defaultChain: Chain
• store: Store
• walletList: WalletListEntry
[]
• shouldEnforceDefaultChainOnConnect: boolean
• privyAppName: string
Returns
Overrides
EventEmitter<ConnectorManagerEvents>.constructor
Properties
activeWallet?
private
activeWallet?:string
chains
private
chains:Chain
[]
defaultChain
private
defaultChain:Chain
initialized
initialized:
boolean
privyAppId
private
privyAppId:string
privyAppName
private
privyAppName:string
rpcConfig
private
rpcConfig:RpcConfig
shouldEnforceDefaultChainOnConnect
private
shouldEnforceDefaultChainOnConnect:boolean
store
private
store:Store
storedConnections
private
storedConnections:StoredConnection
[]
walletConnectCloudProjectId
private
walletConnectCloudProjectId:string
walletConnectors
walletConnectors:
WalletConnector
[]
walletList
private
walletList:WalletListEntry
[]
Accessors
wallets
get
wallets():BaseConnectedWallet
[]
The core wallets array that is exposed to developers. It builds the wallets away with the following logic:
- Flatten all wallets from all connectors
- Sorted by connectedAt
- Active wallet is moved to front of array (if it exists)
Returns
BaseConnectedWallet
[]
Methods
activeWalletSign()
activeWalletSign(
message
):Promise
<null
|string
>
Parameters
• message: string
Returns
Promise
<null
| string
>
Deprecated
Deprecated: This feature will be removed and should be replaced by interfacing with wallets
directly.
Performing personal_sign with the most recently connected wallet. If there is not a wallet connected, return null.
createWalletConnector()
createWalletConnector(
connectorType
,walletClientType
,providers
?):Promise
<null
|WalletConnector
>
Creates a new wallet connector for the given connector type and wallet client type. If a connector already exists, it will be returned instead.
Parameters
• connectorType: string
• walletClientType: string
• providers?: Object
• providers.eip6963InjectedProvider?: EIP6963ProviderDetail
<EIP1193Provider
, "com.coinbase"
| "com.enkrypt"
| "io.metamask"
| "io.zerion"
| string
& Object
>
• providers.legacyInjectedProvider?: any
Returns
Promise
<null
| WalletConnector
>
findWalletConnector()
findWalletConnector(
connectorType
,walletClientType
):null
|WalletConnector
Helper function to find a wallet connector by connector type and wallet client type.
Parameters
• connectorType: string
• walletClientType: string
Returns
null
| WalletConnector
getEthereumProvider()
getEthereumProvider():
EIP1193Provider
Returns
Deprecated
Deprecated: This feature will be removed and should be replaced by interfacing with wallets directly (wallets[0].getEthereumProvider()).
Build an Ethereum provider for the most recently connected wallet.
setActiveWallet()
setActiveWallet(
address
):void
Parameters
• address: string
Returns
void
Deprecated
Deprecated: This feature will be removed and should be replaced by interfacing with wallets
directly.