Conversation
… into feat/add-asset-action
fix:jup.ag fees
feat: add conflux network
feat: add Unit Zero and Unit Zero Testnet networks
[FIX] Total balance not updated when withdrawal completes
Feat/add asset action
Devop/rate logic
feat: add derive network
Add Cytonic Testnet network
PR - Add Hemi Network
Add HEMI Network
Revert "Add HEMI Network"
fix: rate popup
…pt into devop/packeupdates-0512
Release: v2.7.0
WalkthroughThis update introduces support for several new blockchain networks, most notably Conflux, Derive, Unit Zero, and Cytonic Testnet, across the application's core, Ethereum-compatible modules, and user interface. It adds new network configurations, updates network and platform enums, and extends asset and NFT handlers to support Conflux. The release also introduces a user rating popup feature, which is now triggered after successful transactions or certain user actions, with its state managed centrally via a new Pinia store. Numerous development and runtime dependencies are updated in various package manifests, and referral fee logic for the Jupiter swap provider is refactored to use standard SPL token program accounts. Several UI enhancements and new components are added to improve asset management and user interaction. Changes
Sequence Diagram(s)User Rating Popup Flow After TransactionsequenceDiagram
participant User
participant UI_Component as Transaction UI (e.g., send-transaction/verify-transaction)
participant RateState
participant RateStore (Pinia)
participant RatePopup
User->>UI_Component: Sends transaction
UI_Component->>UI_Component: Process transaction
UI_Component-->>User: Show success
UI_Component->>RateState: showPopup(immediate=true)
RateState-->>UI_Component: true/false (should show popup)
alt Should show popup
UI_Component->>RateStore: toggleRatePopup(true)
RateStore->>RatePopup: Open popup
RatePopup-->>User: Display rating prompt
else Do not show popup
UI_Component-->>User: Continue normal flow
end
Conflux NFT Handler Data FetchsequenceDiagram
participant App
participant ConfluxHandler
participant ConfluxScanAPI
App->>ConfluxHandler: fetchNFTCollections(address, network)
ConfluxHandler->>ConfluxScanAPI: GET /nft/collections?owner=address
ConfluxScanAPI-->>ConfluxHandler: List of collections
loop For each collection
ConfluxHandler->>ConfluxScanAPI: GET /nft/items?contract=...&owner=address
ConfluxScanAPI-->>ConfluxHandler: List of items
end
ConfluxHandler-->>App: Array of NFTCollection objects
Asset Detail Buy Action PropagationsequenceDiagram
participant User
participant AssetDetailAction
participant AssetDetailView
participant NetworkAssetsItem
participant NetworkAssets
User->>AssetDetailAction: Click Buy/Sell
AssetDetailAction->>AssetDetailView: emit('open:buy-action', token)
AssetDetailView->>NetworkAssetsItem: emit('open:buy-action', token)
NetworkAssetsItem->>NetworkAssets: emit('open:buy-action', token)
NetworkAssets-->>User: Handle buy/sell flow
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure ✨ Finishing Touches
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. 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
Documentation and Community
|
|
💼 Build Files |
There was a problem hiding this comment.
Actionable comments posted: 4
🔭 Outside diff range comments (2)
packages/extension/src/libs/rate-state/index.ts (1)
77-96: 🛠️ Refactor suggestion
resetPopupTimerinitialises state but forgets prior activity informationIf
resetPopupTimeris invoked before the first call toshowPopup, the newly created state again hard-codesaskedAfterActivity: false.
Replicate the fix above or pass a flag so that the caller can decide.packages/swap/src/providers/jupiter/index.ts (1)
298-310:⚠️ Potential issueReferral suppression check uses the source program instead of the destination
Referral fees are paid in the output token, but the guard variable
isSrcToken2022is derived from the input (source) token.
Swaps where the destination mint is a Token-2022 asset will incorrectly attempt to attach a referral ATA and fail.-const isSrcToken2022 = - srcTokenProgramId.toBase58() === TOKEN_2022_PROGRAM_ID.toBase58(); +const isDstToken2022 = + dstTokenProgramId.toBase58() === TOKEN_2022_PROGRAM_ID.toBase58(); ... - referrerATAPubkey: isSrcToken2022 ? undefined : referrerATAPubkey, + referrerATAPubkey: isDstToken2022 ? undefined : referrerATAPubkey,
🧹 Nitpick comments (10)
packages/extension/src/providers/ethereum/networks/rsk-testnet.ts (1)
12-27: Consider Adding Node Fallbacks
Relying on a single WebSocket endpoint can create a single point of failure. Introducing an array of fallback endpoints or a load-balancer will improve reliability.packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts (1)
287-289: Consider optimizing the accumulator pattern to improve performance.The use of spread syntax (
...) on accumulators in reduce operations causes O(n²) time complexity because it creates a new object on each iteration.- : tokens.reduce( - (obj, cur) => ({ ...obj, [cur.contract]: null }), - {} as Record<string, CoinGeckoTokenMarket | null>, - ); + : tokens.reduce( + (obj, cur) => { + obj[cur.contract] = null; + return obj; + }, + {} as Record<string, CoinGeckoTokenMarket | null>, + );🧰 Tools
🪛 Biome (1.9.4)
[error] 287-287: Avoid the use of spread (
...) syntax on accumulators.Spread syntax should be avoided on accumulators (like those in
.reduce) because it causes a time complexity ofO(n^2).
Consider methods such as .splice or .push instead.(lint/performance/noAccumulatingSpread)
packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts (1)
22-24: Variable name inconsistency.The variable name should be
unitZeroTestnetto match the options variable name and to reflect that this is a testnet network. The current nameunitZerocould cause confusion.-const unitZero = new EvmNetwork(unitZeroTestnetOptions); +const unitZeroTestnet = new EvmNetwork(unitZeroTestnetOptions); -export default unitZero; +export default unitZeroTestnet;packages/extension/src/providers/ethereum/networks/unitzero.ts (1)
22-22: Consider implementing a proper activity handler.The current implementation uses an empty activity handler that returns an empty array, which might not provide users with transaction history for this chain.
- activityHandler: wrapActivityHandler(() => Promise.resolve([])), + activityHandler: wrapActivityHandler(new EtherscanActivity(unitZeroOptions)),packages/extension/src/providers/bitcoin/ui/send-transaction/verify-transaction/index.vue (1)
228-236: Maintain consistent function naming across components.While functionally identical to
callToggleRatePopupin other components, this function is namedcallToggleRate. Consider standardizing the function name across all components for better maintainability.-const callToggleRate = () => { +const callToggleRatePopup = () => {Also update the function calls:
-callToggleRate(); +callToggleRatePopup();packages/extension/src/libs/nft-handlers/types/conflux.ts (1)
15-29: Consider adding JSDoc comments.While the interfaces are well-structured, adding JSDoc comments would improve code documentation and help other developers understand the purpose of each interface and its properties.
+/** + * Represents NFT balance information for Conflux network + */ export interface NFTBalanceItem { owner: string; contract: string; balance: string; name: string; symbol: string; type: string; website: string | null; iconUrl: string | null; } +/** + * Generic list response structure from Conflux API + */ export interface ListResponse { total: number; list: object[]; }packages/extension/src/libs/nft-handlers/conflux.ts (1)
58-84: Comprehensive item fetching and transformation.The helper function effectively fetches and processes NFT items, correctly mapping API data to the standardized NFT interfaces. Good handling of different NFT types (ERC721 vs ERC1155).
However, consider adding more robust error handling for unexpected API response formats:
async function getCollectionItems( contract: string, address: string, ): Promise<NFTItemWithDesc[]> { let itemResponse: ConfluxResponse = await cacheFetch( { url: `${CONFLUX_ENDPOINT}/nft/tokens?contract=${contract}&owner=${address}&skip=0&limit=100&withBrief=${true}&withMetadata=${true}&suppressMetadataError=${true}`, }, CACHE_TTL, ); if (itemResponse.status !== '1') { return []; } + try { let items: ConfluxNFTItem[] = itemResponse.result .list as unknown as ConfluxNFTItem[]; return items.map(item => ({ name: item.name, id: item.tokenId, contract: item.contract, image: item.image, description: item.description, url: `https://evm.confluxscan.org/nft/${item.contract}/${item.tokenId}`, type: item.type === 'ERC721' ? NFTType.ERC721 : NFTType.ERC1155, })); + } catch (error) { + console.error('Error processing Conflux NFT items:', error); + return []; + } }packages/extension/src/libs/rate-state/index.ts (2)
14-22:immediateparameter JSDoc is misleading and incompleteThe block comment explains the parameter but not the expected behaviour (e.g. that it only has an effect when no state exists).
Consider expanding the description or, preferably, makingimmediateinfluence the other branches too (see next comment).
100-107: Possible logic slip withstate?.askedAfterActivity || trueUsing
|| trueforcesaskedAfterActivitytotrueeven if an existing state explicitly had it set tofalse(which may be the case after the previous issues are fixed).- askedAfterActivity: state?.askedAfterActivity || true, + askedAfterActivity: state?.askedAfterActivity ?? true,The nullish-coalescing operator keeps the original value when it is
falsebut sets it totruewhen the state was undefined.packages/swap/src/providers/jupiter/index.ts (1)
1038-1048: Helper wrapper can be removed
getReferrerAssociatedTokenAccountis a one-liner aroundgetSPLAssociatedTokenAccountPubkey; unless you foresee extra logic, consider inlining to reduce indirection.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (2)
packages/extension/src/providers/ethereum/networks/icons/conflux.pngis excluded by!**/*.pngyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (50)
README.md(2 hunks)package.json(1 hunks)packages/extension-bridge/package.json(1 hunks)packages/extension/package.json(5 hunks)packages/extension/src/libs/nft-handlers/conflux.ts(1 hunks)packages/extension/src/libs/nft-handlers/types/conflux.ts(1 hunks)packages/extension/src/libs/rate-state/index.ts(2 hunks)packages/extension/src/libs/rate-state/types.ts(1 hunks)packages/extension/src/providers/bitcoin/ui/send-transaction/verify-transaction/index.vue(3 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/assets-handlers/assetinfo-mew.ts(2 hunks)packages/extension/src/providers/ethereum/libs/assets-handlers/types/tokenbalance-mew.ts(1 hunks)packages/extension/src/providers/ethereum/networks/conflux.ts(1 hunks)packages/extension/src/providers/ethereum/networks/cytonic-testnet.ts(1 hunks)packages/extension/src/providers/ethereum/networks/derive.ts(1 hunks)packages/extension/src/providers/ethereum/networks/index.ts(3 hunks)packages/extension/src/providers/ethereum/networks/rsk-testnet.ts(1 hunks)packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts(1 hunks)packages/extension/src/providers/ethereum/networks/unitzero.ts(1 hunks)packages/extension/src/providers/ethereum/ui/send-transaction/index.vue(3 hunks)packages/extension/src/providers/ethereum/ui/send-transaction/verify-transaction/index.vue(3 hunks)packages/extension/src/providers/kadena/ui/send-transaction/verify-transaction/index.vue(3 hunks)packages/extension/src/providers/polkadot/networks/assethub/assethub-dot.ts(1 hunks)packages/extension/src/providers/polkadot/ui/send-transaction/verify-transaction/index.vue(3 hunks)packages/extension/src/providers/solana/ui/send-transaction/index.vue(3 hunks)packages/extension/src/providers/solana/ui/send-transaction/verify-transaction/index.vue(3 hunks)packages/extension/src/ui/action/App.vue(4 hunks)packages/extension/src/ui/action/components/app-dialog/index.vue(1 hunks)packages/extension/src/ui/action/store/rate-store.ts(1 hunks)packages/extension/src/ui/action/views/asset-detail-view/components/asset-detail-action.vue(1 hunks)packages/extension/src/ui/action/views/asset-detail-view/index.vue(3 hunks)packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue(2 hunks)packages/extension/src/ui/action/views/network-assets/index.vue(1 hunks)packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue(3 hunks)packages/hw-wallets/package.json(4 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/polkadot/package.json(3 hunks)packages/storage/package.json(2 hunks)packages/swap/package.json(2 hunks)packages/swap/src/configs.ts(1 hunks)packages/swap/src/providers/jupiter/index.ts(6 hunks)packages/types/package.json(2 hunks)packages/types/src/networks.ts(2 hunks)packages/utils/package.json(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (7)
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts (2)
packages/swap/src/configs.ts (1)
NATIVE_TOKEN_ADDRESS(123-123)packages/extension/src/libs/market-data/types.ts (1)
CoinGeckoTokenMarket(23-37)
packages/extension/src/providers/ethereum/networks/derive.ts (2)
packages/extension/src/providers/ethereum/types/evm-network.ts (2)
EvmNetworkOptions(25-56)EvmNetwork(58-293)packages/extension/src/providers/ethereum/libs/activity-handlers/index.ts (1)
EtherscanActivity(10-10)
packages/extension/src/providers/ethereum/networks/conflux.ts (2)
packages/extension/src/providers/ethereum/types/evm-network.ts (2)
EvmNetworkOptions(25-56)EvmNetwork(58-293)packages/extension/src/providers/ethereum/libs/activity-handlers/index.ts (1)
EtherscanActivity(10-10)
packages/extension/src/providers/ethereum/networks/cytonic-testnet.ts (2)
packages/extension/src/providers/ethereum/types/evm-network.ts (2)
EvmNetworkOptions(25-56)EvmNetwork(58-293)packages/extension/src/providers/ethereum/libs/activity-handlers/index.ts (1)
EtherscanActivity(10-10)
packages/extension/src/libs/nft-handlers/types/conflux.ts (1)
packages/extension/src/types/nft.ts (1)
NFTItem(9-16)
packages/swap/src/providers/jupiter/index.ts (1)
packages/swap/src/utils/solana.ts (5)
solAccountExists(484-491)SPL_TOKEN_ATA_ACCOUNT_SIZE_BYTES(43-43)getCreateAssociatedTokenAccountIdempotentInstruction(388-451)ASSOCIATED_TOKEN_PROGRAM_ID(39-41)getSPLAssociatedTokenAccountPubkey(309-321)
packages/extension/src/libs/rate-state/index.ts (1)
packages/extension/src/libs/rate-state/types.ts (1)
IState(11-11)
🪛 LanguageTool
README.md
[grammar] ~120-~120: This phrase is duplicated. You should probably use “Unit Zero” only once.
Context: ...in - Ink Onchain - Unichain - Gravity - Unit Zero - Unit Zero Testnet - More coming soon! Looking to...
(PHRASE_REPETITION)
🪛 Biome (1.9.4)
packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts
[error] 287-287: Avoid the use of spread (...) syntax on accumulators.
Spread syntax should be avoided on accumulators (like those in .reduce) because it causes a time complexity of O(n^2).
Consider methods such as .splice or .push instead.
(lint/performance/noAccumulatingSpread)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: buildAll
- GitHub Check: test
- GitHub Check: test
🔇 Additional comments (100)
packages/extension/src/providers/polkadot/networks/assethub/assethub-dot.ts (2)
26-26: AssetHub DOT node endpoint updated
The WebSocket node URL has been changed towss://dot-rpc.stakeworld.io/assethubin line with the network support expansion.
26-26: Verify endpoint connectivity and RPC compatibility
Please ensure this new node supports all required Substrate RPC methods (e.g.,chain_getBlock,state_queryStorage) and is reachable under your CI/test environments. Consider adding automated health checks or connection tests to catch connectivity regressions early.packages/types/package.json (2)
27-32: DevDependencies bumped for consistent linting/tooling
The updates to@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint, andeslint-config-prettieralign this package’s dev tooling with the rest of the monorepo. No conflicts detected.
41-41: Matchtypescript-eslintversion to parser and plugin
Upgradingtypescript-eslintto8.32.1ensures parity with the parser and plugin versions already used.package.json (2)
35-37: Commitlint and SWC devDependencies updated
Bumped@commitlint/cli,@commitlint/config-conventional, and@swc/coreto the next patch versions. This keeps the commit linting rules and SWC compiler in sync with upstream fixes.
41-41: Upgradenodemonfor improved file-watch stability
Updatingnodemonto^3.1.10aligns with the version bump strategy and addresses any recent watch-loop fixes.packages/name-resolution/package.json (2)
25-30: Bump TypeScript and ESLint devDependencies
The newer versions of@types/node,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint, andeslint-config-prettiermatch the versions in sibling packages. This helps maintain consistent linting and type definitions across modules.
39-40: Upgradetypescript-eslintand addvitest
Aligningtypescript-eslintto8.32.1and addingvitest@^3.1.3for testing support completes the dev environment setup.packages/keyring/package.json (2)
37-42: Sync keyring devDependencies with monorepo standards
Version bumps for@types/node,@typescript-eslint/*,eslint, andeslint-config-prettierkeep the keyring package’s tooling in lockstep with other packages.
51-52: Addvitestand aligntypescript-eslint
Introducingvitest@^3.1.3for testing and matchingtypescript-eslint@8.32.1rounds out the development setup.packages/storage/package.json (2)
30-35: Update storage devDependencies for consistency
Bumps to@types/node,@typescript-eslint/*,eslint, andeslint-config-prettiermirror the changes in other packages, standardizing the development environment.
44-45: Includevitestand synchronizetypescript-eslint
Addingvitest@^3.1.3and upgradingtypescript-eslintto8.32.1ensures testing and linting parity across the monorepo.packages/extension-bridge/package.json (1)
47-50: Consistent devDependency version bumps
All devDependencies (TypeScript types, ESLint plugins/parsers, Prettier, tsup, etc.) have been updated to the monorepo’s standard versions, ensuring unified tooling across packages.Also applies to: 52-52, 54-54, 62-64
packages/hw-wallets/package.json (3)
3-3: Version bump aligns with release
The package version has been correctly incremented to 0.0.4 as part of the coordinated release cycle.
25-28: Upgrade devDependencies for consistency
DevDependencies (Node types, ESLint, parser, Prettier config,typescript-eslint, Vitest) have been aligned with the rest of the monorepo’s toolchain without introducing conflicts.Also applies to: 30-30, 39-40
56-56: Runtime dependency version updates
Bumped@ledgerhq/hw-app-eth,@polkadot/types, and@zondax/ledger-substrateto their latest patch releases to incorporate upstream fixes and improvements.Also applies to: 61-61, 65-65
packages/signers/kadena/package.json (1)
33-36: Align devDependency versions
DevDependencies for Node types, ESLint plugins/parsers, Prettier config,typescript-eslint, and Vitest have been updated to the standardized versions used across the repository.Also applies to: 38-38, 47-48
packages/signers/bitcoin/package.json (1)
35-38: Standardize devDependency upgrades
Upgraded Node types, ESLint tooling, Prettier config,typescript-eslint, and Vitest to match the monorepo’s current development environment.Also applies to: 40-40, 49-50
packages/utils/package.json (1)
33-36: Upgrade dev tooling across utils
DevDependencies (TypeScript types, ESLint plugins/parsers, Prettier config,typescript-eslint, Vitest) have been bumped to maintain consistency with the global toolchain.Also applies to: 38-38, 48-49
packages/signers/ethereum/package.json (2)
35-41: Consistent Dev Dependency Version Bumps
The updated versions for Node types, ESLint, Prettier configs, TypeScript, and Vitest align with the coordinated tooling upgrade across the monorepo—this helps maintain a uniform developer experience.Also applies to: 49-50
49-50: Verify Validity of “typescript-eslint” Dependency
The unscoped package"typescript-eslint": "8.32.1"is unusual—please confirm that this is an intentional, published package and not a typo for an @typescript-eslint scoped package.packages/signers/polkadot/package.json (1)
34-37: Approve Dev Tooling Version Alignment
Node types, ESLint, Prettier, TypeScript, and Vitest have been bumped to match the rest of the monorepo’s dev environment.Also applies to: 39-39, 48-50
packages/request/package.json (2)
31-31: Review “ws” Minor Version Upgrade
Thewsruntime dependency was bumped from^8.18.1to^8.18.2. Please verify there are no breaking changes or security advisories in this patch release.
34-37: Approve DevDependency Version Sync
Dev tooling for Node types, ESLint, Prettier configs, TypeScript, and Vitest has been aligned with other packages.Also applies to: 39-39, 48-50
packages/extension/package.json (3)
3-3: Confirm Version Bump and Changelog Updates
The package version is now2.7.0. Ensure the CHANGELOG (or release notes) reflects all new features and network support, and that CI/CD scripts target this version.
26-29: Approve Dependency Upgrades
Runtime libraries (Amplitude, Bubblegum, Polkadot, Solana, bignumber.js, vue-router, etc.) have been updated. These appear consistent with the extension’s new features and network integrations.Also applies to: 43-47, 58-61, 83-84
102-103: Approve DevDependency Version Sync
The extension’s dev environment (TypeScript, linting plugins, Rollup, Vite, Vitest, etc.) is now in lock-step with other packages in the monorepo.Also applies to: 108-109, 115-115, 121-122, 126-127, 130-130, 132-132, 137-137, 140-141
packages/extension/src/providers/ethereum/networks/rsk-testnet.ts (1)
23-23: Update RSK Testnet WebSocket Endpoint
The node URL was changed towss://nodes.mewapi.io/ws/rsktest. Please verify connectivity, subscription support, and performance for this new endpoint.packages/extension/src/ui/action/components/app-dialog/index.vue (1)
88-88: Good UI enhancement to hide scrollbar while maintaining functionality.Adding
'scrollbar-width': 'none'improves cross-browser consistency by hiding the scrollbar in Firefox while preserving scrolling functionality. This aligns with the dialog's design intent in line 143 whereoverflow-y: scrollis set.README.md (2)
57-57: LGTM: Added Derive to supported chains.The addition of Derive to the list of supported chains properly documents the new blockchain support mentioned in the PR summary.
120-121: LGTM: Added Unit Zero and Unit Zero Testnet to supported chains.Both Unit Zero (mainnet) and Unit Zero Testnet are correctly added as separate entries, properly documenting the new blockchain support mentioned in the PR summary.
🧰 Tools
🪛 LanguageTool
[grammar] ~120-~120: This phrase is duplicated. You should probably use “Unit Zero” only once.
Context: ...in - Ink Onchain - Unichain - Gravity - Unit Zero - Unit Zero Testnet - More coming soon! Looking to...(PHRASE_REPETITION)
packages/extension/src/ui/action/views/network-assets/index.vue (1)
28-28: Good addition for consistent prop/event handling across network asset items.Adding
v-bind="$attrs"ensures that all parent attributes, including event listeners, are properly passed to eachnetwork-assets-itemin the loop. This is consistent with how attributes are passed to thenetwork-activity-actioncomponent on line 16 and supports the new interaction flow for triggering buy actions mentioned in the AI summary.packages/extension/src/libs/rate-state/types.ts (1)
8-8: Good addition to support enhanced rating popup behavior.The new
askedAfterActivityboolean property in theRateinterface enables tracking whether users have been asked to rate after completing activities. This supports the conditional triggering of rating popups after successful transactions as described in the PR summary.packages/extension/src/providers/ethereum/libs/assets-handlers/types/tokenbalance-mew.ts (1)
76-77: LGTM: New networks correctly added to SupportedNetworkNames type.The inclusion of
NetworkNames.ImmutableZkevmandNetworkNames.Confluxto theSupportedNetworkNamestype aligns with the PR objective of adding support for new blockchain networks.packages/extension/src/providers/common/libs/new-features.ts (1)
3-7: New network feature flags added correctly.The addition of Derive, Conflux, and UnitZero to the
newNetworksarray will properly flag these networks as new features in the UI, which aligns with the PR objective of introducing support for these blockchain networks.packages/extension/src/providers/ethereum/libs/assets-handlers/assetinfo-mew.ts (1)
220-223: LGTM: Conflux network integration complete.The addition of Conflux to the supported networks mapping with appropriate
tbNameandcgPlatformvalues enables proper asset handling for this network.packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts (1)
74-76: LGTM: Network endpoints for new chains added correctly.The endpoints for CytonicTestnet, Derive, and Conflux networks are properly defined and follow the established pattern, enabling activity tracking for these chains.
packages/extension/src/providers/ethereum/networks/derive.ts (1)
1-25:Details
✅ Verification successful
Network configuration looks good overall
The Derive network is properly configured with all the required parameters for an Ethereum-compatible network. The configuration follows the existing pattern used for other networks.
I'd recommend verifying that the chain ID
0x3bd(957 in decimal) is correct, as this is a critical parameter for transaction signing.
🏁 Script executed:
#!/bin/bash # Verify the chain ID for Derive network curl -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' https://rpc.derive.xyzLength of output: 187
Chain ID Verification Complete for Derive Network
Verified that calling
eth_chainIdon https://rpc.derive.xyz returns0x3bd, matching the configuredchainID. All other parameters follow the established EVM network pattern—no further changes required.packages/extension/src/providers/solana/ui/send-transaction/index.vue (3)
75-75: Variable name updated for consistencyThe variable name change from
paramNFTDatatotokenParamDatain the template binding improves clarity.
205-207: Variable rename improves clarityRenaming from
paramNFTDatatotokenParamDatamakes the code more accurate since this variable handles all types of tokens, not just NFTs.
449-460: Enhanced token selection logicThe improved asset selection logic now automatically pre-selects the token specified in route parameters when available, falling back to the first asset when not found. This provides a better user experience.
packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue (3)
58-58: New event handler for buy actionAdded an event handler for the buy action coming from the asset detail view.
164-164: Updated emit type definitionThe emit type declaration is properly updated to include the new event.
167-169: New method to handle buy/sell actionThe
openBuySellmethod implementation correctly passes the token to the parent component, enabling the buy/sell functionality.packages/extension/src/providers/ethereum/networks/index.ts (3)
30-30: Added import for Derive networkThe Derive network import has been added to support this new Ethereum-compatible network.
75-78: Added imports for new networksAdded imports for additional new networks: Cytonic Testnet, Unit Zero, Unit Zero Testnet, and Conflux.
163-167:Details
✅ Verification successful
Registered new networks in export
The new networks have been properly added to the default export, making them available for use throughout the extension.
🏁 Script executed:
#!/bin/bash # Verify that all imported networks are properly exported for network in "coti" "cytonicTestnet" "derive" "unitZero" "unitZeroTestnet" "conflux"; do grep -n "import.*${network}" packages/extension/src/providers/ethereum/networks/index.ts grep -n "${network}:" packages/extension/src/providers/ethereum/networks/index.ts done # Check if these networks are registered in the network types grep -n "Derive\|Cytonic\|UnitZero\|Conflux" packages/types/src/networks.tsLength of output: 2389
I’d like to confirm that the Coti network is registered in the types definition. Let’s search for any “Coti” entries in
packages/types/src/networks.ts:
🏁 Script executed:
#!/bin/bash # Verify that Coti networks are declared in the types file grep -nE 'Coti|coti' packages/types/src/networks.tsLength of output: 106
✅ New Ethereum networks properly exported and typed
All newly added networks have been verified:
- In
packages/extension/src/providers/ethereum/networks/index.ts, each network (coti,cytonicTestnet,derive,unitZero,unitZeroTestnet,conflux) is correctly imported and included in the default export.- In
packages/types/src/networks.ts, matching enum entries exist for CotiDevnet, Coti, CytonicTestnet, Derive, UnitZero, UnitZeroTestnet, and Conflux.No further changes are required.
packages/extension/src/providers/ethereum/ui/send-transaction/verify-transaction/index.vue (1)
112-119: Well-implemented rating prompt integration.The new code adds a user rating popup that appears after successful transactions. The implementation is clean and non-intrusive, showing the popup only to users who haven't rated before and only after a successful operation (when users are likely to have a positive impression).
Also applies to: 124-124, 153-161, 220-220, 226-226
packages/extension/src/providers/ethereum/networks/conflux.ts (1)
1-29: Good implementation of Conflux network support.The Conflux network configuration is complete with all necessary components:
- Proper chain ID and network parameters
- Block explorer URLs
- Custom NFT handler specific to Conflux
- Assets info handler
- Activity tracking via wrapped EtherscanActivity
- Coingecko ID for price tracking
This implementation follows the established pattern for adding new EVM-compatible networks.
packages/extension/src/providers/ethereum/networks/cytonic-testnet.ts (1)
1-24: Consider adding NFT and assets info handlers for Cytonic Testnet.The implementation correctly configures the Cytonic Testnet as an EVM-compatible network with proper parameters. However, unlike the Conflux network implementation, this network doesn't include NFT or assets info handlers.
While this might be intentional for a testnet, users may expect consistent functionality across networks. Consider adding these handlers if they should be supported.
packages/extension/src/providers/ethereum/networks/unitzero-testnet.ts (1)
1-20: Review the activity handler and consider adding NFT/assets handlers.The network configuration is overall good, but:
- Unlike other networks that use EtherscanActivity, this implementation returns an empty array for activities. Is this intentional?
- Like Cytonic Testnet, there are no NFT or assets info handlers defined. Consider adding these for consistency if they should be supported.
packages/swap/src/configs.ts (2)
60-60: Updated Jupiter fee referrer address for EnkryptThe new address is correctly formatted as a valid Solana public key. This change aligns with the refactoring to use standard SPL token program accounts instead of Jupiter-specific referral PDAs.
64-64: Updated Jupiter fee referrer address for MEWThe new address is correctly formatted as a valid Solana public key. This change completes the necessary referrer updates for the Jupiter swap provider.
packages/extension/src/ui/action/views/swap/views/swap-best-offer/index.vue (4)
160-168: Good addition of rating store integrationThe imports and initialization of the rate store are correctly implemented. This integrates the new centralized rating system into the swap view.
172-172: Proper instantiation of RateStateThe RateState instance is correctly initialized at the component level to manage rating state.
366-367: Rating popup trigger implemented in close methodThe callToggleRatePopup method is correctly called before navigation, ensuring the rating popup can appear after a swap interaction.
Also applies to: 369-370
476-484: Well-implemented rating popup logicThe implementation correctly checks if the popup should be shown based on user history and only toggles the popup when appropriate. The comments clearly explain the conditional behavior.
packages/extension/src/ui/action/store/rate-store.ts (1)
1-15: Well-structured Pinia store for rating state managementThe store is correctly implemented with:
- A reactive state variable to track popup visibility
- An asynchronous action to toggle the state
- Proper exports for component consumption
This centralized approach will make rating state management more consistent across the application.
packages/types/src/networks.ts (2)
109-113: Successfully added new network supportThe new networks (CytonicTestnet, Derive, UnitZero, UnitZeroTestnet, and Conflux) are correctly added to the NetworkNames enum with appropriate identifiers.
179-180:Details
✅ Verification successful
Added Coingecko platform identifiers for new networks
The Coingecko platform identifiers for UnitZero and Conflux are correctly added, ensuring proper asset price lookups for these networks.
Run the following to verify the Coingecko platform IDs are valid:
🏁 Script executed:
#!/bin/bash # Verify that the new Coingecko platform IDs are valid curl -s "https://api.coingecko.com/api/v3/asset_platforms" | grep -E "units-network|conflux"Length of output: 65629
🏁 Script executed:
#!/bin/bash # Precisely verify the presence of the new Coingecko platform IDs curl -s "https://api.coingecko.com/api/v3/asset_platforms" | jq -r '.[] | select(.id=="units-network" or .id=="conflux") | .id'Length of output: 149
Approve Coingecko Platform Identifiers
Verified that the newly addedunits-networkandconfluxIDs exist in Coingecko’s asset_platforms API, confirming the entries in packages/types/src/networks.ts (lines 179–180) are correct.packages/swap/package.json (2)
28-29: Package dependency updates look good.The runtime dependencies have been updated to newer versions, which likely include bug fixes and performance improvements.
Also applies to: 34-34, 39-39
42-48: Dev dependency updates are appropriate.These updates to development dependencies align with modern tooling standards and ensure compatibility with the current development workflow.
Also applies to: 56-57
packages/extension/src/providers/ethereum/networks/unitzero.ts (3)
1-6: Imports and dependencies look correct.The network implementation imports the necessary components, including the network icon and activity handler wrapper.
8-23: Network configuration is well structured.The Unit Zero network options are properly defined with all the essential parameters including chain ID, currency details, and explorers.
25-27: Network instance creation and export looks good.The network is properly instantiated and exported.
packages/extension/src/providers/kadena/ui/send-transaction/verify-transaction/index.vue (3)
107-115: Rating functionality import and initialization is correct.The rating-related imports, store initialization, and state creation are properly set up.
209-209: Rating popup is appropriately triggered after transaction completion.The rating popup is correctly called after successful transaction processing in both popup and window contexts.
Also applies to: 215-216
232-240: Well-implemented rating popup helper function.The
callToggleRatePopupfunction correctly checks conditions before showing the rating popup to users, ensuring it only appears when appropriate.packages/extension/src/providers/bitcoin/ui/send-transaction/verify-transaction/index.vue (3)
101-108: Rating functionality import and initialization is correct.The rating-related imports, store initialization, and state creation are properly set up.
Also applies to: 113-113
197-197: Rating popup is appropriately triggered after transaction completion.The rating popup is correctly called after successful transaction processing in both popup and window contexts.
Also applies to: 203-203
228-236: Well-implemented rating popup helper function.The
callToggleRatefunction correctly checks conditions before showing the rating popup to users, ensuring it only appears when appropriate.packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (3)
80-80: Properly updated UI component prop with new variable name.The
nft-select-listcomponent'sselected-nftprop has been correctly updated to use the renamedtokenParamDatavariable, maintaining consistency in the codebase.
206-208: Consistent variable renaming fromparamNFTDatatotokenParamData.Variable has been renamed consistently in the declaration, improving code readability and maintaining a consistent naming convention across the component.
547-559: Enhanced token selection logic for improved user experience.This improvement makes token selection smarter by:
- Checking if token parameters with a valid contract are provided
- Finding and selecting the matching token from user's assets if available
- Falling back to the first token only when no match is found
This enhancement ensures that when a specific token is specified in the route parameters, the UI automatically selects that token, providing a better user experience.
packages/extension/src/ui/action/views/asset-detail-view/index.vue (5)
44-50: Added token balance display for non-custom tokens.Good addition that shows important balance information for standard tokens, improving the user experience by displaying key financial data directly in the detail view.
51-55: Added asset action component with conditional rendering.The new
asset-detail-actioncomponent with appropriate event binding enhances the UI by providing action capabilities for standard tokens while maintaining a clean interface for custom tokens.
84-84: Added import for the new action component.Properly imported the required component to support the enhanced UI functionality.
145-145: Added new emit event for buy action.Correctly defined the event type for propagating buy action events up the component hierarchy.
148-151: Implemented handler for buy/sell action.The
openBuySellmethod appropriately emits the action event with the token data and closes the popup, ensuring smooth user flow when initiating a buy action.packages/extension/src/providers/polkadot/ui/send-transaction/verify-transaction/index.vue (4)
110-118: Added rating popup feature integration.Properly imported and initialized the rating store functionality, setting up the necessary hooks for the new rating popup feature.
122-122: Initialized RateState instance.Created an instance of RateState to manage the popup display logic at the component level.
219-219: Added rating popup trigger after successful transaction.Appropriately calls the rating popup function at the right moment in the user flow - after a successful transaction and before closing the view.
Also applies to: 225-225
254-262: Implemented conditional rating popup display.The
callToggleRatePopupfunction properly implements the conditional logic for displaying the rating popup, ensuring it's only shown to users who haven't already rated and haven't been shown the popup before.packages/extension/src/providers/solana/ui/send-transaction/verify-transaction/index.vue (4)
118-126: Added rating popup feature integration.Properly imported and initialized the rating store functionality, setting up the necessary hooks for the new rating popup feature.
128-128: Initialized RateState instance.Created an instance of RateState to manage the popup display logic at the component level.
249-249: Correctly triggered rating popup after transaction completion.Appropriately calls the rating popup function at the right moment in the user flow - after a successful transaction and before closing the view.
Also applies to: 255-255
297-305: Implemented conditional rating popup display.The
callToggleRatePopupfunction properly implements the conditional logic for displaying the rating popup, ensuring it's only shown to users who haven't already rated and haven't been shown the popup before.packages/extension/src/ui/action/App.vue (4)
68-68: Refactoring rate popup binding with Pinia store.The modal-rate component's binding has been updated to use the new Pinia store's reactive state.
130-130: Added import for rate store.Adding the useRateStore import to support centralized state management for the rate popup.
157-162: Centralized rate popup state management.Good refactoring by replacing local state management with a centralized Pinia store. This improves maintainability and allows consistent handling of the rate popup across components.
280-280: Updated rate popup toggle.Implementation properly uses the new store's toggleRatePopup method instead of direct state manipulation.
packages/extension/src/libs/nft-handlers/types/conflux.ts (2)
1-13: Well-structured Conflux NFT interfaces.The interfaces for Conflux NFT handling are clearly defined with appropriate properties to match the expected API responses.
37-39: Well-designed extended NFT item interface.Good approach extending the base NFTItem interface to add Conflux-specific description field.
packages/extension/src/ui/action/views/asset-detail-view/components/asset-detail-action.vue (3)
1-34: Well-structured asset action buttons template.The template provides a clean and consistent UI for the three main asset actions (Buy/Sell, Send, Swap) with proper routing and event handling.
59-129: Clean styling with appropriate interactions.The styling follows project conventions with good interaction states (hover effects), proper focus management for accessibility, and a responsive layout that adapts to different screen sizes.
36-56:Details
❓ Verification inconclusive
Verify token handling for edge cases.
The token prop has a default empty object value, but is used to populate route parameters for the Send action (line 16). Consider adding validation to handle cases where token data might be incomplete.
🏁 Script executed:
#!/bin/bash # Check if there are any token validation checks in related files rg "token.*\?" --type=vue -A 3 -B 3 "src/ui/action/views/asset-detail-view" "src/ui/action/views/send-transaction"Length of output: 140
🏁 Script executed:
#!/bin/bash # Show usage of the Send component in asset-detail-action.vue rg -n "<Send" -A5 -B5 packages/extension/src/ui/action/views/asset-detail-view/components/asset-detail-action.vue # Show any direct token property accesses in the same file rg -n "token\." -A5 -B5 packages/extension/src/ui/action/views/asset-detail-view/components/asset-detail-action.vueLength of output: 528
🏁 Script executed:
#!/bin/bash # 1. Inspect the parent asset-detail-view to see how the token prop is passed into AssetDetailAction find packages/extension/src/ui/action/views/asset-detail-view -maxdepth 1 -type f -name "*.vue" \ -exec rg -n "AssetDetailAction" -A3 -B3 {} \; # 2. Locate the send-transaction view and check how tokenData is consumed and validated find packages/extension/src/ui/action/views -type f -iname "*send-transaction*.vue" \ -exec rg -n "tokenData" -A5 -B5 {} \; \ -exec rg -n "defineProps" -A5 -B5 {} \;Length of output: 610
Ensure token has required fields before routing
Thetokenprop currently defaults to{}, but is serialized intotokenDataand passed to the Send page. If any fields (e.g.address,symbol) are missing at runtime, the downstream logic may break.• In
packages/extension/src/ui/action/views/asset-detail-view/components/asset-detail-action.vue:
– Remove the empty‐object default and marktokenasrequired: true, or wrap the<router-link>to Send with a guard (e.g.v-if="token.address").• In the SendTransaction view (where
tokenDatais consumed):
– Deserialize and validate all expected fields fromtokenData, and handle errors or redirect on invalid input.Please manually verify that the SendTransaction component enforces these checks and that the
tokenprop is always passed correctly.packages/extension/src/libs/nft-handlers/conflux.ts (2)
1-15: Good implementation of Conflux NFT handler.The imports, constants, and endpoint definitions are well-organized. Using a cache TTL of 60 seconds is a good approach for balancing fresh data with performance.
16-56: Efficient NFT collection fetching with appropriate limits.The implementation properly validates the network, fetches collections with pagination limits (100 collections), and processes the response data appropriately. Good error handling for invalid responses or empty collections.
packages/swap/src/providers/jupiter/index.ts (2)
235-236: Basis-points calculation now correct – nice catch!
Multiplying by 10 000 finally converts a fractional fee into basis points.
331-345: Good move: rent exemption calculated with constant ATA sizeUsing the predefined
SPL_TOKEN_ATA_ACCOUNT_SIZE_BYTESavoids magic numbers.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Style
Chores