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.
@ckb-ccc/lumos-patches adds lock script support for JoyID, Nostr (NostrLock), and Portal (PWLock) wallets to the Lumos SDK. If you have an existing Lumos-based application and want to support these wallets without migrating to CCC, apply these patches.
For new projects, CCC natively supports all these wallets. Use
@ckb-ccc/lumos-patches only when you already depend on Lumos and cannot
migrate.Installation
Exports
| Export | Description |
|---|---|
generateDefaultScriptInfos | Returns LockScriptInfo[] for JoyID, Nostr, and Portal on both mainnet and testnet |
generateScriptInfo | Build a custom LockScriptInfo for any code hash |
Applying the patches
CallgenerateDefaultScriptInfos() and register the result with Lumos before composing any transactions:
| Script | Wallet | Dummy lock length |
|---|---|---|
JoyId | JoyID (passkey) | 1000 bytes |
NostrLock | Nostr NIP-07 wallets | 572 bytes |
PWLock | Portal Wallet | 65 bytes |
Custom script info
If you need to add a different custom lock, usegenerateScriptInfo directly:
How it works
generateDefaultScriptInfos returns a LockScriptInfo for each supported script on both mainnet and testnet. Each info object:
- Provides a
CellCollectorthat filters cells matching the lock’s code hash. - Implements
setupInputCellto add the correct cell deps and a dummy witness of the right size (used by Lumos for fee estimation).
@ckb-ccc/core’s built-in MAINNET_SCRIPTS and TESTNET_SCRIPTS constants, so you don’t need to hardcode any hashes.