-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
In the CKB ecosystem, molecule is widely used. We initially have moleculec-es to generate molecule codecs for JS, but it's written in Golang, so it can not run in a JS runtime.
Later, we have related features in the Lumos, see @ckb-lumos/codec and @ckb-lumos/molecule. These two offer compile-time, runtime molecule parsing, and molecule schema defining in JS.
Nowadays, CCC plans to be a successor of Lumos to provide a better developer experience. So, we also want to add the molecule-related feature in CCC.
Plan
- Add molecule codecs to
@ckb-ccc/core. Similar to@ckb-lumos/codecbut with CCC types. feat: molecule codec #88 - Add a package
@ckb-ccc/moleculebased on codecs. Similar to@ckb-lumos/molecule. - Decorators to bind codecs to plain TS classes. e.g. feat: a helper to implement ccc base class #81 refactor: use molecule to refactor ckb entities #106
@Molecule(codec)
class Script {
...
}
const bytes = Script.from({...}).toBytes();
Script.fromBytes(bytes);This helps developers to use Molecule.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request