Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Use getCellLive, not getCell, when a cell's current state matters in CCCPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 2026-11-19
In CCC, client.getCell(outPoint) can also return a cell that has already been spent, so status checks built on it report claimed or reclaimed cells as still active. Use client.getCellLive(outPoint, true) and treat an undefined result as "not found or already spent".
Porque importa: A status check built on getCell reports a cell that was already claimed or reclaimed as still active, because getCell also returns spent cells.
Padrão
const cell = await this.client.getCellLive(cellOutPoint, true);Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- salmansarwarr/Tranfr:
sdk/tests/client.test.ts
- Conceitos
- Indexer queries and cell collection
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-10-20
- Última mudança
- 2026-10-20
- Ú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-10-20 · salmansarwarr/Tranfr · 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 getCellLive, not getCell, when a cell's current state matters in CCC", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/use-getcelllive-not-getcell-when-a-cell-s-current-state-matt, CC BY 4.0, last changed 2026-10-20.