Conversation
Release: v2.9.0
commit 0928965 Author: julian.martinez <julian_martinez28@outlook.com> Date: Mon Jul 7 17:08:14 2025 -0700 end of buffer commit 2f286c9 Author: julian.martinez <julian_martinez28@outlook.com> Date: Mon Jul 7 15:59:32 2025 -0700 update okx provider logic commit 12b50c2 Merge: a687ae4 98ad4a2 Author: julian.martinez <julian_martinez28@outlook.com> Date: Mon Jul 7 15:49:53 2025 -0700 Merge branch 'main' of https://github.com/Julian-dev28/enKrypt commit a687ae4 Author: Julian Martinez <julian.martinez@okg.com> Date: Mon Jun 16 21:50:08 2025 -0700 update request/response params commit 98ad4a2 Author: julian.martinez <julian_martinez28@outlook.com> Date: Mon Jun 16 19:18:08 2025 -0700 update request/response params commit eff5837 Author: julian.martinez <julian_martinez28@outlook.com> Date: Thu Jun 12 18:39:25 2025 -0700 add okx provider commit 934e55b Author: julian.martinez <julian_martinez28@outlook.com> Date: Wed Jun 11 10:29:01 2025 -0700 add okx provider
add okx provider
WalkthroughThis update consists entirely of dependency version bumps across multiple Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Extension
participant EthereumNetworkProviders
participant SwapProviders
participant OKXAPI
User->>Extension: Request network info (AppLayer Testnet, CoreDAO)
Extension->>EthereumNetworkProviders: Query network configs and activity handlers
EthereumNetworkProviders-->>Extension: Return network data and activity info
Extension-->>User: Provide network info
User->>Extension: Request swap quote (OKX provider)
Extension->>SwapProviders: Forward quote request to OKX provider
SwapProviders->>OKXAPI: Fetch token list and quote from OKX API
OKXAPI-->>SwapProviders: Return quote data
SwapProviders-->>Extension: Return quote to user
User->>Extension: Request swap transaction (OKX provider)
Extension->>SwapProviders: Forward swap request to OKX provider
SwapProviders->>OKXAPI: Fetch swap transaction data
OKXAPI-->>SwapProviders: Return transaction data
SwapProviders-->>Extension: Return transaction to user
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
💼 Build Files |
Add CoreDAO network
There was a problem hiding this comment.
Actionable comments posted: 4
♻️ Duplicate comments (9)
packages/signers/bitcoin/package.json (1)
35-50: Same ESLint 9/Prettier 3 concerns as noted forextension-bridgeThe dev-dependency set mirrors the earlier package; please run its lint/test scripts under Node 18+ and address any rule churn.
packages/storage/package.json (1)
31-45: Same ESLint 9/Prettier 3 concerns as noted forextension-bridgeThe dev-dependency set mirrors the earlier package; please run its lint/test scripts under Node 18+ and address any rule churn.
packages/types/package.json (1)
28-41: Same ESLint 9/Prettier 3 concerns as noted forextension-bridgeThe dev-dependency set mirrors the earlier package; please run its lint/test scripts under Node 18+ and address any rule churn.
packages/signers/kadena/package.json (1)
31-48: Same ESLint/TS-ESLint mismatch as in signer-ethereumThe dev-dependency block still pins
@typescript-eslint/*to 8.x whileeslintis now 9.x.
Linting will crash for this package as well.Please align the versions as suggested in the ethereum signer package or revert ESLint to 8.x.
packages/swap/package.json (1)
42-58: Repeat of ESLint/TS-ESLint version skewSame comment as above – dev-deps are inconsistent (
eslint@9+@typescript-eslint@8).
Synchronise versions to restore linting.packages/signers/polkadot/package.json (1)
34-49: Same ESLint-9 / meta-package concerns as noted in@enkryptcom/request.packages/utils/package.json (1)
34-49: Same ESLint-9 / meta-package concerns as noted in@enkryptcom/request.packages/keyring/package.json (1)
38-52: Same ESLint-9 / meta-package concerns as noted in@enkryptcom/request.packages/hw-wallets/package.json (1)
25-41: Same ESLint-9 / meta-package concerns as noted in@enkryptcom/request.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (15)
package.json(1 hunks)packages/extension-bridge/package.json(1 hunks)packages/extension/package.json(5 hunks)packages/hw-wallets/package.json(2 hunks)packages/keyring/package.json(1 hunks)packages/name-resolution/package.json(2 hunks)packages/request/package.json(1 hunks)packages/signers/bitcoin/package.json(1 hunks)packages/signers/ethereum/package.json(1 hunks)packages/signers/kadena/package.json(1 hunks)packages/signers/polkadot/package.json(1 hunks)packages/storage/package.json(1 hunks)packages/swap/package.json(1 hunks)packages/types/package.json(1 hunks)packages/utils/package.json(1 hunks)
⏰ 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). (5)
- GitHub Check: test
- GitHub Check: test
- GitHub Check: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (8)
package.json (1)
37-38: Upgrade looks safe ‒ please regenerateyarn.lockand run CI
@swc/coreandconcurrentlyare both patch-level bumps, so no breaking-change risk is expected.
Just make sure to:
- re-run
yarn installso the lockfile picks up the new ranges, and- let CI execute the full test / build matrix to catch any hidden native-binding / spawn issues.
No further action required if CI passes.
packages/extension-bridge/package.json (1)
49-65: Ensure dependencies are installed & re-run ESLint 9 + Prettier 3 lint checkPlease install deps and verify linting under the new versions:
- Run
yarn installat the repo root.- Execute
yarn workspace @enkryptcom/extension-bridge lint --max-warnings=0.- If lint exits non-zero:
• Drop/rename any deprecated ESLint rules in.eslintrc.
• Bumpengines.nodeto>=18inpackages/extension-bridge/package.json.- Confirm
eslint-config-prettier@10fully neutralizes Prettier 3’s stricter formatting.packages/name-resolution/package.json (1)
50-52: Runtime dependency: confirm @bonfida/spl-name-service 3.0.12 is still ESM-safeUpgrading a Solana package occasionally introduces CommonJS/ESM interop issues.
Run the unit test suite for name-resolution against Node ≥18 to ensure dynamic import still works.packages/request/package.json (1)
28-31: ✔ Node engine compatibility verified
- json-rpc-2.0@1.7.1: no
enginesfield (no Node version restriction)- ws@8.18.3:
engines.node = ">=10.0.0"(Node 14.15+ is supported)No changes required.
packages/signers/polkadot/package.json (1)
27-29: Polkadot util patch looks good – only a micro bug-fix; no breaking API surface.packages/utils/package.json (1)
27-27: Safe bump –@polkadot/util-crypto@13.5.3is a patch release; no action required.packages/keyring/package.json (1)
32-32: Minor util bump acknowledged – API unchanged, 👍packages/hw-wallets/package.json (1)
55-67: No explicit Node engine constraints in upgraded hardware-wallet libs
I checked the npm metadata for the bumped packages (@ledgerhq/hw-app-btc@10.9.3, @ledgerhq/hw-transport@6.31.7, @trezor/connect@9.6.2) and none of them declare an “engines” field—so they don’t explicitly drop Node 14 support. However, many now ship ESM-only bundles.Please verify that your downstream builds (web extension, Electron, etc.) still compile and run correctly under your
"engines": ">=14.15.0"constraint.
Add AppLayer Testnet Network
devop: add core dao
feat: OKX sol swap
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (3)
packages/swap/tests/okx.test.ts (1)
1-554: Consider adding test timeouts and retry logic for flaky network tests.Since these tests make real API calls, they may be flaky due to network issues. Consider:
- Adding retry logic for failed API calls
- Using longer timeouts for network operations
- Potentially mocking API responses for more stable unit tests
packages/swap/src/providers/okx/index.ts (2)
740-741: Consider extracting fee percentage calculation for consistency.The fee percentage calculation
(feeConf.fee * 100)appears in multiple places. Consider extracting it to avoid potential inconsistencies.+ const feePercentage = feeConf.fee * 100; // Referral fee configuration using existing fee config - feePercent: (feeConf.fee * 100).toString(), // Convert to percentage + feePercent: feePercentage.toString(), // Convert to percentageLater in the return statement (line 819), use the same variable:
- feePercentage: feeConf.fee * 100, + feePercentage,
862-890: Consider adding more descriptive logging for address lookup table handling.The code handles versioned transactions with address lookup tables but the logging could be more descriptive about why the transaction is returned unmodified.
logger.info( - ` - Returning unmodified OKX transaction to preserve lookup table integrity`, + ` - Returning unmodified OKX versioned transaction with ${lookups.length} address lookup table(s) to preserve integrity`, );
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (9)
packages/extension/src/ui/action/views/swap/libs/solana-gasvals.ts(3 hunks)packages/extension/src/ui/action/views/swap/libs/swap-txs.ts(1 hunks)packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue(3 hunks)packages/swap/src/configs.ts(1 hunks)packages/swap/src/index.ts(2 hunks)packages/swap/src/providers/okx/index.ts(1 hunks)packages/swap/src/providers/okx/types.ts(1 hunks)packages/swap/src/types/index.ts(1 hunks)packages/swap/tests/okx.test.ts(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- packages/swap/src/index.ts
- packages/swap/src/types/index.ts
- packages/swap/src/configs.ts
- packages/swap/src/providers/okx/types.ts
⏰ 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: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (5)
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (1)
64-64: LGTM!The type assertion to
GasFeeTypeis appropriate sincegasCostValuesis already typed asPartial<GasFeeType>.packages/extension/src/ui/action/views/swap/libs/swap-txs.ts (1)
112-127: LGTM! Good simplification of Solana transaction handling.The removal of complex deserialization logic in favor of returning raw transaction data with metadata is a good architectural decision. This approach:
- Reduces complexity and potential points of failure
- Allows downstream consumers to handle deserialization as needed
- Properly flags the data as raw with
isRawData: truepackages/extension/src/ui/action/views/swap/libs/solana-gasvals.ts (3)
26-41: LGTM! Well-structured type extension for raw transactions.The new
RawTransactiontype and updatedTaggedTransactionunion properly extend the type system to handle raw transaction data. The type includes all necessary fields for tracking unprocessed transactions.
149-156: LGTM! Reasonable default fee for raw transactions.Using a default fee of 10000 lamports (0.00001 SOL) for raw transactions is appropriate as it represents a typical Solana transaction fee. The implementation correctly skips further processing for raw transactions.
204-210: LGTM! Good defensive programming.The error handling for null messages is appropriate, and using a fallback fee ensures the function doesn't fail unexpectedly.
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
packages/extension/src/providers/ethereum/networks/xlayer.ts (1)
23-23: Verify intentional disabling of activity handler for X Layer network.The activity handler has been replaced with a no-op function that returns an empty array, effectively disabling transaction history tracking for the X Layer network. This will impact user experience as transaction activities won't be displayed.
Given this is part of release preparation (v2.10), this might be intentional to ensure stability, but please confirm:
- Is this change temporary or permanent?
- Are there known issues with the X Layer activity provider that necessitate this change?
Consider adding a comment explaining the rationale:
- activityHandler: wrapActivityHandler(() => Promise.resolve([])), + // TODO: Temporarily disabled for release stability - re-enable after resolving provider issues + activityHandler: wrapActivityHandler(() => Promise.resolve([])),packages/extension/src/providers/ethereum/networks/sdn.ts (1)
4-5: Remove unused imports for activity handling.The imports
EtherscanActivityandwrapActivityHandlerare no longer being used since the activity handler has been replaced with a no-op function. Consider removing these unused imports to clean up the code.-import { EtherscanActivity } from '../libs/activity-handlers'; -import wrapActivityHandler from '@/libs/activity-state/wrap-activity-handler';
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
packages/extension/src/libs/dapp-list/index.ts(0 hunks)packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts(2 hunks)packages/extension/src/providers/ethereum/networks/aa.ts(0 hunks)packages/extension/src/providers/ethereum/networks/aat.ts(0 hunks)packages/extension/src/providers/ethereum/networks/index.ts(2 hunks)packages/extension/src/providers/ethereum/networks/sdn.ts(1 hunks)packages/extension/src/providers/ethereum/networks/xlayer.ts(1 hunks)packages/extension/src/providers/polkadot/libs/activity-handlers/providers/subscan/configs.ts(0 hunks)packages/extension/src/providers/polkadot/networks/unique/quartz.ts(1 hunks)packages/types/src/networks.ts(2 hunks)
💤 Files with no reviewable changes (4)
- packages/extension/src/libs/dapp-list/index.ts
- packages/extension/src/providers/polkadot/libs/activity-handlers/providers/subscan/configs.ts
- packages/extension/src/providers/ethereum/networks/aa.ts
- packages/extension/src/providers/ethereum/networks/aat.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts
- packages/types/src/networks.ts
- packages/extension/src/providers/ethereum/networks/index.ts
⏰ 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: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (1)
packages/extension/src/providers/polkadot/networks/unique/quartz.ts (1)
28-28: Verify intentional disabling of Quartz network activityHandlerThe
activityHandlerinpackages/extension/src/providers/polkadot/networks/unique/quartz.tswas changed to a no-op (wrapActivityHandler(() => Promise.resolve([]))), which removes transaction history for Quartz. Similar changes exist for Edgeware, Pendulum, Solana, and all Ethereum networks, but Subscan still supports Quartz endpoints.Please clarify:
- Is Quartz activity currently unsupported by Subscan (or another API)?
- If intentional, add a comment (e.g.
// Quartz not yet supported by Subscan) and link to an issue or documentation.- If unintentional, revert to
wrapActivityHandler(subscanActivity).Location to review:
- packages/extension/src/providers/polkadot/networks/unique/quartz.ts – line 28
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
packages/swap/tests/okx.test.ts (2)
281-312: Remove or conditionally enable console.log statements in tests.Test files should not contain console.log statements by default. Consider using a debug flag or test utilities for logging.
446-465: Remove debug console.log statements from test assertions.These console.log statements appear to be leftover debugging code and should be removed from the test.
🧹 Nitpick comments (2)
packages/swap/tests/okx.test.ts (2)
353-383: Remove debug console.log statements.These console.log statements should be removed or wrapped in a conditional debug flag to keep test output clean.
- console.log( - "🚀 Testing SOL -> USDC swap with Wrapped SOL account detection", - ); + // Testing SOL -> USDC swap with Wrapped SOL account detection const solQuote = await okx.getQuote(solQuoteOptions, { infiniteApproval: true, walletIdentifier: WalletIdentifier.enkrypt, slippage: "0.5", }); - console.log("🔍 SOL quote result:", solQuote ? "SUCCESS" : "FAILED"); if (solQuote) { expect(solQuote).not.toBeNull(); expect(solQuote.provider).toBe(ProviderName.okx); - console.log("🔍 Getting SOL swap transaction..."); const solSwap = await okx.getSwap(solQuote.quote); - console.log("🔍 SOL swap result:", solSwap ? "SUCCESS" : "FAILED"); if (solSwap) { expect(solSwap).not.toBeNull(); expect(solSwap.transactions[0]).toHaveProperty("kind"); expect((solSwap.transactions[0] as SolanaTransaction).kind).toBe( "versioned", ); - console.log("✅ SOL swap transaction created successfully"); - console.log( - "✅ Wrapped SOL account detection and creation logic executed", - ); }
474-494: Remove remaining debug console statements.Additional console.log and console.error statements should be removed to maintain clean test output.
let tx: LegacyTransaction; try { tx = LegacyTransaction.from(buffer); - console.log("Successfully deserialized legacy transaction"); } catch (e) { - console.error("Failed to deserialize legacy transaction:", e); // For now, let's just log the error and continue with basic tests // The transaction structure might be different for OKX expect(swap!.transactions[0]).toHaveProperty("serialized"); expect(swap!.transactions[0]).toHaveProperty("from"); expect(swap!.transactions[0]).toHaveProperty("to"); expect(swap!.transactions[0]).toHaveProperty("type"); expect(swap!.transactions[0]).toHaveProperty("kind"); expect((swap!.transactions[0] as SolanaTransaction).kind).toBe( "versioned", ); return; // Skip the detailed transaction analysis for now } // If we get here, the transaction was successfully deserialized // For legacy transactions, we can directly access instructions - console.log( - `Legacy transaction has ${tx.instructions.length} instructions`, - );
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/swap/src/providers/okx/index.ts(1 hunks)packages/swap/tests/okx.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/swap/src/providers/okx/index.ts
⏰ 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: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (2)
packages/swap/tests/okx.test.ts (2)
1-36: LGTM!The test suite setup and imports are appropriate for testing the OKX provider with real API calls.
38-41: LGTM!Basic initialization test correctly verifies provider instantiation.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/extension/src/providers/ethereum/networks/hoodi.ts (1)
1-1: Consider using a Hoodi-specific icon.The configuration uses the generic Ethereum icon (
eth.webp) instead of a Hoodi-specific icon. Consider adding a dedicated icon for better network identification in the UI.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
packages/extension/src/libs/dapp-list/index.ts(0 hunks)packages/extension/src/providers/ethereum/networks/holesky.ts(0 hunks)packages/extension/src/providers/ethereum/networks/hoodi.ts(1 hunks)packages/extension/src/providers/ethereum/networks/index.ts(4 hunks)packages/types/src/networks.ts(3 hunks)
💤 Files with no reviewable changes (2)
- packages/extension/src/libs/dapp-list/index.ts
- packages/extension/src/providers/ethereum/networks/holesky.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- packages/types/src/networks.ts
- packages/extension/src/providers/ethereum/networks/index.ts
⏰ 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). (1)
- GitHub Check: buildAll
🔇 Additional comments (3)
packages/extension/src/providers/ethereum/networks/hoodi.ts (3)
18-18: Activity handler implementation is consistent.The wrapped activity handler that returns an empty array is consistent with the pattern used for other networks in this release, as mentioned in the AI summary.
21-23: Network instantiation and export follow standard pattern.The EvmNetwork instantiation and default export follow the established pattern used throughout the codebase for network configurations.
6-19: Please confirm WebSocket handshake connectivity for the Hoodi node
- Chain ID
0x88bb0→ decimal 560048 ✓- Block explorer
https://hoodi.etherscan.ioreturns HTTP 200 ✓- WebSocket endpoint
wss://nodes.mewapi.io/ws/hoodiresponds (HTTP 403) on a plain GET—please test a real WebSocket handshake (e.g. withwebsocator a browser console) to ensure the node is accepting connectionsNo code changes required; just verify the live WSS handshake before merging.
Summary by CodeRabbit