-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hello CKB DevRel folks!!
I was wondering, have you considered merging iCKB Utils' UDTHandler Features into the CCC library's Udt?
Summary
We currently maintain three parallel UDT implementations:
- CCC's
Udtclass (metadata,transfer,mint, basiccompleteBy) - iCKB Utils'
UdtHandler/UdtManager(SmartTransaction-aware balance tracking, input aggregation, change-cell viacompleteUdt) - iCKB Core's
IckbUdtManager(overrides input balance for iCKB UDT cells, receipt and deposit transformation logic)
This duplication leads to inconsistent behaviors, extra maintenance, and diverging sUDT data-length checks.
CCC Feature Request
In the CCC library's Udt class, add methods/properties from iCKB Utils' UdtManager:
getInputsUdtBalance(client, tx)(open to change the name)getOutputsUdtBalance(tx)(we can find a better name)completeBy(tx, signer, options?), supportshouldAddInputs?: booleanandcompressState?: booleanas options- cellDeps: ccc.CellDep[];
Note: I'm open to change any of the previous names if necessary.
ICKB side of things
Deprecate iCKB Utils' standalone UdtHandler/UdtManager. Instead, let IckbUdtManager extend the enhanced CCC Udt class, overriding only:
- The xUDT data-length check (≥16 bytes on-chain)
- Custom input-balance logic for:
- iCKB receipt cells
- DAO deposit/withdrawal cells
- Accept both
ccc.TransactionandSmartTransactionascompleteByinputs, detect type, usesmartTransaction.copy(tx)when needed in SmartTransactioncompleteFee, and return the same transaction type.
Keep up the Great Work, Phroi %28
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request