Skip to content

Conversation

@rivjc1025
Copy link

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

⚠️ No Changeset found

Latest commit: e5b73f1

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 Nov 18, 2025

Deploy Preview for apiccc ready!

Name Link
🔨 Latest commit e5b73f1
🔍 Latest deploy log https://app.netlify.com/projects/apiccc/deploys/691d20d757fee1000848b4ae
😎 Deploy Preview https://deploy-preview-330--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: 78 (🔴 down 10 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 Nov 18, 2025

Deploy Preview for appccc ready!

Name Link
🔨 Latest commit e5b73f1
🔍 Latest deploy log https://app.netlify.com/projects/appccc/deploys/691d20d7b031340008fd3b7c
😎 Deploy Preview https://deploy-preview-330--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: 60 (🔴 down 17 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 18, 2025

Deploy Preview for liveccc ready!

Name Link
🔨 Latest commit e5b73f1
🔍 Latest deploy log https://app.netlify.com/projects/liveccc/deploys/691d20d7c081f80008f95365
😎 Deploy Preview https://deploy-preview-330--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: 18 (🔴 down 23 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 @rivjc1025, 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 expands the Common Chains Connector's (CCC) wallet support by integrating the SupeRISE wallet. It introduces a new, self-contained package for SupeRISE, complete with a CKB signer implementation, and seamlessly hooks it into the existing CCC framework. This enhancement allows developers and users to leverage SupeRISE for CKB transactions and message signing directly through CCC-powered applications.

Highlights

  • New SupeRISE Package: A new package, @ckb-ccc/superise, has been introduced to provide dedicated support for the SupeRISE wallet within the Common Chains Connector (CCC) ecosystem.
  • CKB Signer Implementation: The new superise package includes a CkbSigner class that extends ccc.Signer, enabling CKB-specific operations such as connecting to the wallet, retrieving addresses, signing messages, and preparing/signing transactions.
  • Integration with CCC Core: The SupeRISE wallet is now integrated into the main ccc package, allowing applications to discover and utilize it through the SignersController.
  • SupeRISE Wallet Asset: An SVG asset representing the SupeRISE wallet logo has been added to the ccc package for UI representation.
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 18, 2025

Deploy Preview for docsccc ready!

Name Link
🔨 Latest commit e5b73f1
🔍 Latest deploy log https://app.netlify.com/projects/docsccc/deploys/691d20d7dc037d0008c5d134
😎 Deploy Preview https://deploy-preview-330--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: 67 (🔴 down 5 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 support for the SupeRISE wallet by adding a new package @ckb-ccc/superise and integrating it into the main ccc package. The new package provides a CkbSigner for interacting with the SupeRISE wallet extension. The changes are well-structured, but I've identified a critical issue with a missing file extension in an import that could lead to runtime errors, along with a few other suggestions to enhance correctness and maintainability.

Copy link
Member

@Hanssen0 Hanssen0 left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! It's happy to see CCC can help devs to integrate the SuperRISE wallet.

This should be a PR that works. However, I have some concerns about the security design of APIs. CCC, or other wallet SDKs, run in an insecure environment, which means code involving security/verification should not depend on the SDK's correctness.

BTW, where can I download the SupeRISE wallet to test this PR?


override async signMessageRaw(message: string) {
const signMessage = `Nervos Message:${message}`;
const sign = await this.bridge.signCkbMessage(signMessage);
Copy link
Member

Choose a reason for hiding this comment

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

This may be a security threat: If a website invokes the signCkbMessage API with a transaction hash, users may accidentally sign a tx while only knowing they're signing an arbitrary message.

I recommend adding the message prefix in the wallet to prevent this problem.

const tx = ccc.Transaction.from(txLike);

const addressObj = await this.getAddressObj();
const acp = await ccc.Script.fromKnownScript(
Copy link
Member

Choose a reason for hiding this comment

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

Note: If new scripts are expected to be added in the future, I recommend doing this on the wallet side.

It's harder to let devs update their apps' SDKs than to let users update their wallets, which means we might end up with multiple SDK versions across different apps. As a result, this might cause the new address not to be supported by some apps.


override async signOnlyTransaction(txLike: ccc.TransactionLike) {
const tx = ccc.Transaction.from(txLike);
const metadata = this.getUiMetadataFromTx(tx);
Copy link
Member

Choose a reason for hiding this comment

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

interface SignCkbHashAllMetadata {
    type: number
    nftImage?: string
    nftName?: string
    toAddress: string
  }

Please be careful if this metadata is meant to display transaction information for the wallet. The CCC SDK is designed to run in an insecure environment (on the application side), meaning anyone can modify its behavior. Misleading information injected by attackers might lead to users losing their assets.

if (signatureCache.has(message)) {
signature = signatureCache.get(message)!;
} else {
const sign = await this.bridge.signCkbHashAll(
Copy link
Member

Choose a reason for hiding this comment

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

As a recommendation, we usually pass the entire transaction to the wallet to allow it to display the transaction details. Blind signing is always dangerous, and we may want to avoid that.

return this.signOnlyTransaction(preparedTx);
}

override async sendTransaction(tx: ccc.TransactionLike): Promise<ccc.Hex> {
Copy link
Member

Choose a reason for hiding this comment

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

It seems unnecessary to override signTransaction and sendTransaction, since they're identical to the default implementations.

@Hanssen0
Copy link
Member

/gemini review

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 support for the Superise wallet by adding a new package @ckb-ccc/superise and integrating it. The changes are well-structured, but I've found a few issues in the new signer implementation concerning connection state management and transaction signing logic that should be addressed. There is also a minor configuration issue in the documentation generation setup.

Comment on lines +62 to +64
override async disconnect() {
this.connection = undefined;
}
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 disconnect method only clears the in-memory connection property. It should also clear the connection details from localStorage to ensure a consistent disconnected state, especially after a page reload.

  override async disconnect() {
    this.connection = undefined;
    localStorage.removeItem(this.connectionStorageKey);
  }

Comment on lines +175 to +177
if (!info) {
return tx;
}
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 code returns the transaction object from within the loop if getSignHashInfo returns no info for a script. This will prevent other scripts in the transaction from being signed. You should use continue to proceed to the next script in the loop instead of returning.

      if (!info) {
        continue;
      }

@@ -0,0 +1,6 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": ["./src/index.ts", "./src/advanced.ts"],
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 entry point src/advanced.ts does not exist in the package. This will cause an error when generating documentation. Please remove it from the entryPoints array.

Suggested change
"entryPoints": ["./src/index.ts", "./src/advanced.ts"],
"entryPoints": ["./src/index.ts"],

"@ckb-ccc/utxo-global": "workspace:*",
"@ckb-ccc/xverse": "workspace:*"
"@ckb-ccc/xverse": "workspace:*",
"@ckb-ccc/superise": "workspace:*"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For better maintainability, it's a good practice to keep dependencies sorted alphabetically. @ckb-ccc/superise should be placed after @ckb-ccc/shell.

Comment on lines +55 to +60
async isConnected() {
if (this.connection) return true;

this.restoreConnection();
return !!this.connection;
}
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 isConnected method has a side effect of trying to restore a connection from localStorage. A method with a name like isConnected is generally expected to be a pure function that only checks the current state without modifying it. This can lead to unexpected behavior. Consider removing the call to restoreConnection() from this method, as the connection restoration logic is already present in getConnection(), which is the more appropriate place for it.

  async isConnected() {
    return !!this.connection;
  }

@rivjc1025
Copy link
Author

@Hanssen0
Thank you for your feedback! We’ve decided to redesign this part.

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