Skip to main content
A Signer represents a connected wallet. It hides the differences between wallet implementations — browser extensions, mobile apps, hardware devices — behind a single interface. You use a signer to get addresses, check balances, sign messages, and submit transactions.

Signer types

CCC supports wallets from multiple ecosystems. The SignerType enum identifies which ecosystem a signer belongs to: Each signer type produces a valid CKB address using a lock script that corresponds to its native signing algorithm (secp256k1, EVM personal sign, BTC ECDSA, etc.).

Connect and disconnect

connect() is async and may throw if the user rejects the connection request. Always await it before calling any other method.

Get addresses

A signer can control more than one address (e.g. a BTC wallet with multiple account derivation paths). getRecommendedAddress returns the primary one as a string:
Use getAddresses to retrieve all controlled addresses:
Use getRecommendedAddressObj when you need the underlying Address object (which carries the lock script):

Check balance

getBalance returns the total CKB capacity across all controlled addresses, in shannons (1 CKB = 10⁸ shannons):

Sign messages

Sign an arbitrary message and receive a structured Signature object:
Verify a signature without knowing which signer type was used:
You can also verify statically:

Sign and send transactions

Build a transaction, then hand it to the signer. sendTransaction signs and broadcasts in one step:
If you need the signed transaction object before broadcasting (e.g. to inspect witnesses), use signTransaction:

Find cells and transactions

A signer exposes the same search helpers as Client, but scoped to the signer’s own addresses:

Access the underlying client

Every signer holds a reference to the Client it was created with:

Network preferences

When the UI needs to enforce a particular network, pass a NetworkPreference array to matchNetworkPreference. The signer returns the preferred entry when a switch is needed, or undefined when already on a compatible network:
In a dApp, obtain a Signer instance from a CCC connector component (React, Vue, etc.) rather than constructing one directly. The connector handles wallet discovery and network negotiation for you.