All lessons · CCC (TypeScript SDK) · Start here · Glossary
completeInputsAddOne may pick an input from any of a multi-address signer's addressesWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-23
In CCC, tx.completeInputsAddOne(signer) searches across all addresses returned by signer.getAddressObjs(). If a lock script authorizes a spend by requiring an input locked to one specific address, the added input can come from a different address: the transaction still signs, but the lock rejects it on chain. Pick the matching address from getAddressObjs() yourself and add a cell found with client.findCellsOnChain using that exact lock script.
Why it matters: A lock that authorizes by the presence of an input from one specific address can be handed an input from another of the signer's addresses, so the transaction signs locally but is rejected on chain.
No existing lesson covers completeInputsAddOne choosing inputs from any of a multi-address signer's locks.
Pattern
await tx.completeInputsAddOne(signer);Taken from the commit, shortened.
- Concepts
- Transaction building and fees, Indexer queries and cell collection
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-20
- Last changed
- 2026-11-20
- Last checked
- 2026-11-23
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-11-20 · salmansarwarr/Tranfr · more from this project
More about CCC (TypeScript SDK)
- Clear the CCC client cache after a sent transaction loses a double spend race
- Deriving minimum cell capacity with ccc.CellOutput.from and output data
- Parsing snake_case JSON-RPC transactions in CCC
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "completeInputsAddOne may pick an input from any of a multi-address signer's addresses", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/completeinputsaddone-may-pick-an-input-from-any-of-a-multi-a, CC BY 4.0, last changed 2026-11-20.