CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

toastmanAu/cemp-mobile

Lessons from toastmanAu/cemp-mobile

github.com/toastmanAu/cemp-mobile

Do you maintain this project? Confirm its lessons in one issue

1 lessons found. All lessons

Count only empty, typeless lock cells as spendable balanceWorkingFrom one fix

When computing a wallet's spendable balance from indexer cells under a lock, count only cells with empty output data and no type script as available. A cell with data or any type script (UDT, DOB, profile or attachment cells, not just your own type) holds state, so its capacity stays in the total but is reported as reserved, because spending it would destroy that state. In cemp-mobile this is `const hasData = cell.data !== "0x" && cell.data !== ""; const isProtocol = hasData || type !== null;`.

#Indexer queries and cell collection #Capacity and cell size · Sources (1) · 2026-10-31

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.