@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,190 @@
|
|
|
1
|
+
import { TokenPrice } from '@0xsequence/api'
|
|
2
|
+
import { compareAddress, formatDisplay, getNativeTokenInfoByChainId } from '@0xsequence/connect'
|
|
3
|
+
import { ArrowRightIcon, Text, Image, TransactionIcon, Skeleton, NetworkImage } from '@0xsequence/design-system'
|
|
4
|
+
import { Transaction, TxnTransfer, TxnTransferType } from '@0xsequence/indexer'
|
|
5
|
+
import { useGetCoinPrices, useGetExchangeRate } from '@0xsequence/react-hooks'
|
|
6
|
+
import dayjs from 'dayjs'
|
|
7
|
+
import React from 'react'
|
|
8
|
+
import { formatUnits, zeroAddress } from 'viem'
|
|
9
|
+
import { useConfig } from 'wagmi'
|
|
10
|
+
|
|
11
|
+
import { useSettings, useNavigation } from '../../hooks'
|
|
12
|
+
|
|
13
|
+
interface TransactionHistoryItemProps {
|
|
14
|
+
transaction: Transaction
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const TransactionHistoryItem = ({ transaction }: TransactionHistoryItemProps) => {
|
|
18
|
+
const { chains } = useConfig()
|
|
19
|
+
const { fiatCurrency } = useSettings()
|
|
20
|
+
const { setNavigation } = useNavigation()
|
|
21
|
+
|
|
22
|
+
const onClickTransaction = () => {
|
|
23
|
+
setNavigation({
|
|
24
|
+
location: 'transaction-details',
|
|
25
|
+
params: {
|
|
26
|
+
transaction
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const tokenContractAddresses: string[] = []
|
|
32
|
+
|
|
33
|
+
transaction.transfers?.forEach(transfer => {
|
|
34
|
+
const tokenContractAddress = transfer.contractAddress
|
|
35
|
+
if (!tokenContractAddresses.includes(tokenContractAddress)) {
|
|
36
|
+
tokenContractAddresses.push(tokenContractAddress)
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const { data: coinPrices = [], isPending: isPendingCoinPrices } = useGetCoinPrices(
|
|
41
|
+
tokenContractAddresses.map(contractAddress => ({
|
|
42
|
+
contractAddress,
|
|
43
|
+
chainId: transaction.chainId
|
|
44
|
+
}))
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const { data: conversionRate = 1, isPending: isPendingConversionRate } = useGetExchangeRate(fiatCurrency.symbol)
|
|
48
|
+
|
|
49
|
+
const isPending = isPendingCoinPrices || isPendingConversionRate
|
|
50
|
+
|
|
51
|
+
const { transfers } = transaction
|
|
52
|
+
|
|
53
|
+
const getTransactionIconByType = (transferType: TxnTransferType) => {
|
|
54
|
+
switch (transferType) {
|
|
55
|
+
case TxnTransferType.SEND:
|
|
56
|
+
return (
|
|
57
|
+
<ArrowRightIcon
|
|
58
|
+
style={{
|
|
59
|
+
transform: 'rotate(270deg)',
|
|
60
|
+
width: '16px'
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
)
|
|
64
|
+
case TxnTransferType.RECEIVE:
|
|
65
|
+
return (
|
|
66
|
+
<ArrowRightIcon
|
|
67
|
+
style={{
|
|
68
|
+
transform: 'rotate(90deg)',
|
|
69
|
+
width: '16px'
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
case TxnTransferType.UNKNOWN:
|
|
74
|
+
default:
|
|
75
|
+
return <TransactionIcon style={{ width: '14px' }} />
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const getTansactionLabelByType = (transferType: TxnTransferType) => {
|
|
80
|
+
switch (transferType) {
|
|
81
|
+
case TxnTransferType.SEND:
|
|
82
|
+
return 'Sent'
|
|
83
|
+
case TxnTransferType.RECEIVE:
|
|
84
|
+
return 'Received'
|
|
85
|
+
case TxnTransferType.UNKNOWN:
|
|
86
|
+
default:
|
|
87
|
+
return 'Transacted'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const getTransferAmountLabel = (amount: string, symbol: string, transferType: TxnTransferType) => {
|
|
92
|
+
let sign = ''
|
|
93
|
+
if (transferType === TxnTransferType.SEND) {
|
|
94
|
+
sign = '-'
|
|
95
|
+
} else if (transferType === TxnTransferType.RECEIVE) {
|
|
96
|
+
sign = '+'
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let textColor: 'muted' | 'negative' | 'positive' = 'muted'
|
|
100
|
+
if (transferType === TxnTransferType.SEND) {
|
|
101
|
+
textColor = 'negative'
|
|
102
|
+
} else if (transferType === TxnTransferType.RECEIVE) {
|
|
103
|
+
textColor = 'positive'
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return <Text variant="normal" fontWeight="bold" color={textColor}>{`${sign}${amount} ${symbol}`}</Text>
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface GetTransfer {
|
|
110
|
+
transfer: TxnTransfer
|
|
111
|
+
isFirstItem: boolean
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const getTransfer = ({ transfer, isFirstItem }: GetTransfer) => {
|
|
115
|
+
const { amounts } = transfer
|
|
116
|
+
const date = dayjs(transaction.timestamp).format('MMM DD, YYYY')
|
|
117
|
+
return (
|
|
118
|
+
<div className="flex gap-2 w-full flex-col justify-between">
|
|
119
|
+
<div className="flex flex-row justify-between">
|
|
120
|
+
<div className="flex text-muted gap-1 flex-row justify-center items-center">
|
|
121
|
+
{getTransactionIconByType(transfer.transferType)}
|
|
122
|
+
<Text variant="normal" fontWeight="medium" color="primary">
|
|
123
|
+
{getTansactionLabelByType(transfer.transferType)}
|
|
124
|
+
</Text>
|
|
125
|
+
<NetworkImage chainId={transaction.chainId} size="xs" />
|
|
126
|
+
</div>
|
|
127
|
+
{isFirstItem && (
|
|
128
|
+
<div>
|
|
129
|
+
<Text variant="normal" fontWeight="medium" color="muted">
|
|
130
|
+
{date}
|
|
131
|
+
</Text>
|
|
132
|
+
</div>
|
|
133
|
+
)}
|
|
134
|
+
</div>
|
|
135
|
+
{amounts.map((amount, index) => {
|
|
136
|
+
const nativeTokenInfo = getNativeTokenInfoByChainId(transaction.chainId, chains)
|
|
137
|
+
const isNativeToken = compareAddress(transfer.contractAddress, zeroAddress)
|
|
138
|
+
const isCollectible = transfer.contractInfo?.type === 'ERC721' || transfer.contractInfo?.type === 'ERC1155'
|
|
139
|
+
let decimals
|
|
140
|
+
const tokenId = transfer.tokenIds?.[index]
|
|
141
|
+
if (isCollectible && tokenId) {
|
|
142
|
+
decimals = transfer.tokenMetadata?.[tokenId]?.decimals || 0
|
|
143
|
+
} else {
|
|
144
|
+
decimals = isNativeToken ? nativeTokenInfo.decimals : transfer.contractInfo?.decimals
|
|
145
|
+
}
|
|
146
|
+
const amountValue = formatUnits(BigInt(amount), decimals || 18)
|
|
147
|
+
const symbol = isNativeToken ? nativeTokenInfo.symbol : transfer.contractInfo?.symbol || ''
|
|
148
|
+
const tokenLogoUri = isNativeToken ? nativeTokenInfo.logoURI : transfer.contractInfo?.logoURI
|
|
149
|
+
|
|
150
|
+
const fiatConversionRate = coinPrices.find((coinPrice: TokenPrice) =>
|
|
151
|
+
compareAddress(coinPrice.token.contractAddress, transfer.contractAddress)
|
|
152
|
+
)?.price?.value
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
<div className="flex flex-row justify-between" key={index}>
|
|
156
|
+
<div className="flex flex-row gap-2 justify-center items-center">
|
|
157
|
+
{tokenLogoUri && <Image className="w-5" src={tokenLogoUri} alt="token logo" />}
|
|
158
|
+
{getTransferAmountLabel(formatDisplay(amountValue), symbol, transfer.transferType)}
|
|
159
|
+
</div>
|
|
160
|
+
{isPending && <Skeleton style={{ width: '35px', height: '20px' }} />}
|
|
161
|
+
{fiatConversionRate && (
|
|
162
|
+
<Text variant="normal" fontWeight="medium" color="muted">
|
|
163
|
+
{`${fiatCurrency.sign}${(Number(amountValue) * fiatConversionRate * conversionRate).toFixed(2)}`}
|
|
164
|
+
</Text>
|
|
165
|
+
)}
|
|
166
|
+
</div>
|
|
167
|
+
)
|
|
168
|
+
})}
|
|
169
|
+
</div>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return (
|
|
174
|
+
<div
|
|
175
|
+
className="flex bg-background-secondary rounded-xl p-4 gap-2 items-center justify-center flex-col select-none cursor-pointer"
|
|
176
|
+
onClick={() => onClickTransaction()}
|
|
177
|
+
>
|
|
178
|
+
{transfers?.map((transfer, position) => {
|
|
179
|
+
return (
|
|
180
|
+
<div className="w-full" key={`${transaction.txnHash}-${position}`}>
|
|
181
|
+
{getTransfer({
|
|
182
|
+
transfer,
|
|
183
|
+
isFirstItem: position === 0
|
|
184
|
+
})}
|
|
185
|
+
</div>
|
|
186
|
+
)
|
|
187
|
+
})}
|
|
188
|
+
</div>
|
|
189
|
+
)
|
|
190
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Skeleton } from '@0xsequence/design-system'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
export const TransactionHistorySkeleton = () => {
|
|
5
|
+
const getTransactionItem = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="flex flex-col gap-2 w-full justify-between">
|
|
8
|
+
<div className="flex flex-row justify-between">
|
|
9
|
+
<Skeleton style={{ width: '65px', height: '20px' }} />
|
|
10
|
+
<Skeleton style={{ width: '75px', height: '17px' }} />
|
|
11
|
+
</div>
|
|
12
|
+
<div className="flex flex-row justify-between">
|
|
13
|
+
<Skeleton style={{ width: '120px', height: '20px' }} />
|
|
14
|
+
<Skeleton style={{ width: '35px', height: '17px' }} />
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<div className="flex flex-col gap-3">
|
|
22
|
+
<Skeleton style={{ width: '70px', height: '17px' }} />
|
|
23
|
+
<div className="flex flex-col gap-2">
|
|
24
|
+
{Array(8)
|
|
25
|
+
.fill(null)
|
|
26
|
+
.map((_, index) => {
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex rounded-xl p-4 gap-2 items-center justify-center flex-col bg-background-secondary" key={index}>
|
|
29
|
+
{getTransactionItem()}
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
})}
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { Spinner, Text } from '@0xsequence/design-system'
|
|
2
|
+
import { Transaction } from '@0xsequence/indexer'
|
|
3
|
+
import { useMemo } from 'react'
|
|
4
|
+
|
|
5
|
+
import { TransactionHistoryItem } from './TransactionHistoryItem'
|
|
6
|
+
import { TransactionHistorySkeleton } from './TransactionHistorySkeleton'
|
|
7
|
+
|
|
8
|
+
interface TransactionHistoryListProps {
|
|
9
|
+
transactions: Transaction[]
|
|
10
|
+
isPending: boolean
|
|
11
|
+
isFetchingNextPage: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const TransactionHistoryList = ({ transactions, isPending, isFetchingNextPage }: TransactionHistoryListProps) => {
|
|
15
|
+
type TransactionPeriodId = 'today' | 'yesterday' | 'week' | 'month' | 'year' | 'past'
|
|
16
|
+
|
|
17
|
+
interface TransactionPeriods {
|
|
18
|
+
id: TransactionPeriodId
|
|
19
|
+
label: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const transactionPeriods: TransactionPeriods[] = [
|
|
23
|
+
{
|
|
24
|
+
id: 'today',
|
|
25
|
+
label: 'Today'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'yesterday',
|
|
29
|
+
label: 'Yesterday'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: 'week',
|
|
33
|
+
label: 'This Week'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'month',
|
|
37
|
+
label: 'This Month'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: 'year',
|
|
41
|
+
label: 'This Year'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'past',
|
|
45
|
+
label: 'Past'
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
const transactionsByTime = useMemo(() => {
|
|
50
|
+
const todayThreshold = new Date(new Date().setHours(0, 0, 0, 0)).getTime()
|
|
51
|
+
const yesterdayThreshold = new Date(new Date().setDate(new Date(todayThreshold).getDate() - 1)).getTime()
|
|
52
|
+
|
|
53
|
+
const currentDate = new Date(new Date().setHours(0, 0, 0, 0))
|
|
54
|
+
const firstDayOfWeek = new Date(currentDate.setDate(currentDate.getDate() - currentDate.getDay()))
|
|
55
|
+
const firstDayOfMonth = new Date(currentDate.setDate(1))
|
|
56
|
+
const firstDayOfYear = new Date(currentDate.setMonth(0, 1))
|
|
57
|
+
|
|
58
|
+
const weekThreshold = firstDayOfWeek.getTime()
|
|
59
|
+
const monthThreshold = firstDayOfMonth.getTime()
|
|
60
|
+
const yearThreshold = firstDayOfYear.getTime()
|
|
61
|
+
|
|
62
|
+
const transactionsByTime: {
|
|
63
|
+
[key in TransactionPeriodId]: Transaction[]
|
|
64
|
+
} = {
|
|
65
|
+
today: [],
|
|
66
|
+
yesterday: [],
|
|
67
|
+
week: [],
|
|
68
|
+
month: [],
|
|
69
|
+
year: [],
|
|
70
|
+
past: []
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
transactions.forEach(transaction => {
|
|
74
|
+
const transactionTime = new Date(transaction.timestamp).getTime()
|
|
75
|
+
if (transactionTime >= todayThreshold) {
|
|
76
|
+
transactionsByTime.today.push(transaction)
|
|
77
|
+
} else if (transactionTime >= yesterdayThreshold) {
|
|
78
|
+
transactionsByTime.yesterday.push(transaction)
|
|
79
|
+
} else if (transactionTime >= weekThreshold) {
|
|
80
|
+
transactionsByTime.week.push(transaction)
|
|
81
|
+
} else if (transactionTime >= monthThreshold) {
|
|
82
|
+
transactionsByTime.month.push(transaction)
|
|
83
|
+
} else if (transactionTime >= yearThreshold) {
|
|
84
|
+
transactionsByTime.year.push(transaction)
|
|
85
|
+
} else {
|
|
86
|
+
transactionsByTime.past.push(transaction)
|
|
87
|
+
}
|
|
88
|
+
})
|
|
89
|
+
|
|
90
|
+
return transactionsByTime
|
|
91
|
+
}, [transactions])
|
|
92
|
+
|
|
93
|
+
if (isPending) {
|
|
94
|
+
return (
|
|
95
|
+
<div className="flex flex-col gap-2">
|
|
96
|
+
<TransactionHistorySkeleton />
|
|
97
|
+
</div>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface TimeLabelProps {
|
|
102
|
+
label: string
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const TimeLabel = ({ label }: TimeLabelProps) => {
|
|
106
|
+
return (
|
|
107
|
+
<div>
|
|
108
|
+
<Text variant="normal" color="muted" fontWeight="medium">
|
|
109
|
+
{label}
|
|
110
|
+
</Text>
|
|
111
|
+
</div>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
interface TransactionsListProps {
|
|
116
|
+
transactions: Transaction[]
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const TransactionsList = ({ transactions }: TransactionsListProps) => {
|
|
120
|
+
return (
|
|
121
|
+
<div className="flex flex-col gap-2">
|
|
122
|
+
{transactions.map((transaction, index) => {
|
|
123
|
+
return (
|
|
124
|
+
<div className="flex flex-col gap-2" key={`${transaction.txnHash}-${index}`}>
|
|
125
|
+
<TransactionHistoryItem transaction={transaction} />
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
})}
|
|
129
|
+
</div>
|
|
130
|
+
)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return (
|
|
134
|
+
<div className="flex flex-col gap-5">
|
|
135
|
+
{transactionPeriods.map(period => {
|
|
136
|
+
const txs = transactionsByTime[period.id]
|
|
137
|
+
if (txs.length === 0) {
|
|
138
|
+
return null
|
|
139
|
+
}
|
|
140
|
+
return (
|
|
141
|
+
<div className="flex flex-col gap-3" key={period.id}>
|
|
142
|
+
<TimeLabel label={period.label} />
|
|
143
|
+
<TransactionsList transactions={txs} />
|
|
144
|
+
</div>
|
|
145
|
+
)
|
|
146
|
+
})}
|
|
147
|
+
{transactions.length === 0 && (
|
|
148
|
+
<div className="flex flex-col gap-3">
|
|
149
|
+
<TimeLabel label={'History'} />
|
|
150
|
+
<Text color="primary">No Recent Transaction History Found</Text>
|
|
151
|
+
</div>
|
|
152
|
+
)}
|
|
153
|
+
{isFetchingNextPage && (
|
|
154
|
+
<div className="flex m-4 items-center justify-center">
|
|
155
|
+
<Spinner />
|
|
156
|
+
</div>
|
|
157
|
+
)}
|
|
158
|
+
</div>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { formatAddress } from '@0xsequence/connect'
|
|
2
|
+
import { Text, GradientAvatar, ChevronDownIcon } from '@0xsequence/design-system'
|
|
3
|
+
import React, { forwardRef } from 'react'
|
|
4
|
+
import { useAccount } from 'wagmi'
|
|
5
|
+
|
|
6
|
+
interface AccountInformationProps {
|
|
7
|
+
onClickAccount: () => void
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const AccountInformation = forwardRef(({ onClickAccount }: AccountInformationProps, ref) => {
|
|
11
|
+
const { address } = useAccount()
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className="flex gap-2 items-center">
|
|
15
|
+
<div className="flex w-full flex-col items-center justify-center">
|
|
16
|
+
<div
|
|
17
|
+
className="flex gap-2 items-center justify-center relative select-none cursor-pointer"
|
|
18
|
+
onClick={onClickAccount}
|
|
19
|
+
// @ts-ignore-next-line
|
|
20
|
+
ref={ref}
|
|
21
|
+
>
|
|
22
|
+
<GradientAvatar size="sm" address={address || ''} />
|
|
23
|
+
<Text color="primary" fontWeight="medium" variant="normal">
|
|
24
|
+
{formatAddress(address || '')}
|
|
25
|
+
</Text>
|
|
26
|
+
<ChevronDownIcon className="text-primary" />
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
})
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { formatAddress, useTheme } from '@0xsequence/connect'
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
IconButton,
|
|
5
|
+
CloseIcon,
|
|
6
|
+
GradientAvatar,
|
|
7
|
+
Text,
|
|
8
|
+
QrCodeIcon,
|
|
9
|
+
SettingsIcon,
|
|
10
|
+
SignoutIcon,
|
|
11
|
+
TransactionIcon
|
|
12
|
+
} from '@0xsequence/design-system'
|
|
13
|
+
import React, { forwardRef } from 'react'
|
|
14
|
+
import { useDisconnect, useAccount } from 'wagmi'
|
|
15
|
+
|
|
16
|
+
import { useNavigation } from '../../../hooks'
|
|
17
|
+
import { useOpenWalletModal } from '../../../hooks/useOpenWalletModal'
|
|
18
|
+
import { CopyButton } from '../../CopyButton'
|
|
19
|
+
|
|
20
|
+
interface WalletDropdownContentProps {
|
|
21
|
+
setOpenWalletDropdown: React.Dispatch<React.SetStateAction<boolean>>
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const WalletDropdownContent = forwardRef(({ setOpenWalletDropdown }: WalletDropdownContentProps, ref: any) => {
|
|
25
|
+
const { setNavigation } = useNavigation()
|
|
26
|
+
const { setOpenWalletModal } = useOpenWalletModal()
|
|
27
|
+
const { address } = useAccount()
|
|
28
|
+
const { disconnect } = useDisconnect()
|
|
29
|
+
const { theme } = useTheme()
|
|
30
|
+
const onClickReceive = () => {
|
|
31
|
+
setOpenWalletDropdown(false)
|
|
32
|
+
setNavigation({
|
|
33
|
+
location: 'receive'
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const onClickHistory = () => {
|
|
38
|
+
setOpenWalletDropdown(false)
|
|
39
|
+
setNavigation({
|
|
40
|
+
location: 'history'
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const onClickSettings = () => {
|
|
45
|
+
setOpenWalletDropdown(false)
|
|
46
|
+
setNavigation({
|
|
47
|
+
location: 'settings'
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const onClickSignout = () => {
|
|
52
|
+
setOpenWalletModal(false)
|
|
53
|
+
setOpenWalletDropdown(false)
|
|
54
|
+
disconnect()
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const getDropdownBackgroundColor = () => {
|
|
58
|
+
switch (theme) {
|
|
59
|
+
case 'dark':
|
|
60
|
+
return 'rgba(38, 38, 38, 0.85)'
|
|
61
|
+
case 'light':
|
|
62
|
+
return 'rgba(217, 217, 217, 0.85)'
|
|
63
|
+
default:
|
|
64
|
+
return 'transparent'
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
className="relative pointer-events-auto backdrop-blur-md p-3 z-30 top-4 left-4 rounded-xl"
|
|
71
|
+
ref={ref}
|
|
72
|
+
style={{
|
|
73
|
+
width: 'calc(100vw - 30px)',
|
|
74
|
+
maxWidth: '370px',
|
|
75
|
+
background: getDropdownBackgroundColor()
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<div className="flex flex-row justify-between items-start">
|
|
79
|
+
<div className="flex flex-row justify-center items-center gap-3 ml-2 text-primary">
|
|
80
|
+
<GradientAvatar size="md" address={address || ''} />
|
|
81
|
+
<Text variant="large" fontWeight="bold" color="primary">
|
|
82
|
+
{formatAddress(address || '')}
|
|
83
|
+
</Text>
|
|
84
|
+
<CopyButton className="ml-[-16px]" buttonVariant="icon" size="md" text={address || ''} />
|
|
85
|
+
</div>
|
|
86
|
+
<IconButton className="bg-button-glass" onClick={() => setOpenWalletDropdown(false)} size="xs" icon={CloseIcon} />
|
|
87
|
+
</div>
|
|
88
|
+
<div className="flex gap-2 mt-3 flex-col">
|
|
89
|
+
<Button className="w-full rounded-xl" variant="glass" leftIcon={QrCodeIcon} label="Receive" onClick={onClickReceive} />
|
|
90
|
+
<Button className="w-full rounded-xl" leftIcon={TransactionIcon} label="History" onClick={onClickHistory} />
|
|
91
|
+
<Button className="w-full rounded-xl" leftIcon={SettingsIcon} label="Settings" onClick={onClickSettings} />
|
|
92
|
+
<Button className="w-full rounded-xl" label="Sign Out" leftIcon={SignoutIcon} onClick={onClickSignout} />
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
})
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ChevronLeftIcon, IconButton, SearchIcon } from '@0xsequence/design-system'
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover'
|
|
3
|
+
import { AnimatePresence, motion } from 'motion/react'
|
|
4
|
+
import React, { useState, useRef, useEffect } from 'react'
|
|
5
|
+
|
|
6
|
+
import { HEADER_HEIGHT } from '../../constants'
|
|
7
|
+
import { useNavigation, useOpenWalletModal } from '../../hooks'
|
|
8
|
+
|
|
9
|
+
import { AccountInformation } from './components/AccountInformation'
|
|
10
|
+
import { WalletDropdownContent } from './components/WalletDropdownContent'
|
|
11
|
+
|
|
12
|
+
export const WalletHeader = () => {
|
|
13
|
+
const { openWalletModalState } = useOpenWalletModal()
|
|
14
|
+
|
|
15
|
+
const [openWalletDropdown, setOpenWalletDropdown] = useState<boolean>(false)
|
|
16
|
+
const { goBack, history, setNavigation } = useNavigation()
|
|
17
|
+
const hasDropdownOpened = useRef<boolean>(false)
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!openWalletModalState) {
|
|
21
|
+
setOpenWalletDropdown(false)
|
|
22
|
+
}
|
|
23
|
+
}, [openWalletModalState])
|
|
24
|
+
|
|
25
|
+
// Close dropdown when navigating to a new page
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (openWalletDropdown) {
|
|
28
|
+
if (!hasDropdownOpened.current) {
|
|
29
|
+
hasDropdownOpened.current = true
|
|
30
|
+
} else {
|
|
31
|
+
setOpenWalletDropdown(false)
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
hasDropdownOpened.current = false
|
|
35
|
+
}
|
|
36
|
+
}, [history.length, openWalletDropdown])
|
|
37
|
+
|
|
38
|
+
const onClickAccount = () => {
|
|
39
|
+
setOpenWalletDropdown(true)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const onClickBack = () => {
|
|
43
|
+
goBack()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const onClickSearch = () => {
|
|
47
|
+
setNavigation({
|
|
48
|
+
location: 'search'
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<motion.div>
|
|
54
|
+
<PopoverPrimitive.Root open={openWalletDropdown}>
|
|
55
|
+
<PopoverPrimitive.Anchor />
|
|
56
|
+
<div
|
|
57
|
+
className="flex bg-background-primary z-20 fixed flex-row items-center justify-between w-full px-4"
|
|
58
|
+
style={{
|
|
59
|
+
height: HEADER_HEIGHT,
|
|
60
|
+
paddingTop: '6px'
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
{history.length > 0 ? (
|
|
64
|
+
<IconButton onClick={onClickBack} icon={ChevronLeftIcon} size="xs" />
|
|
65
|
+
) : (
|
|
66
|
+
<IconButton onClick={onClickSearch} icon={SearchIcon} size="xs" />
|
|
67
|
+
)}
|
|
68
|
+
<PopoverPrimitive.Trigger asChild>
|
|
69
|
+
<AccountInformation onClickAccount={onClickAccount} />
|
|
70
|
+
</PopoverPrimitive.Trigger>
|
|
71
|
+
<div style={{ width: '44px' }} />
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<AnimatePresence>
|
|
75
|
+
{openWalletDropdown && (
|
|
76
|
+
<PopoverPrimitive.Content asChild side="bottom" align="start">
|
|
77
|
+
<WalletDropdownContent setOpenWalletDropdown={setOpenWalletDropdown} />
|
|
78
|
+
</PopoverPrimitive.Content>
|
|
79
|
+
)}
|
|
80
|
+
</AnimatePresence>
|
|
81
|
+
</PopoverPrimitive.Root>
|
|
82
|
+
</motion.div>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export const ERC_1155_ABI = [
|
|
2
|
+
{
|
|
3
|
+
inputs: [
|
|
4
|
+
{
|
|
5
|
+
internalType: 'address',
|
|
6
|
+
name: '_from',
|
|
7
|
+
type: 'address'
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
internalType: 'address',
|
|
11
|
+
name: '_to',
|
|
12
|
+
type: 'address'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
internalType: 'uint256[]',
|
|
16
|
+
name: '_ids',
|
|
17
|
+
type: 'uint256[]'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
internalType: 'uint256[]',
|
|
21
|
+
name: '_amounts',
|
|
22
|
+
type: 'uint256[]'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
internalType: 'bytes',
|
|
26
|
+
name: '_data',
|
|
27
|
+
type: 'bytes'
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
name: 'safeBatchTransferFrom',
|
|
31
|
+
outputs: [],
|
|
32
|
+
stateMutability: 'nonpayable',
|
|
33
|
+
type: 'function'
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
export const ERC_20_ABI = [
|
|
38
|
+
{
|
|
39
|
+
constant: false,
|
|
40
|
+
inputs: [
|
|
41
|
+
{
|
|
42
|
+
internalType: 'address',
|
|
43
|
+
name: 'recipient',
|
|
44
|
+
type: 'address'
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
internalType: 'uint256',
|
|
48
|
+
name: 'amount',
|
|
49
|
+
type: 'uint256'
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
name: 'transfer',
|
|
53
|
+
outputs: [
|
|
54
|
+
{
|
|
55
|
+
internalType: 'bool',
|
|
56
|
+
name: '',
|
|
57
|
+
type: 'bool'
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
payable: false,
|
|
61
|
+
stateMutability: 'nonpayable',
|
|
62
|
+
type: 'function'
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
export const ERC_721_ABI = [
|
|
67
|
+
{
|
|
68
|
+
inputs: [
|
|
69
|
+
{
|
|
70
|
+
internalType: 'address',
|
|
71
|
+
name: 'from',
|
|
72
|
+
type: 'address'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
internalType: 'address',
|
|
76
|
+
name: 'to',
|
|
77
|
+
type: 'address'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
internalType: 'uint256',
|
|
81
|
+
name: 'tokenId',
|
|
82
|
+
type: 'uint256'
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
name: 'safeTransferFrom',
|
|
86
|
+
outputs: [],
|
|
87
|
+
stateMutability: 'nonpayable',
|
|
88
|
+
type: 'function'
|
|
89
|
+
}
|
|
90
|
+
]
|