Composables
Composables are functions that will help you control the modal, subscribe to wallet events and interact with them and smart contracts.
useAppKit
Composable function for controlling the modal.
Returns
open
: Function to open the modalclose
: Function to close the modal
Parameters
You can also select the modal’s view when calling the open
function
List of views you can select
useAppKitAccount
Composable function for accessing account data and connection status.
Composable function for accessing account data and connection status for each namespace when working in a multi-chain environment.
Returns
accountData.value.address
: The current account addressaccountData.value.caipAddress
: The current account address in CAIP formataccountData.value.isConnected
: Boolean that indicates if the user is connectedaccountData.value.status
: The current connection status
useAppKitNetwork
Composable function for accessing network data and methods.
Returns
networkData.caipNetwork
: The current network objectnetworkData.caipNetworkId
: The current network id in CAIP formatnetworkData.chainId
: The current chain idnetworkData.switchNetwork
: Function to switch the network. Accepts acaipNetwork
object as argument.
switchNetwork Usage
See how to import or create a networks here.
useAppKitState
Composable function for getting the current value of the modal’s state.
Returns
stateData.open
: Boolean that indicates if the modal is openstateData.selectedNetworkId
: The current chain id selected by the user
useAppKitTheme
Composable function for controlling the modal’s theme.
Returns
themeAction.themeMode
: Get theme Mode.themeAction.themeVariables
: Get theme variables.themeAction.setThemeMode
: Set theme Mode. Accepts a string as parameter (‘dark’ | ‘light’)themeAction.setThemeVariables
: Set theme variables. Check the example usage.
Example Usage
useAppKitEvents
Composable function for subscribing to modal events.
Returns
events.timestamp
: Get the timestamp of the eventevents.data.event
: Get string of the event.events.data.properties
: get more information from the event.
useDisconnect
Composable function for disconnecting the session.
useWalletInfo
Composable function for accessing wallet information.
Ethereum/Solana Library
You can use Wagmi actions to sign messages, interact with smart contracts, and much more.
getAccount
Action for accessing account data and connection status.
signMessage
Action for signing messages with connected account.
Learn More
You can use Wagmi actions to sign messages, interact with smart contracts, and much more.
getAccount
Action for accessing account data and connection status.
signMessage
Action for signing messages with connected account.
Learn More
useAppKitAccount
Hook that returns the client’s information.
switchNetwork
useAppKitProvider
Hook that returns the walletProvider
and the WalletProviderType
.
getError
Learn More About Ethers
useAppKitAccount
Hook that returns the client’s information.
switchNetwork
useAppKitProvider
Hook that returns the walletProvider
and the WalletProviderType
.
getError
Learn More About Ethers
useAppKitAccount
Hook that returns the client’s information.
useAppKitProvider
Hook that returns the walletProvider
and the WalletProviderType
.
useAppKitConnection
Hook that returns the connection object. More info about Connection Class
Was this page helpful?