Feat/currency exchange#645
Conversation
Release: v2.4.3
…into fix/ftm-underpriced
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (3)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request introduces a new XML workspace configuration file for the MacOS Xcode project and updates numerous dependency versions across multiple package.json files. It adds enhanced currency settings support by extending the settings state with new methods and types, integrates a new currency filter utility ( Changes
Sequence Diagram(s)sequenceDiagram
participant App as App.vue
participant API as Currency API
participant Store as Currency Store (Pinia)
participant Settings as SettingsState
participant UI as UI Component
App->>API: fetch exchange rates
API-->>App: return currency data
App->>Store: setCurrencyList(data)
Store->>Settings: pull current currency settings
Settings-->>Store: return currentSelectedCurrency
UI->>Store: retrieve selected currency
UI->>Filters: parseCurrency(formatted value)
sequenceDiagram
participant User
participant Select as settings-select.vue
participant Store as Currency Store (Pinia)
participant Settings as SettingsState
User->>Select: click to select new currency
Select->>Store: trigger selectCurrency(newCurrency)
Store->>Settings: setSelectedCurrency(newCurrency)
Settings-->>Store: confirm update
Select-->>User: update UI with new selection
Suggested reviewers
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
💼 Build Files |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (12)
packages/extension/src/ui/action/utils/currencyConfig.ts (3)
1-168: Consider optimizing imports for better performance.This file imports 168 SVG icons individually which could impact build size and performance. Consider using dynamic imports or a single sprite sheet to reduce the bundle size.
169-338: Add TypeScript type definitions for better maintainability.The
LANG_INFOobject is a large mapping with a consistent structure, but lacks type definitions. Adding an interface would improve type safety and maintainability.+interface LangInfo { + locale: string; + icon: any; // or more specific SVG type +} + +const LANG_INFO: Record<string, LangInfo> = { "AED": { locale: "ar-AE", icon: AED }, // remaining entries...
216-216: Consider adding more specific locale for EUR.The Euro is used across multiple countries, but you're using only "fr-FR" as the locale. Consider providing a more flexible approach for Euro that can adapt to the user's country.
packages/extension/src/libs/settings-state/types.ts (1)
27-29: Consider future extensibility for CurrencySettingsTypeThe
CurrencySettingsTypeinterface is currently simple with just avalueproperty, which works for the current implementation. However, if more complex currency settings are anticipated in the future (e.g., formatting preferences, regional overrides), consider designing a more extensible structure.export interface CurrencySettingsType { value: string; + // For future extensibility, consider adding: + // format?: string; + // customSymbol?: string; + // decimalPlaces?: number; }packages/extension/src/ui/action/utils/filters.ts (1)
23-35: Consider adding error handling and input validation to parseCurrency.The function works well for valid inputs, but could be more robust with these improvements:
- Add validation for empty or invalid input values
- Add error handling around store access
- Handle potential errors when constructing BigNumber
export const parseCurrency = (value: string): string => { + if (!value) return '0'; + const store = useCurrencyStore(); const currency = store.currentSelectedCurrency; const currencyCode = LANG_INFO[currency as keyof typeof LANG_INFO].locale || 'en-US'; const findRate = store.currencyList.find((c) => c.fiat_currency === currency); const rate = findRate || { exchange_rate: 1 }; + try { return new Intl.NumberFormat(currencyCode, { style: 'currency', currency: currency, }).format(parseFloat(BigNumber(value).times(rate.exchange_rate).toString())); + } catch (error) { + console.error('Error formatting currency:', error); + return value; + } }packages/extension/src/ui/action/views/settings/components/setting-select-option.vue (4)
1-11: Consider improving accessibility and semantic HTML.The component uses an
<a>tag without an href attribute, which isn't ideal for accessibility. Consider using a<button>element instead, as this is an interactive element that performs an action rather than a navigation link.<template> - <a class="base-select__option" @click="select()"> + <button type="button" class="base-select__option" @click="select()"> <div class="base-select__option__img-container"> <img :src="flag" width="40" height="40" /> </div> <div> <h5>{{ title }}</h5> <done-icon v-show="isSelect" /> </div> - </a> + </button> </template>
16-41: Simplify prop default values.The current implementation uses arrow functions to return default values, which is unnecessarily verbose. You can simplify these to direct values.
const props = defineProps({ select: { type: Function, - default: () => { - return null; - }, + default: () => null, }, title: { type: String, - default: () => { - return ''; - }, + default: '', }, isSelect: { type: Boolean, - default: () => { - return false; - }, + default: false, }, flag: { type: String, - default: () => { - return XCD; - }, + default: XCD, }, });
43-45: Add event modifier to prevent event propagation.When using clickable elements inside other clickable elements or forms, it's a good practice to prevent event propagation.
const select = () => { props.select(props.title); };In the template, update the click handler:
- <a class="base-select__option" @click="select()"> + <a class="base-select__option" @click.stop="select()">
48-99: Add scoped attribute to style tag to prevent style leakage.The styles are currently not scoped, which could affect other components using similar class names.
-<style lang="less"> +<style lang="less" scoped> @import '@action/styles/theme.less';Improve image handling approach.
The current approach uses negative margins to adjust the image size within its container, which can lead to rendering issues. Consider either:
- Making the container match the image size
- Using object-fit to properly scale the image within the container
&__img-container { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; margin-right: 12px; img { - width: 60px; - height: 60px; - margin-top: -10px; - margin-left: -10px; + width: 100%; + height: 100%; + object-fit: cover; } }packages/extension/src/ui/action/views/settings/components/settings-select.vue (2)
92-94: Remove console log and improve fallback handlingThe debug logging and fallback mechanism need improvement:
const returnFlag = (value: string) => { - if (!LANG_INFO[value]) console.log(value); - return LANG_INFO[value]?.icon || XCD; + return LANG_INFO[value]?.icon || XCD; };While using XCD as fallback is functional, consider also notifying the user when an unrecognized currency is selected.
186-190: Improve overflow behavior for dropdownThe dropdown's overflow behavior can be improved for better user experience:
&__item-container { max-height: 230px; - overflow: scroll; + overflow: auto; }Using
overflow: autoinstead ofscrollwill only show scrollbars when needed, providing a cleaner UI.packages/extension/src/ui/action/views/settings/views/settings-general/index.vue (1)
114-116: Consider adding error handling to the currency selection method.The
selectCurrencymethod currently doesn't include any error handling. Consider adding try/catch blocks to handle potential failures when setting the currency.const selectCurrency = async (currency: string) => { - setSelectedCurrency(currency); + try { + await setSelectedCurrency(currency); + } catch (error) { + console.error('Failed to set currency:', error); + // Consider adding user notification here + } };
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (173)
packages/extension/src/ui/action/assets/fiat/AED.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/AFN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ALL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/AMD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ANG.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/AOA.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ARS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/AUD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/AWG.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/AZN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BAM.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BBD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BDT.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BGN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BHD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BIF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BMD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BND.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BOB.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BRL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BSD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BTN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BWP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BYN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BYR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/BZD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CAD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CDF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CHF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CLF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CLP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CNH.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CNY.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/COP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CRC.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CUC.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CUP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CVE.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/CZK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/DJF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/DKK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/DOP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/DZD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/EGP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ERN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ETB.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/EUR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/FJD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/FKP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GBP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GEL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GGP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GHS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GIP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GMD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GNF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GTQ.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/GYD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/HKD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/HNL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/HRK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/HTG.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/HUF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/IDQ.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/IDR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ILS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/IMP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/INR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/IQD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/IRR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ISK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/JEP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/JMD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/JOD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/JPY.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KES.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KGS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KHR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KMF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KPW.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KRW.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KWD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KYD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/KZT.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LAK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LBP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LKR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LRD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LSL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LTL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LVL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/LYD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MAD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MDL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MGA.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MKD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MMK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MNT.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MOP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MRU.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MUR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MVR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MWK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MXN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MYR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/MZN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/NAD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/NGN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/NIO.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/NOK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/NPR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/NZD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/OMR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PAB.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PEN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PGK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PHP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PKR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PLN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/PYG.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/QAR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/RON.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/RSD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/RUB.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/RWF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SAR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SBD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SCR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SDG.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SEK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SGD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SHP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SLE.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SLL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SOS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SRD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SSP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/STD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/STN.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SVC.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SYP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/SZL.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/THB.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TJS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TMT.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TND.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TOP.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TRY.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TTD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TWD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/TZS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/UAH.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/UGX.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/USD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/UYU.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/UZS.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/VES.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/VND.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/VUV.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/WST.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XAF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XAG.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XAU.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XCD.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XDR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XOF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/XPF.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/YER.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ZAR.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ZMK.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ZMW.svgis excluded by!**/*.svgpackages/extension/src/ui/action/assets/fiat/ZWL.svgis excluded by!**/*.svgyarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (48)
macos/Enkrypt/Enkrypt.xcodeproj/project.xcworkspace/contents.xcworkspacedata(1 hunks)package.json(1 hunks)packages/extension-bridge/package.json(1 hunks)packages/extension/package.json(4 hunks)packages/extension/src/libs/settings-state/index.ts(2 hunks)packages/extension/src/libs/settings-state/types.ts(2 hunks)packages/extension/src/providers/common/ui/send-transaction/send-fee-select.vue(1 hunks)packages/extension/src/providers/common/ui/send-transaction/send-input-amount.vue(1 hunks)packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-fee.vue(1 hunks)packages/extension/src/providers/ethereum/ui/send-transaction/index.vue(3 hunks)packages/extension/src/providers/kadena/ui/send-transaction/components/send-fee-display.vue(1 hunks)packages/extension/src/providers/kadena/ui/send-transaction/components/send-fee-select.vue(1 hunks)packages/extension/src/providers/polkadot/ui/send-transaction/components/send-fee-display.vue(1 hunks)packages/extension/src/providers/polkadot/ui/send-transaction/components/send-fee-select.vue(1 hunks)packages/extension/src/providers/solana/ui/send-transaction/components/send-fee-select.vue(1 hunks)packages/extension/src/providers/solana/ui/send-transaction/index.vue(2 hunks)packages/extension/src/ui/action/App.vue(4 hunks)packages/extension/src/ui/action/composables/account-info.ts(1 hunks)packages/extension/src/ui/action/main.ts(2 hunks)packages/extension/src/ui/action/types/filters.ts(2 hunks)packages/extension/src/ui/action/utils/currencyConfig.ts(1 hunks)packages/extension/src/ui/action/utils/filters.ts(2 hunks)packages/extension/src/ui/action/utils/misc.ts(0 hunks)packages/extension/src/ui/action/views/assets-select-list/components/assets-select-list-item.vue(1 hunks)packages/extension/src/ui/action/views/network-activity/components/network-activity-total.vue(1 hunks)packages/extension/src/ui/action/views/network-activity/components/network-activity-transaction.vue(3 hunks)packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue(1 hunks)packages/extension/src/ui/action/views/settings/components/setting-select-option.vue(1 hunks)packages/extension/src/ui/action/views/settings/components/settings-select.vue(1 hunks)packages/extension/src/ui/action/views/settings/store.ts(1 hunks)packages/extension/src/ui/action/views/settings/views/settings-backups/index.vue(3 hunks)packages/extension/src/ui/action/views/settings/views/settings-general/index.vue(4 hunks)packages/extension/src/ui/action/views/swap/components/swap-token-amount-input/index.vue(1 hunks)packages/extension/src/ui/action/views/swap/components/swap-token-to-amount/index.vue(1 hunks)packages/extension/src/ui/action/views/transaction-fee/components/transaction-fee-item.vue(1 hunks)packages/extension/src/ui/action/views/transaction-fee/index.vue(1 hunks)packages/hw-wallets/package.json(2 hunks)packages/keyring/package.json(1 hunks)packages/name-resolution/package.json(2 hunks)packages/request/package.json(1 hunks)packages/signers/bitcoin/package.json(1 hunks)packages/signers/ethereum/package.json(1 hunks)packages/signers/kadena/package.json(1 hunks)packages/signers/polkadot/package.json(1 hunks)packages/storage/package.json(1 hunks)packages/swap/package.json(1 hunks)packages/types/package.json(1 hunks)packages/utils/package.json(1 hunks)
💤 Files with no reviewable changes (1)
- packages/extension/src/ui/action/utils/misc.ts
🧰 Additional context used
🧬 Code Definitions (1)
packages/extension/src/libs/settings-state/index.ts (1)
packages/extension/src/libs/settings-state/types.ts (2) (2)
CurrencySettingsType(27-29)SettingsType(30-37)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: buildAll
🔇 Additional comments (63)
macos/Enkrypt/Enkrypt.xcodeproj/project.xcworkspace/contents.xcworkspacedata (1)
1-7: Standard Xcode workspace configuration looks good.This is a standard XML workspace configuration file for an Xcode project, properly structured with the correct version and self-referencing FileRef.
packages/extension/src/ui/action/views/network-activity/components/network-activity-total.vue (1)
20-20: Good formatting enhancement for currency display.The change to use
$filters.parseCurrencyimproves consistency in how currency values are displayed across the application, aligning with the currency exchange feature being implemented.packages/extension/src/ui/action/main.ts (3)
6-6: Good addition of Pinia for state management.Adding Pinia is appropriate for handling state management in a Vue 3 application, especially for features like currency exchange that require shared state across components.
15-15: Pinia instance creation looks good.Correctly creating a Pinia instance before using it in the application.
17-17: Proper integration of Pinia in the application.The middleware chain is correctly ordered with router first, Vue3Lottie second, and Pinia third.
packages/extension/src/ui/action/views/swap/components/swap-token-amount-input/index.vue (1)
28-28: Good improvement to currency formatting.Wrapping the existing formatting with
$filters.parseCurrency()ensures consistent currency display across the application, which is a core part of the currency exchange feature.packages/extension/src/ui/action/utils/currencyConfig.ts (1)
339-340: The code correctly exports the LANG_INFO object.The export is properly defined for the LANG_INFO constant.
packages/extension/src/providers/kadena/ui/send-transaction/components/send-fee-display.vue (1)
5-8: Good improvement to currency formatting.The updated code now uses a centralized currency parsing approach with
$filters.parseCurrency(), which will provide more consistent currency formatting across the application.packages/extension/src/providers/common/ui/send-transaction/send-input-amount.vue (1)
16-18: Good improvement to currency formatting.The updated code uses the consistent currency parsing pattern with
$filters.parseCurrency(), providing better standardization of currency display throughout the application.packages/extension/src/ui/action/views/assets-select-list/components/assets-select-list-item.vue (1)
18-24: Good implementation of consistent currency formatting.The price display now uses the standardized
$filters.parseCurrency()approach while maintaining the conditional fallback to '~' for missing prices.package.json (1)
35-37: Dependency versions updated to improve consistency and security.The commitlint and swc packages have been updated to their latest versions, which aligns with similar version updates across other package.json files in the project.
packages/storage/package.json (1)
30-30: Development dependencies updated to their latest versions.These dependency updates are part of a coordinated effort to standardize dependency versions across multiple packages in the project. The updates include patches and minor version improvements that likely contain bug fixes and performance enhancements.
Also applies to: 33-33, 39-39, 42-45
packages/extension/src/ui/action/views/settings/views/settings-backups/index.vue (1)
182-182: Layout adjustments improve the visual spacing.The margin increase from
0 16px 12pxto0 32pxprovides more horizontal spacing, and the container height reduction from225pxto205pxcreates a better visual cue that there's more content to scroll through.Also applies to: 193-193
packages/utils/package.json (2)
33-33: Development dependencies updated to their latest versions.These dependency updates are part of a coordinated effort to standardize dependency versions across multiple packages in the project. The updates include patches and minor version improvements that likely contain bug fixes and performance enhancements.
Also applies to: 36-36, 42-42, 45-49
27-27:Details
❓ Verification inconclusive
Polkadot crypto utility update may include important changes.
Since
@polkadot/util-cryptois a runtime dependency (not just a dev dependency), the update from 13.3.1 to 13.4.3 might include functionality changes that could affect application behavior. Consider checking the package's release notes for any breaking changes.
🌐 Web query:
What are the changes between @polkadot/util-crypto version 13.3.1 and 13.4.3?💡 Result:
The changes between
@polkadot/util-cryptoversions 13.3.1 and 13.4.3 include:Key Additions
- Added support for custom mnemonic wordlists when creating
KeyringPairinstances, enabling greater flexibility in key generation[9].- Implemented improved WebSocket error handling by switching to Node.js 22+'s native WebSocket library (
ws)[9].Technical Adjustments
- Rolled back a WebSocket implementation change in
x-wsmodule to address compatibility issues (#1980)[3][7].Dependency Updates
- Updated internal dependencies like
@polkadot/commonand@polkadot/apito maintain ecosystem compatibility[2][9].These changes focus on enhancing security customization options while maintaining compatibility with modern Node.js environments.
Citations:
- 1: https://github.com/polkadot-js/api/blob/master/CHANGELOG.md
- 2: https://github.com/polkadot-js/tools/blob/master/CHANGELOG.md
- 3: https://classic.yarnpkg.com/en/package/@polkadot/util-crypto
- 4: https://www.npmjs.com/package/@polkadot/util-crypto
- 5: https://www.npmjs.com/package/@polkadot/util-crypto?activeTab=code
- 6: https://gitee.com/mirrors/bitgo/blob/master/yarn.lock
- 7: https://raw.githubusercontent.com/polkadot-js/common/8b0f5bf46e3edf2f52001c499ccdd555d5bdf5c2/CHANGELOG.md
- 8: https://unpkg.com/browse/@polkadot/util-crypto@13.4.3/cjs/nacl/
- 9: https://newreleases.io/project/npm/@polkadot/util-crypto/release/13.4.1
- 10: https://unpkg.com/browse/@polkadot/util-crypto@13.4.3/key/
Action Required: Verify Runtime Compatibility After Update
The update from version 13.3.1 to 13.4.3 for
@polkadot/util-cryptointroduces enhancements—such as support for custom mnemonic wordlists, improved WebSocket handling, and dependency updates—that could potentially affect runtime behavior. Since this is a runtime dependency, please review the package’s release notes and changelog to ensure that none of these changes lead to unexpected issues in our application.
- Location:
packages/utils/package.json(line 27)- Updated Dependency:
"@polkadot/util-crypto": "^13.4.3"packages/types/package.json (1)
27-27: Dependencies updated to latest versionsThe updates to the development dependencies are a good practice for maintaining a secure and up-to-date codebase. The changes are minor version updates and patch releases which should be backward compatible.
Also applies to: 30-31, 36-41
packages/extension/src/providers/polkadot/ui/send-transaction/components/send-fee-select.vue (1)
6-12: Improved currency formatting with parseCurrencyThe implementation now uses the
parseCurrencyfilter which consolidates currency formatting and symbol display into a single function. This improves consistency across the application.packages/extension/src/providers/ethereum/ui/send-transaction/index.vue (3)
180-180: Import for new parseCurrency filterAdding the import for the new currency formatting utility aligns with the currency enhancements in this PR.
257-262: Network-specific fee selection logicAdded special handling for Fantom network to use the FASTEST gas price type by default, which is appropriate for networks where transaction finality needs to be prioritized.
452-457: Standardized currency formatting in error messagesUpdated error message formatting to use the new
parseCurrencyfunction, maintaining consistency with the rest of the application.packages/signers/ethereum/package.json (1)
35-35: Dependencies updated to latest versionsThe updates to the development dependencies will help maintain a secure and up-to-date development environment. These are minor version updates which should be backward compatible.
Also applies to: 38-39, 44-50
packages/extension/src/providers/common/ui/verify-transaction/verify-transaction-fee.vue (1)
4-7: Great enhancement to currency formatting!The change from hardcoded "$" to using the
parseCurrencyfilter improves internationalization support, allowing the application to display network fees in the user's preferred currency format.packages/signers/kadena/package.json (1)
31-48: Dependencies updated appropriatelyThese development dependency updates align with the project-wide dependency refresh. The changes are incremental version updates that should improve tooling and maintain compatibility across packages.
packages/extension/src/ui/action/views/transaction-fee/index.vue (1)
18-22: Consistent currency formatting implementationThis change follows the same pattern used elsewhere in the application, using the
parseCurrencyfilter to standardize currency display. This ensures consistency in how monetary values are presented throughout the UI.packages/signers/bitcoin/package.json (1)
35-50: Development dependencies properly updatedThese updates to development tools and libraries match the versions used in other packages, ensuring consistency across the project's build system and development environment.
packages/extension/src/providers/solana/ui/send-transaction/index.vue (2)
177-177: New import for currency formatting.The addition of
parseCurrencyimport is part of the standardized currency formatting approach being implemented across the application.
377-379: Improved currency display in error messages.The error message now uses
parseCurrencyto format the fiat value, which will respect the user's selected currency format instead of hardcoding to USD format.packages/extension/src/ui/action/views/swap/components/swap-token-to-amount/index.vue (1)
19-26: Enhanced currency display formatting.The token price display now uses the
parseCurrencyfilter which will respect the user's selected currency settings instead of displaying the value in a fixed format.packages/extension/src/ui/action/composables/account-info.ts (1)
34-41: Removed hardcoded USD currency suffix.The fiat amount is now formatted without the hardcoded " USD" suffix, allowing the
parseCurrencyfunction to handle the currency symbol and formatting based on the user's settings.packages/extension/src/providers/polkadot/ui/send-transaction/components/send-fee-display.vue (1)
5-8: Standardized fee currency display.Fee display now uses the
parseCurrencyfilter to format the fiat value according to the user's currency settings, consistent with other currency displays in the application.packages/extension/src/ui/action/types/filters.ts (1)
8-10: Well-structured integration of the parseCurrency filter!The addition of the
parseCurrencyfunction to the global$filtersnamespace is clean and follows the existing pattern. This enhancement will enable consistent currency formatting across the application.Also applies to: 18-20
packages/signers/polkadot/package.json (1)
25-28: Dependencies updated appropriatelyAll dependency updates are minor version bumps that should maintain compatibility while providing bug fixes and improvements.
Also applies to: 34-49
packages/extension/src/providers/kadena/ui/send-transaction/components/send-fee-select.vue (1)
6-12: Good implementation of the parseCurrency filterThe code now uses the new
parseCurrencyfilter to format the fiat value, which will ensure consistent currency formatting across the application. The conditional check for the existence offee.fiatValueis properly maintained.packages/extension/src/libs/settings-state/types.ts (2)
6-6: Good addition to StorageKeys enumThe addition of
currencyStateto theStorageKeysenum follows the existing naming convention.
35-35: Proper integration with SettingsType interfaceThe currency settings state is properly added to the main
SettingsTypeinterface.packages/extension/src/providers/solana/ui/send-transaction/components/send-fee-select.vue (1)
5-8: Good change to standardize currency formattingThe update to use the
parseCurrencyfilter provides more consistent currency formatting across the application, aligning with the currency management improvements in this PR.packages/extension/src/providers/common/ui/send-transaction/send-fee-select.vue (1)
9-12: Nice improvement to currency display formatThe change to use the
parseCurrencyfilter standardizes how currencies are displayed throughout the application, which should provide a more consistent user experience.packages/extension-bridge/package.json (1)
47-64: Good dependency maintenanceThese minor version updates to dev dependencies will help keep the project secure and up-to-date with the latest bug fixes and improvements.
packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue (1)
46-47:Details
❓ Verification inconclusive
Verify property name change while updating currency formatting
While the change to use
parseCurrencyis good for consistency, I noticed a potential issue: the property changed from what appears to betoken.valueftotoken.value. Please verify this is intentional and that these properties contain compatible data.
🏁 Script executed:
#!/bin/bash # Searching for usages of token.valuef and token.value echo "Searching for token.valuef usage:" rg "token\.valuef" -A 2 -B 2 echo -e "\nSearching for token.value usage:" rg "token\.value" -A 2 -B 2Length of output: 4842
Action Required: Verify Compatibility Between
token.valueandtoken.valuefAfter reviewing the repository:
- The update in packages/extension/src/ui/action/views/network-assets/components/network-assets-item.vue now uses
$filters.parseCurrency(token.value), aligning with how token prices are handled in several provider files (e.g., in the Kadena, Solana, Ethereum, and Bitcoin network types).- However, in packages/extension/src/ui/action/views/asset-detail-view/index.vue the property
token.valuefis still in use.Please confirm that:
- The switch to
token.valuein the network assets view is intentional and that its (likely numeric) data is compatible withparseCurrency.- The apparent distinction between
token.value(used for formatting in most contexts) andtoken.valuef(possibly a pre-formatted string) is by design.
If both properties are meant to represent token pricing information, ensuring consistency across components might be beneficial.packages/extension/src/ui/action/views/transaction-fee/components/transaction-fee-item.vue (1)
21-22: Good improvement to currency formatting!Replacing the hardcoded dollar sign with the
parseCurrencyfilter allows for better internationalization support and consistent currency formatting throughout the application.packages/extension/src/libs/settings-state/index.ts (5)
11-11: Good addition of CurrencySettingsType import.Properly importing the new type for currency settings.
76-78: Implementation of setCurrencySettings follows established pattern.The implementation correctly follows the same pattern as other settings methods, storing the state in the appropriate storage location.
80-86: Well-structured getCurrencySettings implementation.The method properly retrieves currency settings with a default value of 'USD', following the same pattern as other settings retrieval methods in the class.
93-93: Good integration with getAllSettings.Correctly retrieves the currency settings state when getting all settings.
99-99: Properly includes currencySettingsState in the returned settings object.The implementation correctly includes the currency settings in the returned object.
packages/extension/src/ui/action/utils/filters.ts (3)
1-1: Good import of BigNumber for precise numerical operations.Using BigNumber is appropriate for financial calculations to avoid floating-point precision issues.
3-3: Proper import of LANG_INFO for localization.This import provides the necessary locale information for currency formatting.
8-8: Good integration with currency store.Importing the currency store allows access to user's currency preferences.
packages/extension/src/ui/action/views/network-activity/components/network-activity-transaction.vue (3)
13-19: Improved code readability for image sourceGood restructuring of the template code for better readability. Breaking up the complex logic into multiple lines makes it easier to understand.
76-78: Updated to use consistent currency formattingGood update to use the new
parseCurrencyfilter for consistent currency formatting across the application.
123-126: Updated to use consistent currency formatting for swap viewGood implementation of the new
parseCurrencyfilter in the swap transaction view, ensuring consistency with other currency displays.packages/extension/src/ui/action/views/settings/components/settings-select.vue (1)
1-192: Well-implemented settings selector componentOverall, this new component is well-structured and provides a good user experience for selecting currencies. The component has:
- Clear separation between template, script, and styles
- Proper reactive state management
- Good search functionality with computed property
- Well-organized props with defaults
The implementation follows Vue 3 Composition API practices correctly.
packages/extension/src/ui/action/views/settings/views/settings-general/index.vue (2)
4-9: Great improvement to the UI components!The replacement of the commented-out
<base-select>with an active<settings-select>component enhances the currency selection functionality. The binding toselectCurrency,currentSelectedCurrency, andcurrencySymbolsproperly connects this component to the new currency store.
137-141: Well-implemented computed property for currency symbols.The computed property correctly derives the list of currency symbols from the currency list. The null check prevents errors when the list is empty.
packages/keyring/package.json (1)
32-32: Dependencies updated appropriately.The dependency updates to
@polkadot/utiland development dependencies are good practice for maintaining a healthy codebase. These updates likely include security patches, bug fixes, and new features.Also applies to: 37-52
packages/name-resolution/package.json (1)
25-40: Dependencies updated appropriately.The dependency updates, particularly the update to
ethers, are important for security and compatibility. The consistent updates across packages suggest a coordinated maintenance effort.Also applies to: 53-53
packages/hw-wallets/package.json (1)
25-40: Important hardware wallet dependency updates.The updates to Ledger and Polkadot packages are crucial for maintaining compatibility with the latest hardware wallet firmware and blockchain updates. These updates enhance security and functionality for hardware wallet integrations.
Also applies to: 55-62
packages/request/package.json (2)
30-31: Dependency Versions Updated: uuid & ws
The versions for"uuid"and"ws"have been updated to^11.1.0and^8.18.1, respectively. These updates appear to be minor but ensure that any breaking changes in these libraries have been reviewed and are compatible with your codebase.
34-49: DevDependencies Upgrades Reviewed
The versions for"@types/node","eslint","prettier","tsup","typescript","typescript-eslint", and"vitest"have been bumped. These updates are in line with similar changes across other packages. Please confirm that these new versions integrate smoothly with your development and CI environments.packages/swap/package.json (2)
27-39: Updated Dependencies Across Core Libraries
The dependency updates include:
"@solana/spl-token"updated to^0.4.13"rango-sdk-basic"updated to^0.1.64"uuid"updated to^11.1.0"ws"updated to^8.18.1These changes are consistent with the upgrades in other parts of the repository. Please verify that these updated versions maintain backward compatibility with your current implementations.
42-57: DevDependencies Alignment Confirmed
The updated devDependencies—namely"@types/node","eslint","prettier","tsup","typescript","typescript-eslint", and"vitest"—are now consistent with the versions used in related packages. This consolidation can help avoid version conflicts during development and build processes.packages/extension/package.json (2)
26-80: Comprehensive Dependencies Updates
A broad set of dependencies have been upgraded, including blockchain integration libraries and analytics tools:
"@amplitude/analytics-browser","@kadena/client", and"@kadena/pactjs-cli"now support the latest features.- Multiple updates to the
"@metaplex-foundation","@polkadot", and"@solana"packages are in place—likely to support enhanced currency settings and blockchain functionalities.- The update to
"uuid"now aligns with changes in other package components.These updates should reinforce the new currency exchange features, but please double-check that any changes in these external packages (especially those involved in financial or blockchain operations) do not introduce breaking changes in the application.
92-140: Robust DevDependencies Enhancements
DevDependencies such as the Rollup plugins, ESLint, Prettier, TypeScript, and associated tooling have been updated. This ensures that the build tools and development linting configurations remain current and compatible with the rest of the ecosystem. Verify that these updates do not adversely affect the build process or local development configurations.
Summary by CodeRabbit
New Features
setting-select-option.vueandsettings-select.vueintroduced for better user interaction in currency selection.fetchAndSetRatesadded to fetch and update currency rates.Chores