@ckb-ccc/lumos-patches bridges Lumos and CCC. If you already use Lumos to compose CKB transactions but want your users to sign with JoyID, Nostr, or Portal wallets, apply these patches before using any Lumos APIs.
You do not need this package if you are building a new application. Use
@ckb-ccc/connector-react or @ckb-ccc/shell instead for full CCC support.Who needs it
Install@ckb-ccc/lumos-patches if you have an existing Lumos-based codebase and want to:
- Sign transactions with JoyID (no
@ckb-lumos/joyidrequired). - Sign transactions with Nostr wallets.
- Sign transactions with Portal wallet.
Installation
- npm
- yarn
- pnpm
Applying the patches
CallgenerateDefaultScriptInfos() and pass the result to Lumos’ registerCustomLockScriptInfos before you use any Lumos transaction-building functions.
generateDefaultScriptInfos
Returns an array ofLockScriptInfo objects that teach Lumos how to collect cells and prepare witnesses for JoyID, Nostr, and PWLock scripts on both mainnet and testnet.
Each script info covers both mainnet and testnet code hashes, so the same call works for both networks.
generateScriptInfo
If you need to patch in a custom lock script beyond the defaults, use the lower-levelgenerateScriptInfo function: