Description
The CCC library returns BigInt values from chain queries, but JavaScript's JSON.stringify() doesn't support BigInt, causing serialization failures.
Error
TypeError: Do not know how to serialize a BigInt
at JSON.stringify (<anonymous>)
Reproduction
const launchData = await getLaunchFromChain(launchId);
// launchData.targetCkb is a BigInt
JSON.stringify(launchData); // Throws error
Expected Behavior
The library should either:
- Provide built-in serialization helpers (e.g.,
launchData.toJSON())
- Return string-encoded values by default
- Document the required conversion pattern
Impact
Developers must manually convert every BigInt field before saving or transmitting data, which is error-prone and inconsistent.
Temporal Workaround
JSON.stringify({
targetCkb: launchData.targetCkb.toString(),
// ... every field
});
Request
Please provide a standard serialization/deserialization pattern for BigInt values in the library.
Description
The CCC library returns BigInt values from chain queries, but JavaScript's
JSON.stringify()doesn't support BigInt, causing serialization failures.Error
Reproduction
Expected Behavior
The library should either:
launchData.toJSON())Impact
Developers must manually convert every BigInt field before saving or transmitting data, which is error-prone and inconsistent.
Temporal Workaround
Request
Please provide a standard serialization/deserialization pattern for BigInt values in the library.