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
Udt class (metadata, transfer, mint, basic completeBy)
- iCKB Utils'
UdtHandler/UdtManager (SmartTransaction-aware balance tracking, input aggregation, change-cell via completeUdt)
- 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?), support shouldAddInputs?: boolean and compressState?: boolean as 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.Transaction and SmartTransaction as completeBy inputs, detect type, use smartTransaction.copy(tx) when needed in SmartTransaction completeFee, and return the same transaction type.
Keep up the Great Work, Phroi %28
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:
Udtclass (metadata,transfer,mint, basiccompleteBy)UdtHandler/UdtManager(SmartTransaction-aware balance tracking, input aggregation, change-cell viacompleteUdt)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
Udtclass, 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 optionsNote: I'm open to change any of the previous names if necessary.
ICKB side of things
Deprecate iCKB Utils' standalone
UdtHandler/UdtManager. Instead, letIckbUdtManagerextend the enhanced CCCUdtclass, overriding only:ccc.TransactionandSmartTransactionascompleteByinputs, detect type, usesmartTransaction.copy(tx)when needed in SmartTransactioncompleteFee, and return the same transaction type.Keep up the Great Work, Phroi %28