Hooks

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

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.

pageuseAccount

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.

pageuseMint

Signing arbitrary messages

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

pageuseSignMessage

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.

pageuseSignTransaction

[Advanced] Diffie-Hellman key exchange

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

pageuseGetSharedSecret

Last updated