Skip to content

Conversation

@ashuralyk
Copy link
Contributor

@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

⚠️ No Changeset found

Latest commit: e1f996a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for docsccc ready!

Name Link
🔨 Latest commit e1f996a
🔍 Latest deploy log https://app.netlify.com/projects/docsccc/deploys/6967ae5cc7b57d0008d89809
😎 Deploy Preview https://deploy-preview-348--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: 68 (no change 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.

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for apiccc ready!

Name Link
🔨 Latest commit e1f996a
🔍 Latest deploy log https://app.netlify.com/projects/apiccc/deploys/6967ae5b1777c2000805cf34
😎 Deploy Preview https://deploy-preview-348--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 14 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.

@netlify
Copy link

netlify bot commented Jan 9, 2026

Deploy Preview for liveccc ready!

Name Link
🔨 Latest commit e1f996a
🔍 Latest deploy log https://app.netlify.com/projects/liveccc/deploys/6967ae5b4b269c00085d29f7
😎 Deploy Preview https://deploy-preview-348--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: 39 (🔴 down 2 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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ashuralyk, 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 enhances the UDT package by introducing a dedicated UdtRegister class. This class provides a streamlined mechanism for creating and registering new User Defined Tokens, incorporating on-chain metadata directly. It offers flexibility by supporting advanced registration via an SSRI executor while also ensuring compatibility through a fallback to the traditional TypeId pattern for token identification and deployment.

Highlights

  • New UdtRegister Class: Introduced a new UdtRegister class that extends Udt, specifically designed for registering User Defined Tokens (UDTs) with on-chain metadata.
  • UDT Registration Method: Added an asynchronous register method to UdtRegister which allows for the creation of new UDTs, assigning on-chain metadata (name, symbol, decimals, icon), and returning a transaction to instantiate the token. This method supports both SSRI executor-based registration and a fallback to a legacy TypeId pattern.
  • UDT Metadata Definition: Defined UdtMetadata using ccc.mol.table to structure the on-chain metadata for UDTs, including fields for name, symbol, decimals, and icon.
  • Module Export: The new udtRegister module has been exported from the main barrel.ts file, making the UdtRegister class available for use within the package.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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 Jan 9, 2026

Deploy Preview for appccc ready!

Name Link
🔨 Latest commit e1f996a
🔍 Latest deploy log https://app.netlify.com/projects/appccc/deploys/6967ae5b0ec20000087cf5e8
😎 Deploy Preview https://deploy-preview-348--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: 61 (🔴 down 26 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.

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 a register method for UDTs through a new UdtRegister class. The implementation looks solid, providing both an SSRI-based registration path and a fallback to a standard Type ID-based creation. I've provided a few suggestions to improve code clarity, maintainability, and documentation accuracy. Key points include removing a redundant check, replacing a magic string with a constant, correcting a misleading example in the documentation, and adding clarification for a method parameter's constraints. The most critical feedback is to fix the documentation example to prevent user confusion.

Comment on lines +56 to +57
* const udt = new Udt(codeOutPoint, scriptConfig);
* const { tx, tokenHash } = await udt.register(
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The example is incorrect. It instantiates Udt instead of UdtRegister, but the register method is part of the UdtRegister class. Additionally, the UdtRegister constructor requires an executor in its configuration, which is missing from the example.

Suggested change
* const udt = new Udt(codeOutPoint, scriptConfig);
* const { tx, tokenHash } = await udt.register(
* const udtRegister = new UdtRegister(codeOutPoint, scriptConfig, { executor });
* const { tx, tokenHash } = await udtRegister.register(

metadata: {
name: string;
symbol: string;
decimals: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The decimals property is encoded as a Uint8, meaning its value must be an integer between 0 and 255. The current type number is too broad and doesn't communicate this important constraint. Adding a JSDoc comment will help developers use this method correctly and prevent potential runtime errors.

Suggested change
decimals: number;
/** Must be an integer between 0 and 255. */
decimals: number;

Comment on lines +93 to +106
if (this.executor) {
const res = await this.executor.runScriptTry(
this.code,
"SSRIUDT.create",
[
register.toBytes(),
ccc.Script.from(owner.script).toBytes(),
UdtMetadata.encode(metadata),
],
);
if (res) {
resTx = res.map((res) => ccc.Transaction.fromBytes(res));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The UdtRegister constructor requires an executor to be present in the config, making this.executor always defined within this class. The if (this.executor) check is therefore redundant. You can simplify the code by removing this conditional check. The SSRI path will always be attempted, and the fallback logic will still be correctly triggered if runScriptTry returns undefined.

    const res = await this.executor.runScriptTry(
      this.code,
      "SSRIUDT.create",
      [
        register.toBytes(),
        ccc.Script.from(owner.script).toBytes(),
        UdtMetadata.encode(metadata),
      ],
    );
    if (res) {
      resTx = res.map((res) => ccc.Transaction.fromBytes(res));
    }

lock: owner.script,
type: {
codeHash:
"00000000000000000000000000000000000000000000000000545950455f4944",
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The codeHash for the Type ID script is hardcoded here. This "magic string" reduces readability and maintainability. It's better to define this as a constant with a descriptive name (e.g., TYPE_ID_CODE_HASH) in a shared location and reference it here.

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.

1 participant