Skip to content

Commit 6a25f02

Browse files
committed
feat(udt): add udt info querying methods
1 parent 8b18938 commit 6a25f02

File tree

4 files changed

+595
-126
lines changed

4 files changed

+595
-126
lines changed

.changeset/tired-ghosts-greet.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@ckb-ccc/ssri": minor
3+
"@ckb-ccc/udt": minor
4+
"@ckb-ccc/core": patch
5+
---
6+
7+
feat(udt): udt info querying methods
8+

packages/core/src/ckb/transaction.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ export type CellAnyLike = {
315315
* This class provides a unified interface for handling cells before they are included in a transaction,
316316
* or for cells that are already part of the blockchain state.
317317
*
318+
* @remarks
319+
* When representing an output of a transaction being built, which does not have a deterministic `outPoint` yet,
320+
* this class should be used without an `outPoint`. Once the transaction is on-chain, its outputs can be
321+
* represented as `Cell` instances with a defined `outPoint`.
322+
*
318323
* @public
319324
*/
320325
export class CellAny {
@@ -460,6 +465,12 @@ export type CellLike = CellAnyLike &
460465
/**
461466
* Represents an on-chain CKB cell, which is a `CellAny` that is guaranteed to have an `outPoint`.
462467
* This class is typically used for cells that are already part of the blockchain state, such as transaction inputs.
468+
*
469+
* @remarks
470+
* An `outPoint` should only be included when it is deterministic.
471+
* For example, an output cell in a transaction currently being built does not have a deterministic `outPoint` yet,
472+
* and should be represented as a `CellAny` without an `outPoint`. This helps simplify logic elsewhere in the library.
473+
*
463474
* @public
464475
*/
465476
export class Cell extends CellAny {
@@ -1086,6 +1097,7 @@ export class WitnessArgs extends mol.Entity.Base<
10861097
/**
10871098
* Convert a bytes to a num.
10881099
*
1100+
* @deprecated Use `Udt.balanceFrom` from `@ckb-ccc/udt` instead
10891101
* @public
10901102
*/
10911103
export function udtBalanceFrom(dataLike: BytesLike): Num {

0 commit comments

Comments
 (0)