CKB Pulse

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

Avoid
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)

More about CCC (TypeScript SDK)

All 34 in this topic

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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.