@rango-dev/ui 0.1.14 → 0.1.16-next.0
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/dist/components/Alert/Alert.d.ts +7 -7
- package/dist/components/Alert/Alert.stories.d.ts +7 -5
- package/dist/components/Alert/LoadingFailedAlert.d.ts +2 -2
- package/dist/components/Alert/NotFoundAlert.d.ts +7 -7
- package/dist/components/Alert/index.d.ts +2 -2
- package/dist/components/BestRoute/BestRoute.d.ts +15 -12
- package/dist/components/BestRoute/BestRoute.stories.d.ts +10 -8
- package/dist/components/BestRoute/index.d.ts +1 -1
- package/dist/components/BestRoute/mock.d.ts +4 -4
- package/dist/components/BlockchainsList/BlockchainsList.d.ts +10 -10
- package/dist/components/BlockchainsList/BlockchainsList.stories.d.ts +5 -5
- package/dist/components/BlockchainsList/index.d.ts +1 -1
- package/dist/components/BlockchainsList/mockData.d.ts +2 -2
- package/dist/components/Button/Button.d.ts +17 -17
- package/dist/components/Button/Button.stories.d.ts +10 -8
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +11 -11
- package/dist/components/Checkbox/Checkbox.stories.d.ts +7 -5
- package/dist/components/Checkbox/index.d.ts +1 -1
- package/dist/components/Chip/Chip.d.ts +12 -12
- package/dist/components/Chip/Chip.stories.d.ts +7 -7
- package/dist/components/Chip/index.d.ts +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts +9 -9
- package/dist/components/ColorPicker/ColorPicker.stories.d.ts +5 -5
- package/dist/components/ColorPicker/index.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +6 -6
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts +13 -13
- package/dist/components/Drawer/Drawer.stories.d.ts +8 -8
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Header/Header.d.ts +9 -9
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Icon/AddCircleIcon.d.ts +3 -3
- package/dist/components/Icon/AddIcon.d.ts +3 -3
- package/dist/components/Icon/AddWalletIcon.d.ts +3 -3
- package/dist/components/Icon/AngleDownIcon.d.ts +3 -3
- package/dist/components/Icon/AngleLeftIcon.d.ts +3 -3
- package/dist/components/Icon/AngleRightIcon.d.ts +3 -3
- package/dist/components/Icon/AngleUpIcon.d.ts +3 -3
- package/dist/components/Icon/ArrowRightIcon.d.ts +3 -3
- package/dist/components/Icon/BagIcon.d.ts +3 -3
- package/dist/components/Icon/BanIcon.d.ts +3 -3
- package/dist/components/Icon/CheckCircleIcon.d.ts +3 -3
- package/dist/components/Icon/CheckIcon.d.ts +3 -3
- package/dist/components/Icon/CheckSquareIcon.d.ts +3 -3
- package/dist/components/Icon/CheckWalletIcon.d.ts +3 -3
- package/dist/components/Icon/ChevronRightIcon.d.ts +3 -3
- package/dist/components/Icon/CloseIcon.d.ts +112 -1
- package/dist/components/Icon/CopyIcon.d.ts +3 -3
- package/dist/components/Icon/DeleteCircleIcon.d.ts +3 -3
- package/dist/components/Icon/DeleteWalletIcon.d.ts +3 -3
- package/dist/components/Icon/DisconnectIcon.d.ts +3 -3
- package/dist/components/Icon/DownloadIcon.d.ts +3 -3
- package/dist/components/Icon/GasIcon.d.ts +3 -3
- package/dist/components/Icon/HistoryIcon.d.ts +3 -3
- package/dist/components/Icon/HorizontalSwapIcon.d.ts +3 -3
- package/dist/components/Icon/Icons.stories.d.ts +5 -5
- package/dist/components/Icon/InfoCircleIcon.d.ts +3 -3
- package/dist/components/Icon/MinusCircleIcon.d.ts +3 -3
- package/dist/components/Icon/RetryIcon.d.ts +3 -3
- package/dist/components/Icon/RetryLeftIcon.d.ts +3 -3
- package/dist/components/Icon/RetryRightIcon.d.ts +3 -3
- package/dist/components/Icon/SearchIcon.d.ts +3 -3
- package/dist/components/Icon/SearchMinusIcon.d.ts +3 -3
- package/dist/components/Icon/SettingIcon.d.ts +3 -3
- package/dist/components/Icon/SignatureIcon.d.ts +3 -3
- package/dist/components/Icon/SwapWalletIcon.d.ts +3 -3
- package/dist/components/Icon/TimeIcon.d.ts +3 -3
- package/dist/components/Icon/TrashIcon.d.ts +3 -3
- package/dist/components/Icon/TryAgainIcon.d.ts +3 -3
- package/dist/components/Icon/VerticalSwapIcon.d.ts +3 -3
- package/dist/components/Icon/WalletIconIcon.d.ts +3 -3
- package/dist/components/Icon/WarningIcon.d.ts +3 -3
- package/dist/components/Icon/common.d.ts +228 -2
- package/dist/components/Icon/index.d.ts +40 -40
- package/dist/components/Icon/types.d.ts +7 -7
- package/dist/components/LiquiditySourceList/LiquiditySource.stories.d.ts +5 -5
- package/dist/components/LiquiditySourceList/LiquiditySourceList.d.ts +11 -11
- package/dist/components/LiquiditySourceList/index.d.ts +1 -1
- package/dist/components/LiquiditySourceList/mockData.d.ts +2 -2
- package/dist/components/Modal/Modal.d.ts +11 -11
- package/dist/components/Modal/Modal.stories.d.ts +5 -5
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Radio/Radio.d.ts +13 -13
- package/dist/components/Radio/Radio.stories.d.ts +5 -5
- package/dist/components/Radio/index.d.ts +1 -1
- package/dist/components/SecondaryPage/SecondaryPage.d.ts +16 -16
- package/dist/components/SecondaryPage/SecondaryPage.stories.d.ts +5 -2
- package/dist/components/SecondaryPage/index.d.ts +1 -1
- package/dist/components/SelectableWalletList/SelectableWalletList.d.ts +7 -7
- package/dist/components/SelectableWalletList/SelectableWalletList.stories.d.ts +7 -5
- package/dist/components/SelectableWalletList/index.d.ts +1 -1
- package/dist/components/SelectableWalletList/mock.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.d.ts +6 -6
- package/dist/components/Skeleton/Skeleton.stories.d.ts +5 -5
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.d.ts +6 -6
- package/dist/components/Spinner/Spinner.stories.d.ts +5 -5
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/StatusDrawer/StatusDrawer.d.ts +11 -11
- package/dist/components/StatusDrawer/StatusDrawer.stories.d.ts +5 -5
- package/dist/components/StatusDrawer/index.d.ts +1 -1
- package/dist/components/StepDetail/StepDetail.d.ts +12 -12
- package/dist/components/StepDetail/StepDetail.stories.d.ts +7 -5
- package/dist/components/StepDetail/index.d.ts +1 -1
- package/dist/components/SwapContainer/SwapContainer.d.ts +7 -7
- package/dist/components/SwapContainer/index.d.ts +1 -1
- package/dist/components/SwapDetail/SwapDetail.d.ts +8 -8
- package/dist/components/SwapDetail/SwapDetail.stories.d.ts +7 -5
- package/dist/components/SwapDetail/Token.d.ts +17 -17
- package/dist/components/SwapDetail/index.d.ts +1 -1
- package/dist/components/SwapDetail/mock.d.ts +2 -2
- package/dist/components/Switch/Switch.d.ts +6 -6
- package/dist/components/Switch/Switch.stories.d.ts +5 -5
- package/dist/components/Switch/index.d.ts +1 -1
- package/dist/components/TextField/TextField.d.ts +10 -10
- package/dist/components/TextField/TextField.stories.d.ts +7 -7
- package/dist/components/TextField/index.d.ts +1 -1
- package/dist/components/TokenList/TokenItem.d.ts +11 -11
- package/dist/components/TokenList/TokenList.d.ts +17 -17
- package/dist/components/TokenList/TokenList.stories.d.ts +5 -5
- package/dist/components/TokenList/index.d.ts +1 -1
- package/dist/components/TokenList/mockData.d.ts +2 -2
- package/dist/components/Tooltip/Tooltip.d.ts +7 -7
- package/dist/components/Tooltip/Tooltip.stories.d.ts +7 -5
- package/dist/components/Tooltip/index.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +18 -18
- package/dist/components/Typography/Typography.stories.d.ts +7 -5
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/components/VirtualizedList/VirtualizedList.d.ts +17 -17
- package/dist/components/Wallet/State.d.ts +7 -7
- package/dist/components/Wallet/Wallet.d.ts +7 -7
- package/dist/components/Wallet/Wallet.stories.d.ts +7 -5
- package/dist/components/Wallet/index.d.ts +1 -1
- package/dist/components/common/FilledCircle.d.ts +111 -1
- package/dist/components/common/Image.d.ts +6 -6
- package/dist/components/common/index.d.ts +2 -2
- package/dist/components/index.d.ts +25 -31
- package/dist/{components → containers}/BlockchainSelector/BlockchainSelector.d.ts +17 -17
- package/dist/{components → containers}/BlockchainSelector/BlockchainSelector.stories.d.ts +5 -5
- package/dist/containers/ConfirmSwap/ConfirmSwap.d.ts +22 -22
- package/dist/containers/ConfirmSwap/ConfirmSwap.stories.d.ts +8 -6
- package/dist/containers/ConfirmSwap/index.d.ts +1 -1
- package/dist/containers/ConfirmSwap/mock.d.ts +5 -5
- package/dist/{components → containers}/ConnectWalletsModal/ConnectWallets.stories.d.ts +5 -5
- package/dist/{components → containers}/ConnectWalletsModal/ConnectWalletsModal.d.ts +11 -11
- package/dist/{components → containers}/ConnectWalletsModal/mockData.d.ts +2 -2
- package/dist/containers/History/History.d.ts +6 -6
- package/dist/containers/History/History.stories.d.ts +9 -5
- package/dist/containers/History/SwapsGroup.d.ts +13 -13
- package/dist/containers/History/index.d.ts +3 -2
- package/dist/containers/History/mock.d.ts +2 -2
- package/dist/containers/History/types.d.ts +39 -39
- package/dist/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.d.ts +13 -13
- package/dist/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.d.ts +5 -5
- package/dist/{components → containers}/Settings/Settings.d.ts +24 -24
- package/dist/{components → containers}/Settings/Settings.stories.d.ts +5 -5
- package/dist/containers/SwapHistory/SwapHistory.d.ts +1128 -24
- package/dist/containers/SwapHistory/SwapHistory.stories.d.ts +14 -5
- package/dist/containers/SwapHistory/SwapMessages.d.ts +17 -17
- package/dist/containers/SwapHistory/index.d.ts +1 -1
- package/dist/containers/SwapHistory/mock.d.ts +2 -2
- package/dist/containers/TokenSelector/TokenSelector.d.ts +124 -0
- package/dist/{components → containers}/TokenSelector/TokenSelector.stories.d.ts +5 -5
- package/dist/containers/index.d.ts +8 -3
- package/dist/helper/index.d.ts +6 -6
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/useCopyToClipboard.d.ts +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +20 -8
- package/dist/index.js.map +7 -0
- package/dist/theme.d.ts +928 -8
- package/dist/types/index.d.ts +2 -2
- package/dist/types/meta.d.ts +23 -23
- package/dist/types/swaps.d.ts +29 -29
- package/dist/types/wallet.d.ts +23 -23
- package/package.json +18 -38
- package/src/components/Alert/Alert.stories.tsx +19 -6
- package/src/components/Alert/Alert.tsx +3 -3
- package/src/components/BestRoute/BestRoute.stories.tsx +15 -5
- package/src/components/BestRoute/mock.ts +1 -1
- package/src/components/BlockchainsList/BlockchainsList.stories.tsx +9 -3
- package/src/components/BlockchainsList/mockData.ts +603 -108
- package/src/components/Button/Button.stories.tsx +8 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +6 -2
- package/src/components/Chip/Chip.stories.tsx +23 -7
- package/src/components/ColorPicker/ColorPicker.stories.tsx +6 -3
- package/src/components/Divider/Divider.tsx +113 -11
- package/src/components/Drawer/Drawer.stories.tsx +8 -11
- package/src/components/Icon/Icons.stories.tsx +8 -4
- package/src/components/LiquiditySourceList/LiquiditySource.stories.tsx +6 -3
- package/src/components/LiquiditySourceList/LiquiditySourceList.tsx +3 -3
- package/src/components/Modal/Modal.stories.tsx +9 -10
- package/src/components/Radio/Radio.stories.tsx +12 -7
- package/src/components/SecondaryPage/SecondaryPage.stories.tsx +12 -3
- package/src/components/SelectableWalletList/SelectableWalletList.stories.tsx +2 -2
- package/src/components/SelectableWalletList/mock.ts +2 -2
- package/src/components/Skeleton/Skeleton.stories.tsx +6 -2
- package/src/components/Spinner/Spinner.stories.tsx +6 -2
- package/src/components/StatusDrawer/StatusDrawer.stories.tsx +7 -2
- package/src/components/StatusDrawer/StatusDrawer.tsx +2 -2
- package/src/components/StepDetail/StepDetail.stories.tsx +9 -2
- package/src/components/SwapDetail/SwapDetail.stories.tsx +5 -2
- package/src/components/SwapDetail/SwapDetail.tsx +3 -3
- package/src/components/SwapDetail/Token.tsx +4 -4
- package/src/components/Switch/Switch.stories.tsx +2 -2
- package/src/components/TextField/TextField.stories.tsx +3 -2
- package/src/components/TokenList/TokenList.stories.tsx +3 -3
- package/src/components/Tooltip/Tooltip.stories.tsx +7 -2
- package/src/components/Typography/Typography.stories.tsx +2 -2
- package/src/components/Wallet/Wallet.stories.tsx +7 -13
- package/src/components/index.ts +0 -6
- package/src/containers/BlockchainSelector/BlockchainSelector.stories.tsx +41 -0
- package/src/{components → containers}/BlockchainSelector/BlockchainSelector.tsx +5 -5
- package/{dist/components/BlockchainSelector/index.d.ts → src/containers/BlockchainSelector/index.ts} +1 -1
- package/src/containers/ConfirmSwap/ConfirmSwap.stories.tsx +223 -10
- package/src/containers/ConfirmSwap/ConfirmSwap.tsx +21 -12
- package/src/containers/ConfirmSwap/mock.ts +12 -15
- package/src/containers/ConnectWalletsModal/ConnectWallets.stories.tsx +24 -0
- package/src/{components → containers}/ConnectWalletsModal/ConnectWalletsModal.tsx +3 -3
- package/{dist/components/ConnectWalletsModal/index.d.ts → src/containers/ConnectWalletsModal/index.ts} +1 -1
- package/src/{components → containers}/ConnectWalletsModal/mockData.ts +17 -17
- package/src/containers/History/History.stories.tsx +2 -2
- package/src/containers/History/History.tsx +1 -1
- package/src/containers/History/index.ts +2 -1
- package/src/containers/History/mock.ts +3 -3
- package/src/containers/History/types.tsx +1 -1
- package/src/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.stories.tsx +7 -4
- package/src/{components → containers}/LiquiditySourcesSelector/LiquiditySourcesSelector.tsx +2 -3
- package/{dist/components/LiquiditySourcesSelector/index.d.ts → src/containers/LiquiditySourcesSelector/index.ts} +1 -1
- package/src/containers/Settings/Settings.stories.tsx +27 -0
- package/src/{components → containers}/Settings/Settings.tsx +11 -8
- package/{dist/components/Settings/index.d.ts → src/containers/Settings/index.ts} +1 -1
- package/src/containers/SwapHistory/SwapHistory.stories.tsx +3 -3
- package/src/containers/SwapHistory/SwapHistory.tsx +4 -5
- package/src/containers/SwapHistory/mock.ts +2 -2
- package/src/{components → containers}/TokenSelector/TokenSelector.stories.tsx +7 -8
- package/src/{components → containers}/TokenSelector/TokenSelector.tsx +7 -6
- package/{dist/components/TokenSelector/index.d.ts → src/containers/TokenSelector/index.ts} +1 -1
- package/src/containers/index.ts +5 -0
- package/src/theme.ts +14 -22
- package/src/types/index.ts +1 -1
- package/dist/components/Spacer/Spacer.d.ts +0 -6
- package/dist/components/Spacer/Spacer.stories.d.ts +0 -5
- package/dist/components/Spacer/index.d.ts +0 -1
- package/dist/components/SwapContainer/SwapContainer.stories.d.ts +0 -5
- package/dist/components/TokenSelector/TokenSelector.d.ts +0 -14
- package/dist/ui.cjs.development.js +0 -5181
- package/dist/ui.cjs.development.js.map +0 -1
- package/dist/ui.cjs.production.min.js +0 -2
- package/dist/ui.cjs.production.min.js.map +0 -1
- package/dist/ui.esm.js +0 -5091
- package/dist/ui.esm.js.map +0 -1
- package/src/components/BlockchainSelector/BlockchainSelector.stories.tsx +0 -25
- package/src/components/ConnectWalletsModal/ConnectWallets.stories.tsx +0 -13
- package/src/components/Settings/Settings.stories.tsx +0 -34
- package/src/components/Spacer/Spacer.stories.tsx +0 -31
- package/src/components/Spacer/Spacer.tsx +0 -128
- package/src/components/Spacer/index.ts +0 -1
- package/src/components/SwapContainer/SwapContainer.stories.tsx +0 -13
- /package/{src/components/BlockchainSelector/index.ts → dist/containers/BlockchainSelector/index.d.ts} +0 -0
- /package/{src/components/ConnectWalletsModal/index.ts → dist/containers/ConnectWalletsModal/index.d.ts} +0 -0
- /package/{src/components/LiquiditySourcesSelector/index.ts → dist/containers/LiquiditySourcesSelector/index.d.ts} +0 -0
- /package/{src/components/Settings/index.ts → dist/containers/Settings/index.d.ts} +0 -0
- /package/{src/components/TokenSelector/index.ts → dist/containers/TokenSelector/index.d.ts} +0 -0
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './wallet';
|
|
2
|
-
export { BestRouteWithFee } from './swaps';
|
|
1
|
+
export * from './wallet';
|
|
2
|
+
export type { BestRouteWithFee } from './swaps';
|
package/dist/types/meta.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export
|
|
2
|
-
blockchain: string;
|
|
3
|
-
symbol: string;
|
|
4
|
-
image: string;
|
|
5
|
-
address: string | null;
|
|
6
|
-
usdPrice: number | null;
|
|
7
|
-
isSecondaryCoin: boolean;
|
|
8
|
-
coinSource: string | null;
|
|
9
|
-
coinSourceUrl: string | null;
|
|
10
|
-
name: string | null;
|
|
11
|
-
decimals: number;
|
|
12
|
-
balance?: {
|
|
13
|
-
amount: string;
|
|
14
|
-
usdPrice: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export interface LiquiditySource {
|
|
18
|
-
title: string;
|
|
19
|
-
logo: string;
|
|
20
|
-
type: 'BRIDGE' | 'AGGREGATOR' | 'DEX';
|
|
21
|
-
selected: boolean;
|
|
22
|
-
}
|
|
23
|
-
export
|
|
1
|
+
export type TokenMeta = {
|
|
2
|
+
blockchain: string;
|
|
3
|
+
symbol: string;
|
|
4
|
+
image: string;
|
|
5
|
+
address: string | null;
|
|
6
|
+
usdPrice: number | null;
|
|
7
|
+
isSecondaryCoin: boolean;
|
|
8
|
+
coinSource: string | null;
|
|
9
|
+
coinSourceUrl: string | null;
|
|
10
|
+
name: string | null;
|
|
11
|
+
decimals: number;
|
|
12
|
+
balance?: {
|
|
13
|
+
amount: string;
|
|
14
|
+
usdPrice: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export interface LiquiditySource {
|
|
18
|
+
title: string;
|
|
19
|
+
logo: string;
|
|
20
|
+
type: 'BRIDGE' | 'AGGREGATOR' | 'DEX';
|
|
21
|
+
selected: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type LoadingStatus = 'loading' | 'success' | 'failed';
|
package/dist/types/swaps.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { BestRouteResponse, BlockchainValidationStatus, SimulationResult, SwapResult, WalletRequiredAssets } from 'rango-sdk';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export declare enum PendingSwapNetworkStatus {
|
|
6
|
-
WaitingForConnectingWallet = "waitingForConnectingWallet",
|
|
7
|
-
WaitingForQueue = "waitingForQueue",
|
|
8
|
-
WaitingForNetworkChange = "waitingForNetworkChange",
|
|
9
|
-
NetworkChanged = "networkChanged"
|
|
10
|
-
}
|
|
11
|
-
export
|
|
12
|
-
walletType: string;
|
|
13
|
-
address: string;
|
|
14
|
-
};
|
|
15
|
-
export
|
|
16
|
-
slippage: string;
|
|
17
|
-
disabledSwappersIds: string[];
|
|
18
|
-
disabledSwappersGroups: string[];
|
|
19
|
-
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
result: Omit<SimulationResult, 'swaps'> & {
|
|
25
|
-
swaps: (SwapResult & {
|
|
26
|
-
feeInUsd?: string;
|
|
27
|
-
})[];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
1
|
+
import { BestRouteResponse, BlockchainValidationStatus, SimulationResult, SwapResult, WalletRequiredAssets } from 'rango-sdk';
|
|
2
|
+
export type SwapStatus = 'running' | 'failed' | 'success';
|
|
3
|
+
export type MessageSeverity = 'error' | 'warning' | 'info' | 'success';
|
|
4
|
+
export type StepStatus = 'created' | 'running' | 'failed' | 'success' | 'waitingForApproval' | 'approved';
|
|
5
|
+
export declare enum PendingSwapNetworkStatus {
|
|
6
|
+
WaitingForConnectingWallet = "waitingForConnectingWallet",
|
|
7
|
+
WaitingForQueue = "waitingForQueue",
|
|
8
|
+
WaitingForNetworkChange = "waitingForNetworkChange",
|
|
9
|
+
NetworkChanged = "networkChanged"
|
|
10
|
+
}
|
|
11
|
+
export type WalletTypeAndAddress = {
|
|
12
|
+
walletType: string;
|
|
13
|
+
address: string;
|
|
14
|
+
};
|
|
15
|
+
export type SwapSavedSettings = {
|
|
16
|
+
slippage: string;
|
|
17
|
+
disabledSwappersIds: string[];
|
|
18
|
+
disabledSwappersGroups: string[];
|
|
19
|
+
};
|
|
20
|
+
export type SimulationAssetAndAmount = WalletRequiredAssets;
|
|
21
|
+
export type SimulationValidationStatus = BlockchainValidationStatus;
|
|
22
|
+
export type BestRouteType = BestRouteResponse;
|
|
23
|
+
export type BestRouteWithFee = Omit<BestRouteResponse, 'result'> & {
|
|
24
|
+
result: Omit<SimulationResult, 'swaps'> & {
|
|
25
|
+
swaps: (SwapResult & {
|
|
26
|
+
feeInUsd?: string;
|
|
27
|
+
})[];
|
|
28
|
+
};
|
|
29
|
+
};
|
package/dist/types/wallet.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { InstallObjects, WalletType } from '@rango-dev/wallets-shared';
|
|
2
|
-
export declare enum WalletState {
|
|
3
|
-
NOT_INSTALLED = "not installed",
|
|
4
|
-
DISCONNECTED = "disconnected",
|
|
5
|
-
CONNECTING = "connecting",
|
|
6
|
-
CONNECTED = "connected"
|
|
7
|
-
}
|
|
8
|
-
export
|
|
9
|
-
state: WalletState.CONNECTED | WalletState.DISCONNECTED | WalletState.CONNECTING | WalletState.NOT_INSTALLED;
|
|
10
|
-
installLink: InstallObjects | string;
|
|
11
|
-
name: string;
|
|
12
|
-
image: string;
|
|
13
|
-
type: WalletType;
|
|
14
|
-
showOnMobile: boolean;
|
|
15
|
-
};
|
|
16
|
-
export interface SelectableWallet {
|
|
17
|
-
chain: string;
|
|
18
|
-
walletType: WalletType;
|
|
19
|
-
address: string;
|
|
20
|
-
image: string;
|
|
21
|
-
selected: boolean;
|
|
22
|
-
name: string;
|
|
23
|
-
}
|
|
1
|
+
import { InstallObjects, WalletType } from '@rango-dev/wallets-shared';
|
|
2
|
+
export declare enum WalletState {
|
|
3
|
+
NOT_INSTALLED = "not installed",
|
|
4
|
+
DISCONNECTED = "disconnected",
|
|
5
|
+
CONNECTING = "connecting",
|
|
6
|
+
CONNECTED = "connected"
|
|
7
|
+
}
|
|
8
|
+
export type WalletInfo = {
|
|
9
|
+
state: WalletState.CONNECTED | WalletState.DISCONNECTED | WalletState.CONNECTING | WalletState.NOT_INSTALLED;
|
|
10
|
+
installLink: InstallObjects | string;
|
|
11
|
+
name: string;
|
|
12
|
+
image: string;
|
|
13
|
+
type: WalletType;
|
|
14
|
+
showOnMobile: boolean;
|
|
15
|
+
};
|
|
16
|
+
export interface SelectableWallet {
|
|
17
|
+
chain: string;
|
|
18
|
+
walletType: WalletType;
|
|
19
|
+
address: string;
|
|
20
|
+
image: string;
|
|
21
|
+
selected: boolean;
|
|
22
|
+
name: string;
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,58 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.16-next.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
5
|
+
"module": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"src"
|
|
10
10
|
],
|
|
11
11
|
"scripts": {
|
|
12
|
-
"dev": "
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"analyze": "size-limit --why",
|
|
19
|
-
"storybook": "start-storybook -p 3000",
|
|
20
|
-
"build-storybook": "build-storybook"
|
|
12
|
+
"dev": "yarn bundle --watch",
|
|
13
|
+
"bundle": "esbuild src/index.ts --bundle --minify --keep-names --sourcemap --outdir=dist --platform=node --format=esm --packages=external",
|
|
14
|
+
"build": "yarn type-checking && yarn bundle",
|
|
15
|
+
"type-checking": "tsc --declaration --emitDeclarationOnly",
|
|
16
|
+
"storybook": "storybook dev -p 3000",
|
|
17
|
+
"build-storybook": "storybook build"
|
|
21
18
|
},
|
|
22
19
|
"peerDependencies": {
|
|
23
20
|
"@rango-dev/queue-manager-rango-preset": "*",
|
|
24
21
|
"react": ">=16"
|
|
25
22
|
},
|
|
26
|
-
"husky": {
|
|
27
|
-
"hooks": {
|
|
28
|
-
"pre-commit": "tsdx lint"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"prettier": {
|
|
32
|
-
"printWidth": 80,
|
|
33
|
-
"semi": true,
|
|
34
|
-
"singleQuote": true,
|
|
35
|
-
"trailingComma": "es5"
|
|
36
|
-
},
|
|
37
|
-
"module": "dist/ui.esm.js",
|
|
38
|
-
"size-limit": [
|
|
39
|
-
{
|
|
40
|
-
"path": "dist/ui.cjs.production.min.js",
|
|
41
|
-
"limit": "10 KB"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"path": "dist/ui.esm.js",
|
|
45
|
-
"limit": "10 KB"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
23
|
"devDependencies": {
|
|
49
24
|
"@babel/core": "^7.20.2",
|
|
25
|
+
"@babel/preset-env": "^7.21.4",
|
|
26
|
+
"@babel/preset-react": "^7.18.6",
|
|
27
|
+
"@babel/preset-typescript": "^7.21.4",
|
|
50
28
|
"@size-limit/preset-small-lib": "^8.1.0",
|
|
51
|
-
"@storybook/addon-essentials": "^
|
|
29
|
+
"@storybook/addon-essentials": "^7.0.9",
|
|
52
30
|
"@storybook/addon-info": "^5.3.21",
|
|
53
|
-
"@storybook/addon-links": "^
|
|
54
|
-
"@storybook/addons": "^
|
|
55
|
-
"@storybook/react": "^
|
|
31
|
+
"@storybook/addon-links": "^7.0.9",
|
|
32
|
+
"@storybook/addons": "^7.0.9",
|
|
33
|
+
"@storybook/react": "^7.0.9",
|
|
34
|
+
"@storybook/react-webpack5": "^7.0.9",
|
|
56
35
|
"@types/react": "^18.0.25",
|
|
57
36
|
"@types/react-dom": "^18.0.8",
|
|
58
37
|
"@types/react-virtualized-auto-sizer": "^1.0.1",
|
|
@@ -64,6 +43,7 @@
|
|
|
64
43
|
"react-dom": "^18.2.0",
|
|
65
44
|
"react-is": "^18.2.0",
|
|
66
45
|
"size-limit": "^8.1.0",
|
|
46
|
+
"storybook": "^7.0.9",
|
|
67
47
|
"tsdx": "^0.14.1",
|
|
68
48
|
"tslib": "^2.4.1",
|
|
69
49
|
"typescript": "^4.8.4"
|
|
@@ -73,7 +53,7 @@
|
|
|
73
53
|
"@radix-ui/react-radio-group": "^1.1.1",
|
|
74
54
|
"@radix-ui/react-switch": "^1.0.1",
|
|
75
55
|
"@radix-ui/react-tooltip": "^1.0.2",
|
|
76
|
-
"@rango-dev/wallets-shared": "^0.1.
|
|
56
|
+
"@rango-dev/wallets-shared": "^0.1.14",
|
|
77
57
|
"@stitches/react": "^1.2.8",
|
|
78
58
|
"@types/react-color": "^3.0.6",
|
|
79
59
|
"rango-sdk": "^0.1.27",
|
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentMeta } from '@storybook/react';
|
|
3
2
|
import { Alert } from '.';
|
|
4
3
|
import { PropTypes } from './Alert';
|
|
4
|
+
import { Meta } from '@storybook/react';
|
|
5
|
+
import { Typography } from '../Typography';
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
|
-
title: 'Alert',
|
|
8
|
+
title: 'Components/Alert',
|
|
8
9
|
component: Alert,
|
|
10
|
+
args: {
|
|
11
|
+
type: 'success',
|
|
12
|
+
title: 'Alert Title',
|
|
13
|
+
footer: <Typography variant='body1'>It's a Alert!</Typography>
|
|
14
|
+
},
|
|
9
15
|
argTypes: {
|
|
10
16
|
type: {
|
|
17
|
+
name: 'type',
|
|
11
18
|
defaultValue: 'success',
|
|
19
|
+
control: {
|
|
20
|
+
type: 'select',
|
|
21
|
+
options: ['primary', 'secondary', 'success', 'warning', 'error'],
|
|
22
|
+
},
|
|
12
23
|
},
|
|
24
|
+
|
|
13
25
|
title: {
|
|
26
|
+
name: 'title',
|
|
14
27
|
defaultValue: 'Alert Title',
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
control: {
|
|
29
|
+
type: 'text',
|
|
30
|
+
},
|
|
18
31
|
},
|
|
19
32
|
},
|
|
20
|
-
} as
|
|
33
|
+
} as Meta<typeof Alert>;
|
|
21
34
|
|
|
22
35
|
export const Main = (args: PropTypes) => <Alert {...args} />;
|
|
@@ -2,7 +2,7 @@ import React, { PropsWithChildren, ReactNode } from 'react';
|
|
|
2
2
|
import { CheckCircleIcon, InfoCircleIcon, WarningIcon } from '../Icon';
|
|
3
3
|
import { Typography } from '../Typography';
|
|
4
4
|
import { styled } from '../../theme';
|
|
5
|
-
import {
|
|
5
|
+
import { Divider } from '../Divider';
|
|
6
6
|
|
|
7
7
|
const MainContainer = styled('div', {
|
|
8
8
|
width: '100%',
|
|
@@ -72,7 +72,7 @@ export function Alert(props: PropsWithChildren<PropTypes>) {
|
|
|
72
72
|
{type === 'success' && <CheckCircleIcon color={type} size={24} />}
|
|
73
73
|
{type === 'warning' && <WarningIcon color={type} size={24} />}
|
|
74
74
|
{type === 'error' && <InfoCircleIcon color={type} size={24} />}
|
|
75
|
-
<
|
|
75
|
+
<Divider size={4} direction='horizontal' />
|
|
76
76
|
</div>
|
|
77
77
|
</>
|
|
78
78
|
)}
|
|
@@ -90,7 +90,7 @@ export function Alert(props: PropsWithChildren<PropTypes>) {
|
|
|
90
90
|
<Typography className="title" variant="title" color={type}>
|
|
91
91
|
{title}
|
|
92
92
|
</Typography>
|
|
93
|
-
{!!children && <
|
|
93
|
+
{!!children && <Divider size={4} />}
|
|
94
94
|
</>
|
|
95
95
|
)}
|
|
96
96
|
{children}
|
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentMeta } from '@storybook/react';
|
|
3
2
|
import { BestRoute, PropTypes } from './BestRoute';
|
|
4
3
|
import { bestRoute, bestRouteExample2, bestRouteExample3 } from './mock';
|
|
4
|
+
import { Meta } from '@storybook/react';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
title: 'Components/Best Route',
|
|
8
8
|
component: BestRoute,
|
|
9
|
-
} as
|
|
9
|
+
} as Meta<typeof BestRoute>;
|
|
10
10
|
|
|
11
11
|
export const Main = (props: PropTypes) => (
|
|
12
12
|
<div style={{ maxWidth: 512 }}>
|
|
13
|
-
<BestRoute {...props} data={bestRoute} />
|
|
13
|
+
<BestRoute {...props} data={bestRoute} totalFee="0.28" totalTime="10:45" />
|
|
14
14
|
</div>
|
|
15
15
|
);
|
|
16
16
|
export const With4Step = (props: PropTypes) => (
|
|
17
17
|
<div style={{ maxWidth: 512 }}>
|
|
18
|
-
<BestRoute
|
|
18
|
+
<BestRoute
|
|
19
|
+
{...props}
|
|
20
|
+
data={bestRouteExample2}
|
|
21
|
+
totalFee="0.28"
|
|
22
|
+
totalTime="10:45"
|
|
23
|
+
/>
|
|
19
24
|
</div>
|
|
20
25
|
);
|
|
21
26
|
|
|
22
27
|
export const With2Step = (props: PropTypes) => (
|
|
23
28
|
<div style={{ maxWidth: 512 }}>
|
|
24
|
-
<BestRoute
|
|
29
|
+
<BestRoute
|
|
30
|
+
{...props}
|
|
31
|
+
data={bestRouteExample3}
|
|
32
|
+
totalFee="0.28"
|
|
33
|
+
totalTime="10:45"
|
|
34
|
+
/>
|
|
25
35
|
</div>
|
|
26
36
|
);
|
|
27
37
|
export const WithError = (props: PropTypes) => (
|
|
@@ -174,7 +174,7 @@ export const bestRouteExample2: BestRouteType = {
|
|
|
174
174
|
warnings: [],
|
|
175
175
|
swapperId: 'ParaSwap Bsc',
|
|
176
176
|
swapperType: 'DEX',
|
|
177
|
-
swapperLogo: 'https://api.rango.exchange/swappers/
|
|
177
|
+
swapperLogo: 'https://api.rango.exchange/swappers/paraswap.svg',
|
|
178
178
|
|
|
179
179
|
from: {
|
|
180
180
|
symbol: 'USDC',
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Meta } from '@storybook/react';
|
|
3
3
|
import { BlockchainsList, PropTypes } from './BlockchainsList';
|
|
4
4
|
import { blockchainMeta } from './mockData';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
|
-
title: 'Blockchains List',
|
|
7
|
+
title: 'Components/Blockchains List',
|
|
8
8
|
component: BlockchainsList,
|
|
9
|
+
args: {
|
|
10
|
+
searchedText: '',
|
|
11
|
+
},
|
|
9
12
|
argTypes: {
|
|
10
13
|
searchedText: {
|
|
11
14
|
type: 'string',
|
|
12
15
|
defaultValue: '',
|
|
16
|
+
control: {
|
|
17
|
+
type: 'text',
|
|
18
|
+
},
|
|
13
19
|
},
|
|
14
20
|
},
|
|
15
|
-
} as
|
|
21
|
+
} as Meta<typeof BlockchainsList>;
|
|
16
22
|
|
|
17
23
|
export const Main = (args: PropTypes) => {
|
|
18
24
|
return (
|