-
Notifications
You must be signed in to change notification settings - Fork 36
[FEATURE] Adds support for icons from token lists #1954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Redesign Account History (#1785) * Remove leftovers * Move stellarExpertUrl to inside HistoryItem * Display amounts using Badge component * Date font size and color # Conflicts: # extension/src/popup/components/accountHistory/HistoryItem/styles.scss * Make formatted amount label consistent between History item and Tx detail components * Fix isRecieving => isReceiving typo * Redesign "payment" row * Redesign "swap" payment * Use SVG for history icons * Swapped label * Use SDS Icon components * format * Remove history segments * Use Text SDS component + refactor some styling * Renaming * Swap icons with placeholders * center swap icons * Icons for soroban operations * Remove a few spaces to keep consistency * Don't show small icon for generic transactions * Handle CreateAccount and ChangeTrust operations # Conflicts: # extension/src/popup/components/accountHistory/HistoryItem/index.tsx * Separate history in month sections + use SDS Text component to render headers * clean up * Displays actual month name * getHistoryState => historyState renaming * Delete HistoryList component Is not adding much value currently * Use AppHeader component * Tweak section margin * tweak bottom margin * Use index to get last section instead of mutating the array * Use more descriptive names to color classes * Remove Account ternaries * Leave amount field blank instead of displaying "N/A" label * Use "tertiary" variant for Send and Swap buttons # Conflicts: # extension/src/popup/components/account/AssetDetail/index.tsx * Reduce Badge max width * Add translations * Fix test id * Add key to list item * Drop ticker on balances view * Fix tests * Prevent null pointer when attrs is null * Fix icon for mint and transfer invocations * Fix "false" appearing as amount sign * Fix tests * Extract isDustPayment to a helper * Display stellar logo for XLM transfer invocations * Use pxToRem * Use pxToRem * Use pxToRem * adds background settings key and methods for hidden assets, adds extension settings duck state * adds ducks for gettung hidden assets, adds button to navigate to hidden assets * adds asset visibility toggle in asset rows * adds isAssetVisible helper, tweaks background handling of hidden assets * updates toggle asset classes * refactor getAccountBalances to allow filtering of hidden assets * wip: reset account balance after managing assets * adds test for hiding a token * adds useFetchDomains helper * mocks getHiddenAssets in existing tests * switches to composite key for asset key in hidden asset map * updates e2e tests for new Manage Assets header * uses pxToRem helper in place of raw rem values, tweaks hidden assets storage key name * [REFACTOR] Account balances data workflow (#1872) * abstracts request hook internals into common helpers and constants, adds useGetBalances * removes balances from transactionSubmission store * adds page data hook, useGetAccountData, refactors account view to use data hook * refactors useFetchDomains to use reducer data hook pattern * adds useGetSignTxData data hook and uses it in SignTx * WIP: moves remaining views to new balance hooks, adds data hooks for views with mixed data needs * adds get settings data hook, refactors to use data hook * adds get tx details data hook, refactors to use data hook * adds send amount data hook, refactors to use data hook. Moves icon fetching to top level in dom tree for send workflow * removes remaining balances references from store, adds balances from parents and hooks * address lint warnings * update useGetAccountData to sort operations by asset * removes forgotten debugging filter for claimable balances * adds missing loading state for swap, steps around missing dest address for swap settings send to * refactors SendTo data flow to include debouncing * tweaks handling of tx fee in settings flow * fixes asset token type in tx detail * updates AssetType to use SorobanBalance * cast types temporarily to help new type propagation differences * adds back submission resets at asset selection, sets empty dest asset on send navigation * uses correct header on send workflow choose asset step * adds isGetBalancesError to narrow response types, uses it in consuming hooks * fixes balance finding for classic assets in send flow * refactors send to work with SAC sends and C address destinations * refactors send to work with SAC sends and G addresses * adds destination balance to useGetTxDetailsData, cleans up TxDetails using asset helpers * refactors send amount hook to use new balances interface * refactors and organizes balance types * fixes remaining references that assume balance keys that are present on all balance types * moves findAssetBalance helper to fix ciruclar dependency * fixes asset type in AssetNetworkInfo * reload balances after funding with friendbot * refactor balance hooks to account for missing destination address during swaps, tweak balance helper * restores Swap unit tests * restores Account unit tests * restores remaining unit tests * restores e2e tests * reset submission after submitting result, add new test token contract ID * moves AccountBalanceInterface and related types to backend api types * restores add asset e2e test * moves balance hook helpers to balance helper file, cleans up response type for get history hook, cleans up error handling in standalone data hooks * adds downstream handling of undefined asset from findAssetBalance * combine isError helper for all requests, update downstream consumption * use fallback value for missing icons due to invalid tomls * use include hidden true for asset visibility domains * renames file and hook for getAssetDomains, moves xlmToStroop helper * release/5.27.2 (#1827) (#1828) * Feature/memory security improvement 5.27.2 (#1827) * add temporary store extra data * add tests for switching accounts * reset session length * upgrade jest and add unit tests * rm unused selectors * fix sendpayment test * rm npm package and add unit tests * add better error handling and Sentry capture * rm console.log * make sure to login before adding new stellar address * add a test for imported S key payment * Fix/import acct when timed out (#1832) * make sure to login to all accounts before importing by private key if session has timed out * update comment * login before showing mnemonic phrase (#1834) * login before showing mnemonic phrase * add more Sentry error capture * bump versions to 5.27.2 (#1837) * Release 5.28.0 (#1798) * Redesign Account History (#1785) * Remove leftovers * Move stellarExpertUrl to inside HistoryItem * Display amounts using Badge component * Date font size and color * Make formatted amount label consistent between History item and Tx detail components * Fix isRecieving => isReceiving typo * Redesign "payment" row * Redesign "swap" payment * Use SVG for history icons * Swapped label * Use SDS Icon components * format * Remove history segments * Use Text SDS component + refactor some styling * Renaming * Swap icons with placeholders * center swap icons * Icons for soroban operations * Remove a few spaces to keep consistency * Don't show small icon for generic transactions * Handle CreateAccount and ChangeTrust operations * Separate history in month sections + use SDS Text component to render headers * clean up * Displays actual month name * getHistoryState => historyState renaming * Delete HistoryList component Is not adding much value currently * Use AppHeader component * Tweak section margin * tweak bottom margin * Use index to get last section instead of mutating the array * Use more descriptive names to color classes * Remove Account ternaries * Leave amount field blank instead of displaying "N/A" label * Use "tertiary" variant for Send and Swap buttons * Reduce Badge max width * Add translations * Fix test id * Add key to list item * Drop ticker on balances view * Fix tests * Prevent null pointer when attrs is null * Fix icon for mint and transfer invocations * Fix "false" appearing as amount sign * Fix tests * Extract isDustPayment to a helper * Display stellar logo for XLM transfer invocations * Use pxToRem * Use pxToRem * Use pxToRem * adding blockaid byline and feedback form (#1767) * Bump @stellar/design-system in /extension (#1729) Bumps [@stellar/design-system](https://github.com/stellar/stellar-design-system) from 2.0.0-beta.15 to 2.0.0-beta.17. - [Release notes](https://github.com/stellar/stellar-design-system/releases) - [Commits](https://github.com/stellar/stellar-design-system/commits) --- updated-dependencies: - dependency-name: "@stellar/design-system" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * adding blockaid byline and feedback form * fix tests * Added translations --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * “Add Token” via freighter-api (#1815) * First cut on data flow * Fix lint warnings * Clean up * Only enable button if asset found * If there is an asset, display it right away * Add missing network param * Guard against missing contract id * Make sure popup is always closed * Use publicKeySelector instead * No need for backwards compatibility on new method * Default to tx's network passphrase * Return contractId on success * Default to Mainnet passphrase * Add tests * Use Type definition for input and output * Disable rule only on necessary spots * Let optional params be optional * First cut on UI * only display info when it exists * Display token image when available * Display "Asset on your lists" notification * Fetch asset name from TOML * Prevent infinity spinner * Fetch and display balance * Display error if id not valid * Add/update docs * Missing addToken documentation * Missing getNetworkDetails documentation * "Simulated Balance Changes" => "Balance Info" * Fetch token balance using freighter-backend instead of soroban rpc * Fix/replace alert (#1847) * reusing an existing notification style to redesign the blockaid Alert notification * make sure warnings match case and fix row gap * update testid --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump versions to 5.28.0 (#1862) * docs(): bumping release to 5.28.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * Bump @stellar/freighter-api version to (#1864) * @stellar/freighter-api: bumping version to 3.1.0 * [create-pull-request] automated change * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: aristidesstaffieri <6886006+aristidesstaffieri@users.noreply.github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * upgrades node to version 22 in all actions (#1870) * Release 5.28.1 (#1868) * [CHORE] Core dependency upgrade (#1865) * Bump the major group across 5 directories with 83 updates --- updated-dependencies: - dependency-name: "@testing-library/dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/testing-library__jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@typescript-eslint/parser" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-config-prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-import-resolver-typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-plugin-flowtype dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-plugin-react-hooks dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: glob dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: got dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: husky dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: isomorphic-unfetch dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jest dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/jest" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jsdom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: lint-staged dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: pretty-quick dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: webpack-cli dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: webpack-merge dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/preinstall-always-fail" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: clsx dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-is dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: styled-components dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@reduxjs/toolkit" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/user-event" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/jsdom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-copy-to-clipboard" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/testing-library__jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: concurrently dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: history dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/history" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next-browser-languagedetector dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jest-environment-jsdom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: qrcode.react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: sass-loader dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: ses dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@sentry/webpack-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/prettier-config" dependency-type: direct:development dependency-group: major - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/js-xdr" dependency-type: direct:production dependency-group: major - dependency-name: bignumber.js dependency-type: direct:production dependency-group: major - dependency-name: "@stellar/prettier-config" dependency-type: direct:development dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: bignumber.js dependency-type: direct:production dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: pretty-quick dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@lavamoat/allow-scripts" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: bignumber.js dependency-type: direct:production dependency-group: major - dependency-name: react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@ledgerhq/hw-app-str" dependency-type: direct:production dependency-group: major - dependency-name: "@ledgerhq/hw-transport-webusb" dependency-type: direct:production dependency-group: major - dependency-name: "@reduxjs/toolkit" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@sentry/browser" dependency-type: direct:production dependency-group: major - dependency-name: "@stellar/typescript-wallet-sdk-km" dependency-type: direct:production dependency-group: major - dependency-name: "@testing-library/react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@testing-library/user-event" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/history" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/jsdom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/lodash" dependency-type: direct:production dependency-group: major - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/qrcode.react" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-copy-to-clipboard" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/react-redux" dependency-type: direct:production dependency-group: major - dependency-name: "@types/react-router-dom" dependency-type: direct:production dependency-group: major - dependency-name: "@types/testing-library__jest-dom" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: concurrently dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: dotenv-webpack dependency-type: direct:production dependency-group: major - dependency-name: formik dependency-type: direct:production dependency-group: major - dependency-name: history dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: html-loader dependency-type: direct:production dependency-group: major - dependency-name: html-webpack-plugin dependency-type: direct:production dependency-group: major - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next-browser-languagedetector dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next-resources-to-backend dependency-type: direct:production dependency-group: major - dependency-name: jest-canvas-mock dependency-type: direct:production dependency-group: major - dependency-name: jest-environment-jsdom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: jsonschema dependency-type: direct:production dependency-group: major - dependency-name: lodash dependency-type: direct:production dependency-group: major - dependency-name: mini-css-extract-plugin dependency-type: direct:production dependency-group: major - dependency-name: prop-types dependency-type: direct:production dependency-group: major - dependency-name: punycode dependency-type: direct:production dependency-group: major - dependency-name: qrcode.react dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-copy-to-clipboard dependency-type: direct:production dependency-group: major - dependency-name: react-i18next dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: react-router-dom dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: redux dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: sass dependency-type: direct:production dependency-group: major - dependency-name: sass-loader dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: semver dependency-type: direct:production dependency-group: major - dependency-name: ses dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: tsconfig-paths-webpack-plugin dependency-type: direct:production dependency-group: major - dependency-name: yup dependency-type: direct:production dependency-group: major - dependency-name: "@sentry/webpack-plugin" dependency-type: direct:development update-type: version-update:semver-major dependency-group: major - dependency-name: "@types/semver" dependency-type: direct:development dependency-group: major - dependency-name: terser-webpack-plugin dependency-type: direct:development dependency-group: major - dependency-name: thread-loader dependency-type: direct:development dependency-group: major ... Signed-off-by: dependabot[bot] <support@github.com> * upgrades all syntax for breaking changes * updates test harness and syntax for new major versions, updates Router patterns to work in v7 * migrate navigateTo to use v7 API, fix tests for send payment * updates account tests for new router model * updates account creator tests for new router model * updates account history tests for new router model * updates grant access tests for new router model * updates manage assets tests for new router model * updates mnemonic phrase tests for new router model * updates review auth tests for new router model * updates send token payment tests for new router model * updates sign tx tests for new router model * updates swap tests for new router model * updates swap unfunded tests for new router model * updates operation keyval tests for new router model * catches up e2e tests to upstream changes * bumps node version in CI to 22 * cleans up imports in ManageAssets test, adds jest dom types to API ts config * temporarily dont fail on eslint failure * fixes routing logic for nested routes * disable eslint - temporary * fixes nested routing path handling for router v7, disables tests that rely on nested routing * updates test ID reference in e2e payment tests * bumps docs node engine to >=22 * trigger build to retry docs preview * bumps node version in npm rc for docs * restores swap index route * properly handle second level nested routed for settings * adds getPathFromRoute to clean up sub routing changes * upgrades all actions to use node version 22 * removes stray comment from refactor * redo eslint, prettier, ts configs to be compatible with new major versions * release/5.27.2 (#1827) (#1828) * Feature/memory security improvement 5.27.2 (#1827) * add temporary store extra data * add tests for switching accounts * reset session length * upgrade jest and add unit tests * rm unused selectors * fix sendpayment test * rm npm package and add unit tests * add better error handling and Sentry capture * rm console.log * make sure to login before adding new stellar address * add a test for imported S key payment * Fix/import acct when timed out (#1832) * make sure to login to all accounts before importing by private key if session has timed out * update comment * login before showing mnemonic phrase (#1834) * login before showing mnemonic phrase * add more Sentry error capture * bump versions to 5.27.2 (#1837) * Release 5.28.0 (#1798) * Redesign Account History (#1785) * Remove leftovers * Move stellarExpertUrl to inside HistoryItem * Display amounts using Badge component * Date font size and color * Make formatted amount label consistent between History item and Tx detail components * Fix isRecieving => isReceiving typo * Redesign "payment" row * Redesign "swap" payment * Use SVG for history icons * Swapped label * Use SDS Icon components * format * Remove history segments * Use Text SDS component + refactor some styling * Renaming * Swap icons with placeholders * center swap icons * Icons for soroban operations * Remove a few spaces to keep consistency * Don't show small icon for generic transactions * Handle CreateAccount and ChangeTrust operations * Separate history in month sections + use SDS Text component to render headers * clean up * Displays actual month name * getHistoryState => historyState renaming * Delete HistoryList component Is not adding much value currently * Use AppHeader component * Tweak section margin * tweak bottom margin * Use index to get last section instead of mutating the array * Use more descriptive names to color classes * Remove Account ternaries * Leave amount field blank instead of displaying "N/A" label * Use "tertiary" variant for Send and Swap buttons * Reduce Badge max width * Add translations * Fix test id * Add key to list item * Drop ticker on balances view * Fix tests * Prevent null pointer when attrs is null * Fix icon for mint and transfer invocations * Fix "false" appearing as amount sign * Fix tests * Extract isDustPayment to a helper * Display stellar logo for XLM transfer invocations * Use pxToRem * Use pxToRem * Use pxToRem * adding blockaid byline and feedback form (#1767) * Bump @stellar/design-system in /extension (#1729) Bumps [@stellar/design-system](https://github.com/stellar/stellar-design-system) from 2.0.0-beta.15 to 2.0.0-beta.17. - [Release notes](https://github.com/stellar/stellar-design-system/releases) - [Commits](https://github.com/stellar/stellar-design-system/commits) --- updated-dependencies: - dependency-name: "@stellar/design-system" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * adding blockaid byline and feedback form * fix tests * Added translations --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * “Add Token” via freighter-api (#1815) * First cut on data flow * Fix lint warnings * Clean up * Only enable button if asset found * If there is an asset, display it right away * Add missing network param * Guard against missing contract id * Make sure popup is always closed * Use publicKeySelector instead * No need for backwards compatibility on new method * Default to tx's network passphrase * Return contractId on success * Default to Mainnet passphrase * Add tests * Use Type definition for input and output * Disable rule only on necessary spots * Let optional params be optional * First cut on UI * only display info when it exists * Display token image when available * Display "Asset on your lists" notification * Fetch asset name from TOML * Prevent infinity spinner * Fetch and display balance * Display error if id not valid * Add/update docs * Missing addToken documentation * Missing getNetworkDetails documentation * "Simulated Balance Changes" => "Balance Info" * Fetch token balance using freighter-backend instead of soroban rpc * Fix/replace alert (#1847) * reusing an existing notification style to redesign the blockaid Alert notification * make sure warnings match case and fix row gap * update testid --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump versions to 5.28.0 (#1862) * docs(): bumping release to 5.28.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * Bump @stellar/freighter-api version to (#1864) * @stellar/freighter-api: bumping version to 3.1.0 * [create-pull-request] automated change * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: aristidesstaffieri <6886006+aristidesstaffieri@users.noreply.github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: aristidesstaffieri <6886006+aristidesstaffieri@users.noreply.github.com> * fixes typo in asset list sub route (#1873) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: aristidesstaffieri <6886006+aristidesstaffieri@users.noreply.github.com> * Bump versions to 5.28.1 (#1874) * docs(): bumping release to 5.28.1 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * catches up changelog to current release (#1876) * Bump @stellar/freighter-api version to (#1894) * @stellar/freighter-api: bumping version to 4.1.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * Release 5.29.0 (#1887) * [FEATURE] Split assets by verification status (#1839) * adds types for asset list schema, adds splitVerifiedAssetCurrency helper * wip - splits assets by verified status, wip on restoring the chunked blockaid check approach * adds getAssetListForAsset and getAssetLists * split blockaid scan in search asset into verified and unverified processing * extract AssetRows to handle non verificatiomn enabled lists, clean up list title styles * fixes hasAsset sentinel to use correct logic, accounts for empty verification lists * update manage asset tests to match new workflows including verification * tweaks e2e add asset tests for new structure * removes unnecessary assertion * remove leftover only call in test for debugging * adds isSacContract helper, uses it to determine the title for asset rows * Update extension/src/popup/helpers/assetList.ts Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * Update extension/src/popup/helpers/assetList.ts Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * Update extension/src/popup/helpers/assetList.ts Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * refactors split asset bulk scan incremental workflow to not overflow list and to not cause extra re-renders * uses better var names for list verification list splits, adds tranlations for new tooltips * Added translations --------- Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * Update metrics.ts (#1813) Better Handling of metrics: If JSON.parse fails (due to invalid JSON), the catch block ensures that the app won’t crash and instead falls back to defaults. If localStorage.getItem returns null, we also handle that by falling back to defaults. We are also explicitly define default values for each property of MetricsData. This ensures the rest of the code can safely use metricsData without checking for undefined. Even if METRICS_DATA is missing, corrupted, or incomplete, metricsData will always have a valid structure matching the MetricsData type. * Feature/account mismatch 3 (#1892) * replace localStoreFacade with including activePublicKey on every background request * PR comments * add API signing tests * use array index based identification in mnemonic phrase (#1883) * [FIX] Add Asset Warnings (#1889) * fixes alignment on add asset warning, labels warning by issuer * updats chromium darwin snapshots for add asset tests * tweaks copy to align adding assets internally and externally * updates tests for TokenWarning to test trustline label * updates snapshots for copy tweak on asset modal * fixes bad enum member for metrics fallback block * updates notificaton modal to match latest mocks * removes unused comments and adds translation calls for new notification text * Added translations * fix signed msg api e2e test (#1903) * fix signed msg api e2e test * align copy tweaks to latest changes in warning messages * adds updated snapshots for copy tweaks --------- Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * Bump the all-actions group across 1 directory with 2 updates (#1900) * Bump @stellar/freighter-api version to (#1894) * @stellar/freighter-api: bumping version to 4.1.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * Bump the all-actions group across 1 directory with 2 updates Bumps the all-actions group with 2 updates in the / directory: [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) and [ruby/setup-ruby](https://github.com/ruby/setup-ruby). Updates `peter-evans/create-pull-request` from 7.0.5 to 7.0.8 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/5e914681df9dc83aa4e4905692ca88beb2f9e91f...271a8d0340265f705b14b6d32b9829c1cb33d45e) Updates `ruby/setup-ruby` from 1.204.0 to 1.222.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/v1.204.0...v1.222.0) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions - dependency-name: ruby/setup-ruby dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions ... Signed-off-by: dependabot[bot] <support@github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * rm stellar-identicon-js dependency (#1904) * [FEATURE] masks asset icons to make all assets uniform and circular (#1902) * Bump @stellar/freighter-api version to (#1894) * @stellar/freighter-api: bumping version to 4.1.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * masks asset icons to make all assets uniform and circular --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> * [FIX] Hardens validation for custom slippage input (#1901) * Bump @stellar/freighter-api version to (#1894) * @stellar/freighter-api: bumping version to 4.1.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * hardens validation on input for custom slippage, adds tests for valid inputs --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> * Bump the major group across 4 directories with 25 updates (#1899) * Bump @stellar/freighter-api version to (#1894) * @stellar/freighter-api: bumping version to 4.1.0 * trigger CI --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * Bump the major group across 4 directories with 25 updates --- updated-dependencies: - dependency-name: babel-loader dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: eslint-webpack-plugin dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: globals dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@sentry/browser" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/design-system" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: copy-webpack-plugin dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: prettier dependency-type: direct:production dependency-group: major - dependency-name: typescript dependency-type: direct:production update-type: version-update:semver-minor dependency-group: major - dependency-name: semver dependency-type: direct:production dependency-group: major - dependency-name: "@types/react" dependency-type: direct:production dependency-group: major - dependency-name: "@types/react-dom" dependency-type: direct:production dependency-group: major - dependency-name: prettier dependency-type: direct:production dependency-group: major - dependency-name: pretty-quick dependency-type: direct:production dependency-group: major - dependency-name: "@sentry/browser" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/design-system" dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: "@stellar/typescript-wallet-sdk-km" dependency-type: direct:production dependency-group: major - dependency-name: "@testing-library/user-event" dependency-type: direct:production dependency-group: major - dependency-name: "@types/lodash" dependency-type: direct:production dependency-group: major - dependency-name: "@types/node" dependency-type: direct:production dependency-group: major - dependency-name: copy-webpack-plugin dependency-type: direct:production update-type: version-update:semver-major dependency-group: major - dependency-name: i18next dependency-type: direct:production dependency-group: major - dependency-name: i18next-browser-languagedetector dependency-type: direct:production dependency-group: major - dependency-name: react-i18next dependency-type: direct:production dependency-group: major - dependency-name: react-router-dom dependency-type: direct:production dependency-group: major - dependency-name: sass dependency-type: direct:production dependency-group: major - dependency-name: sass-loader dependency-type: direct:production dependency-group: major - dependency-name: semver dependency-type: direct:production dependency-group: major - dependency-name: ses dependency-type: direct:production dependency-group: major - dependency-name: "@sentry/webpack-plugin" dependency-type: direct:development dependency-group: major - dependency-name: terser-webpack-plugin dependency-type: direct:development dependency-group: major ... Signed-off-by: dependabot[bot] <support@github.com> * make buffer type happy about memo possible types * cast memo value as string --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * masks asset images in asset detail view (#1915) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Bruno-Osec <127886595+Bruno-Osec@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> * pin @types/react to stable version (#1922) * pin @types/react to stable version * update test token C address and skip tests pertaining to USDC * Added translations * fix flakey grantAccess test * Bump versions to 5.29.0 (#1924) * [CHANGELOG] Release notes - Wallets - FE-Freighter-5.29.0 (#1925) * Release 5.30.0 (#1928) * [FEATURE] USD Balances and 24 hour price deltas (#1912) * adds new internal API for token-prices * refactors account view to show usd values * tweaks live prices styles, adds total USD balance * update for API changes on live prices, adds fallback markup for missing deltas and unsupported networks * adds polling for live price updates, adds motion for live price state transitions * tweaks max width for total balance * set prices interval to 1 minute to align with update interval * adds color transitions for moving direction, lowers polling time to 30s * reset store status for balances and token prices when switching networks * adds shouldFetchTokenPrices option to account balances action, removes token price status * removes initial animation in animation number, tightens up rounding and color display of delta values * adds tests for token prices display on account * tweak tests IDs to restore test assertions * renames internal method for getting token prices * renames internal method for getting token prices in internal API * cleans up empty state, cleans up import orders, and extracts duration constant * wraps token prices in account balances flow with local error handler * adds timeout around token prices routine in getBalances in order to resolve at 3s if token prices takes longer * fixes linter warnings and reinstalls dropped dep framer motion * adds test tweaks and removes dot only call for token tests * removes stray debug log * adds -- indicator for any assets that do not have a price * [FIX] Don't use custom tokens for token prices (#1929) * removes extra space in front of asset usd balance, excludes custom tokens from getTokenPrices, adds composite response for tokenPriceErrors in getAccountBalances * updates token price tests for UI tweak * pins prettier to exact version, runs prettier on entire extension dir * updates mock for helper moved to shared helpers * [FIX] Remove price/delta value transition (#1934) * removes price transition, removes AnimatedNumber component, changes negative delta values to grey * removes framer-motion * temporarily removes getRpcHealth check in message listener (#1935) * bumps version to 5.30.0 (#1944) * Redesign Account History (#1785) * Remove leftovers * Move stellarExpertUrl to inside HistoryItem * Display amounts using Badge component * Date font size and color * Make formatted amount label consistent between History item and Tx detail components * Fix isRecieving => isReceiving typo * Redesign "payment" row * Redesign "swap" payment * Use SVG for history icons * Swapped label * Use SDS Icon components * format * Remove history segments * Use Text SDS component + refactor some styling * Renaming * Swap icons with placeholders * center swap icons * Icons for soroban operations * Remove a few spaces to keep consistency * Don't show small icon for generic transactions * Handle CreateAccount and ChangeTrust operations * Separate history in month sections + use SDS Text component to render headers * clean up * Displays actual month name * getHistoryState => historyState renaming * Delete HistoryList component Is not adding much value currently * Use AppHeader component * Tweak section margin * tweak bottom margin * Use index to get last section instead of mutating the array * Use more descriptive names to color classes * Remove Account ternaries * Leave amount field blank instead of displaying "N/A" label * Use "tertiary" variant for Send and Swap buttons * Reduce Badge max width * Add translations * Fix test id * Add key to list item * Drop ticker on balances view * Fix tests * Prevent null pointer when attrs is null * Fix icon for mint and transfer invocations * Fix "false" appearing as amount sign * Fix tests * Extract isDustPayment to a helper * Display stellar logo for XLM transfer invocations * Use pxToRem * Use pxToRem * Use pxToRem * adds background settings key and methods for hidden assets, adds extension settings duck state * adds asset visibility toggle in asset rows * refactor getAccountBalances to allow filtering of hidden assets * adds test for hiding a token * adds useFetchDomains helper * switches to composite key for asset key in hidden asset map * updates e2e tests for new Manage Assets header * uses pxToRem helper in place of raw rem values, tweaks hidden assets storage key name * [REFACTOR] Account balances data workflow (#1872) * abstracts request hook internals into common helpers and constants, adds useGetBalances * removes balances from transactionSubmission store * adds page data hook, useGetAccountData, refactors account view to use data hook * refactors useFetchDomains to use reducer data hook pattern * adds useGetSignTxData data hook and uses it in SignTx * WIP: moves remaining views to new balance hooks, adds data hooks for views with mixed data needs * adds get settings data hook, refactors to use data hook * adds get tx details data hook, refactors to use data hook * adds send amount data hook, refactors to use data hook. Moves icon fetching to top level in dom tree for send workflow * removes remaining balances references from store, adds balances from parents and hooks * address lint warnings * update useGetAccountData to sort operations by asset * removes forgotten debugging filter for claimable balances * adds missing loading state for swap, steps around missing dest address for swap settings send to * refactors SendTo data flow to include debouncing * tweaks handling of tx fee in settings flow * fixes asset token type in tx detail * updates AssetType to use SorobanBalance * cast types temporarily to help new type propagation differences * adds back submission resets at asset selection, sets empty dest asset on send navigation * uses correct header on send workflow choose asset step * adds isGetBalancesError to narrow response types, uses it in consuming hooks * fixes balance finding for classic assets in send flow * refactors send to work with SAC sends and C address destinations * refactors send to work with SAC sends and G addresses * adds destination balance to useGetTxDetailsData, cleans up TxDetails using asset helpers * refactors send amount hook to use new balances interface * refactors and organizes balance types * fixes remaining references that assume balance keys that are present on all balance types * moves findAssetBalance helper to fix ciruclar dependency * fixes asset type in AssetNetworkInfo * reload balances after funding with friendbot * refactor balance hooks to account for missing destination address during swaps, tweak balance helper * restores Swap unit tests * restores Account unit tests * restores remaining unit tests * restores e2e tests * reset submission after submitting result, add new test token contract ID * moves AccountBalanceInterface and related types to backend api types * restores add asset e2e test * moves balance hook helpers to balance helper file, cleans up response type for get history hook, cleans up error handling in standalone data hooks * adds downstream handling of undefined asset from findAssetBalance * combine isError helper for all requests, update downstream consumption * use fallback value for missing icons due to invalid tomls * use include hidden true for asset visibility domains * renames file and hook for getAssetDomains, moves xlmToStroop helper * catches up to master, reimplements token prices in the data hook * cleans up imports and naming from upstream rebase * uses internal api for get asset and set visibility from hook * restores send payment tests, tweaks asset visibility header * removes AccountAsset from transaction details * tweaks css for generic modal warning --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Piyal Basu <pbasu235@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: aristidesstaffieri <6886006+aristidesstaffieri@users.noreply.github.com> Co-authored-by: Bruno-Osec <127886595+Bruno-Osec@users.noreply.github.com>
* [FEATURE] Split assets by verification status (#1839) * adds types for asset list schema, adds splitVerifiedAssetCurrency helper * wip - splits assets by verified status, wip on restoring the chunked blockaid check approach * adds getAssetListForAsset and getAssetLists * split blockaid scan in search asset into verified and unverified processing * extract AssetRows to handle non verificatiomn enabled lists, clean up list title styles * fixes hasAsset sentinel to use correct logic, accounts for empty verification lists * update manage asset tests to match new workflows including verification * tweaks e2e add asset tests for new structure * removes unnecessary assertion * remove leftover only call in test for debugging * adds isSacContract helper, uses it to determine the title for asset rows * Update extension/src/popup/helpers/assetList.ts Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * Update extension/src/popup/helpers/assetList.ts Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * Update extension/src/popup/helpers/assetList.ts Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * refactors split asset bulk scan incremental workflow to not overflow list and to not cause extra re-renders * uses better var names for list verification list splits, adds tranlations for new tooltips * Added translations --------- Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> * Update metrics.ts (#1813) Better Handling of metrics: If JSON.parse fails (due to invalid JSON), the catch block ensures that the app won’t crash and instead falls back to defaults. If localStorage.getItem returns null, we also handle that by falling back to defaults. We are also explicitly define default values for each property of MetricsData. This ensures the rest of the code can safely use metricsData without checking for undefined. Even if METRICS_DATA is missing, corrupted, or incomplete, metricsData will always have a valid structure matching the MetricsData type. * Feature/account mismatch 3 (#1892) * replace localStoreFacade with including activePublicKey on every background request * PR comments * add API signing tests * [FIX] Add Asset Warnings (#1889) * fixes alignment on add asset warning, labels warning by issuer * updats chromium darwin snapshots for add asset tests * tweaks copy to align adding assets internally and externally * updates tests for TokenWarning to test trustline label * updates snapshots for copy tweak on asset modal * fixes bad enum member for metrics fallback block * updates notificaton modal to match latest mocks * removes unused comments and adds translation calls for new notification text * Added translations * fix signed msg api e2e test (#1903) * fix signed msg api e2e test * align copy tweaks to latest changes in warning messages * adds updated snapshots for copy tweaks --------- Co-authored-by: Aristides Staffieri <aristides.staffieri@stellar.org> * first pass at copy/paste UX * rm copy button and clear clipboard * clear the clipboard after successful paste * update tests --------- Co-authored-by: aristides <aristides.staffieri@stellar.org> Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com> Co-authored-by: Bruno-Osec <127886595+Bruno-Osec@users.noreply.github.com>
* improve experience for users overwriting their accounts from the unlock password screen * update tests to make sure logging in still works with new accounts * update alert messaging * Added translations * update tests
* separate connected apps by network and public key * rm unused eslint override * run prettier
* refactors the send flow to not use intermediary routes * move previous route based metrics to step selections, add choose asset step for swap * combines ChooseAssets, tweaks ChooseAssets to work in all flows * fixes container styles for verify account on full screen * removes debug logs and comments, tweaks send tests to use base route * updates send settings snapshot for button focus
* add UI that links out to Coinbase onramp * add translations * genericize data fetch hook and implement loading state for Coinbase JWT fetch * fix broken test * ensure BUY buttons shows on XLM asset detail page * only show BUY button on Mainnet * Feature/coinbase onramp usdc (#1884) * Adding a buy screen where a user can buy usdc * remove generic buy page and open Coinbase when clicking `Buy with Coinbase` * add translations * restore a default page for both xlm purchases and generic purchases (#1920) * restore a default page for both xlm purchases and generic purchases * fix CI tests * fix tests and add metrics
* if domain not allowed, completely block instead of warn * Added translations * update tests * rm test freighter-api tar * rm unnecessary eslint disable * fix unit tests
…get icon from token lists
…move json validation
for (const r of promiseRes) { | ||
if (r.status === "fulfilled") { | ||
// confirm that this list still adheres to the agreed upon schema | ||
const validatedList = await schemaValidatedAssetList(r.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed the schema validation because both Soroswap and Lobstr have lists that we want to use but due to slight differences they don't align with the spec. We need Soroswap's list in order for this feature to work and the schema differences are small(bad version schema and use mainnet instead of pubnet).
These differences are inconsequential to the way we use them and our use of the lists checks for string equality on specific fields, so it should be fine to not validate the lists since these equality checks will fail if the fields are not present resulting in the same behavior as an earlier failure due to schema validation.
I can work with those teams to update their lists to match validation separately.
@@ -254,3 +254,24 @@ export const mockAccountHistory = [ | |||
type_i: 1, | |||
}, | |||
]; | |||
|
|||
export const validAssetList = { | |||
name: "PiyalBasu Top 50", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good list name 💯
extension/src/popup/helpers/__tests__/getIconFromTokenLists.test.js
Outdated
Show resolved
Hide resolved
…st.js Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com>
Co-authored-by: Cássio Marcos Goulart <3228151+CassioMG@users.noreply.github.com>
|
||
export const getIconFromTokenLists = async ({ | ||
networkDetails, | ||
id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: should we have separate contractId
and issuerKey
params and let the function return whatever it finds giving priority to contractId? So we don't need to call it twice and await twice like it's happening here.
Then this getIconFromTokenLists
function could return something like { icon, canonicalAsset }
so we could use canonicalAsset
as the icon key for assetIcons
.
I think having contractId
and issuerKey
params would also make the function declaration a bit easier to understand since we'd be removing the ambiguity.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it to use your suggested pattern, I also pass in the code from the caller because its safer to take the code from the extension to make the canonical vs assuming the code from the token list will match. Wdyt?
e16ae43
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update, looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Left a suggestion regarding the function inputs and response
Thanks for moving/extracting stuff to @shared/api so it'll be easier to reuse on the mobile wallet! 👊
…check for both internally
Closes #1791
What
Adds an API level lookup for icon URLs from any active token lists in order to support icons from tokens that don't have a home domain( like SEP-41 tokens, USDL, etc. ).
Why
SEP-41 tokens currently have no support for icons but its possible for them to be added to community token lists with a corresponding icon URL.
Related:
Adds USDL to Soroswap's token list
https://github.com/soroswap/token-list/pull/55/files