Expose some commonly used Hooks that you can use independently or in conjunction with components.
Connect or disconnect the wallet. Usually, you don't need to use this Hook directly, but use the Connector component. This Hook is used when you need to connect or disconnect the wallet in custom components or event triggers.
The following example simulates the connection through Web3ConfigProvider
. Usually, your application will use adapter, so you don't need to do this like the example, but use useConnection
directly.
Property | Description | Type |
---|---|---|
connect | Connect | UniversalWeb3ProviderInterface["connect"] |
disconnect | Disconnect | UniversalWeb3ProviderInterface["disconnect"] |
Used to retrieve the account address of the current user.
Property | Description | Type |
---|---|---|
account | Represents the web3 account address of the current user. | Account |
Convenient access to NFT metadata.
Property | Description | Type |
---|---|---|
loading | Indicate whether the NFT metadata is currently being loaded. | boolean |
metadata | An object containing metadata associated with the specified NFT. | NFTMetadata |
error | When an error occurs during the process of fetching metadata, the error property stores the error object. | Error |
Property | Description | Type |
---|---|---|
address | Required. NFT contract address. | string |
tokenId | Required. NFT token ID. | bigint | number |
Not Connected