-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/sol sign offchain message #280
Conversation
WalkthroughThis pull request represents a comprehensive version update across multiple packages within the OneKey cross-inpage provider ecosystem. The primary change is a minor version increment from Changes
Sequence DiagramsequenceDiagram
participant Client
participant SolanaProvider
participant Bridge
Client->>SolanaProvider: solSignOffchainMessage(message)
SolanaProvider->>Bridge: Encode message to base58
Bridge->>SolanaProvider: Return signature
SolanaProvider->>Client: Return { signature, publicKey }
The sequence diagram illustrates the flow of signing an off-chain Solana message, showing how the message is encoded, sent through the bridge, and a signature is returned to the client. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎ To accept the risk, merge this PR and you will not be notified again.
Next stepsWhat is a critical CVE?Contains a Critical Common Vulnerability and Exposure (CVE). Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies. Take a deeper look at the dependencyTake 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 [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🔭 Outside diff range comments (2)
packages/example/package.json (2)
Line range hint
15-125
: Consider adding version constraintsMany external dependencies lack version constraints. This could lead to unexpected breaking changes.
Add caret (^) or exact versions for dependencies without version constraints. For example:
- "@alephium/web3-react": "1.4.0", + "@alephium/web3-react": "^1.4.0",
Remove
--openssl-legacy-provider
flag - it's not neededThe flag is present in the build script but there's no actual crypto usage that would require it. The codebase doesn't use Node's crypto module or any legacy crypto features. You can safely remove the flag from the build command.
- In
packages/example/package.json
, update the build script to:"build": "cross-env next build && next export"🔗 Analysis chain
Line range hint
8-8
: Review the need for legacy OpenSSL providerThe build script uses the
--openssl-legacy-provider
flag. This might indicate usage of deprecated crypto features.Run this check to identify potential crypto usage:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for crypto-related code that might require legacy provider rg -l 'crypto|createHash|createHmac|createCipher|createDecipher'Length of output: 867
Script:
#!/bin/bash # Check if the --openssl-legacy-provider flag is actually used in package.json rg --json "openssl-legacy-provider" packages/example/package.json # Check for actual crypto usage in the example app's source files rg -l "require\(['\"](crypto|node:crypto)" packages/example/ rg "new (Crypto|SubtleCrypto|WebCrypto)" packages/example/ rg "window\.crypto" packages/example/Length of output: 1145
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (36)
packages/core/package.json
(2 hunks)packages/desktop/desktop-bridge-injected/package.json
(2 hunks)packages/e2e/package.json
(2 hunks)packages/empty/package.json
(1 hunks)packages/errors/package.json
(1 hunks)packages/events/package.json
(1 hunks)packages/example/components/chains/solana/example.tsx
(3 hunks)packages/example/components/chains/solana/types.ts
(1 hunks)packages/example/package.json
(2 hunks)packages/extension/extension-bridge-hosted/package.json
(2 hunks)packages/extension/extension-bridge-injected/package.json
(2 hunks)packages/injected/package.json
(2 hunks)packages/native/native-bridge-injected/package.json
(2 hunks)packages/providers/inpage-providers-hub/package.json
(2 hunks)packages/providers/onekey-algo-provider/package.json
(2 hunks)packages/providers/onekey-alph-provider/package.json
(2 hunks)packages/providers/onekey-aptos-provider/package.json
(2 hunks)packages/providers/onekey-bfc-provider/package.json
(2 hunks)packages/providers/onekey-btc-provider/package.json
(2 hunks)packages/providers/onekey-cardano-provider/package.json
(2 hunks)packages/providers/onekey-conflux-provider/package.json
(2 hunks)packages/providers/onekey-cosmos-provider/package.json
(2 hunks)packages/providers/onekey-eth-provider/package.json
(2 hunks)packages/providers/onekey-near-provider/package.json
(2 hunks)packages/providers/onekey-nostr-provider/package.json
(2 hunks)packages/providers/onekey-polkadot-provider/package.json
(2 hunks)packages/providers/onekey-private-provider/package.json
(2 hunks)packages/providers/onekey-scdo-provider/package.json
(2 hunks)packages/providers/onekey-solana-provider/package.json
(2 hunks)packages/providers/onekey-solana-provider/src/ProviderSolana.ts
(2 hunks)packages/providers/onekey-sui-provider/package.json
(2 hunks)packages/providers/onekey-ton-provider/package.json
(2 hunks)packages/providers/onekey-tron-provider/package.json
(2 hunks)packages/providers/onekey-webln-provider/package.json
(2 hunks)packages/types/package.json
(1 hunks)packages/webview/package.json
(2 hunks)
🔇 Additional comments (40)
packages/example/components/chains/solana/types.ts (1)
17-23
: New method looks consistent.
The off-chain sign method aligns well with existing patterns. Please ensure tests cover potential edge cases, such as empty byte arrays.packages/example/components/chains/solana/example.tsx (2)
181-183
: Clean signature verification.
The return statement is clear and concise. Code is readable.
378-378
: No impactful change.
This line doesn't change functionality. All good.packages/providers/onekey-solana-provider/src/ProviderSolana.ts (1)
29-33
: Nice addition.
IncludingsolSignOffchainMessage
in theSolanaRequest
type is consistent.packages/events/package.json (1)
3-3
: Version bump confirmed.
Update makes sense, matching other packages.packages/empty/package.json (1)
3-3
: Version bump looks good!Clean version update from 2.2.7-alpha.0 to 2.2.7-alpha.1.
packages/types/package.json (1)
3-3
: Version bump looks good!Clean version update from 2.2.7-alpha.0 to 2.2.7-alpha.1.
packages/errors/package.json (2)
3-3
: Version bump looks good!Clean version update from 2.2.7-alpha.0 to 2.2.7-alpha.1.
Line range hint
1-35
: Verify Solana feature implementationThe PR title mentions Solana off-chain message signing, but I don't see related code changes in the reviewed files. Let's verify the implementation.
✅ Verification successful
Solana off-chain message signing is implemented
The codebase includes Solana off-chain message signing implementation in
packages/providers/onekey-solana-provider/src/ProviderSolana.ts
. The relevant code shows:
solSignOffchainMessage
method for off-chain message signing- Support for both regular
signMessage
and off-chain message signing- Implementation in both the provider and wallet standard interfaces
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for Solana-related changes in the codebase echo "Searching for Solana-related files..." fd -e ts -e js "solana|sol" echo "Searching for message signing implementations..." rg -i "sign.*message|message.*sign"Length of output: 52875
packages/native/native-bridge-injected/package.json (1)
3-3
: Version updates look good!Version bump is consistent across package and dependencies.
Also applies to: 31-32
packages/extension/extension-bridge-injected/package.json (1)
3-3
: Version updates are consistent!Package version and dependencies align with other packages.
Also applies to: 31-32
packages/extension/extension-bridge-hosted/package.json (1)
3-3
: Version updates are aligned!Package version and core dependencies match the version bump.
Let's verify version consistency across all packages:
Also applies to: 31-32
✅ Verification successful
Version consistency confirmed across all packages
All @onekeyfe packages and their dependencies are correctly set to version 2.2.7-alpha.1. The version bump is complete and consistent.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check version consistency across all package.json files # Expected: All relevant packages should use version 2.2.7-alpha.1 echo "Checking package versions..." fd package.json | xargs jq -r '. | select(.name | startswith("@onekeyfe")) | "\(.name): \(.version)"' echo -e "\nChecking dependency versions..." fd package.json | xargs jq -r '. | select(.dependencies != null) | .dependencies | to_entries[] | select(.key | startswith("@onekeyfe")) | "\(.key): \(.value)"'Length of output: 8604
packages/desktop/desktop-bridge-injected/package.json (1)
3-3
: Version updates look consistentPackage version and dependencies are aligned at 2.2.7-alpha.1.
Also applies to: 37-38
packages/webview/package.json (1)
3-3
: Version updates are in syncPackage version and dependencies are correctly updated to 2.2.7-alpha.1.
Also applies to: 39-40
packages/providers/onekey-btc-provider/package.json (2)
3-3
: Version updates are consistentPackage version and all four dependencies are properly updated to 2.2.7-alpha.1.
Also applies to: 31-34
Line range hint
1-34
: Verify PR scope and implementationThe PR title mentions "Feat/sol sign offchain message" but this is a BTC provider package. Let's verify the implementation location.
packages/providers/onekey-algo-provider/package.json (1)
3-3
: Version updates look consistentPackage version and dependencies are all aligned to 2.2.7-alpha.1.
Let's verify version consistency across the monorepo:
Also applies to: 31-34
✅ Verification successful
Version consistency verified across all packages
All @onekeyfe packages are aligned to version 2.2.7-alpha.1. The version update is consistent throughout the monorepo.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check version consistency across all package.json files fd package.json | xargs jq -r '. | select(.name | startswith("@onekeyfe")) | [.name, .version] | @tsv'Length of output: 1655
packages/providers/onekey-scdo-provider/package.json (1)
3-3
: Version updates look consistentPackage version and dependencies are all aligned to 2.2.7-alpha.1.
Also applies to: 31-34
packages/providers/onekey-webln-provider/package.json (1)
3-3
: Version updates look consistentPackage version and dependencies are all aligned to 2.2.7-alpha.1.
Since this is an alpha release, ensure proper testing before promoting to beta/stable.
Also applies to: 31-34
packages/providers/onekey-nostr-provider/package.json (1)
3-3
: Version updates look consistent.Package version and dependencies are all bumped to 2.2.7-alpha.1. The changes maintain version alignment across the @onekeyfe ecosystem.
Also applies to: 31-34
packages/providers/onekey-conflux-provider/package.json (1)
3-3
: Version updates are in sync.Package version and dependencies match the 2.2.7-alpha.1 update across the ecosystem.
Also applies to: 31-34
packages/providers/onekey-private-provider/package.json (1)
3-3
: Version updates are consistent.Package version and dependencies correctly updated to 2.2.7-alpha.1.
Note: The PR title mentions "Solana sign offchain message" feature, but I only see version bumps in these files. Are there additional files with the Solana-specific changes?
Also applies to: 31-34
packages/providers/onekey-cardano-provider/package.json (1)
3-3
: Version updates look good!Package version and all dependencies are consistently updated to 2.2.7-alpha.1.
Also applies to: 32-35
packages/providers/onekey-ton-provider/package.json (1)
3-3
: Version updates are consistent!Package version and OneKey dependencies are properly updated to 2.2.7-alpha.1.
Also applies to: 31-34
packages/providers/onekey-sui-provider/package.json (1)
3-3
: Version updates are aligned!Package version and OneKey dependencies are correctly updated to 2.2.7-alpha.1.
Let's verify version consistency across the monorepo:
Also applies to: 32-35
✅ Verification successful
Version consistency verified across the monorepo
All @onekeyfe packages and dependencies are correctly set to version 2.2.7-alpha.1. The verification shows perfect alignment across:
- 33 published packages
- All internal dependencies
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check version consistency across all package.json files # Find all package.json files and check their versions echo "Checking package versions:" fd package.json | xargs jq -r '. | select(.name | startswith("@onekeyfe")) | "\(.name): \(.version)"' # Check dependency versions echo -e "\nChecking @onekeyfe dependency versions:" fd package.json | xargs jq -r '.dependencies | to_entries[] | select(.key | startswith("@onekeyfe")) | "\(.key): \(.value)"'Length of output: 8850
packages/providers/onekey-eth-provider/package.json (1)
3-3
: Version updates look consistentAll @onekeyfe dependencies align with the package version bump to 2.2.7-alpha.1. Good job keeping versions in sync!
Let's verify version consistency across the monorepo:
Also applies to: 31-34
✅ Verification successful
Version consistency verified across all packages
All @onekeyfe packages are correctly set to version 2.2.7-alpha.1. The version bump is consistent across the entire monorepo.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check version consistency across all package.json files fd package.json | xargs jq -r '. | select(.name | startswith("@onekeyfe")) | .name + ": " + .version'Length of output: 1687
packages/providers/onekey-alph-provider/package.json (1)
3-3
: Version updates look goodPackage version and @onekeyfe dependencies are in sync at 2.2.7-alpha.1. Alephium dependencies remain stable at 1.5.2.
Let's check for any breaking changes in Alephium dependencies:
Also applies to: 34-37
✅ Verification successful
Version changes are compatible and safe
The package updates look clean and safe. All @onekeyfe dependencies are at 2.2.7-alpha.1, while Alephium dependencies (@alephium/web3, @alephium/get-extension-wallet, @alephium/walletconnect-provider) stay at 1.5.2. No breaking changes detected.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for breaking changes in package.json files mentioning Alephium rg -l "alephium" | xargs cat | jq -r 'select(.dependencies != null) | .dependencies | with_entries(select(.key | contains("alephium")))'Length of output: 229
Script:
#!/bin/bash # Let's try a different approach to check package.json cat packages/providers/onekey-alph-provider/package.json | jq '.dependencies'Length of output: 442
Script:
#!/bin/bash # Also check if there are any other Alephium-related files fd -t f -e json alphLength of output: 22
Script:
#!/bin/bash # Search for any Alephium version references in the codebase rg -i "alephium.*version|version.*alephium"Length of output: 45
Script:
#!/bin/bash # Check the git history for recent Alephium-related changes git log --oneline -n 10 | grep -i alphLength of output: 0
packages/providers/onekey-bfc-provider/package.json (1)
3-3
: Version updates are consistentPackage version and @onekeyfe dependencies match at 2.2.7-alpha.1. BFC.js dependency stays at 0.2.7.
Let's check for any breaking changes in BFC dependencies:
Also applies to: 32-35
✅ Verification successful
BFC dependencies are consistent and compatible
The verification shows:
@benfen/bfc.js
stays at version 0.2.7 in both the example and BFC provider packages- All imports and usage patterns are consistent
- No breaking changes in BFC-related dependencies across the codebase
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for breaking changes in package.json files mentioning BFC rg -l "bfc" | xargs cat | jq -r 'select(.dependencies != null) | .dependencies | with_entries(select(.key | contains("bfc")))'Length of output: 219
Script:
#!/bin/bash # Let's try a different approach to check BFC dependencies fd package.json | while read -r file; do echo "=== $file ===" cat "$file" | jq -r '.dependencies | select(. != null) | with_entries(select(.key | contains("bfc"))) // empty' doneLength of output: 9894
Script:
#!/bin/bash # Also check for any BFC-related imports or requires in the codebase rg -i "require.*bfc|import.*bfc" -g "!package.json" -g "!*.md"Length of output: 1430
Script:
#!/bin/bash # Check the specific package.json file cat packages/providers/onekey-bfc-provider/package.jsonLength of output: 1169
packages/providers/onekey-polkadot-provider/package.json (1)
3-3
: Version updates look consistent.The version bump to 2.2.7-alpha.1 matches across the package and its dependencies.
Let's verify version consistency across all packages:
Also applies to: 32-35
✅ Verification successful
Version consistency verified across all packages
All packages in the repository are using version 2.2.7-alpha.1, which matches the version bump in onekey-polkadot-provider. This includes:
- All core packages
- All provider packages
- All bridge packages
- All utility packages
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check version consistency across all package.json files find . -name "package.json" -type f -exec grep -H "\"version\":" {} \;Length of output: 27863
packages/core/package.json (1)
3-3
: Core package version aligns with other packages.Version 2.2.7-alpha.1 is consistent with related packages.
Also applies to: 32-34
packages/providers/onekey-cosmos-provider/package.json (1)
3-3
: Versions are in sync, but Solana changes seem missing.The version updates look good, but the PR title mentions Solana off-chain message signing. I don't see any Solana-related changes in the provided files.
Let's check for Solana-related files:
Also applies to: 32-35
packages/providers/onekey-tron-provider/package.json (1)
3-3
: Version updates look consistentPackage version and @onekeyfe dependencies are in sync at 2.2.7-alpha.1.
Let's check version consistency across all packages:
Also applies to: 32-35
✅ Verification successful
All @onekeyfe packages are in sync at version 2.2.7-alpha.1
The version check shows perfect alignment across all 33 @onekeyfe packages, including the tron provider. Each package uses version 2.2.7-alpha.1.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Find all package.json files and check versions fd package.json | xargs jq -r '. | select(.name | startswith("@onekeyfe")) | "\(.name): \(.version)"'Length of output: 1687
packages/providers/onekey-solana-provider/package.json (1)
3-3
: Version updates look consistentPackage version and @onekeyfe dependencies are in sync at 2.2.7-alpha.1.
Also applies to: 32-35
packages/providers/onekey-near-provider/package.json (1)
3-3
: Version updates look consistentPackage version and @onekeyfe dependencies are in sync at 2.2.7-alpha.1.
Also applies to: 38-41
packages/e2e/package.json (1)
4-4
: Version updates look consistentPackage version and dependencies are correctly bumped to 2.2.7-alpha.1.
Also applies to: 34-36
packages/providers/onekey-aptos-provider/package.json (1)
3-3
: Version updates are alignedPackage version and dependencies are correctly updated to 2.2.7-alpha.1.
Also applies to: 32-35
packages/injected/package.json (1)
3-3
: Version updates are consistentPackage version and dependencies are correctly updated to 2.2.7-alpha.1.
Let's verify version consistency across all packages:
Also applies to: 46-51
✅ Verification successful
All packages are in sync with version 2.2.7-alpha.1
The verification shows perfect version alignment across all packages. No references to the old version (2.2.7-alpha.0) were found in any dependencies.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check version consistency across all package.json files # Find all package.json files and check their versions echo "Checking package versions:" fd "package.json" | xargs jq -r '. | select(.version != null) | .name + ": " + .version' # Check if any package still references old version in dependencies echo -e "\nChecking for old version references:" fd "package.json" | xargs jq -r '.dependencies | select(. != null) | to_entries[] | select(.value | contains("2.2.7-alpha.0")) | .key + ": " + .value'Length of output: 1975
packages/providers/inpage-providers-hub/package.json (2)
3-3
: Version updates look consistentAll @onekeyfe packages are aligned at version 2.2.7-alpha.1. This maintains compatibility across the ecosystem.
Also applies to: 31-50
Line range hint
16-22
: Package exports configuration looks robustThe package properly supports both ESM and CommonJS through conditional exports. This ensures compatibility across different module systems.
packages/example/package.json (1)
3-3
: Version updates are in syncAll @onekeyfe dependencies are correctly updated to 2.2.7-alpha.1.
Also applies to: 31-41
Report too large to display inline |
Summary by CodeRabbit
New Features
Chores
2.2.7-alpha.0
to2.2.7-alpha.1