Hooks
React hooks allow for more customizable Web3 experiences with the Comet SDK.
Last updated
React hooks allow for more customizable Web3 experiences with the Comet SDK.
Last updated
Comet React hooks will not work unless they are used in components wrapped with a CometProvider
. See the CometProvider
page for details.
Use the useAccount
hook to grab the current user's information, including username and Solana address.
Use the useMint
hook to bring up the mint dialog for your customers, where they can confirm the transaction and pay via credit card if needed.
Use the useSignMessage
hook to sign any message using the customer's Comet wallet.
Use the useSignTransaction
hook to partially sign a Solana Web3 transaction using the customer's Comet wallet. The customer will be asked to confirm signing.
Use the useGetSharedSecret
hook to perform ECDH with the customer's private key and another public key.