All lessons · CCC (TypeScript SDK) · Start here · Glossary
Use getCellLive, not getCell, when a cell's current state matters in CCCWorkingFrom one fix
From one fix · Check: right · Checked 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".
Why it matters: A status check built on getCell reports a cell that was already claimed or reclaimed as still active, because getCell also returns spent cells.
Pattern
const cell = await this.client.getCellLive(cellOutPoint, true);Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- salmansarwarr/Tranfr:
sdk/tests/client.test.ts
- Concepts
- Indexer queries and cell collection
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-20
- Last changed
- 2026-10-20
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-10-20 · salmansarwarr/Tranfr · more from this project
More about 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
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
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.