Fix/kaspa version limit - #477
Conversation
WalkthroughThis update bumps package versions from 1.0.29 to 1.0.30 across several projects and dependencies. It also tweaks firmware version checks and device model identifiers in Kaspa-related methods, adding stricter compatibility enforcement for certain features. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant KaspaGetAddress
participant BaseMethod
App->>KaspaGetAddress: run()
KaspaGetAddress->>BaseMethod: checkFeatureVersionLimit(..., { strictCheckDeviceSupport: true })
BaseMethod-->>KaspaGetAddress: Throws error if device unsupported
KaspaGetAddress-->>App: Returns address or error
sequenceDiagram
participant App
participant KaspaSignTransaction
participant BaseMethod
App->>KaspaSignTransaction: run()
KaspaSignTransaction->>BaseMethod: checkFeatureVersionLimit(..., { strictCheckDeviceSupport: true })
BaseMethod-->>KaspaSignTransaction: Throws error if device unsupported
KaspaSignTransaction-->>App: Returns result or error
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
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.
|
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (15)
packages/connect-examples/electron-example/package.json(1 hunks)packages/connect-examples/expo-example/package.json(2 hunks)packages/core/package.json(2 hunks)packages/core/src/api/BaseMethod.ts(3 hunks)packages/core/src/api/kaspa/KaspaGetAddress.ts(2 hunks)packages/core/src/api/kaspa/KaspaSignTransaction.ts(2 hunks)packages/hd-ble-sdk/package.json(2 hunks)packages/hd-common-connect-sdk/package.json(2 hunks)packages/hd-transport-http/package.json(2 hunks)packages/hd-transport-lowlevel/package.json(2 hunks)packages/hd-transport-react-native/package.json(2 hunks)packages/hd-transport-webusb/package.json(2 hunks)packages/hd-transport/package.json(1 hunks)packages/hd-web-sdk/package.json(2 hunks)packages/shared/package.json(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/core/src/api/BaseMethod.ts (2)
packages/core/src/types/device.ts (1)
DeviceFirmwareRange(132-134)packages/shared/src/HardwareError.ts (1)
HardwareErrorCode(46-410)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: lint (18.x)
- GitHub Check: build (18.x)
🔇 Additional comments (23)
packages/hd-transport/package.json (1)
3-3: Version bump looks good.Clean increment to 1.0.30 aligns with the coordinated release.
packages/core/src/api/BaseMethod.ts (3)
2-6: Import additions support the new error handling.Added imports for ERRORS and HardwareErrorCode enable the stricter device support checking.
157-163: Good API design for backward compatibility.Optional options parameter maintains existing behavior while enabling stricter checking when needed.
175-180: Stricter device support checking implemented correctly.The conditional error throwing uses the appropriate error code and message. Logic is well-guarded and maintains backward compatibility.
packages/shared/package.json (1)
3-3: Version bump consistent with release.Clean increment aligns with the coordinated package updates.
packages/connect-examples/electron-example/package.json (1)
5-5: Version bump completes coordinated release.Consistent increment to 1.0.30 matches other packages.
packages/core/package.json (2)
3-3: Sync package version. Bumped"version"to1.0.30to match the coordinated release.
28-29: Align dependency versions. Updated@onekeyfe/hd-sharedand@onekeyfe/hd-transportto^1.0.30for consistency across packages.packages/hd-transport-webusb/package.json (2)
3-3: Sync package version. Bumped"version"to1.0.30to keep in line with the monorepo.
23-24: Align dependency versions. Updated@onekeyfe/hd-sharedand@onekeyfe/hd-transportto^1.0.30for compatibility.packages/hd-transport-lowlevel/package.json (2)
3-3: Sync package version. Bumped"version"to1.0.30to match other transports.
22-23: Align dependency versions. Raised@onekeyfe/hd-sharedand@onekeyfe/hd-transportto^1.0.30for consistency.packages/hd-transport-react-native/package.json (2)
3-3: Sync package version. Updated"version"to1.0.30in step with the release.
22-23: Align dependency versions. Upgraded@onekeyfe/hd-sharedand@onekeyfe/hd-transportto^1.0.30for uniformity.packages/hd-transport-http/package.json (2)
3-3: Sync package version. Bumped"version"to1.0.30to maintain parity.
27-28: Align dependency versions. Updated@onekeyfe/hd-sharedand@onekeyfe/hd-transportto^1.0.30to stay in sync.packages/hd-web-sdk/package.json (1)
3-3: LGTM! Clean coordinated version bump.The package version and all related dependencies are updated consistently from 1.0.29 to 1.0.30.
Also applies to: 24-27
packages/connect-examples/expo-example/package.json (1)
3-3: LGTM! Consistent version bump across dependencies.All @onekeyfe package dependencies are updated in sync with the main version bump.
Also applies to: 22-25
packages/hd-common-connect-sdk/package.json (1)
3-3: LGTM! Coordinated version update maintained.Version consistency across the monorepo is properly maintained.
Also applies to: 23-27
packages/hd-ble-sdk/package.json (1)
3-3: LGTM! Final package version bump is consistent.All dependency versions are properly aligned with the main version update.
Also applies to: 23-25
packages/core/src/api/kaspa/KaspaSignTransaction.ts (2)
100-102: Device model key corrected and firmware requirement relaxed.The device model key change from
model_classictomodel_classic1sappears to be a naming correction. The firmware version requirement was lowered from '3.13.0' to '3.12.0'.Please verify that firmware version '3.12.0' properly supports the tweak functionality to avoid compatibility issues.
150-157: Good addition of strict device support checking.Adding
strictCheckDeviceSupport: trueimproves error handling by enforcing stricter compatibility checks when tweak functionality is disabled.packages/core/src/api/kaspa/KaspaGetAddress.ts (1)
72-76:Details
✅ Verification successful
Verify BaseMethod supports the new strictCheckDeviceSupport option.
The addition of
strictCheckDeviceSupport: trueenforces stricter device compatibility checks. This looks correct but needs verification that BaseMethod.checkFeatureVersionLimit accepts this option.
🏁 Script executed:
#!/bin/bash # Verify BaseMethod.checkFeatureVersionLimit supports the strictCheckDeviceSupport option ast-grep --pattern 'checkFeatureVersionLimit($$$) { $$$ }' # Also check for the options parameter definition rg -A 10 "checkFeatureVersionLimit.*options" --type tsLength of output: 119
🏁 Script executed:
#!/bin/bash # Locate the BaseMethod class definition rg -n "class BaseMethod" --type ts # Find where checkFeatureVersionLimit is declared or defined rg -n "checkFeatureVersionLimit" --type tsLength of output: 772
🏁 Script executed:
#!/bin/bash # Show the checkFeatureVersionLimit method signature and parameter list rg -n "protected checkFeatureVersionLimit" -A 8 -B 2 packages/core/src/api/BaseMethod.tsLength of output: 373
Approve strictCheckDeviceSupport usage
The
checkFeatureVersionLimitmethod inBaseMethodalready declares an optionalstrictCheckDeviceSupport?: booleanparameter:• packages/core/src/api/BaseMethod.ts (lines 159–163)
No further changes needed.
Summary by CodeRabbit