You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add UDT balance and transfer CLI commands (#447)
* feat: add UDT balance and transfer CLI commands
Add offckb udt-balance and udt-transfer commands leveraging the
CCC SDK. Supports both SUDT and xUDT via --kind.
- udt-balance: query UDT balance for an address
- udt-transfer: transfer UDT amount to an address with change output
Closes#445
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor: reuse balance/transfer for UDT and add issue/destroy commands
- Reuse existing balance/transfer commands via --udt-type-args/--udt-kind flags
- Make balance default show CKB plus detected SUDT/xUDT balances
- Replace udt-balance/udt-transfer with udt issue/destroy subcommands
- Add detectUdtBalances, udtIssue, and udtDestroy to CKB SDK
- Update tests for the revised CLI
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: add changeset and fix formatting for UDT CLI refactor
- Add minor changeset for the new UDT issue/destroy commands and balance/transfer reuse.
- Apply prettier formatting to src/cmd/transfer.ts.
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(udt): address PR review comments
- Use minimal cell capacity (capacity: 0) instead of hardcoded 61 CKB for UDT outputs
- Add missing cell deps in udtTransfer
- Reject full UDT destroy to avoid potential script rejection
- Add max input cell limit for udtDestroy
- Skip corrupted UDT cells in balance detection instead of failing
- Remove hard 500-cell cap on UDT balance scan (now 1000 with warning)
- Add input validation: amount, type args length, UDT kind enum
- Warn when --type-args is provided for SUDT issue
- Remove process.exit(0) from balance command
- Support filtering balance by --udt-kind alone
- Add CLI enum choices for --udt-kind and --kind
- Add SDK-level UDT tests and expand validator tests
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(udt): address code review comments from review squad
- Extract getUdtScriptInfo helper to unify SUDT/xUDT script/cellDeps handling
- Filter detectUdtBalances by UDT type script with prefix search instead of scanning all cells
- Add --no-udt flag and parallel CKB/UDT queries in balance command
- Restore process.exit(0) in balanceOf to prevent CLI hang
- Unify UDT kind CLI flag to --udt-kind across balance/transfer/udt commands
- Move UdtKind type to src/type/base.ts and reuse in validator
- Add u128 upper bound check to validateUdtAmount
- Add logTxSuccess helper to remove duplicated testnet/devnet success logging
- Fix ckb.udt.test.ts test title/content mismatch and cover SUDT type-args warning
- Update tests for renamed udtKind option and process.exit mocking
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments