@rango-dev/ui 0.1.10-next.69
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/README.md +181 -0
- package/dist/components/Alert/Alert.d.ts +6 -0
- package/dist/components/Alert/Alert.stories.d.ts +4 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/BestRoute/BestRoute.d.ts +8 -0
- package/dist/components/BestRoute/BestRoute.stories.d.ts +8 -0
- package/dist/components/BestRoute/index.d.ts +1 -0
- package/dist/components/BestRoute/mock.d.ts +4 -0
- package/dist/components/BlockchainSelector/BlockchainSelector.d.ts +14 -0
- package/dist/components/BlockchainSelector/BlockchainSelector.stories.d.ts +4 -0
- package/dist/components/BlockchainSelector/index.d.ts +1 -0
- package/dist/components/BlockchainsList/BlockchainsList.d.ts +7 -0
- package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +4 -0
- package/dist/components/BlockchainsList/index.d.ts +1 -0
- package/dist/components/BlockchainsList/mockData.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +17 -0
- package/dist/components/Button/Button.stories.d.ts +8 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +11 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Chip/Chip.d.ts +12 -0
- package/dist/components/Chip/Chip.stories.d.ts +6 -0
- package/dist/components/Chip/index.d.ts +1 -0
- package/dist/components/ConnectWalletsModal/ConnectWallets.stories.d.ts +4 -0
- package/dist/components/ConnectWalletsModal/ConnectWalletsModal.d.ts +10 -0
- package/dist/components/ConnectWalletsModal/index.d.ts +1 -0
- package/dist/components/ConnectWalletsModal/mockData.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +12 -0
- package/dist/components/Drawer/Drawer.stories.d.ts +7 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- package/dist/components/Icon/AddCircleIcon.d.ts +3 -0
- package/dist/components/Icon/AddIcon.d.ts +3 -0
- package/dist/components/Icon/AddWalletIcon.d.ts +3 -0
- package/dist/components/Icon/AngleDownIcon.d.ts +3 -0
- package/dist/components/Icon/AngleLeftIcon.d.ts +3 -0
- package/dist/components/Icon/AngleRightIcon.d.ts +3 -0
- package/dist/components/Icon/AngleUpIcon.d.ts +3 -0
- package/dist/components/Icon/BagIcon.d.ts +3 -0
- package/dist/components/Icon/BanIcon.d.ts +3 -0
- package/dist/components/Icon/CheckCircleIcon.d.ts +3 -0
- package/dist/components/Icon/CheckIcon.d.ts +3 -0
- package/dist/components/Icon/CheckSquareIcon.d.ts +3 -0
- package/dist/components/Icon/CheckWalletIcon.d.ts +3 -0
- package/dist/components/Icon/CloseIcon.d.ts +1 -0
- package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -0
- package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -0
- package/dist/components/Icon/DownloadIcon.d.ts +3 -0
- package/dist/components/Icon/GasIcon.d.ts +3 -0
- package/dist/components/Icon/HistoryIcon.d.ts +3 -0
- package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -0
- package/dist/components/Icon/Icons.stories.d.ts +5 -0
- package/dist/components/Icon/InfoCircleIcon.d.ts +3 -0
- package/dist/components/Icon/MinusCircleIcon.d.ts +3 -0
- package/dist/components/Icon/RetryIcon.d.ts +3 -0
- package/dist/components/Icon/RetryLeftIcon.d.ts +3 -0
- package/dist/components/Icon/RetryRightIcon.d.ts +3 -0
- package/dist/components/Icon/SearchIcon.d.ts +3 -0
- package/dist/components/Icon/SearchMinusIcon.d.ts +3 -0
- package/dist/components/Icon/SettingIcon.d.ts +3 -0
- package/dist/components/Icon/SignatureIcon.d.ts +3 -0
- package/dist/components/Icon/SwapWalletIcon.d.ts +3 -0
- package/dist/components/Icon/TimeIcon.d.ts +3 -0
- package/dist/components/Icon/TrashIcon.d.ts +3 -0
- package/dist/components/Icon/TryAgainIcon.d.ts +3 -0
- package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -0
- package/dist/components/Icon/WalletIconIcon.d.ts +3 -0
- package/dist/components/Icon/WarningIcon.d.ts +3 -0
- package/dist/components/Icon/common.d.ts +2 -0
- package/dist/components/Icon/index.d.ts +36 -0
- package/dist/components/Icon/types.d.ts +6 -0
- package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +4 -0
- package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +8 -0
- package/dist/components/LiquiditySourceList/index.d.ts +1 -0
- package/dist/components/LiquiditySourceList/mockData.d.ts +2 -0
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +11 -0
- package/dist/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +4 -0
- package/dist/components/LiquiditySourcesSelector/index.d.ts +1 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.stories.d.ts +4 -0
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +12 -0
- package/dist/components/Radio/Radio.stories.d.ts +4 -0
- package/dist/components/Radio/index.d.ts +1 -0
- package/dist/components/SecondaryPage/SecondaryPage.d.ts +18 -0
- package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +2 -0
- package/dist/components/SecondaryPage/index.d.ts +1 -0
- package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -0
- package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +5 -0
- package/dist/components/SelectableWalletList/index.d.ts +1 -0
- package/dist/components/SelectableWalletList/mock.d.ts +2 -0
- package/dist/components/Settings/Settings.d.ts +19 -0
- package/dist/components/Settings/Settings.stories.d.ts +4 -0
- package/dist/components/Settings/index.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +5 -0
- package/dist/components/Skeleton/Skeleton.stories.d.ts +4 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Spacer/Spacer.d.ts +5 -0
- package/dist/components/Spacer/Spacer.stories.d.ts +4 -0
- package/dist/components/Spacer/index.d.ts +1 -0
- package/dist/components/Spinner/Spinner.d.ts +5 -0
- package/dist/components/Spinner/Spinner.stories.d.ts +4 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -0
- package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +4 -0
- package/dist/components/StatusDrawer/index.d.ts +1 -0
- package/dist/components/StepDetail/StepDetail.d.ts +10 -0
- package/dist/components/StepDetail/StepDetail.stories.d.ts +5 -0
- package/dist/components/StepDetail/index.d.ts +1 -0
- package/dist/components/SwapContainer/SwapContainer.d.ts +6 -0
- package/dist/components/SwapContainer/SwapContainer.stories.d.ts +5 -0
- package/dist/components/SwapContainer/index.d.ts +1 -0
- package/dist/components/SwapDetail/SwapDetail.d.ts +8 -0
- package/dist/components/SwapDetail/SwapDetail.stories.d.ts +5 -0
- package/dist/components/SwapDetail/index.d.ts +1 -0
- package/dist/components/SwapDetail/mock.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +5 -0
- package/dist/components/Switch/Switch.stories.d.ts +4 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/TextField/TextField.d.ts +10 -0
- package/dist/components/TextField/TextField.stories.d.ts +7 -0
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TokenList/TokenList.d.ts +14 -0
- package/dist/components/TokenList/TokenList.stories.d.ts +4 -0
- package/dist/components/TokenList/index.d.ts +1 -0
- package/dist/components/TokenList/mockData.d.ts +2 -0
- package/dist/components/TokenSelector/TokenSelector.d.ts +10 -0
- package/dist/components/TokenSelector/TokenSelector.stories.d.ts +4 -0
- package/dist/components/TokenSelector/index.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +7 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +5 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Typography/Typography.d.ts +14 -0
- package/dist/components/Typography/Typography.stories.d.ts +5 -0
- package/dist/components/Typography/index.d.ts +1 -0
- package/dist/components/VirtualizedList/VirtualizedList.d.ts +18 -0
- package/dist/components/Wallet/State.d.ts +6 -0
- package/dist/components/Wallet/Wallet.d.ts +6 -0
- package/dist/components/Wallet/Wallet.stories.d.ts +4 -0
- package/dist/components/Wallet/index.d.ts +1 -0
- package/dist/components/common/FilledCircle.d.ts +1 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +23 -0
- package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +5 -0
- package/dist/containers/ConfirmSwap/index.d.ts +1 -0
- package/dist/containers/ConfirmSwap/mock.d.ts +2 -0
- package/dist/containers/ConfirmWallets/ConfirmWallets.d.ts +14 -0
- package/dist/containers/ConfirmWallets/ConfirmWallets.stories.d.ts +6 -0
- package/dist/containers/ConfirmWallets/index.d.ts +1 -0
- package/dist/containers/ConfirmWallets/mock.d.ts +5 -0
- package/dist/containers/ConfirmWallets/types.d.ts +8 -0
- package/dist/containers/History/History.d.ts +8 -0
- package/dist/containers/History/History.stories.d.ts +5 -0
- package/dist/containers/History/index.d.ts +1 -0
- package/dist/containers/History/mock.d.ts +2 -0
- package/dist/containers/History/types.d.ts +59 -0
- package/dist/containers/SwapHistory/SwapHistory.d.ts +7 -0
- package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +4 -0
- package/dist/containers/SwapHistory/index.d.ts +1 -0
- package/dist/containers/SwapHistory/mock.d.ts +2 -0
- package/dist/containers/index.d.ts +4 -0
- package/dist/helper/index.d.ts +6 -0
- package/dist/helper/swaps.d.ts +5 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/theme.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/meta.d.ts +22 -0
- package/dist/types/swaps.d.ts +22 -0
- package/dist/types/wallet.d.ts +14 -0
- package/dist/ui.cjs.development.js +4103 -0
- package/dist/ui.cjs.development.js.map +1 -0
- package/dist/ui.cjs.production.min.js +2 -0
- package/dist/ui.cjs.production.min.js.map +1 -0
- package/dist/ui.esm.js +4028 -0
- package/dist/ui.esm.js.map +1 -0
- package/package.json +89 -0
- package/src/components/Alert/Alert.stories.tsx +22 -0
- package/src/components/Alert/Alert.tsx +78 -0
- package/src/components/Alert/index.ts +1 -0
- package/src/components/BestRoute/BestRoute.stories.tsx +31 -0
- package/src/components/BestRoute/BestRoute.tsx +189 -0
- package/src/components/BestRoute/index.ts +1 -0
- package/src/components/BestRoute/mock.ts +544 -0
- package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +25 -0
- package/src/components/BlockchainSelector/BlockchainSelector.tsx +93 -0
- package/src/components/BlockchainSelector/index.ts +1 -0
- package/src/components/BlockchainsList/BlockchainsList.stories.tsx +25 -0
- package/src/components/BlockchainsList/BlockchainsList.tsx +60 -0
- package/src/components/BlockchainsList/index.ts +1 -0
- package/src/components/BlockchainsList/mockData.ts +2972 -0
- package/src/components/Button/Button.stories.tsx +59 -0
- package/src/components/Button/Button.tsx +407 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +22 -0
- package/src/components/Checkbox/Checkbox.tsx +54 -0
- package/src/components/Checkbox/index.ts +1 -0
- package/src/components/Chip/Chip.stories.tsx +37 -0
- package/src/components/Chip/Chip.tsx +45 -0
- package/src/components/Chip/index.ts +1 -0
- package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +13 -0
- package/src/components/ConnectWalletsModal/ConnectWalletsModal.tsx +42 -0
- package/src/components/ConnectWalletsModal/index.ts +1 -0
- package/src/components/ConnectWalletsModal/mockData.ts +118 -0
- package/src/components/Drawer/Drawer.stories.tsx +86 -0
- package/src/components/Drawer/Drawer.tsx +128 -0
- package/src/components/Drawer/index.ts +1 -0
- package/src/components/Icon/AddCircleIcon.tsx +29 -0
- package/src/components/Icon/AddIcon.tsx +28 -0
- package/src/components/Icon/AddWalletIcon.tsx +48 -0
- package/src/components/Icon/AngleDownIcon.tsx +30 -0
- package/src/components/Icon/AngleLeftIcon.tsx +31 -0
- package/src/components/Icon/AngleRightIcon.tsx +30 -0
- package/src/components/Icon/AngleUpIcon.tsx +30 -0
- package/src/components/Icon/BagIcon.tsx +37 -0
- package/src/components/Icon/BanIcon.tsx +30 -0
- package/src/components/Icon/CheckCircleIcon.tsx +37 -0
- package/src/components/Icon/CheckIcon.tsx +28 -0
- package/src/components/Icon/CheckSquareIcon.tsx +35 -0
- package/src/components/Icon/CheckWalletIcon.tsx +43 -0
- package/src/components/Icon/CloseIcon.tsx +9 -0
- package/src/components/Icon/DeleteCircleIcon.tsx +29 -0
- package/src/components/Icon/DeleteWalletIcon.tsx +48 -0
- package/src/components/Icon/DownloadIcon.tsx +35 -0
- package/src/components/Icon/GasIcon.tsx +35 -0
- package/src/components/Icon/HistoryIcon.tsx +38 -0
- package/src/components/Icon/HorizontalSwapIcon.tsx +36 -0
- package/src/components/Icon/Icons.stories.tsx +44 -0
- package/src/components/Icon/InfoCircleIcon.tsx +37 -0
- package/src/components/Icon/MinusCircleIcon.tsx +29 -0
- package/src/components/Icon/RetryIcon.tsx +30 -0
- package/src/components/Icon/RetryLeftIcon.tsx +29 -0
- package/src/components/Icon/RetryRightIcon.tsx +29 -0
- package/src/components/Icon/SearchIcon.tsx +29 -0
- package/src/components/Icon/SearchMinusIcon.tsx +29 -0
- package/src/components/Icon/SettingIcon.tsx +37 -0
- package/src/components/Icon/SignatureIcon.tsx +30 -0
- package/src/components/Icon/SwapWalletIcon.tsx +48 -0
- package/src/components/Icon/TimeIcon.tsx +29 -0
- package/src/components/Icon/TrashIcon.tsx +29 -0
- package/src/components/Icon/TryAgainIcon.tsx +29 -0
- package/src/components/Icon/VerticalSwapIcon.tsx +36 -0
- package/src/components/Icon/WalletIconIcon.tsx +38 -0
- package/src/components/Icon/WarningIcon.tsx +35 -0
- package/src/components/Icon/common.ts +69 -0
- package/src/components/Icon/index.ts +44 -0
- package/src/components/Icon/types.tsx +44 -0
- package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +13 -0
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +114 -0
- package/src/components/LiquiditySourceList/index.ts +1 -0
- package/src/components/LiquiditySourceList/mockData.ts +316 -0
- package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +16 -0
- package/src/components/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +55 -0
- package/src/components/LiquiditySourcesSelector/index.ts +1 -0
- package/src/components/Modal/Modal.stories.tsx +22 -0
- package/src/components/Modal/Modal.tsx +76 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Radio/Radio.stories.tsx +23 -0
- package/src/components/Radio/Radio.tsx +95 -0
- package/src/components/Radio/index.ts +1 -0
- package/src/components/SecondaryPage/SecondaryPage.stories.tsx +7 -0
- package/src/components/SecondaryPage/SecondaryPage.tsx +95 -0
- package/src/components/SecondaryPage/index.ts +1 -0
- package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +14 -0
- package/src/components/SelectableWalletList/SelectableWalletList.tsx +113 -0
- package/src/components/SelectableWalletList/index.ts +1 -0
- package/src/components/SelectableWalletList/mock.ts +12 -0
- package/src/components/Settings/Settings.stories.tsx +34 -0
- package/src/components/Settings/Settings.tsx +160 -0
- package/src/components/Settings/index.ts +1 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +24 -0
- package/src/components/Skeleton/Skeleton.tsx +66 -0
- package/src/components/Skeleton/index.ts +1 -0
- package/src/components/Spacer/Spacer.stories.tsx +18 -0
- package/src/components/Spacer/Spacer.tsx +98 -0
- package/src/components/Spacer/index.ts +1 -0
- package/src/components/Spinner/Spinner.stories.tsx +25 -0
- package/src/components/Spinner/Spinner.tsx +61 -0
- package/src/components/Spinner/index.ts +1 -0
- package/src/components/StatusDrawer/StatusDrawer.stories.tsx +38 -0
- package/src/components/StatusDrawer/StatusDrawer.tsx +81 -0
- package/src/components/StatusDrawer/index.ts +1 -0
- package/src/components/StepDetail/StepDetail.stories.tsx +37 -0
- package/src/components/StepDetail/StepDetail.tsx +97 -0
- package/src/components/StepDetail/index.ts +1 -0
- package/src/components/SwapContainer/SwapContainer.stories.tsx +13 -0
- package/src/components/SwapContainer/SwapContainer.tsx +35 -0
- package/src/components/SwapContainer/index.ts +1 -0
- package/src/components/SwapDetail/SwapDetail.stories.tsx +19 -0
- package/src/components/SwapDetail/SwapDetail.tsx +150 -0
- package/src/components/SwapDetail/index.ts +1 -0
- package/src/components/SwapDetail/mock.ts +275 -0
- package/src/components/Switch/Switch.stories.tsx +9 -0
- package/src/components/Switch/Switch.tsx +52 -0
- package/src/components/Switch/index.ts +1 -0
- package/src/components/TextField/TextField.stories.tsx +31 -0
- package/src/components/TextField/TextField.tsx +129 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TokenList/TokenList.stories.tsx +18 -0
- package/src/components/TokenList/TokenList.tsx +180 -0
- package/src/components/TokenList/index.ts +1 -0
- package/src/components/TokenList/mockData.ts +1721 -0
- package/src/components/TokenSelector/TokenSelector.stories.tsx +18 -0
- package/src/components/TokenSelector/TokenSelector.tsx +35 -0
- package/src/components/TokenSelector/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +52 -0
- package/src/components/Tooltip/Tooltip.tsx +110 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/Typography/Typography.stories.tsx +68 -0
- package/src/components/Typography/Typography.tsx +199 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/VirtualizedList/VirtualizedList.tsx +78 -0
- package/src/components/Wallet/State.tsx +36 -0
- package/src/components/Wallet/Wallet.stories.tsx +36 -0
- package/src/components/Wallet/Wallet.tsx +42 -0
- package/src/components/Wallet/index.ts +1 -0
- package/src/components/common/FilledCircle.tsx +8 -0
- package/src/components/common/index.ts +1 -0
- package/src/components/index.ts +24 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +13 -0
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +154 -0
- package/src/containers/ConfirmSwap/index.ts +1 -0
- package/src/containers/ConfirmSwap/mock.ts +146 -0
- package/src/containers/ConfirmWallets/ConfirmWallets.stories.tsx +26 -0
- package/src/containers/ConfirmWallets/ConfirmWallets.tsx +98 -0
- package/src/containers/ConfirmWallets/index.ts +1 -0
- package/src/containers/ConfirmWallets/mock.ts +222 -0
- package/src/containers/ConfirmWallets/types.ts +9 -0
- package/src/containers/History/History.stories.tsx +14 -0
- package/src/containers/History/History.tsx +93 -0
- package/src/containers/History/index.ts +1 -0
- package/src/containers/History/mock.ts +825 -0
- package/src/containers/History/types.tsx +66 -0
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +13 -0
- package/src/containers/SwapHistory/SwapHistory.tsx +165 -0
- package/src/containers/SwapHistory/index.ts +1 -0
- package/src/containers/SwapHistory/mock.ts +275 -0
- package/src/containers/index.ts +4 -0
- package/src/helper/index.ts +23 -0
- package/src/helper/swaps.ts +23 -0
- package/src/helpers.ts +2 -0
- package/src/index.ts +4 -0
- package/src/theme.ts +161 -0
- package/src/types/index.ts +1 -0
- package/src/types/meta.ts +20 -0
- package/src/types/swaps.tsx +36 -0
- package/src/types/wallet.ts +20 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { CosmosTransaction, EvmTransaction, SimulationResult, SolanaTransaction, SwapExplorerUrl, SwapperStatusStep, Transfer } from 'rango-sdk';
|
|
2
|
+
import {
|
|
3
|
+
MessageSeverity,
|
|
4
|
+
PendingSwapNetworkStatus,
|
|
5
|
+
StepStatus,
|
|
6
|
+
SwapSavedSettings,
|
|
7
|
+
SwapStatus,
|
|
8
|
+
WalletTypeAndAddress,
|
|
9
|
+
} from '../../types/swaps';
|
|
10
|
+
|
|
11
|
+
export type PendingSwapStep = {
|
|
12
|
+
id: number;
|
|
13
|
+
fromBlockchain: string;
|
|
14
|
+
fromSymbol: string;
|
|
15
|
+
fromSymbolAddress: string | null;
|
|
16
|
+
fromDecimals: number;
|
|
17
|
+
fromAmountPrecision: string | null;
|
|
18
|
+
fromAmountMinValue: string | null;
|
|
19
|
+
fromAmountMaxValue: string | null;
|
|
20
|
+
fromLogo: string;
|
|
21
|
+
fromBlockchainLogo: string;
|
|
22
|
+
toBlockchainLogo: string;
|
|
23
|
+
toBlockchain: string;
|
|
24
|
+
toSymbol: string;
|
|
25
|
+
toSymbolAddress: string | null;
|
|
26
|
+
toDecimals: number;
|
|
27
|
+
toLogo: string;
|
|
28
|
+
swapperId: string;
|
|
29
|
+
swapperLogo: string;
|
|
30
|
+
swapperType: string;
|
|
31
|
+
expectedOutputAmountHumanReadable: string | null;
|
|
32
|
+
startTransactionTime: number;
|
|
33
|
+
outputAmount: string;
|
|
34
|
+
status: StepStatus;
|
|
35
|
+
networkStatus: PendingSwapNetworkStatus | null;
|
|
36
|
+
executedTransactionId: string | null;
|
|
37
|
+
explorerUrl: SwapExplorerUrl[] | null;
|
|
38
|
+
evmApprovalTransaction: EvmTransaction | null;
|
|
39
|
+
evmTransaction: EvmTransaction | null;
|
|
40
|
+
cosmosTransaction: CosmosTransaction | null;
|
|
41
|
+
transferTransaction: Transfer | null;
|
|
42
|
+
solanaTransaction: SolanaTransaction | null;
|
|
43
|
+
diagnosisUrl: string | null;
|
|
44
|
+
internalSteps: SwapperStatusStep[] | null;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type PendingSwap = {
|
|
48
|
+
creationTime: string;
|
|
49
|
+
finishTime: string | null;
|
|
50
|
+
requestId: string;
|
|
51
|
+
inputAmount: string;
|
|
52
|
+
status: SwapStatus;
|
|
53
|
+
isPaused: boolean;
|
|
54
|
+
extraMessage: string | null;
|
|
55
|
+
extraMessageSeverity: MessageSeverity | null;
|
|
56
|
+
extraMessageErrorCode: string | null;
|
|
57
|
+
extraMessageDetail: string | null | undefined;
|
|
58
|
+
networkStatusExtraMessage: string | null;
|
|
59
|
+
networkStatusExtraMessageDetail: string | null;
|
|
60
|
+
lastNotificationTime: string | null;
|
|
61
|
+
wallets: { [p: string]: WalletTypeAndAddress };
|
|
62
|
+
settings: SwapSavedSettings;
|
|
63
|
+
steps: PendingSwapStep[];
|
|
64
|
+
simulationResult: SimulationResult;
|
|
65
|
+
validateBalanceOrFee: boolean;
|
|
66
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentMeta } from '@storybook/react';
|
|
3
|
+
import { PropTypes, SwapHistory } from './SwapHistory';
|
|
4
|
+
import { pendingSwap } from './mock';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Swap History',
|
|
8
|
+
component: SwapHistory,
|
|
9
|
+
} as ComponentMeta<typeof SwapHistory>;
|
|
10
|
+
|
|
11
|
+
export const Main = (args: PropTypes) => (
|
|
12
|
+
<SwapHistory {...args} pendingSwap={pendingSwap} />
|
|
13
|
+
);
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
StepDetail,
|
|
4
|
+
SecondaryPage,
|
|
5
|
+
GasIcon,
|
|
6
|
+
Typography,
|
|
7
|
+
CheckCircleIcon,
|
|
8
|
+
InfoCircleIcon,
|
|
9
|
+
} from '../../components';
|
|
10
|
+
import { styled } from '../../theme';
|
|
11
|
+
import {
|
|
12
|
+
RelativeContainer,
|
|
13
|
+
Dot,
|
|
14
|
+
SwapperContainer,
|
|
15
|
+
SwapperLogo,
|
|
16
|
+
ArrowDown,
|
|
17
|
+
Fee,
|
|
18
|
+
} from '../ConfirmSwap/ConfirmSwap';
|
|
19
|
+
import { PendingSwap } from '../History/types';
|
|
20
|
+
|
|
21
|
+
const StyledAnchor = styled('a', {
|
|
22
|
+
color: '$primary',
|
|
23
|
+
fontWeight: '$600',
|
|
24
|
+
marginLeft: '$12',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const InternalDetailsContainer = styled('div', {
|
|
28
|
+
display: 'flex',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const InternalDetail = styled('div', {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
padding: '$10',
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const DescriptionContainer = styled('div', {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const Description = styled(Typography, {
|
|
42
|
+
color: '$success',
|
|
43
|
+
marginLeft: '$8',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const Error = styled(Description, {
|
|
47
|
+
color: '$error',
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const Line = styled('div', {
|
|
51
|
+
width: '0',
|
|
52
|
+
marginLeft: '$12',
|
|
53
|
+
border: '1px dashed $foreground',
|
|
54
|
+
borderRadius: 'inherit',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export interface PropTypes {
|
|
58
|
+
pendingSwap: PendingSwap;
|
|
59
|
+
onBack: () => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function SwapHistory(props: PropTypes) {
|
|
63
|
+
const { pendingSwap, onBack } = props;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<SecondaryPage
|
|
67
|
+
title="History"
|
|
68
|
+
textField={false}
|
|
69
|
+
onBack={onBack}
|
|
70
|
+
Content={
|
|
71
|
+
<>
|
|
72
|
+
{pendingSwap?.steps.map((step, index) => (
|
|
73
|
+
<>
|
|
74
|
+
{index === 0 && (
|
|
75
|
+
<RelativeContainer>
|
|
76
|
+
<StepDetail
|
|
77
|
+
logo={step.fromLogo}
|
|
78
|
+
symbol={step.fromSymbol}
|
|
79
|
+
chainLogo={step.fromBlockchainLogo}
|
|
80
|
+
blockchain={step.fromBlockchain}
|
|
81
|
+
amount={pendingSwap.inputAmount}
|
|
82
|
+
/>
|
|
83
|
+
<Dot />
|
|
84
|
+
</RelativeContainer>
|
|
85
|
+
)}
|
|
86
|
+
<Line />
|
|
87
|
+
<SwapperContainer>
|
|
88
|
+
<SwapperLogo src={step.swapperLogo} alt={step.swapperId} />
|
|
89
|
+
<div>
|
|
90
|
+
<Typography ml={4} variant="caption">
|
|
91
|
+
{step.swapperType} from {step.fromSymbol} to {step.toSymbol}
|
|
92
|
+
via {step.swapperId}
|
|
93
|
+
</Typography>
|
|
94
|
+
<Fee>
|
|
95
|
+
<GasIcon />
|
|
96
|
+
<Typography ml={4} variant="caption">
|
|
97
|
+
{/* {parseFloat(step.fee[0].amount).toFixed(6)} estimated gas */}
|
|
98
|
+
fee
|
|
99
|
+
</Typography>
|
|
100
|
+
</Fee>
|
|
101
|
+
</div>
|
|
102
|
+
</SwapperContainer>
|
|
103
|
+
<div
|
|
104
|
+
style={{
|
|
105
|
+
display: 'flex',
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
108
|
+
<InternalDetailsContainer>
|
|
109
|
+
<Line />
|
|
110
|
+
{!!step.explorerUrl && (
|
|
111
|
+
<div>
|
|
112
|
+
{step.explorerUrl.map((item, index) => (
|
|
113
|
+
<InternalDetail>
|
|
114
|
+
<DescriptionContainer>
|
|
115
|
+
<CheckCircleIcon color="success" />
|
|
116
|
+
<Description variant="body2">
|
|
117
|
+
{!item.description ? (
|
|
118
|
+
<b>View transaction</b>
|
|
119
|
+
) : (
|
|
120
|
+
<b>
|
|
121
|
+
{item.description
|
|
122
|
+
.substring(0, 1)
|
|
123
|
+
.toUpperCase()}
|
|
124
|
+
{item.description.substring(1)}
|
|
125
|
+
</b>
|
|
126
|
+
)}
|
|
127
|
+
</Description>
|
|
128
|
+
</DescriptionContainer>
|
|
129
|
+
<StyledAnchor
|
|
130
|
+
href={item.url}
|
|
131
|
+
target="_blank"
|
|
132
|
+
rel="noreferrer"
|
|
133
|
+
key={index}
|
|
134
|
+
>
|
|
135
|
+
TX-Link
|
|
136
|
+
</StyledAnchor>
|
|
137
|
+
</InternalDetail>
|
|
138
|
+
))}
|
|
139
|
+
{step.status === 'failed' && (
|
|
140
|
+
<InternalDetail>
|
|
141
|
+
<DescriptionContainer>
|
|
142
|
+
<InfoCircleIcon color="error" />
|
|
143
|
+
<Error variant="body2">Step failed</Error>
|
|
144
|
+
</DescriptionContainer>
|
|
145
|
+
</InternalDetail>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
)}
|
|
149
|
+
</InternalDetailsContainer>
|
|
150
|
+
</div>
|
|
151
|
+
{index + 1 === pendingSwap.steps.length && <ArrowDown />}
|
|
152
|
+
<StepDetail
|
|
153
|
+
logo={step.toLogo}
|
|
154
|
+
symbol={step.toSymbol}
|
|
155
|
+
chainLogo={step.toBlockchainLogo}
|
|
156
|
+
blockchain={step.toBlockchain}
|
|
157
|
+
amount={step.outputAmount}
|
|
158
|
+
/>
|
|
159
|
+
</>
|
|
160
|
+
))}
|
|
161
|
+
</>
|
|
162
|
+
}
|
|
163
|
+
/>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwapHistory } from './SwapHistory';
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { RoutingResultType, TransactionType } from 'rango-sdk';
|
|
2
|
+
import { PendingSwap } from '../History/types';
|
|
3
|
+
|
|
4
|
+
export const pendingSwap: PendingSwap = {
|
|
5
|
+
creationTime: '1673164511955',
|
|
6
|
+
finishTime: '1673164550137',
|
|
7
|
+
requestId: '51e211d9-d61c-45d2-a4d4-1f9f7f90ee85',
|
|
8
|
+
inputAmount: '1',
|
|
9
|
+
wallets: {
|
|
10
|
+
OSMOSIS: {
|
|
11
|
+
walletType: 'keplr',
|
|
12
|
+
address: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
status: 'running',
|
|
16
|
+
isPaused: false,
|
|
17
|
+
extraMessage: null,
|
|
18
|
+
extraMessageSeverity: 'info',
|
|
19
|
+
extraMessageDetail: '',
|
|
20
|
+
extraMessageErrorCode: null,
|
|
21
|
+
networkStatusExtraMessage: null,
|
|
22
|
+
networkStatusExtraMessageDetail: null,
|
|
23
|
+
lastNotificationTime: null,
|
|
24
|
+
settings: {
|
|
25
|
+
slippage: '1.0',
|
|
26
|
+
disabledSwappersIds: [],
|
|
27
|
+
disabledSwappersGroups: [],
|
|
28
|
+
},
|
|
29
|
+
simulationResult: {
|
|
30
|
+
resultType: RoutingResultType.OK,
|
|
31
|
+
outputAmount: '1.540670',
|
|
32
|
+
swaps: [
|
|
33
|
+
{
|
|
34
|
+
swapperId: 'Osmosis',
|
|
35
|
+
swapperType: 'DEX',
|
|
36
|
+
swapperLogo: '',
|
|
37
|
+
from: {
|
|
38
|
+
symbol: 'JUNO',
|
|
39
|
+
logo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
|
|
40
|
+
address:
|
|
41
|
+
'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
|
|
42
|
+
blockchain: 'OSMOSIS',
|
|
43
|
+
blockchainLogo: '',
|
|
44
|
+
decimals: 6,
|
|
45
|
+
usdPrice: 1.1091996179668873,
|
|
46
|
+
},
|
|
47
|
+
to: {
|
|
48
|
+
symbol: 'OSMO',
|
|
49
|
+
logo: 'https://api.rango.exchange/i/mJQPS2',
|
|
50
|
+
address: null,
|
|
51
|
+
blockchain: 'OSMOSIS',
|
|
52
|
+
decimals: 6,
|
|
53
|
+
blockchainLogo: '',
|
|
54
|
+
usdPrice: 0.7192435454440882,
|
|
55
|
+
},
|
|
56
|
+
fromAmount: '1.000000',
|
|
57
|
+
fromAmountPrecision: null,
|
|
58
|
+
fromAmountMinValue: null,
|
|
59
|
+
fromAmountMaxValue: null,
|
|
60
|
+
fromAmountRestrictionType: 'EXCLUSIVE',
|
|
61
|
+
toAmount: '1.540670',
|
|
62
|
+
fee: [
|
|
63
|
+
{
|
|
64
|
+
asset: {
|
|
65
|
+
blockchain: 'OSMOSIS',
|
|
66
|
+
symbol: 'OSMO',
|
|
67
|
+
address: null,
|
|
68
|
+
},
|
|
69
|
+
expenseType: 'FROM_SOURCE_WALLET',
|
|
70
|
+
amount: '0',
|
|
71
|
+
name: 'Network Fee',
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
estimatedTimeInSeconds: 45,
|
|
75
|
+
swapChainType: 'INTRA_CHAIN',
|
|
76
|
+
routes: [
|
|
77
|
+
{
|
|
78
|
+
nodes: [
|
|
79
|
+
{
|
|
80
|
+
nodes: [
|
|
81
|
+
{
|
|
82
|
+
marketName: 'pool#498',
|
|
83
|
+
marketId: null,
|
|
84
|
+
percent: 1,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
from: 'JUNO',
|
|
88
|
+
fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
|
|
89
|
+
fromAddress:
|
|
90
|
+
'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
|
|
91
|
+
fromBlockchain: 'OSMOSIS',
|
|
92
|
+
to: 'ATOM',
|
|
93
|
+
toLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
94
|
+
toAddress:
|
|
95
|
+
'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
|
|
96
|
+
toBlockchain: 'OSMOSIS',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
nodes: [
|
|
100
|
+
{
|
|
101
|
+
marketName: 'pool#8',
|
|
102
|
+
marketId: null,
|
|
103
|
+
percent: 1,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
from: 'ATOM',
|
|
107
|
+
fromLogo: 'https://api.rango.exchange/tokens/COSMOS/ATOM.png',
|
|
108
|
+
fromAddress:
|
|
109
|
+
'ibc/27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2',
|
|
110
|
+
fromBlockchain: 'OSMOSIS',
|
|
111
|
+
to: 'IRIS',
|
|
112
|
+
toLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
|
|
113
|
+
toAddress:
|
|
114
|
+
'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
|
|
115
|
+
toBlockchain: 'OSMOSIS',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
nodes: [
|
|
119
|
+
{
|
|
120
|
+
marketName: 'pool#7',
|
|
121
|
+
marketId: null,
|
|
122
|
+
percent: 1,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
from: 'IRIS',
|
|
126
|
+
fromLogo: 'https://api.rango.exchange/tokens/COSMOS/IRIS.png',
|
|
127
|
+
fromAddress:
|
|
128
|
+
'ibc/7c4d60aa95e5a7558b0a364860979ca34b7ff8aaf255b87af9e879374470cec0',
|
|
129
|
+
fromBlockchain: 'OSMOSIS',
|
|
130
|
+
to: 'OSMO',
|
|
131
|
+
toLogo: 'https://api.rango.exchange/tokens/COSMOS/OSMO.png',
|
|
132
|
+
toAddress: null,
|
|
133
|
+
toBlockchain: 'OSMOSIS',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
recommendedSlippage: null,
|
|
139
|
+
timeStat: {
|
|
140
|
+
min: 6,
|
|
141
|
+
avg: 40,
|
|
142
|
+
max: 241,
|
|
143
|
+
},
|
|
144
|
+
includesDestinationTx: false,
|
|
145
|
+
maxRequiredSign: 1,
|
|
146
|
+
warnings: [],
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
validateBalanceOrFee: true,
|
|
151
|
+
steps: [
|
|
152
|
+
{
|
|
153
|
+
id: 1,
|
|
154
|
+
fromBlockchain: 'OSMOSIS',
|
|
155
|
+
fromSymbol: 'JUNO',
|
|
156
|
+
fromSymbolAddress:
|
|
157
|
+
'ibc/46b44899322f3cd854d2d46deef881958467cdd4b3b10086da49296bbed94bed',
|
|
158
|
+
fromDecimals: 6,
|
|
159
|
+
fromAmountPrecision: null,
|
|
160
|
+
fromAmountMinValue: null,
|
|
161
|
+
fromAmountMaxValue: null,
|
|
162
|
+
toBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
163
|
+
fromBlockchainLogo: 'https://api.rango.exchange/swappers/osmosis.png',
|
|
164
|
+
toBlockchain: 'OSMOSIS',
|
|
165
|
+
fromLogo: 'https://api.rango.exchange/tokens/COSMOS/JUNO.png',
|
|
166
|
+
toSymbol: 'OSMO',
|
|
167
|
+
toSymbolAddress: null,
|
|
168
|
+
swapperType: 'DEX',
|
|
169
|
+
toDecimals: 6,
|
|
170
|
+
toLogo: 'https://api.rango.exchange/i/mJQPS2',
|
|
171
|
+
startTransactionTime: 1673164519916,
|
|
172
|
+
swapperId: 'Osmosis',
|
|
173
|
+
swapperLogo: '',
|
|
174
|
+
expectedOutputAmountHumanReadable: '1.540670',
|
|
175
|
+
outputAmount: '1.540658',
|
|
176
|
+
status: 'running',
|
|
177
|
+
networkStatus: null,
|
|
178
|
+
executedTransactionId:
|
|
179
|
+
'0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
|
|
180
|
+
explorerUrl: [
|
|
181
|
+
{
|
|
182
|
+
url: 'https://www.mintscan.io/osmosis/txs/0f8f17eecc863c2d6be65ef52cfe3128ff3cd7baeddf133160bea8ccdfbf876b',
|
|
183
|
+
description: null,
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
cosmosTransaction: {
|
|
187
|
+
type: TransactionType.COSMOS,
|
|
188
|
+
fromWalletAddress: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
|
|
189
|
+
blockChain: 'OSMOSIS',
|
|
190
|
+
data: {
|
|
191
|
+
chainId: 'osmosis-1',
|
|
192
|
+
account_number: 102721,
|
|
193
|
+
sequence: '308',
|
|
194
|
+
msgs: [
|
|
195
|
+
{
|
|
196
|
+
__type: 'OsmosisSwapMessage',
|
|
197
|
+
type: 'osmosis/gamm/swap-exact-amount-in',
|
|
198
|
+
value: {
|
|
199
|
+
sender: 'osmo1unf2rcytjxfpz8x8ar63h4qeftadptg5t0nqcl',
|
|
200
|
+
routes: [
|
|
201
|
+
{
|
|
202
|
+
pool_id: '498',
|
|
203
|
+
token_out_denom:
|
|
204
|
+
'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
pool_id: '8',
|
|
208
|
+
token_out_denom:
|
|
209
|
+
'ibc/7C4D60AA95E5A7558B0A364860979CA34B7FF8AAF255B87AF9E879374470CEC0',
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
pool_id: '7',
|
|
213
|
+
token_out_denom: 'uosmo',
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
token_in: {
|
|
217
|
+
denom:
|
|
218
|
+
'ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED',
|
|
219
|
+
amount: '1000000',
|
|
220
|
+
},
|
|
221
|
+
token_out_min_amount: '1525264',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
],
|
|
225
|
+
protoMsgs: [
|
|
226
|
+
{
|
|
227
|
+
type_url: '/osmosis.gamm.v1beta1.MsgSwapExactAmountIn',
|
|
228
|
+
value: [
|
|
229
|
+
10, 43, 111, 115, 109, 111, 49, 117, 110, 102, 50, 114, 99, 121,
|
|
230
|
+
116, 106, 120, 102, 112, 122, 56, 120, 56, 97, 114, 54, 51, 104,
|
|
231
|
+
52, 113, 101, 102, 116, 97, 100, 112, 116, 103, 53, 116, 48,
|
|
232
|
+
110, 113, 99, 108, 18, 73, 8, -14, 3, 18, 68, 105, 98, 99, 47,
|
|
233
|
+
50, 55, 51, 57, 52, 70, 66, 48, 57, 50, 68, 50, 69, 67, 67, 68,
|
|
234
|
+
53, 54, 49, 50, 51, 67, 55, 52, 70, 51, 54, 69, 52, 67, 49, 70,
|
|
235
|
+
57, 50, 54, 48, 48, 49, 67, 69, 65, 68, 65, 57, 67, 65, 57, 55,
|
|
236
|
+
69, 65, 54, 50, 50, 66, 50, 53, 70, 52, 49, 69, 53, 69, 66, 50,
|
|
237
|
+
18, 72, 8, 8, 18, 68, 105, 98, 99, 47, 55, 67, 52, 68, 54, 48,
|
|
238
|
+
65, 65, 57, 53, 69, 53, 65, 55, 53, 53, 56, 66, 48, 65, 51, 54,
|
|
239
|
+
52, 56, 54, 48, 57, 55, 57, 67, 65, 51, 52, 66, 55, 70, 70, 56,
|
|
240
|
+
65, 65, 70, 50, 53, 53, 66, 56, 55, 65, 70, 57, 69, 56, 55, 57,
|
|
241
|
+
51, 55, 52, 52, 55, 48, 67, 69, 67, 48, 18, 9, 8, 7, 18, 5, 117,
|
|
242
|
+
111, 115, 109, 111, 26, 79, 10, 68, 105, 98, 99, 47, 52, 54, 66,
|
|
243
|
+
52, 52, 56, 57, 57, 51, 50, 50, 70, 51, 67, 68, 56, 53, 52, 68,
|
|
244
|
+
50, 68, 52, 54, 68, 69, 69, 70, 56, 56, 49, 57, 53, 56, 52, 54,
|
|
245
|
+
55, 67, 68, 68, 52, 66, 51, 66, 49, 48, 48, 56, 54, 68, 65, 52,
|
|
246
|
+
57, 50, 57, 54, 66, 66, 69, 68, 57, 52, 66, 69, 68, 18, 7, 49,
|
|
247
|
+
48, 48, 48, 48, 48, 48, 34, 7, 49, 53, 50, 53, 50, 54, 52,
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
memo: '',
|
|
252
|
+
source: null,
|
|
253
|
+
fee: {
|
|
254
|
+
gas: '900000',
|
|
255
|
+
amount: [
|
|
256
|
+
{
|
|
257
|
+
denom: 'uosmo',
|
|
258
|
+
amount: '0',
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
},
|
|
262
|
+
signType: 'AMINO',
|
|
263
|
+
rpcUrl: 'sample_rpc',
|
|
264
|
+
},
|
|
265
|
+
rawTransfer: null,
|
|
266
|
+
},
|
|
267
|
+
solanaTransaction: null,
|
|
268
|
+
evmTransaction: null,
|
|
269
|
+
evmApprovalTransaction: null,
|
|
270
|
+
transferTransaction: null,
|
|
271
|
+
diagnosisUrl: null,
|
|
272
|
+
internalSteps: null,
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BestRouteResponse } from 'rango-sdk';
|
|
2
|
+
|
|
3
|
+
export const secondsToString = (s: number): string => {
|
|
4
|
+
const minutes = parseInt((s / 60).toString()).toString();
|
|
5
|
+
return `${minutes}`;
|
|
6
|
+
};
|
|
7
|
+
export const totalArrivalTime = (data: BestRouteResponse) =>
|
|
8
|
+
data?.result?.swaps?.reduce((a, b) => a + b.estimatedTimeInSeconds, 0) || 0;
|
|
9
|
+
|
|
10
|
+
export const rawFees = (data: BestRouteResponse): string =>
|
|
11
|
+
(
|
|
12
|
+
data?.result?.swaps?.flatMap((s) =>
|
|
13
|
+
s.fee.map((f) => ({ swapperId: s.swapperId, fee: f }))
|
|
14
|
+
) || []
|
|
15
|
+
)
|
|
16
|
+
.reduce((partialSum, a) => partialSum + parseFloat(a.fee.amount), 0)
|
|
17
|
+
.toFixed(3);
|
|
18
|
+
|
|
19
|
+
export const decimalNumber = (number = '0', toFixed: number) =>
|
|
20
|
+
parseFloat(number).toFixed(toFixed);
|
|
21
|
+
|
|
22
|
+
export const containsText = (text: string, searchText: string) =>
|
|
23
|
+
text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PendingSwap } from '../containers/History/types';
|
|
2
|
+
|
|
3
|
+
export function groupingOfSwaps(list: PendingSwap[]) {
|
|
4
|
+
return list.reduce(
|
|
5
|
+
(acc: Array<{ title: string; swaps: PendingSwap[] }>, swap) => {
|
|
6
|
+
const categoryIndex = acc.findIndex(
|
|
7
|
+
(item) =>
|
|
8
|
+
(swap.status === 'running' && item.title == 'Active Swaps') ||
|
|
9
|
+
(swap.status !== 'running' && item.title == 'Recent Swaps')
|
|
10
|
+
);
|
|
11
|
+
if (categoryIndex > -1) {
|
|
12
|
+
acc[categoryIndex].swaps.push(swap);
|
|
13
|
+
} else {
|
|
14
|
+
acc.push({
|
|
15
|
+
title: swap.status === 'running' ? 'Active Swaps' : 'Recent Swaps',
|
|
16
|
+
swaps: [swap],
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return acc;
|
|
20
|
+
},
|
|
21
|
+
[]
|
|
22
|
+
);
|
|
23
|
+
}
|
package/src/helpers.ts
ADDED
package/src/index.ts
ADDED