CKB Pulse

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)

Mais sobre CCC (TypeScript SDK)

Ver as 33 deste tema

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.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.