CKB Pulse

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

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

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, "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.

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.