Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ckb-devrel/ccc/llms.txt
Use this file to discover all available pages before exploring further.
Create a new app
The fastest way to start is with Follow the prompts to select your framework template.
create-ccc-app, which scaffolds a new CCC-based application with your preferred framework:Or install manually
If you’re adding CCC to an existing React project, install the connector package directly:
Add the Provider to your app
Wrap your application with The
ccc.Provider. This mounts the wallet connector UI and makes the CCC context available to all child components.If you’re using React Server Components, add
"use client" at the top of any file that uses ccc.Provider.app.tsx
Provider accepts these props:| Prop | Type | Description |
|---|---|---|
name | string | Your app’s name, shown in the connector UI. |
icon | string | URL to your app’s icon. |
signerFilter | function | Filter which wallets are shown. |
defaultClient | ccc.Client | Override the default CKB client (testnet by default). |
preferredNetworks | ccc.NetworkPreference[] | Preferred networks for wallet connections. |
Connect a wallet with useCcc
Use the
useCcc hook inside any component wrapped by ccc.Provider to open the connector and get the active signer:component.tsx
useCcc returns:| Value | Type | Description |
|---|---|---|
open | () => void | Opens the wallet connector modal. |
close | () => void | Closes the connector modal. |
disconnect | () => void | Disconnects the active wallet. |
wallet | ccc.Wallet | undefined | The connected wallet, if any. |
signerInfo | ccc.SignerInfo | undefined | The active signer info, if connected. |
client | ccc.Client | The active CKB client. |
Compose and send a transaction
Once connected, you can compose and send a transaction. CCC fills in the inputs and calculates the fee automatically:The three key steps are:
transfer.ts
completeInputsByCapacity(signer)— finds and adds input cells to cover your outputs.completeFeeBy(signer)— calculates the fee and adjusts inputs accordingly.signer.sendTransaction(tx)— signs and broadcasts the transaction, returning its hash.
What’s next
- Read the Installation page for all package options and TypeScript configuration.
- Explore the CCC Playground to run examples interactively in your browser.
- See the full API reference for all available types and methods.