Skip to content

Comments

release: v2.13.0#761

Merged
kvhnuke merged 27 commits intomainfrom
develop
Oct 2, 2025
Merged

release: v2.13.0#761
kvhnuke merged 27 commits intomainfrom
develop

Conversation

@kvhnuke
Copy link
Contributor

@kvhnuke kvhnuke commented Oct 2, 2025

Summary by CodeRabbit

  • New Features

    • Added RFQ swap support via 1inch Fusion, including order submission and signature flow.
    • Swap UI now signs RFQ typed data and tracks confirmations, showing a “Waiting for transactions to be mined” message.
    • Improved token wrapping/approvals handling and provider responses include swap type.
  • Improvements

    • Updated block explorer API endpoints for broader EVM network coverage.
    • RFQ-aware filtering and option retrieval in swap flows.
    • Graceful gas-fee fallback when estimates are unavailable.
  • Bug Fixes

    • Safer error handling in swap providers to avoid hard failures.
  • UI

    • Removed survey popup.
  • Chores

    • Widespread dependency updates and version bumps.

@coderabbitai
Copy link

coderabbitai bot commented Oct 2, 2025

Walkthrough

Introduces RFQ swap support via a new OneInch Fusion provider, RFQ types and flows, approvals/wrapper utilities, and UI wiring including typed-data signing and receipt waiting. Updates Etherscan endpoints and URL construction. Removes survey popup. Adds guards and helpers in swap libs, adjusts swap types/responses, and bumps various dependencies.

Changes

Cohort / File(s) Summary
Dependency bumps
package.json, packages/*/package.json (many)
Version updates across dev/runtime dependencies; no code changes. Extension version bumped to 2.13.0.
RFQ core types and provider wiring
packages/swap/src/types/index.ts, packages/swap/src/index.ts, packages/swap/src/configs.ts
Adds SwapType enum, RFQ option interfaces, ProviderWithRFQ, ProviderName.oneInchFusion, submitRFQOrder method, fee config for OneInchFusion, and GAS_LIMITS.Wrap.
New OneInch Fusion provider
packages/swap/src/providers/oneInchFusion/index.ts, packages/swap/src/providers/oneInchFusion/types.ts
Adds RFQ-capable provider using FusionSDK: quotes, swaps (typed messages), status, and RFQ order submission.
Provider response harmonization
packages/swap/src/providers/{changelly,jupiter,okx,oneInch,paraswap,rango,zerox}/index.ts
Adds type: SwapType.regular to swap responses; exports supportedNetworks in oneInch and removes Kaia/Aurora; endpoint updates in Jupiter; minor error-handling tweaks.
Approvals and wrapping utilities
packages/swap/src/utils/approvals.ts, packages/swap/src/utils/abi/wrapper.ts
Adds wrapper ABI, wrap-balance check, native wrap tx builder; expands exports; changes getAllowanceTransactions fromToken param to { address: string }.
Extension swap UI RFQ integration
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue, .../swap/index.vue, .../swap-initiated/index.vue, .../libs/evm-waitreceipt.ts, .../libs/evm-gasvals.ts, .../types.ts
Adds RFQ filtering/options, typed-data signing for RFQ, wait-for-receipt helper, waitingToBeMined prop/state, zero-fee guard when gasVals empty, extends ProviderResponseWithStatus with rfqOptions.
Etherscan endpoint updates
packages/extension/src/providers/ethereum/.../etherscan/configs.ts, .../etherscan/index.ts
Standardizes endpoints to API-style URLs and removes “api?” in constructed request path.
UI cleanup
packages/extension/src/ui/action/components/app-menu/index.vue, packages/extension/src/providers/common/libs/new-features.ts
Removes survey popup usage/logic; clears newNetworks array.
Massa signer updates
packages/signers/massa/src/crypto/{blake3.ts,ed25519.ts}, packages/signers/massa/tests/sign.test.ts
Switches noble ed25519 imports/sha512Sync wiring; formatting; adds valid-signature test and keeps invalid-signature test.
Swap tests
packages/swap/tests/{oneInchFusion.test.ts,swap.test.ts}
Adds OneInchFusion provider tests and asserts inclusion in aggregated quotes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant UI as Extension UI (Swap Best Offer)
  participant SW as Swap lib
  participant P as OneInchFusion Provider
  participant SDK as FusionSDK
  participant CH as Chain (EVM)

  U->>UI: Initiate RFQ swap
  UI->>SW: getQuotes()
  SW->>P: getQuote(options, meta)
  P->>SDK: getQuote/createOrder (approx)
  SDK-->>P: Quote/Order data
  P-->>SW: ProviderQuoteResponse (type=rfq)
  SW-->>UI: Quotes with RFQ getRFQObject()

  UI->>SW: getSwap(selected RFQ)
  SW->>P: getSwap(quote)
  P->>SDK: getQuote/createOrder (accurate)
  SDK-->>P: Order + typedMessages + txs
  P-->>SW: ProviderSwapResponse {typedMessages[], transactions[], getRFQObject}

  UI->>UI: Sign typedMessages (EIP-712)
  UI->>CH: Send approval/wrap/swap tx(s)
  UI->>CH: Wait for receipts (waitForReceipt)
  CH-->>UI: Receipts mined

  UI->>SW: submitRFQOrder(RFQOptionsResponse + signatures)
  SW->>P: submitRFQOrder(options)
  P->>SDK: submitOrder(relayer request)
  SDK-->>P: orderHash
  P-->>SW: orderHash
  SW-->>UI: Finalize & update activity
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • gamalielhere

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly conveys the primary purpose of the pull request, which is to release version 2.13.0 of the project; it is clear, specific, and directly related to the main change without extraneous detail.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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.

❤️ Share

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

@github-actions
Copy link

github-actions bot commented Oct 2, 2025

💼 Build Files
chrome: enkrypt-chrome-94a605da.zip
firefox: enkrypt-firefox-94a605da.zip

💉 Virus total analysis
chrome: 94a605da
firefox: 94a605da

Merge pull request #757 from enkryptcom/develop
Copy link

@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: 11

Caution

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

⚠️ Outside diff range comments (6)
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/index.ts (1)

61-66: Hard-coded OKLink API key in source

The API key is embedded in the extension bundle. High risk: exposure, rotation pain, and potential abuse.

Recommendations:

  • Load from a secrets/config facility (env at build-time, managed settings, or remote-config), not source.
  • Pass via header only when present; add telemetry to detect missing key.
  • If bundling is unavoidable, gate by environment and rotate immediately.

I can draft a small config wrapper for injecting per-network API keys and wiring it here. Want me to proceed?

packages/swap/src/providers/changelly/index.ts (1)

842-872: Fix NaN risk in Solana priority fee calculation (can produce invalid tx).

If all recent prioritization fees are zero, recentFeeCountWithoutZeroes is 0, so recentFeeMean becomes NaN and recentFeeMinAvg also becomes NaN. This hits the else-branch and sets ComputeUnitPrice with NaN, yielding an invalid transaction.

Apply safe guards and integer microLamports:

-            const recentFeeMean = recentFeeSum / recentFeeCountWithoutZeroes;
-            const recentFeeMinAvg = Math.min(recentFeeMean, recentFeeMedian);
+            const hasNonZero = recentFeeCountWithoutZeroes > 0;
+            const recentFeeMean = hasNonZero
+              ? recentFeeSum / recentFeeCountWithoutZeroes
+              : 0;
+            const recentFeeMinAvg = hasNonZero
+              ? Math.min(recentFeeMean, recentFeeMedian)
+              : 0;
...
-            if (recentFeeMinAvg <= 0) {
+            if (!Number.isFinite(recentFeeMinAvg) || recentFeeMinAvg <= 0) {
               logger.info(
                 `getSwap: No recent fees, not setting priority fee` +
...
-            } else {
+            } else {
               logger.info(
                 `getSwap: Setting priority fee` +
                   `  priority_fee=${recentFeeMinAvg} micro_lamports/compute_unit` +
...
-              instructions.unshift(
-                ComputeBudgetProgram.setComputeUnitPrice({
-                  microLamports: recentFeeMinAvg,
-                }),
-              );
+              instructions.unshift(
+                ComputeBudgetProgram.setComputeUnitPrice({
+                  microLamports: Math.trunc(recentFeeMinAvg),
+                }),
+              );
             }

Also applies to: 879-910

packages/swap/src/providers/jupiter/index.ts (3)

1007-1015: Bug: undefined identifier quote (should check swap).

This will not compile and breaks the flow.

-      if (!quote) {
+      if (!swap) {
         throw new Error(
           `Failed to get Jupiter swap at url ${url}, something went wrong and result is falsy`,
         );
       }

469-475: Harden error paths and remove stray console.log.

Use optional chaining for context and remove noisy console.log.

-      console.log(err);
-      if (!context.signal.aborted) {
+      if (!context?.signal?.aborted) {
         console.error(
           `[Jupiter.getQuote] Error calling getQuote: ${String(err)}`,
         );
       }
...
-      if (!context.signal.aborted) {
+      if (!context?.signal?.aborted) {
         console.error(
           `[Jupiter.getSwap] Error calling getSwap: ${String(err)}`,
         );
       }

Also applies to: 526-532


445-451: Avoid precision loss: compute outAmount with BN using basis points.

Converting large integer strings to Number risks overflow/precision loss. Use BN and bps arithmetic.

-        toTokenAmount: toBN(
-          Math.floor((1 - feePercentage / 100) * Number(jupiterQuote.outAmount))
-            .toFixed(10)
-            .replace(/\.?0+$/, ""),
-        ),
+        // feePercentage is percent; convert to bps to keep integer math
+        toTokenAmount: (() => {
+          const out = toBN(jupiterQuote.outAmount);
+          const feeBps = Math.round(feePercentage * 100);
+          return out.mul(toBN((10000 - feeBps).toString())).div(toBN("10000"));
+        })(),
...
-        toTokenAmount: toBN(
-          Math.floor((1 - feePercentage / 100) * Number(jupiterQuote.outAmount))
-            .toFixed(10)
-            .replace(/\.?0+$/, ""),
-        ),
+        toTokenAmount: (() => {
+          const out = toBN(jupiterQuote.outAmount);
+          const feeBps = Math.round(feePercentage * 100);
+          return out.mul(toBN((10000 - feeBps).toString())).div(toBN("10000"));
+        })(),

Also applies to: 505-512

packages/swap/src/providers/rango/index.ts (1)

1124-1154: Initialize totalGaslimit before Solana aggregation

totalGaslimit is declared but never initialized before the Solana branch adds to it, so the first += produces NaN. That propagates through the quote response and breaks downstream fee handling for any Solana route. Please initialize it (e.g. let totalGaslimit = 0;) before the switch or at the start of the Solana branch.

-    let totalGaslimit: number;
+    let totalGaslimit = 0;
     switch (res.networkTransactions.type) {
       case NetworkType.EVM: {
-        totalGaslimit = res.networkTransactions.transactions.reduce(
+        totalGaslimit = res.networkTransactions.transactions.reduce(
             (total: number, curVal: EVMTransaction) =>
               total + toBN(curVal.gasLimit).toNumber(),
           0,
         );
         break;
       }
       case NetworkType.Solana: {
-        for (
+        totalGaslimit = 0;
+        for (
             let i = 0, len = res.networkTransactions.transactions.length;
             i < len;
             i++
         ) {
           const tx = res.networkTransactions.transactions[i];
           totalGaslimit += extractComputeBudget(
             VersionedTransaction.deserialize(
               Buffer.from(tx.serialized, "base64"),
             ),
           );
         }
         break;
       }
♻️ Duplicate comments (1)
packages/request/package.json (1)

30-30: Verify uuid v13 and check for breaking changes.

The uuid dependency jumps from ^11.1.0 to ^13.0.0, matching the same change in packages/swap/package.json. This unusual version jump requires verification (see comment on swap/package.json).

🧹 Nitpick comments (17)
packages/extension/src/ui/action/components/app-menu/index.vue (1)

168-173: Consider removing commented-out code or tracking it in an issue.

The commented-out survey-popup template code is left as a placeholder for future use. While the intent is clear, leaving commented-out code in the codebase can reduce maintainability and clutter the file. Consider one of the following:

  1. Remove the commented-out code entirely if there's no immediate plan to reintroduce it.
  2. If the feature is planned for the future, track it in a separate issue or task and reference it in a TODO comment instead of leaving the full code block commented out.

Apply this diff to replace the commented-out code with a TODO comment:

-      <!-- Leaving this here for future use -->
-      <!-- <survey-popup
-        v-else-if="isSurveyPopup && isExpanded"
-        key="survey-popup"
-        @close="closeSurveyPopup"
-      /> -->
+      <!-- TODO: Add survey-popup component here when needed (tracked in issue #XXX) -->
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/index.ts (2)

21-28: Build URL with URLSearchParams instead of string concat

Avoid relying on endpoints ending with '?' or '&'. Safer and clearer with URL + searchParams; auto-encodes address and preserves existing query (e.g., chainid).

-  return cacheFetch(
-    {
-      // Note: would like to add offset=50 (i.e. results per page) but it seems to cause polygon API to hang
-      url: `${endpoint}module=account&action=txlist&address=${address}&sort=desc`,
-      headers,
-    },
-    TTL,
-  ).then(res => {
+  const url = new URL(endpoint);
+  // Note: would like to add offset=50 (i.e. results per page) but it seems to cause polygon API to hang
+  url.searchParams.set('module', 'account');
+  url.searchParams.set('action', 'txlist');
+  url.searchParams.set('address', address);
+  url.searchParams.set('sort', 'desc');
+  return cacheFetch(
+    {
+      url: url.toString(),
+      headers,
+    },
+    TTL,
+  ).then(res => {

68-70: Minor: rename enpoint → endpoint

Typo harms readability; also rename Promises → promises.

-  const enpoint =
-    NetworkEndpoints[network.name as keyof typeof NetworkEndpoints];
-  const activities = await getAddressActivity(address, enpoint, headers);
+  const endpoint =
+    NetworkEndpoints[network.name as keyof typeof NetworkEndpoints];
+  const activities = await getAddressActivity(address, endpoint, headers);
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts (2)

56-66: OKLink/XLayer path compatibility

These OKLink endpoints appear to append an extra '/api?' segment (e.g., /api/v5/explorer/xlayer/api?). Ensure they actually accept Etherscan-style params (module, action), or switch to native OKLink endpoints with their documented params.

I can adapt getAddressActivity to support provider-specific param shapes if OKLink isn’t Etherscan-compatible. Want a small adapter?


3-73: Normalize endpoints and use URL builder

  • Remove all trailing ?/& from base URLs in configs.ts (fix the duplicate /api/api? entries at lines 65 and 70)
  • In callers, build query strings with new URL() and URLSearchParams instead of manual ?/& concatenation
packages/swap/package.json (1)

25-26: LGTM!

The addition of @1inch/fusion-sdk and @1inch/limit-order-sdk aligns with the PR's objective to introduce RFQ swap support. The versions specified are appropriate.

Based on learnings, the latest stable version of @1inch/limit-order-sdk is 5.2.0. Consider updating from ^5.0.4 to ^5.2.0 for the latest fixes and features, but the current version is acceptable for this release.

packages/utils/package.json (1)

30-30: Consider planning migration to web3-utils 4.x.

The package uses web3-utils ^1.10.4, which is from the legacy 1.x series. The latest stable version is 4.3.3, featuring a TypeScript-first rewrite with improved types and modular exports. Key breaking changes include Buffer → Uint8Array transitions. Plan a migration to 4.x for continued support and security fixes.

Based on learnings.

packages/extension/src/ui/action/views/swap/libs/evm-waitreceipt.ts (1)

4-20: Consider adding error handling and configurable polling interval.

The function lacks error handling if getTransactionReceipt throws, and uses a hardcoded 2-second polling interval. Consider:

  • Wrapping the polling in a try-catch to handle RPC failures gracefully.
  • Making the polling interval configurable or adaptive.
  • Logging warnings when approaching timeout.
packages/extension/package.json (1)

87-88: Consider upgrading to web3.js v4.

The codebase uses web3-eth@^1.10.4 and web3-utils@^1.10.4 from the older 1.x series. Based on learnings, the latest stable versions are:

  • web3-utils: 4.3.3
  • web3-eth: 4.11.1

The v4 rewrite offers TypeScript-first design, modular packages, improved types, and Uint8Array over Buffer. Migration would require following the official v4 migration guide due to breaking changes (API renames, type changes, middleware differences).

Based on learnings.

packages/swap/tests/oneInchFusion.test.ts (1)

22-27: Avoid async describe and ensure provider init awaits.

Use beforeAll to perform async setup and remove async on describe to prevent harness issues.

-describe("OneInchFusion Provider", async () => {
-  // @ts-ignore
-  const web3eth = new Web3Eth(nodeURL);
-  const oneInch = new OneInchFusion(web3eth, SupportedNetworkName.Ethereum);
-  oneInch.init([]);
+describe("OneInchFusion Provider", () => {
+  // @ts-ignore
+  const web3eth = new Web3Eth(nodeURL);
+  const oneInch = new OneInchFusion(web3eth, SupportedNetworkName.Ethereum);
+  beforeAll(async () => {
+    await oneInch.init([]);
+  });
packages/swap/src/providers/jupiter/index.ts (1)

1059-1062: Remove debug log from sleep helper.

Stray console.log is noisy in tests and production.

-  console.log(abortable);
-  if (abortable?.signal?.aborted)
+  if (abortable?.signal?.aborted)
     return Promise.reject(abortable.signal.reason);
packages/swap/src/index.ts (1)

247-250: Harden submitRFQOrder provider lookup

If the provider isn’t found (or doesn’t implement RFQ), the cast to ProviderWithRFQ throws at runtime. Add an explicit check so we fail fast with a clear error rather than Cannot read properties of undefined.

-    const provider = this.providers.find((p) => p.name === options.provider);
-    return (provider as ProviderWithRFQ).submitRFQOrder(options.options);
+    const provider = this.providers.find((p) => p.name === options.provider);
+    if (
+      !provider ||
+      typeof (provider as ProviderWithRFQ).submitRFQOrder !== "function"
+    ) {
+      throw new Error(`RFQ provider ${options.provider} is not available`);
+    }
+    return (provider as ProviderWithRFQ).submitRFQOrder(options.options);
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (1)

326-333: Remove leftover debugging log

This console log dumps every trade on mount; please delete it to avoid noisy production logs.

-  swapData.trades.forEach((trade, index) => {
-    console.log(`Trade ${index + 1}:`, {
-      provider: trade.provider,
-      fromAmount: trade.fromTokenAmount.toString(),
-      toAmount: trade.toTokenAmount.toString(),
-      additionalFees: trade.additionalNativeFees.toString(),
-    });
-  });
packages/swap/src/providers/oneInchFusion/index.ts (4)

96-100: Prefer direct key-in check for supported networks

Minor: Object.keys(...).includes(...) allocates an array and casts; network in supportedNetworks is simpler and type-safe.

-  static isSupported(network: SupportedNetworkName) {
-    return Object.keys(supportedNetworks).includes(
-      network as unknown as string,
-    );
-  }
+  static isSupported(network: SupportedNetworkName) {
+    return network in supportedNetworks;
+  }

200-211: Guard gas estimate result length to avoid undefined gasLimit

If estimateEVMGasList returns fewer results than transactions.length, indexing result[idx] can assign undefined gasLimit.

-          if (accurateGasEstimate) {
+          if (accurateGasEstimate) {
             if (accurateGasEstimate.isError) return null;
-            transactions.forEach((tx, idx) => {
-              tx.gasLimit = accurateGasEstimate.result[idx];
-            });
+            transactions.forEach((tx, idx) => {
+              const est = accurateGasEstimate.result[idx];
+              if (est) tx.gasLimit = est;
+            });
           }

141-149: Expose permit2 via meta to reduce approvals when supported

You hardcode isPermit2: false. Allow passing this via meta (or provider-level config) to leverage Permit2 when available and reduce on-chain approvals.

-      enableEstimate: false,
-      isPermit2: false,
+      enableEstimate: false,
+      isPermit2: Boolean((meta as any)?.isPermit2),

304-314: Status mapping: consider handling more Fusion statuses explicitly

Optional: Map additional statuses (e.g., Cancelled, Expired) distinctly if your UI differentiates them, rather than lumping into failed.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0b090a and 94a605d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (45)
  • package.json (1 hunks)
  • packages/extension-bridge/package.json (2 hunks)
  • packages/extension/package.json (6 hunks)
  • packages/extension/src/providers/common/libs/new-features.ts (1 hunks)
  • packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts (1 hunks)
  • packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/index.ts (1 hunks)
  • packages/extension/src/ui/action/components/app-menu/index.vue (1 hunks)
  • packages/extension/src/ui/action/views/swap-initiated/index.vue (2 hunks)
  • packages/extension/src/ui/action/views/swap/index.vue (2 hunks)
  • packages/extension/src/ui/action/views/swap/libs/evm-gasvals.ts (1 hunks)
  • packages/extension/src/ui/action/views/swap/libs/evm-waitreceipt.ts (1 hunks)
  • packages/extension/src/ui/action/views/swap/types.ts (2 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (8 hunks)
  • packages/hw-wallets/package.json (3 hunks)
  • packages/keyring/package.json (2 hunks)
  • packages/name-resolution/package.json (2 hunks)
  • packages/request/package.json (2 hunks)
  • packages/signers/bitcoin/package.json (2 hunks)
  • packages/signers/ethereum/package.json (2 hunks)
  • packages/signers/kadena/package.json (2 hunks)
  • packages/signers/massa/package.json (2 hunks)
  • packages/signers/massa/src/crypto/blake3.ts (1 hunks)
  • packages/signers/massa/src/crypto/ed25519.ts (2 hunks)
  • packages/signers/massa/tests/sign.test.ts (1 hunks)
  • packages/signers/polkadot/package.json (3 hunks)
  • packages/storage/package.json (2 hunks)
  • packages/swap/package.json (3 hunks)
  • packages/swap/src/configs.ts (2 hunks)
  • packages/swap/src/index.ts (4 hunks)
  • packages/swap/src/providers/changelly/index.ts (2 hunks)
  • packages/swap/src/providers/jupiter/index.ts (5 hunks)
  • packages/swap/src/providers/okx/index.ts (2 hunks)
  • packages/swap/src/providers/oneInch/index.ts (3 hunks)
  • packages/swap/src/providers/oneInchFusion/index.ts (1 hunks)
  • packages/swap/src/providers/oneInchFusion/types.ts (1 hunks)
  • packages/swap/src/providers/paraswap/index.ts (3 hunks)
  • packages/swap/src/providers/rango/index.ts (2 hunks)
  • packages/swap/src/providers/zerox/index.ts (3 hunks)
  • packages/swap/src/types/index.ts (6 hunks)
  • packages/swap/src/utils/abi/wrapper.ts (1 hunks)
  • packages/swap/src/utils/approvals.ts (3 hunks)
  • packages/swap/tests/oneInchFusion.test.ts (1 hunks)
  • packages/swap/tests/swap.test.ts (3 hunks)
  • packages/types/package.json (2 hunks)
  • packages/utils/package.json (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (11)
packages/swap/src/configs.ts (2)
packages/swap/src/index.ts (1)
  • WalletIdentifier (263-263)
packages/utils/src/index.ts (1)
  • numberToHex (46-46)
packages/signers/massa/src/crypto/blake3.ts (1)
packages/signers/massa/src/crypto/interfaces/hasher.ts (1)
  • Hasher (2-4)
packages/swap/src/providers/oneInchFusion/types.ts (1)
packages/swap/src/types/index.ts (2)
  • EVMTransaction (163-170)
  • BN (47-47)
packages/signers/massa/src/crypto/ed25519.ts (1)
packages/signers/massa/src/crypto/interfaces/signer.ts (1)
  • Signer (2-11)
packages/swap/src/types/index.ts (1)
packages/swap/src/index.ts (1)
  • ProviderSwapResponse (270-270)
packages/signers/massa/tests/sign.test.ts (1)
packages/signers/massa/src/index.ts (1)
  • MassaSigner (11-59)
packages/swap/src/utils/approvals.ts (2)
packages/swap/src/types/index.ts (2)
  • BN (47-47)
  • EVMTransaction (163-170)
packages/utils/src/index.ts (1)
  • numberToHex (46-46)
packages/extension/src/ui/action/views/swap/types.ts (1)
packages/swap/src/types/index.ts (1)
  • RFQOptionsResponse (254-257)
packages/swap/src/index.ts (1)
packages/swap/src/types/index.ts (1)
  • RFQOptionsResponse (254-257)
packages/swap/tests/oneInchFusion.test.ts (4)
packages/swap/src/types/index.ts (1)
  • EVMTransaction (163-170)
packages/swap/src/providers/oneInch/index.ts (1)
  • ONEINCH_APPROVAL_ADDRESS (37-38)
packages/swap/src/utils/approvals.ts (1)
  • TOKEN_AMOUNT_INFINITY_AND_BEYOND (8-9)
packages/utils/src/index.ts (1)
  • numberToHex (46-46)
packages/swap/src/providers/oneInchFusion/index.ts (6)
packages/swap/src/types/index.ts (12)
  • TokenType (49-60)
  • MinMaxResponse (205-210)
  • getQuoteOptions (143-149)
  • QuoteMetaOptions (107-114)
  • EVMTransaction (163-170)
  • ProviderQuoteResponse (218-230)
  • SwapQuote (212-216)
  • ProviderSwapResponse (259-276)
  • RFQOptionsResponse (254-257)
  • StatusOptions (244-247)
  • StatusOptionsResponse (249-252)
  • RFQOptions (239-242)
packages/swap/src/providers/oneInch/index.ts (1)
  • supportedNetworks (39-82)
packages/swap/src/utils/common.ts (1)
  • isEVMAddress (13-19)
packages/swap/src/utils/approvals.ts (4)
  • TOKEN_AMOUNT_INFINITY_AND_BEYOND (8-9)
  • getAllowanceTransactions (171-171)
  • isSufficientWrappedAvailable (174-174)
  • getNativeWrapTx (173-173)
packages/swap/src/providers/oneInchFusion/types.ts (1)
  • OneInchSwapResponse (3-13)
packages/swap/src/configs.ts (3)
  • NATIVE_TOKEN_ADDRESS (144-144)
  • FEE_CONFIGS (142-142)
  • DEFAULT_SLIPPAGE (148-148)
⏰ 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). (2)
  • GitHub Check: buildAll
  • GitHub Check: test
🔇 Additional comments (44)
packages/signers/massa/src/crypto/blake3.ts (1)

1-2: LGTM! Formatting-only changes.

The import statements and return statement have been updated with double quotes and trailing semicolons. No logic or behavior changes.

Also applies to: 10-10

packages/signers/massa/src/crypto/ed25519.ts (2)

1-4: LGTM! Correct namespace import and SHA512 wiring.

The refactor to a namespace import (import * as ed) and the SHA512 synchronous wiring on line 4 follow the standard pattern for @noble/ed25519. The implementation correctly uses ed.etc.concatBytes and delegates to the synchronous sha512 function from @noble/hashes/sha2.


11-11: LGTM! API calls correctly updated.

All ed25519 API calls have been correctly updated to use the namespace prefix (ed.getPublicKey, ed.sign, ed.verify, ed.utils.randomPrivateKey). The parameter order and signatures match the @noble/ed25519 library's API.

Also applies to: 16-16, 21-21, 30-30

packages/extension/src/providers/common/libs/new-features.ts (1)

3-3: LGTM!

Removing Massa from the newNetworks array is a straightforward cleanup. This change likely indicates that Massa is no longer considered a new network feature.

package.json (2)

37-37: LGTM!

The patch bump for @swc/core from 1.13.5 to 1.13.19 is a routine update that should be safe.


35-36: Note commitlint v20 URL exception in body-max-line-length rule
commitlint v20 now ignores lines containing URLs when enforcing body-max-line-length—ensure this change aligns with your commit message policy.

packages/swap/package.json (1)

44-48: LGTM!

The devDependency updates for TypeScript tooling are routine maintenance updates.

Also applies to: 58-58

packages/signers/ethereum/package.json (1)

35-39: LGTM!

The devDependency updates are routine maintenance updates for TypeScript and ESLint tooling. All changes are patch or minor version bumps that should be safe.

Also applies to: 49-49

packages/types/package.json (1)

28-31: LGTM!

The devDependency updates follow the same pattern as other packages in this PR and are routine maintenance updates.

Also applies to: 42-42

packages/keyring/package.json (1)

38-41: LGTM!

The devDependency updates are consistent with the tooling updates across the repository.

Also applies to: 52-52

packages/extension-bridge/package.json (1)

47-47: LGTM!

The devDependency updates follow the same pattern as other packages in this PR.

Also applies to: 49-50, 52-52, 62-62, 64-64

packages/request/package.json (1)

34-37: LGTM!

The devDependency updates are routine maintenance updates consistent with other packages in this PR.

Also applies to: 48-48

packages/signers/bitcoin/package.json (1)

35-39: LGTM! DevDependency updates are appropriate.

The version bumps for TypeScript and ESLint tooling are consistent with the broader PR pattern and introduce no runtime changes.

Also applies to: 49-49

packages/name-resolution/package.json (1)

25-28: LGTM! DevDependency updates are appropriate.

The version bumps are consistent with the broader tooling update pattern in this PR and introduce no runtime changes.

Also applies to: 39-40

packages/storage/package.json (1)

30-33: LGTM! DevDependency updates are appropriate.

The version bumps align with the broader tooling update pattern in this PR and introduce no runtime changes.

Also applies to: 44-44

packages/signers/massa/package.json (2)

37-37: Verify @types/node version change.

The version appears to change from ^24.4.0 to ^22.18.6, which is a major version downgrade. Confirm this is intentional or correct the version to align with other packages (e.g., ^24.5.2).


39-41: LGTM! Other devDependency updates are appropriate.

The TypeScript and ESLint tooling updates are consistent with the broader PR pattern.

Also applies to: 52-52

packages/utils/package.json (1)

33-36: LGTM! DevDependency updates are appropriate.

The version bumps align with the broader tooling update pattern in this PR.

Also applies to: 48-48

packages/signers/kadena/package.json (1)

33-36: LGTM! DevDependency updates are appropriate.

The version bumps align with the broader tooling update pattern in this PR and introduce no runtime changes.

Also applies to: 47-47

packages/signers/polkadot/package.json (2)

25-25: Verify @commitlint/cli placement and major version bump.

@commitlint/cli is listed as a runtime dependency and updated from ^19.8.1 to ^20.0.0 (major version). Commitlint is typically a devDependency used for commit message validation during development. Confirm this placement is intentional and verify compatibility with the major version upgrade.


34-37: LGTM! DevDependency updates are appropriate.

The TypeScript and ESLint tooling updates are consistent with the broader PR pattern.

Also applies to: 48-48

packages/extension/src/ui/action/views/swap-initiated/index.vue (2)

98-98: LGTM! New prop is correctly declared.

The waitingToBeMined prop is properly typed as a boolean and integrates well with the loading state logic.


27-33: LGTM! Conditional rendering logic is correct.

The mutual exclusivity between the hardware instruction and mining wait message is properly implemented. The new message provides clear user feedback during transaction mining.

packages/swap/src/providers/oneInchFusion/types.ts (1)

3-13: LGTM!

The OneInchSwapResponse interface is well-structured and properly typed for RFQ swap responses. The fields align with the new RFQ functionality being introduced.

packages/hw-wallets/package.json (1)

25-73: Verify compatibility of dependency updates.

Multiple hardware wallet and crypto library dependencies have been updated. While these appear to be minor/patch updates, ensure compatibility testing has been performed, especially for:

  • LedgerHQ packages (multiple version bumps)
  • Polkadot types (16.4.7 → 16.4.8)
  • Trezor connect packages

Based on learnings, the package versions should be validated against official sources. Consider running integration tests with hardware wallets after these updates.

packages/extension/package.json (1)

3-3: LGTM!

Version bump to 2.13.0 is appropriate for this release.

packages/extension/src/ui/action/views/swap/libs/evm-gasvals.ts (1)

50-63: LGTM!

The early-return guard for empty gasVals is appropriate and prevents potential errors in the reduction logic. Returning zero fees for all gas price types is a sensible fallback for RFQ flows with no transactions.

packages/extension/src/ui/action/views/swap/types.ts (2)

13-13: LGTM!

Import of RFQOptionsResponse properly supports the new RFQ functionality.


34-34: LGTM!

Adding optional rfqOptions to ProviderResponseWithStatus correctly extends the type for RFQ-enabled swaps.

packages/swap/src/configs.ts (2)

24-33: Verify the OneInch Fusion fee model.

The oneInchFusion provider uses integer fees (88 and 250) instead of percentage-based fees (0.00875, 0.025) like other providers. This suggests a different fee structure for RFQ swaps. Ensure this is the intended configuration and matches the 1inch Fusion SDK documentation.

Based on learnings, the @1inch/fusion-sdk documentation should be consulted to confirm the correct fee format.


134-134: LGTM!

Addition of Wrap gas limit (70,000) is appropriate for token wrapping operations.

packages/extension/src/ui/action/views/swap/index.vue (2)

841-846: Verify index alignment when attaching RFQ options.

The code filters rfqTrades from trades, resolves their RFQ options in parallel, then assigns them back using indices:

const rfqTrades = trades.filter(t => t!.type === SwapType.rfq);
const tradesRfqOptions = rfqTrades.map(t => t!.getRFQObject!());
// ... later ...
rfqTrades.forEach((t, idx) => (t!.rfqOptions = rfqOptionObjects[idx]));

Since rfqTrades is a filtered subset and JavaScript objects are passed by reference, the mutation correctly updates the original trades. However, ensure that:

  1. All RFQ trades have getRFQObject defined (the ! assumes it's always present).
  2. Error handling exists if getRFQObject() rejects.

Consider adding a try-catch or validation:

const tradesRfqOptions = rfqTrades.map(t => {
  if (!t!.getRFQObject) {
    console.warn('RFQ trade missing getRFQObject method');
    return Promise.resolve(null);
  }
  return t!.getRFQObject();
});

171-171: LGTM!

Import of SwapType properly supports RFQ type checking.

packages/swap/src/providers/changelly/index.ts (1)

992-1001: Annotate swap response with SwapType.regular — LGTM.

Addition of type: SwapType.regular is consistent with the new API surface.

packages/swap/src/providers/zerox/index.ts (2)

177-179: Broadened error check is reasonable.

Treating responses without transaction as errors aligns with expected shape. Logging entire response aids triage.

If available, codify the response type so transaction is non-optional on success (discriminated union) to avoid runtime checks.


262-266: SwapType.regular — LGTM.

Consistent with other providers.

packages/swap/tests/swap.test.ts (1)

80-82: Include OneInchFusion in quotes — LGTM.

Assertions correctly validate the Fusion provider appears among quotes.

Also applies to: 94-95, 127-129, 136-137

packages/swap/src/providers/paraswap/index.ts (2)

291-299: Graceful error handling for missing priceRoute — LGTM.

Returning null on known ParaSwap errors avoids throwing and aligns across providers.


351-356: SwapType.regular — LGTM.

Standardized provider response shape.

packages/swap/src/providers/jupiter/index.ts (1)

503-514: SwapType.regular — LGTM.

Consistent with new swap surface.

packages/swap/src/providers/okx/index.ts (1)

425-434: SwapType.regular — LGTM.

Matches shared response contract.

packages/swap/src/providers/oneInch/index.ts (2)

39-82: Exporting supportedNetworks — LGTM.

Makes network map reusable (e.g., tests, Fusion provider). Ensure no unintended external mutation.

Consider Object.freeze if you want to prevent mutation by consumers.


272-286: SwapType.regular — LGTM.

Consistent with cross-provider API.

packages/swap/src/providers/oneInchFusion/index.ts (1)

102-109: toTokens shape: ensure consumers expect network-scoped map

You’re nesting by network only in toTokens; confirm downstream expects toTokens[network][address]. If not, consider aligning with other providers’ structures.

Do existing consumers of getToTokens() expect a network-scoped dictionary?

@kvhnuke kvhnuke merged commit ae5aa73 into main Oct 2, 2025
4 of 6 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 21, 2025
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.

3 participants