Hooks

React hooks allow for more customizable Web3 experiences with the Comet SDK.

circle-info

Comet React hooks will not work unless they are used in components wrapped with a CometProvider. See the CometProvider page for details.

Getting the logged-in account

Use the useAccount hook to grab the current user's information, including username and Solana address.

useAccountchevron-right

Starting the mint process

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.

useMintchevron-right

Signing arbitrary messages

Use the useSignMessage hook to sign any message using the customer's Comet wallet.

useSignMessagechevron-right

Signing Solana transactions

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.

useSignTransactionchevron-right

[Advanced] Diffie-Hellman key exchange

Use the useGetSharedSecret hook to perform ECDH with the customer's private key and another public key.

useGetSharedSecretchevron-right

Last updated