From 836914c662701ee4d8ca0a2a6924f66c87f4af7b Mon Sep 17 00:00:00 2001 From: Tim Man Date: Thu, 23 Nov 2023 19:14:47 +0800 Subject: [PATCH] Chore merge ours to downstream develop (#62) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * Release/v0.20.0 (#611) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Show BRC20 token transaction history (#523) * Show BRC20 token transaction history * Handle pending state * Use updated brc20 transaction history response * Update package.lock.json file * fix loading state * Update brc20 history tx title * Update core version to latest --------- Co-authored-by: Denys Hriaznov <36603049+dhriaznov@users.noreply.github.com> * fix rare sats settings copy (#612) * Release/0.21.0 (#613) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 (#29) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man Co-authored-by: fede erbes * chore: tidy up zips of each build run and the release uploads (#31) * feat: collectibles ui frontend (#30) * [ENG-2836] feat: Ordinals and BRC-20 collectibles UI * Improve ordinals & brc-20 collectibles fetching logic and UI * Collectible ordinal detail page (#32) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * Add ordinal attributes in detail screen * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file * Add scrollbar to ordinal detail screen * Adjust text alignment * Update Navigation Bar * Add Share button in extension ordinal detail screen * Include useInscription hook --------- Co-authored-by: Tim Man Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Fix `getNextPageParam` param in the `useAddressInscriptionCollections` hook * feat: inscriptions collection page UI components (#36) * chore: use xverse-core with api functions * feat: add ordinals collection screen and route * chore: add prettier organize imports plugin * chore: remove unused eslint disable line * fix: fix tab query params * feat: add ordinals collection route and screen * fix: revert scrollbar change * Tim/eng 2813 inscriptions collection page data fetching pagination (#37) * Make some small code tweaks * Complete Remaining Todos for Ordinal Detail Screen (#38) * Update ordinal detail Ui accodrding to MVP * Get ordinal details from api * Have placeholder incase market data does not exist * Fix navigation and address comments * feat: collection grid items (#39) * Add content skeleton loader for Collectibles tab * Fix border radius for Collectibles skeleton loader * Fix the loader condition in Collectibles tab * Update BRC20 token collection thumbnail in main collectible page * Tim/eng 2833 inscriptions full screen responsive main page collection (#41) * feat: style the send screen including responsive layout * style: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Display collection market data (#40) * Get collection amrket data * Fix alignment on collection page * chore: revert the large package-lock.json diff * Update receive screen and bottom modal (#42) * Update recieve screen * Add updated QR code in recieve screen * Update receive modal * Fix getNextPageParam for const useAddressInscriptionCollections = () => { * Remove unused package * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Address comments * chore: remove empty unreferenced component * Remove unused background color * fix: layout and spacing on updated bottom modal, receive nft --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix color for custom switch and code typo (#43) * unstaged package-lock.json * fix: update all custom switch colors --------- Co-authored-by: Tim Man * fix: inscriptions grid fixes (#44) * chore: bump core version to 1.9.1 * Update function to recognise and parse brc20 tokens (#46) * Update skeleton loader logic for Collectibles UI (#45) * Update skeleton loader logic for Collectibles UI * Add a separate `TilesSkeletonLoader` component, add skeleton loader on the Collection page * Add ordinal detail page skeleton loader for the extension view * Add skeleton loader for the ordinal image component * fix: collectibles fixes from review (#47) * Fix minor ui bugs in collectible screen (#48) --------- Co-authored-by: Imamah-Zafar <88320460+Imamah-Zafar@users.noreply.github.com> Co-authored-by: Tim Man Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov Co-authored-by: Duska.T <55587184+DuskaT021@users.noreply.github.com> * release: v0.21.0 * Small fixes for the Collectibles UI loading state (#50) * Small fixes for the Collectibles UI * Fix loader appearance in the Collectibles tabs * Fix skeleton loader on the main Collectibles tab gallery view * Fix skeleton loader on the Collection page gallery view * Add skeleton loader for the ordinal detail page * fix: container padding on ordinals collection page * chore: remove debug lines --------- Co-authored-by: Tim Man * fix: more collectible UI fixes (#52) * chore: remove testAddress and TODOs * fix: brc20 status in ordinal details * fix: back button from nft details goes to nfts tab and back button from ordinal detail says back to collection or gallery * Minor ui fixes (#51) * sort brc20 inscription array * Fix styling * Remove unused funciton --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov Co-authored-by: Imamah-Zafar <88320460+Imamah-Zafar@users.noreply.github.com> Co-authored-by: Duska.T <55587184+DuskaT021@users.noreply.github.com> * feat: revamp all colors (#588) * Tim/eng 2317 consistent dashboard buttons in extension (#618) * fix: use revamped swap svg * fix: hide swap button on testnet * Ledger send btc screen crash when going back and forward (#615) * Make `Authorize data collection` property turned on by default (#614) * Make `Authorize data collection` property turned on by default * Change the html tag and text color constant * [ENG-2961] Fix eslint errors for web extension (#617) * [ENG-2961] Fix eslint errors for web extension * [ENG-2961] Fix eslint errors for web extension * Update src/app/hooks/queries/ordinals/useInscriptionDetails.ts Co-authored-by: Victor Kirov * Update src/app/hooks/queries/useAppConfig.ts Co-authored-by: Victor Kirov --------- Co-authored-by: Victor Kirov * [ENG-3059] fix: Remove ordinal callout from send rare sats (#619) * [ENG-3059] fix: Remove ordinal callout from send rare sats * Update `amount` field validation error styling * chore: turn on tsc --noEmit precommit hook (#622) * chore: add tsc-files dev dep and run on lint staged pre commit also ran npm audit fix for a critical vuln and updated direct svg import typings * chore: use string for svg typescript declarations * chore: run eslint on repo before passing the workflow checks * feat: allow unpublished UTXOs as inputs to PSBTs (#621) * feat: allow unpublished UTXOs as inputs to PSBTs * Use correct status from response --------- Co-authored-by: Tim Man * [ENG-3039] fix: Skeleton loader for BRC-20 icons in home dashboard (#620) it can be merged, tested on ledger as well * Mahmoud/eng 2284 seedphrase vault (#510) * refactor wallet flow to use seed vault * code cleanup * update auth flow and seedphrase usage * lock dependencies and user xverse-core beta * migrate onboarding to use seed vault * use account switch method from wallet reducer hook * use seed vault for stx swaps * removed seedPhrase from wallet store * rebase fixes * small fixes * clear home screen errors * revert hashing algo change * fix swap hook * Revert "clear home screen errors" This reverts commit 55da10e60ead4c0798c40d61701b904085d6e603. * apply core changes * clear encrypted seed after successfully migrating * type fixes * update core version * onboarding guard refactor * update seed vault hook * use chromeStorage driver for session storage * updated core-lib version * refactor onboarding guard to use hasSeed * update core-lib * small fixes * update auth guard and update core version * updated csp * deprecate internal message handler * update wallet exists guard * overwrite any existing seed on restore wallet * update flow to explicitly clear vault for onboarding * update image csp * reset navigation if seed is not pre-set * update sendRareSat screen to use seed vault * add rich media csp policy * added authguard to settings screen * updated lock file * minor fixes * fresh npm install using v18 * lock with develop * adde new package updates * use fixed version of core * update to core lts version --------- Co-authored-by: Victor Kirov Co-authored-by: Tim Man * [ENG-3115] fix: UI issue in the legal screen (#624) * feat: add vout to the end of the tx id for unknown rarities (#623) * feat: add vout to the end of the tx id for unknown rarities * chore: sed replace forward slash in workflow file should replace all occurrences --------- Co-authored-by: Tim Man * Fix minor UI issues (#625) * Have thousandths separators for STX balance * Add scrollbar in message signing screen * Fix spacing in ordinal detail screen * Add loader for recover ordinal screen * fix: disabling ordinals user should not see them in the (#627) * fix: only display tab buttons when more than one tab (#629) * chore: turn on eslint rule and fix up some core internal imports (#630) * chore: turn on eslint rule and fix up some core internal imports but not all, as some are not exported yet * chore: escape . in eslint rule * chore: use a different eslint rule for this * release: v0.22.0 (#626) * fix: unable to change the network to testnet on the latest (#636) * chore: investigate npm dependabot warnings on extension (#635) * Hotfix/fix (#646) * release: v0.22.0-rc.4 to main (#642) * fix: refactor select currency logic to use reducer and unit test * chore: commit package-lock * fix: disable button when insufficient balance * fix: add token name to min received * fix: advanced settings modal on swaps * fix: use 4dp rounding on exchange rate * fix: toggle button should also toggle amounts * fix: function font style should be body_medium_m * feat: make swap confirmation buttons sticky bottom * fix: standardise button hover, active, disabled css ref: https://zeroheight.com/0683c9fa7/p/5270b4-buttons/b/32e1a2 * feat: add error state to slippage input * fix: use intended params for swap advance settings on apply handler * fix: padding on swap confirm buttons * fix: no exponents in fees block of swap confirmation * feat: add sponsor swap transaction UI and add a hook with placeholder * feat: bump xverse-core dep version and use sponsor2 url * fix: bump xverse-core version and handle sponsor transaction error * feat(Dashboard): update new action button style and add swap button * feat(Swap): add swap screen placeholder * feat(swap): add swap basic UI * feat(swap): add more UI components * feat(swap): add slippage * feat(swap): make BitCoin and Stacks option in the coin select modal * feat(swap): add token selection logic * feat: add swap data connection * feat(swap): add runSwap * chore(swap): bump alex-sdk version * fix(swap): slippage setting * feat: swap confirm layout * feat: add data bindings * fix: function name and copy address * feat: add advanced settings to the confirmation page * feat: bump alex-sdk to latest and fix the issue where from is the same as to * feat: add math.floor before converting to bigInt * fix: skip action when input is invalid * chore: update package.lock * feat(swap): update to support amm v1_1 pools * chore: fix lint warnings * fix: update swap svg stroke and add missing translation * fix: add key to fix react warnings * chore: fix lint warnings * fix: add error 700 border to swap token card * fix: update swap error message and restrict input to number * chore: prettier * style: add a not-allowed cursor to disabled buttons * fix: update translations * fix: use background elevation_1 * style: update swap details spacing * style: use unicode arrow right for swap route details * feat: implement toggle tokens button in swaps * feat: add reset slippage button to swaps * fix: refactor select currency logic to use reducer and unit test * chore: commit package-lock * fix: disable button when insufficient balance * fix: add token name to min received * fix: advanced settings modal on swaps * fix: use 4dp rounding on exchange rate * fix: toggle button should also toggle amounts * fix: function font style should be body_medium_m * feat: make swap confirmation buttons sticky bottom * fix: standardise button hover, active, disabled css ref: https://zeroheight.com/0683c9fa7/p/5270b4-buttons/b/32e1a2 * feat: add error state to slippage input * fix: use intended params for swap advance settings on apply handler * fix: padding on swap confirm buttons * fix: no exponents in fees block of swap confirmation * style: prettier * chore: update package-lock with npm i * chore: fix package-lock.json for correct xverse-core dep * chore: replace workflow dep with github api calls * chore: remove erroneous ` * Fix Edit fees popup error * Fix Edit fees popup error * Add receiving address verification for ledger accounts * Fix warning display condition on the ledger verification screen * Dont close popup on checkbox click * fix: fix for JSON serialisation of location.state * chore: use the test instance URL * chore: upgrade to alex-sdk 0.1.14 * Show wrong ledger device error * Add custom ledger account name validation * fix: turn react deps warning back on and fix stale callback * fix: move sponsor url to constants and add sponsor to swap unsigned tx * fix: display the transaction explorer link on successful sponsored tx * fix: set swap transaction fee to 0 if being sponsored * The transaction history not showing a pending send transaction that was just sent from the address * release v0.14.0 * chore: update xverse-core to published release 1.4.0 * chore: update swaps xverse sponsor 2 host * fix: remove btc from swaps coin modal. change was removed during merge * fix: remove static text describing swap route * Add Before Getting Started screen for Ledger onboarding * update copy * add links and update copy * chore: add husky and pre commit prettier to staged files * chore: run prettier --write ./src * fix: show inscription service fee fiat amount * Fix ledger account name UI issue * Show loader instead of previous transaction history data * comment out swaps button * Add localization for onboarding flow Ledger Live warning screen * chore: automatically do husky install on npm install * chore: prefer .husky for hooks * chore: run prettier again * fix: fix unsigned tx serialisation in advance settings for swaps * fix: use getNewNonce to ensure swaps transactions have correct nonce * docs: comment * bump xverse-core to v1.4.2 * fix: only show swaps button if not on a ledger account * fix: post condition info should display to/from depending on the swap * Fix regression issues v0.14.0-rc.1 * fix: ensure we are sending the correct ordinal * fix: ensure we are sending the correct ordinal * 0.14.1 * fix: remove unnecessary nested BalanceAmountText * fix: use semantic html instead of all h1 * fix: add a filter list to not display coins for swaps * Fix screen crash when changing account on /send-brc20 screen * fix: button should always be disabled when processing and show loading state in swap with await, and fix typing * Update /send-brc20 screen logic * use toString to convert value to BigNumber * chore: bump xverse-core to 1.5.0 * fix: not all tickers are all uppercase e.g. xBTC * fix: decouple alex swap from/to token list and visible token list * Fix the case when address verification screen flashes when using wrong device * Add an override switch for sponsoring transaction in swap screen * Update function param name * chore: bump core version to 1.6.0 (#560) * Allow send ordinal to self and display warning instead of error (#525) * feat: allow send ordinal to self and display warning instead of error * feat: remove send btc send to self error and use warning also adjust send ordinal warning if sending brc20 ordinal to self * Release v0.15.0 (#544) * bump version to v0.15.0 * Switch to alex sdk & url for sponsoring service Inspect error code and show sponsoring service info block feat: move alex sponsored transaction hook to new file revert: changes to useSponsoredTransaction hook for future use fix: sponsor transaction switch should toggle userOverrideSponsorValue feat: add a try again button on failed swaps due to sponsor error * feat: add warning texts to explain why a swap cannot be sponsored (#553) * fix: enforce width on swap number input (#554) * Fix swap screen fee update issue (#555) * Use correct value for fee card component * Fix fee state management * Dont show fee block when sponsored * chore: bump xverse-core to 1.5.1 to include fetchStxPendingTxData fix * Fix ui glitch on the login screen (#556) * Remove css transition code * Add hover and active state * fix: use :disabled css pseudo class instead of props on buttons --------- Co-authored-by: Tim Man * Fix swaps tx history (#557) * Use ft transfer array to show token specific history * Add filter to only show specific token history * Refactor txTransfers file to reuse code * Use token ticker * Update variable name * Use correct decimal places for fungible token (#559) * Use ftDecimals function for fungible token amount * fix undefined check --------- Co-authored-by: Tim Man Co-authored-by: Imamah-Zafar Co-authored-by: Tim Man Co-authored-by: Imamah-Zafar <88320460+Imamah-Zafar@users.noreply.github.com> * chore: bump xverse-core to 1.6.1 (#561) * fix: Don't use ordinals as inputs when recovering ordinals (#558) * Use updated type from sats-connect (#546) * Use updated type from sats-connect * chore: bump sats-connect to 1.0.0 * Update package-lock.json --------- Co-authored-by: Tim Man Co-authored-by: Tim Man * feat: remove binance onramp from buy screen (#567) * Release 0.16.0 (#565) * 0.16.0 * feat: change restore and backup wallet inputs (#566) * chore: fix eslint errors with typing and use of fragments * feat: move restore wallet route to larger screen size * feat: replace restore wallet seed phrase text area with input boxes * fix: ensure only one input can be visible at a time * feat: implement verify seed quiz * feat: disable copy of seed phrase view * fix: set error message properly * refactor: clean up to use one effect * fix: styling and input labels on backup/restore wallet * fix: handle edge case where new mnemonic already contains the answer * feat: seedPhraseInput will focus on next input on space and do not allow some common special characters * fix: decouple copy from restore wallet and change password screens * fix: bump xverse-core to 1.6.2 (#574) * Fix incorrect swap transaction fee ticker (#562) * Use STX as fee currency in swap screen * Fix typo * Fix variable name * Fix fiat rate state calculation * Show correct ticker and currency * Remove isSponsored check for fee amount * Add ability to remove connected Ledger account (#524) * Add ability to remove connected Ledger account * Improve the ledger account removal logic * Select the first account after ledger account removal * Create a reusable `optionsDialog` component * Fix account list logic, rename `seperator` component to `separator` * Fix option dialog indents * Add `deviceAccountIndex` value for ledger accounts that are missing it * Fix ledger account address verification * Move the `deviceAccountIndex` field migration to `loadActiveAccounts` func * Update copy --------- Co-authored-by: Tim Man * Support BTC message signing with ledger accounts (#549) * Support BTC message signing with ledger accounts * Remove console.logs * Change ledger signing modal displaying * Add segwit tx signing functionality * Use `signSimpleBip322Message` method for bip 322 message signing * Update package-lock.json * Update PSBT signing logic for ledger accounts * Add `findLedgerAccountId` util, update usage for `signIncomingSingleSigPSBT` function * Update `isAccountSelected` func logic for external popup account select window * Pass an array of inputs to sign to `signIncomingSingleSigPSBT` func * Move `handleBip322LedgerMessageSigning` func to utils, make some small code fixes * Disable the PSBT signing for BTC ledger accounts * Remove the `@stacks/common` module * Add error warning regarding ledger Bitcoin app version * Update error handling for signature request popup * Update copy and make some small UI tweaks * Update the copy for message signing screen * release: v0.17.0 (#576) * release: v0.17.0 * chore: bump to 1.6.3-rc.1 (#575) * chore: bump to 1.6.3-rc.1 * bump core version --------- Co-authored-by: Yukan * update package-lock --------- Co-authored-by: Yukan * Filter out dead pending transactions (#568) * Filter out dead pending transactions * Get account current nonce from confirmed and pending transactions * Refactor filterng out dead pending transaction logic * Address comments * Update variable name * fix: account select navigation (#578) * Display pending fungible token transactions in token dashboard (#572) * Update filterTx function to show pending fungible transactions * Fix transaction title display * Show pending ordinal transactions (#563) * Show pending ordinal transactions * Slight refactor of getBtcTokenTransferTitle * Fix duplicate tx in groupBtcTxsByDate * chore: bump to xverse-core v1.6.4-rc.2 * Remove unused fallback value --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man * feat: add Xverse namespaced providers (#581) * add Xverse namespaced providers * fix comments * Enable PSBT signing for ledger BTC accounts (#570) * Support BTC message signing with ledger accounts * Remove console.logs * Change ledger signing modal displaying * Add segwit tx signing functionality * Use `signSimpleBip322Message` method for bip 322 message signing * Update package-lock.json * Update PSBT signing logic for ledger accounts * Add `findLedgerAccountId` util, update usage for `signIncomingSingleSigPSBT` function * Update `isAccountSelected` func logic for external popup account select window * Pass an array of inputs to sign to `signIncomingSingleSigPSBT` func * Move `handleBip322LedgerMessageSigning` func to utils, make some small code fixes * Disable the PSBT signing for BTC ledger accounts * Enable PSBT signing for ledger BTC accounts * Remove the `@stacks/common` module * Add error warning regarding ledger Bitcoin app version * Update error handling for signature request popup * Update copy and make some small UI tweaks * Update the copy for message signing screen * Update PSBT signing screen copy * fix: allow display of brc-20 if application/json type (#587) * fix: allow display of brc-20 if application/json type * make bg colours for a BRC-20 coin consistent * fix: full screen and popup styling (#577) * fix: full screen and popup styling * fix screen container * fix app load styling * fix full screen popup pages --------- Co-authored-by: Tim Man * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Add STX support for Ledger accounts (#564) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Fix ledger account import when both BTC and STX options are selected * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Add error handling when user rejects stx address * Add a guard from account changing for the `/add-stx-address-ledger` route * Remove the back button on the ledger account import flow * Throw an error when `stacksCreds` were not fetched * Upgrade `@secretkeylabs/xverse-core` version to `^1.6.5-3bb284c` * Update package files * Fix add stx address error handling * Fix signing with 1st ledger account and bottom modal position * Skip the `No errors` value of the `errorMessage` for STX ledger signature * Remove the caret symbol in `sats-connect` package version * chore: bump xverse-core version 1.7.2 --------- Co-authored-by: Tim Man * fix: brc-20 balance number check (#592) * fix: don't show fees until we have UTXOs on inscription screen (#594) * fix: improve full screen popup styling (#593) * fix: improve full screen popup styling * fix: set height to 600 on options window * Release/v0.18.0 (#591) * release: v0.18.0 * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Use `ticker` field instead of `name` for ft and brc-20 token sending (#595) * update package-lock.json --------- Co-authored-by: Victor Kirov Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Fix Tx history screen reload & send form navigation issues (#584) * Donot show spinner when refetching transaction history data * Fix STX navigation issue * Fix input fields clearance on naviagtion * Update dependency array for useEffect * Add comment * Fix memo error * Support script outputs in psbts (#534) * Support script outputs * Update copy * Revert package.json change * Add info message for output script * Use Array.some * Remove unused style * Update core versio and address comments * Remove pretext from output script ui * Refactor render script output logic * Donot show spinner when refetching transaction history data * Fix STX navigation issue * Fix input fields clearance on naviagtion * chore: turn on eslint for staged files on precommit and turn off no-plusplus rule * Fix eslint issues * Update dependency array for useEffect * Add comment * Fix script count * fix: eslint fix --------- Co-authored-by: Tim Man Co-authored-by: Tim Man * Mismatch when verifying the addresses from the ledger device (#580) * Handle min fee rate returned by the API (#583) * Handle min fee rate returned by the API * Add a check for the STX tx min fee * Fix a couple of tslint errors * fix: don't show loader on balance refetch on home screen ENG-2757 (#589) * Add refetch loader * resize loading spinner * Release/v0.18.2 (#600) * release: v0.18.0 * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Use `ticker` field instead of `name` for ft and brc-20 token sending (#595) * update package-lock.json * release v0.18.2 * fix send through app fees when inscribing * update package-lock --------- Co-authored-by: Tim Man Co-authored-by: Victor Kirov Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * feat: 1 step brc 20 transfers (#585) * chore: use xverse-core with brc20 hooks * refactor: make reusable fiat row component from sendForm * feat: update send brc20 form to use 1 step mode * feat: update theme elevations to revamp elevations * fix: ensure brc20 currencies are uppercase * fix: remove margin on reusable component tokenImage * feat: create confirm brc20 transaction screen * chore: add jsx key eslint rule * feat: style the brc20 review screen & fees component * feat: implement edit fees for brc20 transfer * fix: show brc20 ticker and image on confirm screen * fix: styling of account header and other brc20 fixes * feat: remove copy buttons from account header * feat: bottom bar will always maintain height * fix: padding and margins on confirm brc20 screen * feat: create a file for common styles and new screen for execute brc20 * fix: styling, react errors, and estimate fees on click edit fees buttons * fix: edit fees button width * fix: account list padding * feat: implement loading status animation * feat: integrate the animations for loading transaction status * fix: clean up TODOs * feat: use content loader in brc20 edit fees * chore: rename the common styled file * fix: fix reset user flow on confirmBrc20Transaction and unused styles * Revert "feat: bottom bar will always maintain height" This reverts commit 07e9fca564beb0a971c4703aa07893a8a9491e5d. * docs: comment * Update src/app/screens/confirmBrc20Transaction/index.tsx Co-authored-by: Victor Kirov * style: use relative import for consistency * style: remove unused comment * docs: add todo to existing comment * fix: reset user flow to '/' and other review fixes * fix: don't clear input if a disallowed key is pressed * fix: ensure only run executeBrc20Transaction once * refactor: simplify usage of useResetUserFlow * chore: remove unused types * chore: update core version to use new brc20 hook * refactor: use useBrc20EstimateTransfer hook * refactor: save edit fees previous state if user clicks cancel * refactor: separate logic to hook * fix: add hook typings and use phosphor icon * fix: actually pass the user input fee rate to execute transfer * fix: disable cancel and confirm buttons while estimate fee is loading * fix: add padding back in account row list on btc select address screen * fix: colors on options and popup css * fix: button positioning on full screen ledger view * refactor: rename one step brc20 send screen and put TODOs for ledger * revert: restore 2 step brc20 send form for ledger support * fix: apply useResetUserFlow update to sendBrc20 * fix: restore 2 step brc20 translations * fix: update new pages to refactored reset user flow hook --------- Co-authored-by: Victor Kirov * update license (#606) * Add scrollbar on all scrollable screens (#582) * Update scrollbar * Include scrollbar styling in theme file * Show transparent scrollbar in account list screen * Remove disable cycle dependency flag * Revert unrelated eslint fixes * Update src/theme/index.ts Co-authored-by: Tim Man * Update theme file * Add missing hidden scrollbar css --------- Co-authored-by: Tim Man * fix: loader on home page issues (#603) Co-authored-by: Tim Man * Fix scrollbar in landing page (#609) * Fix scrollbar in landing page * Revert "Fix scrollbar in landing page" This reverts commit 46c1a8f45cd4f308c84a15db2e57bc284515bbbe. * fix: add back the global CSS to hide scrollbars by default and add display: block on scrollbars CSS when desired --------- Co-authored-by: Tim Man * feat: notice for an non taproot address when sending brc 20 tokens (#602) * refactor: move fiatRow into separate component * feat: add callout and inputFeedback to send brc20 one step screen and include components in ui-library * feat: add conditional callouts to confirm brc20 screen * feat: update the recipient card on confirm brc20 transaction * fix: input borders should reflect errors only, not info feedback * refactor: include a helper function for checking if error state * refactor: make styles consistent in callout.tsx * fix: remove unused icon variants * fix: fix styling and imports on brc20 one step and callout component * refactor: use recipient card props instead of type from core * fix: update success callout color and add to theme * fix: fix estimate fee error not showing, and vertical align of callout body * refactor: use styled components instead of React.createElement * Revert "refactor: use styled components instead of React.createElement" This reverts commit 31faea642fdcc867b0cec707bf2ff8a5814aab44. * fix: disable key presses for - and . on brc20 edit fees * refactor: use styled icon instead of React.createElement * refactor: use fiatAmountText component and allow styling * fix: use input feedback in editFees and update components to allow styled components * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * Release/v0.20.0 (#611) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Show BRC20 token transaction history (#523) * Show BRC20 token transaction history * Handle pending state * Use updated brc20 transaction history response * Update package.lock.json file * fix loading state * Update brc20 history tx title * Update core version to latest --------- Co-authored-by: Denys Hriaznov <36603049+dhriaznov@users.noreply.github.com> * fix rare sats settings copy (#612) * Release/0.21.0 (#613) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 (#29) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man Co-authored-by: fede erbes * chore: tidy up zips of each build run and the release uploads (#31) * feat: collectibles ui frontend (#30) * [ENG-2836] feat: Ordinals and BRC-20 collectibles UI * Improve ordinals & brc-20 collectibles fetching logic and UI * Collectible ordinal detail page (#32) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * Add ordinal attributes in detail screen * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file * Add scrollbar to ordinal detail screen * Adjust text alignment * Update Navigation Bar * Add Share button in extension ordinal detail screen * Include useInscription hook --------- Co-authored-by: Tim Man Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Fix `getNextPageParam` param in the `useAddressInscriptionCollections` hook * feat: inscriptions collection page UI components (#36) * chore: use xverse-core with api functions * feat: add ordinals collection screen and route * chore: add prettier organize imports plugin * chore: remove unused eslint disable line * fix: fix tab query params * feat: add ordinals collection route and screen * fix: revert scrollbar change * Tim/eng 2813 inscriptions collection page data fetching pagination (#37) * Make some small code tweaks * Complete Remaining Todos for Ordinal Detail Screen (#38) * Update ordinal detail Ui accodrding to MVP * Get ordinal details from api * Have placeholder incase market data does not exist * Fix navigation and address comments * feat: collection grid items (#39) * Add content skeleton loader for Collectibles tab * Fix border radius for Collectibles skeleton loader * Fix the loader condition in Collectibles tab * Update BRC20 token collection thumbnail in main collectible page * Tim/eng 2833 inscriptions full screen responsive main page collection (#41) * feat: style the send screen including responsive layout * style: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Display collection market data (#40) * Get collection amrket data * Fix alignment on collection page * chore: revert the large package-lock.json diff * Update receive screen and bottom modal (#42) * Update recieve screen * Add updated QR code in recieve screen * Update receive modal * Fix getNextPageParam for const useAddressInscriptionCollections = () => { * Remove unused package * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Address comments * chore: remove empty unreferenced component * Remove unused background color * fix: layout and spacing on updated bottom modal, receive nft --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix color for custom switch and code t… * Fix main dev drift (#647) * release: v0.22.0-rc.4 to main (#642) * fix: refactor select currency logic to use reducer and unit test * chore: commit package-lock * fix: disable button when insufficient balance * fix: add token name to min received * fix: advanced settings modal on swaps * fix: use 4dp rounding on exchange rate * fix: toggle button should also toggle amounts * fix: function font style should be body_medium_m * feat: make swap confirmation buttons sticky bottom * fix: standardise button hover, active, disabled css ref: https://zeroheight.com/0683c9fa7/p/5270b4-buttons/b/32e1a2 * feat: add error state to slippage input * fix: use intended params for swap advance settings on apply handler * fix: padding on swap confirm buttons * fix: no exponents in fees block of swap confirmation * feat: add sponsor swap transaction UI and add a hook with placeholder * feat: bump xverse-core dep version and use sponsor2 url * fix: bump xverse-core version and handle sponsor transaction error * feat(Dashboard): update new action button style and add swap button * feat(Swap): add swap screen placeholder * feat(swap): add swap basic UI * feat(swap): add more UI components * feat(swap): add slippage * feat(swap): make BitCoin and Stacks option in the coin select modal * feat(swap): add token selection logic * feat: add swap data connection * feat(swap): add runSwap * chore(swap): bump alex-sdk version * fix(swap): slippage setting * feat: swap confirm layout * feat: add data bindings * fix: function name and copy address * feat: add advanced settings to the confirmation page * feat: bump alex-sdk to latest and fix the issue where from is the same as to * feat: add math.floor before converting to bigInt * fix: skip action when input is invalid * chore: update package.lock * feat(swap): update to support amm v1_1 pools * chore: fix lint warnings * fix: update swap svg stroke and add missing translation * fix: add key to fix react warnings * chore: fix lint warnings * fix: add error 700 border to swap token card * fix: update swap error message and restrict input to number * chore: prettier * style: add a not-allowed cursor to disabled buttons * fix: update translations * fix: use background elevation_1 * style: update swap details spacing * style: use unicode arrow right for swap route details * feat: implement toggle tokens button in swaps * feat: add reset slippage button to swaps * fix: refactor select currency logic to use reducer and unit test * chore: commit package-lock * fix: disable button when insufficient balance * fix: add token name to min received * fix: advanced settings modal on swaps * fix: use 4dp rounding on exchange rate * fix: toggle button should also toggle amounts * fix: function font style should be body_medium_m * feat: make swap confirmation buttons sticky bottom * fix: standardise button hover, active, disabled css ref: https://zeroheight.com/0683c9fa7/p/5270b4-buttons/b/32e1a2 * feat: add error state to slippage input * fix: use intended params for swap advance settings on apply handler * fix: padding on swap confirm buttons * fix: no exponents in fees block of swap confirmation * style: prettier * chore: update package-lock with npm i * chore: fix package-lock.json for correct xverse-core dep * chore: replace workflow dep with github api calls * chore: remove erroneous ` * Fix Edit fees popup error * Fix Edit fees popup error * Add receiving address verification for ledger accounts * Fix warning display condition on the ledger verification screen * Dont close popup on checkbox click * fix: fix for JSON serialisation of location.state * chore: use the test instance URL * chore: upgrade to alex-sdk 0.1.14 * Show wrong ledger device error * Add custom ledger account name validation * fix: turn react deps warning back on and fix stale callback * fix: move sponsor url to constants and add sponsor to swap unsigned tx * fix: display the transaction explorer link on successful sponsored tx * fix: set swap transaction fee to 0 if being sponsored * The transaction history not showing a pending send transaction that was just sent from the address * release v0.14.0 * chore: update xverse-core to published release 1.4.0 * chore: update swaps xverse sponsor 2 host * fix: remove btc from swaps coin modal. change was removed during merge * fix: remove static text describing swap route * Add Before Getting Started screen for Ledger onboarding * update copy * add links and update copy * chore: add husky and pre commit prettier to staged files * chore: run prettier --write ./src * fix: show inscription service fee fiat amount * Fix ledger account name UI issue * Show loader instead of previous transaction history data * comment out swaps button * Add localization for onboarding flow Ledger Live warning screen * chore: automatically do husky install on npm install * chore: prefer .husky for hooks * chore: run prettier again * fix: fix unsigned tx serialisation in advance settings for swaps * fix: use getNewNonce to ensure swaps transactions have correct nonce * docs: comment * bump xverse-core to v1.4.2 * fix: only show swaps button if not on a ledger account * fix: post condition info should display to/from depending on the swap * Fix regression issues v0.14.0-rc.1 * fix: ensure we are sending the correct ordinal * fix: ensure we are sending the correct ordinal * 0.14.1 * fix: remove unnecessary nested BalanceAmountText * fix: use semantic html instead of all h1 * fix: add a filter list to not display coins for swaps * Fix screen crash when changing account on /send-brc20 screen * fix: button should always be disabled when processing and show loading state in swap with await, and fix typing * Update /send-brc20 screen logic * use toString to convert value to BigNumber * chore: bump xverse-core to 1.5.0 * fix: not all tickers are all uppercase e.g. xBTC * fix: decouple alex swap from/to token list and visible token list * Fix the case when address verification screen flashes when using wrong device * Add an override switch for sponsoring transaction in swap screen * Update function param name * chore: bump core version to 1.6.0 (#560) * Allow send ordinal to self and display warning instead of error (#525) * feat: allow send ordinal to self and display warning instead of error * feat: remove send btc send to self error and use warning also adjust send ordinal warning if sending brc20 ordinal to self * Release v0.15.0 (#544) * bump version to v0.15.0 * Switch to alex sdk & url for sponsoring service Inspect error code and show sponsoring service info block feat: move alex sponsored transaction hook to new file revert: changes to useSponsoredTransaction hook for future use fix: sponsor transaction switch should toggle userOverrideSponsorValue feat: add a try again button on failed swaps due to sponsor error * feat: add warning texts to explain why a swap cannot be sponsored (#553) * fix: enforce width on swap number input (#554) * Fix swap screen fee update issue (#555) * Use correct value for fee card component * Fix fee state management * Dont show fee block when sponsored * chore: bump xverse-core to 1.5.1 to include fetchStxPendingTxData fix * Fix ui glitch on the login screen (#556) * Remove css transition code * Add hover and active state * fix: use :disabled css pseudo class instead of props on buttons --------- Co-authored-by: Tim Man * Fix swaps tx history (#557) * Use ft transfer array to show token specific history * Add filter to only show specific token history * Refactor txTransfers file to reuse code * Use token ticker * Update variable name * Use correct decimal places for fungible token (#559) * Use ftDecimals function for fungible token amount * fix undefined check --------- Co-authored-by: Tim Man Co-authored-by: Imamah-Zafar Co-authored-by: Tim Man Co-authored-by: Imamah-Zafar <88320460+Imamah-Zafar@users.noreply.github.com> * chore: bump xverse-core to 1.6.1 (#561) * fix: Don't use ordinals as inputs when recovering ordinals (#558) * Use updated type from sats-connect (#546) * Use updated type from sats-connect * chore: bump sats-connect to 1.0.0 * Update package-lock.json --------- Co-authored-by: Tim Man Co-authored-by: Tim Man * feat: remove binance onramp from buy screen (#567) * Release 0.16.0 (#565) * 0.16.0 * feat: change restore and backup wallet inputs (#566) * chore: fix eslint errors with typing and use of fragments * feat: move restore wallet route to larger screen size * feat: replace restore wallet seed phrase text area with input boxes * fix: ensure only one input can be visible at a time * feat: implement verify seed quiz * feat: disable copy of seed phrase view * fix: set error message properly * refactor: clean up to use one effect * fix: styling and input labels on backup/restore wallet * fix: handle edge case where new mnemonic already contains the answer * feat: seedPhraseInput will focus on next input on space and do not allow some common special characters * fix: decouple copy from restore wallet and change password screens * fix: bump xverse-core to 1.6.2 (#574) * Fix incorrect swap transaction fee ticker (#562) * Use STX as fee currency in swap screen * Fix typo * Fix variable name * Fix fiat rate state calculation * Show correct ticker and currency * Remove isSponsored check for fee amount * Add ability to remove connected Ledger account (#524) * Add ability to remove connected Ledger account * Improve the ledger account removal logic * Select the first account after ledger account removal * Create a reusable `optionsDialog` component * Fix account list logic, rename `seperator` component to `separator` * Fix option dialog indents * Add `deviceAccountIndex` value for ledger accounts that are missing it * Fix ledger account address verification * Move the `deviceAccountIndex` field migration to `loadActiveAccounts` func * Update copy --------- Co-authored-by: Tim Man * Support BTC message signing with ledger accounts (#549) * Support BTC message signing with ledger accounts * Remove console.logs * Change ledger signing modal displaying * Add segwit tx signing functionality * Use `signSimpleBip322Message` method for bip 322 message signing * Update package-lock.json * Update PSBT signing logic for ledger accounts * Add `findLedgerAccountId` util, update usage for `signIncomingSingleSigPSBT` function * Update `isAccountSelected` func logic for external popup account select window * Pass an array of inputs to sign to `signIncomingSingleSigPSBT` func * Move `handleBip322LedgerMessageSigning` func to utils, make some small code fixes * Disable the PSBT signing for BTC ledger accounts * Remove the `@stacks/common` module * Add error warning regarding ledger Bitcoin app version * Update error handling for signature request popup * Update copy and make some small UI tweaks * Update the copy for message signing screen * release: v0.17.0 (#576) * release: v0.17.0 * chore: bump to 1.6.3-rc.1 (#575) * chore: bump to 1.6.3-rc.1 * bump core version --------- Co-authored-by: Yukan * update package-lock --------- Co-authored-by: Yukan * Filter out dead pending transactions (#568) * Filter out dead pending transactions * Get account current nonce from confirmed and pending transactions * Refactor filterng out dead pending transaction logic * Address comments * Update variable name * fix: account select navigation (#578) * Display pending fungible token transactions in token dashboard (#572) * Update filterTx function to show pending fungible transactions * Fix transaction title display * Show pending ordinal transactions (#563) * Show pending ordinal transactions * Slight refactor of getBtcTokenTransferTitle * Fix duplicate tx in groupBtcTxsByDate * chore: bump to xverse-core v1.6.4-rc.2 * Remove unused fallback value --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man * feat: add Xverse namespaced providers (#581) * add Xverse namespaced providers * fix comments * Enable PSBT signing for ledger BTC accounts (#570) * Support BTC message signing with ledger accounts * Remove console.logs * Change ledger signing modal displaying * Add segwit tx signing functionality * Use `signSimpleBip322Message` method for bip 322 message signing * Update package-lock.json * Update PSBT signing logic for ledger accounts * Add `findLedgerAccountId` util, update usage for `signIncomingSingleSigPSBT` function * Update `isAccountSelected` func logic for external popup account select window * Pass an array of inputs to sign to `signIncomingSingleSigPSBT` func * Move `handleBip322LedgerMessageSigning` func to utils, make some small code fixes * Disable the PSBT signing for BTC ledger accounts * Enable PSBT signing for ledger BTC accounts * Remove the `@stacks/common` module * Add error warning regarding ledger Bitcoin app version * Update error handling for signature request popup * Update copy and make some small UI tweaks * Update the copy for message signing screen * Update PSBT signing screen copy * fix: allow display of brc-20 if application/json type (#587) * fix: allow display of brc-20 if application/json type * make bg colours for a BRC-20 coin consistent * fix: full screen and popup styling (#577) * fix: full screen and popup styling * fix screen container * fix app load styling * fix full screen popup pages --------- Co-authored-by: Tim Man * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Add STX support for Ledger accounts (#564) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Fix ledger account import when both BTC and STX options are selected * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Add error handling when user rejects stx address * Add a guard from account changing for the `/add-stx-address-ledger` route * Remove the back button on the ledger account import flow * Throw an error when `stacksCreds` were not fetched * Upgrade `@secretkeylabs/xverse-core` version to `^1.6.5-3bb284c` * Update package files * Fix add stx address error handling * Fix signing with 1st ledger account and bottom modal position * Skip the `No errors` value of the `errorMessage` for STX ledger signature * Remove the caret symbol in `sats-connect` package version * chore: bump xverse-core version 1.7.2 --------- Co-authored-by: Tim Man * fix: brc-20 balance number check (#592) * fix: don't show fees until we have UTXOs on inscription screen (#594) * fix: improve full screen popup styling (#593) * fix: improve full screen popup styling * fix: set height to 600 on options window * Release/v0.18.0 (#591) * release: v0.18.0 * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Use `ticker` field instead of `name` for ft and brc-20 token sending (#595) * update package-lock.json --------- Co-authored-by: Victor Kirov Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Fix Tx history screen reload & send form navigation issues (#584) * Donot show spinner when refetching transaction history data * Fix STX navigation issue * Fix input fields clearance on naviagtion * Update dependency array for useEffect * Add comment * Fix memo error * Support script outputs in psbts (#534) * Support script outputs * Update copy * Revert package.json change * Add info message for output script * Use Array.some * Remove unused style * Update core versio and address comments * Remove pretext from output script ui * Refactor render script output logic * Donot show spinner when refetching transaction history data * Fix STX navigation issue * Fix input fields clearance on naviagtion * chore: turn on eslint for staged files on precommit and turn off no-plusplus rule * Fix eslint issues * Update dependency array for useEffect * Add comment * Fix script count * fix: eslint fix --------- Co-authored-by: Tim Man Co-authored-by: Tim Man * Mismatch when verifying the addresses from the ledger device (#580) * Handle min fee rate returned by the API (#583) * Handle min fee rate returned by the API * Add a check for the STX tx min fee * Fix a couple of tslint errors * fix: don't show loader on balance refetch on home screen ENG-2757 (#589) * Add refetch loader * resize loading spinner * Release/v0.18.2 (#600) * release: v0.18.0 * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Use `ticker` field instead of `name` for ft and brc-20 token sending (#595) * update package-lock.json * release v0.18.2 * fix send through app fees when inscribing * update package-lock --------- Co-authored-by: Tim Man Co-authored-by: Victor Kirov Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * feat: 1 step brc 20 transfers (#585) * chore: use xverse-core with brc20 hooks * refactor: make reusable fiat row component from sendForm * feat: update send brc20 form to use 1 step mode * feat: update theme elevations to revamp elevations * fix: ensure brc20 currencies are uppercase * fix: remove margin on reusable component tokenImage * feat: create confirm brc20 transaction screen * chore: add jsx key eslint rule * feat: style the brc20 review screen & fees component * feat: implement edit fees for brc20 transfer * fix: show brc20 ticker and image on confirm screen * fix: styling of account header and other brc20 fixes * feat: remove copy buttons from account header * feat: bottom bar will always maintain height * fix: padding and margins on confirm brc20 screen * feat: create a file for common styles and new screen for execute brc20 * fix: styling, react errors, and estimate fees on click edit fees buttons * fix: edit fees button width * fix: account list padding * feat: implement loading status animation * feat: integrate the animations for loading transaction status * fix: clean up TODOs * feat: use content loader in brc20 edit fees * chore: rename the common styled file * fix: fix reset user flow on confirmBrc20Transaction and unused styles * Revert "feat: bottom bar will always maintain height" This reverts commit 07e9fca564beb0a971c4703aa07893a8a9491e5d. * docs: comment * Update src/app/screens/confirmBrc20Transaction/index.tsx Co-authored-by: Victor Kirov * style: use relative import for consistency * style: remove unused comment * docs: add todo to existing comment * fix: reset user flow to '/' and other review fixes * fix: don't clear input if a disallowed key is pressed * fix: ensure only run executeBrc20Transaction once * refactor: simplify usage of useResetUserFlow * chore: remove unused types * chore: update core version to use new brc20 hook * refactor: use useBrc20EstimateTransfer hook * refactor: save edit fees previous state if user clicks cancel * refactor: separate logic to hook * fix: add hook typings and use phosphor icon * fix: actually pass the user input fee rate to execute transfer * fix: disable cancel and confirm buttons while estimate fee is loading * fix: add padding back in account row list on btc select address screen * fix: colors on options and popup css * fix: button positioning on full screen ledger view * refactor: rename one step brc20 send screen and put TODOs for ledger * revert: restore 2 step brc20 send form for ledger support * fix: apply useResetUserFlow update to sendBrc20 * fix: restore 2 step brc20 translations * fix: update new pages to refactored reset user flow hook --------- Co-authored-by: Victor Kirov * update license (#606) * Add scrollbar on all scrollable screens (#582) * Update scrollbar * Include scrollbar styling in theme file * Show transparent scrollbar in account list screen * Remove disable cycle dependency flag * Revert unrelated eslint fixes * Update src/theme/index.ts Co-authored-by: Tim Man * Update theme file * Add missing hidden scrollbar css --------- Co-authored-by: Tim Man * fix: loader on home page issues (#603) Co-authored-by: Tim Man * Fix scrollbar in landing page (#609) * Fix scrollbar in landing page * Revert "Fix scrollbar in landing page" This reverts commit 46c1a8f45cd4f308c84a15db2e57bc284515bbbe. * fix: add back the global CSS to hide scrollbars by default and add display: block on scrollbars CSS when desired --------- Co-authored-by: Tim Man * feat: notice for an non taproot address when sending brc 20 tokens (#602) * refactor: move fiatRow into separate component * feat: add callout and inputFeedback to send brc20 one step screen and include components in ui-library * feat: add conditional callouts to confirm brc20 screen * feat: update the recipient card on confirm brc20 transaction * fix: input borders should reflect errors only, not info feedback * refactor: include a helper function for checking if error state * refactor: make styles consistent in callout.tsx * fix: remove unused icon variants * fix: fix styling and imports on brc20 one step and callout component * refactor: use recipient card props instead of type from core * fix: update success callout color and add to theme * fix: fix estimate fee error not showing, and vertical align of callout body * refactor: use styled components instead of React.createElement * Revert "refactor: use styled components instead of React.createElement" This reverts commit 31faea642fdcc867b0cec707bf2ff8a5814aab44. * fix: disable key presses for - and . on brc20 edit fees * refactor: use styled icon instead of React.createElement * refactor: use fiatAmountText component and allow styling * fix: use input feedback in editFees and update components to allow styled components * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * Release/v0.20.0 (#611) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Show BRC20 token transaction history (#523) * Show BRC20 token transaction history * Handle pending state * Use updated brc20 transaction history response * Update package.lock.json file * fix loading state * Update brc20 history tx title * Update core version to latest --------- Co-authored-by: Denys Hriaznov <36603049+dhriaznov@users.noreply.github.com> * fix rare sats settings copy (#612) * Release/0.21.0 (#613) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 (#29) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man Co-authored-by: fede erbes * chore: tidy up zips of each build run and the release uploads (#31) * feat: collectibles ui frontend (#30) * [ENG-2836] feat: Ordinals and BRC-20 collectibles UI * Improve ordinals & brc-20 collectibles fetching logic and UI * Collectible ordinal detail page (#32) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * Add ordinal attributes in detail screen * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file * Add scrollbar to ordinal detail screen * Adjust text alignment * Update Navigation Bar * Add Share button in extension ordinal detail screen * Include useInscription hook --------- Co-authored-by: Tim Man Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Fix `getNextPageParam` param in the `useAddressInscriptionCollections` hook * feat: inscriptions collection page UI components (#36) * chore: use xverse-core with api functions * feat: add ordinals collection screen and route * chore: add prettier organize imports plugin * chore: remove unused eslint disable line * fix: fix tab query params * feat: add ordinals collection route and screen * fix: revert scrollbar change * Tim/eng 2813 inscriptions collection page data fetching pagination (#37) * Make some small code tweaks * Complete Remaining Todos for Ordinal Detail Screen (#38) * Update ordinal detail Ui accodrding to MVP * Get ordinal details from api * Have placeholder incase market data does not exist * Fix navigation and address comments * feat: collection grid items (#39) * Add content skeleton loader for Collectibles tab * Fix border radius for Collectibles skeleton loader * Fix the loader condition in Collectibles tab * Update BRC20 token collection thumbnail in main collectible page * Tim/eng 2833 inscriptions full screen responsive main page collection (#41) * feat: style the send screen including responsive layout * style: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Display collection market data (#40) * Get collection amrket data * Fix alignment on collection page * chore: revert the large package-lock.json diff * Update receive screen and bottom modal (#42) * Update recieve screen * Add updated QR code in recieve screen * Update receive modal * Fix getNextPageParam for const useAddressInscriptionCollections = () => { * Remove unused package * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Address comments * chore: remove empty unreferenced component * Remove unused background color * fix: layout and spacing on updated bottom modal, receive nft --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix color for custom switch an… * fix: when clicking on the inscription image in the details view (#659) * fix: settings layover (#657) * navigate back to the screen that triggers login (#651) * fix: remove bignumber from the redux store (#610) * Update btcbalance to string and fix some typing issues * stx balances to string * btc fiat rate to string and fix all typings related to it * stx fiat rate to string * update state sync settings * Remove restore btc screen --------- Co-authored-by: Tim Man * feat: Enable Ledger PSBT signing (#660) * feat: Enable Ledger PSBT signing * bump core * chore: bump sats-connect to 1.1.2 (#667) * Replace hardcoded USD with dynamic NumericFormat prefix (#670) * fix: cache keys for react queries where stale time was added (#669) * feat: STX NFTs Tab (#634) * Add hook to get nft collection data * Update stx collectible UI * Make NFT collage for collections * Fix on click function * fix import * Update NFT Collection Page & NFT Detail Page (#633) * Update NFT Detail UI * Use hook to get collection data * Add NFT Collection screen * Fix navigation * Remove hard coded address * Fix bns name navigation * refactor: use array for cache key * Turn off no-nested-ternary rule globally * Move nft util functions to a seperate file * fix: remove unnecessary use mutation in nft details and some other bug fixes * fix: add the useResetUserFlow hook to nft collection page * refactor: remove nftData from redux store use the react-query cache instead, and fixes bug where some nftData was not being stored * fix: add isLoading state back to nftdetail and route to send with id * fix: react console errors and send nft finishes at dashboard screen * feat: add sticky tabs to collectibles dashboard * refactor: separate use nft dashboard to separate file * fix: bns detail page works * chore: use core version with some updates * fix: make bns names in collection screen not clickable and display name * chore: enable stx test address from localstorage * fix: button width for gallery view (#650) * fix: open NFT gamma link (#649) * fix: open nft page on gamma * refactor: gamma url * fix: metaData * fix: show snackbar if NFT metadata is failed to fetch (#648) * fix: show snackbar if nft metadata is failed to fetch * fix: snackbar styling * feat: revamp stacks nfts send to screen (#653) * feat: revamp the send nft screen * fix: back button display should rely on back history not ledger account * fix: ledger accounts should only open in new tab when not already in full screen otherwise it is annoying * fix: add the bns name resolver to send nft form * fix: opening a send-nft from ledger should open responsive screen and debounce the stx address -> bns name resolver * fix: some nft images are still showing the moon loader spinner it should be (#654) * chore: tweak BetterBarLoader component to receive string as width and height in order to user percentages * fix: key prop in nft collection screen * fix: hardcoded placeholder size values and replace error icon with the new one * fix: NFT detail screen UI (#655) * fix: detail screen UI * fix: UI alignments * fix: buttons spacing * feat: hook items count with correct values (#658) * fix: column gap on tiles skeleton loader * chore: update core version * chore: follow i18n next doc about plurals (#661) * fix: extension crashes when closing the broadcast success screen (#662) * fix: wrong background color on transaction status screens * fix: wrong navigation routes on transaction status screen * fix: copy on inscription complete screen * fix: z index on sticky tabs list and modals, popups (#665) * refactor: collectibles fetch (#666) * refactor: adapt to core refactor of stx collectibles * fix: add back the check for metadata before nav to nft detail screen * fix: use 24 hour staleTime for nft details to match mobile * refactor: remove unused utils function * fix: add react-is-visible to virtualise nft tab and nft collection page * chore: bump core version with duplicate nft fix * chore: bump core version * chore: update core version and remove total_nft * fix: bns image size and disable click on bns item (#668) --------- Co-authored-by: Tim Man Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes * Release/v0.23.0 (#674) * release: v0.22.0-rc.4 to main (#642) * fix: refactor select currency logic to use reducer and unit test * chore: commit package-lock * fix: disable button when insufficient balance * fix: add token name to min received * fix: advanced settings modal on swaps * fix: use 4dp rounding on exchange rate * fix: toggle button should also toggle amounts * fix: function font style should be body_medium_m * feat: make swap confirmation buttons sticky bottom * fix: standardise button hover, active, disabled css ref: https://zeroheight.com/0683c9fa7/p/5270b4-buttons/b/32e1a2 * feat: add error state to slippage input * fix: use intended params for swap advance settings on apply handler * fix: padding on swap confirm buttons * fix: no exponents in fees block of swap confirmation * feat: add sponsor swap transaction UI and add a hook with placeholder * feat: bump xverse-core dep version and use sponsor2 url * fix: bump xverse-core version and handle sponsor transaction error * feat(Dashboard): update new action button style and add swap button * feat(Swap): add swap screen placeholder * feat(swap): add swap basic UI * feat(swap): add more UI components * feat(swap): add slippage * feat(swap): make BitCoin and Stacks option in the coin select modal * feat(swap): add token selection logic * feat: add swap data connection * feat(swap): add runSwap * chore(swap): bump alex-sdk version * fix(swap): slippage setting * feat: swap confirm layout * feat: add data bindings * fix: function name and copy address * feat: add advanced settings to the confirmation page * feat: bump alex-sdk to latest and fix the issue where from is the same as to * feat: add math.floor before converting to bigInt * fix: skip action when input is invalid * chore: update package.lock * feat(swap): update to support amm v1_1 pools * chore: fix lint warnings * fix: update swap svg stroke and add missing translation * fix: add key to fix react warnings * chore: fix lint warnings * fix: add error 700 border to swap token card * fix: update swap error message and restrict input to number * chore: prettier * style: add a not-allowed cursor to disabled buttons * fix: update translations * fix: use background elevation_1 * style: update swap details spacing * style: use unicode arrow right for swap route details * feat: implement toggle tokens button in swaps * feat: add reset slippage button to swaps * fix: refactor select currency logic to use reducer and unit test * chore: commit package-lock * fix: disable button when insufficient balance * fix: add token name to min received * fix: advanced settings modal on swaps * fix: use 4dp rounding on exchange rate * fix: toggle button should also toggle amounts * fix: function font style should be body_medium_m * feat: make swap confirmation buttons sticky bottom * fix: standardise button hover, active, disabled css ref: https://zeroheight.com/0683c9fa7/p/5270b4-buttons/b/32e1a2 * feat: add error state to slippage input * fix: use intended params for swap advance settings on apply handler * fix: padding on swap confirm buttons * fix: no exponents in fees block of swap confirmation * style: prettier * chore: update package-lock with npm i * chore: fix package-lock.json for correct xverse-core dep * chore: replace workflow dep with github api calls * chore: remove erroneous ` * Fix Edit fees popup error * Fix Edit fees popup error * Add receiving address verification for ledger accounts * Fix warning display condition on the ledger verification screen * Dont close popup on checkbox click * fix: fix for JSON serialisation of location.state * chore: use the test instance URL * chore: upgrade to alex-sdk 0.1.14 * Show wrong ledger device error * Add custom ledger account name validation * fix: turn react deps warning back on and fix stale callback * fix: move sponsor url to constants and add sponsor to swap unsigned tx * fix: display the transaction explorer link on successful sponsored tx * fix: set swap transaction fee to 0 if being sponsored * The transaction history not showing a pending send transaction that was just sent from the address * release v0.14.0 * chore: update xverse-core to published release 1.4.0 * chore: update swaps xverse sponsor 2 host * fix: remove btc from swaps coin modal. change was removed during merge * fix: remove static text describing swap route * Add Before Getting Started screen for Ledger onboarding * update copy * add links and update copy * chore: add husky and pre commit prettier to staged files * chore: run prettier --write ./src * fix: show inscription service fee fiat amount * Fix ledger account name UI issue * Show loader instead of previous transaction history data * comment out swaps button * Add localization for onboarding flow Ledger Live warning screen * chore: automatically do husky install on npm install * chore: prefer .husky for hooks * chore: run prettier again * fix: fix unsigned tx serialisation in advance settings for swaps * fix: use getNewNonce to ensure swaps transactions have correct nonce * docs: comment * bump xverse-core to v1.4.2 * fix: only show swaps button if not on a ledger account * fix: post condition info should display to/from depending on the swap * Fix regression issues v0.14.0-rc.1 * fix: ensure we are sending the correct ordinal * fix: ensure we are sending the correct ordinal * 0.14.1 * fix: remove unnecessary nested BalanceAmountText * fix: use semantic html instead of all h1 * fix: add a filter list to not display coins for swaps * Fix screen crash when changing account on /send-brc20 screen * fix: button should always be disabled when processing and show loading state in swap with await, and fix typing * Update /send-brc20 screen logic * use toString to convert value to BigNumber * chore: bump xverse-core to 1.5.0 * fix: not all tickers are all uppercase e.g. xBTC * fix: decouple alex swap from/to token list and visible token list * Fix the case when address verification screen flashes when using wrong device * Add an override switch for sponsoring transaction in swap screen * Update function param name * chore: bump core version to 1.6.0 (#560) * Allow send ordinal to self and display warning instead of error (#525) * feat: allow send ordinal to self and display warning instead of error * feat: remove send btc send to self error and use warning also adjust send ordinal warning if sending brc20 ordinal to self * Release v0.15.0 (#544) * bump version to v0.15.0 * Switch to alex sdk & url for sponsoring service Inspect error code and show sponsoring service info block feat: move alex sponsored transaction hook to new file revert: changes to useSponsoredTransaction hook for future use fix: sponsor transaction switch should toggle userOverrideSponsorValue feat: add a try again button on failed swaps due to sponsor error * feat: add warning texts to explain why a swap cannot be sponsored (#553) * fix: enforce width on swap number input (#554) * Fix swap screen fee update issue (#555) * Use correct value for fee card component * Fix fee state management * Dont show fee block when sponsored * chore: bump xverse-core to 1.5.1 to include fetchStxPendingTxData fix * Fix ui glitch on the login screen (#556) * Remove css transition code * Add hover and active state * fix: use :disabled css pseudo class instead of props on buttons --------- Co-authored-by: Tim Man * Fix swaps tx history (#557) * Use ft transfer array to show token specific history * Add filter to only show specific token history * Refactor txTransfers file to reuse code * Use token ticker * Update variable name * Use correct decimal places for fungible token (#559) * Use ftDecimals function for fungible token amount * fix undefined check --------- Co-authored-by: Tim Man Co-authored-by: Imamah-Zafar Co-authored-by: Tim Man Co-authored-by: Imamah-Zafar <88320460+Imamah-Zafar@users.noreply.github.com> * chore: bump xverse-core to 1.6.1 (#561) * fix: Don't use ordinals as inputs when recovering ordinals (#558) * Use updated type from sats-connect (#546) * Use updated type from sats-connect * chore: bump sats-connect to 1.0.0 * Update package-lock.json --------- Co-authored-by: Tim Man Co-authored-by: Tim Man * feat: remove binance onramp from buy screen (#567) * Release 0.16.0 (#565) * 0.16.0 * feat: change restore and backup wallet inputs (#566) * chore: fix eslint errors with typing and use of fragments * feat: move restore wallet route to larger screen size * feat: replace restore wallet seed phrase text area with input boxes * fix: ensure only one input can be visible at a time * feat: implement verify seed quiz * feat: disable copy of seed phrase view * fix: set error message properly * refactor: clean up to use one effect * fix: styling and input labels on backup/restore wallet * fix: handle edge case where new mnemonic already contains the answer * feat: seedPhraseInput will focus on next input on space and do not allow some common special characters * fix: decouple copy from restore wallet and change password screens * fix: bump xverse-core to 1.6.2 (#574) * Fix incorrect swap transaction fee ticker (#562) * Use STX as fee currency in swap screen * Fix typo * Fix variable name * Fix fiat rate state calculation * Show correct ticker and currency * Remove isSponsored check for fee amount * Add ability to remove connected Ledger account (#524) * Add ability to remove connected Ledger account * Improve the ledger account removal logic * Select the first account after ledger account removal * Create a reusable `optionsDialog` component * Fix account list logic, rename `seperator` component to `separator` * Fix option dialog indents * Add `deviceAccountIndex` value for ledger accounts that are missing it * Fix ledger account address verification * Move the `deviceAccountIndex` field migration to `loadActiveAccounts` func * Update copy --------- Co-authored-by: Tim Man * Support BTC message signing with ledger accounts (#549) * Support BTC message signing with ledger accounts * Remove console.logs * Change ledger signing modal displaying * Add segwit tx signing functionality * Use `signSimpleBip322Message` method for bip 322 message signing * Update package-lock.json * Update PSBT signing logic for ledger accounts * Add `findLedgerAccountId` util, update usage for `signIncomingSingleSigPSBT` function * Update `isAccountSelected` func logic for external popup account select window * Pass an array of inputs to sign to `signIncomingSingleSigPSBT` func * Move `handleBip322LedgerMessageSigning` func to utils, make some small code fixes * Disable the PSBT signing for BTC ledger accounts * Remove the `@stacks/common` module * Add error warning regarding ledger Bitcoin app version * Update error handling for signature request popup * Update copy and make some small UI tweaks * Update the copy for message signing screen * release: v0.17.0 (#576) * release: v0.17.0 * chore: bump to 1.6.3-rc.1 (#575) * chore: bump to 1.6.3-rc.1 * bump core version --------- Co-authored-by: Yukan * update package-lock --------- Co-authored-by: Yukan * Filter out dead pending transactions (#568) * Filter out dead pending transactions * Get account current nonce from confirmed and pending transactions * Refactor filterng out dead pending transaction logic * Address comments * Update variable name * fix: account select navigation (#578) * Display pending fungible token transactions in token dashboard (#572) * Update filterTx function to show pending fungible transactions * Fix transaction title display * Show pending ordinal transactions (#563) * Show pending ordinal transactions * Slight refactor of getBtcTokenTransferTitle * Fix duplicate tx in groupBtcTxsByDate * chore: bump to xverse-core v1.6.4-rc.2 * Remove unused fallback value --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man * feat: add Xverse namespaced providers (#581) * add Xverse namespaced providers * fix comments * Enable PSBT signing for ledger BTC accounts (#570) * Support BTC message signing with ledger accounts * Remove console.logs * Change ledger signing modal displaying * Add segwit tx signing functionality * Use `signSimpleBip322Message` method for bip 322 message signing * Update package-lock.json * Update PSBT signing logic for ledger accounts * Add `findLedgerAccountId` util, update usage for `signIncomingSingleSigPSBT` function * Update `isAccountSelected` func logic for external popup account select window * Pass an array of inputs to sign to `signIncomingSingleSigPSBT` func * Move `handleBip322LedgerMessageSigning` func to utils, make some small code fixes * Disable the PSBT signing for BTC ledger accounts * Enable PSBT signing for ledger BTC accounts * Remove the `@stacks/common` module * Add error warning regarding ledger Bitcoin app version * Update error handling for signature request popup * Update copy and make some small UI tweaks * Update the copy for message signing screen * Update PSBT signing screen copy * fix: allow display of brc-20 if application/json type (#587) * fix: allow display of brc-20 if application/json type * make bg colours for a BRC-20 coin consistent * fix: full screen and popup styling (#577) * fix: full screen and popup styling * fix screen container * fix app load styling * fix full screen popup pages --------- Co-authored-by: Tim Man * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Add STX support for Ledger accounts (#564) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Fix ledger account import when both BTC and STX options are selected * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Add error handling when user rejects stx address * Add a guard from account changing for the `/add-stx-address-ledger` route * Remove the back button on the ledger account import flow * Throw an error when `stacksCreds` were not fetched * Upgrade `@secretkeylabs/xverse-core` version to `^1.6.5-3bb284c` * Update package files * Fix add stx address error handling * Fix signing with 1st ledger account and bottom modal position * Skip the `No errors` value of the `errorMessage` for STX ledger signature * Remove the caret symbol in `sats-connect` package version * chore: bump xverse-core version 1.7.2 --------- Co-authored-by: Tim Man * fix: brc-20 balance number check (#592) * fix: don't show fees until we have UTXOs on inscription screen (#594) * fix: improve full screen popup styling (#593) * fix: improve full screen popup styling * fix: set height to 600 on options window * Release/v0.18.0 (#591) * release: v0.18.0 * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Use `ticker` field instead of `name` for ft and brc-20 token sending (#595) * update package-lock.json --------- Co-authored-by: Victor Kirov Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Fix Tx history screen reload & send form navigation issues (#584) * Donot show spinner when refetching transaction history data * Fix STX navigation issue * Fix input fields clearance on naviagtion * Update dependency array for useEffect * Add comment * Fix memo error * Support script outputs in psbts (#534) * Support script outputs * Update copy * Revert package.json change * Add info message for output script * Use Array.some * Remove unused style * Update core versio and address comments * Remove pretext from output script ui * Refactor render script output logic * Donot show spinner when refetching transaction history data * Fix STX navigation issue * Fix input fields clearance on naviagtion * chore: turn on eslint for staged files on precommit and turn off no-plusplus rule * Fix eslint issues * Update dependency array for useEffect * Add comment * Fix script count * fix: eslint fix --------- Co-authored-by: Tim Man Co-authored-by: Tim Man * Mismatch when verifying the addresses from the ledger device (#580) * Handle min fee rate returned by the API (#583) * Handle min fee rate returned by the API * Add a check for the STX tx min fee * Fix a couple of tslint errors * fix: don't show loader on balance refetch on home screen ENG-2757 (#589) * Add refetch loader * resize loading spinner * Release/v0.18.2 (#600) * release: v0.18.0 * feat: add inscription confirmation for sats connect (#571) * feat: add inscription confirmation for sats connect * implement inscribing and improve event naming * Added complete inscription screen * Add edit fees * Add HTML and SVG preview functionality * change content to content type and allow more previews * implement error designs on main screen * add error modal * fix: completion page not displaying * fix: styling issues and add inscription developer fees * add custom initial fee rate * fix screen height styling * set app height to 600 again * revert screen container size * improve screen container height * moved feerate get one level up * fix: full screen and popup styling * fix screen container * fix app load styling * Make top address selector sticky. Also fixes it for sign psbt and sign message requests * Update todos * fix full screen popup pages * fix account row styling * add json validaiton * add brc-20 and sats names views * add preview menu and fix styling * add preview markdown * switch to single inscribe event * fix preview of file type text and html * Ensure we only use non ordinal UTXOs for inscriptions * update sats-connect arg names and update the dom event name * fix type name * Show correct fiat currency * Use phosphor-icons * update beta core * fix: fee rate and styling issues * clean up icons * Clean up more icons * Update Core * Update sats connect version * Update sats connect * Use `ticker` field instead of `name` for ft and brc-20 token sending (#595) * update package-lock.json * release v0.18.2 * fix send through app fees when inscribing * update package-lock --------- Co-authored-by: Tim Man Co-authored-by: Victor Kirov Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * feat: 1 step brc 20 transfers (#585) * chore: use xverse-core with brc20 hooks * refactor: make reusable fiat row component from sendForm * feat: update send brc20 form to use 1 step mode * feat: update theme elevations to revamp elevations * fix: ensure brc20 currencies are uppercase * fix: remove margin on reusable component tokenImage * feat: create confirm brc20 transaction screen * chore: add jsx key eslint rule * feat: style the brc20 review screen & fees component * feat: implement edit fees for brc20 transfer * fix: show brc20 ticker and image on confirm screen * fix: styling of account header and other brc20 fixes * feat: remove copy buttons from account header * feat: bottom bar will always maintain height * fix: padding and margins on confirm brc20 screen * feat: create a file for common styles and new screen for execute brc20 * fix: styling, react errors, and estimate fees on click edit fees buttons * fix: edit fees button width * fix: account list padding * feat: implement loading status animation * feat: integrate the animations for loading transaction status * fix: clean up TODOs * feat: use content loader in brc20 edit fees * chore: rename the common styled file * fix: fix reset user flow on confirmBrc20Transaction and unused styles * Revert "feat: bottom bar will always maintain height" This reverts commit 07e9fca564beb0a971c4703aa07893a8a9491e5d. * docs: comment * Update src/app/screens/confirmBrc20Transaction/index.tsx Co-authored-by: Victor Kirov * style: use relative import for consistency * style: remove unused comment * docs: add todo to existing comment * fix: reset user flow to '/' and other review fixes * fix: don't clear input if a disallowed key is pressed * fix: ensure only run executeBrc20Transaction once * refactor: simplify usage of useResetUserFlow * chore: remove unused types * chore: update core version to use new brc20 hook * refactor: use useBrc20EstimateTransfer hook * refactor: save edit fees previous state if user clicks cancel * refactor: separate logic to hook * fix: add hook typings and use phosphor icon * fix: actually pass the user input fee rate to execute transfer * fix: disable cancel and confirm buttons while estimate fee is loading * fix: add padding back in account row list on btc select address screen * fix: colors on options and popup css * fix: button positioning on full screen ledger view * refactor: rename one step brc20 send screen and put TODOs for ledger * revert: restore 2 step brc20 send form for ledger support * fix: apply useResetUserFlow update to sendBrc20 * fix: restore 2 step brc20 translations * fix: update new pages to refactored reset user flow hook --------- Co-authored-by: Victor Kirov * update license (#606) * Add scrollbar on all scrollable screens (#582) * Update scrollbar * Include scrollbar styling in theme file * Show transparent scrollbar in account list screen * Remove disable cycle dependency flag * Revert unrelated eslint fixes * Update src/theme/index.ts Co-authored-by: Tim Man * Update theme file * Add missing hidden scrollbar css --------- Co-authored-by: Tim Man * fix: loader on home page issues (#603) Co-authored-by: Tim Man * Fix scrollbar in landing page (#609) * Fix scrollbar in landing page * Revert "Fix scrollbar in landing page" This reverts commit 46c1a8f45cd4f308c84a15db2e57bc284515bbbe. * fix: add back the global CSS to hide scrollbars by default and add display: block on scrollbars CSS when desired --------- Co-authored-by: Tim Man * feat: notice for an non taproot address when sending brc 20 tokens (#602) * refactor: move fiatRow into separate component * feat: add callout and inputFeedback to send brc20 one step screen and include components in ui-library * feat: add conditional callouts to confirm brc20 screen * feat: update the recipient card on confirm brc20 transaction * fix: input borders should reflect errors only, not info feedback * refactor: include a helper function for checking if error state * refactor: make styles consistent in callout.tsx * fix: remove unused icon variants * fix: fix styling and imports on brc20 one step and callout component * refactor: use recipient card props instead of type from core * fix: update success callout color and add to theme * fix: fix estimate fee error not showing, and vertical align of callout body * refactor: use styled components instead of React.createElement * Revert "refactor: use styled components instead of React.createElement" This reverts commit 31faea642fdcc867b0cec707bf2ff8a5814aab44. * fix: disable key presses for - and . on brc20 edit fees * refactor: use styled icon instead of React.createElement * refactor: use fiatAmountText component and allow styling * fix: use input feedback in editFees and update components to allow styled components * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * Release/v0.20.0 (#611) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Show BRC20 token transaction history (#523) * Show BRC20 token transaction history * Handle pending state * Use updated brc20 transaction history response * Update package.lock.json file * fix loading state * Update brc20 history tx title * Update core version to latest --------- Co-authored-by: Denys Hriaznov <36603049+dhriaznov@users.noreply.github.com> * fix rare sats settings copy (#612) * Release/0.21.0 (#613) * chore: merge from upstream develop (#26) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * chore: allow ci build version to pass env vars to build (#27) * feat/eng 2904 implement frontend on web extension (#5) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file --------- Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * release v0.20.0 (#29) * release: v0.19.0 (#607) * release: v0.19.0 * update package-lock * bump xverse core version to fix fee issue --------- Co-authored-by: Yukan * Build analytics tracking for web-extension (#590) * Build analytics tracking for web-extension * Add `/privacy-preferences` screen * Build analytics tracking for web-extension * Update mixpanel tracking logic * Remove unused wallet action name * Add authorize data collection toggler and popup * Update tracking logic * Add translation keys * Update mixpanel tracking logic * Remove unused imports * Make some code changes after PR review, upgrade `xverse-core` package version * Upgrade `xverse-core` package version * Resolve git conflicts * Handling fees with thresholds (#601) * Handling fees with thresholds * Add margin under the high fees warning * Change the high fees warning position for Ordinals & Brc-20 txs * Show the warning if the initial fee from transaction is greater than the threshold * Add high fee warning for one-step brc20 transfer * update copy --------- Co-authored-by: Yukan * Refactor ledger-related logic (#586) * Add STX support for Ledger accounts * Update the copy and ledger account import logic * Update the ledger account import logic for STX support * Add `/add-stx-address-ledger` route for adding stx account * Remove the old case handling when there is no `ordinalsAddress` * Add STX address verification with ledger device * Remove the `/send-stx-ledger` path and update `/send-stx` to handle ledger * Handle regular STX transactions * Remove unused `/review-ledger-stx-tx` path, add STX NFT handling * Remove `/review-ledger-ft-tx` and `/send-ft-ledger` routes, update `/send-ft` to support ledger * Enable STX auth requests for ledger accounts that have an STX address * Add link to the auth popup to add the STX Ledger account * Update screen UI for STX NFT sending * Update copy for STX incoming tx signing * Update STX message signing logic * Update STX-related logic for ledger accounts * Update error handling for STX message signing with ledger * Get rid of `findLedgerAccountId` ledger util, move more copy to locales * Fix cropped button container for tx signing popup * Update address index definition for adding stx address * Update address index definition for address verification and stx tx confirmation * Update address index definition for stx jwt auth * Refactor ledger-related logic * Refactor ledger account import * Fix ledger account import when both BTC and STX options are selected * Refactor ledger address verification screen * Refactor ledger tx confirmation screen * Refactor Add stx address screen * Fix `unsignedTx` type * Add `StacksRecipient` type and make some small code fixes * Add `icon` prop for the `ActionButton` component * Change the ledger steps in a callback * Add types for ledger tx state objects * Fix account index for stx account import, update ledger tx types and utils * Change the import path for `StacksRecipient` * Change the steps numeration for ledger account import * Get rid of unused step changing logic for ledger account import * Add more error handling * Update xverse-core version for testing purposes * Remove caret symbol in xverse-core package * Fix CI build * Make a couple of code fixes according to PR review comments * Add more transaltions * Add the `DEFAULT_TRANSITION_OPTIONS` constant * Make separate components for Steps and StepControls for the Ledger account import flow * Fix style imports * Upgrade the `xverse-core` package version * Upgrade `xverse-core` package version * Disable PSBT tx signing for ledger accounts * update xverse-core * package-lock --------- Co-authored-by: Yukan * release v0.20.0 * chore: bump to xverse-core 1.8.2 for bip322 signing fix * fix: collectibles dashboard should ignore invalid params errors (#33) * fix: put in a quick fix for more location.state serialization bugs (#34) * chore: add support for rare sats in tx confirmation screen (#35) * chore: add support for rare sats in tx confirmation screen * chore: remove logs and fix typo * chore: change unknown icon --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Tim Man Co-authored-by: fede erbes * chore: tidy up zips of each build run and the release uploads (#31) * feat: collectibles ui frontend (#30) * [ENG-2836] feat: Ordinals and BRC-20 collectibles UI * Improve ordinals & brc-20 collectibles fetching logic and UI * Collectible ordinal detail page (#32) * Tim/eng 2933 implement dashboard display of rare sats bundles (#1) * chore: create a hook for rare sats with placeholder data * chore: add some inscription placeholder with image * feat/eng 2933 implement dashboard rare sats tab (#4) * chore: create a collectiblesTabs component with react-tabs * refactor: move nft dashboard logic into hook * feat: move rare sats into separate tab * fix: add tab state styling and move to common.styled * feat: style collectibles header * fix: restyle all grid item colors and add total items * fix: supply total nfts and total rare sats number and type the collectiblesTabs props * style: comments * feat/eng 2934 implement sats bundle UI screen (#6) * Abdulhaseeb/eng 2930 implement settings screen updates (#7) * feat: enable rare sats from settings * fix: disabled UI * fix: typos * Abdulhaseeb/eng 2931 implement info dialogs (#8) * feat: enable rare sats from settings * feat: notice alert and rarities screen * feat: new feature dialog * fix: styles * feat: add UI for rare sats bundle in collectible item details (#2) * fix: ordinal thumbnails were broken (#10) * Add no collectibles and error screens (#11) * feat: integrate rare sats form core (#9) * feat: add rare sats item detail screen (#3) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen --------- Co-authored-by: Tim Man * feat: implement rare sats send screen (#12) * chore: use getUtxoOrdinalBundle to know if a inscription belongs to a bundle (#14) * Abdulhaseeb/eng 2938 implement rare sats confirm screen (#15) * feat: confirm rare sat tx * feat: added warning callout * feat: implement UI for rare sats thumbnails (#16) * feat: add UI for rare sats bundle in collectible item details * feat: implement rare sats details screen * feat: add rare sats thumbnathumbnails * chore: add missing mock data for testing inscriptions belonging to a bundle * Tim/eng 2959 set up test mocks (#17) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen (#18) * fix: react console errors * fix: send rare sat heading and sub text * fix: eslint errors * chore: add mock test cases in hook * fix: back button sometimes has no history * fix: revert merge change * fix: should be no commoners in mock tests * feat: added thumbnail in confirm screen * fix: ui --------- Co-authored-by: Tim Man * fix: rarities screen UI (#19) * chore: fix some todos and issues in rare sats feature (#20) * chore: Unify assets and rarity label in rarityTile and rareSatIcon components * chore: create bundle asset and use it in RareSatsTabGridItem and confirm send screen * chore: add bundle asset component in send screen * chore: make glow optional and remove it from inscribed rare sats asset * chore: add assets to bundle gallery view * chore: remove unsupported media callout. add margin bottom and fix cannot send rare sat individually for gallery view * fix: styling on gallery view for dashboard and rare sats bundle grids (#22) * fix: styling on gallery view for dashboard and rare sats bundle grids * fix: add column layout for rare sats bundle gallery view * fix: rare sats bundle back should always fo to gallery * fix: header spacing rare sats bundle and load more button * feat: add isLoading state for rare sats tab * fix: remove is owned by active account check the user flow resets whenever account changes, so this check is no longer necessary * feat: save collectibles tab index in query params * fix: restore ledger open in new tab behaviour * fix: show info panel regardless of empty state (#23) * Add ordinal attributes in detail screen * chore: fix UI issues (#24) * chore: fix issues with dont see your rare sat banner * chore: fix ui issues in rare sats details screen * Update src/app/screens/nftDashboard/notice.tsx * refactor: use library components and minor styling fixes * fix: rare sat bundle send button width * fix: add separator in gallery view rare sats bundle and styling fixes * fix: minor style fix --------- Co-authored-by: Tim Man * fix: branch merge errors * chore: remove mock data (#28) * chore: remove mock data * chore: add extenral links to scan tool and rare sats post * chore: move external link urls to constants file * Add scrollbar to ordinal detail screen * Adjust text alignment * Update Navigation Bar * Add Share button in extension ordinal detail screen * Include useInscription hook --------- Co-authored-by: Tim Man Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov * Fix `getNextPageParam` param in the `useAddressInscriptionCollections` hook * feat: inscriptions collection page UI components (#36) * chore: use xverse-core with api functions * feat: add ordinals collection screen and route * chore: add prettier organize imports plugin * chore: remove unused eslint disable line * fix: fix tab query params * feat: add ordinals collection route and screen * fix: revert scrollbar change * Tim/eng 2813 inscriptions collection page data fetching pagination (#37) * Make some small code tweaks * Complete Remaining Todos for Ordinal Detail Screen (#38) * Update ordinal detail Ui accodrding to MVP * Get ordinal details from api * Have placeholder incase market data does not exist * Fix navigation and address comments * feat: collection grid items (#39) * Add content skeleton loader for Collectibles tab * Fix border radius for Collectibles skeleton loader * Fix the loader condition in Collectibles tab * Update BRC20 token collection thumbnail in main collectible page * Tim/eng 2833 inscriptions full screen responsive main page collection (#41) * feat: style the send screen including responsive layout * style: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> --------- Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Display collection market data (#40) * Get collection amrket data * Fix alignment on collection page * chore: revert the large package-lock.json diff * Update receive screen and bottom modal (#42) * Update recieve screen * Add updated QR code in recieve screen * Update receive modal * Fix getNextPageParam for const useAddressInscriptionCollections = () => { * Remove unused package * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix: use theme radius Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * Address comments * chore: remove empty unreferenced component * Remove unused background color * fix: layout and spacing on updated bottom modal, receive nft --------- Co-authored-by: Tim Man Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> * fix color for custom switch and c… --------- Co-authored-by: Yukan Co-authored-by: Den <36603049+dhriaznov@users.noreply.github.com> Co-authored-by: Abdul Haseeb Co-authored-by: fede erbes Co-authored-by: Victor Kirov Co-authored-by: Imamah-Zafar <88320460+Imamah-Zafar@users.noreply.github.com> Co-authored-by: Duska.T <55587184+DuskaT021@users.noreply.github.com> Co-authored-by: Mahmoud Aboelenein Co-authored-by: Kyle Fang Co-authored-by: Denys Hriaznov Co-authored-by: Imamah-Zafar Co-authored-by: Jordan K <65149726+jordankzf@users.noreply.github.com> --- .eslintrc.json | 24 +- package-lock.json | 373 ++++++---- package.json | 7 +- src/app/App.tsx | 8 +- src/app/components/barLoader/index.tsx | 5 +- .../components/bundleAsset/bundleAsset.tsx | 4 +- .../collectibleCollage.tsx} | 16 +- .../collectibleCollectionGridItem/index.tsx} | 61 +- .../collectibleDetailTile/index.tsx | 9 +- .../confirmBtcTransactionComponent/index.tsx | 7 +- .../inputOutputComponent.tsx | 2 +- .../confirmStxTransactionComponent/index.tsx | 5 +- .../optionsDialog/optionsDialog.tsx | 2 +- .../components/recipientAddressView/index.tsx | 4 +- .../components/recipientComponent/index.tsx | 4 +- src/app/components/sendForm/index.tsx | 63 +- src/app/components/tabBar/index.tsx | 2 +- src/app/components/tilesSkeletonLoader.tsx | 2 +- src/app/components/tokenTile/index.tsx | 6 +- src/app/components/topRow/index.tsx | 2 +- .../components/transactionSetting/editFee.tsx | 23 +- .../components/transactionSetting/index.tsx | 6 +- .../ContractCallRequest.tsx | 25 +- src/app/components/transferFeeView/index.tsx | 9 +- .../queries/ordinals/useAddressRareSats.ts | 2 +- .../ordinals/useCollectionMarketData.ts | 2 +- src/app/hooks/queries/useBnsName.ts | 16 +- src/app/hooks/queries/useBtcWalletData.ts | 4 +- src/app/hooks/queries/useCoinRates.ts | 2 +- src/app/hooks/queries/useNftDetail.ts | 28 + .../hooks/queries/useStacksCollectibles.ts | 43 +- src/app/hooks/stores/useNftReducer.ts | 23 - src/app/hooks/stores/useOrdinalReducer.ts | 2 +- src/app/hooks/useDetectOrdinalInSignPsbt.ts | 2 +- src/app/hooks/useResetUserFlow.ts | 19 +- src/app/hooks/useTextOrdinalContent.ts | 2 +- src/app/layouts/sendLayout.tsx | 101 +++ src/app/routes/index.tsx | 18 +- src/app/screens/btcSendScreen/index.tsx | 4 +- src/app/screens/coinDashboard/coinHeader.tsx | 6 +- .../confirmBrc20Transaction/editFees.tsx | 2 +- .../screens/confirmBrc20Transaction/index.tsx | 2 +- .../confirmBrc20Transaction/recipientCard.tsx | 2 +- .../confirmInscriptionRequest/index.tsx | 6 +- .../screens/confirmNftTransaction/index.tsx | 20 +- .../confirmOrdinalTransaction/index.tsx | 11 +- .../screens/confirmStxTransaction/index.tsx | 48 +- .../createInscription/CompleteScreen.tsx | 46 +- src/app/screens/home/index.tsx | 30 +- src/app/screens/nftCollection/index.tsx | 270 +++++++ .../screens/nftCollection/useNftCollection.ts | 44 ++ .../screens/nftDashboard/collectiblesTabs.tsx | 20 +- src/app/screens/nftDashboard/index.tsx | 278 +------- .../nftDashboard/inscriptionsTabGridItem.tsx | 9 +- src/app/screens/nftDashboard/nft.tsx | 96 +-- src/app/screens/nftDashboard/nftImage.tsx | 60 +- .../screens/nftDashboard/nftTabGridItem.tsx | 81 +++ .../screens/nftDashboard/receiveNft/index.tsx | 12 +- .../nftDashboard/tilesSkeletonLoader.tsx | 41 -- .../screens/nftDashboard/useNftDashboard.tsx | 270 +++++++ src/app/screens/nftDetail/index.tsx | 669 +++++++++++------- src/app/screens/nftDetail/nftAttribute.tsx | 16 +- src/app/screens/nftDetail/useNftDetail.ts | 78 ++ src/app/screens/ordinalDetail/index.tsx | 1 - .../screens/ordinalDetail/useOrdinalDetail.ts | 4 +- src/app/screens/ordinalsCollection/index.tsx | 33 +- src/app/screens/rareSatsBundle/index.tsx | 4 +- .../screens/rareSatsDetail/rareSatsDetail.tsx | 9 +- src/app/screens/restoreFunds/index.tsx | 6 - .../screens/restoreFunds/restoreBtc/index.tsx | 208 ------ .../restoreFunds/restoreOrdinals/index.tsx | 5 +- src/app/screens/sendBrc20/index.tsx | 23 +- src/app/screens/sendBtc/index.tsx | 30 +- src/app/screens/sendNft/index.tsx | 321 +++++---- src/app/screens/sendOrdinal/index.tsx | 173 ++--- src/app/screens/settings/index.tsx | 5 +- src/app/screens/signPsbtRequest/index.tsx | 125 ++-- src/app/screens/swap/swapTokenBlock/index.tsx | 15 +- .../screens/swap/useCurrencyConversion.tsx | 14 +- src/app/screens/transactionStatus/index.tsx | 25 +- src/app/stores/index.ts | 11 +- .../stores/nftData/actions/actionCreator.ts | 11 +- src/app/stores/nftData/actions/types.ts | 13 +- src/app/stores/nftData/reducer.ts | 7 - .../stores/wallet/actions/actionCreators.ts | 34 +- src/app/stores/wallet/actions/types.ts | 26 +- src/app/stores/wallet/reducer.ts | 23 +- src/app/ui-library/snackBar.tsx | 75 ++ src/app/utils/nfts.ts | 36 + src/assets/img/nftDashboard/bns.svg | 9 + .../img/nftDashboard/ic_nft_diamond.svg | 3 - src/assets/img/nftDashboard/nft_user.svg | 4 - src/locales/en.json | 14 +- src/react-app-env.d.ts | 1 + 94 files changed, 2492 insertions(+), 1830 deletions(-) rename src/app/components/{bundleAsset/rareSatsCollage.tsx => collectibleCollage/collectibleCollage.tsx} (66%) rename src/app/{screens/ordinalsCollection/ordinalsCollectionGridItem.tsx => components/collectibleCollectionGridItem/index.tsx} (50%) create mode 100644 src/app/hooks/queries/useNftDetail.ts delete mode 100644 src/app/hooks/stores/useNftReducer.ts create mode 100644 src/app/layouts/sendLayout.tsx create mode 100644 src/app/screens/nftCollection/index.tsx create mode 100644 src/app/screens/nftCollection/useNftCollection.ts create mode 100644 src/app/screens/nftDashboard/nftTabGridItem.tsx delete mode 100644 src/app/screens/nftDashboard/tilesSkeletonLoader.tsx create mode 100644 src/app/screens/nftDashboard/useNftDashboard.tsx create mode 100644 src/app/screens/nftDetail/useNftDetail.ts delete mode 100644 src/app/screens/restoreFunds/restoreBtc/index.tsx create mode 100644 src/app/ui-library/snackBar.tsx create mode 100644 src/app/utils/nfts.ts create mode 100644 src/assets/img/nftDashboard/bns.svg delete mode 100644 src/assets/img/nftDashboard/ic_nft_diamond.svg delete mode 100644 src/assets/img/nftDashboard/nft_user.svg diff --git a/.eslintrc.json b/.eslintrc.json index e8b938d9e..5f3531fda 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -20,26 +20,20 @@ "sourceType": "module", "project": "./tsconfig.json" }, - "plugins": [ - "react", - "prettier", - "eslint-plugin-no-inline-styles", - "@tanstack/query" - ], + "plugins": ["react", "prettier", "eslint-plugin-no-inline-styles", "@tanstack/query"], "rules": { "consistent-return": "off", "import/prefer-default-export": 1, "no-restricted-imports": [ "warn", { - "patterns": [ - "@secretkeylabs/xverse-core/**/*" - ] + "patterns": ["@secretkeylabs/xverse-core/**/*"] } ], "no-promise-executor-return": "warn", "max-len": "off", "no-inline-styles/no-inline-styles": 2, + "no-nested-ternary": "off", "no-param-reassign": "off", "react-hooks/exhaustive-deps": "warn", "react/jsx-key": "warn", @@ -61,16 +55,8 @@ "settings": { "import/resolver": { "node": { - "extensions": [ - ".js", - ".jsx", - ".ts", - ".tsx" - ], - "moduleDirectory": [ - "node_modules", - "src/" - ] + "extensions": [".js", ".jsx", ".ts", ".tsx"], + "moduleDirectory": ["node_modules", "src/"] } } } diff --git a/package-lock.json b/package-lock.json index 6d2709260..736fcde5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "xverse-web-extension", - "version": "0.22.1", + "version": "0.23.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "xverse-web-extension", - "version": "0.22.1", + "version": "0.23.0", "dependencies": { "@ledgerhq/hw-transport-webusb": "^6.27.13", "@phosphor-icons/react": "^2.0.10", "@react-spring/web": "^9.6.1", - "@secretkeylabs/xverse-core": "2.3.0", + "@secretkeylabs/xverse-core": "3.0.0", "@stacks/connect": "^6.10.2", "@stacks/encryption": "4.3.5", "@stacks/stacks-blockchain-api-types": "6.1.1", @@ -47,6 +47,7 @@ "react-dom": "^18.2.0", "react-hot-toast": "^2.4.0", "react-i18next": "^11.18.6", + "react-is-visible": "^1.2.0", "react-modal": "^3.15.1", "react-number-format": "^5.0.0", "react-qr-code": "^2.0.8", @@ -61,7 +62,7 @@ "redux": "^4.0.5", "redux-persist": "^6.0.0", "redux-state-sync": "^3.1.4", - "sats-connect": "1.1.1", + "sats-connect": "1.1.2", "stream-browserify": "^3.0.0", "string-to-color": "^2.2.2", "styled-components": "^5.3.5", @@ -3407,9 +3408,9 @@ } }, "node_modules/@secretkeylabs/xverse-core": { - "version": "2.3.0", - "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/2.3.0/024dea2b4f44fb6cc84c7125b8adf381f8f2791d", - "integrity": "sha512-zE/C/e1ri551rVLJTNnJRDfLcXujOtdfTnW6nanIrEAjmNQxXH1DAploudDkRMDnG9JQBHrFnuW9JpeAGR4Y+g==", + "version": "3.0.0", + "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/3.0.0/90bd130bc7b3f9c0739e65d34772d6a550b5818d", + "integrity": "sha512-dtPkHY+VSNf/iwta3cSO2ZsKxdURTM4E+FPCwrotXc85MfxO0MIjyRa4VlOCtHsj8fNS2yH+KHg3uClLK9+WiQ==", "license": "ISC", "dependencies": { "@bitcoinerlab/secp256k1": "^1.0.2", @@ -3625,14 +3626,14 @@ } }, "node_modules/@stacks/auth": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/auth/-/auth-6.7.0.tgz", - "integrity": "sha512-By0KuZlC0UNiD+q74TIPre0todQjsTPLWDOPskR0Rf9WKZMpw0YSaW02mdggJd+/oJjvDDidUxlPlsiKYe8d+w==", - "dependencies": { - "@stacks/common": "^6.5.5", - "@stacks/encryption": "^6.7.0", - "@stacks/network": "^6.5.5", - "@stacks/profile": "^6.7.0", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/auth/-/auth-6.9.0.tgz", + "integrity": "sha512-tBOB+H/96TUNK9pKmr1YQoiIItUFp2ms5RCNYPSjy3/lbIYYJYtw/O2fOS78fVQvCCpuObhhO65AVsrE/IzQeg==", + "dependencies": { + "@stacks/common": "^6.8.1", + "@stacks/encryption": "^6.9.0", + "@stacks/network": "^6.8.1", + "@stacks/profile": "^6.9.0", "cross-fetch": "^3.1.5", "jsontokens": "^4.0.1" } @@ -3663,15 +3664,24 @@ "@scure/base": "~1.1.0" } }, + "node_modules/@stacks/auth/node_modules/@stacks/common": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", + "dependencies": { + "@types/bn.js": "^5.1.0", + "@types/node": "^18.0.4" + } + }, "node_modules/@stacks/auth/node_modules/@stacks/encryption": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.7.0.tgz", - "integrity": "sha512-31eh+Wd14/+4rsD3HGtbpfWl7T30aZHTJsCdK5+XWvl4umJQytNkTMH3nPHoouxfLW0lR9rHPm8gTntblKMQhg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.9.0.tgz", + "integrity": "sha512-hbpZ47eYgw9ZH5ly+GSgvw2Ffsu9L6d++2XIhvYSzL7yxYl4m1+FV5QYdJthJ2AS3vi8cI5otE254HTfCrhKzg==", "dependencies": { "@noble/hashes": "1.1.5", "@noble/secp256k1": "1.7.1", "@scure/bip39": "1.1.0", - "@stacks/common": "^6.5.5", + "@stacks/common": "^6.8.1", "@types/node": "^18.0.4", "base64-js": "^1.5.1", "bs58": "^5.0.0", @@ -3679,10 +3689,19 @@ "varuint-bitcoin": "^1.1.2" } }, + "node_modules/@stacks/auth/node_modules/@stacks/network": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "dependencies": { + "@stacks/common": "^6.8.1", + "cross-fetch": "^3.1.5" + } + }, "node_modules/@stacks/common": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.5.5.tgz", - "integrity": "sha512-6v2AVHTTryvl1Govu5rmBXLywAyen2fU3doMCx/7Lk/tFLc4OjMEx4uf1wzpPx1zw/fwJnvoz74OrT/RSALDYw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", "dependencies": { "@types/bn.js": "^5.1.0", "@types/node": "^18.0.4" @@ -3898,11 +3917,12 @@ } }, "node_modules/@stacks/network": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.5.5.tgz", - "integrity": "sha512-lw7+g6UhOpvWasMeRYMb2OGRKm9ptYkGt27Usg3Eo0z/pu20jZxvHXLBMdDQqxNQOOmwiG4FadICnwTlmnHaqw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "peer": true, "dependencies": { - "@stacks/common": "^6.5.5", + "@stacks/common": "^6.8.1", "cross-fetch": "^3.1.5" } }, @@ -3915,13 +3935,13 @@ } }, "node_modules/@stacks/profile": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/profile/-/profile-6.7.0.tgz", - "integrity": "sha512-jwCpSFMmxL/1K5zWdhQ9/CPWEylW0hnMjGKmQNIUtLJO6+qnmp2Jr+Pc6vm6V5jE+L2wtrumv89TKJisrxg/Kg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/profile/-/profile-6.9.0.tgz", + "integrity": "sha512-sIR60DsAHi8C6zGqKqSe1r2hXTMHgwrJkX3fAaP3de40KeplZ2bkE+0B83yismEeU2baNc+AukyVvWJv0PfP0A==", "dependencies": { - "@stacks/common": "^6.5.5", - "@stacks/network": "^6.5.5", - "@stacks/transactions": "^6.7.0", + "@stacks/common": "^6.8.1", + "@stacks/network": "^6.8.1", + "@stacks/transactions": "^6.9.0", "jsontokens": "^4.0.1", "schema-inspector": "^2.0.2", "zone-file": "^2.0.0-beta.3" @@ -3938,15 +3958,33 @@ } ] }, + "node_modules/@stacks/profile/node_modules/@stacks/common": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", + "dependencies": { + "@types/bn.js": "^5.1.0", + "@types/node": "^18.0.4" + } + }, + "node_modules/@stacks/profile/node_modules/@stacks/network": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "dependencies": { + "@stacks/common": "^6.8.1", + "cross-fetch": "^3.1.5" + } + }, "node_modules/@stacks/profile/node_modules/@stacks/transactions": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/transactions/-/transactions-6.7.0.tgz", - "integrity": "sha512-M/SxSkKk78cTa7hLxq36YcN+NnnSanvKgINfXnQGTL31dzvH3UfQbRzPZHEkjPRRN82E9XC0scu6Kpwq+qVbtA==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/transactions/-/transactions-6.9.0.tgz", + "integrity": "sha512-hSs9+0Ew++GwMZMgPObOx0iVCQRxkiCqI+DHdPEikAmg2utpyLh2/txHOjfSIkQHvcBfJJ6O5KphmxDP4gUqiA==", "dependencies": { "@noble/hashes": "1.1.5", "@noble/secp256k1": "1.7.1", - "@stacks/common": "^6.5.5", - "@stacks/network": "^6.5.5", + "@stacks/common": "^6.8.1", + "@stacks/network": "^6.8.1", "c32check": "^2.0.0", "lodash.clonedeep": "^4.5.0" } @@ -3957,14 +3995,14 @@ "integrity": "sha512-Mw5dBPx3DySPupwaq0iBdm1WdEVXIfhjUVaTjI2iSyzWz4Fgs3U7JCaAezLbgNu7Q69c/ZN4JUDWuo9FVjy7oA==" }, "node_modules/@stacks/storage": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/storage/-/storage-6.7.0.tgz", - "integrity": "sha512-Ega/AudDGWII10WjVM1/6gF4XHvGM022O1Gxau4pRbHXxzq5gKafkqQqRI8/O+rYllBclCZfKOkSNNGaEpgzsQ==", - "dependencies": { - "@stacks/auth": "^6.7.0", - "@stacks/common": "^6.5.5", - "@stacks/encryption": "^6.7.0", - "@stacks/network": "^6.5.5", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/storage/-/storage-6.9.0.tgz", + "integrity": "sha512-aZ3tOnwRSk5cHQh9ButhfHDvAylNVxPRQzeSB8PydHfyib4XL7fSAJwizzEWNgJV4dovqW2Nsy8gm/4rM/oFKQ==", + "dependencies": { + "@stacks/auth": "^6.9.0", + "@stacks/common": "^6.8.1", + "@stacks/encryption": "^6.9.0", + "@stacks/network": "^6.8.1", "base64-js": "^1.5.1", "jsontokens": "^4.0.1" } @@ -3995,15 +4033,24 @@ "@scure/base": "~1.1.0" } }, + "node_modules/@stacks/storage/node_modules/@stacks/common": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", + "dependencies": { + "@types/bn.js": "^5.1.0", + "@types/node": "^18.0.4" + } + }, "node_modules/@stacks/storage/node_modules/@stacks/encryption": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.7.0.tgz", - "integrity": "sha512-31eh+Wd14/+4rsD3HGtbpfWl7T30aZHTJsCdK5+XWvl4umJQytNkTMH3nPHoouxfLW0lR9rHPm8gTntblKMQhg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.9.0.tgz", + "integrity": "sha512-hbpZ47eYgw9ZH5ly+GSgvw2Ffsu9L6d++2XIhvYSzL7yxYl4m1+FV5QYdJthJ2AS3vi8cI5otE254HTfCrhKzg==", "dependencies": { "@noble/hashes": "1.1.5", "@noble/secp256k1": "1.7.1", "@scure/bip39": "1.1.0", - "@stacks/common": "^6.5.5", + "@stacks/common": "^6.8.1", "@types/node": "^18.0.4", "base64-js": "^1.5.1", "bs58": "^5.0.0", @@ -4011,6 +4058,15 @@ "varuint-bitcoin": "^1.1.2" } }, + "node_modules/@stacks/storage/node_modules/@stacks/network": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "dependencies": { + "@stacks/common": "^6.8.1", + "cross-fetch": "^3.1.5" + } + }, "node_modules/@stacks/transactions": { "version": "4.3.8", "resolved": "https://registry.npmjs.org/@stacks/transactions/-/transactions-4.3.8.tgz", @@ -4418,9 +4474,9 @@ } }, "node_modules/@testing-library/dom": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.1.tgz", - "integrity": "sha512-0DGPd9AR3+iDTjGoMpxIkAsUihHZ3Ai6CneU6bRRrffXMgzCdlNk43jTrD2/5LT6CBb3MWTP8v510JzYtahD2w==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", + "integrity": "sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==", "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", @@ -6654,13 +6710,13 @@ "integrity": "sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow==" }, "node_modules/bitcoinjs-lib": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.3.tgz", - "integrity": "sha512-TYXs/Qf+GNk2nnsB9HrXWqzFuEgCg0Gx+v3UW3B8VuceFHXVvhT+7hRnTSvwkX0i8rz2rtujeU6gFaDcFqYFDw==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.5.tgz", + "integrity": "sha512-yuf6xs9QX/E8LWE2aMJPNd0IxGofwfuVOiYdNUESkc+2bHHVKjhJd8qewqapeoolh9fihzHGoDCB5Vkr57RZCQ==", "dependencies": { "@noble/hashes": "^1.2.0", "bech32": "^2.0.0", - "bip174": "^2.1.0", + "bip174": "^2.1.1", "bs58check": "^3.0.1", "typeforce": "^1.11.3", "varuint-bitcoin": "^1.1.2" @@ -15691,6 +15747,19 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "peer": true }, + "node_modules/react-is-visible": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-is-visible/-/react-is-visible-1.2.0.tgz", + "integrity": "sha512-052RH7aHdKrABOBH12wvS2zTAzJ8MnaswPvX2AQGq5wxvD8BnQ5vcnf0cA0cj2g4bjH0+qXz1AIkEL9ZlnN23A==", + "dependencies": { + "@babel/runtime": "^7.12.5", + "hoist-non-react-statics": "3.3.2" + }, + "peerDependencies": { + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", @@ -16340,9 +16409,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sats-connect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/sats-connect/-/sats-connect-1.1.1.tgz", - "integrity": "sha512-cckwlFc0gnYNZsNUsH9xACcpIeD+XdbSvtYhkGZSRqNeqzbqgdVI50mD4mzxs1ILbUGLjdTCINohVP6WbbvhcA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sats-connect/-/sats-connect-1.1.2.tgz", + "integrity": "sha512-nJmCV69WgMNGH9H2cTTH/HsO9wEYS7g0AvnCNNgY5fezEJmA6jNpRMP4Xidv/c0xWL1uGOUHPLJEEOSG4NoneQ==", "dependencies": { "jsontokens": "^4.0.1", "process": "^0.11.10", @@ -16370,9 +16439,9 @@ } }, "node_modules/schema-inspector": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/schema-inspector/-/schema-inspector-2.0.3.tgz", - "integrity": "sha512-Q9mpYxrP3w6CpHRfnh3QLOE1urkGTLvnl7xgVH7fsu0HYJUZenUASUr4j/pf7bAxShh+4R3Ta8ZgVKak1b2wyA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/schema-inspector/-/schema-inspector-2.1.0.tgz", + "integrity": "sha512-3bmQVhbA01/EW8cZin4vIpqlpNU2SIy4BhKCfCgogJ3T/L76dLx3QAE+++4o+dNT33sa+SN9vOJL7iHiHFjiNg==", "dependencies": { "async": "~2.6.3" } @@ -21432,9 +21501,9 @@ } }, "@secretkeylabs/xverse-core": { - "version": "2.3.0", - "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/2.3.0/024dea2b4f44fb6cc84c7125b8adf381f8f2791d", - "integrity": "sha512-zE/C/e1ri551rVLJTNnJRDfLcXujOtdfTnW6nanIrEAjmNQxXH1DAploudDkRMDnG9JQBHrFnuW9JpeAGR4Y+g==", + "version": "3.0.0", + "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/3.0.0/90bd130bc7b3f9c0739e65d34772d6a550b5818d", + "integrity": "sha512-dtPkHY+VSNf/iwta3cSO2ZsKxdURTM4E+FPCwrotXc85MfxO0MIjyRa4VlOCtHsj8fNS2yH+KHg3uClLK9+WiQ==", "requires": { "@bitcoinerlab/secp256k1": "^1.0.2", "@noble/secp256k1": "^1.7.1", @@ -21626,14 +21695,14 @@ } }, "@stacks/auth": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/auth/-/auth-6.7.0.tgz", - "integrity": "sha512-By0KuZlC0UNiD+q74TIPre0todQjsTPLWDOPskR0Rf9WKZMpw0YSaW02mdggJd+/oJjvDDidUxlPlsiKYe8d+w==", - "requires": { - "@stacks/common": "^6.5.5", - "@stacks/encryption": "^6.7.0", - "@stacks/network": "^6.5.5", - "@stacks/profile": "^6.7.0", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/auth/-/auth-6.9.0.tgz", + "integrity": "sha512-tBOB+H/96TUNK9pKmr1YQoiIItUFp2ms5RCNYPSjy3/lbIYYJYtw/O2fOS78fVQvCCpuObhhO65AVsrE/IzQeg==", + "requires": { + "@stacks/common": "^6.8.1", + "@stacks/encryption": "^6.9.0", + "@stacks/network": "^6.8.1", + "@stacks/profile": "^6.9.0", "cross-fetch": "^3.1.5", "jsontokens": "^4.0.1" }, @@ -21652,28 +21721,46 @@ "@scure/base": "~1.1.0" } }, + "@stacks/common": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", + "requires": { + "@types/bn.js": "^5.1.0", + "@types/node": "^18.0.4" + } + }, "@stacks/encryption": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.7.0.tgz", - "integrity": "sha512-31eh+Wd14/+4rsD3HGtbpfWl7T30aZHTJsCdK5+XWvl4umJQytNkTMH3nPHoouxfLW0lR9rHPm8gTntblKMQhg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.9.0.tgz", + "integrity": "sha512-hbpZ47eYgw9ZH5ly+GSgvw2Ffsu9L6d++2XIhvYSzL7yxYl4m1+FV5QYdJthJ2AS3vi8cI5otE254HTfCrhKzg==", "requires": { "@noble/hashes": "1.1.5", "@noble/secp256k1": "1.7.1", "@scure/bip39": "1.1.0", - "@stacks/common": "^6.5.5", + "@stacks/common": "^6.8.1", "@types/node": "^18.0.4", "base64-js": "^1.5.1", "bs58": "^5.0.0", "ripemd160-min": "^0.0.6", "varuint-bitcoin": "^1.1.2" } + }, + "@stacks/network": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "requires": { + "@stacks/common": "^6.8.1", + "cross-fetch": "^3.1.5" + } } } }, "@stacks/common": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.5.5.tgz", - "integrity": "sha512-6v2AVHTTryvl1Govu5rmBXLywAyen2fU3doMCx/7Lk/tFLc4OjMEx4uf1wzpPx1zw/fwJnvoz74OrT/RSALDYw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", "requires": { "@types/bn.js": "^5.1.0", "@types/node": "^18.0.4" @@ -21882,11 +21969,12 @@ } }, "@stacks/network": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.5.5.tgz", - "integrity": "sha512-lw7+g6UhOpvWasMeRYMb2OGRKm9ptYkGt27Usg3Eo0z/pu20jZxvHXLBMdDQqxNQOOmwiG4FadICnwTlmnHaqw==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "peer": true, "requires": { - "@stacks/common": "^6.5.5", + "@stacks/common": "^6.8.1", "cross-fetch": "^3.1.5" } }, @@ -21899,13 +21987,13 @@ } }, "@stacks/profile": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/profile/-/profile-6.7.0.tgz", - "integrity": "sha512-jwCpSFMmxL/1K5zWdhQ9/CPWEylW0hnMjGKmQNIUtLJO6+qnmp2Jr+Pc6vm6V5jE+L2wtrumv89TKJisrxg/Kg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/profile/-/profile-6.9.0.tgz", + "integrity": "sha512-sIR60DsAHi8C6zGqKqSe1r2hXTMHgwrJkX3fAaP3de40KeplZ2bkE+0B83yismEeU2baNc+AukyVvWJv0PfP0A==", "requires": { - "@stacks/common": "^6.5.5", - "@stacks/network": "^6.5.5", - "@stacks/transactions": "^6.7.0", + "@stacks/common": "^6.8.1", + "@stacks/network": "^6.8.1", + "@stacks/transactions": "^6.9.0", "jsontokens": "^4.0.1", "schema-inspector": "^2.0.2", "zone-file": "^2.0.0-beta.3" @@ -21916,15 +22004,33 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.1.5.tgz", "integrity": "sha512-LTMZiiLc+V4v1Yi16TD6aX2gmtKszNye0pQgbaLqkvhIqP7nVsSaJsWloGQjJfJ8offaoP5GtX3yY5swbcJxxQ==" }, + "@stacks/common": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", + "requires": { + "@types/bn.js": "^5.1.0", + "@types/node": "^18.0.4" + } + }, + "@stacks/network": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "requires": { + "@stacks/common": "^6.8.1", + "cross-fetch": "^3.1.5" + } + }, "@stacks/transactions": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/transactions/-/transactions-6.7.0.tgz", - "integrity": "sha512-M/SxSkKk78cTa7hLxq36YcN+NnnSanvKgINfXnQGTL31dzvH3UfQbRzPZHEkjPRRN82E9XC0scu6Kpwq+qVbtA==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/transactions/-/transactions-6.9.0.tgz", + "integrity": "sha512-hSs9+0Ew++GwMZMgPObOx0iVCQRxkiCqI+DHdPEikAmg2utpyLh2/txHOjfSIkQHvcBfJJ6O5KphmxDP4gUqiA==", "requires": { "@noble/hashes": "1.1.5", "@noble/secp256k1": "1.7.1", - "@stacks/common": "^6.5.5", - "@stacks/network": "^6.5.5", + "@stacks/common": "^6.8.1", + "@stacks/network": "^6.8.1", "c32check": "^2.0.0", "lodash.clonedeep": "^4.5.0" } @@ -21937,14 +22043,14 @@ "integrity": "sha512-Mw5dBPx3DySPupwaq0iBdm1WdEVXIfhjUVaTjI2iSyzWz4Fgs3U7JCaAezLbgNu7Q69c/ZN4JUDWuo9FVjy7oA==" }, "@stacks/storage": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/storage/-/storage-6.7.0.tgz", - "integrity": "sha512-Ega/AudDGWII10WjVM1/6gF4XHvGM022O1Gxau4pRbHXxzq5gKafkqQqRI8/O+rYllBclCZfKOkSNNGaEpgzsQ==", - "requires": { - "@stacks/auth": "^6.7.0", - "@stacks/common": "^6.5.5", - "@stacks/encryption": "^6.7.0", - "@stacks/network": "^6.5.5", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/storage/-/storage-6.9.0.tgz", + "integrity": "sha512-aZ3tOnwRSk5cHQh9ButhfHDvAylNVxPRQzeSB8PydHfyib4XL7fSAJwizzEWNgJV4dovqW2Nsy8gm/4rM/oFKQ==", + "requires": { + "@stacks/auth": "^6.9.0", + "@stacks/common": "^6.8.1", + "@stacks/encryption": "^6.9.0", + "@stacks/network": "^6.8.1", "base64-js": "^1.5.1", "jsontokens": "^4.0.1" }, @@ -21963,21 +22069,39 @@ "@scure/base": "~1.1.0" } }, + "@stacks/common": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/common/-/common-6.8.1.tgz", + "integrity": "sha512-ewL9GLZNQYa5a/3K4xSHlHIgHkD4rwWW/QEaPId8zQIaL+1O9qCaF4LX9orNQeOmEk8kvG0x2xGV54fXKCZeWQ==", + "requires": { + "@types/bn.js": "^5.1.0", + "@types/node": "^18.0.4" + } + }, "@stacks/encryption": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.7.0.tgz", - "integrity": "sha512-31eh+Wd14/+4rsD3HGtbpfWl7T30aZHTJsCdK5+XWvl4umJQytNkTMH3nPHoouxfLW0lR9rHPm8gTntblKMQhg==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/@stacks/encryption/-/encryption-6.9.0.tgz", + "integrity": "sha512-hbpZ47eYgw9ZH5ly+GSgvw2Ffsu9L6d++2XIhvYSzL7yxYl4m1+FV5QYdJthJ2AS3vi8cI5otE254HTfCrhKzg==", "requires": { "@noble/hashes": "1.1.5", "@noble/secp256k1": "1.7.1", "@scure/bip39": "1.1.0", - "@stacks/common": "^6.5.5", + "@stacks/common": "^6.8.1", "@types/node": "^18.0.4", "base64-js": "^1.5.1", "bs58": "^5.0.0", "ripemd160-min": "^0.0.6", "varuint-bitcoin": "^1.1.2" } + }, + "@stacks/network": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@stacks/network/-/network-6.8.1.tgz", + "integrity": "sha512-n8M25pPbLqpSBctabtsLOTBlmPvm9EPQpTI//x7HLdt5lEjDXxauEQt0XGSvDUZwecrmztqt9xNxlciiGApRBw==", + "requires": { + "@stacks/common": "^6.8.1", + "cross-fetch": "^3.1.5" + } } } }, @@ -22312,9 +22436,9 @@ } }, "@testing-library/dom": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.1.tgz", - "integrity": "sha512-0DGPd9AR3+iDTjGoMpxIkAsUihHZ3Ai6CneU6bRRrffXMgzCdlNk43jTrD2/5LT6CBb3MWTP8v510JzYtahD2w==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-9.3.3.tgz", + "integrity": "sha512-fB0R+fa3AUqbLHWyxXa2kGVtf1Fe1ZZFr0Zp6AIbIAzXb2mKbEXl+PCQNUOaq5lbTab5tfctfXRNsWXxa2f7Aw==", "peer": true, "requires": { "@babel/code-frame": "^7.10.4", @@ -24109,13 +24233,13 @@ "integrity": "sha512-pef6gxZFztEhaE9RY9HmWVmiIHqCb2OyS4HPKkpc6CIiiOa3Qmuoylxc5P2EkU3w+5eTSifI9SEZC88idAIGow==" }, "bitcoinjs-lib": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.3.tgz", - "integrity": "sha512-TYXs/Qf+GNk2nnsB9HrXWqzFuEgCg0Gx+v3UW3B8VuceFHXVvhT+7hRnTSvwkX0i8rz2rtujeU6gFaDcFqYFDw==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/bitcoinjs-lib/-/bitcoinjs-lib-6.1.5.tgz", + "integrity": "sha512-yuf6xs9QX/E8LWE2aMJPNd0IxGofwfuVOiYdNUESkc+2bHHVKjhJd8qewqapeoolh9fihzHGoDCB5Vkr57RZCQ==", "requires": { "@noble/hashes": "^1.2.0", "bech32": "^2.0.0", - "bip174": "^2.1.0", + "bip174": "^2.1.1", "bs58check": "^3.0.1", "typeforce": "^1.11.3", "varuint-bitcoin": "^1.1.2" @@ -30888,6 +31012,15 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "peer": true }, + "react-is-visible": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/react-is-visible/-/react-is-visible-1.2.0.tgz", + "integrity": "sha512-052RH7aHdKrABOBH12wvS2zTAzJ8MnaswPvX2AQGq5wxvD8BnQ5vcnf0cA0cj2g4bjH0+qXz1AIkEL9ZlnN23A==", + "requires": { + "@babel/runtime": "^7.12.5", + "hoist-non-react-statics": "3.3.2" + } + }, "react-lifecycles-compat": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz", @@ -31348,9 +31481,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sats-connect": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/sats-connect/-/sats-connect-1.1.1.tgz", - "integrity": "sha512-cckwlFc0gnYNZsNUsH9xACcpIeD+XdbSvtYhkGZSRqNeqzbqgdVI50mD4mzxs1ILbUGLjdTCINohVP6WbbvhcA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sats-connect/-/sats-connect-1.1.2.tgz", + "integrity": "sha512-nJmCV69WgMNGH9H2cTTH/HsO9wEYS7g0AvnCNNgY5fezEJmA6jNpRMP4Xidv/c0xWL1uGOUHPLJEEOSG4NoneQ==", "requires": { "jsontokens": "^4.0.1", "process": "^0.11.10", @@ -31375,9 +31508,9 @@ } }, "schema-inspector": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/schema-inspector/-/schema-inspector-2.0.3.tgz", - "integrity": "sha512-Q9mpYxrP3w6CpHRfnh3QLOE1urkGTLvnl7xgVH7fsu0HYJUZenUASUr4j/pf7bAxShh+4R3Ta8ZgVKak1b2wyA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/schema-inspector/-/schema-inspector-2.1.0.tgz", + "integrity": "sha512-3bmQVhbA01/EW8cZin4vIpqlpNU2SIy4BhKCfCgogJ3T/L76dLx3QAE+++4o+dNT33sa+SN9vOJL7iHiHFjiNg==", "requires": { "async": "~2.6.3" } diff --git a/package.json b/package.json index 1afd69db9..8dcc16c02 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xverse-web-extension", "description": "A Bitcoin wallet for Web3", - "version": "0.22.1", + "version": "0.23.0", "private": true, "engines": { "node": "^18.18.2" @@ -10,7 +10,7 @@ "@ledgerhq/hw-transport-webusb": "^6.27.13", "@phosphor-icons/react": "^2.0.10", "@react-spring/web": "^9.6.1", - "@secretkeylabs/xverse-core": "2.3.0", + "@secretkeylabs/xverse-core": "3.0.0", "@stacks/connect": "^6.10.2", "@stacks/encryption": "4.3.5", "@stacks/stacks-blockchain-api-types": "6.1.1", @@ -46,6 +46,7 @@ "react-dom": "^18.2.0", "react-hot-toast": "^2.4.0", "react-i18next": "^11.18.6", + "react-is-visible": "^1.2.0", "react-modal": "^3.15.1", "react-number-format": "^5.0.0", "react-qr-code": "^2.0.8", @@ -60,7 +61,7 @@ "redux": "^4.0.5", "redux-persist": "^6.0.0", "redux-state-sync": "^3.1.4", - "sats-connect": "1.1.1", + "sats-connect": "1.1.2", "stream-browserify": "^3.0.0", "string-to-color": "^2.2.2", "styled-components": "^5.3.5", diff --git a/src/app/App.tsx b/src/app/App.tsx index 215a33c1b..73c0f2138 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -2,16 +2,16 @@ import LoadingScreen from '@components/loadingScreen'; import rootStore from '@stores/index'; import { QueryClientProvider } from '@tanstack/react-query'; import { ReactQueryDevtools } from '@tanstack/react-query-devtools'; +import { MIX_PANEL_TOKEN } from '@utils/constants'; import { queryClient } from '@utils/query'; +import mixpanel from 'mixpanel-browser'; +import { useEffect } from 'react'; import { Toaster } from 'react-hot-toast'; import { Provider } from 'react-redux'; import { RouterProvider } from 'react-router-dom'; import { PersistGate } from 'redux-persist/integration/react'; import { ThemeProvider } from 'styled-components'; import '../locales'; -import { useEffect } from 'react'; -import mixpanel from 'mixpanel-browser'; -import { MIX_PANEL_TOKEN } from '@utils/constants'; import Theme from '../theme'; import GlobalStyle from '../theme/global'; import SessionGuard from './components/guards/session'; @@ -40,7 +40,7 @@ function App(): JSX.Element { - + diff --git a/src/app/components/barLoader/index.tsx b/src/app/components/barLoader/index.tsx index 5c53d37da..428a9cc76 100644 --- a/src/app/components/barLoader/index.tsx +++ b/src/app/components/barLoader/index.tsx @@ -77,8 +77,8 @@ export function BetterBarLoader({ height, className, }: { - width: number; - height: number; + width: number | string; + height: number | string; className?: string; }) { return ( @@ -88,7 +88,6 @@ export function BetterBarLoader({ interval={0.1} width={width} height={height} - viewBox={`0 0 ${width} ${height}`} backgroundColor={Theme.colors.elevation3} foregroundColor={Theme.colors.grey} className={className} diff --git a/src/app/components/bundleAsset/bundleAsset.tsx b/src/app/components/bundleAsset/bundleAsset.tsx index 4ab31b673..284534cba 100644 --- a/src/app/components/bundleAsset/bundleAsset.tsx +++ b/src/app/components/bundleAsset/bundleAsset.tsx @@ -2,7 +2,7 @@ import RareSatAsset from '@components/rareSatAsset/rareSatAsset'; import { Bundle } from '@utils/rareSats'; import styled from 'styled-components'; -import RareSatsCollage from './rareSatsCollage'; +import CollectibleCollage from '../collectibleCollage/collectibleCollage'; const ImageContainer = styled.div` display: flex; @@ -29,7 +29,7 @@ function BundleAsset({ bundle }: Props) { return ( {isMoreThanOneItem ? ( - + ) : ( diff --git a/src/app/components/bundleAsset/rareSatsCollage.tsx b/src/app/components/collectibleCollage/collectibleCollage.tsx similarity index 66% rename from src/app/components/bundleAsset/rareSatsCollage.tsx rename to src/app/components/collectibleCollage/collectibleCollage.tsx index b5d0a7466..e15ee56c5 100644 --- a/src/app/components/bundleAsset/rareSatsCollage.tsx +++ b/src/app/components/collectibleCollage/collectibleCollage.tsx @@ -1,4 +1,6 @@ import RareSatAsset from '@components/rareSatAsset/rareSatAsset'; +import Nft from '@screens/nftDashboard/nft'; +import { NonFungibleToken } from '@secretkeylabs/xverse-core'; import { BundleItem } from '@utils/rareSats'; import styled from 'styled-components'; @@ -31,15 +33,16 @@ const RemainingAmountOfAssets = styled.div((props) => ({ borderRadius: props.theme.radius(1), background: props.theme.colors.elevation1, p: { - ...props.theme.body_medium_m, - fontSize: 'calc(2vw + 2vh)', + ...props.theme.typography.body_medium_m, + fontSize: 'calc((2vw + 2vh)* 0.8)', color: props.theme.colors.white_0, }, })); -function RareSatsCollage({ items }: { items: Array }) { +function CollectibleCollage({ items }: { items: Array }) { const moreThanFourItems = items.length > 4; + const isBundleItem = (item: any): boolean => (item as BundleItem).rarity_ranking !== undefined; return ( {items.slice(0, 4).map((item, index) => ( @@ -49,8 +52,11 @@ function RareSatsCollage({ items }: { items: Array }) {

+{items.length - 4}

+ ) : // Conditionally render RareSatAsset if item is a BundleItem otherwise render Nft + isBundleItem(item) ? ( + ) : ( - + )} ))} @@ -58,4 +64,4 @@ function RareSatsCollage({ items }: { items: Array }) { ); } -export default RareSatsCollage; +export default CollectibleCollage; diff --git a/src/app/screens/ordinalsCollection/ordinalsCollectionGridItem.tsx b/src/app/components/collectibleCollectionGridItem/index.tsx similarity index 50% rename from src/app/screens/ordinalsCollection/ordinalsCollectionGridItem.tsx rename to src/app/components/collectibleCollectionGridItem/index.tsx index 933c6d92a..d11c4be81 100644 --- a/src/app/screens/ordinalsCollection/ordinalsCollectionGridItem.tsx +++ b/src/app/components/collectibleCollectionGridItem/index.tsx @@ -1,14 +1,7 @@ -import useOrdinalDataReducer from '@hooks/stores/useOrdinalReducer'; -import OrdinalImage from '@screens/ordinals/ordinalImage'; -import type { Inscription } from '@secretkeylabs/xverse-core'; import { StyledP } from '@ui-library/common.styled'; -import { - getInscriptionsCollectionGridItemId, - getInscriptionsCollectionGridItemSubText, - getInscriptionsCollectionGridItemSubTextColor, -} from '@utils/inscriptions'; -import { useNavigate } from 'react-router-dom'; +import { ReactNode } from 'react'; import styled from 'styled-components'; +import { Color } from 'theme'; const InfoContainer = styled.div` display: flex; @@ -22,6 +15,7 @@ const StyledItemId = styled(StyledP)` text-wrap: nowrap; overflow: hidden; width: 100%; + text-overflow: ellipsis; `; const StyledItemSub = styled(StyledP)` @@ -49,35 +43,46 @@ const GridItemContainer = styled.button` flex-direction: column; background: transparent; gap: ${(props) => props.theme.space.s}; + cursor: ${(props) => (props.onClick ? 'pointer' : 'initial')}; + width: 100%; `; -export function OrdinalsCollectionGridItem({ item }: { item: Inscription }) { - const navigate = useNavigate(); - const { setSelectedOrdinalDetails } = useOrdinalDataReducer(); - - const handleOnClick = () => { - setSelectedOrdinalDetails(item); - navigate(`/nft-dashboard/ordinal-detail/${item.id}`); - }; - - const itemId = getInscriptionsCollectionGridItemId(item); - const itemSubText = getInscriptionsCollectionGridItemSubText(item); - const itemSubTextColor = getInscriptionsCollectionGridItemSubTextColor(item); +interface Props { + item: any; + itemId: string; + itemSubText?: string; + itemSubTextColor?: Color; + children: ReactNode; + onClick?: (collectible: any) => void; +} +export function CollectibleCollectionGridItem({ + item, + itemId, + itemSubText, + itemSubTextColor, + children, + onClick, +}: Props) { + const handleOnClick = onClick + ? () => { + onClick(item); + } + : undefined; return ( - - - + {children} {itemId} - - {itemSubText} - + {itemSubText && ( + + {itemSubText} + + )} ); } -export default OrdinalsCollectionGridItem; +export default CollectibleCollectionGridItem; diff --git a/src/app/components/collectibleDetailTile/index.tsx b/src/app/components/collectibleDetailTile/index.tsx index 7ef735d22..88058a8dd 100644 --- a/src/app/components/collectibleDetailTile/index.tsx +++ b/src/app/components/collectibleDetailTile/index.tsx @@ -7,17 +7,17 @@ interface DetailSectionProps { isGallery: boolean; } const DescriptionHeadingText = styled.p((props) => ({ - ...props.theme.body_medium_m, - color: props.theme.colors.white['400'], + ...props.theme.typography.body_medium_m, + color: props.theme.colors.white_400, marginBottom: props.theme.spacing(2), whiteSpace: 'nowrap', textAlign: props.isGallery ? 'right' : 'left', })); const DescriptionValueText = styled.p((props) => ({ - ...props.theme.body_medium_m, + ...props.theme.typography.body_medium_m, wordWrap: 'break-word', - color: props.theme.colors.white['0'], + color: props.theme.colors.white_0, textAlign: !props.isGallery ? 'left' : 'right', maxWidth: 375, })); @@ -30,6 +30,7 @@ const Container = styled.div((props) => ({ display: 'flex', flexDirection: props.isColumnAlignment ? 'column' : 'row', width: '100%', + flex: 1, justifyContent: 'space-between', })); diff --git a/src/app/components/confirmBtcTransactionComponent/index.tsx b/src/app/components/confirmBtcTransactionComponent/index.tsx index 551364017..a39114420 100644 --- a/src/app/components/confirmBtcTransactionComponent/index.tsx +++ b/src/app/components/confirmBtcTransactionComponent/index.tsx @@ -10,7 +10,6 @@ import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress'; import useSeedVault from '@hooks/useSeedVault'; import useWalletSelector from '@hooks/useWalletSelector'; import { - BtcUtxoDataResponse, ErrorCodes, getBtcFiatEquivalent, ResponseError, @@ -130,7 +129,7 @@ interface Props { assetDetail?: string; assetDetailValue?: string; isRestoreFundFlow?: boolean; - nonOrdinalUtxos?: BtcUtxoDataResponse[]; + nonOrdinalUtxos?: UTXO[]; isBtcSendBrowserTx?: boolean; currencyType?: CurrencyTypes; isPartOfBundle?: boolean; @@ -318,7 +317,7 @@ function ConfirmBtcTransactionComponent({ const newFee = new BigNumber(modifiedFee); setCurrentFee(newFee); const seed = await getSeed(); - setCurrentFeeRate(new BigNumber(feeRate ?? '')); + setCurrentFeeRate(new BigNumber(feeRate!)); if (ordinalTxUtxo) ordinalMutate({ txFee: modifiedFee, seedPhrase: seed }); else if (isRestoreFundFlow) { mutateSignNonOrdinalBtcTransaction({ txFee: modifiedFee, seedPhrase: seed }); @@ -439,7 +438,7 @@ function ConfirmBtcTransactionComponent({ )} diff --git a/src/app/components/confirmBtcTransactionComponent/inputOutputComponent.tsx b/src/app/components/confirmBtcTransactionComponent/inputOutputComponent.tsx index d120ccba0..1703f7d00 100644 --- a/src/app/components/confirmBtcTransactionComponent/inputOutputComponent.tsx +++ b/src/app/components/confirmBtcTransactionComponent/inputOutputComponent.tsx @@ -97,7 +97,7 @@ const Button = styled.button((props) => ({ interface Props { address: string[]; - parsedPsbt: ParsedPSBT; + parsedPsbt: ParsedPSBT | undefined; isExpanded: boolean; onArrowClick: () => void; } diff --git a/src/app/components/confirmStxTransactionComponent/index.tsx b/src/app/components/confirmStxTransactionComponent/index.tsx index 67b4498bc..d5937ee86 100644 --- a/src/app/components/confirmStxTransactionComponent/index.tsx +++ b/src/app/components/confirmStxTransactionComponent/index.tsx @@ -12,16 +12,17 @@ import useNetworkSelector from '@hooks/useNetwork'; import useSeedVault from '@hooks/useSeedVault'; import useWalletSelector from '@hooks/useWalletSelector'; import Transport from '@ledgerhq/hw-transport-webusb'; +import type { StacksTransaction } from '@secretkeylabs/xverse-core'; import { getNonce, + microstacksToStx, setFee, setNonce, signLedgerStxTransaction, signMultiStxTransactions, signTransaction, + stxToMicrostacks, } from '@secretkeylabs/xverse-core'; -import { microstacksToStx, stxToMicrostacks } from '@secretkeylabs/xverse-core/currency'; -import { StacksTransaction } from '@secretkeylabs/xverse-core/types'; import { isHardwareAccount } from '@utils/helper'; import BigNumber from 'bignumber.js'; import { ReactNode, useEffect, useState } from 'react'; diff --git a/src/app/components/optionsDialog/optionsDialog.tsx b/src/app/components/optionsDialog/optionsDialog.tsx index 084d8cbf9..fd151bfdf 100644 --- a/src/app/components/optionsDialog/optionsDialog.tsx +++ b/src/app/components/optionsDialog/optionsDialog.tsx @@ -23,7 +23,7 @@ const OuterContainer = styled.div({ left: 0, right: 0, backgroundColor: 'transparent', - zIndex: 1, + zIndex: 2, }); interface Props { diff --git a/src/app/components/recipientAddressView/index.tsx b/src/app/components/recipientAddressView/index.tsx index cdc3d5d75..54e71e372 100644 --- a/src/app/components/recipientAddressView/index.tsx +++ b/src/app/components/recipientAddressView/index.tsx @@ -1,6 +1,5 @@ import ArrowSquareOut from '@assets/img/arrow_square_out.svg'; import { useBnsName } from '@hooks/queries/useBnsName'; -import useNetworkSelector from '@hooks/useNetwork'; import { getExplorerUrl } from '@utils/helper'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; @@ -56,9 +55,8 @@ interface Props { recipient: string; } function RecipientAddressView({ recipient }: Props) { - const selectedNetwork = useNetworkSelector(); const { t } = useTranslation('translation', { keyPrefix: 'CONFIRM_TRANSACTION' }); - const bnsName = useBnsName(recipient, selectedNetwork); + const bnsName = useBnsName(recipient); const handleOnPress = () => { window.open(getExplorerUrl(recipient)); }; diff --git a/src/app/components/recipientComponent/index.tsx b/src/app/components/recipientComponent/index.tsx index 222bf0d8b..62b88cb2c 100644 --- a/src/app/components/recipientComponent/index.tsx +++ b/src/app/components/recipientComponent/index.tsx @@ -146,8 +146,8 @@ function RecipientComponent({ amountInCurrency = getFiatEquivalent( Number(value), currencyType, - stxBtcRate, - btcFiatRate, + BigNumber(stxBtcRate), + BigNumber(btcFiatRate), fungibleToken, ); } diff --git a/src/app/components/sendForm/index.tsx b/src/app/components/sendForm/index.tsx index 38e4e060d..c10231387 100644 --- a/src/app/components/sendForm/index.tsx +++ b/src/app/components/sendForm/index.tsx @@ -1,13 +1,15 @@ import ActionButton from '@components/button'; import InfoContainer from '@components/infoContainer'; import TokenImage from '@components/tokenImage'; -import { useBnsName, useBNSResolver } from '@hooks/queries/useBnsName'; +import { useBnsName, useBnsResolver } from '@hooks/queries/useBnsName'; import useDebounce from '@hooks/useDebounce'; -import useNetworkSelector from '@hooks/useNetwork'; import useWalletSelector from '@hooks/useWalletSelector'; -import { getBtcEquivalent, getStxTokenEquivalent } from '@secretkeylabs/xverse-core'; -import { getFiatEquivalent } from '@secretkeylabs/xverse-core/transactions'; -import { FungibleToken } from '@secretkeylabs/xverse-core/types'; +import { + FungibleToken, + getBtcEquivalent, + getFiatEquivalent, + getStxTokenEquivalent, +} from '@secretkeylabs/xverse-core'; import InputFeedback from '@ui-library/inputFeedback'; import { CurrencyTypes } from '@utils/constants'; import { getCurrencyFlag } from '@utils/currency'; @@ -64,45 +66,45 @@ const MemoContainer = styled.div((props) => ({ marginBottom: props.theme.spacing(6), })); -const ErrorText = styled.h1((props) => ({ - ...props.theme.body_xs, - color: props.theme.colors.feedback.error, +const ErrorText = styled.p((props) => ({ + ...props.theme.typography.body_s, + color: props.theme.colors.danger_medium, })); const InputFieldContainer = styled.div(() => ({ flex: 1, })); -const TitleText = styled.h1((props) => ({ - ...props.theme.body_medium_m, +const TitleText = styled.p((props) => ({ + ...props.theme.typography.body_medium_m, flex: 1, display: 'flex', })); -const Text = styled.h1((props) => ({ - ...props.theme.body_medium_m, +const Text = styled.p((props) => ({ + ...props.theme.typography.body_medium_m, })); -const SubText = styled.h1((props) => ({ - ...props.theme.body_xs, +const SubText = styled.p((props) => ({ + ...props.theme.typography.body_s, display: 'flex', flex: 1, color: props.theme.colors.white_400, })); -const AssociatedText = styled.h1((props) => ({ - ...props.theme.body_xs, +const AssociatedText = styled.p((props) => ({ + ...props.theme.typography.body_s, wordWrap: 'break-word', })); -const BalanceText = styled.h1((props) => ({ - ...props.theme.body_medium_m, +const BalanceText = styled.p((props) => ({ + ...props.theme.typography.body_medium_m, color: props.theme.colors.white_400, marginRight: props.theme.spacing(2), })); const InputField = styled.input((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, backgroundColor: props.theme.colors.elevation_n1, color: props.theme.colors.white_0, width: '100%', @@ -224,10 +226,9 @@ function SendForm({ const { stxBtcRate, btcFiatRate, fiatCurrency, stxAddress, selectedAccount } = useWalletSelector(); - const network = useNetworkSelector(); const debouncedSearchTerm = useDebounce(recipientAddress, 300); - const associatedBnsName = useBnsName(recipientAddress, network); - const associatedAddress = useBNSResolver(debouncedSearchTerm, stxAddress, currencyType); + const associatedBnsName = useBnsName(recipientAddress); + const associatedAddress = useBnsResolver(debouncedSearchTerm, stxAddress, currencyType); const { isAccountSwitched } = useClearFormOnAccountSwitch(); useEffect(() => { @@ -257,8 +258,8 @@ function SendForm({ const amountInCurrency = getFiatEquivalent( Number(amountToSend), currencyType, - stxBtcRate, - btcFiatRate, + BigNumber(stxBtcRate), + BigNumber(btcFiatRate), fungibleToken, ); setFiatAmount(amountInCurrency); @@ -293,8 +294,8 @@ function SendForm({ const amountInCurrency = getFiatEquivalent( Number(newValue), currencyType, - stxBtcRate, - btcFiatRate, + BigNumber(stxBtcRate), + BigNumber(btcFiatRate), fungibleToken, ); setFiatAmount(amountInCurrency); @@ -307,11 +308,17 @@ function SendForm({ if (!tokenAmount) return '0'; switch (currencyType) { case 'STX': - return getStxTokenEquivalent(new BigNumber(tokenAmount), stxBtcRate, btcFiatRate) + return getStxTokenEquivalent( + new BigNumber(tokenAmount), + BigNumber(stxBtcRate), + BigNumber(btcFiatRate), + ) .toFixed(6) .toString(); case 'BTC': - return getBtcEquivalent(new BigNumber(tokenAmount), btcFiatRate).toFixed(8).toString(); + return getBtcEquivalent(new BigNumber(tokenAmount), BigNumber(btcFiatRate)) + .toFixed(8) + .toString(); case 'FT': if (fungibleToken?.tokenFiatRate) { return new BigNumber(tokenAmount) diff --git a/src/app/components/tabBar/index.tsx b/src/app/components/tabBar/index.tsx index 3bd6786fc..92601e9fd 100644 --- a/src/app/components/tabBar/index.tsx +++ b/src/app/components/tabBar/index.tsx @@ -31,7 +31,7 @@ const Button = styled.button({ zIndex: 2, }); -type Tab = 'dashboard' | 'nft' | 'stacking' | 'settings'; +export type Tab = 'dashboard' | 'nft' | 'stacking' | 'settings'; interface Props { tab: Tab; diff --git a/src/app/components/tilesSkeletonLoader.tsx b/src/app/components/tilesSkeletonLoader.tsx index 1252ced0d..3f7325179 100644 --- a/src/app/components/tilesSkeletonLoader.tsx +++ b/src/app/components/tilesSkeletonLoader.tsx @@ -7,7 +7,7 @@ const TilesLoaderContainer = styled.div<{ width: '100%', display: 'flex', justifyContent: 'flex-start', - columnGap: props.isGalleryOpen ? props.theme.spacing(16) : props.theme.spacing(12), + columnGap: props.isGalleryOpen ? props.theme.spacing(16) : props.theme.spacing(8), })); const TileLoaderContainer = styled.div({ diff --git a/src/app/components/tokenTile/index.tsx b/src/app/components/tokenTile/index.tsx index 0ba643f25..60756ad5c 100644 --- a/src/app/components/tokenTile/index.tsx +++ b/src/app/components/tokenTile/index.tsx @@ -1,6 +1,6 @@ import { BetterBarLoader } from '@components/barLoader'; -import { microstacksToStx, satsToBtc } from '@secretkeylabs/xverse-core/currency'; -import { FungibleToken } from '@secretkeylabs/xverse-core/types'; +import type { FungibleToken } from '@secretkeylabs/xverse-core'; +import { microstacksToStx, satsToBtc } from '@secretkeylabs/xverse-core'; import { currencySymbolMap } from '@secretkeylabs/xverse-core/types/currency'; import { StoreState } from '@stores/index'; import { CurrencyTypes } from '@utils/constants'; @@ -347,7 +347,7 @@ function TokenTile({ onPress({ coin: currency as CurrencyTypes, ft: fungibleToken && fungibleToken.principal, - brc20Ft: !fungibleToken?.principal && fungibleToken?.name, + brc20Ft: !fungibleToken?.principal ? fungibleToken?.name : undefined, }); }; diff --git a/src/app/components/topRow/index.tsx b/src/app/components/topRow/index.tsx index ed4a6b966..38e44039c 100644 --- a/src/app/components/topRow/index.tsx +++ b/src/app/components/topRow/index.tsx @@ -40,7 +40,7 @@ const AnimatedBackButton = styled(BackButton)` interface Props { title: string; - onClick: () => void; + onClick: (e: React.MouseEvent) => void; showBackButton?: boolean; className?: string; } diff --git a/src/app/components/transactionSetting/editFee.tsx b/src/app/components/transactionSetting/editFee.tsx index bf51ea681..8d2b51286 100644 --- a/src/app/components/transactionSetting/editFee.tsx +++ b/src/app/components/transactionSetting/editFee.tsx @@ -1,12 +1,13 @@ import useDebounce from '@hooks/useDebounce'; import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress'; import useWalletSelector from '@hooks/useWalletSelector'; -import { BtcUtxoDataResponse, ErrorCodes, UTXO } from '@secretkeylabs/xverse-core'; import { + ErrorCodes, getBtcFiatEquivalent, getStxFiatEquivalent, stxToMicrostacks, -} from '@secretkeylabs/xverse-core/currency'; + UTXO, +} from '@secretkeylabs/xverse-core'; import { getBtcFees, getBtcFeesForNonOrdinalBtcSend, @@ -146,7 +147,7 @@ interface Props { btcRecipients?: Recipient[]; ordinalTxUtxo?: UTXO; isRestoreFlow?: boolean; - nonOrdinalUtxos?: BtcUtxoDataResponse[]; + nonOrdinalUtxos?: UTXO[]; feeMode: string; error: string; setIsLoading: () => void; @@ -185,7 +186,7 @@ function EditFee({ } = useWalletSelector(); const [totalFee, setTotalFee] = useState(fee); const [feeRateInput, setFeeRateInput] = useState(feeRate?.toString() ?? ''); - const inputRef = useRef(null); + const inputRef = useRef(null); const debouncedFeeRateInput = useDebounce(feeRateInput, 500); const isBtcOrOrdinals = type === 'BTC' || type === 'Ordinals'; const isStx = type === 'STX'; @@ -292,7 +293,7 @@ function EditFee({ feeMode, feeRateInput, ); - setFeeRateInput(selectedFeeRate?.toString()); + setFeeRateInput(selectedFeeRate!.toString()); setTotalFee(modifiedFee.toString()); } else if (btcRecipients && selectedAccount) { const { fee: modifiedFee, selectedFeeRate } = await getBtcFees( @@ -302,7 +303,7 @@ function EditFee({ feeMode, feeRateInput, ); - setFeeRateInput(selectedFeeRate?.toString()); + setFeeRateInput(selectedFeeRate!.toString()); setTotalFee(modifiedFee.toString()); } } catch (err: any) { @@ -328,7 +329,7 @@ function EditFee({ feeMode, feeRateInput, ); - setFeeRateInput(selectedFeeRate?.toString()); + setFeeRateInput(selectedFeeRate!.toString()); setTotalFee(modifiedFee.toString()); } catch (err: any) { if (Number(err) === ErrorCodes.InSufficientBalance) { @@ -356,8 +357,12 @@ function EditFee({ function getFiatEquivalent() { return isStx - ? getStxFiatEquivalent(stxToMicrostacks(new BigNumber(totalFee)), stxBtcRate, btcFiatRate) - : getBtcFiatEquivalent(new BigNumber(totalFee), btcFiatRate); + ? getStxFiatEquivalent( + stxToMicrostacks(new BigNumber(totalFee)), + BigNumber(stxBtcRate), + BigNumber(btcFiatRate), + ) + : getBtcFiatEquivalent(new BigNumber(totalFee), BigNumber(btcFiatRate)); } const getFiatAmountString = (fiatAmount: BigNumber) => { diff --git a/src/app/components/transactionSetting/index.tsx b/src/app/components/transactionSetting/index.tsx index 42bf77098..20bd18b3d 100644 --- a/src/app/components/transactionSetting/index.tsx +++ b/src/app/components/transactionSetting/index.tsx @@ -3,7 +3,7 @@ import ArrowIcon from '@assets/img/settings/arrow.svg'; import BottomModal from '@components/bottomModal'; import ActionButton from '@components/button'; import useWalletSelector from '@hooks/useWalletSelector'; -import { BtcUtxoDataResponse, UTXO } from '@secretkeylabs/xverse-core'; +import { UTXO } from '@secretkeylabs/xverse-core'; import { stxToMicrostacks } from '@secretkeylabs/xverse-core/currency'; import { isCustomFeesAllowed, Recipient } from '@secretkeylabs/xverse-core/transactions/btc'; import BigNumber from 'bignumber.js'; @@ -64,7 +64,7 @@ interface Props { btcRecipients?: Recipient[]; ordinalTxUtxo?: UTXO; isRestoreFlow?: boolean; - nonOrdinalUtxos?: BtcUtxoDataResponse[]; + nonOrdinalUtxos?: UTXO[]; showFeeSettings: boolean; setShowFeeSettings: (value: boolean) => void; } @@ -123,7 +123,7 @@ function TransactionSettingAlert({ const applyClickForBtc = async () => { const currentFee = new BigNumber(feeInput); - if (btcBalance && currentFee.gt(btcBalance)) { + if (currentFee.gt(btcBalance)) { // show fee exceeds total balance error setError(t('TRANSACTION_SETTING.GREATER_FEE_ERROR')); return; diff --git a/src/app/components/transactionsRequests/ContractCallRequest.tsx b/src/app/components/transactionsRequests/ContractCallRequest.tsx index 8c3a021dc..f20a09173 100644 --- a/src/app/components/transactionsRequests/ContractCallRequest.tsx +++ b/src/app/components/transactionsRequests/ContractCallRequest.tsx @@ -134,8 +134,9 @@ export default function ContractCallRequest(props: ContractCallRequestProps) { const functionArgsView = () => { const args = getFunctionArgs(); - return args.map((arg, index) => ( + return args.map((arg) => ( 20 ? truncateFunctionArgsView(arg.value) : arg.value} description={arg.type} @@ -224,20 +225,18 @@ export default function ContractCallRequest(props: ContractCallRequestProps) { switch (postCondition.conditionType) { case PostConditionType.STX: return ; - case PostConditionType.Fungible: + case PostConditionType.Fungible: { + const coinInfo = coinsMetaData?.find( + (coin: Coin) => + coin.contract === + `${addressToString(postCondition.assetInfo.address)}.${ + postCondition.assetInfo.contractName.content + }`, + ); return ( - - coin.contract === - `${addressToString(postCondition.assetInfo.address)}.${ - postCondition.assetInfo.contractName.content - }`, - )} - /> + ); + } case PostConditionType.NonFungible: return ; default: diff --git a/src/app/components/transferFeeView/index.tsx b/src/app/components/transferFeeView/index.tsx index bc061948d..7080417fd 100644 --- a/src/app/components/transferFeeView/index.tsx +++ b/src/app/components/transferFeeView/index.tsx @@ -56,7 +56,12 @@ function TransferFeeView({ feePerVByte, fee, currency, title }: Props) { const { btcFiatRate, stxBtcRate, fiatCurrency } = useSelector( (state: StoreState) => state.walletState, ); - const fiatRate = getFiatEquivalent(Number(fee), currency, stxBtcRate, btcFiatRate); + const fiatRate = getFiatEquivalent( + Number(fee), + currency, + BigNumber(stxBtcRate), + BigNumber(btcFiatRate), + ); const getFiatAmountString = (fiatAmount: BigNumber) => { if (!fiatAmount) { return ''; @@ -103,7 +108,7 @@ function TransferFeeView({ feePerVByte, fee, currency, title }: Props) { {getFiatAmountString( currency === 'sats' - ? getBtcFiatEquivalent(new BigNumber(fee), btcFiatRate) + ? getBtcFiatEquivalent(new BigNumber(fee), BigNumber(btcFiatRate)) : new BigNumber(fiatRate!), )} diff --git a/src/app/hooks/queries/ordinals/useAddressRareSats.ts b/src/app/hooks/queries/ordinals/useAddressRareSats.ts index 547cd9cf6..0329325dc 100644 --- a/src/app/hooks/queries/ordinals/useAddressRareSats.ts +++ b/src/app/hooks/queries/ordinals/useAddressRareSats.ts @@ -53,7 +53,7 @@ export const useGetUtxoOrdinalBundle = (output?: string, shouldMakeTheCall?: boo const { data, isLoading } = useQuery({ enabled: !!(output && shouldMakeTheCall), - queryKey: ['rare-sats', output], + queryKey: ['rare-sats', output, network.type], queryFn: getUtxoOrdinalBundleByOutput, retry: handleRetries, staleTime: 1 * 60 * 1000, // 1 min diff --git a/src/app/hooks/queries/ordinals/useCollectionMarketData.ts b/src/app/hooks/queries/ordinals/useCollectionMarketData.ts index 990a667fc..ab5a9e8b1 100644 --- a/src/app/hooks/queries/ordinals/useCollectionMarketData.ts +++ b/src/app/hooks/queries/ordinals/useCollectionMarketData.ts @@ -18,7 +18,7 @@ const useInscriptionCollectionMarketData = (collectionId?: string | null) => { return useQuery({ enabled: !!collectionId, retry: handleRetries, - queryKey: ['collection-market-data', collectionId], + queryKey: ['collection-market-data', collectionId, network.type], queryFn: collectionMarketData, staleTime: 1 * 60 * 1000, // 1 min }); diff --git a/src/app/hooks/queries/useBnsName.ts b/src/app/hooks/queries/useBnsName.ts index 028d1c06c..6f02fe79a 100644 --- a/src/app/hooks/queries/useBnsName.ts +++ b/src/app/hooks/queries/useBnsName.ts @@ -1,10 +1,10 @@ +import { fetchAddressOfBnsName, getBnsName, validateStxAddress } from '@secretkeylabs/xverse-core'; import { useEffect, useState } from 'react'; -import { StacksNetwork, validateStxAddress } from '@secretkeylabs/xverse-core'; -import { fetchAddressOfBnsName, getBnsName } from '@secretkeylabs/xverse-core/api'; -import useWalletSelector from '../useWalletSelector'; import useNetworkSelector from '../useNetwork'; +import useWalletSelector from '../useWalletSelector'; -export const useBnsName = (walletAddress: string, network: StacksNetwork) => { +export const useBnsName = (walletAddress: string) => { + const network = useNetworkSelector(); const [bnsName, setBnsName] = useState(''); useEffect(() => { @@ -12,15 +12,15 @@ export const useBnsName = (walletAddress: string, network: StacksNetwork) => { const name = await getBnsName(walletAddress, network); setBnsName(name ?? ''); })(); - }, [walletAddress]); + }, [walletAddress, network]); return bnsName; }; -export const useBNSResolver = ( +export const useBnsResolver = ( recipientAddress: string, walletAddress: string, - currencyType: string, + currencyType?: string, ) => { const { network } = useWalletSelector(); const selectedNetwork = useNetworkSelector(); @@ -43,7 +43,7 @@ export const useBNSResolver = ( setAssociatedAddress(''); } })(); - }, [recipientAddress]); + }, [recipientAddress, network, currencyType, selectedNetwork, walletAddress]); return associatedAddress; }; diff --git a/src/app/hooks/queries/useBtcWalletData.ts b/src/app/hooks/queries/useBtcWalletData.ts index f2615ac55..ef83e1762 100644 --- a/src/app/hooks/queries/useBtcWalletData.ts +++ b/src/app/hooks/queries/useBtcWalletData.ts @@ -2,7 +2,6 @@ import useBtcClient from '@hooks/useBtcClient'; import type { BtcAddressData } from '@secretkeylabs/xverse-core'; import { SetBtcWalletDataAction } from '@stores/wallet/actions/actionCreators'; import { useQuery } from '@tanstack/react-query'; -import BigNumber from 'bignumber.js'; import { useDispatch } from 'react-redux'; import useWalletSelector from '../useWalletSelector'; @@ -13,8 +12,7 @@ export const useBtcWalletData = () => { const fetchBtcWalletData = async () => { const btcData: BtcAddressData = await btcClient.getBalance(btcAddress); - const btcBalance = new BigNumber(btcData.finalBalance); - dispatch(SetBtcWalletDataAction(btcBalance)); + dispatch(SetBtcWalletDataAction(btcData.finalBalance)); return btcData; }; diff --git a/src/app/hooks/queries/useCoinRates.ts b/src/app/hooks/queries/useCoinRates.ts index 92e2e446b..cb87c308b 100644 --- a/src/app/hooks/queries/useCoinRates.ts +++ b/src/app/hooks/queries/useCoinRates.ts @@ -22,7 +22,7 @@ export const useCoinRates = () => { }; return useQuery({ - queryKey: ['coin_rates'], + queryKey: ['coin_rates', fiatCurrency, network.type], queryFn: fetchCoinRates, staleTime: 5 * 60 * 1000, // 5 min }); diff --git a/src/app/hooks/queries/useNftDetail.ts b/src/app/hooks/queries/useNftDetail.ts new file mode 100644 index 000000000..85a37841a --- /dev/null +++ b/src/app/hooks/queries/useNftDetail.ts @@ -0,0 +1,28 @@ +import { getNftDetail, NftDetailResponse, NonFungibleToken } from '@secretkeylabs/xverse-core'; +import { useQuery } from '@tanstack/react-query'; +import { getIdentifier, isBnsCollection } from '@utils/nfts'; +import { handleRetries } from '@utils/query'; + +const useNftDetail = (id: string | NonFungibleToken['identifier']) => { + const { tokenId, contractAddress, contractName } = + typeof id === 'string' ? getIdentifier(id) : id; + + const fetchNft = (): Promise => + getNftDetail(tokenId, contractAddress, contractName); + + return useQuery({ + enabled: !!( + id && + tokenId && + contractAddress && + contractName && + !isBnsCollection(`${contractAddress}.${contractName}`) + ), + retry: handleRetries, + queryKey: ['nft-detail', contractAddress, contractName, tokenId], + queryFn: fetchNft, + staleTime: 24 * 60 * 60 * 1000, // 24 hours + }); +}; + +export default useNftDetail; diff --git a/src/app/hooks/queries/useStacksCollectibles.ts b/src/app/hooks/queries/useStacksCollectibles.ts index d93cdffbc..3ad6c3c0a 100644 --- a/src/app/hooks/queries/useStacksCollectibles.ts +++ b/src/app/hooks/queries/useStacksCollectibles.ts @@ -1,42 +1,23 @@ import useNetworkSelector from '@hooks/useNetwork'; import useWalletSelector from '@hooks/useWalletSelector'; -import { getNfts, NftsListData } from '@secretkeylabs/xverse-core'; -import { useInfiniteQuery } from '@tanstack/react-query'; -import { handleRetries, InvalidParamsError } from '@utils/query'; +import { getNftCollections, StacksCollectionList } from '@secretkeylabs/xverse-core'; +import { useQuery } from '@tanstack/react-query'; +import { handleRetries } from '@utils/query'; const useStacksCollectibles = () => { const { stxAddress } = useWalletSelector(); const selectedNetwork = useNetworkSelector(); - function fetchNfts({ pageParam = 0 }): Promise { - if (!stxAddress) { - return Promise.reject(new InvalidParamsError('stxAddress is required')); - } - return getNfts(stxAddress, selectedNetwork, pageParam); - } + const fetchNftCollections = (): Promise => + getNftCollections(stxAddress, selectedNetwork); - const { isLoading, data, fetchNextPage, isFetchingNextPage, hasNextPage, refetch, error } = - useInfiniteQuery([`nft-meta-data-${stxAddress}`], fetchNfts, { - retry: handleRetries, - keepPreviousData: false, - getNextPageParam: (lastpage, pages) => { - const currentLength = pages.map((page) => page.nftsList).flat().length; - if (currentLength < lastpage.total) { - return currentLength; - } - return false; - }, - }); - - return { - isLoading, - error, - data, - fetchNextPage, - isFetchingNextPage, - hasNextPage, - refetch, - }; + return useQuery({ + enabled: !!stxAddress, + retry: handleRetries, + queryKey: ['nft-collection-data', stxAddress], + queryFn: fetchNftCollections, + staleTime: 5 * 60 * 1000, // 5mins + }); }; export default useStacksCollectibles; diff --git a/src/app/hooks/stores/useNftReducer.ts b/src/app/hooks/stores/useNftReducer.ts deleted file mode 100644 index a6caf3510..000000000 --- a/src/app/hooks/stores/useNftReducer.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { NftData } from '@secretkeylabs/xverse-core/types/api/gamma/currency'; -import { setNftDataAction } from '@stores/nftData/actions/actionCreator'; -import { useDispatch } from 'react-redux'; -import useNftDataSelector from './useNftDataSelector'; - -const useNftDataReducer = () => { - const { nftData } = useNftDataSelector(); - const dispatch = useDispatch(); - - const storeNftData = (data: NftData) => { - const nftExists = nftData.find((nftItem) => nftItem?.token_id === data?.token_id); - if (data && !nftExists) { - const modifiedNftList = [...nftData]; - modifiedNftList.push(data); - dispatch(setNftDataAction(modifiedNftList)); - } - }; - return { - storeNftData, - }; -}; - -export default useNftDataReducer; diff --git a/src/app/hooks/stores/useOrdinalReducer.ts b/src/app/hooks/stores/useOrdinalReducer.ts index 966d2c64d..86f7f2645 100644 --- a/src/app/hooks/stores/useOrdinalReducer.ts +++ b/src/app/hooks/stores/useOrdinalReducer.ts @@ -1,4 +1,4 @@ -import { Inscription } from '@secretkeylabs/xverse-core/types/api/ordinals'; +import type { Inscription } from '@secretkeylabs/xverse-core'; import { setSelectedOrdinalAction } from '@stores/nftData/actions/actionCreator'; import { useDispatch } from 'react-redux'; diff --git a/src/app/hooks/useDetectOrdinalInSignPsbt.ts b/src/app/hooks/useDetectOrdinalInSignPsbt.ts index 9483c86d1..36fe692b7 100644 --- a/src/app/hooks/useDetectOrdinalInSignPsbt.ts +++ b/src/app/hooks/useDetectOrdinalInSignPsbt.ts @@ -4,7 +4,7 @@ import { isAxiosError } from 'axios'; import { useEffect, useState } from 'react'; import useWalletSelector from './useWalletSelector'; -const useDetectOrdinalInSignPsbt = (parsedPsbt: '' | ParsedPSBT) => { +const useDetectOrdinalInSignPsbt = (parsedPsbt: undefined | ParsedPSBT) => { const [loading, setLoading] = useState(false); const [userReceivesOrdinal, setUserReceivesOrdinal] = useState(false); const [bundleItemsData, setBundleItemsData] = useState([]); diff --git a/src/app/hooks/useResetUserFlow.ts b/src/app/hooks/useResetUserFlow.ts index 932f416f3..7443eb201 100644 --- a/src/app/hooks/useResetUserFlow.ts +++ b/src/app/hooks/useResetUserFlow.ts @@ -14,18 +14,19 @@ const userFlowConfig: Record = { '/send-brc20': { resetTo: '/' }, '/confirm-brc20-tx': { resetTo: '/' }, '/confirm-inscription-request': { resetTo: '/' }, - '/ordinal-detail': { resetTo: '/nft-dashboard' }, - '/send-ordinal': { resetTo: '/nft-dashboard' }, - '/confirm-ordinal-tx': { resetTo: '/nft-dashboard' }, - '/nft-detail': { resetTo: '/nft-dashboard' }, - '/send-nft': { resetTo: '/nft-dashboard' }, - '/confirm-nft-tx': { resetTo: '/nft-dashboard' }, - '/verify-ledger': { resetTo: '/verify-ledger?mismatch=true' }, - '/add-stx-address-ledger': { resetTo: '/add-stx-address-ledger?mismatch=true' }, + '/ordinals-collection': { resetTo: '/nft-dashboard?tab=inscriptions' }, + '/ordinal-detail': { resetTo: '/nft-dashboard?tab=inscriptions' }, + '/send-ordinal': { resetTo: '/nft-dashboard?tab=inscriptions' }, + '/confirm-ordinal-tx': { resetTo: '/nft-dashboard?tab=inscriptions' }, + '/nft-collection': { resetTo: '/nft-dashboard?tab=nfts' }, + '/nft-detail': { resetTo: '/nft-dashboard?tab=nfts' }, + '/send-nft': { resetTo: '/nft-dashboard?tab=nfts' }, + '/confirm-nft-tx': { resetTo: '/nft-dashboard?tab=nfts' }, '/rare-sats-detail': { resetTo: '/nft-dashboard?tab=rareSats' }, '/rare-sats-bundle': { resetTo: '/nft-dashboard?tab=rareSats' }, '/send-rare-sat': { resetTo: '/nft-dashboard?tab=rareSats' }, - '/ordinals-collection': { resetTo: '/nft-dashboard?tab=inscriptions' }, + '/verify-ledger': { resetTo: '/verify-ledger?mismatch=true' }, + '/add-stx-address-ledger': { resetTo: '/add-stx-address-ledger?mismatch=true' }, }; type UserFlowConfigKey = keyof typeof userFlowConfig; diff --git a/src/app/hooks/useTextOrdinalContent.ts b/src/app/hooks/useTextOrdinalContent.ts index 130dfdcc2..00a6040ac 100644 --- a/src/app/hooks/useTextOrdinalContent.ts +++ b/src/app/hooks/useTextOrdinalContent.ts @@ -9,7 +9,7 @@ const queue = new PQueue({ concurrency: 1 }); const useTextOrdinalContent = (ordinal: Inscription | CondensedInscription) => { const { network } = useWalletSelector(); const { data: textContent } = useQuery({ - queryKey: [`ordinal-text-${ordinal?.id}`], + queryKey: ['ordinal-text', ordinal?.id, network.type], queryFn: async () => queue.add(() => getTextOrdinalContent(network.type, ordinal?.id)), staleTime: 5 * 60 * 1000, // 5 min }); diff --git a/src/app/layouts/sendLayout.tsx b/src/app/layouts/sendLayout.tsx new file mode 100644 index 000000000..8a077ce8b --- /dev/null +++ b/src/app/layouts/sendLayout.tsx @@ -0,0 +1,101 @@ +import AccountHeaderComponent from '@components/accountHeader'; +import BottomBar, { Tab } from '@components/tabBar'; +import TopRow from '@components/topRow'; +import { ArrowLeft } from '@phosphor-icons/react'; +import { StyledP } from '@ui-library/common.styled'; +import { PropsWithChildren } from 'react'; +import { useTranslation } from 'react-i18next'; +import styled from 'styled-components'; +import { breakpoints, devices } from 'theme'; + +const ScrollContainer = styled.div((props) => ({ + display: 'flex', + flex: 1, + flexDirection: 'column', + ...props.theme.scrollbar, +})); + +const Container = styled.div` + display: flex; + flex-direction: column; + margin: auto; + margin-top: ${(props) => props.theme.space.xxs}; + padding: 0 ${(props) => props.theme.space.s}; + width: 100%; + height: 100%; + max-width: ${breakpoints.xs}px; + max-height: 600px; + + @media only screen and ${devices.min.s} { + flex: initial; + max-width: 588px; + border: 1px solid ${(props) => props.theme.colors.elevation3}; + border-radius: ${(props) => props.theme.space.s}; + padding: ${(props) => props.theme.space.l} ${(props) => props.theme.space.m}; + padding-bottom: ${(props) => props.theme.space.xxl}; + margin-top: ${(props) => props.theme.space.xxxxl}; + } +`; + +const FooterContainer = styled.div` + display: flex; + justify-content: center; + margin-bottom: ${(props) => props.theme.space.xxl}; +`; + +const BottomBarContainer = styled.div({ + marginTop: 'auto', +}); + +const Button = styled.button` + display: flex; + background-color: transparent; + margin-bottom: ${(props) => props.theme.space.l}; +`; + +function SendLayout({ + children, + selectedBottomTab, + onClickBack, + hideBackButton = false, +}: PropsWithChildren<{ + selectedBottomTab: Tab; + onClickBack?: (e: React.MouseEvent) => void; + hideBackButton?: boolean; +}>) { + const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); + const isScreenLargerThanXs = document.documentElement.clientWidth > Number(breakpoints.xs); + const year = new Date().getFullYear(); + + return ( + <> + {isScreenLargerThanXs ? ( + + ) : ( + + )} + + + {isScreenLargerThanXs && !hideBackButton && onClickBack && ( + + )} + {children} + + {isScreenLargerThanXs && ( + + + {t('COPYRIGHT', { year })} + + + )} + + + {!isScreenLargerThanXs && } + + + ); +} + +export default SendLayout; diff --git a/src/app/routes/index.tsx b/src/app/routes/index.tsx index 9d426fb2a..60dc5417b 100644 --- a/src/app/routes/index.tsx +++ b/src/app/routes/index.tsx @@ -33,6 +33,7 @@ import VerifyLedger from '@screens/ledger/verifyLedgerAccountAddress'; import LegalLinks from '@screens/legalLinks'; import Login from '@screens/login'; import ManageTokens from '@screens/manageTokens'; +import NftCollection from '@screens/nftCollection'; import NftDashboard from '@screens/nftDashboard'; import SupportedRarities from '@screens/nftDashboard/supportedRarities'; import NftDetailScreen from '@screens/nftDetail'; @@ -43,7 +44,6 @@ import RareSatsBundle from '@screens/rareSatsBundle'; import RareSatsDetailScreen from '@screens/rareSatsDetail/rareSatsDetail'; import Receive from '@screens/receive'; import RestoreFunds from '@screens/restoreFunds'; -import RestoreBtc from '@screens/restoreFunds/restoreBtc'; import RestoreOrdinals from '@screens/restoreFunds/restoreOrdinals'; import RestoreWallet from '@screens/restoreWallet'; import SendBrc20Screen from '@screens/sendBrc20'; @@ -301,10 +301,6 @@ const router = createHashRouter([ path: 'restore-funds', element: , }, - { - path: 'recover-btc', - element: , - }, { path: 'recover-ordinals', element: , @@ -374,10 +370,6 @@ const router = createHashRouter([ ), }, - { - path: 'send-nft/:id', - element: , - }, { path: 'confirm-inscription-request', element: ( @@ -457,6 +449,14 @@ const router = createHashRouter([ path: 'nft-dashboard/nft-detail/:id/send-nft', element: , }, + { + path: 'nft-dashboard/nft-collection/:id', + element: ( + + + + ), + }, { path: 'nft-dashboard/ordinal-detail/:id/send-ordinal', element: ( diff --git a/src/app/screens/btcSendScreen/index.tsx b/src/app/screens/btcSendScreen/index.tsx index 04e84627a..422734a34 100644 --- a/src/app/screens/btcSendScreen/index.tsx +++ b/src/app/screens/btcSendScreen/index.tsx @@ -109,9 +109,9 @@ function BtcSendScreen() { recipient, fee: signedTx.fee, feePerVByte: signedTx.feePerVByte, - fiatFee: getBtcFiatEquivalent(signedTx.fee, btcFiatRate), + fiatFee: getBtcFiatEquivalent(signedTx.fee, BigNumber(btcFiatRate)), total: signedTx.total, - fiatTotal: getBtcFiatEquivalent(signedTx.total, btcFiatRate), + fiatTotal: getBtcFiatEquivalent(signedTx.total, BigNumber(btcFiatRate)), btcSendBrowserTx: true, requestToken, tabId, diff --git a/src/app/screens/coinDashboard/coinHeader.tsx b/src/app/screens/coinDashboard/coinHeader.tsx index ce741ad1c..5825b3721 100644 --- a/src/app/screens/coinDashboard/coinHeader.tsx +++ b/src/app/screens/coinDashboard/coinHeader.tsx @@ -10,7 +10,7 @@ import useWalletSelector from '@hooks/useWalletSelector'; import { FungibleToken, microstacksToStx, satsToBtc } from '@secretkeylabs/xverse-core'; import { currencySymbolMap } from '@secretkeylabs/xverse-core/types/currency'; import { CurrencyTypes } from '@utils/constants'; -import { isLedgerAccount } from '@utils/helper'; +import { isInOptions, isLedgerAccount } from '@utils/helper'; import { getFtBalance, getFtTicker } from '@utils/tokens'; import BigNumber from 'bignumber.js'; import { useState } from 'react'; @@ -231,7 +231,7 @@ export default function CoinHeader(props: CoinBalanceProps) { } const renderStackingBalances = () => { - if (stxLockedBalance && !new BigNumber(stxLockedBalance).eq(0, 10) && coin === 'STX') { + if (!new BigNumber(stxLockedBalance).eq(0) && coin === 'STX') { return ( <> @@ -262,7 +262,7 @@ export default function CoinHeader(props: CoinBalanceProps) { }; const goToSendScreen = async () => { - if (isLedgerAccount(selectedAccount)) { + if (isLedgerAccount(selectedAccount) && !isInOptions()) { switch (coin) { case 'BTC': await chrome.tabs.create({ diff --git a/src/app/screens/confirmBrc20Transaction/editFees.tsx b/src/app/screens/confirmBrc20Transaction/editFees.tsx index cad42c787..36c2a3e1a 100644 --- a/src/app/screens/confirmBrc20Transaction/editFees.tsx +++ b/src/app/screens/confirmBrc20Transaction/editFees.tsx @@ -228,7 +228,7 @@ export function EditFees({ onClose(); }; - const fiatFee = getBtcFiatEquivalent(new BigNumber(fee), btcFiatRate); + const fiatFee = getBtcFiatEquivalent(new BigNumber(fee), BigNumber(btcFiatRate)); return ( } diff --git a/src/app/screens/confirmInscriptionRequest/index.tsx b/src/app/screens/confirmInscriptionRequest/index.tsx index 7a697fe37..ac7c278d7 100644 --- a/src/app/screens/confirmInscriptionRequest/index.tsx +++ b/src/app/screens/confirmInscriptionRequest/index.tsx @@ -317,7 +317,7 @@ function ConfirmInscriptionRequest() { nonce?: string; }) => { const seedPhrase = await getSeed(); - setCurrentFeeRate(new BigNumber(feeRate)); + setCurrentFeeRate(new BigNumber(feeRate!)); mutateTxFee({ recipients: recipient, txFee: modifiedFee, seedPhrase }); }; @@ -391,7 +391,7 @@ function ConfirmInscriptionRequest() { + + ); - const galleryView = - isLoading || !nft ? ( - - - - ) : ( - + const galleryView = isLoading ? ( + + - + - {nft?.token_metadata.name} - - - - - - - - - - {showShareNftOptions && ( - - )} - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + ) : ( + + + + + + {t('MOVE_TO_ASSET_DETAIL')} + + + + + {nft && } + {nftAttributes} + - {t('DESCRIPTION')} - - {nft?.rarity_score && ( - - )} - - {nft?.nft_token_attributes.length !== 0 && ( - <> - {t('ATTRIBUTES')} - - {nft?.nft_token_attributes.map((attribute) => ( - - ))} - - - )} - - - - - ); + + + + ); return ( <> @@ -452,7 +575,7 @@ function NftDetailScreen() { ) : ( )} - {isGalleryOpen ? galleryView : extensionView} + {isGalleryOpen ? galleryView : extensionView} {!isGalleryOpen && ( diff --git a/src/app/screens/nftDetail/nftAttribute.tsx b/src/app/screens/nftDetail/nftAttribute.tsx index 7f00fd22c..3d1b7eef0 100644 --- a/src/app/screens/nftDetail/nftAttribute.tsx +++ b/src/app/screens/nftDetail/nftAttribute.tsx @@ -1,25 +1,23 @@ import styled from 'styled-components'; -const Container = styled.h1((props) => ({ +const Container = styled.div((props) => ({ display: 'flex', - borderRadius: 20, + borderRadius: 12, border: `1px solid ${props.theme.colors.elevation3}`, - flexDirection: 'row', - marginEnd: 10, - padding: props.theme.spacing(5), - alignItems: 'center', + flexDirection: 'column', + padding: '8px 16px', + alignItems: 'flex-start', })); const TypeText = styled.h1((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, color: props.theme.colors.white_400, })); const ValueText = styled.h1((props) => ({ - ...props.theme.body_medium_m, + ...props.theme.typography.body_medium_m, color: props.theme.colors.white_0, wordBreak: 'break-all', - marginLeft: props.theme.spacing(3), })); interface Props { diff --git a/src/app/screens/nftDetail/useNftDetail.ts b/src/app/screens/nftDetail/useNftDetail.ts new file mode 100644 index 000000000..61443e77d --- /dev/null +++ b/src/app/screens/nftDetail/useNftDetail.ts @@ -0,0 +1,78 @@ +import useNftDetail from '@hooks/queries/useNftDetail'; +import useStacksCollectibles from '@hooks/queries/useStacksCollectibles'; +import useResetUserFlow from '@hooks/useResetUserFlow'; +import useWalletSelector from '@hooks/useWalletSelector'; +import { GAMMA_URL } from '@utils/constants'; +import { getExplorerUrl, isInOptions, isLedgerAccount } from '@utils/helper'; +import { useMemo } from 'react'; +import { useNavigate, useParams } from 'react-router-dom'; + +export default function useNftDetailScreen() { + const navigate = useNavigate(); + const { stxAddress, selectedAccount } = useWalletSelector(); + const { id } = useParams(); + + const nftDetailQuery = useNftDetail(id!); + const nftCollectionsQuery = useStacksCollectibles(); + const collectionId = nftDetailQuery.data?.data.collection_contract_id; + const collection = nftCollectionsQuery.data?.results.find( + (c) => c.collection_id === collectionId, + ); + + const metadata = nftDetailQuery.data?.data?.token_metadata; + const gammaUrl = `${GAMMA_URL}collections/${metadata?.contract_id}/${nftDetailQuery.data?.data?.token_id}`; + + useResetUserFlow('/nft-detail'); + + const isGalleryOpen: boolean = useMemo(() => document.documentElement.clientWidth > 360, []); + const galleryTitle = metadata?.name; + + const onSharePress = () => { + navigator.clipboard.writeText(gammaUrl); + }; + + const handleBackButtonClick = () => { + navigate(`/nft-dashboard/nft-collection/${collectionId}`); + }; + + const onGammaPress = () => { + window.open(gammaUrl); + }; + + const onExplorerPress = () => { + const address = metadata?.contract_id?.split('.')!; + window.open(getExplorerUrl(address[0])); + }; + + const openInGalleryView = async () => { + await chrome.tabs.create({ + url: chrome.runtime.getURL(`options.html#/nft-dashboard/nft-detail/${id}`), + }); + }; + + const handleOnSendClick = async () => { + if (isLedgerAccount(selectedAccount) && !isInOptions()) { + await chrome.tabs.create({ + url: chrome.runtime.getURL(`options.html#/nft-dashboard/nft-detail/${id}/send-nft`), + }); + return; + } + navigate(`/nft-dashboard/nft-detail/${id}/send-nft`); + }; + + return { + nft: nftDetailQuery.data, + nftData: nftDetailQuery.data?.data, + collection, + stxAddress, + isLoading: nftDetailQuery.isLoading, + isGalleryOpen, + onSharePress, + handleBackButtonClick, + onGammaPress, + onExplorerPress, + openInGalleryView, + handleOnSendClick, + galleryTitle, + }; +} diff --git a/src/app/screens/ordinalDetail/index.tsx b/src/app/screens/ordinalDetail/index.tsx index 418feae32..53a5279f8 100644 --- a/src/app/screens/ordinalDetail/index.tsx +++ b/src/app/screens/ordinalDetail/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import ArrowLeft from '@assets/img/dashboard/arrow_left.svg'; import OrdinalsIcon from '@assets/img/nftDashboard/white_ordinals_icon.svg'; import AccountHeaderComponent from '@components/accountHeader'; diff --git a/src/app/screens/ordinalDetail/useOrdinalDetail.ts b/src/app/screens/ordinalDetail/useOrdinalDetail.ts index abd694b05..7704e5b78 100644 --- a/src/app/screens/ordinalDetail/useOrdinalDetail.ts +++ b/src/app/screens/ordinalDetail/useOrdinalDetail.ts @@ -8,7 +8,7 @@ import useSatBundleDataReducer from '@hooks/stores/useSatBundleReducer'; import useTextOrdinalContent from '@hooks/useTextOrdinalContent'; import useWalletSelector from '@hooks/useWalletSelector'; import { XVERSE_ORDIVIEW_URL } from '@utils/constants'; -import { getBtcTxStatusUrl, isLedgerAccount } from '@utils/helper'; +import { getBtcTxStatusUrl, isInOptions, isLedgerAccount } from '@utils/helper'; import { getInscriptionsCollectionGridItemSubText, getInscriptionsCollectionGridItemSubTextColor, @@ -83,7 +83,7 @@ export default function useOrdinalDetail() { return; } if (ordinalData) setSelectedOrdinalDetails(ordinalData); - if (isLedgerAccount(selectedAccount)) { + if (isLedgerAccount(selectedAccount) && !isInOptions()) { await chrome.tabs.create({ url: chrome.runtime.getURL(`options.html#/nft-dashboard/ordinal-detail/${id}/send-ordinal`), }); diff --git a/src/app/screens/ordinalsCollection/index.tsx b/src/app/screens/ordinalsCollection/index.tsx index 70017292e..51b28fe7e 100644 --- a/src/app/screens/ordinalsCollection/index.tsx +++ b/src/app/screens/ordinalsCollection/index.tsx @@ -1,6 +1,7 @@ import AccountHeaderComponent from '@components/accountHeader'; import { BetterBarLoader } from '@components/barLoader'; import ActionButton from '@components/button'; +import CollectibleCollectionGridItem from '@components/collectibleCollectionGridItem'; import CollectibleDetailTile from '@components/collectibleDetailTile'; import Separator from '@components/separator'; import BottomTabBar from '@components/tabBar'; @@ -10,15 +11,22 @@ import WebGalleryButton from '@components/webGalleryButton'; import WrenchErrorMessage from '@components/wrenchErrorMessage'; import useAddressInscriptions from '@hooks/queries/ordinals/useAddressInscriptions'; import useInscriptionCollectionMarketData from '@hooks/queries/ordinals/useCollectionMarketData'; +import useOrdinalDataReducer from '@hooks/stores/useOrdinalReducer'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; import { ArrowLeft } from '@phosphor-icons/react'; import { GridContainer } from '@screens/nftDashboard/collectiblesTabs'; +import OrdinalImage from '@screens/ordinals/ordinalImage'; +import { Inscription } from '@secretkeylabs/xverse-core'; import { StyledHeading, StyledP } from '@ui-library/common.styled'; +import { + getInscriptionsCollectionGridItemId, + getInscriptionsCollectionGridItemSubText, + getInscriptionsCollectionGridItemSubTextColor, +} from '@utils/inscriptions'; import { useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate, useParams } from 'react-router-dom'; import styled from 'styled-components'; -import { OrdinalsCollectionGridItem } from './ordinalsCollectionGridItem'; interface DetailSectionProps { isGalleryOpen?: boolean; @@ -27,11 +35,9 @@ interface DetailSectionProps { /* layout */ // TODO tim: create a reusable layout const Container = styled.div` - overflow-y: auto; display: flex; flex-direction: column; flex: 1; - overflow-y: auto; ${(props) => props.theme.scrollbar} `; @@ -129,8 +135,9 @@ const StyledBarLoader = styled(BetterBarLoader)((props) => ({ })); function OrdinalsCollection() { - const { t } = useTranslation('translation', { keyPrefix: 'ORDINALS_COLLECTION_SCREEN' }); + const { t } = useTranslation('translation', { keyPrefix: 'COLLECTIBLE_COLLECTION_SCREEN' }); const navigate = useNavigate(); + const { setSelectedOrdinalDetails } = useOrdinalDataReducer(); const { id: collectionId } = useParams(); const { data, error, isLoading, hasNextPage, isFetchingNextPage, fetchNextPage } = useAddressInscriptions(collectionId); @@ -151,7 +158,7 @@ function OrdinalsCollection() { }); }; - const isEmpty = !isLoading && !error && data?.pages?.[0]?.data?.total === 0; + const isEmpty = !isLoading && !error && data?.pages?.[0]?.total === 0; const collectionHeading = data?.pages?.[0].collection_name; const estPortfolioValue = @@ -162,6 +169,11 @@ function OrdinalsCollection() { ? `${collectionMarketData?.floor_price?.toFixed(8)} BTC` : '--'; + const handleOnClick = (item: Inscription) => { + setSelectedOrdinalDetails(item); + navigate(`/nft-dashboard/ordinal-detail/${item.id}`); + }; + return ( <> {isGalleryOpen ? ( @@ -222,7 +234,16 @@ function OrdinalsCollection() { ?.map((page) => page?.data) .flat() .map((inscription) => ( - + + + )) )} diff --git a/src/app/screens/rareSatsBundle/index.tsx b/src/app/screens/rareSatsBundle/index.tsx index ed00dc4ef..985bf887b 100644 --- a/src/app/screens/rareSatsBundle/index.tsx +++ b/src/app/screens/rareSatsBundle/index.tsx @@ -14,7 +14,7 @@ import useWalletSelector from '@hooks/useWalletSelector'; import { ArrowRight, ArrowUp } from '@phosphor-icons/react'; import { GridContainer } from '@screens/nftDashboard/collectiblesTabs'; import { StyledHeading, StyledP } from '@ui-library/common.styled'; -import { getBtcTxStatusUrl, isLedgerAccount } from '@utils/helper'; +import { getBtcTxStatusUrl, isInOptions, isLedgerAccount } from '@utils/helper'; import { BundleItem } from '@utils/rareSats'; import { useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -171,7 +171,7 @@ function RareSatsBundle() { return setShowSendOrdinalsAlert(true); } - if (isLedgerAccount(selectedAccount)) { + if (isLedgerAccount(selectedAccount) && !isInOptions()) { await chrome.tabs.create({ url: chrome.runtime.getURL('options.html#/nft-dashboard/send-rare-sat'), }); diff --git a/src/app/screens/rareSatsDetail/rareSatsDetail.tsx b/src/app/screens/rareSatsDetail/rareSatsDetail.tsx index 57e7bef4c..b5bb2b9a0 100644 --- a/src/app/screens/rareSatsDetail/rareSatsDetail.tsx +++ b/src/app/screens/rareSatsDetail/rareSatsDetail.tsx @@ -14,7 +14,12 @@ import useWalletSelector from '@hooks/useWalletSelector'; import { ArrowRight, ArrowUp, Circle } from '@phosphor-icons/react'; import Callout from '@ui-library/callout'; import { XVERSE_ORDIVIEW_URL } from '@utils/constants'; -import { getBtcTxStatusUrl, getTruncatedAddress, isLedgerAccount } from '@utils/helper'; +import { + getBtcTxStatusUrl, + getTruncatedAddress, + isInOptions, + isLedgerAccount, +} from '@utils/helper'; import { BundleItem, getBundleItemId, @@ -292,7 +297,7 @@ function RareSatsDetailScreen() { return showAlert(); } - if (isLedgerAccount(selectedAccount)) { + if (isLedgerAccount(selectedAccount) && !isInOptions()) { await chrome.tabs.create({ url: chrome.runtime.getURL('options.html#/nft-dashboard/send-rare-sat'), }); diff --git a/src/app/screens/restoreFunds/index.tsx b/src/app/screens/restoreFunds/index.tsx index e6ab2c740..d08635be9 100644 --- a/src/app/screens/restoreFunds/index.tsx +++ b/src/app/screens/restoreFunds/index.tsx @@ -1,4 +1,3 @@ -import BitcoinIcon from '@assets/img/dashboard/bitcoin_icon.svg'; import OrdinalsIcon from '@assets/img/nftDashboard/ordinals_icon.svg'; import BottomTabBar from '@components/tabBar'; import TopRow from '@components/topRow'; @@ -31,10 +30,6 @@ function RestoreFunds() { navigate(-1); }; - const handleOnRestoreBtcClick = () => { - navigate('/recover-btc'); - }; - const handleOnRestoreOridnalClick = () => { navigate('/recover-ordinals'); }; @@ -44,7 +39,6 @@ function RestoreFunds() { {t('DESCRIPTION')} - {/* */} ({ - ...props.theme.body_l, - marginBottom: props.theme.spacing(16), - color: props.theme.colors.white_200, -})); - -const BtcCard = styled.div((props) => ({ - display: 'flex', - flexDirection: 'row', - background: props.theme.colors.elevation1, - borderRadius: props.theme.radius(1), - padding: '16px 12px', -})); - -const Icon = styled.img((props) => ({ - marginRight: props.theme.spacing(6), - width: 32, - height: 32, - borderRadius: 30, -})); - -const TitleText = styled.h1((props) => ({ - ...props.theme.body_medium_m, - color: props.theme.colors.white_0, -})); - -const ValueText = styled.h1((props) => ({ - ...props.theme.body_xs, - color: props.theme.colors.white_400, -})); - -const BtcContainer = styled.div({ - display: 'flex', - flexDirection: 'column', -}); - -const Container = styled.div((props) => ({ - display: 'flex', - flex: 1, - flexDirection: 'column', - marginLeft: props.theme.spacing(8), - marginTop: props.theme.spacing(16), - marginRight: props.theme.spacing(8), -})); - -const ButtonContainer = styled.div((props) => ({ - marginLeft: props.theme.spacing(8), - marginBottom: props.theme.spacing(16), - marginRight: props.theme.spacing(8), -})); - -function RestoreBtc() { - const { t } = useTranslation('translation', { keyPrefix: 'RESTORE_BTC_SCREEN' }); - const { ordinalsAddress, btcAddress, network, selectedAccount, btcFiatRate } = - useWalletSelector(); - const { getSeed } = useSeedVault(); - const navigate = useNavigate(); - const { unspentUtxos } = useNonOrdinalUtxos(); - let amount = new BigNumber(0); - if (unspentUtxos) { - amount = sumUnspentOutputs(unspentUtxos); - } - const isNoAmount = amount.isEqualTo(0) || !unspentUtxos[0]?.status.confirmed; - - const { data: ordinalsFee } = useQuery({ - queryKey: [`getFee-${ordinalsAddress}`], - queryFn: () => - getBtcFeesForNonOrdinalBtcSend(btcAddress, unspentUtxos, ordinalsAddress, network.type), - }); - - const { - error: errorSigningNonOrdial, - data: signedNonOrdinalBtcSend, - mutate: mutateSignNonOrdinalBtcTransaction, - } = useMutation< - SignedBtcTx, - Error, - { - recipientAddress: string; - nonOrdinalUtxos: Array; - accountIndex: number; - seedPhrase: string; - network: NetworkType; - fee?: BigNumber; - } - >({ - mutationFn: async ({ - recipientAddress, - nonOrdinalUtxos, - accountIndex, - seedPhrase: currentSeedPhrase, - network: currentNetwork, - fee, - }) => - signNonOrdinalBtcSendTransaction( - recipientAddress, - nonOrdinalUtxos, - accountIndex, - currentSeedPhrase, - currentNetwork, - fee, - ), - }); - - const onClickTransfer = async () => { - const seedPhrase = await getSeed(); - mutateSignNonOrdinalBtcTransaction({ - recipientAddress: btcAddress, - nonOrdinalUtxos: unspentUtxos, - accountIndex: selectedAccount?.id ?? 0, - seedPhrase, - network: network.type, - fee: ordinalsFee?.fee, - }); - }; - - useEffect(() => { - if (errorSigningNonOrdial) { - navigate('/tx-status', { - state: { - txid: '', - currency: 'BTC', - error: errorSigningNonOrdial.toString(), - }, - }); - } - }, [errorSigningNonOrdial]); - - useEffect(() => { - if (signedNonOrdinalBtcSend) { - navigate('/confirm-btc-tx', { - state: { - signedTxHex: signedNonOrdinalBtcSend.signedTx, - recipientAddress: btcAddress, - amount, - recipient: [ - { - address: btcAddress, - amountSats: new BigNumber(amount), - }, - ], - fiatAmount: getBtcFiatEquivalent(amount, btcFiatRate), - fee: ordinalsFee?.fee, - feePerVByte: ordinalsFee?.selectedFeeRate, - fiatFee: getBtcFiatEquivalent(ordinalsFee?.fee!, btcFiatRate), - isRestoreFundFlow: true, - unspentUtxos, - }, - }); - } - }, [signedNonOrdinalBtcSend]); - - const handleOnCancelClick = () => { - navigate(-1); - }; - - return ( - <> - - - {isNoAmount ? ( - {t('NO_FUNDS')} - ) : ( - <> - {t('DESCRIPTION')} - - - - {`${satsToBtc(amount)} BTC`} - {t('BTC')} - - - - )} - - - - - - - ); -} - -export default RestoreBtc; diff --git a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx index a0c551e9c..695d4db2f 100644 --- a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx +++ b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx @@ -12,6 +12,7 @@ import { } from '@secretkeylabs/xverse-core/transactions/btc'; import { BtcOrdinal, ErrorCodes, Inscription } from '@secretkeylabs/xverse-core/types'; import { useMutation } from '@tanstack/react-query'; +import BigNumber from 'bignumber.js'; import { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; @@ -123,9 +124,9 @@ function RestoreOrdinals() { recipientAddress: ordinalsAddress, fee: signedTx.fee, feePerVByte: signedTx.feePerVByte, - fiatFee: getBtcFiatEquivalent(signedTx.fee, btcFiatRate), + fiatFee: getBtcFiatEquivalent(signedTx.fee, BigNumber(btcFiatRate)), total: signedTx.total, - fiatTotal: getBtcFiatEquivalent(signedTx.total, btcFiatRate), + fiatTotal: getBtcFiatEquivalent(signedTx.total, BigNumber(btcFiatRate)), ordinalUtxo: selectedOrdinal.utxo, }, }); diff --git a/src/app/screens/sendBrc20/index.tsx b/src/app/screens/sendBrc20/index.tsx index f46642876..e6b42bd09 100644 --- a/src/app/screens/sendBrc20/index.tsx +++ b/src/app/screens/sendBrc20/index.tsx @@ -114,7 +114,7 @@ function SendBrc20Screen() { } else { console.log('Unexpected error', error); } - return Promise.reject(error); + throw error; } }; @@ -148,16 +148,11 @@ function SendBrc20Screen() { selectedAccount?.id ?? 0, seedPhrase, network.type, - ).catch((err) => { - if (Number(err) === ErrorCodes.InSufficientBalance) { - setAmountError(t('SEND.ERRORS.INSUFFICIENT_BALANCE')); - } else if (Number(err) === ErrorCodes.InSufficientBalanceWithTxFee) { - setAmountError(t('SEND.ERRORS.INSUFFICIENT_BALANCE_FEES')); - } else setAmountError(err.toString()); - }); + ); navigate('/confirm-inscription-request', { state: { - brcContent: order.inscriptionRequest.files[0].dataURL, + // !NOTE: Typing below is broken. Not going to fix as this page is deprecated. + brcContent: (order.inscriptionRequest as any).files[0].dataURL, signedTxHex: data?.signedTx, recipientAddress: order.inscriptionRequest.charge.address, amount: order.inscriptionRequest.charge.amount.toString(), @@ -165,12 +160,18 @@ function SendBrc20Screen() { fiatAmount: order.inscriptionRequest.charge.fiat_value, fee: data?.fee, feePerVByte: data?.feePerVByte, - fiatFee: getBtcFiatEquivalent(data?.fee, btcFiatRate), + fiatFee: getBtcFiatEquivalent(data?.fee, BigNumber(btcFiatRate)), total: data?.total, - fiatTotal: getBtcFiatEquivalent(data?.total, btcFiatRate), + fiatTotal: getBtcFiatEquivalent(data?.total, BigNumber(btcFiatRate)), }, }); } catch (err) { + if (Number(err) === ErrorCodes.InSufficientBalance) { + setAmountError(t('SEND.ERRORS.INSUFFICIENT_BALANCE')); + } else if (Number(err) === ErrorCodes.InSufficientBalanceWithTxFee) { + setAmountError(t('SEND.ERRORS.INSUFFICIENT_BALANCE_FEES')); + } else setAmountError(`${err}`); + setIsCreatingOrder(false); } }; diff --git a/src/app/screens/sendBtc/index.tsx b/src/app/screens/sendBtc/index.tsx index ab5c8eb93..31e6467ee 100644 --- a/src/app/screens/sendBtc/index.tsx +++ b/src/app/screens/sendBtc/index.tsx @@ -1,21 +1,21 @@ -import BigNumber from 'bignumber.js'; -import { useEffect, useState } from 'react'; -import { useTranslation } from 'react-i18next'; -import { useMutation } from '@tanstack/react-query'; -import { useLocation, useNavigate } from 'react-router-dom'; import SendForm from '@components/sendForm'; -import TopRow from '@components/topRow'; import BottomBar from '@components/tabBar'; -import { signBtcTransaction } from '@secretkeylabs/xverse-core/transactions'; +import TopRow from '@components/topRow'; +import { useResetUserFlow } from '@hooks/useResetUserFlow'; +import useSeedVault from '@hooks/useSeedVault'; +import useWalletSelector from '@hooks/useWalletSelector'; +import { ErrorCodes, ResponseError } from '@secretkeylabs/xverse-core'; import { btcToSats, getBtcFiatEquivalent, satsToBtc } from '@secretkeylabs/xverse-core/currency'; +import { signBtcTransaction } from '@secretkeylabs/xverse-core/transactions'; +import { Recipient, SignedBtcTx } from '@secretkeylabs/xverse-core/transactions/btc'; import { validateBtcAddress } from '@secretkeylabs/xverse-core/wallet'; +import { useMutation } from '@tanstack/react-query'; import { BITCOIN_DUST_AMOUNT_SATS } from '@utils/constants'; -import { Recipient, SignedBtcTx } from '@secretkeylabs/xverse-core/transactions/btc'; -import { ErrorCodes, ResponseError } from '@secretkeylabs/xverse-core'; -import useWalletSelector from '@hooks/useWalletSelector'; -import useSeedVault from '@hooks/useSeedVault'; -import { useResetUserFlow } from '@hooks/useResetUserFlow'; import { isInOptions } from '@utils/helper'; +import BigNumber from 'bignumber.js'; +import { useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useLocation, useNavigate } from 'react-router-dom'; function SendBtcScreen() { const location = useLocation(); @@ -71,12 +71,12 @@ function SendBtcScreen() { recipientAddress, amount, recipient, - fiatAmount: getBtcFiatEquivalent(parsedAmountSats, btcFiatRate), + fiatAmount: getBtcFiatEquivalent(parsedAmountSats, BigNumber(btcFiatRate)), fee: data.fee, feePerVByte: data.feePerVByte, - fiatFee: getBtcFiatEquivalent(data.fee, btcFiatRate), + fiatFee: getBtcFiatEquivalent(data.fee, BigNumber(btcFiatRate)), total: data.total, - fiatTotal: getBtcFiatEquivalent(data.total, btcFiatRate), + fiatTotal: getBtcFiatEquivalent(data.total, BigNumber(btcFiatRate)), }, }); } diff --git a/src/app/screens/sendNft/index.tsx b/src/app/screens/sendNft/index.tsx index 7704b6672..84ff4a26e 100644 --- a/src/app/screens/sendNft/index.tsx +++ b/src/app/screens/sendNft/index.tsx @@ -1,146 +1,131 @@ -import ArrowLeft from '@assets/img/dashboard/arrow_left.svg'; -import AccountHeaderComponent from '@components/accountHeader'; -import SendForm from '@components/sendForm'; -import BottomBar from '@components/tabBar'; -import TopRow from '@components/topRow'; +import ActionButton from '@components/button'; +import { useBnsName, useBnsResolver } from '@hooks/queries/useBnsName'; +import useNftDetail from '@hooks/queries/useNftDetail'; import useStxPendingTxData from '@hooks/queries/useStxPendingTxData'; -import useNftDataSelector from '@hooks/stores/useNftDataSelector'; +import useDebounce from '@hooks/useDebounce'; import useNetworkSelector from '@hooks/useNetwork'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; import useWalletSelector from '@hooks/useWalletSelector'; -import NftImage from '@screens/nftDashboard/nftImage'; -import { validateStxAddress } from '@secretkeylabs/xverse-core'; -import { generateUnsignedTransaction } from '@secretkeylabs/xverse-core/transactions'; import { cvToHex, + generateUnsignedTransaction, StacksTransaction, uintCV, UnsignedStacksTransation, -} from '@secretkeylabs/xverse-core/types'; -import { NftData } from '@secretkeylabs/xverse-core/types/api/stacks/assets'; + validateStxAddress, +} from '@secretkeylabs/xverse-core'; import { useMutation } from '@tanstack/react-query'; -import { checkNftExists, isLedgerAccount } from '@utils/helper'; +import { StyledHeading, StyledP } from '@ui-library/common.styled'; +import { InputFeedback, InputFeedbackProps, isDangerFeedback } from '@ui-library/inputFeedback'; +import { checkNftExists } from '@utils/helper'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate, useParams } from 'react-router-dom'; import styled from 'styled-components'; +import SendLayout from '../../layouts/sendLayout'; -const ScrollContainer = styled.div` +const Container = styled.div` display: flex; - flex: 1; flex-direction: column; - overflow-y: auto; - &::-webkit-scrollbar { - display: none; - } - width: 360px; - margin: auto; + justify-content: space-between; + flex-grow: 1; `; -const Container = styled.div({ - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - alignItems: 'center', - flex: 1, -}); - -const NftContainer = styled.div((props) => ({ - maxHeight: 148, - width: 148, - display: 'flex', - aspectRatio: 1, - justifyContent: 'center', - alignItems: 'center', - borderRadius: 8, - marginTop: props.theme.spacing(16), - marginBottom: props.theme.spacing(12), -})); +const StyledSendTo = styled(StyledHeading)` + margin-bottom: ${(props) => props.theme.space.l}; +`; -const NftTitleText = styled.h1((props) => ({ - ...props.theme.headline_s, - color: props.theme.colors.white_0, - textAlign: 'center', +const NextButtonContainer = styled.div((props) => ({ + position: 'sticky', + bottom: 0, + paddingBottom: props.theme.spacing(12), + paddingTop: props.theme.spacing(12), + backgroundColor: props.theme.colors.elevation0, })); -const BottomBarContainer = styled.div({ - marginTop: 'auto', -}); +const InputGroup = styled.div` + margin-top: ${(props) => props.theme.spacing(8)}px; +`; -const ButtonContainer = styled.div((props) => ({ +const Label = styled.label((props) => ({ + ...props.theme.typography.body_medium_m, + color: props.theme.colors.white_200, display: 'flex', - flexDirection: 'row', - marginLeft: '15%', - marginTop: props.theme.spacing(40), + flex: 1, })); -const Button = styled.button((props) => ({ +const AmountInputContainer = styled.div<{ error: boolean }>((props) => ({ display: 'flex', flexDirection: 'row', - justifyContent: 'flex-end', alignItems: 'center', + marginTop: props.theme.spacing(4), + marginBottom: props.theme.spacing(4), + border: props.error + ? `1px solid ${props.theme.colors.danger_dark_200}` + : `1px solid ${props.theme.colors.white_800}`, + backgroundColor: props.theme.colors.elevation_n1, borderRadius: props.theme.radius(1), - backgroundColor: 'transparent', - opacity: 0.8, - marginTop: props.theme.spacing(5), + paddingLeft: props.theme.spacing(5), + paddingRight: props.theme.spacing(5), + height: 44, })); -const ButtonText = styled.div((props) => ({ - ...props.theme.body_xs, - fontWeight: 400, - fontSize: 14, +const InputFieldContainer = styled.div(() => ({ + flex: 1, +})); + +const InputField = styled.input((props) => ({ + ...props.theme.typography.body_m, + backgroundColor: 'transparent', color: props.theme.colors.white_0, - textAlign: 'center', + width: '100%', + border: 'transparent', })); -const ButtonImage = styled.img((props) => ({ - marginRight: props.theme.spacing(3), - alignSelf: 'center', - transform: 'all', +const ErrorContainer = styled.div((props) => ({ + marginTop: props.theme.spacing(3), + marginBottom: props.theme.spacing(12), })); +const RowContainer = styled.div({ + display: 'flex', + flexDirection: 'row', + alignItems: 'center', +}); + function SendNft() { const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); const navigate = useNavigate(); - const { id } = useParams(); const location = useLocation(); - let address: string | undefined; + const [recipientError, setRecipientError] = useState(null); + const [recipientAddress, setRecipientAddress] = useState(location.state?.recipientAddress ?? ''); - if (location.state) { - address = location.state.recipientAddress; - } - const { nftData } = useNftDataSelector(); - const nftIdDetails = id!.split('::'); - const [nft, setNft] = useState(undefined); + useResetUserFlow('/send-nft'); + + const { id } = useParams(); + const { data: nftDetail } = useNftDetail(id!); + const nft = nftDetail?.data; - useEffect(() => { - const data = nftData.find( - (nftItem) => Number(nftItem?.token_id) === Number(nftIdDetails[2].slice(1)), - ); - if (data) { - setNft(data); - } - }, []); const selectedNetwork = useNetworkSelector(); const { data: stxPendingTxData } = useStxPendingTxData(); - const isGalleryOpen: boolean = document.documentElement.clientWidth > 360; - const { stxAddress, stxPublicKey, network, feeMultipliers, selectedAccount } = - useWalletSelector(); - const [error, setError] = useState(''); - const [recipientAddress, setRecipientAddress] = useState(''); + const { stxAddress, stxPublicKey, network, feeMultipliers } = useWalletSelector(); + const debouncedSearchTerm = useDebounce(recipientAddress, 300); + const associatedBnsName = useBnsName(debouncedSearchTerm); + const associatedAddress = useBnsResolver(debouncedSearchTerm, stxAddress); + const { isLoading, data, mutate } = useMutation< StacksTransaction, Error, - { tokenId: string; associatedAddress: string } + { tokenId: string; address: string } >({ - mutationFn: async ({ tokenId, associatedAddress }) => { + mutationFn: async ({ tokenId, address }) => { const principal = nft?.fully_qualified_token_id?.split('::')!; const name = principal[1].split(':')[0]; const contractInfo: string[] = principal[0].split('.'); const unsginedTx: UnsignedStacksTransation = { amount: tokenId, senderAddress: stxAddress, - recipientAddress: associatedAddress, + recipientAddress: address, contractAddress: contractInfo[0], contractName: contractInfo[1], assetName: name, @@ -156,7 +141,7 @@ function SendNft() { unsignedTx.auth.spendingCondition.fee * BigInt(feeMultipliers.stxSendTxMultiplier), ); } - setRecipientAddress(associatedAddress); + setRecipientAddress(address); return unsignedTx; }, }); @@ -172,81 +157,115 @@ function SendNft() { } }, [data]); - useResetUserFlow('/send-nft'); - const handleBackButtonClick = () => { navigate(-1); }; - function validateFields(associatedAddress: string): boolean { - if (!associatedAddress) { - setError(t('ERRORS.ADDRESS_REQUIRED')); - return false; - } - - if (!validateStxAddress({ stxAddress: associatedAddress, network: network.type })) { - setError(t('ERRORS.ADDRESS_INVALID')); - return false; - } - - if (associatedAddress === stxAddress) { - setError(t('ERRORS.SEND_TO_SELF')); - return false; - } - - return true; - } - - const onPressSendNFT = async (associatedAddress: string) => { + const onPressNext = async () => { if (stxPendingTxData) { if (checkNftExists(stxPendingTxData?.pendingTransactions, nft!)) { - setError(t('ERRORS.NFT_SEND_DETAIL')); + setRecipientError({ variant: 'danger', message: t('ERRORS.NFT_SEND_DETAIL') }); return; } } - if (validateFields(associatedAddress.trim()) && nft) { - setError(''); + if (!isDangerFeedback(recipientError) && nft) { const tokenId = cvToHex(uintCV(nft?.token_id.toString()!)); - mutate({ tokenId, associatedAddress }); + mutate({ tokenId, address: associatedAddress || recipientAddress }); } }; + + const handleAddressChange = (e: React.ChangeEvent) => { + setRecipientAddress(e.target.value.trim()); + }; + + useEffect(() => { + const validateRecipientAddress = (address: string): boolean => { + if (!address) { + setRecipientError({ variant: 'danger', message: t('ERRORS.ADDRESS_REQUIRED') }); + return false; + } + if (!validateStxAddress({ stxAddress: address, network: network.type })) { + setRecipientError({ variant: 'danger', message: t('ERRORS.ADDRESS_INVALID') }); + return false; + } + if (address === stxAddress) { + setRecipientError({ variant: 'info', message: t('YOU_ARE_TRANSFERRING_TO_YOURSELF') }); + return true; + } + setRecipientError(null); + return true; + }; + if (associatedAddress) { + validateRecipientAddress(associatedAddress); + } else if (recipientAddress) { + validateRecipientAddress(recipientAddress); + } + }, [associatedAddress, recipientAddress, network.type, stxAddress, t]); + + const isNextEnabled = !isDangerFeedback(recipientError) && !!recipientAddress; + + // hide back button if there is no history + const hideBackButton = location.key === 'default'; + return ( - <> - {isGalleryOpen && ( - <> - - {!isLedgerAccount(selectedAccount) && ( - - - - )} - - )} - - {!isGalleryOpen && } - - - - - - {nft?.token_metadata?.name} - - - {!isGalleryOpen && } - - + + +
+ + {t('SEND_TO')} + + + + + + + + + + + {associatedAddress && ( + <> + + {t('ASSOCIATED_ADDRESS')} + + + {associatedAddress} + + + )} + {associatedBnsName && ( + <> + + {t('ASSOCIATED_BNS_DOMAIN')} + + + {associatedBnsName} + + + )} + + {recipientError && } + + +
+ + + +
+
); } diff --git a/src/app/screens/sendOrdinal/index.tsx b/src/app/screens/sendOrdinal/index.tsx index 12a59bea9..75a49e6b8 100644 --- a/src/app/screens/sendOrdinal/index.tsx +++ b/src/app/screens/sendOrdinal/index.tsx @@ -1,65 +1,37 @@ -import AccountHeaderComponent from '@components/accountHeader'; import ActionButton from '@components/button'; -import BottomBar from '@components/tabBar'; -import TopRow from '@components/topRow'; import useNftDataSelector from '@hooks/stores/useNftDataSelector'; import useBtcClient from '@hooks/useBtcClient'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; import useSeedVault from '@hooks/useSeedVault'; import useWalletSelector from '@hooks/useWalletSelector'; -import { ArrowLeft } from '@phosphor-icons/react'; -import { isOrdinalOwnedByAccount } from '@secretkeylabs/xverse-core'; -import { getBtcFiatEquivalent } from '@secretkeylabs/xverse-core/currency'; +import { + ErrorCodes, + getBtcFiatEquivalent, + isOrdinalOwnedByAccount, + ResponseError, + UTXO, + validateBtcAddress, +} from '@secretkeylabs/xverse-core'; import { SignedBtcTx, signOrdinalSendTransaction, } from '@secretkeylabs/xverse-core/transactions/btc'; -import { ErrorCodes, ResponseError, UTXO } from '@secretkeylabs/xverse-core/types'; -import { validateBtcAddress } from '@secretkeylabs/xverse-core/wallet'; import { useMutation } from '@tanstack/react-query'; import Callout from '@ui-library/callout'; -import { StyledHeading, StyledP } from '@ui-library/common.styled'; +import { StyledHeading } from '@ui-library/common.styled'; import { InputFeedback, InputFeedbackProps, isDangerFeedback } from '@ui-library/inputFeedback'; -import { isLedgerAccount } from '@utils/helper'; -import { useEffect, useMemo, useState } from 'react'; +import BigNumber from 'bignumber.js'; +import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import styled from 'styled-components'; -import { devices } from 'theme'; - -const ScrollContainer = styled.div((props) => ({ - display: 'flex', - flex: 1, - flexDirection: 'column', - ...props.theme.scrollbar, -})); +import SendLayout from '../../layouts/sendLayout'; const Container = styled.div` display: flex; - flex: 1; flex-direction: column; - margin: auto; - margin-top: ${(props) => props.theme.space.xxs}; - padding: 0 ${(props) => props.theme.space.s}; justify-content: space-between; - max-width: 360px; - - @media only screen and ${devices.min.s} { - flex: initial; - max-width: 588px; - border: 1px solid ${(props) => props.theme.colors.elevation3}; - border-radius: ${(props) => props.theme.space.s}; - padding: ${(props) => props.theme.space.l} ${(props) => props.theme.space.m}; - padding-bottom: ${(props) => props.theme.space.xxl}; - margin-top: ${(props) => props.theme.space.xxxxl}; - min-height: 600px; - } -`; - -const FooterContainer = styled.div` - display: flex; - justify-content: center; - margin-bottom: ${(props) => props.theme.space.xxl}; + flex-grow: 1; `; const StyledSendTo = styled(StyledHeading)` @@ -79,7 +51,7 @@ const InputGroup = styled.div` `; const Label = styled.label((props) => ({ - ...props.theme.body_medium_m, + ...props.theme.typography.body_medium_m, color: props.theme.colors.white_200, display: 'flex', flex: 1, @@ -106,9 +78,9 @@ const InputFieldContainer = styled.div(() => ({ })); const InputField = styled.input((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, backgroundColor: 'transparent', - color: props.theme.colors.white['0'], + color: props.theme.colors.white_0, width: '100%', border: 'transparent', })); @@ -128,16 +100,6 @@ const StyledCallout = styled(Callout)` margin-bottom: ${(props) => props.theme.spacing(14)}px; `; -const BottomBarContainer = styled.div({ - marginTop: 'auto', -}); - -const Button = styled.button` - display: flex; - background-color: transparent; - margin-bottom: ${(props) => props.theme.space.l}; -`; - function SendOrdinal() { const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); const navigate = useNavigate(); @@ -153,8 +115,6 @@ function SendOrdinal() { useResetUserFlow('/send-ordinal'); - const isGalleryOpen: boolean = useMemo(() => document.documentElement.clientWidth > 360, []); - const { isLoading, data, @@ -203,9 +163,9 @@ function SendOrdinal() { recipientAddress, fee: data.fee, feePerVByte: data.feePerVByte, - fiatFee: getBtcFiatEquivalent(data.fee, btcFiatRate), + fiatFee: getBtcFiatEquivalent(data.fee, BigNumber(btcFiatRate)), total: data.total, - fiatTotal: getBtcFiatEquivalent(data.total, btcFiatRate), + fiatTotal: getBtcFiatEquivalent(data.total, BigNumber(btcFiatRate)), ordinalUtxo, }, }); @@ -257,63 +217,50 @@ function SendOrdinal() { }; const isNextEnabled = !isDangerFeedback(recipientError) && !!recipientAddress; - const year = new Date().getFullYear(); + + // hide back button if there is no history + const hideBackButton = location.key === 'default'; return ( - <> - {isGalleryOpen && ( - - )} - {!isGalleryOpen && } - - -
- {isGalleryOpen && !isLedgerAccount(selectedAccount) && ( - - )} - - {t('SEND_TO')} - - - - - - - - - - - - {recipientError && } - - - -
- - - -
- {isGalleryOpen && ( - - - {t('COPYRIGHT', { year })} - - - )} -
- {!isGalleryOpen && } - + + +
+ + {t('SEND_TO')} + + + + + + + + + + + + {recipientError && } + + + +
+ + + +
+
); } diff --git a/src/app/screens/settings/index.tsx b/src/app/screens/settings/index.tsx index 791895106..12677354f 100644 --- a/src/app/screens/settings/index.tsx +++ b/src/app/screens/settings/index.tsx @@ -3,7 +3,6 @@ import ArrowIcon from '@assets/img/settings/arrow.svg'; import XverseLogo from '@assets/img/settings/logo.svg'; import PasswordInput from '@components/passwordInput'; import BottomBar from '@components/tabBar'; -import useNonOrdinalUtxos from '@hooks/useNonOrdinalUtxo'; import useSeedVault from '@hooks/useSeedVault'; import useWalletReducer from '@hooks/useWalletReducer'; import useWalletSelector from '@hooks/useWalletSelector'; @@ -12,7 +11,7 @@ import { ChangeActivateRareSatsAction, } from '@stores/wallet/actions/actionCreators'; import { PRIVACY_POLICY_LINK, SUPPORT_LINK, TERMS_LINK } from '@utils/constants'; -import { isLedgerAccount } from '@utils/helper'; +import { isInOptions, isLedgerAccount } from '@utils/helper'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useDispatch } from 'react-redux'; @@ -137,7 +136,7 @@ function Setting() { }; const onRestoreFundClick = async () => { - if (isLedgerAccount(selectedAccount)) { + if (isLedgerAccount(selectedAccount) && !isInOptions()) { await chrome.tabs.create({ url: chrome.runtime.getURL('options.html#/restore-funds'), }); diff --git a/src/app/screens/signPsbtRequest/index.tsx b/src/app/screens/signPsbtRequest/index.tsx index 6dd3cf894..f85e8297f 100644 --- a/src/app/screens/signPsbtRequest/index.tsx +++ b/src/app/screens/signPsbtRequest/index.tsx @@ -15,17 +15,13 @@ import useDetectOrdinalInSignPsbt from '@hooks/useDetectOrdinalInSignPsbt'; import useSignPsbtTx from '@hooks/useSignPsbtTx'; import useWalletSelector from '@hooks/useWalletSelector'; import Transport from '@ledgerhq/hw-transport-webusb'; -import { - getBtcFiatEquivalent, - satsToBtc, - signIncomingSingleSigPSBT, -} from '@secretkeylabs/xverse-core'; +import { getBtcFiatEquivalent, satsToBtc, signLedgerPSBT } from '@secretkeylabs/xverse-core'; import { Transport as TransportType } from '@secretkeylabs/xverse-core/ledger/types'; import { parsePsbt, psbtBase64ToHex } from '@secretkeylabs/xverse-core/transactions/psbt'; import { isLedgerAccount } from '@utils/helper'; import BigNumber from 'bignumber.js'; import { decodeToken } from 'jsontokens'; -import { useCallback, useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { NumericFormat } from 'react-number-format'; import { useLocation, useNavigate } from 'react-router-dom'; @@ -95,8 +91,15 @@ const SuccessActionsContainer = styled.div((props) => ({ })); function SignPsbtRequest() { - const { btcAddress, ordinalsAddress, selectedAccount, network, btcFiatRate } = - useWalletSelector(); + const { + btcAddress, + btcPublicKey, + ordinalsAddress, + ordinalsPublicKey, + selectedAccount, + network, + btcFiatRate, + } = useWalletSelector(); const navigate = useNavigate(); const { t } = useTranslation('translation', { keyPrefix: 'CONFIRM_TRANSACTION' }); const { t: signatureRequestTranslate } = useTranslation('translation', { @@ -120,15 +123,14 @@ function SignPsbtRequest() { const request = decodeToken(requestToken) as any as SignTransactionOptions; const btcClient = useBtcClient(); - const handlePsbtParsing = useCallback(() => { + const parsedPsbt = useMemo(() => { try { return parsePsbt(selectedAccount!, payload.inputsToSign, payload.psbtBase64, network.type); } catch (err) { - return ''; + return undefined; } - }, [selectedAccount, payload.psbtBase64]); + }, [selectedAccount, payload.inputsToSign, payload.psbtBase64, network.type]); - const parsedPsbt = useMemo(() => handlePsbtParsing(), [handlePsbtParsing]); const { loading, bundleItemsData, userReceivesOrdinal } = useDetectOrdinalInSignPsbt(parsedPsbt); const signingAddresses = useMemo( () => getSigningAddresses(payload.inputsToSign), @@ -187,7 +189,7 @@ function SignPsbtRequest() { const onSignPsbtConfirmed = async () => { try { if (isLedgerAccount(selectedAccount)) { - // setIsModalVisible(true); + setIsModalVisible(true); return; } @@ -232,19 +234,20 @@ function SignPsbtRequest() { const handleLedgerPsbtSigning = async (transport: TransportType) => { const addressIndex = selectedAccount?.deviceAccountIndex; - const { inputsToSign, psbtBase64, broadcast } = payload; + const { psbtBase64, broadcast } = payload; if (addressIndex === undefined) { throw new Error('Account not found'); } - const signingResponse = await signIncomingSingleSigPSBT({ + const signingResponse = await signLedgerPSBT({ transport, network: network.type, addressIndex, - inputsToSign, - psbtBase64, - finalize: broadcast, + psbtInputBase64: psbtBase64, + finalize: broadcast ?? false, + nativeSegwitPubKey: btcPublicKey, + taprootPubKey: ordinalsPublicKey, }); let txId: string = ''; @@ -346,53 +349,46 @@ function SignPsbtRequest() { ) : ( <> - {isLedgerAccount(selectedAccount) ? ( - - - - ) : ( - - {t('REVIEW_TRANSACTION')} - {!payload.broadcast && ( - - )} - {bundleItemsData && - bundleItemsData.map((bundleItem, index) => ( - - ))} - - - - - {payload.broadcast ? ( - + {t('REVIEW_TRANSACTION')} + {!payload.broadcast && } + {bundleItemsData && + bundleItemsData.map((bundleItem, index) => ( + - ) : null} - {hasOutputScript && } - - )} + ))} + + + + + {payload.broadcast ? ( + + ) : null} + {hasOutputScript && } +
@@ -402,7 +398,6 @@ function SignPsbtRequest() { text={t('CONFIRM')} onPress={onSignPsbtConfirmed} processing={isSigning} - disabled={isLedgerAccount(selectedAccount)} /> diff --git a/src/app/screens/swap/swapTokenBlock/index.tsx b/src/app/screens/swap/swapTokenBlock/index.tsx index 26fe27324..f36ea34fa 100644 --- a/src/app/screens/swap/swapTokenBlock/index.tsx +++ b/src/app/screens/swap/swapTokenBlock/index.tsx @@ -1,7 +1,10 @@ import ChevronIcon from '@assets/img/swap/chevron.svg'; import TokenImage from '@components/tokenImage'; +import useWalletSelector from '@hooks/useWalletSelector'; import { SwapToken } from '@screens/swap/types'; +import { currencySymbolMap } from '@secretkeylabs/xverse-core/types/currency'; import { useTranslation } from 'react-i18next'; +import { NumericFormat } from 'react-number-format'; import styled from 'styled-components'; const Container = styled.div((props) => ({ @@ -115,6 +118,7 @@ function SwapTokenBlock({ error, }: SwapTokenBlockProps) { const { t } = useTranslation('translation', { keyPrefix: 'SWAP_SCREEN' }); + const { fiatCurrency } = useWalletSelector(); return ( @@ -141,9 +145,14 @@ function SwapTokenBlock({ /> - - {selectedCoin?.fiatAmount ? `≈ $ ${selectedCoin.fiatAmount} USD` : '--'} - + {value}} + /> diff --git a/src/app/screens/swap/useCurrencyConversion.tsx b/src/app/screens/swap/useCurrencyConversion.tsx index b912ea892..65ef55061 100644 --- a/src/app/screens/swap/useCurrencyConversion.tsx +++ b/src/app/screens/swap/useCurrencyConversion.tsx @@ -6,6 +6,7 @@ import { AlexSDK, Currency } from 'alex-sdk'; import BigNumber from 'bignumber.js'; import { SwapToken } from './types'; +// eslint-disable-next-line import/prefer-default-export export function useCurrencyConversion() { const alexSDK = new AlexSDK(); const { @@ -46,7 +47,14 @@ export function useCurrencyConversion() { amount, fiatAmount: amount != null - ? Number(getFiatEquivalent(amount, 'STX', stxBtcRate as any, btcFiatRate as any)) + ? Number( + getFiatEquivalent( + amount, + 'STX', + BigNumber(stxBtcRate) as any, + BigNumber(btcFiatRate) as any, + ), + ) : undefined, }; } @@ -63,7 +71,9 @@ export function useCurrencyConversion() { balance: Number(ftDecimals(token.balance, token.decimals ?? 0)), fiatAmount: amount != null - ? Number(getFiatEquivalent(amount, 'FT', stxBtcRate as any, btcFiatRate as any, token)) + ? Number( + getFiatEquivalent(amount, 'FT', BigNumber(stxBtcRate), BigNumber(btcFiatRate), token), + ) : undefined, }; } diff --git a/src/app/screens/transactionStatus/index.tsx b/src/app/screens/transactionStatus/index.tsx index 000f9480c..1e397eba8 100644 --- a/src/app/screens/transactionStatus/index.tsx +++ b/src/app/screens/transactionStatus/index.tsx @@ -10,13 +10,12 @@ import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import styled from 'styled-components'; -const TxStatusContainer = styled.div({ - background: 'rgba(25, 25, 48, 0.74)', +const TxStatusContainer = styled.div((props) => ({ + background: props.theme.colors.elevation0, display: 'flex', flexDirection: 'column', height: '100%', - backdropFilter: 'blur(16px)', -}); +})); const Container = styled.div({ display: 'flex', @@ -84,14 +83,14 @@ const Image = styled.img({ }); const HeadingText = styled.h1((props) => ({ - ...props.theme.headline_s, + ...props.theme.typography.headline_s, color: props.theme.colors.white_0, textAlign: 'center', marginTop: props.theme.spacing(8), })); const BodyText = styled.h1((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, color: props.theme.colors.white_400, marginTop: props.theme.spacing(8), textAlign: 'center', @@ -110,19 +109,19 @@ const TxIDText = styled.h1((props) => ({ })); const BeforeButtonText = styled.h1((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, color: props.theme.colors.white_400, })); const IDText = styled.h1((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, color: props.theme.colors.white_0, marginTop: props.theme.spacing(2), wordBreak: 'break-all', })); const ButtonText = styled.h1((props) => ({ - ...props.theme.body_m, + ...props.theme.typography.body_m, marginRight: props.theme.spacing(2), color: props.theme.colors.white_0, })); @@ -152,6 +151,7 @@ function TransactionStatus() { browserTx, isOrdinal, isNft, + isRareSat, errorTitle, isBrc20TokenFlow, isSponsorServiceError, @@ -186,9 +186,10 @@ function TransactionStatus() { const onCloseClick = () => { if (browserTx) window.close(); - else if (isOrdinal) navigate(-4); - else if (isNft) navigate(-3); - else navigate(-3); + else if (isRareSat) navigate('/nft-dashboard?tab=rareSats'); + else if (isOrdinal) navigate('/nft-dashboard?tab=inscriptions'); + else if (isNft) navigate('/nft-dashboard?tab=nfts'); + else navigate('/'); }; const handleClickTrySwapAgain = () => { diff --git a/src/app/stores/index.ts b/src/app/stores/index.ts index 94f0fbe20..d8fdd1d65 100644 --- a/src/app/stores/index.ts +++ b/src/app/stores/index.ts @@ -3,7 +3,6 @@ import { applyMiddleware, combineReducers, createStore } from 'redux'; import { PersistConfig, persistReducer, persistStore } from 'redux-persist'; import { createStateSyncMiddleware, initMessageListener } from 'redux-state-sync'; import NftDataStateReducer from './nftData/reducer'; -import * as actions from './wallet/actions/types'; import { WalletState } from './wallet/actions/types'; import walletReducer from './wallet/reducer'; @@ -33,14 +32,8 @@ export type StoreState = ReturnType; const storeMiddleware = [ createStateSyncMiddleware({ - // We only want to sync seedphrase data for onboarding - whitelist: [ - actions.StoreEncryptedSeedKey, - actions.SelectAccountKey, - actions.SetWalletUnlockedKey, - actions.AddAccountKey, - actions.UpdateLedgerAccountsKey, - ], + // We don't want to sync the redux-persist actions + blacklist: ['persist/PERSIST', 'persist/REHYDRATE'], }), ]; const store = createStore(persistedReducer, applyMiddleware(...storeMiddleware)); diff --git a/src/app/stores/nftData/actions/actionCreator.ts b/src/app/stores/nftData/actions/actionCreator.ts index 6c98635e9..e87b88878 100644 --- a/src/app/stores/nftData/actions/actionCreator.ts +++ b/src/app/stores/nftData/actions/actionCreator.ts @@ -1,15 +1,6 @@ -/* eslint-disable import/prefer-default-export */ -import { NftData } from '@secretkeylabs/xverse-core/types/api/stacks/assets'; -import { Inscription } from '@secretkeylabs/xverse-core/types/api/ordinals'; +import { Inscription } from '@secretkeylabs/xverse-core'; import * as actions from './types'; -export function setNftDataAction(nftData: NftData[]): actions.SetNftData { - return { - type: actions.SetNftDataKey, - nftData, - }; -} - export function setSelectedOrdinalAction( selectedOrdinal: Inscription | null, ): actions.SetSelectedOrdinal { diff --git a/src/app/stores/nftData/actions/types.ts b/src/app/stores/nftData/actions/types.ts index 7c76f3b7f..69056dd72 100644 --- a/src/app/stores/nftData/actions/types.ts +++ b/src/app/stores/nftData/actions/types.ts @@ -1,26 +1,16 @@ -import { Inscription } from '@secretkeylabs/xverse-core/types/api/ordinals'; -import { NftData } from '@secretkeylabs/xverse-core/types/api/stacks/assets'; +import type { Inscription } from '@secretkeylabs/xverse-core'; import { Bundle } from '@utils/rareSats'; export interface NftDataState { - nftData: NftData[]; selectedOrdinal: Inscription | null; selectedSatBundle: Bundle | null; selectedSatBundleItemIndex: number | null; } -export const SetNftDataKey = 'SetNftData'; - export const SetSelectedOrdinalKey = 'SetSelectedOrdinal'; - export const SetSelectedSatBundleKey = 'SetSelectedSatBundle'; export const SetSelectedSatBundleItemIndexKey = 'SetSelectedSatBundleItemIndex'; -export interface SetNftData { - type: typeof SetNftDataKey; - nftData: NftData[]; -} - export interface SetSelectedOrdinal { type: typeof SetSelectedOrdinalKey; selectedOrdinal: Inscription | null; @@ -36,7 +26,6 @@ export interface SetSelectedSatBundleItemIndex { } export type NftDataAction = - | SetNftData | SetSelectedOrdinal | SetSelectedSatBundle | SetSelectedSatBundleItemIndex; diff --git a/src/app/stores/nftData/reducer.ts b/src/app/stores/nftData/reducer.ts index 8d4c4701c..4d37c0bb7 100644 --- a/src/app/stores/nftData/reducer.ts +++ b/src/app/stores/nftData/reducer.ts @@ -1,14 +1,12 @@ import { NftDataAction, NftDataState, - SetNftDataKey, SetSelectedOrdinalKey, SetSelectedSatBundleItemIndexKey, SetSelectedSatBundleKey, } from './actions/types'; const initialNftDataState: NftDataState = { - nftData: [], selectedOrdinal: null, selectedSatBundle: null, selectedSatBundleItemIndex: null, @@ -20,11 +18,6 @@ const NftDataStateReducer = ( action: NftDataAction, ): NftDataState => { switch (action.type) { - case SetNftDataKey: - return { - ...state, - nftData: action.nftData, - }; case SetSelectedOrdinalKey: return { ...state, diff --git a/src/app/stores/wallet/actions/actionCreators.ts b/src/app/stores/wallet/actions/actionCreators.ts index cbf9a060e..3648dd6c0 100644 --- a/src/app/stores/wallet/actions/actionCreators.ts +++ b/src/app/stores/wallet/actions/actionCreators.ts @@ -13,6 +13,16 @@ import type { import BigNumber from 'bignumber.js'; import * as actions from './types'; +type NumberLike = string | number | bigint | BigNumber; + +function numberLikeToStringOrThrow(value: NumberLike, name: string): string { + if (typeof value !== 'bigint' && BigNumber(value).isNaN()) { + throw new Error(`Invalid value for ${name}: ${value}`); + } + + return `${value}`; +} + export function setWalletAction(wallet: BaseWallet): actions.SetWallet { return { type: actions.SetWalletKey, @@ -103,37 +113,37 @@ export function setFeeMultiplierAction(feeMultipliers: AppInfo): actions.SetFeeM } export function setCoinRatesAction( - stxBtcRate: BigNumber, - btcFiatRate: BigNumber, + stxBtcRate: NumberLike, + btcFiatRate: NumberLike, ): actions.SetCoinRates { return { type: actions.SetCoinRatesKey, - stxBtcRate, - btcFiatRate, + stxBtcRate: numberLikeToStringOrThrow(stxBtcRate, 'stx fiat rate'), + btcFiatRate: numberLikeToStringOrThrow(btcFiatRate, 'btc fiat rate'), }; } export function setStxWalletDataAction( - stxBalance: BigNumber, - stxAvailableBalance: BigNumber, - stxLockedBalance: BigNumber, + stxBalance: NumberLike, + stxAvailableBalance: NumberLike, + stxLockedBalance: NumberLike, stxTransactions: TransactionData[], stxNonce: number, ): actions.SetStxWalletData { return { type: actions.SetStxWalletDataKey, - stxBalance, - stxAvailableBalance, - stxLockedBalance, + stxBalance: numberLikeToStringOrThrow(stxBalance, 'stx balance'), + stxAvailableBalance: numberLikeToStringOrThrow(stxAvailableBalance, 'stx available'), + stxLockedBalance: numberLikeToStringOrThrow(stxLockedBalance, 'stx locked'), stxTransactions, stxNonce, }; } -export function SetBtcWalletDataAction(balance: BigNumber): actions.SetBtcWalletData { +export function SetBtcWalletDataAction(balance: NumberLike): actions.SetBtcWalletData { return { type: actions.SetBtcWalletDataKey, - balance, + balance: numberLikeToStringOrThrow(balance, 'bitcoin balance'), }; } diff --git a/src/app/stores/wallet/actions/types.ts b/src/app/stores/wallet/actions/types.ts index 26c2db85b..df898784b 100644 --- a/src/app/stores/wallet/actions/types.ts +++ b/src/app/stores/wallet/actions/types.ts @@ -9,7 +9,6 @@ import type { SupportedCurrency, TransactionData, } from '@secretkeylabs/xverse-core'; -import BigNumber from 'bignumber.js'; export const SetWalletKey = 'SetWallet'; export const ResetWalletKey = 'ResetWallet'; @@ -67,13 +66,13 @@ export interface WalletState { network: SettingsNetwork; encryptedSeed: string; fiatCurrency: SupportedCurrency; - btcFiatRate: BigNumber; - stxBtcRate: BigNumber; - stxBalance: BigNumber; - stxAvailableBalance: BigNumber; - stxLockedBalance: BigNumber; + btcFiatRate: string; + stxBtcRate: string; + stxBalance: string; + stxAvailableBalance: string; + stxLockedBalance: string; stxNonce: number; - btcBalance: BigNumber; + btcBalance: string; coinsList: FungibleToken[] | null; coins: Coin[]; brcCoinsList: FungibleToken[] | null; @@ -142,22 +141,22 @@ export interface SelectAccount { } export interface SetCoinRates { type: typeof SetCoinRatesKey; - stxBtcRate: BigNumber; - btcFiatRate: BigNumber; + stxBtcRate: string; + btcFiatRate: string; } export interface SetStxWalletData { type: typeof SetStxWalletDataKey; - stxBalance: BigNumber; - stxAvailableBalance: BigNumber; - stxLockedBalance: BigNumber; + stxBalance: string; + stxAvailableBalance: string; + stxLockedBalance: string; stxTransactions: TransactionData[]; stxNonce: number; } export interface SetBtcWalletData { type: typeof SetBtcWalletDataKey; - balance: BigNumber; + balance: string; } export interface SetCoinData { @@ -248,6 +247,7 @@ export type WalletActions = | GetActiveAccounts | ChangeActivateOrdinals | ChangeActivateRareSats + | SetRareSatsNoticeDismissed | ChangeShowBtcReceiveAlert | ChangeShowOrdinalReceiveAlert | ChangeShowDataCollectionAlert diff --git a/src/app/stores/wallet/reducer.ts b/src/app/stores/wallet/reducer.ts index 6b95f5164..fee58665e 100644 --- a/src/app/stores/wallet/reducer.ts +++ b/src/app/stores/wallet/reducer.ts @@ -1,15 +1,16 @@ import { initialNetworksList } from '@utils/constants'; -import BigNumber from 'bignumber.js'; import { AddAccountKey, ChangeFiatCurrencyKey, ChangeHasActivatedOrdinalsKey, + ChangeHasActivatedRareSatsKey, ChangeNetworkKey, ChangeShowBtcReceiveAlertKey, + ChangeShowDataCollectionAlertKey, ChangeShowOrdinalReceiveAlertKey, - UpdateLedgerAccountsKey, FetchAccountKey, GetActiveAccountsKey, + RareSatsNoticeDismissedKey, ResetWalletKey, SelectAccountKey, SetBrcCoinsListKey, @@ -20,15 +21,13 @@ import { SetStxWalletDataKey, SetWalletKey, SetWalletLockPeriodKey, + SetWalletUnlockedKey, StoreEncryptedSeedKey, + UpdateLedgerAccountsKey, UpdateVisibleCoinListKey, WalletActions, WalletSessionPeriods, WalletState, - SetWalletUnlockedKey, - ChangeShowDataCollectionAlertKey, - RareSatsNoticeDismissedKey, - ChangeHasActivatedRareSatsKey, } from './actions/types'; const initialWalletState: WalletState = { @@ -45,13 +44,13 @@ const initialWalletState: WalletState = { selectedAccount: null, encryptedSeed: '', fiatCurrency: 'USD', - btcFiatRate: new BigNumber(0), - stxBtcRate: new BigNumber(0), - stxBalance: new BigNumber(0), - stxAvailableBalance: new BigNumber(0), - stxLockedBalance: new BigNumber(0), + btcFiatRate: '0', + stxBtcRate: '0', + stxBalance: '0', + stxAvailableBalance: '0', + stxLockedBalance: '0', stxNonce: 0, - btcBalance: new BigNumber(0), + btcBalance: '0', coinsList: null, coins: [], brcCoinsList: [], diff --git a/src/app/ui-library/snackBar.tsx b/src/app/ui-library/snackBar.tsx new file mode 100644 index 000000000..d546d399a --- /dev/null +++ b/src/app/ui-library/snackBar.tsx @@ -0,0 +1,75 @@ +import toast from 'react-hot-toast'; +import { useTranslation } from 'react-i18next'; +import styled from 'styled-components'; + +type ToastType = 'success' | 'error' | 'neutral'; + +interface ToastProps { + text: string; + type: ToastType; +} + +const getBackgroundColor = (type: ToastType, theme: any): string => { + const colors = { + success: theme.colors.feedback.success, + error: theme.colors.feedback.error, + neutral: theme.colors.feedback.neutral, + }; + return colors[type] || theme.colors.feedback.neutral; +}; + +const getTextColor = (type: ToastType, theme: any): string => { + const colors = { + success: theme.colors.elevation0, + error: theme.colors.white_0, + neutral: theme.colors.white_0, + }; + return colors[type] || theme.colors.elevation0; +}; + +const ToastContainer = styled.div<{ type: ToastType }>` + display: flex; + flex-direction: row; + background: ${(props) => getBackgroundColor(props.type, props.theme)}; + border-radius: 12px; + box-shadow: 0px 7px 16px -4px rgba(25, 25, 48, 0.25); + height: 44px; + padding: 12px 20px; + width: auto; + max-width: 306px; + align-items: center; + justify-content: space-between; + margin-bottom: 80px; +`; + +const ToastMessage = styled.h1<{ type: ToastType }>` + ${({ theme }) => theme.typography.body_medium_m}; + color: ${(props) => getTextColor(props.type, props.theme)}; + margin-right: 24px; +`; + +const ToastDismissButton = styled.h1<{ type: ToastType }>` + ${({ theme }) => theme.typography.body_medium_m}; + color: ${(props) => getTextColor(props.type, props.theme)}; + background: transparent; + cursor: pointer; +`; + +export function SnackBar({ text, type }: ToastProps) { + const { t } = useTranslation('translation'); + + const dismissToast = () => { + toast.dismiss(); + }; + + return ( + + {text} + + {t('OK')} + + + ); +} + +export default SnackBar; diff --git a/src/app/utils/nfts.ts b/src/app/utils/nfts.ts new file mode 100644 index 000000000..5ab03f46b --- /dev/null +++ b/src/app/utils/nfts.ts @@ -0,0 +1,36 @@ +import { getBnsNftName, NonFungibleToken, StacksCollectionData } from '@secretkeylabs/xverse-core'; + +export const getNftsTabGridItemSubText = (collection: StacksCollectionData) => + collection?.all_nfts?.length > 1 ? `${collection.all_nfts.length} Items` : '1 Item'; + +export const isBnsCollection = (collectionId?: string | null): boolean => + collectionId === 'SP000000000000000000002Q6VF78.bns'; + +// fully_qualified_token_id like: +// SP1E1RNN4JZ7T6Y0JVCSY2TH4918Z590P8JAB9HZM.radboy-first-feat::radboy-first-feat:64 +export const getFullyQualifiedKey = ({ + tokenId, + contractName, + contractAddress, +}: NonFungibleToken['identifier']) => + `${contractAddress}.${contractName}::${contractName}:${tokenId}`; + +export const getIdentifier = (fullyQualifiedKey: string): NonFungibleToken['identifier'] => { + const [principal, , contractName, tokenId] = fullyQualifiedKey.split(':'); + const [contractAddress] = principal.split('.'); + return { + tokenId, + contractName, + contractAddress, + }; +}; + +export const getNftCollectionsGridItemId = ( + nft: NonFungibleToken, + collectionData: StacksCollectionData, +) => + isBnsCollection(collectionData?.collection_id) + ? getBnsNftName(nft) + : nft?.identifier.tokenId + ? `${collectionData?.collection_name} #${nft?.identifier.tokenId}` + : `${collectionData?.collection_name}`; diff --git a/src/assets/img/nftDashboard/bns.svg b/src/assets/img/nftDashboard/bns.svg new file mode 100644 index 000000000..5d77a17ba --- /dev/null +++ b/src/assets/img/nftDashboard/bns.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/assets/img/nftDashboard/ic_nft_diamond.svg b/src/assets/img/nftDashboard/ic_nft_diamond.svg deleted file mode 100644 index b78cce2ce..000000000 --- a/src/assets/img/nftDashboard/ic_nft_diamond.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/img/nftDashboard/nft_user.svg b/src/assets/img/nftDashboard/nft_user.svg deleted file mode 100644 index 0101a3c43..000000000 --- a/src/assets/img/nftDashboard/nft_user.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/locales/en.json b/src/locales/en.json index 4f09fcf17..140f535f4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -539,7 +539,8 @@ "ERROR_RETRIEVING": "We are having trouble retrieving data.", "TRY_AGAIN": "Please try again later.", "LOAD_MORE": "Load more", - "TOTAL_ITEMS": "{{total}} items", + "TOTAL_ITEMS_one": "{{count}} item", + "TOTAL_ITEMS_other": "{{count}} items", "WEB_GALLERY": "Open gallery", "RECEIVE": "Receive", "SEND": "Send", @@ -630,7 +631,7 @@ "RARITY": "Overall rarity", "CONTRACT_ID": "Contract ID", "ATTRIBUTES": "Attributes", - "VIEW_CONTRACT": "View the contract on", + "VIEW_CONTRACT": "View on", "STACKS_EXPLORER": "Stacks Explorer", "DETAILS": "See detail on", "GAMMA": "Gamma.io", @@ -912,7 +913,7 @@ }, "COMPLETE": { "INSCRIBED": "Ordinal inscribed", - "MESSAGE": "Your ordinal have been successfully inscribed and should appear in a few minutes.", + "MESSAGE": "Your ordinal has been successfully inscribed and should appear in a few minutes.", "SEE_ON": "See on", "BITCOIN_EXPLORER": "mempool", "TRANSACTION_ID": "Transaction ID", @@ -1107,11 +1108,14 @@ "RARE_SAT": "Rare Sat", "INSCRIBED_SAT": "Inscribed Sat" }, - "ORDINALS_COLLECTION_SCREEN": { + "COLLECTIBLE_COLLECTION_SCREEN": { "BACK_TO_GALLERY": "Back to gallery", "COLLECTION_FLOOR_PRICE": "Collection floor price", "EST_PORTFOLIO_VALUE": "Est. portfolio value", "COLLECTION": "Collection", - "LOAD_MORE": "Load more" + "LOAD_MORE": "Load more", + "ERRORS": { + "FAILED_TO_FETCH": "Failed to fetch data" + } } } diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 47da6c8e9..e779d1399 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -7,3 +7,4 @@ declare module '*.jpeg'; declare module '*.jpg'; declare module '*.otf'; declare module '*.ttf'; +declare module 'react-is-visible';