Skip to content

Conversation

@ByteZhang1024
Copy link
Contributor

@ByteZhang1024 ByteZhang1024 commented Dec 24, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Stellar network address retrieval.
  • Chores

    • Version bumped to 1.1.22-alpha.1 across all packages with updated internal dependencies.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 24, 2025

Walkthrough

This PR bumps all package versions from 1.1.21 to 1.1.22-alpha.1 across the monorepo and adds Stellar network support to core APIs with type-only import refactoring.

Changes

Cohort / File(s) Summary
Package version bumps to 1.1.22-alpha.1
packages/*/package.json, packages/core/package.json, packages/shared/package.json, packages/hd-*/package.json
Version field updated from 1.1.21 to 1.1.22-alpha.1 across all packages. Internal dependencies updated to match new version consistently.
Stellar network support
packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts, packages/core/src/types/api/allNetworkGetAddress.ts
Added 'stellar' network option with methodName 'stellarGetAddress' to networkConfigMap. Extended INetwork union type to include 'stellar'.
Stellar API methods and type-only imports
packages/core/src/api/stellar/StellarGetAddress.ts, packages/core/src/api/stellar/StellarSignTransaction.ts
Converted StellarGetAddress and related types to type-only imports from @onekeyfe/hd-transport. Runtime behavior unchanged; reduces compiled footprint.
AllNetwork method refactoring
packages/core/src/api/allnetwork/AllNetworkGetAddress.ts, packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts
Converted CoreApi import to type-only. Added runtime imports for UI progress messaging (createUiMessage, UI_REQUEST) and base class (AllNetworkGetAddressBase). Reorganized imports for clarity.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feat/stellar' is overly vague and generic. While it hints at Stellar network support, it doesn't clearly convey the main changes: version bumping to 1.1.22-alpha.1 and adding Stellar address/transaction signing capabilities across the SDK. Use a clearer title like 'Add Stellar network support and alpha version bump' to better reflect the scope of changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/stellar

📜 Recent review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2c691ae and 837e49e.

📒 Files selected for processing (21)
  • packages/connect-examples/electron-example/package.json
  • packages/connect-examples/expo-example/package.json
  • packages/connect-examples/expo-playground/package.json
  • packages/core/package.json
  • packages/core/src/api/allnetwork/AllNetworkGetAddress.ts
  • packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts
  • packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts
  • packages/core/src/api/stellar/StellarGetAddress.ts
  • packages/core/src/api/stellar/StellarSignTransaction.ts
  • packages/core/src/types/api/allNetworkGetAddress.ts
  • packages/hd-ble-sdk/package.json
  • packages/hd-common-connect-sdk/package.json
  • packages/hd-transport-electron/package.json
  • packages/hd-transport-emulator/package.json
  • packages/hd-transport-http/package.json
  • packages/hd-transport-lowlevel/package.json
  • packages/hd-transport-react-native/package.json
  • packages/hd-transport-web-device/package.json
  • packages/hd-transport/package.json
  • packages/hd-web-sdk/package.json
  • packages/shared/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish v1.1.22-alpha.1
  • GitHub Check: build (22)
  • GitHub Check: lint (22)
🔇 Additional comments (22)
packages/hd-transport-emulator/package.json (1)

3-3: LGTM! Version bumps are consistent.

The package version and dependency versions are all correctly bumped to 1.1.22-alpha.1. Exact pinning ensures version consistency across the monorepo.

Also applies to: 27-28

packages/core/src/api/stellar/StellarGetAddress.ts (1)

6-7: LGTM! Type-only imports are correctly applied.

The refactoring to type-only imports is safe. These types appear only in type positions (generics, type annotations) with no runtime usage.

packages/core/src/api/stellar/StellarSignTransaction.ts (2)

1-1: Correct: StellarMemoType kept as runtime import.

This enum is accessed at runtime (line 181: StellarMemoType.NONE), so it must remain a value import.


9-13: LGTM! Type-only imports correctly applied.

These types appear only in type positions. The refactoring won't affect runtime behavior.

packages/hd-transport/package.json (1)

3-3: Version bump to alpha release looks good.

Consistent with the PR's coordinated version updates across the monorepo.

packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts (1)

243-245: Stellar network support added successfully.

The minimal configuration (method name only) is consistent with other simple networks like sol, algo, and near. If Stellar addresses don't require parameter transformation, this is correct.

packages/hd-transport-http/package.json (1)

3-3: Version bump synchronized across dependencies.

All internal package references updated to 1.1.22-alpha.1 consistently.

packages/hd-transport-electron/package.json (1)

3-3: Version and dependencies updated consistently.

All internal package dependencies bumped to 1.1.22-alpha.1 in sync with the package version.

Also applies to: 28-30

packages/hd-common-connect-sdk/package.json (1)

3-3: Coordinated version bump across all internal dependencies.

Package and all @onekeyfe dependencies updated to 1.1.22-alpha.1 consistently.

Also applies to: 23-28

packages/core/package.json (1)

3-3: Core package version and dependencies synchronized.

Version bump to 1.1.22-alpha.1 with matching internal dependency updates.

Also applies to: 28-29

packages/hd-web-sdk/package.json (1)

3-3: Version bump looks consistent.

Package version and internal dependencies all align at 1.1.22-alpha.1. Good coordination.

Also applies to: 24-27

packages/shared/package.json (1)

3-3: LGTM!

Version bump to 1.1.22-alpha.1 is in sync with the rest of the monorepo.

packages/core/src/api/allnetwork/AllNetworkGetAddress.ts (1)

3-7: Imports look good.

Type-only import for CoreApi is the right call. UI messaging imports are needed for progress reporting.

packages/connect-examples/electron-example/package.json (1)

5-5: LGTM!

Version and dependency bump are consistent.

Also applies to: 25-25

packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts (1)

1-16: Imports cleaned up nicely.

Good separation of runtime vs type imports. AllNetworkGetAddressBase integration unifies the address-fetching logic.

packages/hd-transport-react-native/package.json (1)

3-3: LGTM!

Version and dependencies align at 1.1.22-alpha.1.

Also applies to: 22-23

packages/hd-transport-lowlevel/package.json (1)

3-3: LGTM!

Version and dependencies are consistent at 1.1.22-alpha.1.

Also applies to: 22-23

packages/core/src/types/api/allNetworkGetAddress.ts (1)

36-37: Good catch on both additions. Both neo and stellar are now in the INetwork union and have matching implementations in AllNetworkGetAddressBase (neoGetAddress and stellarGetAddress). PR title mentions only Stellar, but neo slips in here too. All good.

packages/connect-examples/expo-playground/package.json (1)

3-3: Version bump looks good.

The alpha version and dependency updates are consistent across the monorepo.

Also applies to: 20-22

packages/connect-examples/expo-example/package.json (1)

3-3: LGTM!

Version and dependency updates are properly coordinated.

Also applies to: 22-25

packages/hd-ble-sdk/package.json (1)

3-3: Version synchronization looks correct.

All internal dependencies updated consistently to the alpha release.

Also applies to: 23-25

packages/hd-transport-web-device/package.json (1)

3-3: Coordinated version bump is correct.

Dependencies and devDependencies properly updated to match the alpha release.

Also applies to: 23-24, 27-27


Comment @coderabbitai help to get the list of available commands and usage tips.

@revan-zhang
Copy link
Contributor

revan-zhang commented Dec 24, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@socket-security
Copy link

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/react-native-svg@15.12.1npm/entities@4.5.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@4.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/react-native-svg@15.12.1npm/entities@4.5.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@4.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/core/src/api/allnetwork/AllNetworkGetAddress.ts (2)

74-78: Progress calculation may be misleading.

You're iterating over methodGroups (grouped by method name), but dividing by this.payload.bundle.length (total items). If 10 addresses use 2 methods, you'd jump from 50% to 100% in two steps—not smooth progress. Consider tracking actual items processed instead.

🔎 Suggested fix

Track cumulative items processed:

     let i = 0;
+    let processedItems = 0;
     for (const [methodName, params] of Object.entries(methodGroups)) {
       // ... existing code ...

       for (let i = 0; i < params.length; i++) {
         // ... existing mapping code ...
+        processedItems++;
       }

       if (this.payload?.bundle?.length > 1) {
-        const progress = Math.round(((i + 1) / this.payload.bundle.length) * 100);
+        const progress = Math.round((processedItems / this.payload.bundle.length) * 100);
         this.postMessage(createUiMessage(UI_REQUEST.DEVICE_PROGRESS, { progress }));
       }
-      i++;
     }

43-43: Unused loop variable i.

Line 43 declares let i = 0 and line 78 increments it, but you never use i after that. The for...of on line 44 doesn't need it. Clean it up or use it in progress calculation.

packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts (1)

48-49: Consider typing the bundle parameter.

bundle: any[] is pretty loose. You already have AllNetworkAddressParams[] available. Stronger types catch bugs earlier.

🔎 Suggested fix
+import type {
+  AllNetworkAddress,
+  AllNetworkAddressParams,
+  AllNetworkGetAddressParamsByLoop,
+} from '../../types/api/allNetworkGetAddress';

 private async processCallbacksInBackground(
-    bundle: any[],
+    bundle: AllNetworkAddressParams[],
     rootFingerprint: number,
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2c691ae and 837e49e.

📒 Files selected for processing (21)
  • packages/connect-examples/electron-example/package.json
  • packages/connect-examples/expo-example/package.json
  • packages/connect-examples/expo-playground/package.json
  • packages/core/package.json
  • packages/core/src/api/allnetwork/AllNetworkGetAddress.ts
  • packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts
  • packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts
  • packages/core/src/api/stellar/StellarGetAddress.ts
  • packages/core/src/api/stellar/StellarSignTransaction.ts
  • packages/core/src/types/api/allNetworkGetAddress.ts
  • packages/hd-ble-sdk/package.json
  • packages/hd-common-connect-sdk/package.json
  • packages/hd-transport-electron/package.json
  • packages/hd-transport-emulator/package.json
  • packages/hd-transport-http/package.json
  • packages/hd-transport-lowlevel/package.json
  • packages/hd-transport-react-native/package.json
  • packages/hd-transport-web-device/package.json
  • packages/hd-transport/package.json
  • packages/hd-web-sdk/package.json
  • packages/shared/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish v1.1.22-alpha.1
  • GitHub Check: build (22)
  • GitHub Check: lint (22)
🔇 Additional comments (22)
packages/hd-transport-emulator/package.json (1)

3-3: LGTM! Version bumps are consistent.

The package version and dependency versions are all correctly bumped to 1.1.22-alpha.1. Exact pinning ensures version consistency across the monorepo.

Also applies to: 27-28

packages/core/src/api/stellar/StellarGetAddress.ts (1)

6-7: LGTM! Type-only imports are correctly applied.

The refactoring to type-only imports is safe. These types appear only in type positions (generics, type annotations) with no runtime usage.

packages/core/src/api/stellar/StellarSignTransaction.ts (2)

1-1: Correct: StellarMemoType kept as runtime import.

This enum is accessed at runtime (line 181: StellarMemoType.NONE), so it must remain a value import.


9-13: LGTM! Type-only imports correctly applied.

These types appear only in type positions. The refactoring won't affect runtime behavior.

packages/hd-transport/package.json (1)

3-3: Version bump to alpha release looks good.

Consistent with the PR's coordinated version updates across the monorepo.

packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts (1)

243-245: Stellar network support added successfully.

The minimal configuration (method name only) is consistent with other simple networks like sol, algo, and near. If Stellar addresses don't require parameter transformation, this is correct.

packages/hd-transport-http/package.json (1)

3-3: Version bump synchronized across dependencies.

All internal package references updated to 1.1.22-alpha.1 consistently.

packages/hd-transport-electron/package.json (1)

3-3: Version and dependencies updated consistently.

All internal package dependencies bumped to 1.1.22-alpha.1 in sync with the package version.

Also applies to: 28-30

packages/hd-common-connect-sdk/package.json (1)

3-3: Coordinated version bump across all internal dependencies.

Package and all @onekeyfe dependencies updated to 1.1.22-alpha.1 consistently.

Also applies to: 23-28

packages/core/package.json (1)

3-3: Core package version and dependencies synchronized.

Version bump to 1.1.22-alpha.1 with matching internal dependency updates.

Also applies to: 28-29

packages/hd-web-sdk/package.json (1)

3-3: Version bump looks consistent.

Package version and internal dependencies all align at 1.1.22-alpha.1. Good coordination.

Also applies to: 24-27

packages/shared/package.json (1)

3-3: LGTM!

Version bump to 1.1.22-alpha.1 is in sync with the rest of the monorepo.

packages/core/src/api/allnetwork/AllNetworkGetAddress.ts (1)

3-7: Imports look good.

Type-only import for CoreApi is the right call. UI messaging imports are needed for progress reporting.

packages/connect-examples/electron-example/package.json (1)

5-5: LGTM!

Version and dependency bump are consistent.

Also applies to: 25-25

packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts (1)

1-16: Imports cleaned up nicely.

Good separation of runtime vs type imports. AllNetworkGetAddressBase integration unifies the address-fetching logic.

packages/hd-transport-react-native/package.json (1)

3-3: LGTM!

Version and dependencies align at 1.1.22-alpha.1.

Also applies to: 22-23

packages/hd-transport-lowlevel/package.json (1)

3-3: LGTM!

Version and dependencies are consistent at 1.1.22-alpha.1.

Also applies to: 22-23

packages/core/src/types/api/allNetworkGetAddress.ts (1)

36-37: Good catch on both additions. Both neo and stellar are now in the INetwork union and have matching implementations in AllNetworkGetAddressBase (neoGetAddress and stellarGetAddress). PR title mentions only Stellar, but neo slips in here too. All good.

packages/connect-examples/expo-playground/package.json (1)

3-3: Version bump looks good.

The alpha version and dependency updates are consistent across the monorepo.

Also applies to: 20-22

packages/connect-examples/expo-example/package.json (1)

3-3: LGTM!

Version and dependency updates are properly coordinated.

Also applies to: 22-25

packages/hd-ble-sdk/package.json (1)

3-3: Version synchronization looks correct.

All internal dependencies updated consistently to the alpha release.

Also applies to: 23-25

packages/hd-transport-web-device/package.json (1)

3-3: Coordinated version bump is correct.

Dependencies and devDependencies properly updated to match the alpha release.

Also applies to: 23-24, 27-27

@ByteZhang1024 ByteZhang1024 merged commit 4af7b08 into onekey Dec 30, 2025
13 checks passed
@ByteZhang1024 ByteZhang1024 deleted the feat/stellar branch December 30, 2025 08:16
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.

4 participants