Skip to content

Commit 0ad2a5f

Browse files
authored
feat(udt): add udt info querying methods
1 parent 2e42efa commit 0ad2a5f

4 files changed

Lines changed: 602 additions & 139 deletions

File tree

.changeset/tired-ghosts-greet.md

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

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 {
@@ -464,6 +469,12 @@ export type CellLike = CellAnyLike &
464469
/**
465470
* Represents an on-chain CKB cell, which is a `CellAny` that is guaranteed to have an `outPoint`.
466471
* This class is typically used for cells that are already part of the blockchain state, such as transaction inputs.
472+
*
473+
* @remarks
474+
* An `outPoint` should only be included when it is deterministic.
475+
* For example, an output cell in a transaction currently being built does not have a deterministic `outPoint` yet,
476+
* and should be represented as a `CellAny` without an `outPoint`. This helps simplify logic elsewhere in the library.
477+
*
467478
* @public
468479
*/
469480
export class Cell extends CellAny {
@@ -1090,6 +1101,7 @@ export class WitnessArgs extends mol.Entity.Base<
10901101
/**
10911102
* Convert a bytes to a num.
10921103
*
1104+
* @deprecated Use `Udt.balanceFrom` from `@ckb-ccc/udt` instead
10931105
* @public
10941106
*/
10951107
export function udtBalanceFrom(dataLike: BytesLike): Num {

0 commit comments

Comments
 (0)