From fbb56945bf67dc157acd3a1dd07e9965704db48a Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Fri, 13 Sep 2024 13:29:45 -0400 Subject: [PATCH 1/7] CI Fixes (#1700) --- e2e/serial/swap/1_swapFlow1.test.ts | 2 +- lavamoat/build-webpack/policy.json | 9 +++++++-- package.json | 4 +++- yarn.lock | 16 ++++++++-------- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/e2e/serial/swap/1_swapFlow1.test.ts b/e2e/serial/swap/1_swapFlow1.test.ts index ad28107fac..0103a8df0f 100644 --- a/e2e/serial/swap/1_swapFlow1.test.ts +++ b/e2e/serial/swap/1_swapFlow1.test.ts @@ -640,7 +640,7 @@ it('should be able to filter assets to buy by network', async () => { await typeOnTextInput({ id: 'token-to-buy-search-token-input', driver, - text: 'matic', + text: 'pol', }); await delayTime('long'); await findElementByTestIdAndClick({ diff --git a/lavamoat/build-webpack/policy.json b/lavamoat/build-webpack/policy.json index 19440ec708..69a0472426 100644 --- a/lavamoat/build-webpack/policy.json +++ b/lavamoat/build-webpack/policy.json @@ -1184,8 +1184,13 @@ "define": true }, "packages": { - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": true, - "webpack>terser-webpack-plugin>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true, + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": true + } + }, + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/resolve-uri": { + "globals": { + "define": true } }, "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": { diff --git a/package.json b/package.json index 286cf43fb3..46b02f3d20 100644 --- a/package.json +++ b/package.json @@ -277,7 +277,9 @@ "braces": "3.0.3", "ws": "8.17.1", "micromatch": "4.0.8", - "webpack": "5.94.0" + "webpack": "5.94.0", + "path-to-regexp": "6.3.0", + "dset": "3.1.4" }, "lavamoat": { "allowScripts": { diff --git a/yarn.lock b/yarn.lock index dd3c2e5cf2..c547b1ba1c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8231,10 +8231,10 @@ dotenv@^8.2.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== -dset@^3.1.2: - version "3.1.3" - resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.3.tgz#c194147f159841148e8e34ca41f638556d9542d2" - integrity sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ== +dset@3.1.4, dset@^3.1.2: + version "3.1.4" + resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.4.tgz#f8eaf5f023f068a036d08cd07dc9ffb7d0065248" + integrity sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA== dtrace-provider@~0.8: version "0.8.8" @@ -14026,10 +14026,10 @@ path-scurry@^1.6.1: lru-cache "^9.1.1 || ^10.0.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@^6.2.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz#d54934d6798eb9e5ef14e7af7962c945906918e5" - integrity sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw== +path-to-regexp@6.3.0, path-to-regexp@^6.2.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-6.3.0.tgz#2b6a26a337737a8e1416f9272ed0766b1c0389f4" + integrity sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ== path-type@^4.0.0: version "4.0.0" From 0b0f08ee6e8cbab9a5d674d8dff13eb26f19a337 Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Fri, 13 Sep 2024 14:10:37 -0400 Subject: [PATCH 2/7] fix: prevent underflow error when parsing native asset fee and price (#1690) Co-authored-by: Daniel Sinclair <4412473+DanielSinclair@users.noreply.github.com> --- src/core/utils/transactions.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/core/utils/transactions.ts b/src/core/utils/transactions.ts index 79a52b4350..820eebf77a 100644 --- a/src/core/utils/transactions.ts +++ b/src/core/utils/transactions.ts @@ -222,7 +222,10 @@ const parseFees = ( const feeValue = FixedNumber.from( formatUnits(BigInt(fee.value) + rollupFee, nativeAssetDecimals), ); - const feePrice = FixedNumber.fromString(fee.price.toString()); + const feePrice = FixedNumber.fromString( + fee.price.toFixed(nativeAssetDecimals).toString(), + nativeAssetDecimals, + ); return { fee: feeValue.toString(), @@ -278,19 +281,23 @@ export function parseTransaction({ const description = getDescription(asset, type, meta); const nativeAsset = changes.find((change) => change?.asset.isNativeAsset); - const nativeAssetPrice = FixedNumber.fromString( - nativeAsset?.price?.toString() || '0', - ); const value = FixedNumber.fromValue( BigNumber.from(nativeAsset?.value || 0), nativeAsset?.asset.decimals || 0, ); - const valueInNative = value.mulUnsafe(nativeAssetPrice).toString(); - const nativeAssetDecimals = 18; // we only support networks with 18 decimals native assets rn, backend will change when we support more + const nativeAssetPrice = FixedNumber.fromString( + typeof nativeAsset?.price === 'number' + ? nativeAsset.price.toFixed(nativeAssetDecimals).toString() + : '0', + nativeAssetDecimals, + ); + + const valueInNative = value.mulUnsafe(nativeAssetPrice).toString(); + const { feeInNative, ...fee } = parseFees(tx.fee, nativeAssetDecimals); const native = { From 09bb6aa8ddba4cf5bc63a0b7055654f7fbbe239b Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Fri, 13 Sep 2024 14:45:22 -0400 Subject: [PATCH 3/7] fix: prevent asset to buy dropdown from opening if asset to buy is already set (#1693) --- src/entries/popup/pages/swap/index.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/entries/popup/pages/swap/index.tsx b/src/entries/popup/pages/swap/index.tsx index fca9dc4f28..9b57f71ecb 100644 --- a/src/entries/popup/pages/swap/index.tsx +++ b/src/entries/popup/pages/swap/index.tsx @@ -799,7 +799,9 @@ export function Swap({ bridge = false }: { bridge?: boolean }) { } setAssetToSellInputValue={setAssetToSellInputValue} inputRef={assetToSellInputRef} - openDropdownOnMount={inputToOpenOnMount === 'sell'} + openDropdownOnMount={ + inputToOpenOnMount === 'sell' && !assetToSell + } assetToSellNativeValue={assetToSellNativeValue} assetToSellNativeDisplay={assetToSellNativeDisplay} setAssetToSellInputNativeValue={ @@ -881,7 +883,9 @@ export function Swap({ bridge = false }: { bridge?: boolean }) { assetToSellValue={assetToSellValue} setAssetToBuyInputValue={setAssetToBuyInputValue} inputRef={assetToBuyInputRef} - openDropdownOnMount={inputToOpenOnMount === 'buy'} + openDropdownOnMount={ + inputToOpenOnMount === 'buy' && !assetToBuy + } inputDisabled={isCrosschainSwap} assetToBuyNativeDisplay={assetToBuyNativeDisplay} assetToSellNativeDisplay={assetToSellNativeDisplay} From 37e2060d3a37f9bbd4a49710e5200c4ee930acf3 Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Fri, 13 Sep 2024 16:06:45 -0400 Subject: [PATCH 4/7] fix: always bump user to tokens after a swap (#1691) Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com> --- .../popup/pages/swap/SwapReviewSheet/SwapReviewSheet.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/entries/popup/pages/swap/SwapReviewSheet/SwapReviewSheet.tsx b/src/entries/popup/pages/swap/SwapReviewSheet/SwapReviewSheet.tsx index 67a3175991..eab89bfb95 100644 --- a/src/entries/popup/pages/swap/SwapReviewSheet/SwapReviewSheet.tsx +++ b/src/entries/popup/pages/swap/SwapReviewSheet/SwapReviewSheet.tsx @@ -284,7 +284,7 @@ const SwapReviewSheetWithQuote = ({ setSendingSwap(false); if (swapExecutedSuccessfully) { - navigate(ROUTES.HOME, { state: { tab: 'activity' } }); + navigate(ROUTES.HOME, { state: { tab: 'tokens' } }); } }, [ assetToBuy, From dc11fa41b940721e4bbe831c48f4c6efa09f7ee0 Mon Sep 17 00:00:00 2001 From: Christopher Howard Date: Fri, 13 Sep 2024 16:08:34 -0400 Subject: [PATCH 5/7] fix: disable send shortcuts while contact prompt is active (#1692) Co-authored-by: Daniel Sinclair <4412473+DanielSinclair@users.noreply.github.com> Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com> --- .../TransactionFee/TransactionFee.tsx | 39 ++++++---- src/entries/popup/pages/send/index.tsx | 77 ++++++++++--------- 2 files changed, 63 insertions(+), 53 deletions(-) diff --git a/src/entries/popup/components/TransactionFee/TransactionFee.tsx b/src/entries/popup/components/TransactionFee/TransactionFee.tsx index c5b172162a..5bfc248721 100644 --- a/src/entries/popup/components/TransactionFee/TransactionFee.tsx +++ b/src/entries/popup/components/TransactionFee/TransactionFee.tsx @@ -45,6 +45,7 @@ import { SwitchTransactionSpeedMenu } from './TransactionSpeedsMenu'; type FeeProps = { chainId: ChainId; + disableShortcuts?: boolean; accentColor?: string; plainTriggerBorder?: boolean; selectedSpeed: GasSpeed; @@ -71,6 +72,7 @@ function Fee({ analyticsEvents, baseFeeTrend, chainId, + disableShortcuts, currentBaseFee, gasFeeParamsBySpeed, isLoading, @@ -130,22 +132,24 @@ function Fee({ useKeyboardShortcut({ handler: (e: KeyboardEvent) => { - if (e.key === shortcuts.global.OPEN_CUSTOM_GAS_MENU.key) { - if (chainId === ChainId.mainnet) { - trackShortcut({ - key: shortcuts.global.OPEN_CUSTOM_GAS_MENU.display, - type: 'customGasMenu.open', - }); - // hackery preventing GweiInputMask from firing an onChange event when opening the menu with KB - setTimeout(() => openCustomGasSheet(), 0); - } - } else if (e.key === shortcuts.global.OPEN_GAS_MENU.key) { - if (chainId === ChainId.mainnet || chainId === ChainId.polygon) { - trackShortcut({ - key: shortcuts.global.OPEN_GAS_MENU.display, - type: 'gasMenu.open', - }); - switchTransactionSpeedMenuRef?.current?.open(); + if (!disableShortcuts) { + if (e.key === shortcuts.global.OPEN_CUSTOM_GAS_MENU.key) { + if (chainId === ChainId.mainnet) { + trackShortcut({ + key: shortcuts.global.OPEN_CUSTOM_GAS_MENU.display, + type: 'customGasMenu.open', + }); + // hackery preventing GweiInputMask from firing an onChange event when opening the menu with KB + setTimeout(() => openCustomGasSheet(), 0); + } + } else if (e.key === shortcuts.global.OPEN_GAS_MENU.key) { + if (chainId === ChainId.mainnet || chainId === ChainId.polygon) { + trackShortcut({ + key: shortcuts.global.OPEN_GAS_MENU.display, + type: 'gasMenu.open', + }); + switchTransactionSpeedMenuRef?.current?.open(); + } } } }, @@ -256,6 +260,7 @@ function Fee({ type TransactionFeeProps = { chainId: ChainId; + disableShortcuts?: boolean; address?: Address; defaultSpeed?: GasSpeed; transactionRequest: TransactionRequest; @@ -271,6 +276,7 @@ type TransactionFeeProps = { export function TransactionFee({ chainId, + disableShortcuts, address, defaultSpeed, transactionRequest, @@ -302,6 +308,7 @@ export function TransactionFee({ return ( { - if (e.altKey) { - if (e.key === shortcuts.send.FOCUS_TO_ADDRESS.key) { - trackShortcut({ - key: shortcuts.send.FOCUS_TO_ADDRESS.display, - type: 'send.focusToAddress', - }); - toAddressInputRef?.current?.focus(); - sendTokenInputRef?.current?.blur(); - } - if (e.key === shortcuts.send.FOCUS_ASSET.key) { - trackShortcut({ - key: shortcuts.send.FOCUS_ASSET.display, - type: 'send.focusAsset', - }); - toAddressInputRef?.current?.blur(); - sendTokenInputRef.current?.focus(); - } - } else { - if (!toAddressInputRef.current?.isFocused?.()) { - if (e.key === shortcuts.send.SET_MAX_AMOUNT.key) { + if (!explainerSheetParams.show && !contactSaveAction.show) { + if (e.altKey) { + if (e.key === shortcuts.send.FOCUS_TO_ADDRESS.key) { trackShortcut({ - key: shortcuts.send.SET_MAX_AMOUNT.display, - type: 'send.setMax', + key: shortcuts.send.FOCUS_TO_ADDRESS.display, + type: 'send.focusToAddress', }); - setMaxAssetAmount(); + toAddressInputRef?.current?.focus(); + sendTokenInputRef?.current?.blur(); } - if (e.key === shortcuts.send.SWITCH_CURRENCY_LABEL.key) { + if (e.key === shortcuts.send.FOCUS_ASSET.key) { trackShortcut({ - key: shortcuts.send.SWITCH_CURRENCY_LABEL.display, - type: 'send.switchCurrency', + key: shortcuts.send.FOCUS_ASSET.display, + type: 'send.focusAsset', }); - switchIndependentField(); + toAddressInputRef?.current?.blur(); + sendTokenInputRef.current?.focus(); + } + } else { + if (!toAddressInputRef.current?.isFocused?.()) { + if (e.key === shortcuts.send.SET_MAX_AMOUNT.key) { + trackShortcut({ + key: shortcuts.send.SET_MAX_AMOUNT.display, + type: 'send.setMax', + }); + setMaxAssetAmount(); + } + if (e.key === shortcuts.send.SWITCH_CURRENCY_LABEL.key) { + trackShortcut({ + key: shortcuts.send.SWITCH_CURRENCY_LABEL.display, + type: 'send.switchCurrency', + }); + switchIndependentField(); + } + } + if ( + e.key === shortcuts.send.OPEN_CONTACT_MENU.key && + !valueInputRef.current?.isFocused?.() + ) { + trackShortcut({ + key: shortcuts.send.OPEN_CONTACT_MENU.display, + type: 'send.openContactMenu', + }); + clickHeaderRight(); } - } - if ( - e.key === shortcuts.send.OPEN_CONTACT_MENU.key && - !valueInputRef.current?.isFocused?.() - ) { - trackShortcut({ - key: shortcuts.send.OPEN_CONTACT_MENU.display, - type: 'send.openContactMenu', - }); - clickHeaderRight(); } } }, @@ -753,6 +755,7 @@ export function Send() { Date: Fri, 13 Sep 2024 14:09:24 -0600 Subject: [PATCH 6/7] chore: matic-pol migration (#1694) Co-authored-by: Christopher Howard Co-authored-by: Bruno Barbieri <1247834+brunobar79@users.noreply.github.com> --- e2e/serial/swap/1_swapFlow1.test.ts | 4 +- e2e/walletVariables.ts | 2 +- lavamoat/build-webpack/policy.json | 50 +++++++------------- src/core/references/index.ts | 6 +-- src/core/resources/addys/addysSummary.ts | 2 +- src/core/resources/search/tokenSearch.ts | 4 +- src/core/state/favorites/index.ts | 4 +- src/core/types/transactions.ts | 2 +- src/entries/popup/hooks/useWalletsSummary.ts | 12 ++--- static/json/languages/ar_AR.json | 2 +- static/json/languages/en_US.json | 2 +- static/json/languages/es_419.json | 2 +- static/json/languages/fr_FR.json | 2 +- static/json/languages/id_ID.json | 2 +- static/json/languages/ja_JP.json | 2 +- static/json/languages/ko_KR.json | 2 +- static/json/languages/pt_BR.json | 2 +- static/json/languages/ru_RU.json | 2 +- static/json/languages/th_TH.json | 2 +- static/json/languages/tr_TR.json | 2 +- static/json/languages/zh_CN.json | 2 +- 21 files changed, 48 insertions(+), 62 deletions(-) diff --git a/e2e/serial/swap/1_swapFlow1.test.ts b/e2e/serial/swap/1_swapFlow1.test.ts index 0103a8df0f..6d9da751d1 100644 --- a/e2e/serial/swap/1_swapFlow1.test.ts +++ b/e2e/serial/swap/1_swapFlow1.test.ts @@ -644,12 +644,12 @@ it('should be able to filter assets to buy by network', async () => { }); await delayTime('long'); await findElementByTestIdAndClick({ - id: `${SWAP_VARIABLES.MATIC_POLYGON_ID}-favorites-token-to-buy-row`, + id: `${SWAP_VARIABLES.POL_POLYGON_ID}-favorites-token-to-buy-row`, driver, }); // ARBITRUM await findElementByTestIdAndClick({ - id: `${SWAP_VARIABLES.MATIC_POLYGON_ID}-token-to-buy-token-input-remove`, + id: `${SWAP_VARIABLES.POL_POLYGON_ID}-token-to-buy-token-input-remove`, driver, }); await findElementByTestIdAndClick({ diff --git a/e2e/walletVariables.ts b/e2e/walletVariables.ts index 9412fd5fac..f7f033e422 100644 --- a/e2e/walletVariables.ts +++ b/e2e/walletVariables.ts @@ -41,7 +41,7 @@ export const SWAP_VARIABLES = { ETH_MAINNET_ID: 'eth_1', ETH_OPTIMISM_ID: '0x0000000000000000000000000000000000000000_10', GMX_ARBITRUM_ID: '0xfc5a1a6eb076a2c7ad06ed22c90d7e710e35ad0a_42161', - MATIC_POLYGON_ID: '0x0000000000000000000000000000000000001010_137', + POL_POLYGON_ID: '0x0000000000000000000000000000000000001010_137', OP_OPTIMISM_ID: '0x4200000000000000000000000000000000000042_10', UNI_BNB_ID: '0xbf5140a22578168fd562dccf235e5d43a02ce9b1_56', USDC_ARBITRUM_ID: '0xaf88d065e77c8cc2239327c5edb3a432268e5831_42161', diff --git a/lavamoat/build-webpack/policy.json b/lavamoat/build-webpack/policy.json index 69a0472426..e49f823566 100644 --- a/lavamoat/build-webpack/policy.json +++ b/lavamoat/build-webpack/policy.json @@ -614,10 +614,10 @@ "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": true, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-split-export-declaration": true, + "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-validator-identifier": true, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/template": true, "jest>@jest/core>jest-snapshot>@babel/traverse": true, - "jest>@jest/core>jest-snapshot>@babel/types": true, - "jest>@jest/core>jest-snapshot>@babel/types>@babel/helper-validator-identifier": true + "jest>@jest/core>jest-snapshot>@babel/types": true } }, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": { @@ -1141,9 +1141,16 @@ "console.warn": true, "process.emitWarning": true }, + "packages": { + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>@babel/highlight": true, + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>chalk": true + } + }, + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>@babel/highlight": { "packages": { "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>chalk": true, - "lavamoat>@babel/highlight": true + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types>@babel/helper-validator-identifier": true, + "react>loose-envify>js-tokens": true } }, "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>chalk": { @@ -1222,34 +1229,6 @@ "lavamoat>lavamoat-core>@babel/types>to-fast-properties": true } }, - "lavamoat>@babel/highlight": { - "packages": { - "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true, - "lavamoat>@babel/highlight>chalk": true, - "react>loose-envify>js-tokens": true - } - }, - "lavamoat>@babel/highlight>chalk": { - "globals": { - "process.env.TERM": true, - "process.platform": true - }, - "packages": { - "lavamoat>@babel/highlight>chalk>ansi-styles": true, - "lavamoat>@babel/highlight>chalk>escape-string-regexp": true, - "supports-color": true - } - }, - "lavamoat>@babel/highlight>chalk>ansi-styles": { - "packages": { - "lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": true - } - }, - "lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": { - "packages": { - "lavamoat>@babel/highlight>chalk>ansi-styles>color-convert>color-name": true - } - }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name": { "packages": { "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template": true, @@ -1269,10 +1248,17 @@ "process.emitWarning": true }, "packages": { - "lavamoat>@babel/highlight": true, + "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>@babel/highlight": true, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": true } }, + "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>@babel/highlight": { + "packages": { + "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": true, + "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types>@babel/helper-validator-identifier": true, + "react>loose-envify>js-tokens": true + } + }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": { "globals": { "process.env.TERM": true, diff --git a/src/core/references/index.ts b/src/core/references/index.ts index 79eab77b9a..9df60444b0 100644 --- a/src/core/references/index.ts +++ b/src/core/references/index.ts @@ -50,8 +50,8 @@ export const ETH_ADDRESS = 'eth'; export const DAI_ADDRESS = '0x6b175474e89094c44da98b954eedeac495271d0f'; export const USDC_ADDRESS = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'; export const WBTC_ADDRESS = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599'; -export const MATIC_MAINNET_ADDRESS = - '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0'; +export const POL_MAINNET_ADDRESS = + '0x455e53CBB86018Ac2B8092FdCd39d8444aFFC3F6'; export const BNB_MAINNET_ADDRESS = '0xb8c77482e45f1f44de1745f52c74426c631bdd52'; export const SOCKS_ADDRESS = '0x23b608675a2b2fb1890d3abbd85c5775c51691d5'; export const WETH_ADDRESS = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'; @@ -84,7 +84,7 @@ export const DAI_BSC_ADDRESS = '0x6b175474e89094c44da98b954eedeac495271d0f'; export const USDC_BSC_ADDRESS = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'; // polygon -export const MATIC_POLYGON_ADDRESS = +export const POL_POLYGON_ADDRESS = '0x0000000000000000000000000000000000001010'; export const WETH_POLYGON_ADDRESS = '0x7ceb23fd6bc0add59e62ac25578270cff1b9f619'; diff --git a/src/core/resources/addys/addysSummary.ts b/src/core/resources/addys/addysSummary.ts index 09e0e64258..8660fa2c48 100644 --- a/src/core/resources/addys/addysSummary.ts +++ b/src/core/resources/addys/addysSummary.ts @@ -28,7 +28,7 @@ export interface AddySummary { [key: Address]: { summary: { native_balance_by_symbol: { - [key in 'ETH' | 'MATIC' | 'BNB' | 'AVAX']: { + [key in 'ETH' | 'POL' | 'BNB' | 'AVAX']: { symbol: string; quantity: string; decimals: number; diff --git a/src/core/resources/search/tokenSearch.ts b/src/core/resources/search/tokenSearch.ts index 53823aafbc..67f09dbef2 100644 --- a/src/core/resources/search/tokenSearch.ts +++ b/src/core/resources/search/tokenSearch.ts @@ -14,7 +14,7 @@ import { import { BNB_BSC_ADDRESS, ETH_ADDRESS, - MATIC_POLYGON_ADDRESS, + POL_POLYGON_ADDRESS, } from '~/core/references'; import { ChainId } from '~/core/types/chains'; import { @@ -111,7 +111,7 @@ function parseTokenSearch(assets: SearchAsset[], chainId: ChainId) { `${ETH_ADDRESS}_${ChainId.optimism}`, `${ETH_ADDRESS}_${ChainId.arbitrum}`, `${BNB_BSC_ADDRESS}_${ChainId.bsc}`, - `${MATIC_POLYGON_ADDRESS}_${ChainId.polygon}`, + `${POL_POLYGON_ADDRESS}_${ChainId.polygon}`, `${ETH_ADDRESS}_${ChainId.base}`, `${ETH_ADDRESS}_${ChainId.zora}`, `${ETH_ADDRESS}_${ChainId.avalanche}`, diff --git a/src/core/state/favorites/index.ts b/src/core/state/favorites/index.ts index 29ecd3f7bc..4afd590b2c 100644 --- a/src/core/state/favorites/index.ts +++ b/src/core/state/favorites/index.ts @@ -17,7 +17,7 @@ import { ETH_BLAST_ADDRESS, ETH_OPTIMISM_ADDRESS, ETH_ZORA_ADDRESS, - MATIC_POLYGON_ADDRESS, + POL_POLYGON_ADDRESS, OP_ADDRESS, SOCKS_ADDRESS, SOCKS_ARBITRUM_ADDRESS, @@ -77,7 +77,7 @@ const defaultFavorites = { ], [ChainId.bsc]: [BNB_BSC_ADDRESS, DAI_BSC_ADDRESS, USDC_BSC_ADDRESS], [ChainId.polygon]: [ - MATIC_POLYGON_ADDRESS, + POL_POLYGON_ADDRESS, WETH_POLYGON_ADDRESS, DAI_POLYGON_ADDRESS, USDC_POLYGON_ADDRESS, diff --git a/src/core/types/transactions.ts b/src/core/types/transactions.ts index b3672d4127..2d5ca55de0 100644 --- a/src/core/types/transactions.ts +++ b/src/core/types/transactions.ts @@ -36,7 +36,7 @@ type BaseTransaction = { direction?: TransactionDirection; flashbots?: boolean; - value?: string; // network asset amount sent with the tx (like eth or matic) + value?: string; // network asset amount sent with the tx (like eth or pol) fee?: string; native?: { // fee and value but in the user prefered currency terms (USD, EUR, etc) diff --git a/src/entries/popup/hooks/useWalletsSummary.ts b/src/entries/popup/hooks/useWalletsSummary.ts index 05ec8b812c..2726e23222 100644 --- a/src/entries/popup/hooks/useWalletsSummary.ts +++ b/src/entries/popup/hooks/useWalletsSummary.ts @@ -47,7 +47,7 @@ const parseAddressSummary = ({ const { ETH: ethRawBalance, BNB: bnbRawBalance, - MATIC: maticRawBalance, + POL: polRawBalance, AVAX: avaxRawBalance, } = addressData?.summary.native_balance_by_symbol || {}; @@ -69,14 +69,14 @@ const parseAddressSummary = ({ currentCurrency, ).amount; - const maticBalance = convertRawAmountToBalance( - maticRawBalance?.quantity || 0, + const polBalance = convertRawAmountToBalance( + polRawBalance?.quantity || 0, { decimals: 18, }, ).amount; - const maticCurrencyBalance = convertAmountAndPriceToNativeDisplay( - maticBalance || 0, + const polCurrencyBalance = convertAmountAndPriceToNativeDisplay( + polBalance || 0, nativeAssets?.[ChainId.polygon]?.price?.value || 0, currentCurrency, ).amount; @@ -92,7 +92,7 @@ const parseAddressSummary = ({ const balance = add( add(ethCurrencyBalance, bnbCurrencyBalance), - add(maticCurrencyBalance, avaxCurrencyBalance), + add(polCurrencyBalance, avaxCurrencyBalance), ); const balanceDisplay = convertAmountToNativeDisplay(balance, currentCurrency); diff --git a/static/json/languages/ar_AR.json b/static/json/languages/ar_AR.json index d0701fa9b2..e681bee5a2 100644 --- a/static/json/languages/ar_AR.json +++ b/static/json/languages/ar_AR.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "كلما استخدمت Rainbow أكثر، كلما حصلت على مكافآت أكبر", "balance_required": "مطلوب رصيد في المحفظة", "ensure_you_have_a_balance_on": "للمتابعة، تأكد من امتلاكك لرصيد ETH على إحدى الشبكات التالية:", - "or_alternatively_balance_on": "أو بديلًا، رصيد MATIC على شبكة Polygon أو رصيد BNB على شبكة BSC", + "or_alternatively_balance_on": "أو بديلًا، رصيد POL على شبكة Polygon أو رصيد BNB على شبكة BSC", "fund_my_wallet": "تمويل محفظتي" }, "error": { diff --git a/static/json/languages/en_US.json b/static/json/languages/en_US.json index 0af93da120..969105db2f 100644 --- a/static/json/languages/en_US.json +++ b/static/json/languages/en_US.json @@ -1461,7 +1461,7 @@ "the_more_you_use": "The more you use Rainbow, the more you’ll be rewarded", "balance_required": "Wallet balance required", "ensure_you_have_a_balance_on": "To continue, ensure you have an ETH balance on one of the following networks:", - "or_alternatively_balance_on": "Or alternatively, a MATIC balance on Polygon or a BNB balance on BSC", + "or_alternatively_balance_on": "Or alternatively, a POL balance on Polygon or a BNB balance on BSC", "fund_my_wallet": "Fund My Wallet" }, "error": { diff --git a/static/json/languages/es_419.json b/static/json/languages/es_419.json index 9d5d480fcd..27155c11cd 100644 --- a/static/json/languages/es_419.json +++ b/static/json/languages/es_419.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Cuanto más uses Rainbow, más serás recompensado", "balance_required": "Saldo de billetera requerido", "ensure_you_have_a_balance_on": "Para continuar, asegúrate de tener saldo en ETH en una de las siguientes redes:", - "or_alternatively_balance_on": "O alternativamente, saldo en MATIC en Polygon o saldo en BNB en BSC", + "or_alternatively_balance_on": "O alternativamente, saldo en POL en Polygon o saldo en BNB en BSC", "fund_my_wallet": "Financiar Mi Billetera" }, "error": { diff --git a/static/json/languages/fr_FR.json b/static/json/languages/fr_FR.json index d335d7b2b6..1b3d705a77 100644 --- a/static/json/languages/fr_FR.json +++ b/static/json/languages/fr_FR.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Plus vous utilisez Rainbow, plus vous serez récompensé", "balance_required": "Solde du portefeuille requis", "ensure_you_have_a_balance_on": "Pour continuer, assurez-vous d'avoir un solde en ETH sur l'un des réseaux suivants :", - "or_alternatively_balance_on": "Ou alternativement, un solde en MATIC sur Polygon ou un solde en BNB sur BSC", + "or_alternatively_balance_on": "Ou alternativement, un solde en POL sur Polygon ou un solde en BNB sur BSC", "fund_my_wallet": "Financer mon portefeuille" }, "error": { diff --git a/static/json/languages/id_ID.json b/static/json/languages/id_ID.json index 30ceaaf8b0..ac0ea52e58 100644 --- a/static/json/languages/id_ID.json +++ b/static/json/languages/id_ID.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Semakin sering Anda menggunakan Rainbow, semakin banyak hadiah yang akan Anda dapatkan", "balance_required": "Saldo dompet diperlukan", "ensure_you_have_a_balance_on": "Untuk melanjutkan, pastikan Anda memiliki saldo ETH di salah satu jaringan berikut:", - "or_alternatively_balance_on": "Atau alternatifnya, saldo MATIC di Polygon atau saldo BNB di BSC", + "or_alternatively_balance_on": "Atau alternatifnya, saldo POL di Polygon atau saldo BNB di BSC", "fund_my_wallet": "Isi Saldo Dompet" }, "error": { diff --git a/static/json/languages/ja_JP.json b/static/json/languages/ja_JP.json index 9d13387e76..93214934a4 100644 --- a/static/json/languages/ja_JP.json +++ b/static/json/languages/ja_JP.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Rainbowを使えば使うほど報酬が増えます", "balance_required": "ウォレットの残高が必要です", "ensure_you_have_a_balance_on": "続行するには、以下のネットワークのいずれかにETH残高があることを確認してください:", - "or_alternatively_balance_on": "または、Polygon上のMATIC残高、またはBSC上のBNB残高がある場合", + "or_alternatively_balance_on": "または、Polygon上のPOL残高、またはBSC上のBNB残高がある場合", "fund_my_wallet": "マイウォレットに資金を入れる" }, "error": { diff --git a/static/json/languages/ko_KR.json b/static/json/languages/ko_KR.json index b40d03025c..93be951af9 100644 --- a/static/json/languages/ko_KR.json +++ b/static/json/languages/ko_KR.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Rainbow를 더 많이 사용할수록 더 많은 보상을 받게 됩니다", "balance_required": "지갑 잔액 필요", "ensure_you_have_a_balance_on": "계속하려면 다음 네트워크 중 하나에 ETH 잔액이 있는지 확인하세요:", - "or_alternatively_balance_on": "또는, Polygon에 MATIC 잔액 또는 BSC에 BNB 잔액", + "or_alternatively_balance_on": "또는, Polygon에 POL 잔액 또는 BSC에 BNB 잔액", "fund_my_wallet": "지갑에 자금 추가" }, "error": { diff --git a/static/json/languages/pt_BR.json b/static/json/languages/pt_BR.json index 0ef414fedf..33e18b726d 100644 --- a/static/json/languages/pt_BR.json +++ b/static/json/languages/pt_BR.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Quanto mais você usar o Rainbow, mais será recompensado", "balance_required": "Saldo da carteira necessário", "ensure_you_have_a_balance_on": "Para continuar, verifique se possui saldo em ETH em uma das seguintes redes:", - "or_alternatively_balance_on": "Ou alternativamente, saldo em MATIC na Polygon ou saldo em BNB na BSC", + "or_alternatively_balance_on": "Ou alternativamente, saldo em POL na Polygon ou saldo em BNB na BSC", "fund_my_wallet": "Financiar Minha Carteira" }, "error": { diff --git a/static/json/languages/ru_RU.json b/static/json/languages/ru_RU.json index 25301a4b4f..23d9ccba9a 100644 --- a/static/json/languages/ru_RU.json +++ b/static/json/languages/ru_RU.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Чем больше вы используете Rainbow, тем больше будет награда", "balance_required": "Требуется баланс кошелька", "ensure_you_have_a_balance_on": "Для продолжения убедитесь, что у вас есть баланс ETH на одной из следующих сетей:", - "or_alternatively_balance_on": "Или, альтернативно, баланс MATIC на Polygon или баланс BNB на BSC", + "or_alternatively_balance_on": "Или, альтернативно, баланс POL на Polygon или баланс BNB на BSC", "fund_my_wallet": "Пополнить мой кошелек" }, "error": { diff --git a/static/json/languages/th_TH.json b/static/json/languages/th_TH.json index e681596b37..5d707cdd5f 100644 --- a/static/json/languages/th_TH.json +++ b/static/json/languages/th_TH.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "ยิ่งใช้ Rainbow มากเท่าไหร่ ก็ยิ่งได้รับรางวัลมากขึ้น", "balance_required": "ต้องมียอดเงินในกระเป๋า", "ensure_you_have_a_balance_on": "เพื่อดำเนินการต่อ โปรดตรวจสอบว่าคุณมี ETH ในเครือข่ายต่อไปนี้:", - "or_alternatively_balance_on": "หรือมียอดเงิน MATIC บน Polygon หรือ BNB บน BSC", + "or_alternatively_balance_on": "หรือมียอดเงิน POL บน Polygon หรือ BNB บน BSC", "fund_my_wallet": "เติมเงินเข้ากระเป๋า" }, "error": { diff --git a/static/json/languages/tr_TR.json b/static/json/languages/tr_TR.json index 48d2ebb9d3..000672042e 100644 --- a/static/json/languages/tr_TR.json +++ b/static/json/languages/tr_TR.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "Rainbow’u ne kadar çok kullanırsanız, o kadar çok ödül kazanırsınız", "balance_required": "Cüzdan bakiyesi gerekiyor", "ensure_you_have_a_balance_on": "Devam etmek için, aşağıdaki ağlardan birinde ETH bakiyeniz olduğundan emin olun:", - "or_alternatively_balance_on": "Veya alternatif olarak, Polygon'da MATIC veya BSC'de BNB bakiyeniz olsun", + "or_alternatively_balance_on": "Veya alternatif olarak, Polygon'da POL veya BSC'de BNB bakiyeniz olsun", "fund_my_wallet": "Cüzdanımı Finanse Et" }, "error": { diff --git a/static/json/languages/zh_CN.json b/static/json/languages/zh_CN.json index 2b0a8eebdc..f3f0f72c11 100644 --- a/static/json/languages/zh_CN.json +++ b/static/json/languages/zh_CN.json @@ -1456,7 +1456,7 @@ "the_more_you_use": "越多使用Rainbow,越多奖励", "balance_required": "需要钱包余额", "ensure_you_have_a_balance_on": "继续操作前,请确保以下网络中有ETH余额:", - "or_alternatively_balance_on": "或者,Polygon上的MATIC余额或BSC上的BNB余额", + "or_alternatively_balance_on": "或者,Polygon上的POL余额或BSC上的BNB余额", "fund_my_wallet": "资金进入我的钱包" }, "error": { From f80d99947196ac51c604780f7a768969eaa0924f Mon Sep 17 00:00:00 2001 From: DanielSinclair Date: Fri, 13 Sep 2024 20:19:46 +0000 Subject: [PATCH 7/7] Version Bump (Internal) - v1.5.39 --- lavamoat/build-webpack/policy.json | 59 +++++++++++++++++------------- package.json | 2 +- static/manifest.json | 2 +- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/lavamoat/build-webpack/policy.json b/lavamoat/build-webpack/policy.json index e49f823566..19440ec708 100644 --- a/lavamoat/build-webpack/policy.json +++ b/lavamoat/build-webpack/policy.json @@ -614,10 +614,10 @@ "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": true, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-simple-access": true, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-split-export-declaration": true, - "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-validator-identifier": true, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/template": true, "jest>@jest/core>jest-snapshot>@babel/traverse": true, - "jest>@jest/core>jest-snapshot>@babel/types": true + "jest>@jest/core>jest-snapshot>@babel/types": true, + "jest>@jest/core>jest-snapshot>@babel/types>@babel/helper-validator-identifier": true } }, "eslint-config-rainbow>eslint-import-resolver-babel-module>@babel/core>@babel/helper-module-transforms>@babel/helper-module-imports": { @@ -1141,16 +1141,9 @@ "console.warn": true, "process.emitWarning": true }, - "packages": { - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>@babel/highlight": true, - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>chalk": true - } - }, - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>@babel/highlight": { "packages": { "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>chalk": true, - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/types>@babel/helper-validator-identifier": true, - "react>loose-envify>js-tokens": true + "lavamoat>@babel/highlight": true } }, "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/code-frame>chalk": { @@ -1191,13 +1184,8 @@ "define": true }, "packages": { - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true, - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": true - } - }, - "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/resolve-uri": { - "globals": { - "define": true + "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": true, + "webpack>terser-webpack-plugin>@jridgewell/trace-mapping>@jridgewell/resolve-uri": true } }, "jest>@jest/core>jest-snapshot>@babel/traverse>@babel/generator>@jridgewell/trace-mapping>@jridgewell/sourcemap-codec": { @@ -1229,6 +1217,34 @@ "lavamoat>lavamoat-core>@babel/types>to-fast-properties": true } }, + "lavamoat>@babel/highlight": { + "packages": { + "lavamoat>@babel/highlight>@babel/helper-validator-identifier": true, + "lavamoat>@babel/highlight>chalk": true, + "react>loose-envify>js-tokens": true + } + }, + "lavamoat>@babel/highlight>chalk": { + "globals": { + "process.env.TERM": true, + "process.platform": true + }, + "packages": { + "lavamoat>@babel/highlight>chalk>ansi-styles": true, + "lavamoat>@babel/highlight>chalk>escape-string-regexp": true, + "supports-color": true + } + }, + "lavamoat>@babel/highlight>chalk>ansi-styles": { + "packages": { + "lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": true + } + }, + "lavamoat>@babel/highlight>chalk>ansi-styles>color-convert": { + "packages": { + "lavamoat>@babel/highlight>chalk>ansi-styles>color-convert>color-name": true + } + }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name": { "packages": { "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template": true, @@ -1248,17 +1264,10 @@ "process.emitWarning": true }, "packages": { - "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>@babel/highlight": true, + "lavamoat>@babel/highlight": true, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": true } }, - "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>@babel/highlight": { - "packages": { - "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": true, - "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/types>@babel/helper-validator-identifier": true, - "react>loose-envify>js-tokens": true - } - }, "lavamoat>lavamoat-tofu>@babel/traverse>@babel/helper-function-name>@babel/template>@babel/code-frame>chalk": { "globals": { "process.env.TERM": true, diff --git a/package.json b/package.json index 46b02f3d20..4d661c3b68 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "browser-extension", "license": "GPL-3.0-only", - "version": "1.5.38", + "version": "1.5.39", "scripts": { "//enable dev mode": "", "devmode:on": "sed -i'' -e 's/IS_DEV.*/IS_DEV=true/g' .env", diff --git a/static/manifest.json b/static/manifest.json index 8197aab686..2f70ebab77 100644 --- a/static/manifest.json +++ b/static/manifest.json @@ -68,7 +68,7 @@ "notifications" ], "short_name": "Rainbow", - "version": "1.5.38", + "version": "1.5.39", "web_accessible_resources": [ { "matches": [