@rango-dev/ui 0.1.10-next.89 → 0.1.10-next.91

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.
@@ -3,7 +3,7 @@ import { TokenWithAmount } from '../TokenList/TokenList';
3
3
  export interface PropTypes {
4
4
  list: TokenWithAmount[];
5
5
  type?: 'Source' | 'Destination';
6
- selected?: TokenWithAmount;
6
+ selected: TokenWithAmount | null;
7
7
  onChange: (token: TokenWithAmount) => void;
8
8
  hasHeader?: boolean;
9
9
  multiSelect?: boolean;
@@ -1,5 +1,5 @@
1
- import { BestRouteResponse } from 'rango-sdk';
2
1
  import React, { PropsWithChildren, ReactNode } from 'react';
2
+ import { BestRouteWithFee } from '../../types/swaps';
3
3
  export declare const Line: any;
4
4
  export declare const SwapperContainer: any;
5
5
  export declare const BodyError: any;
@@ -13,7 +13,7 @@ export declare const ArrowDown: any;
13
13
  export declare const UpdateIcon: any;
14
14
  export declare const StyledUpdateIcon: any;
15
15
  export interface PropTypes {
16
- bestRoute: BestRouteResponse | null;
16
+ bestRoute: BestRouteWithFee | null;
17
17
  onRefresh?: React.MouseEventHandler<SVGElement>;
18
18
  confirmButtonTitle: string;
19
19
  confirmButtonDisabled: boolean;
@@ -2,7 +2,7 @@ import { BestRouteResponse } from 'rango-sdk';
2
2
  import React, { PropsWithChildren } from 'react';
3
3
  import { SelectableWallet } from '../../types';
4
4
  export interface PropTypes {
5
- swap: BestRouteResponse;
5
+ swap: BestRouteResponse | null;
6
6
  fromAmount: string;
7
7
  toAmount: string;
8
8
  onBack: () => void;
@@ -1 +1,2 @@
1
1
  export * from './wallet';
2
+ export { BestRouteWithFee } from './swaps';
@@ -1,4 +1,4 @@
1
- import { BestRouteResponse, BlockchainValidationStatus, WalletRequiredAssets } from 'rango-sdk';
1
+ import { BestRouteResponse, BlockchainValidationStatus, SimulationResult, SwapResult, WalletRequiredAssets } from 'rango-sdk';
2
2
  export declare type SwapStatus = 'running' | 'failed' | 'success';
3
3
  export declare type MessageSeverity = 'error' | 'warning' | 'info' | 'success';
4
4
  export declare type StepStatus = 'created' | 'running' | 'failed' | 'success' | 'waitingForApproval' | 'approved';
@@ -20,3 +20,10 @@ export declare type SwapSavedSettings = {
20
20
  export declare type SimulationAssetAndAmount = WalletRequiredAssets;
21
21
  export declare type SimulationValidationStatus = BlockchainValidationStatus;
22
22
  export declare type BestRouteType = BestRouteResponse;
23
+ export declare type BestRouteWithFee = Omit<BestRouteResponse, 'result'> & {
24
+ result: Omit<SimulationResult, 'swaps'> & {
25
+ swaps: (SwapResult & {
26
+ feeInUsd?: string;
27
+ })[];
28
+ };
29
+ };
@@ -11,6 +11,7 @@ export declare type WalletInfo = {
11
11
  name: string;
12
12
  image: string;
13
13
  type: WalletType;
14
+ showOnMobile: boolean;
14
15
  };
15
16
  export interface SelectableWallet {
16
17
  chain: string;
@@ -4075,15 +4075,19 @@ function ConfirmSwap(props) {
4075
4075
  onClick: onRefresh
4076
4076
  })
4077
4077
  }, React__default.createElement(MainContainer$2, null, React__default.createElement("div", null, extraMessages || null, React__default.createElement(Alerts, null, errors == null ? void 0 : errors.map(function (error, index) {
4078
- return React__default.createElement(Alert, {
4078
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
4079
+ direction: "vertical"
4080
+ }), React__default.createElement(Alert, {
4079
4081
  type: "error",
4080
4082
  key: index
4081
- }, error);
4083
+ }, error));
4082
4084
  }), warnings == null ? void 0 : warnings.map(function (warning, index) {
4083
- return React__default.createElement(Alert, {
4085
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(Spacer, {
4086
+ direction: "vertical"
4087
+ }), React__default.createElement(Alert, {
4084
4088
  type: "warning",
4085
4089
  key: index
4086
- }, warning);
4090
+ }, warning));
4087
4091
  }))), React__default.createElement(BestRouteContainer$1, null, bestRoute == null ? void 0 : (_bestRoute$result = bestRoute.result) == null ? void 0 : _bestRoute$result.swaps.map(function (swap, index) {
4088
4092
  var _bestRoute$result2;
4089
4093
  return React__default.createElement(React.Fragment, {
@@ -4103,7 +4107,7 @@ function ConfirmSwap(props) {
4103
4107
  }, swap.swapperType, " from ", swap.from.symbol, " to", ' ', swap.to.symbol, " via ", swap.swapperId, ' '), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
4104
4108
  ml: 4,
4105
4109
  variant: "caption"
4106
- }, parseFloat(swap.fee[0].amount).toFixed(6), " estimated gas fee")))), React__default.createElement(Line$2, null), index + 1 === ((_bestRoute$result2 = bestRoute.result) == null ? void 0 : _bestRoute$result2.swaps.length) && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
4110
+ }, "$", swap.feeInUsd, " estimated gas fee")))), React__default.createElement(Line$2, null), index + 1 === ((_bestRoute$result2 = bestRoute.result) == null ? void 0 : _bestRoute$result2.swaps.length) && React__default.createElement(ArrowDown, null), React__default.createElement(StepDetail, {
4107
4111
  logo: swap.to.logo,
4108
4112
  symbol: swap.to.symbol,
4109
4113
  chainLogo: swap.to.blockchainLogo,
@@ -4137,8 +4141,8 @@ function ConfirmWallets(props) {
4137
4141
  handleConnectChain = props.handleConnectChain,
4138
4142
  fromAmount = props.fromAmount,
4139
4143
  toAmount = props.toAmount;
4140
- var firstStep = (_swap$result = swap.result) == null ? void 0 : _swap$result.swaps[0];
4141
- var lastStep = (_swap$result2 = swap.result) == null ? void 0 : _swap$result2.swaps[((_swap$result3 = swap.result) == null ? void 0 : _swap$result3.swaps.length) - 1];
4144
+ var firstStep = swap == null ? void 0 : (_swap$result = swap.result) == null ? void 0 : _swap$result.swaps[0];
4145
+ var lastStep = swap == null ? void 0 : (_swap$result2 = swap.result) == null ? void 0 : _swap$result2.swaps[((_swap$result3 = swap.result) == null ? void 0 : _swap$result3.swaps.length) - 1];
4142
4146
  return React__default.createElement(SecondaryPage, {
4143
4147
  textField: false,
4144
4148
  title: "Confirm Swap",
@@ -4381,7 +4385,7 @@ function SwapHistory(props) {
4381
4385
  }, step.swapperType, " from ", step.fromSymbol, " to ", step.toSymbol, "via ", step.swapperId), React__default.createElement(Fee, null, React__default.createElement(GasIcon, null), React__default.createElement(Typography, {
4382
4386
  ml: 4,
4383
4387
  variant: "caption"
4384
- }, step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4388
+ }, "$", step.feeInUsd, " estimated gas fee")))), React__default.createElement("div", {
4385
4389
  style: {
4386
4390
  display: 'flex'
4387
4391
  }