Skip to content

Comments

feat: add provider names to swap#769

Merged
kvhnuke merged 16 commits intodevop/package-updates-2-14from
feat/provider-names
Nov 27, 2025
Merged

feat: add provider names to swap#769
kvhnuke merged 16 commits intodevop/package-updates-2-14from
feat/provider-names

Conversation

@gamalielhere
Copy link
Contributor

@gamalielhere gamalielhere commented Nov 19, 2025

Summary by CodeRabbit

  • New Features

    • Added Nibiru and Nibiru Testnet network support
    • Introduced RouteScan activity provider for Ethereum networks
    • Added dynamic provider display with icons in swap interface
  • Improvements

    • Enhanced Changelly provider with RBTC floating-rate swap support
    • Updated network endpoints for improved reliability
    • Refined swap UI with inlined component structure
  • Removals

    • Discontinued support for Canto, ZChains, and Proof of Play Apex networks
    • Removed Klaytn and Syscoin from hardware wallet support
  • Chores

    • Extended dependency updates across all packages
    • Version bump to 2.14.0

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

@coderabbitai
Copy link

coderabbitai bot commented Nov 19, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • main
  • develop
  • devop/vite-migrate

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR performs a comprehensive update including 60+ dependency bumps across the monorepo, network infrastructure changes (removing Canto, ZChains, ProofOfPlayApex; adding Nibiru/NibiruTestnet), UI enhancements for swap provider information display, extended Changelly provider with RBTC/floating-rate support, and various endpoint migrations to community-managed infrastructure.

Changes

Cohort / File(s) Summary
Dependency Updates
packages/extension/package.json, packages/hw-wallets/package.json, packages/keyring/package.json, packages/name-resolution/package.json, packages/request/package.json, packages/signers/*/package.json, packages/storage/package.json, packages/swap/package.json, packages/types/package.json, packages/utils/package.json, packages/extension-bridge/package.json, package.json
Multiple version bumps across Polkadot, Ledger/Trezor, ESLint, TypeScript toolchain, and Vue ecosystem packages. Updates range from patch versions (e.g., typescript ~5.9.2 → ~5.9.3) to minor versions (e.g., vitest ^3.2.4 → ^4.0.10).
Network Type Definitions
packages/types/src/networks.ts
Removed NetworkNames enum members: Canto, ZChains, ProofOfPlayApex. Added: Nibiru and NibiruTestnet. Updated CoingeckoPlatform enum with Nibiru entry.
Swap Provider Infrastructure
packages/swap/src/types/index.ts, packages/swap/src/configs.ts, packages/swap/src/index.ts
New ProviderNameProper enum with display-friendly names for all providers. New PROVIDER_INFO constant mapping each ProviderName to icon and localized name; exported as public API.
Swap UI Components
packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list-item.vue, best-offer-list.vue, index.vue
Added provider prop to list-item component with dynamic icon/name rendering. Updated parent list-item with :provider binding. Enhanced header to display provider icon and name; added provider information block with icon.
Changelly Swap Provider
packages/swap/src/providers/changelly/index.ts
Extended getMinMaxAmount signature with optional amount parameter. Added RBTC/floating-rate path support: switches getFixRate→getExchangeAmount, getFixRateForAmount→getExchangeAmount, createFixTransaction→createTransaction when protocol is RBTC. Updated error handling and response id population accordingly.
Ethereum Networks
packages/extension/src/providers/ethereum/networks/index.ts
Removed imports and exports: canto, zcd, proofOfPlayApex. Added imports and exports: nibiru, nibiruTestnet.
Nibiru Network Integration
packages/extension/src/providers/ethereum/networks/nibiru.ts, nibiru-testnet.ts, packages/extension/src/providers/ethereum/libs/activity-handlers/providers/routescan/configs.ts, types.ts, index.ts
Created two new Nibiru network modules with EvmNetworkOptions and EvmNetwork instances. Added Routescan activity provider with RoutescanTxType interface and endpoint/transaction mapping for Nibiru and NibiruTestnet.
Activity Handler Updates
packages/extension/src/providers/ethereum/libs/activity-handlers/index.ts
Added RoutescanActivity import and export, exposing new Routescan-based activity provider.
Network Removal
packages/extension/src/providers/ethereum/networks/canto.ts, pop-apex.ts, zcd.ts
Deleted files for Canto, Proof of Play Apex, and ZChains network configurations.
Network Configuration Updates
packages/extension/src/providers/ethereum/networks/ftm.ts, xlayer.ts, okc.ts, palm.ts, astr.ts, story.ts
Updated endpoints: Fantom wss→https; XLayer wss→https. Removed assetsInfoHandler from OKC and XLayer. Updated Palm and Astar endpoints. Updated Story chainID from 0x5EF to 0x5ea.
Etherscan Activity Handler
packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts
Removed NetworkNames.ProofOfPlayApex endpoint mapping.
Asset Handler Cleanup
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts, token-lists.ts, types/tokenbalance-mew.ts
Removed supportedNetworks entries for Okc, Canto, XLayer, ProofOfPlayApex. Updated SupportedNetworkNames union type to exclude same four networks.
Hardware Wallet Support
packages/hw-wallets/src/ledger/ethereum/configs.ts
Removed Klaytn and Syscoin from supportedPaths mapping.
Kadena Network Infrastructure
packages/extension/package.json, packages/extension/src/providers/kadena/networks/kadena.ts, index.ts
Updated Kadena endpoint URLs from api.chainweb.com to api.chainweb-community.org. Updated block explorer URLs from explorer.chainweb.com to explorer.chainweb-community.org. Removed kadenaTestnet from default export.
DApp List and Feature Flags
packages/extension/src/libs/dapp-list/index.ts, providers/common/libs/new-features.ts
Removed four networks (Canto, ZkSyncGoerli, ZChains, ProofOfPlayApex) from dApp lists. Added NetworkNames.Nibiru to newNetworks array.
Backup State and Utilities
packages/extension/src/libs/backup-state/index.ts, libs/utils/initialize-wallet.ts
Added excludedSignerTypes guard in restoreBackup. Reordered KadenaNetworks import.
Other UI/Config Updates
packages/extension/src/ui/action/views/swap/index.vue, lock-screen/index.vue, eth-verify-transaction.vue, packages/swap/src/common/icons/index.d.ts, tsconfig.json
Template refactoring in swap/lock-screen with inline component consolidation. Safe default for realToAddress in eth-verify. Added PNG module declaration. Extended TypeScript include for PNG files.
Polkadot Signer
packages/signers/polkadot/src/index.ts
Removed final argument (2048) from mnemonicToMiniSecret call in generate().
OKX Swap Provider
packages/swap/src/providers/okx/index.ts
Updated getOKXTokens to check data.data existence; returns data.data or empty array instead of potentially undefined.
README and Metadata
README.md
Added Nibiru and Nibiru Testnet to "Currently Supported Chains" list.

Sequence Diagram(s)

sequenceDiagram
    participant User as User/UI
    participant ListItem as BestOfferListItem Component
    participant Config as PROVIDER_INFO Config
    participant Icon as Provider Icon
    
    User->>ListItem: Render with trade data
    ListItem->>Config: Look up provider: PROVIDER_INFO[props.provider]
    Config-->>ListItem: Return {name: ProviderNameProper, icon: any}
    ListItem->>Icon: Render icon image
    ListItem->>ListItem: Display provider name (ProviderNameProper)
    ListItem-->>User: Show provider icon + localized name
    
    Note over ListItem,Config: Falls back to "Unknown Provider" if provider not in PROVIDER_INFO
Loading
sequenceDiagram
    participant Client as Changelly Client
    participant Provider as Changelly Provider
    participant API as Changelly API
    
    alt RBTC Protocol (Floating Rate)
        Client->>Provider: getMinMaxAmount({protocol: "RBTC", amount: "..."})
        Provider->>API: getExchangeAmount (with amountFrom)
        API-->>Provider: Exchange rate response
    else Fixed Rate Protocol
        Client->>Provider: getMinMaxAmount({protocol: normal})
        Provider->>API: getFixRate
        API-->>Provider: Fixed rate response
    end
    
    Provider-->>Client: MinMaxResponse
    
    Note over Provider,API: Request routing changed based on protocol type
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

  • High-complexity areas requiring careful review:
    • Changelly provider logic updates for RBTC/floating-rate paths—method routing changes (getFixRate→getExchangeAmount, etc.) and response handling require validation against Changelly API contract
    • Network removal impact verification across dapp-list, asset handlers, activity handlers, and type definitions to ensure no orphaned references
    • Nibiru network integration completeness: verify Routescan endpoint configuration, activity handler wiring, and CoingeckoPlatform enum alignment
    • Swap UI component provider prop threading through hierarchy (list-item ← list ← best-offer-block) for correct data flow
    • Kadena endpoint migration from chainweb.com to chainweb-community.org—verify reliability and compatibility

Possibly related PRs

  • Enable RBTC swaps using Changelly floating point API #767: Overlapping Changelly provider modifications for RBTC/floating-rate support with different implementation approach; verify consistency of getMinMaxAmount/getQuote/getSwap signatures and error handling strategy
  • feat: Nibiru network #750: Concurrent Nibiru/NibiruTestnet integration including network types, Ethereum networks registry, and Routescan activity provider; coordinate to avoid conflicts in network enum definitions and activity handler exports
  • feat: OKX sol swap #729: Parallel swap provider surface changes adding OKX provider and ProviderName extension; ensure PROVIDER_INFO and ProviderNameProper mappings align with all provider variants

Suggested reviewers

  • gamalielhere
  • NickKelly1

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add provider names to swap' accurately describes the main change: adding provider name mappings and display functionality to the swap module across multiple components and configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 Nov 19, 2025

💼 Build Files
chrome: enkrypt-chrome-6fa4721c.zip
firefox: enkrypt-firefox-6fa4721c.zip

💉 Virus total analysis
chrome: 6fa4721c
firefox: 6fa4721c

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: 2

🧹 Nitpick comments (3)
packages/swap/src/types/index.ts (1)

147-156: Consider adding an explicit type annotation for compile-time completeness.

While the current mapping includes all providers, adding an explicit type would ensure compile-time verification that all ProviderName values are mapped to ProviderNameProper values. This prevents future additions to ProviderName from being missed.

Apply this diff to add type safety:

-export const providerNameProper = {
+export const providerNameProper: Record<ProviderName, ProviderNameProper> = {
   [ProviderName.changelly]: ProviderNameProper.changelly,
   [ProviderName.oneInch]: ProviderNameProper.oneInch,
   [ProviderName.oneInchFusion]: ProviderNameProper.oneInchFusion,
   [ProviderName.paraswap]: ProviderNameProper.paraswap,
   [ProviderName.zerox]: ProviderNameProper.zerox,
   [ProviderName.rango]: ProviderNameProper.rango,
   [ProviderName.jupiter]: ProviderNameProper.jupiter,
   [ProviderName.okx]: ProviderNameProper.okx,
 };

This ensures that if a new provider is added to ProviderName, TypeScript will enforce adding it to providerNameProper.

packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list-item.vue (2)

4-10: Add defensive check for invalid provider values.

The current logic only handles falsy provider values but doesn't guard against invalid provider names that aren't in the providerNameProper map.

Apply this diff for more robust fallback handling:

       <p>
         {{
-          props.provider
-            ? providerNameProper[props.provider]
-            : 'Unknown Provider'
+          (props.provider && providerNameProper[props.provider]) || 'Unknown Provider'
         }}
       </p>

This ensures "Unknown Provider" is displayed when:

  • provider is falsy (empty string, null, undefined)
  • provider is not a key in providerNameProper (returns undefined)

31-68: Consider using <script setup> with defineProps<T>() for cleaner type inference.

The current approach uses runtime prop validation with PropType casting. For better type inference and cleaner code, consider using the TypeScript-based defineProps<T>() syntax.

You could refactor to:

interface Props {
  select?: () => void;
  provider?: ProviderName;
  swapNumber?: number;
  amount?: string;
  isLoading?: boolean;
  isChecked?: boolean;
}

const props = withDefaults(defineProps<Props>(), {
  select: () => () => null,
  provider: undefined,
  swapNumber: 0,
  amount: '',
  isLoading: false,
  isChecked: false,
});

This provides better IDE support and type safety.

📜 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 1bd8c09 and 9130c31.

📒 Files selected for processing (5)
  • packages/extension/package.json (1 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list-item.vue (2 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list.vue (1 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/index.vue (3 hunks)
  • packages/swap/src/types/index.ts (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). (3)
  • GitHub Check: buildAll
  • GitHub Check: test
  • GitHub Check: test
🔇 Additional comments (2)
packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list.vue (1)

8-8: LGTM!

The provider prop is correctly bound from trade.provider to pass the provider name to the child component.

packages/extension/package.json (1)

7-7: Prebuild removal is safe and poses no risk to Kadena integration.

The verification confirms that removing prebuild and kadena:prebuild steps has no negative impact:

  • No references to prebuild exist anywhere in the source code
  • Kadena is fully integrated as a complete provider with all necessary code present and properly scoped
  • All package.json scripts are clean with no prebuild dependencies
  • The type declaration reference in tsconfig (./node_modules/.kadena/pactjs-generated) is managed by the @kadena/pactjs-cli dependency itself, not by a prebuild step

Development and production builds should function correctly across all browsers without the prebuild steps.

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: 2

♻️ Duplicate comments (3)
packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/index.vue (2)

3-7: Add null safety when accessing provider details.

The code directly accesses providersDetails[props.pickedTrade.provider].logo and .name without verifying the provider exists in the mapping. This will throw a runtime error if an unmapped provider is encountered.

The previous review comment suggesting fallback handling remains unaddressed. Apply defensive access:

     <h3>
       Best offer including network fee powered by
-      <img :src="providersDetails[props.pickedTrade.provider].logo" />
-      {{ providersDetails[props.pickedTrade.provider].name }}
+      <img v-if="providersDetails[props.pickedTrade.provider]" :src="providersDetails[props.pickedTrade.provider].logo" />
+      {{ providersDetails[props.pickedTrade.provider]?.name || 'Unknown Provider' }}
     </h3>

48-55: Add null safety for provider info section.

Same issue as the heading—direct property access without checking if the provider key exists in providersDetails.

Apply defensive access:

       <p>
         Provider:
-        <img
+        <img
+          v-if="providersDetails[props.pickedTrade.provider]"
           height="15px"
           :src="providersDetails[props.pickedTrade.provider].logo"
         />
-        {{ providersDetails[props.pickedTrade.provider].name }}
+        {{ providersDetails[props.pickedTrade.provider]?.name || 'Unknown Provider' }}
       </p>
packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list-item.vue (1)

42-47: Fix type mismatch between prop type and default value.

The provider prop is typed as ProviderName (enum) but defaults to '' (empty string), creating a type inconsistency.

The previous review comment remains unaddressed. Choose one of these solutions:

Option 1: Make prop optional with undefined default

   provider: {
     type: String as PropType<ProviderName>,
-    default: () => {
-      return '';
-    },
+    required: false,
+    default: undefined,
   },

Option 2: Make prop required (preferred if provider is always passed)

   provider: {
     type: String as PropType<ProviderName>,
-    default: () => {
-      return '';
-    },
+    required: true,
   },
🧹 Nitpick comments (1)
packages/extension/src/libs/utils/providersDetails.ts (1)

11-20: Add explicit typing to the exported mapping.

The exported object lacks explicit typing, which reduces type safety and IDE support. Adding a type annotation will catch any mismatches between ProviderName keys and the expected structure.

Apply this diff:

-export default {
+const providersDetails: Record<ProviderName, { name: string; logo: string }> = {
   [ProviderName.changelly]: { name: ProviderNameProper.changelly, logo: changellyLogo },
   [ProviderName.oneInch]: { name: ProviderNameProper.oneInch, logo: oneInch },
   [ProviderName.oneInchFusion]: { name: ProviderNameProper.oneInchFusion, logo: oneInch },
   [ProviderName.paraswap]: { name: ProviderNameProper.paraswap, logo: paraswap },
   [ProviderName.zerox]: { name: ProviderNameProper.zerox, logo: zerox },
   [ProviderName.rango]: { name: ProviderNameProper.rango, logo: rango },
   [ProviderName.jupiter]: { name: ProviderNameProper.jupiter, logo: jupiter },
   [ProviderName.okx]: { name: ProviderNameProper.okx, logo: okx }
-}
+};
+
+export default providersDetails;
📜 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 9130c31 and a104588.

⛔ Files ignored due to path filters (7)
  • packages/extension/src/ui/action/assets/swap/0x-logo.png is excluded by !**/*.png
  • packages/extension/src/ui/action/assets/swap/1inch-logo.png is excluded by !**/*.png
  • packages/extension/src/ui/action/assets/swap/changelly-logo.png is excluded by !**/*.png
  • packages/extension/src/ui/action/assets/swap/jupiter-logo.png is excluded by !**/*.png
  • packages/extension/src/ui/action/assets/swap/okx-logo.png is excluded by !**/*.png
  • packages/extension/src/ui/action/assets/swap/paraswap-logo.png is excluded by !**/*.png
  • packages/extension/src/ui/action/assets/swap/rango-logo.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • packages/extension/src/libs/utils/providersDetails.ts (1 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/components/best-offer-list-item.vue (3 hunks)
  • packages/extension/src/ui/action/views/swap/views/swap-best-offer/components/swap-best-offer-block/index.vue (4 hunks)
  • packages/swap/src/types/index.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/swap/src/types/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/libs/utils/providersDetails.ts (1)

11-20: All ProviderName enum values are correctly mapped.

The verification confirms that providersDetails.ts imports ProviderName from @enkryptcom/swap/src/types and maps all 8 enum values (changelly, oneInch, oneInchFusion, paraswap, zerox, rango, jupiter, okx) without any missing entries. No runtime errors will occur from incomplete mappings.

@kvhnuke kvhnuke changed the base branch from develop to devop/package-updates-2-14 November 25, 2025 23:39
- Enhanced formatting and indentation in `eth-verify-transaction.vue` for better code clarity.
- Streamlined the structure of `App.vue` by reducing unnecessary divs and improving component usage.
- Updated `lock-screen/index.vue` to improve layout and readability.
- Refined `restricted/index.vue` to enhance the user experience with clearer conditional rendering.
- Improved `swap/index.vue` by organizing component props and events for better readability.
- Enhanced `best-offer-list-item.vue` and `index.vue` for better structure and clarity.
- Added geo-restriction checks in `onboard/App.vue` to improve user flow.
- Standardized code style in `base58.ts`, `cross-browser.ts`, and various interface files for consistency.
- Ensured all interface methods end with a semicolon for uniformity.
@kvhnuke kvhnuke merged commit 581e162 into devop/package-updates-2-14 Nov 27, 2025
5 checks passed
@kvhnuke kvhnuke deleted the feat/provider-names branch November 27, 2025 00:06
@coderabbitai coderabbitai bot mentioned this pull request Nov 27, 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.

2 participants