Skip to content

Conversation

@phroi
Copy link
Contributor

@phroi phroi commented Nov 30, 2025

Hey @Hanssen0, in this PR I fixed #261 minor merge conflicts: feel free to take the code in this branch and force push it on #261 as your own.

I tried to commit on #261, but I don't have the permissions.

Phroi %150

@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

🦋 Changeset detected

Latest commit: 2b3852b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@ckb-ccc/ssri Minor
@ckb-ccc/udt Minor
@ckb-ccc/core Patch
@ckb-ccc/shell Patch
@ckb-ccc/eip6963 Patch
@ckb-ccc/joy-id Patch
@ckb-ccc/lumos-patches Patch
@ckb-ccc/nip07 Patch
@ckb-ccc/okx Patch
@ckb-ccc/rei Patch
@ckb-ccc/spore Patch
@ckb-ccc/uni-sat Patch
@ckb-ccc/utxo-global Patch
@ckb-ccc/xverse Patch
@ckb-ccc/ccc Patch
ckb-ccc Patch
@ckb-ccc/connector Patch
@ckb-ccc/connector-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for apiccc ready!

Name Link
🔨 Latest commit 2b3852b
🔍 Latest deploy log https://app.netlify.com/projects/apiccc/deploys/692cd22d0e39c100087d2d52
😎 Deploy Preview https://deploy-preview-333--apiccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 80 (🔴 down 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 94 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @phroi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the UDT (User Defined Token) functionality by introducing a robust set of methods for querying UDT-related information and streamlining transaction completion processes. It provides developers with more granular control and clearer insights into UDT balances and cell management, while also improving error handling and documentation for a better development experience. The changes also resolve existing merge conflicts to facilitate smoother integration.

Highlights

  • New UDT Information Querying Methods: Introduced a comprehensive suite of methods within the Udt class for querying UDT (User Defined Token) information, including infoFrom, balanceFrom, calculateInfo, and calculateBalance, allowing for detailed statistics on UDT cells and balances.
  • Enhanced UDT Transaction Completion: Added advanced transaction completion methods such as completeInputsByBalance, completeInputsAll, completeChangeToOutput, completeChangeToLock, and a general complete method, providing flexible and robust ways to manage UDT inputs and change outputs, considering both UDT balance and CKB capacity.
  • Improved Error Handling and Documentation: Implemented a new error type, ErrorUdtInsufficientCoin, for clearer communication of balance shortfalls. Significantly expanded JSDoc comments across the Udt class, offering detailed explanations, examples, and usage remarks for all new and modified methods.
  • Core Library Updates: Updated the @ckb-ccc/core package to include @remarks in CellAny and Cell classes for clarifying outPoint usage, and deprecated the udtBalanceFrom function in favor of the new Udt.balanceFrom.
  • Merge Conflict Resolution: This pull request specifically addresses and fixes minor merge conflicts related to issue feat(udt): add udt info querying methods #261, ensuring compatibility and integration of the new UDT features.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for liveccc ready!

Name Link
🔨 Latest commit 2b3852b
🔍 Latest deploy log https://app.netlify.com/projects/liveccc/deploys/692cd22d0e39c100087d2d4e
😎 Deploy Preview https://deploy-preview-333--liveccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 23 (🟢 up 3 from production)
Accessibility: 88 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for appccc ready!

Name Link
🔨 Latest commit 2b3852b
🔍 Latest deploy log https://app.netlify.com/projects/appccc/deploys/692cd22d97ccfc000869035d
😎 Deploy Preview https://deploy-preview-333--appccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 53 (🔴 down 22 from production)
Accessibility: 89 (🟢 up 1 from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 30, 2025

Deploy Preview for docsccc ready!

Name Link
🔨 Latest commit 2b3852b
🔍 Latest deploy log https://app.netlify.com/projects/docsccc/deploys/692cd22dca4de300095690d8
😎 Deploy Preview https://deploy-preview-333--docsccc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 59 (🔴 down 8 from production)
Accessibility: 88 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces significant enhancements to the UDT (User Defined Token) handling by adding new methods for querying UDT information and improving transaction completion logic. The changes are well-structured, with new features like UdtInfo, calculateInfo, and a much more robust completeInputsByBalance method that handles both UDT balance and CKB capacity. The new test suite is comprehensive and covers many edge cases. The documentation for the new APIs is excellent. I've found one minor issue in the changeset configuration.

@@ -0,0 +1,8 @@
---
"@ckb-ccc/ssri": minor
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This changeset includes a minor version bump for @ckb-ccc/ssri. However, based on the file changes in this pull request, there are no modifications to the ssri package. Bumping the version of an unchanged package could be misleading. Please consider removing this line if the version bump for @ckb-ccc/ssri is not intentional.

@ashuralyk
Copy link
Contributor

Hi Phroi, I carefully compared your commits to the merging base, I found some unnecessary changes, like:

class CellAny {
  constructor(
    ...
    public outPoint?: OutPoint,
  )
}

to

class CellAny {
  public outPoint: OutPoint | undefined,
  
  constructor(
    outPoint?: OutPoint
  )
}

and

numLeToBytes(values, 16)

to

numLeToBytes(values)

These changes work fine, but it seems no necessity, can you share about your considerations?

@phroi
Copy link
Contributor Author

phroi commented Dec 23, 2025

Hey @ashuralyk! Thank you for taking your time to review this PR. I open it because I was unable to push on #261 and it has conflict merge, being an old PR, branched off this summer.

Back to us, I personally did not make those changes, but since @Hanssen0 is otherwise busy, I may as well owning the thing and keep working on it.

I'm not sure which part of the code you are talking about, please, could you use the appropriate instruments to review the code?

Please leave comments on the actual PR code, in short:

  1. Open the Files changed tab
  2. Look at the screen half showing the modified code
  3. Click on the + on the line(s) containing the code you would like to comment on
  4. Write a comment explaining your reasoning
  5. Click on the Comment button

Love & Peace, Phroi %15

@ashuralyk
Copy link
Contributor

hi @phroi
I'm so sorry for any inconvenience, I just picked those changed files from yours and hanssen's into an outside compare tool, and see what exactly the difference between them, which I cannot seek through my eyes.

But I really didn't double check my findings directly in your PR, so here's the mistake I made, sorry for this again.

What I found isn't in any changed code blocks, so I cannot put my comment through Github review tools, I just put them in this comment zone, and to be honest, I'm not sure why those difference exist.

CellAny (in transaction.ts:325)

the screen shot from hanssen's
image

the screen shot from phroi's
image

numLeToBytes (in udt/index.ts:1030)

the screen shot from hanssen's
image

the screen shot from phroi's
image

note: as a result, above changes won't give impact for the final output yet, you can choose to deal or not on your need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants