@0xsequence/wallet-widget 0.0.0-20250314205219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +219 -0
- package/README.md +53 -0
- package/dist/cjs/components/Alert.js +15 -0
- package/dist/cjs/components/Alert.js.map +1 -0
- package/dist/cjs/components/CoinRow.js +19 -0
- package/dist/cjs/components/CoinRow.js.map +1 -0
- package/dist/cjs/components/CollectibleTileImage.js +10 -0
- package/dist/cjs/components/CollectibleTileImage.js.map +1 -0
- package/dist/cjs/components/CopyButton.js +25 -0
- package/dist/cjs/components/CopyButton.js.map +1 -0
- package/dist/cjs/components/DefaultIcon.js +13 -0
- package/dist/cjs/components/DefaultIcon.js.map +1 -0
- package/dist/cjs/components/FeeOptionSelector.js +48 -0
- package/dist/cjs/components/FeeOptionSelector.js.map +1 -0
- package/dist/cjs/components/InfiniteScroll.js +42 -0
- package/dist/cjs/components/InfiniteScroll.js.map +1 -0
- package/dist/cjs/components/Loader.js +10 -0
- package/dist/cjs/components/Loader.js.map +1 -0
- package/dist/cjs/components/NavigationHeader/index.js +26 -0
- package/dist/cjs/components/NavigationHeader/index.js.map +1 -0
- package/dist/cjs/components/NetworkBadge.js +18 -0
- package/dist/cjs/components/NetworkBadge.js.map +1 -0
- package/dist/cjs/components/SelectButton/SelectButton.js +12 -0
- package/dist/cjs/components/SelectButton/SelectButton.js.map +1 -0
- package/dist/cjs/components/SelectButton/SelectedIndicator.js +12 -0
- package/dist/cjs/components/SelectButton/SelectedIndicator.js.map +1 -0
- package/dist/cjs/components/SelectButton/index.js +6 -0
- package/dist/cjs/components/SelectButton/index.js.map +1 -0
- package/dist/cjs/components/SendItemInfo.js +21 -0
- package/dist/cjs/components/SendItemInfo.js.map +1 -0
- package/dist/cjs/components/SequenceWalletProvider/SequenceWalletProvider.js +55 -0
- package/dist/cjs/components/SequenceWalletProvider/SequenceWalletProvider.js.map +1 -0
- package/dist/cjs/components/SequenceWalletProvider/index.js +18 -0
- package/dist/cjs/components/SequenceWalletProvider/index.js.map +1 -0
- package/dist/cjs/components/SequenceWalletProvider/utils/index.js +84 -0
- package/dist/cjs/components/SequenceWalletProvider/utils/index.js.map +1 -0
- package/dist/cjs/components/TransactionConfirmation.js +65 -0
- package/dist/cjs/components/TransactionConfirmation.js.map +1 -0
- package/dist/cjs/components/TransactionHistoryList/TransactionHistoryItem.js +117 -0
- package/dist/cjs/components/TransactionHistoryList/TransactionHistoryItem.js.map +1 -0
- package/dist/cjs/components/TransactionHistoryList/TransactionHistorySkeleton.js +17 -0
- package/dist/cjs/components/TransactionHistoryList/TransactionHistorySkeleton.js.map +1 -0
- package/dist/cjs/components/TransactionHistoryList/index.js +97 -0
- package/dist/cjs/components/TransactionHistoryList/index.js.map +1 -0
- package/dist/cjs/components/WalletHeader/components/AccountInformation.js +15 -0
- package/dist/cjs/components/WalletHeader/components/AccountInformation.js.map +1 -0
- package/dist/cjs/components/WalletHeader/components/WalletDropdownContent.js +57 -0
- package/dist/cjs/components/WalletHeader/components/WalletDropdownContent.js.map +1 -0
- package/dist/cjs/components/WalletHeader/index.js +87 -0
- package/dist/cjs/components/WalletHeader/index.js.map +1 -0
- package/dist/cjs/constants/abi.js +92 -0
- package/dist/cjs/constants/abi.js.map +1 -0
- package/dist/cjs/constants/currency.js +29 -0
- package/dist/cjs/constants/currency.js.map +1 -0
- package/dist/cjs/constants/index.js +20 -0
- package/dist/cjs/constants/index.js.map +1 -0
- package/dist/cjs/constants/sizing.js +5 -0
- package/dist/cjs/constants/sizing.js.map +1 -0
- package/dist/cjs/contexts/Navigation.js +8 -0
- package/dist/cjs/contexts/Navigation.js.map +1 -0
- package/dist/cjs/contexts/WalletModal.js +8 -0
- package/dist/cjs/contexts/WalletModal.js.map +1 -0
- package/dist/cjs/contexts/genericContext.js +20 -0
- package/dist/cjs/contexts/genericContext.js.map +1 -0
- package/dist/cjs/contexts/index.js +19 -0
- package/dist/cjs/contexts/index.js.map +1 -0
- package/dist/cjs/hooks/index.js +20 -0
- package/dist/cjs/hooks/index.js.map +1 -0
- package/dist/cjs/hooks/useNavigation.js +23 -0
- package/dist/cjs/hooks/useNavigation.js.map +1 -0
- package/dist/cjs/hooks/useOpenWalletModal.js +10 -0
- package/dist/cjs/hooks/useOpenWalletModal.js.map +1 -0
- package/dist/cjs/hooks/useScrollbarWidth.js +13 -0
- package/dist/cjs/hooks/useScrollbarWidth.js.map +1 -0
- package/dist/cjs/hooks/useSettings.js +100 -0
- package/dist/cjs/hooks/useSettings.js.map +1 -0
- package/dist/cjs/index.js +12 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/utils/helpers.js +49 -0
- package/dist/cjs/utils/helpers.js.map +1 -0
- package/dist/cjs/utils/index.js +19 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/cjs/utils/tokens.js +78 -0
- package/dist/cjs/utils/tokens.js.map +1 -0
- package/dist/cjs/views/CoinDetails/Skeleton.js +13 -0
- package/dist/cjs/views/CoinDetails/Skeleton.js.map +1 -0
- package/dist/cjs/views/CoinDetails/index.js +90 -0
- package/dist/cjs/views/CoinDetails/index.js.map +1 -0
- package/dist/cjs/views/CollectibleDetails/Skeleton.js +14 -0
- package/dist/cjs/views/CollectibleDetails/Skeleton.js.map +1 -0
- package/dist/cjs/views/CollectibleDetails/index.js +83 -0
- package/dist/cjs/views/CollectibleDetails/index.js.map +1 -0
- package/dist/cjs/views/CollectionDetails/Skeleton.js +15 -0
- package/dist/cjs/views/CollectionDetails/Skeleton.js.map +1 -0
- package/dist/cjs/views/CollectionDetails/index.js +50 -0
- package/dist/cjs/views/CollectionDetails/index.js.map +1 -0
- package/dist/cjs/views/History.js +19 -0
- package/dist/cjs/views/History.js.map +1 -0
- package/dist/cjs/views/Home/components/AssetSummary/CoinTile/CoinTileContent.js +14 -0
- package/dist/cjs/views/Home/components/AssetSummary/CoinTile/CoinTileContent.js.map +1 -0
- package/dist/cjs/views/Home/components/AssetSummary/CoinTile/index.js +60 -0
- package/dist/cjs/views/Home/components/AssetSummary/CoinTile/index.js.map +1 -0
- package/dist/cjs/views/Home/components/AssetSummary/CollectibleTile/index.js +17 -0
- package/dist/cjs/views/Home/components/AssetSummary/CollectibleTile/index.js.map +1 -0
- package/dist/cjs/views/Home/components/AssetSummary/SkeletonTiles.js +14 -0
- package/dist/cjs/views/Home/components/AssetSummary/SkeletonTiles.js.map +1 -0
- package/dist/cjs/views/Home/components/AssetSummary/index.js +98 -0
- package/dist/cjs/views/Home/components/AssetSummary/index.js.map +1 -0
- package/dist/cjs/views/Home/index.js +10 -0
- package/dist/cjs/views/Home/index.js.map +1 -0
- package/dist/cjs/views/Receive.js +42 -0
- package/dist/cjs/views/Receive.js.map +1 -0
- package/dist/cjs/views/Search/SearchWallet.js +112 -0
- package/dist/cjs/views/Search/SearchWallet.js.map +1 -0
- package/dist/cjs/views/Search/SearchWalletViewAll.js +169 -0
- package/dist/cjs/views/Search/SearchWalletViewAll.js.map +1 -0
- package/dist/cjs/views/Search/components/BalanceItem.js +52 -0
- package/dist/cjs/views/Search/components/BalanceItem.js.map +1 -0
- package/dist/cjs/views/Search/components/CoinsTab.js +49 -0
- package/dist/cjs/views/Search/components/CoinsTab.js.map +1 -0
- package/dist/cjs/views/Search/components/CollectionsTab.js +49 -0
- package/dist/cjs/views/Search/components/CollectionsTab.js.map +1 -0
- package/dist/cjs/views/Search/components/WalletLink.js +15 -0
- package/dist/cjs/views/Search/components/WalletLink.js.map +1 -0
- package/dist/cjs/views/Search/index.js +19 -0
- package/dist/cjs/views/Search/index.js.map +1 -0
- package/dist/cjs/views/SendCoin.js +198 -0
- package/dist/cjs/views/SendCoin.js.map +1 -0
- package/dist/cjs/views/SendCollectible.js +237 -0
- package/dist/cjs/views/SendCollectible.js.map +1 -0
- package/dist/cjs/views/Settings/Currency.js +16 -0
- package/dist/cjs/views/Settings/Currency.js.map +1 -0
- package/dist/cjs/views/Settings/General.js +23 -0
- package/dist/cjs/views/Settings/General.js.map +1 -0
- package/dist/cjs/views/Settings/Menu.js +28 -0
- package/dist/cjs/views/Settings/Menu.js.map +1 -0
- package/dist/cjs/views/Settings/Network.js +35 -0
- package/dist/cjs/views/Settings/Network.js.map +1 -0
- package/dist/cjs/views/Settings/index.js +21 -0
- package/dist/cjs/views/Settings/index.js.map +1 -0
- package/dist/cjs/views/SwapCoin/SwapList.js +190 -0
- package/dist/cjs/views/SwapCoin/SwapList.js.map +1 -0
- package/dist/cjs/views/SwapCoin/index.js +89 -0
- package/dist/cjs/views/SwapCoin/index.js.map +1 -0
- package/dist/cjs/views/TransactionDetails/index.js +88 -0
- package/dist/cjs/views/TransactionDetails/index.js.map +1 -0
- package/dist/cjs/views/index.js +30 -0
- package/dist/cjs/views/index.js.map +1 -0
- package/dist/esm/components/Alert.js +11 -0
- package/dist/esm/components/Alert.js.map +1 -0
- package/dist/esm/components/CoinRow.js +14 -0
- package/dist/esm/components/CoinRow.js.map +1 -0
- package/dist/esm/components/CollectibleTileImage.js +6 -0
- package/dist/esm/components/CollectibleTileImage.js.map +1 -0
- package/dist/esm/components/CopyButton.js +21 -0
- package/dist/esm/components/CopyButton.js.map +1 -0
- package/dist/esm/components/DefaultIcon.js +9 -0
- package/dist/esm/components/DefaultIcon.js.map +1 -0
- package/dist/esm/components/FeeOptionSelector.js +41 -0
- package/dist/esm/components/FeeOptionSelector.js.map +1 -0
- package/dist/esm/components/InfiniteScroll.js +37 -0
- package/dist/esm/components/InfiniteScroll.js.map +1 -0
- package/dist/esm/components/Loader.js +6 -0
- package/dist/esm/components/Loader.js.map +1 -0
- package/dist/esm/components/NavigationHeader/index.js +22 -0
- package/dist/esm/components/NavigationHeader/index.js.map +1 -0
- package/dist/esm/components/NetworkBadge.js +14 -0
- package/dist/esm/components/NetworkBadge.js.map +1 -0
- package/dist/esm/components/SelectButton/SelectButton.js +8 -0
- package/dist/esm/components/SelectButton/SelectButton.js.map +1 -0
- package/dist/esm/components/SelectButton/SelectedIndicator.js +8 -0
- package/dist/esm/components/SelectButton/SelectedIndicator.js.map +1 -0
- package/dist/esm/components/SelectButton/index.js +2 -0
- package/dist/esm/components/SelectButton/index.js.map +1 -0
- package/dist/esm/components/SendItemInfo.js +16 -0
- package/dist/esm/components/SendItemInfo.js.map +1 -0
- package/dist/esm/components/SequenceWalletProvider/SequenceWalletProvider.js +50 -0
- package/dist/esm/components/SequenceWalletProvider/SequenceWalletProvider.js.map +1 -0
- package/dist/esm/components/SequenceWalletProvider/index.js +2 -0
- package/dist/esm/components/SequenceWalletProvider/index.js.map +1 -0
- package/dist/esm/components/SequenceWalletProvider/utils/index.js +79 -0
- package/dist/esm/components/SequenceWalletProvider/utils/index.js.map +1 -0
- package/dist/esm/components/TransactionConfirmation.js +61 -0
- package/dist/esm/components/TransactionConfirmation.js.map +1 -0
- package/dist/esm/components/TransactionHistoryList/TransactionHistoryItem.js +110 -0
- package/dist/esm/components/TransactionHistoryList/TransactionHistoryItem.js.map +1 -0
- package/dist/esm/components/TransactionHistoryList/TransactionHistorySkeleton.js +13 -0
- package/dist/esm/components/TransactionHistoryList/TransactionHistorySkeleton.js.map +1 -0
- package/dist/esm/components/TransactionHistoryList/index.js +93 -0
- package/dist/esm/components/TransactionHistoryList/index.js.map +1 -0
- package/dist/esm/components/WalletHeader/components/AccountInformation.js +12 -0
- package/dist/esm/components/WalletHeader/components/AccountInformation.js.map +1 -0
- package/dist/esm/components/WalletHeader/components/WalletDropdownContent.js +54 -0
- package/dist/esm/components/WalletHeader/components/WalletDropdownContent.js.map +1 -0
- package/dist/esm/components/WalletHeader/index.js +50 -0
- package/dist/esm/components/WalletHeader/index.js.map +1 -0
- package/dist/esm/constants/abi.js +89 -0
- package/dist/esm/constants/abi.js.map +1 -0
- package/dist/esm/constants/currency.js +26 -0
- package/dist/esm/constants/currency.js.map +1 -0
- package/dist/esm/constants/index.js +4 -0
- package/dist/esm/constants/index.js.map +1 -0
- package/dist/esm/constants/sizing.js +2 -0
- package/dist/esm/constants/sizing.js.map +1 -0
- package/dist/esm/contexts/Navigation.js +4 -0
- package/dist/esm/contexts/Navigation.js.map +1 -0
- package/dist/esm/contexts/WalletModal.js +4 -0
- package/dist/esm/contexts/WalletModal.js.map +1 -0
- package/dist/esm/contexts/genericContext.js +16 -0
- package/dist/esm/contexts/genericContext.js.map +1 -0
- package/dist/esm/contexts/index.js +3 -0
- package/dist/esm/contexts/index.js.map +1 -0
- package/dist/esm/hooks/index.js +4 -0
- package/dist/esm/hooks/index.js.map +1 -0
- package/dist/esm/hooks/useNavigation.js +19 -0
- package/dist/esm/hooks/useNavigation.js.map +1 -0
- package/dist/esm/hooks/useOpenWalletModal.js +6 -0
- package/dist/esm/hooks/useOpenWalletModal.js.map +1 -0
- package/dist/esm/hooks/useScrollbarWidth.js +9 -0
- package/dist/esm/hooks/useScrollbarWidth.js.map +1 -0
- package/dist/esm/hooks/useSettings.js +96 -0
- package/dist/esm/hooks/useSettings.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/utils/helpers.js +41 -0
- package/dist/esm/utils/helpers.js.map +1 -0
- package/dist/esm/utils/index.js +3 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/esm/utils/tokens.js +70 -0
- package/dist/esm/utils/tokens.js.map +1 -0
- package/dist/esm/views/CoinDetails/Skeleton.js +9 -0
- package/dist/esm/views/CoinDetails/Skeleton.js.map +1 -0
- package/dist/esm/views/CoinDetails/index.js +86 -0
- package/dist/esm/views/CoinDetails/index.js.map +1 -0
- package/dist/esm/views/CollectibleDetails/Skeleton.js +10 -0
- package/dist/esm/views/CollectibleDetails/Skeleton.js.map +1 -0
- package/dist/esm/views/CollectibleDetails/index.js +79 -0
- package/dist/esm/views/CollectibleDetails/index.js.map +1 -0
- package/dist/esm/views/CollectionDetails/Skeleton.js +11 -0
- package/dist/esm/views/CollectionDetails/Skeleton.js.map +1 -0
- package/dist/esm/views/CollectionDetails/index.js +46 -0
- package/dist/esm/views/CollectionDetails/index.js.map +1 -0
- package/dist/esm/views/History.js +15 -0
- package/dist/esm/views/History.js.map +1 -0
- package/dist/esm/views/Home/components/AssetSummary/CoinTile/CoinTileContent.js +10 -0
- package/dist/esm/views/Home/components/AssetSummary/CoinTile/CoinTileContent.js.map +1 -0
- package/dist/esm/views/Home/components/AssetSummary/CoinTile/index.js +56 -0
- package/dist/esm/views/Home/components/AssetSummary/CoinTile/index.js.map +1 -0
- package/dist/esm/views/Home/components/AssetSummary/CollectibleTile/index.js +13 -0
- package/dist/esm/views/Home/components/AssetSummary/CollectibleTile/index.js.map +1 -0
- package/dist/esm/views/Home/components/AssetSummary/SkeletonTiles.js +10 -0
- package/dist/esm/views/Home/components/AssetSummary/SkeletonTiles.js.map +1 -0
- package/dist/esm/views/Home/components/AssetSummary/index.js +94 -0
- package/dist/esm/views/Home/components/AssetSummary/index.js.map +1 -0
- package/dist/esm/views/Home/index.js +6 -0
- package/dist/esm/views/Home/index.js.map +1 -0
- package/dist/esm/views/Receive.js +38 -0
- package/dist/esm/views/Receive.js.map +1 -0
- package/dist/esm/views/Search/SearchWallet.js +105 -0
- package/dist/esm/views/Search/SearchWallet.js.map +1 -0
- package/dist/esm/views/Search/SearchWalletViewAll.js +162 -0
- package/dist/esm/views/Search/SearchWalletViewAll.js.map +1 -0
- package/dist/esm/views/Search/components/BalanceItem.js +48 -0
- package/dist/esm/views/Search/components/BalanceItem.js.map +1 -0
- package/dist/esm/views/Search/components/CoinsTab.js +45 -0
- package/dist/esm/views/Search/components/CoinsTab.js.map +1 -0
- package/dist/esm/views/Search/components/CollectionsTab.js +45 -0
- package/dist/esm/views/Search/components/CollectionsTab.js.map +1 -0
- package/dist/esm/views/Search/components/WalletLink.js +11 -0
- package/dist/esm/views/Search/components/WalletLink.js.map +1 -0
- package/dist/esm/views/Search/index.js +3 -0
- package/dist/esm/views/Search/index.js.map +1 -0
- package/dist/esm/views/SendCoin.js +194 -0
- package/dist/esm/views/SendCoin.js.map +1 -0
- package/dist/esm/views/SendCollectible.js +233 -0
- package/dist/esm/views/SendCollectible.js.map +1 -0
- package/dist/esm/views/Settings/Currency.js +12 -0
- package/dist/esm/views/Settings/Currency.js.map +1 -0
- package/dist/esm/views/Settings/General.js +19 -0
- package/dist/esm/views/Settings/General.js.map +1 -0
- package/dist/esm/views/Settings/Menu.js +24 -0
- package/dist/esm/views/Settings/Menu.js.map +1 -0
- package/dist/esm/views/Settings/Network.js +31 -0
- package/dist/esm/views/Settings/Network.js.map +1 -0
- package/dist/esm/views/Settings/index.js +5 -0
- package/dist/esm/views/Settings/index.js.map +1 -0
- package/dist/esm/views/SwapCoin/SwapList.js +186 -0
- package/dist/esm/views/SwapCoin/SwapList.js.map +1 -0
- package/dist/esm/views/SwapCoin/index.js +85 -0
- package/dist/esm/views/SwapCoin/index.js.map +1 -0
- package/dist/esm/views/TransactionDetails/index.js +81 -0
- package/dist/esm/views/TransactionDetails/index.js.map +1 -0
- package/dist/esm/views/index.js +14 -0
- package/dist/esm/views/index.js.map +1 -0
- package/dist/types/components/Alert.d.ts +12 -0
- package/dist/types/components/Alert.d.ts.map +1 -0
- package/dist/types/components/CoinRow.d.ts +13 -0
- package/dist/types/components/CoinRow.d.ts.map +1 -0
- package/dist/types/components/CollectibleTileImage.d.ts +6 -0
- package/dist/types/components/CollectibleTileImage.d.ts.map +1 -0
- package/dist/types/components/CopyButton.d.ts +10 -0
- package/dist/types/components/CopyButton.d.ts.map +1 -0
- package/dist/types/components/DefaultIcon.d.ts +6 -0
- package/dist/types/components/DefaultIcon.d.ts.map +1 -0
- package/dist/types/components/FeeOptionSelector.d.ts +29 -0
- package/dist/types/components/FeeOptionSelector.d.ts.map +1 -0
- package/dist/types/components/InfiniteScroll.d.ts +9 -0
- package/dist/types/components/InfiniteScroll.d.ts.map +1 -0
- package/dist/types/components/Loader.d.ts +2 -0
- package/dist/types/components/Loader.d.ts.map +1 -0
- package/dist/types/components/NavigationHeader/index.d.ts +7 -0
- package/dist/types/components/NavigationHeader/index.d.ts.map +1 -0
- package/dist/types/components/NetworkBadge.d.ts +6 -0
- package/dist/types/components/NetworkBadge.d.ts.map +1 -0
- package/dist/types/components/SelectButton/SelectButton.d.ts +13 -0
- package/dist/types/components/SelectButton/SelectButton.d.ts.map +1 -0
- package/dist/types/components/SelectButton/SelectedIndicator.d.ts +8 -0
- package/dist/types/components/SelectButton/SelectedIndicator.d.ts.map +1 -0
- package/dist/types/components/SelectButton/index.d.ts +2 -0
- package/dist/types/components/SelectButton/index.d.ts.map +1 -0
- package/dist/types/components/SendItemInfo.d.ts +15 -0
- package/dist/types/components/SendItemInfo.d.ts.map +1 -0
- package/dist/types/components/SequenceWalletProvider/SequenceWalletProvider.d.ts +7 -0
- package/dist/types/components/SequenceWalletProvider/SequenceWalletProvider.d.ts.map +1 -0
- package/dist/types/components/SequenceWalletProvider/index.d.ts +2 -0
- package/dist/types/components/SequenceWalletProvider/index.d.ts.map +1 -0
- package/dist/types/components/SequenceWalletProvider/utils/index.d.ts +4 -0
- package/dist/types/components/SequenceWalletProvider/utils/index.d.ts.map +1 -0
- package/dist/types/components/TransactionConfirmation.d.ts +24 -0
- package/dist/types/components/TransactionConfirmation.d.ts.map +1 -0
- package/dist/types/components/TransactionHistoryList/TransactionHistoryItem.d.ts +7 -0
- package/dist/types/components/TransactionHistoryList/TransactionHistoryItem.d.ts.map +1 -0
- package/dist/types/components/TransactionHistoryList/TransactionHistorySkeleton.d.ts +2 -0
- package/dist/types/components/TransactionHistoryList/TransactionHistorySkeleton.d.ts.map +1 -0
- package/dist/types/components/TransactionHistoryList/index.d.ts +9 -0
- package/dist/types/components/TransactionHistoryList/index.d.ts.map +1 -0
- package/dist/types/components/WalletHeader/components/AccountInformation.d.ts +7 -0
- package/dist/types/components/WalletHeader/components/AccountInformation.d.ts.map +1 -0
- package/dist/types/components/WalletHeader/components/WalletDropdownContent.d.ts +7 -0
- package/dist/types/components/WalletHeader/components/WalletDropdownContent.d.ts.map +1 -0
- package/dist/types/components/WalletHeader/index.d.ts +2 -0
- package/dist/types/components/WalletHeader/index.d.ts.map +1 -0
- package/dist/types/constants/abi.d.ts +40 -0
- package/dist/types/constants/abi.d.ts.map +1 -0
- package/dist/types/constants/currency.d.ts +11 -0
- package/dist/types/constants/currency.d.ts.map +1 -0
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/constants/index.d.ts.map +1 -0
- package/dist/types/constants/sizing.d.ts +2 -0
- package/dist/types/constants/sizing.d.ts.map +1 -0
- package/dist/types/contexts/Navigation.d.ts +88 -0
- package/dist/types/contexts/Navigation.d.ts.map +1 -0
- package/dist/types/contexts/WalletModal.d.ts +11 -0
- package/dist/types/contexts/WalletModal.d.ts.map +1 -0
- package/dist/types/contexts/genericContext.d.ts +2 -0
- package/dist/types/contexts/genericContext.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts +3 -0
- package/dist/types/contexts/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +4 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/useNavigation.d.ts +10 -0
- package/dist/types/hooks/useNavigation.d.ts.map +1 -0
- package/dist/types/hooks/useOpenWalletModal.d.ts +5 -0
- package/dist/types/hooks/useOpenWalletModal.d.ts.map +1 -0
- package/dist/types/hooks/useScrollbarWidth.d.ts +2 -0
- package/dist/types/hooks/useScrollbarWidth.d.ts.map +1 -0
- package/dist/types/hooks/useSettings.d.ts +14 -0
- package/dist/types/hooks/useSettings.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/utils/helpers.d.ts +6 -0
- package/dist/types/utils/helpers.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/tokens.d.ts +21 -0
- package/dist/types/utils/tokens.d.ts.map +1 -0
- package/dist/types/views/CoinDetails/Skeleton.d.ts +7 -0
- package/dist/types/views/CoinDetails/Skeleton.d.ts.map +1 -0
- package/dist/types/views/CoinDetails/index.d.ts +6 -0
- package/dist/types/views/CoinDetails/index.d.ts.map +1 -0
- package/dist/types/views/CollectibleDetails/Skeleton.d.ts +6 -0
- package/dist/types/views/CollectibleDetails/Skeleton.d.ts.map +1 -0
- package/dist/types/views/CollectibleDetails/index.d.ts +7 -0
- package/dist/types/views/CollectibleDetails/index.d.ts.map +1 -0
- package/dist/types/views/CollectionDetails/Skeleton.d.ts +6 -0
- package/dist/types/views/CollectionDetails/Skeleton.d.ts.map +1 -0
- package/dist/types/views/CollectionDetails/index.d.ts +7 -0
- package/dist/types/views/CollectionDetails/index.d.ts.map +1 -0
- package/dist/types/views/History.d.ts +2 -0
- package/dist/types/views/History.d.ts.map +1 -0
- package/dist/types/views/Home/components/AssetSummary/CoinTile/CoinTileContent.d.ts +12 -0
- package/dist/types/views/Home/components/AssetSummary/CoinTile/CoinTileContent.d.ts.map +1 -0
- package/dist/types/views/Home/components/AssetSummary/CoinTile/index.d.ts +7 -0
- package/dist/types/views/Home/components/AssetSummary/CoinTile/index.d.ts.map +1 -0
- package/dist/types/views/Home/components/AssetSummary/CollectibleTile/index.d.ts +7 -0
- package/dist/types/views/Home/components/AssetSummary/CollectibleTile/index.d.ts.map +1 -0
- package/dist/types/views/Home/components/AssetSummary/SkeletonTiles.d.ts +2 -0
- package/dist/types/views/Home/components/AssetSummary/SkeletonTiles.d.ts.map +1 -0
- package/dist/types/views/Home/components/AssetSummary/index.d.ts +2 -0
- package/dist/types/views/Home/components/AssetSummary/index.d.ts.map +1 -0
- package/dist/types/views/Home/index.d.ts +2 -0
- package/dist/types/views/Home/index.d.ts.map +1 -0
- package/dist/types/views/Receive.d.ts +2 -0
- package/dist/types/views/Receive.d.ts.map +1 -0
- package/dist/types/views/Search/SearchWallet.d.ts +2 -0
- package/dist/types/views/Search/SearchWallet.d.ts.map +1 -0
- package/dist/types/views/Search/SearchWalletViewAll.d.ts +10 -0
- package/dist/types/views/Search/SearchWalletViewAll.d.ts.map +1 -0
- package/dist/types/views/Search/components/BalanceItem.d.ts +7 -0
- package/dist/types/views/Search/components/BalanceItem.d.ts.map +1 -0
- package/dist/types/views/Search/components/CoinsTab.d.ts +16 -0
- package/dist/types/views/Search/components/CoinsTab.d.ts.map +1 -0
- package/dist/types/views/Search/components/CollectionsTab.d.ts +16 -0
- package/dist/types/views/Search/components/CollectionsTab.d.ts.map +1 -0
- package/dist/types/views/Search/components/WalletLink.d.ts +8 -0
- package/dist/types/views/Search/components/WalletLink.d.ts.map +1 -0
- package/dist/types/views/Search/index.d.ts +3 -0
- package/dist/types/views/Search/index.d.ts.map +1 -0
- package/dist/types/views/SendCoin.d.ts +7 -0
- package/dist/types/views/SendCoin.d.ts.map +1 -0
- package/dist/types/views/SendCollectible.d.ts +8 -0
- package/dist/types/views/SendCollectible.d.ts.map +1 -0
- package/dist/types/views/Settings/Currency.d.ts +2 -0
- package/dist/types/views/Settings/Currency.d.ts.map +1 -0
- package/dist/types/views/Settings/General.d.ts +2 -0
- package/dist/types/views/Settings/General.d.ts.map +1 -0
- package/dist/types/views/Settings/Menu.d.ts +2 -0
- package/dist/types/views/Settings/Menu.d.ts.map +1 -0
- package/dist/types/views/Settings/Network.d.ts +2 -0
- package/dist/types/views/Settings/Network.d.ts.map +1 -0
- package/dist/types/views/Settings/index.d.ts +5 -0
- package/dist/types/views/Settings/index.d.ts.map +1 -0
- package/dist/types/views/SwapCoin/SwapList.d.ts +8 -0
- package/dist/types/views/SwapCoin/SwapList.d.ts.map +1 -0
- package/dist/types/views/SwapCoin/index.d.ts +6 -0
- package/dist/types/views/SwapCoin/index.d.ts.map +1 -0
- package/dist/types/views/TransactionDetails/index.d.ts +7 -0
- package/dist/types/views/TransactionDetails/index.d.ts.map +1 -0
- package/dist/types/views/index.d.ts +14 -0
- package/dist/types/views/index.d.ts.map +1 -0
- package/package.json +69 -0
- package/src/components/Alert.tsx +51 -0
- package/src/components/CoinRow.tsx +62 -0
- package/src/components/CollectibleTileImage.tsx +14 -0
- package/src/components/CopyButton.tsx +41 -0
- package/src/components/DefaultIcon.tsx +22 -0
- package/src/components/FeeOptionSelector.tsx +133 -0
- package/src/components/InfiniteScroll.tsx +56 -0
- package/src/components/Loader.tsx +12 -0
- package/src/components/NavigationHeader/index.tsx +59 -0
- package/src/components/NetworkBadge.tsx +35 -0
- package/src/components/SelectButton/SelectButton.tsx +33 -0
- package/src/components/SelectButton/SelectedIndicator.tsx +34 -0
- package/src/components/SelectButton/index.ts +1 -0
- package/src/components/SendItemInfo.tsx +83 -0
- package/src/components/SequenceWalletProvider/SequenceWalletProvider.tsx +96 -0
- package/src/components/SequenceWalletProvider/index.ts +1 -0
- package/src/components/SequenceWalletProvider/utils/index.tsx +119 -0
- package/src/components/TransactionConfirmation.tsx +183 -0
- package/src/components/TransactionHistoryList/TransactionHistoryItem.tsx +190 -0
- package/src/components/TransactionHistoryList/TransactionHistorySkeleton.tsx +36 -0
- package/src/components/TransactionHistoryList/index.tsx +160 -0
- package/src/components/WalletHeader/components/AccountInformation.tsx +31 -0
- package/src/components/WalletHeader/components/WalletDropdownContent.tsx +96 -0
- package/src/components/WalletHeader/index.tsx +84 -0
- package/src/constants/abi.ts +90 -0
- package/src/constants/currency.ts +35 -0
- package/src/constants/index.ts +3 -0
- package/src/constants/sizing.ts +1 -0
- package/src/contexts/Navigation.ts +132 -0
- package/src/contexts/WalletModal.ts +15 -0
- package/src/contexts/genericContext.ts +19 -0
- package/src/contexts/index.ts +2 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useNavigation.ts +30 -0
- package/src/hooks/useOpenWalletModal.ts +7 -0
- package/src/hooks/useScrollbarWidth.ts +11 -0
- package/src/hooks/useSettings.ts +121 -0
- package/src/index.ts +6 -0
- package/src/utils/helpers.ts +51 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/tokens.ts +98 -0
- package/src/views/CoinDetails/Skeleton.tsx +46 -0
- package/src/views/CoinDetails/index.tsx +153 -0
- package/src/views/CollectibleDetails/Skeleton.tsx +50 -0
- package/src/views/CollectibleDetails/index.tsx +184 -0
- package/src/views/CollectionDetails/Skeleton.tsx +36 -0
- package/src/views/CollectionDetails/index.tsx +98 -0
- package/src/views/History.tsx +28 -0
- package/src/views/Home/components/AssetSummary/CoinTile/CoinTileContent.tsx +60 -0
- package/src/views/Home/components/AssetSummary/CoinTile/index.tsx +93 -0
- package/src/views/Home/components/AssetSummary/CollectibleTile/index.tsx +20 -0
- package/src/views/Home/components/AssetSummary/SkeletonTiles.tsx +21 -0
- package/src/views/Home/components/AssetSummary/index.tsx +128 -0
- package/src/views/Home/index.tsx +11 -0
- package/src/views/Receive.tsx +83 -0
- package/src/views/Search/SearchWallet.tsx +177 -0
- package/src/views/Search/SearchWalletViewAll.tsx +265 -0
- package/src/views/Search/components/BalanceItem.tsx +76 -0
- package/src/views/Search/components/CoinsTab.tsx +89 -0
- package/src/views/Search/components/CollectionsTab.tsx +88 -0
- package/src/views/Search/components/WalletLink.tsx +32 -0
- package/src/views/Search/index.ts +2 -0
- package/src/views/SendCoin.tsx +397 -0
- package/src/views/SendCollectible.tsx +447 -0
- package/src/views/Settings/Currency.tsx +34 -0
- package/src/views/Settings/General.tsx +55 -0
- package/src/views/Settings/Menu.tsx +60 -0
- package/src/views/Settings/Network.tsx +60 -0
- package/src/views/Settings/index.ts +4 -0
- package/src/views/SwapCoin/SwapList.tsx +320 -0
- package/src/views/SwapCoin/index.tsx +150 -0
- package/src/views/TransactionDetails/index.tsx +213 -0
- package/src/views/index.ts +13 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { compareAddress, formatDisplay, getNativeTokenInfoByChainId, ContractVerificationStatus } from '@0xsequence/connect'
|
|
2
|
+
import { Button, SendIcon, SwapIcon, Text, TokenImage } from '@0xsequence/design-system'
|
|
3
|
+
import {
|
|
4
|
+
useGetTokenBalancesSummary,
|
|
5
|
+
useGetCoinPrices,
|
|
6
|
+
useGetExchangeRate,
|
|
7
|
+
useGetTransactionHistory
|
|
8
|
+
} from '@0xsequence/react-hooks'
|
|
9
|
+
import { formatUnits, zeroAddress } from 'viem'
|
|
10
|
+
import { useAccount, useConfig } from 'wagmi'
|
|
11
|
+
|
|
12
|
+
import { InfiniteScroll } from '../../components/InfiniteScroll'
|
|
13
|
+
import { NetworkBadge } from '../../components/NetworkBadge'
|
|
14
|
+
import { TransactionHistoryList } from '../../components/TransactionHistoryList'
|
|
15
|
+
import { HEADER_HEIGHT } from '../../constants'
|
|
16
|
+
import { useSettings, useNavigation } from '../../hooks'
|
|
17
|
+
import { computeBalanceFiat, flattenPaginatedTransactionHistory } from '../../utils'
|
|
18
|
+
|
|
19
|
+
import { CoinDetailsSkeleton } from './Skeleton'
|
|
20
|
+
|
|
21
|
+
export interface CoinDetailsProps {
|
|
22
|
+
contractAddress: string
|
|
23
|
+
chainId: number
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const CoinDetails = ({ contractAddress, chainId }: CoinDetailsProps) => {
|
|
27
|
+
const { chains } = useConfig()
|
|
28
|
+
const { setNavigation } = useNavigation()
|
|
29
|
+
const { fiatCurrency, hideUnlistedTokens } = useSettings()
|
|
30
|
+
const { address: accountAddress } = useAccount()
|
|
31
|
+
|
|
32
|
+
const isReadOnly = !chains.map(chain => chain.id).includes(chainId)
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
data: dataTransactionHistory,
|
|
36
|
+
isPending: isPendingTransactionHistory,
|
|
37
|
+
fetchNextPage,
|
|
38
|
+
hasNextPage,
|
|
39
|
+
isFetchingNextPage
|
|
40
|
+
} = useGetTransactionHistory({
|
|
41
|
+
chainId,
|
|
42
|
+
accountAddress: accountAddress || '',
|
|
43
|
+
contractAddress
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
const transactionHistory = flattenPaginatedTransactionHistory(dataTransactionHistory)
|
|
47
|
+
|
|
48
|
+
const { data: tokenBalance, isPending: isPendingCoinBalance } = useGetTokenBalancesSummary({
|
|
49
|
+
chainIds: [chainId],
|
|
50
|
+
filter: {
|
|
51
|
+
accountAddresses: [accountAddress || ''],
|
|
52
|
+
contractWhitelist: [contractAddress],
|
|
53
|
+
contractStatus: hideUnlistedTokens ? ContractVerificationStatus.VERIFIED : ContractVerificationStatus.ALL,
|
|
54
|
+
omitNativeBalances: false
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const dataCoinBalance =
|
|
59
|
+
tokenBalance && tokenBalance.length > 0
|
|
60
|
+
? compareAddress(contractAddress, zeroAddress)
|
|
61
|
+
? tokenBalance?.[0]
|
|
62
|
+
: tokenBalance?.[1]
|
|
63
|
+
: undefined
|
|
64
|
+
|
|
65
|
+
const { data: dataCoinPrices, isPending: isPendingCoinPrices } = useGetCoinPrices([
|
|
66
|
+
{
|
|
67
|
+
chainId,
|
|
68
|
+
contractAddress
|
|
69
|
+
}
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
const { data: conversionRate = 1, isPending: isPendingConversionRate } = useGetExchangeRate(fiatCurrency.symbol)
|
|
73
|
+
|
|
74
|
+
const isPending = isPendingCoinBalance || isPendingCoinPrices || isPendingConversionRate
|
|
75
|
+
|
|
76
|
+
if (isPending) {
|
|
77
|
+
return <CoinDetailsSkeleton chainId={chainId} isReadOnly={isReadOnly} />
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const isNativeToken = compareAddress(contractAddress, zeroAddress)
|
|
81
|
+
const logo = isNativeToken ? getNativeTokenInfoByChainId(chainId, chains).logoURI : dataCoinBalance?.contractInfo?.logoURI
|
|
82
|
+
const symbol = isNativeToken ? getNativeTokenInfoByChainId(chainId, chains).symbol : dataCoinBalance?.contractInfo?.symbol
|
|
83
|
+
const name = isNativeToken ? getNativeTokenInfoByChainId(chainId, chains).name : dataCoinBalance?.contractInfo?.name
|
|
84
|
+
const decimals = isNativeToken ? getNativeTokenInfoByChainId(chainId, chains).decimals : dataCoinBalance?.contractInfo?.decimals
|
|
85
|
+
const formattedBalance = formatUnits(BigInt(dataCoinBalance?.balance || '0'), decimals || 18)
|
|
86
|
+
const balanceDisplayed = formatDisplay(formattedBalance)
|
|
87
|
+
|
|
88
|
+
const coinBalanceFiat = dataCoinBalance
|
|
89
|
+
? computeBalanceFiat({
|
|
90
|
+
balance: dataCoinBalance,
|
|
91
|
+
prices: dataCoinPrices || [],
|
|
92
|
+
conversionRate,
|
|
93
|
+
decimals: decimals || 0
|
|
94
|
+
})
|
|
95
|
+
: '0'
|
|
96
|
+
|
|
97
|
+
const onClickSend = () => {
|
|
98
|
+
setNavigation({
|
|
99
|
+
location: 'send-coin',
|
|
100
|
+
params: {
|
|
101
|
+
chainId,
|
|
102
|
+
contractAddress
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const onClickSwap = () => {
|
|
108
|
+
setNavigation({
|
|
109
|
+
location: 'swap-coin',
|
|
110
|
+
params: {
|
|
111
|
+
chainId,
|
|
112
|
+
contractAddress
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
return (
|
|
117
|
+
<div style={{ paddingTop: HEADER_HEIGHT }}>
|
|
118
|
+
<div className="flex flex-col gap-10 pb-5 px-4 pt-0" style={{ marginTop: '-20px' }}>
|
|
119
|
+
<div className="flex mb-10 gap-2 items-center justify-center flex-col">
|
|
120
|
+
<TokenImage src={logo} size="xl" />
|
|
121
|
+
<Text variant="large" color="primary" fontWeight="bold">
|
|
122
|
+
{name}
|
|
123
|
+
</Text>
|
|
124
|
+
<NetworkBadge chainId={chainId} />
|
|
125
|
+
</div>
|
|
126
|
+
<div>
|
|
127
|
+
<Text variant="normal" fontWeight="medium" color="muted">
|
|
128
|
+
Balance
|
|
129
|
+
</Text>
|
|
130
|
+
<div className="flex flex-row items-end justify-between">
|
|
131
|
+
<Text variant="xlarge" fontWeight="bold" color="primary">{`${balanceDisplayed} ${symbol}`}</Text>
|
|
132
|
+
<Text variant="normal" fontWeight="medium" color="muted">{`${fiatCurrency.sign}${coinBalanceFiat}`}</Text>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
{!isReadOnly && (
|
|
136
|
+
<div className="flex gap-2">
|
|
137
|
+
<Button className="w-full text-primary" variant="primary" leftIcon={SendIcon} label="Send" onClick={onClickSend} />
|
|
138
|
+
<Button className="w-full text-primary" variant="primary" leftIcon={SwapIcon} label="Buy" onClick={onClickSwap} />
|
|
139
|
+
</div>
|
|
140
|
+
)}
|
|
141
|
+
<div>
|
|
142
|
+
<InfiniteScroll onLoad={() => fetchNextPage()} hasMore={hasNextPage}>
|
|
143
|
+
<TransactionHistoryList
|
|
144
|
+
transactions={transactionHistory}
|
|
145
|
+
isPending={isPendingTransactionHistory}
|
|
146
|
+
isFetchingNextPage={isFetchingNextPage}
|
|
147
|
+
/>
|
|
148
|
+
</InfiniteScroll>
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</div>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Button, SendIcon, Skeleton, Text } from '@0xsequence/design-system'
|
|
2
|
+
|
|
3
|
+
import { TransactionHistorySkeleton } from '../../components/TransactionHistoryList/TransactionHistorySkeleton'
|
|
4
|
+
import { HEADER_HEIGHT } from '../../constants'
|
|
5
|
+
|
|
6
|
+
interface CollectibleDetailsSkeletonProps {
|
|
7
|
+
isReadOnly: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CollectibleDetailsSkeleton = ({ isReadOnly }: CollectibleDetailsSkeletonProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<div style={{ paddingTop: HEADER_HEIGHT }}>
|
|
13
|
+
<div
|
|
14
|
+
className="flex flex-col gap-10 pb-5 px-4 pt-0"
|
|
15
|
+
style={{
|
|
16
|
+
marginTop: '-20px'
|
|
17
|
+
}}
|
|
18
|
+
>
|
|
19
|
+
<div className="flex gap-3 items-center justify-center flex-col">
|
|
20
|
+
<Skeleton style={{ width: '120px', height: '16px' }} />
|
|
21
|
+
<Skeleton style={{ width: '140px', height: '44px' }} />
|
|
22
|
+
</div>
|
|
23
|
+
<div>
|
|
24
|
+
<Skeleton style={{ width: '100%', aspectRatio: '1/1' }} />
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
{/* balance */}
|
|
28
|
+
<div>
|
|
29
|
+
<Text variant="normal" fontWeight="medium" color="muted">
|
|
30
|
+
Balance
|
|
31
|
+
</Text>
|
|
32
|
+
<div className="flex flex-row items-end justify-between">
|
|
33
|
+
<Skeleton style={{ width: '44px', height: '36px' }} />
|
|
34
|
+
<Skeleton style={{ width: '34px', height: '17px' }} />
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
{!isReadOnly && (
|
|
38
|
+
<Button className="text-primary mt-4 w-full" variant="primary" leftIcon={SendIcon} label="Send" onClick={() => {}} />
|
|
39
|
+
)}
|
|
40
|
+
</div>
|
|
41
|
+
<div>
|
|
42
|
+
<Text variant="normal" color="muted" fontWeight="medium">
|
|
43
|
+
This week
|
|
44
|
+
</Text>
|
|
45
|
+
<TransactionHistorySkeleton />
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { formatDisplay, ContractVerificationStatus } from '@0xsequence/connect'
|
|
2
|
+
import { Button, Image, NetworkImage, SendIcon, Text } from '@0xsequence/design-system'
|
|
3
|
+
import {
|
|
4
|
+
useGetTokenBalancesDetails,
|
|
5
|
+
useGetTransactionHistory,
|
|
6
|
+
useGetCollectiblePrices,
|
|
7
|
+
useGetExchangeRate
|
|
8
|
+
} from '@0xsequence/react-hooks'
|
|
9
|
+
import { formatUnits } from 'viem'
|
|
10
|
+
import { useAccount, useConfig } from 'wagmi'
|
|
11
|
+
|
|
12
|
+
import { CollectibleTileImage } from '../../components/CollectibleTileImage'
|
|
13
|
+
import { InfiniteScroll } from '../../components/InfiniteScroll'
|
|
14
|
+
import { TransactionHistoryList } from '../../components/TransactionHistoryList'
|
|
15
|
+
import { HEADER_HEIGHT } from '../../constants'
|
|
16
|
+
import { useSettings, useNavigation } from '../../hooks'
|
|
17
|
+
import { computeBalanceFiat, flattenPaginatedTransactionHistory } from '../../utils'
|
|
18
|
+
|
|
19
|
+
import { CollectibleDetailsSkeleton } from './Skeleton'
|
|
20
|
+
|
|
21
|
+
export interface CollectibleDetailsProps {
|
|
22
|
+
contractAddress: string
|
|
23
|
+
chainId: number
|
|
24
|
+
tokenId: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const CollectibleDetails = ({ contractAddress, chainId, tokenId }: CollectibleDetailsProps) => {
|
|
28
|
+
const { chains } = useConfig()
|
|
29
|
+
|
|
30
|
+
const { address: accountAddress } = useAccount()
|
|
31
|
+
const { fiatCurrency } = useSettings()
|
|
32
|
+
const { setNavigation } = useNavigation()
|
|
33
|
+
|
|
34
|
+
const isReadOnly = !chains.map(chain => chain.id).includes(chainId)
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
data: dataTransactionHistory,
|
|
38
|
+
isPending: isPendingTransactionHistory,
|
|
39
|
+
fetchNextPage,
|
|
40
|
+
hasNextPage,
|
|
41
|
+
isFetchingNextPage
|
|
42
|
+
} = useGetTransactionHistory({
|
|
43
|
+
chainId,
|
|
44
|
+
accountAddress: accountAddress || '',
|
|
45
|
+
contractAddress,
|
|
46
|
+
tokenId
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const transactionHistory = flattenPaginatedTransactionHistory(dataTransactionHistory)
|
|
50
|
+
|
|
51
|
+
const { data: dataTokens, isPending: isPendingCollectibleBalance } = useGetTokenBalancesDetails({
|
|
52
|
+
filter: {
|
|
53
|
+
accountAddresses: accountAddress ? [accountAddress] : [],
|
|
54
|
+
contractStatus: ContractVerificationStatus.ALL,
|
|
55
|
+
contractWhitelist: [contractAddress],
|
|
56
|
+
omitNativeBalances: true
|
|
57
|
+
},
|
|
58
|
+
chainIds: [chainId]
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
const dataCollectibleBalance =
|
|
62
|
+
dataTokens && dataTokens.length > 0 ? dataTokens.find(token => token.tokenID === tokenId) : undefined
|
|
63
|
+
|
|
64
|
+
const { data: dataCollectiblePrices, isPending: isPendingCollectiblePrices } = useGetCollectiblePrices([
|
|
65
|
+
{
|
|
66
|
+
chainId,
|
|
67
|
+
contractAddress,
|
|
68
|
+
tokenId
|
|
69
|
+
}
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
const { data: conversionRate = 1, isPending: isPendingConversionRate } = useGetExchangeRate(fiatCurrency.symbol)
|
|
73
|
+
|
|
74
|
+
const isPending = isPendingCollectibleBalance || isPendingCollectiblePrices || isPendingConversionRate
|
|
75
|
+
|
|
76
|
+
if (isPending) {
|
|
77
|
+
return <CollectibleDetailsSkeleton isReadOnly={isReadOnly} />
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const onClickSend = () => {
|
|
81
|
+
setNavigation({
|
|
82
|
+
location: 'send-collectible',
|
|
83
|
+
params: {
|
|
84
|
+
chainId,
|
|
85
|
+
contractAddress,
|
|
86
|
+
tokenId
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const collectionLogo = dataCollectibleBalance?.contractInfo?.logoURI
|
|
92
|
+
const collectionName = dataCollectibleBalance?.contractInfo?.name || 'Unknown Collection'
|
|
93
|
+
|
|
94
|
+
const decimals = dataCollectibleBalance?.tokenMetadata?.decimals || 0
|
|
95
|
+
const rawBalance = dataCollectibleBalance?.balance || '0'
|
|
96
|
+
const balance = formatUnits(BigInt(rawBalance), decimals)
|
|
97
|
+
const formattedBalance = formatDisplay(Number(balance))
|
|
98
|
+
|
|
99
|
+
const valueFiat = dataCollectibleBalance
|
|
100
|
+
? computeBalanceFiat({
|
|
101
|
+
balance: dataCollectibleBalance,
|
|
102
|
+
prices: dataCollectiblePrices || [],
|
|
103
|
+
conversionRate,
|
|
104
|
+
decimals: decimals
|
|
105
|
+
})
|
|
106
|
+
: '0'
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<div style={{ paddingTop: HEADER_HEIGHT }}>
|
|
110
|
+
<div
|
|
111
|
+
className="flex flex-col gap-10 pb-5 px-4 pt-0"
|
|
112
|
+
style={{
|
|
113
|
+
marginTop: '-20px'
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
<div className="flex gap-3 items-center justify-center flex-col">
|
|
117
|
+
<div className="flex flex-row gap-2 justify-center items-center">
|
|
118
|
+
{collectionLogo && (
|
|
119
|
+
<Image
|
|
120
|
+
className="rounded-full w-8"
|
|
121
|
+
src={collectionLogo}
|
|
122
|
+
alt="collection logo"
|
|
123
|
+
style={{
|
|
124
|
+
objectFit: 'cover'
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
<div className="flex gap-1 flex-row justify-center items-center">
|
|
129
|
+
<Text variant="small" fontWeight="bold" color="primary">
|
|
130
|
+
{collectionName}
|
|
131
|
+
</Text>
|
|
132
|
+
<NetworkImage chainId={chainId} size="xs" />
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
<div className="flex flex-col justify-center items-center">
|
|
136
|
+
<Text variant="large" color="primary" fontWeight="bold">
|
|
137
|
+
{dataCollectibleBalance?.tokenMetadata?.name || 'Unknown Collectible'}
|
|
138
|
+
</Text>
|
|
139
|
+
<Text variant="small" color="muted" fontWeight="medium">
|
|
140
|
+
{`#${tokenId}`}
|
|
141
|
+
</Text>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div>
|
|
145
|
+
<CollectibleTileImage imageUrl={dataCollectibleBalance?.tokenMetadata?.image} />
|
|
146
|
+
</div>
|
|
147
|
+
<div>
|
|
148
|
+
{/* balance */}
|
|
149
|
+
<div>
|
|
150
|
+
<Text variant="normal" fontWeight="medium" color="muted">
|
|
151
|
+
Balance
|
|
152
|
+
</Text>
|
|
153
|
+
<div className="flex flex-row items-end justify-between">
|
|
154
|
+
<Text variant="xlarge" fontWeight="bold" color="primary">
|
|
155
|
+
{formattedBalance}
|
|
156
|
+
</Text>
|
|
157
|
+
{dataCollectiblePrices && dataCollectiblePrices[0].price?.value && (
|
|
158
|
+
<Text variant="normal" fontWeight="medium" color="muted">{`${fiatCurrency.symbol} ${valueFiat}`}</Text>
|
|
159
|
+
)}
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
{!isReadOnly && (
|
|
163
|
+
<Button
|
|
164
|
+
className="text-primary mt-4 w-full"
|
|
165
|
+
variant="primary"
|
|
166
|
+
leftIcon={SendIcon}
|
|
167
|
+
label="Send"
|
|
168
|
+
onClick={onClickSend}
|
|
169
|
+
/>
|
|
170
|
+
)}
|
|
171
|
+
</div>
|
|
172
|
+
<div>
|
|
173
|
+
<InfiniteScroll onLoad={() => fetchNextPage()} hasMore={hasNextPage}>
|
|
174
|
+
<TransactionHistoryList
|
|
175
|
+
transactions={transactionHistory}
|
|
176
|
+
isPending={isPendingTransactionHistory}
|
|
177
|
+
isFetchingNextPage={isFetchingNextPage}
|
|
178
|
+
/>
|
|
179
|
+
</InfiniteScroll>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Skeleton } from '@0xsequence/design-system'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { NetworkBadge } from '../../components/NetworkBadge'
|
|
5
|
+
|
|
6
|
+
interface CollectionDetailsSkeletonProps {
|
|
7
|
+
chainId: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const CollectionDetailsSkeleton = ({ chainId }: CollectionDetailsSkeletonProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<div className="flex px-4 pb-5 pt-3 mt-8 flex-col items-center justify-center gap-10">
|
|
13
|
+
<div className="flex flex-col gap-2 justify-center items-center">
|
|
14
|
+
<Skeleton style={{ width: '32px', height: '32px' }} />
|
|
15
|
+
<Skeleton style={{ width: '100px', height: '24px' }} />
|
|
16
|
+
<NetworkBadge chainId={chainId} />
|
|
17
|
+
<Skeleton style={{ width: '142px', height: '17px' }} />
|
|
18
|
+
</div>
|
|
19
|
+
<div className="w-full">
|
|
20
|
+
<Skeleton style={{ width: '168px', height: '20px' }} />
|
|
21
|
+
<div
|
|
22
|
+
className="w-full mt-3 grid gap-2"
|
|
23
|
+
style={{
|
|
24
|
+
gridTemplateColumns: `calc(50% - 4px) calc(50% - 4px)`
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
{Array(8)
|
|
28
|
+
.fill(null)
|
|
29
|
+
.map((_, i) => (
|
|
30
|
+
<Skeleton className="w-full aspect-square" key={i} />
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { formatDisplay, ContractVerificationStatus } from '@0xsequence/connect'
|
|
2
|
+
import { Image, Text, TokenImage } from '@0xsequence/design-system'
|
|
3
|
+
import { TokenBalance } from '@0xsequence/indexer'
|
|
4
|
+
import { useGetTokenBalancesDetails } from '@0xsequence/react-hooks'
|
|
5
|
+
import { formatUnits } from 'viem'
|
|
6
|
+
import { useAccount } from 'wagmi'
|
|
7
|
+
|
|
8
|
+
import { NetworkBadge } from '../../components/NetworkBadge'
|
|
9
|
+
import { useNavigation } from '../../hooks'
|
|
10
|
+
|
|
11
|
+
import { CollectionDetailsSkeleton } from './Skeleton'
|
|
12
|
+
|
|
13
|
+
interface CollectionDetailsProps {
|
|
14
|
+
chainId: number
|
|
15
|
+
contractAddress: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const CollectionDetails = ({ chainId, contractAddress }: CollectionDetailsProps) => {
|
|
19
|
+
const { setNavigation } = useNavigation()
|
|
20
|
+
const { address: accountAddress } = useAccount()
|
|
21
|
+
const { data: collectionBalanceData, isPending: isPendingCollectionBalance } = useGetTokenBalancesDetails({
|
|
22
|
+
chainIds: [chainId],
|
|
23
|
+
filter: {
|
|
24
|
+
accountAddresses: accountAddress ? [accountAddress] : [],
|
|
25
|
+
contractStatus: ContractVerificationStatus.ALL,
|
|
26
|
+
contractWhitelist: [contractAddress],
|
|
27
|
+
omitNativeBalances: true
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const contractInfo = collectionBalanceData?.[0]?.contractInfo
|
|
32
|
+
const collectionLogoURI = contractInfo?.logoURI
|
|
33
|
+
|
|
34
|
+
if (isPendingCollectionBalance) {
|
|
35
|
+
return <CollectionDetailsSkeleton chainId={chainId} />
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const onClickItem = (balance: TokenBalance) => {
|
|
39
|
+
setNavigation({
|
|
40
|
+
location: 'collectible-details',
|
|
41
|
+
params: {
|
|
42
|
+
contractAddress: balance.contractAddress,
|
|
43
|
+
chainId: balance.chainId,
|
|
44
|
+
tokenId: balance.tokenID || ''
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<div className="flex px-4 pb-5 pt-3 mt-8 flex-col items-center justify-center gap-10">
|
|
51
|
+
<div className="flex flex-col gap-2 justify-center items-center">
|
|
52
|
+
<TokenImage src={collectionLogoURI} size="lg" />
|
|
53
|
+
<Text variant="large" fontWeight="bold" color="primary">
|
|
54
|
+
{contractInfo?.name || 'Unknown'}
|
|
55
|
+
</Text>
|
|
56
|
+
<NetworkBadge chainId={chainId} />
|
|
57
|
+
<Text variant="normal" fontWeight="medium" color="muted">{`${
|
|
58
|
+
collectionBalanceData?.length || 0
|
|
59
|
+
} Unique Collectibles`}</Text>
|
|
60
|
+
</div>
|
|
61
|
+
<div className="w-full">
|
|
62
|
+
<Text variant="normal" fontWeight="medium" color="muted">
|
|
63
|
+
{`Owned (${collectionBalanceData?.length || 0})`}
|
|
64
|
+
</Text>
|
|
65
|
+
<div
|
|
66
|
+
className="w-full mt-3 grid gap-2"
|
|
67
|
+
style={{
|
|
68
|
+
gridTemplateColumns: `calc(50% - 4px) calc(50% - 4px)`
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{collectionBalanceData?.map((balance, index) => {
|
|
72
|
+
const unformattedBalance = balance.balance
|
|
73
|
+
const decimals = balance?.tokenMetadata?.decimals || 0
|
|
74
|
+
const formattedBalance = formatDisplay(formatUnits(BigInt(unformattedBalance), decimals))
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<div className="select-none cursor-pointer" key={index} onClick={() => onClickItem(balance)}>
|
|
78
|
+
<div className="flex bg-background-secondary aspect-square w-full rounded-xl justify-center items-center mb-2">
|
|
79
|
+
<Image className="rounded-lg" style={{ height: '100%' }} src={balance.tokenMetadata?.image} />
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<Text variant="normal" fontWeight="bold" color="primary">
|
|
83
|
+
{`${balance.tokenMetadata?.name}`}
|
|
84
|
+
</Text>
|
|
85
|
+
</div>
|
|
86
|
+
<div>
|
|
87
|
+
<Text className="mt-1" variant="normal" fontWeight="medium" color="muted">
|
|
88
|
+
{formattedBalance} Owned
|
|
89
|
+
</Text>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
)
|
|
93
|
+
})}
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useGetTransactionHistorySummary } from '@0xsequence/react-hooks'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { useAccount } from 'wagmi'
|
|
4
|
+
|
|
5
|
+
import { TransactionHistoryList } from '../components/TransactionHistoryList'
|
|
6
|
+
import { useSettings } from '../hooks'
|
|
7
|
+
|
|
8
|
+
export const History = () => {
|
|
9
|
+
const { selectedNetworks } = useSettings()
|
|
10
|
+
const { address: accountAddress } = useAccount()
|
|
11
|
+
|
|
12
|
+
const { data: transactionHistory = [], isPending: isPendingTransactionHistory } = useGetTransactionHistorySummary({
|
|
13
|
+
accountAddress: accountAddress || '',
|
|
14
|
+
chainIds: selectedNetworks
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div>
|
|
19
|
+
<div className="px-4 pb-5 pt-3">
|
|
20
|
+
<TransactionHistoryList
|
|
21
|
+
transactions={transactionHistory}
|
|
22
|
+
isPending={isPendingTransactionHistory}
|
|
23
|
+
isFetchingNextPage={false}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { NetworkImage, Text, TokenImage } from '@0xsequence/design-system'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useSettings } from '../../../../../hooks'
|
|
5
|
+
import { getPercentageColor } from '../../../../../utils'
|
|
6
|
+
|
|
7
|
+
interface CoinTileContentProps {
|
|
8
|
+
logoUrl?: string
|
|
9
|
+
tokenName: string
|
|
10
|
+
balance: string
|
|
11
|
+
balanceFiat: string
|
|
12
|
+
priceChangePercentage: number
|
|
13
|
+
symbol: string
|
|
14
|
+
chainId: number
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const CoinTileContent = ({
|
|
18
|
+
logoUrl,
|
|
19
|
+
tokenName,
|
|
20
|
+
balance,
|
|
21
|
+
balanceFiat,
|
|
22
|
+
priceChangePercentage,
|
|
23
|
+
symbol,
|
|
24
|
+
chainId
|
|
25
|
+
}: CoinTileContentProps) => {
|
|
26
|
+
const { fiatCurrency } = useSettings()
|
|
27
|
+
const priceChangeSymbol = priceChangePercentage > 0 ? '+' : ''
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex bg-background-secondary w-full h-full rounded-xl p-4 flex-col justify-center items-start gap-1">
|
|
31
|
+
<div className="mb-1">
|
|
32
|
+
<TokenImage src={logoUrl} symbol={symbol} size="lg" />
|
|
33
|
+
</div>
|
|
34
|
+
<div className="mb-3">
|
|
35
|
+
<div className="flex flex-row gap-1 justify-start items-center">
|
|
36
|
+
<Text
|
|
37
|
+
className="whitespace-nowrap"
|
|
38
|
+
fontWeight="bold"
|
|
39
|
+
color="primary"
|
|
40
|
+
style={{ maxWidth: '130px', textOverflow: 'ellipsis', overflow: 'hidden' }}
|
|
41
|
+
>
|
|
42
|
+
{tokenName}
|
|
43
|
+
</Text>
|
|
44
|
+
<NetworkImage chainId={chainId} size="xs" />
|
|
45
|
+
</div>
|
|
46
|
+
<Text color="muted" ellipsis nowrap block style={{ maxWidth: '150px' }}>
|
|
47
|
+
{`${balance} ${symbol}`}
|
|
48
|
+
</Text>
|
|
49
|
+
</div>
|
|
50
|
+
<div>
|
|
51
|
+
<div>
|
|
52
|
+
<Text variant="normal" fontWeight="bold" color="primary">{`${fiatCurrency.sign}${balanceFiat}`}</Text>
|
|
53
|
+
</div>
|
|
54
|
+
<Text variant="normal" color={getPercentageColor(priceChangePercentage)}>
|
|
55
|
+
{`${priceChangeSymbol}${priceChangePercentage.toFixed(2)}%`}
|
|
56
|
+
</Text>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
}
|