A Signer is an abstract class that represents a connected wallet. It provides a unified interface for interacting with wallets from different blockchain ecosystems — EVM wallets, Bitcoin wallets, CKB native wallets, Nostr keys, and more — all through the same API.
// From packages/core/src/signer/signer/index.tsexport abstract class Signer { constructor(protected client_: Client) {} abstract get type(): SignerType; abstract get signType(): SignerSignType; get client(): Client { return this.client_; }}
Signers are not created directly. They are obtained from wallet connectors (e.g., useCcc() in the React connector, or SignersController).
// Connect to the walletabstract connect(): Promise<void>;// Disconnect from the walletasync disconnect(): Promise<void>;// Check whether the signer is currently connectedabstract isConnected(): Promise<boolean>;
// Get the wallet's internal (native) address stringabstract getInternalAddress(): Promise<string>;// Get the recommended CKB address as a stringasync getRecommendedAddress(preference?: unknown): Promise<string>;// Get all CKB addresses as stringsasync getAddresses(): Promise<string[]>;// Get all Address objects (includes the associated Script)abstract getAddressObjs(): Promise<Address[]>;// Get the recommended Address objectasync getRecommendedAddressObj(_preference?: unknown): Promise<Address>;
// From packages/core/src/signer/signer/index.tsexport class Signature { constructor( public signature: string, // The raw signature bytes as a hex string public identity: string, // The signer's identity (usually their address) public signType: SignerSignType, ) {}}
// From packages/core/src/signer/signer/index.tsexport type NetworkPreference = { addressPrefix: string; // "ckb" for mainnet, "ckt" for testnet signerType: SignerType; network: string; // e.g. "btc", "btcTestnet", "btcSignet"};