Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
completeInputsAddOne may pick an input from any of a multi-address signer's addressesPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
await tx.completeInputsAddOne(signer);Tirado do commit, encurtado.
- Conceitos
- Transaction building and fees, Indexer queries and cell collection
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-20
- Última mudança
- 2026-11-20
- Última verificação
- 2026-11-23
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-11-20 · salmansarwarr/Tranfr · mais deste projeto
Mais sobre 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
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.