All lessons · CCC (TypeScript SDK) · Start here · Glossary
Parsing snake_case JSON-RPC transactions in CCCWorkingReproduced
Reproduced · Check: right · Checked 2026-11-19
ccc.Transaction.from reads only camelCase keys, so a snake_case JSON-RPC transaction (such as the ones ckb-cli writes, with cell_deps, outputs_data and similar) has to be converted with cccA.JsonRpcTransformers.transactionTo from @ckb-ccc/core/advanced. Passing that JSON directly to Transaction.from does not read those fields.
Why it matters: Feeding ckb-cli style JSON straight to Transaction.from leaves cell_deps, header_deps and outputs_data unread, so the resulting CCC transaction is missing those fields and hashes or signs as a different transaction.
Pattern
return cccA.JsonRpcTransformers.transactionTo(object as unknown as JsonRpcTransaction);Taken from the commit, shortened.
Reproduced by a test
A public test runs what this lesson says on @ckb-ccc/core 1.23.1, with no node. Anyone can run it.
tests/ccc/snake-case-transaction.test.mjs
- Concepts
- Data encoding (molecule, hex, bigints), Transaction building and fees
- Evidence
- Reproduced: reproduced by a public test
- First seen
- 2026-11-08
- Last changed
- 2026-11-08
- 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-11-08 · ILE-Labs/ckb-msig · more from this project
More about CCC (TypeScript SDK)
- Use JsonRpcTransformers.transactionFrom to serialize CCC transactions for CKB/Fiber RPC
- Transaction size for fee rate is serialized bytes plus 4
- Convert Fiber RPC snake_case scripts to CCC camelCase ScriptLike
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Parsing snake_case JSON-RPC transactions in CCC", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/parsing-snake-case-json-rpc-transactions-in-ccc, CC BY 4.0, last changed 2026-11-08.