⚙️
Comet SDK Docs
  • Welcome to the Comet SDK!
  • Getting Started
  • Project Guides
    • Launch and mint your first NFT collection
  • Reference
    • Comet SDK Reference
      • Comet REST API
        • Collections
        • Airdrops
        • Gallery
        • Usage
      • Comet React SDK
        • Getting started
        • Components
        • Hooks
          • useAccount
          • useMint
          • useSignMessage
          • useSignTransaction
          • useGetSharedSecret
Powered by GitBook
On this page
  • Getting the logged-in account
  • Starting the mint process
  • Signing arbitrary messages
  • Signing Solana transactions
  • [Advanced] Diffie-Hellman key exchange
  1. Reference
  2. Comet SDK Reference
  3. Comet React SDK

Hooks

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

PreviousComponentsNextuseAccount

Last updated 2 years ago

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

Getting the logged-in account

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

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.

Signing arbitrary messages

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

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.

[Advanced] Diffie-Hellman key exchange

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

useGetSharedSecret
useAccount
useMint
useSignMessage
useSignTransaction
CometProvider page