CKB Pulse

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

Prefer
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.

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)

More about CCC (TypeScript SDK)

All 33 in this topic

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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.