Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Use findCellsOnChain for shared live statePráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
client.findCells merges results from the client's local cache, which can still hold outputs of your own earlier transactions after other parties spent them on chain. When you need the true live cell set, such as state shared with other actors or runners, use client.findCellsOnChain.
Porque importa: With findCells, a builder can pick up the signer's own earlier outputs that other parties already spent on chain, so it builds transactions over stale cells next to the live ones and they fail or misread state.
Medium confidence.
Padrão
client.findCells({script, scriptType, ...}) used to read shared on-chain state → client.findCellsOnChain({...})- Conceitos
- Indexer queries and cell collection
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-15
- Última mudança
- 2026-11-15
- Última verificação
- 2026-11-19
- 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-15 · psawyerberlin/ckb-revocable-timelock · mais deste projeto
Mais sobre CCC (TypeScript SDK)
- CCC EVM signer exposes several lock addresses via getAddressObjs
- Use findCellsOnChain, not findCells, for block range queries in CCC
- Clear the CCC client cache after a sent transaction loses a double spend race
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Use findCellsOnChain for shared live state", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/use-findcellsonchain-for-shared-live-state, CC BY 4.0, last changed 2026-11-15.