@rango-dev/widget-embedded 0.1.11-next.0 → 0.1.11-next.4
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/App.d.ts +3 -3
- package/dist/App.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +1 -7
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +2 -2
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/Layout.d.ts +3 -3
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +2 -5
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/lib.d.ts +2 -2
- package/dist/lib.d.ts.map +1 -1
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts +1 -7
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcesPage.d.ts +1 -2
- package/dist/pages/LiquiditySourcesPage.d.ts.map +1 -1
- package/dist/pages/SelectChainPage.d.ts +1 -2
- package/dist/pages/SelectChainPage.d.ts.map +1 -1
- package/dist/pages/SelectTokenPage.d.ts +2 -2
- package/dist/pages/SelectTokenPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +1 -2
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/settings.d.ts +2 -0
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/types/config.d.ts +26 -29
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +2 -6
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/widget-embedded.cjs.development.js +87 -159
- package/dist/widget-embedded.cjs.development.js.map +1 -1
- package/dist/widget-embedded.cjs.production.min.js +87 -159
- package/dist/widget-embedded.cjs.production.min.js.map +1 -1
- package/dist/widget-embedded.esm.js +86 -158
- package/dist/widget-embedded.esm.js.map +1 -1
- package/package.json +6 -4
- package/readme.md +1 -1
- package/src/App.tsx +21 -13
- package/src/components/AppRouter.tsx +7 -16
- package/src/components/AppRoutes.tsx +13 -32
- package/src/components/Layout.tsx +32 -23
- package/src/hooks/useConfirmSwap.ts +5 -4
- package/src/hooks/useTheme.ts +15 -9
- package/src/lib.tsx +30 -36
- package/src/pages/ConfirmSwapPage.tsx +2 -0
- package/src/pages/Home.tsx +2 -8
- package/src/pages/LiquiditySourcesPage.tsx +3 -6
- package/src/pages/SelectChainPage.tsx +6 -6
- package/src/pages/SelectTokenPage.tsx +16 -18
- package/src/pages/SettingsPage.tsx +8 -18
- package/src/pages/SwapDetailsPage.tsx +2 -4
- package/src/pages/WalletsPage.tsx +2 -2
- package/src/store/bestRoute.ts +3 -2
- package/src/store/settings.ts +7 -0
- package/src/types/config.ts +27 -29
- package/src/utils/swap.ts +3 -96
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TokenSelector } from '@rango-dev/ui';
|
|
3
3
|
import { useBestRouteStore } from '../store/bestRoute';
|
|
4
|
-
import { Token } from 'rango-sdk';
|
|
4
|
+
import { Asset, Token } from 'rango-sdk';
|
|
5
5
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
6
6
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
7
7
|
import { tokensAreEqual } from '../utils/wallets';
|
|
@@ -9,7 +9,7 @@ import { useMetaStore } from '../store/meta';
|
|
|
9
9
|
|
|
10
10
|
interface PropTypes {
|
|
11
11
|
type: 'from' | 'to';
|
|
12
|
-
supportedTokens
|
|
12
|
+
supportedTokens?: Asset[];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface TokenWithBalance extends Token {
|
|
@@ -25,23 +25,21 @@ export function SelectTokenPage(props: PropTypes) {
|
|
|
25
25
|
const { type, supportedTokens } = props;
|
|
26
26
|
const sourceTokens = useBestRouteStore.use.sourceTokens();
|
|
27
27
|
const destinationTokens = useBestRouteStore.use.destinationTokens();
|
|
28
|
-
const supportedSourceTokens =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
);
|
|
28
|
+
const supportedSourceTokens = supportedTokens
|
|
29
|
+
? sourceTokens.filter((token) =>
|
|
30
|
+
supportedTokens.some((supportedToken) =>
|
|
31
|
+
tokensAreEqual(supportedToken, token)
|
|
32
|
+
)
|
|
33
|
+
)
|
|
34
|
+
: sourceTokens;
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
);
|
|
36
|
+
const supportedDestinationTokens = supportedTokens
|
|
37
|
+
? destinationTokens.filter((token) =>
|
|
38
|
+
supportedTokens.some((supportedToken) =>
|
|
39
|
+
tokensAreEqual(supportedToken, token)
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
: destinationTokens;
|
|
45
43
|
|
|
46
44
|
const fromToken = useBestRouteStore.use.fromToken();
|
|
47
45
|
const toToken = useBestRouteStore.use.toToken();
|
|
@@ -5,7 +5,6 @@ import { useMetaStore } from '../store/meta';
|
|
|
5
5
|
import { useNavigate } from 'react-router-dom';
|
|
6
6
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
7
7
|
import { removeDuplicateFrom } from '../utils/common';
|
|
8
|
-
import { Source } from '../types';
|
|
9
8
|
import {
|
|
10
9
|
MAX_SLIPPAGE,
|
|
11
10
|
MIN_SLIPPGAE,
|
|
@@ -13,7 +12,7 @@ import {
|
|
|
13
12
|
} from '../constants/swapSettings';
|
|
14
13
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
15
14
|
interface PropTypes {
|
|
16
|
-
supportedSwappers
|
|
15
|
+
supportedSwappers?: string[];
|
|
17
16
|
}
|
|
18
17
|
export function SettingsPage({ supportedSwappers }: PropTypes) {
|
|
19
18
|
const slippage = useSettingsStore.use.slippage();
|
|
@@ -45,8 +44,6 @@ export function SettingsPage({ supportedSwappers }: PropTypes) {
|
|
|
45
44
|
.find((s) => {
|
|
46
45
|
if (s) {
|
|
47
46
|
for (const type of s.types) {
|
|
48
|
-
if (supportedSwappers !== 'all') {
|
|
49
|
-
}
|
|
50
47
|
uniqueSwappersGroups.push({
|
|
51
48
|
title: s.swapperGroup,
|
|
52
49
|
logo: s.logo,
|
|
@@ -56,23 +53,16 @@ export function SettingsPage({ supportedSwappers }: PropTypes) {
|
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
55
|
});
|
|
59
|
-
supportedSwappers
|
|
56
|
+
supportedSwappers &&
|
|
60
57
|
uniqueSwappersGroups.filter(
|
|
61
|
-
(item) =>
|
|
62
|
-
supportedSwappers.filter(
|
|
63
|
-
(s) => s.title === item.title && s.type === item.type
|
|
64
|
-
).length > 0
|
|
58
|
+
(item) => supportedSwappers.filter((s) => s === item.title).length > 0
|
|
65
59
|
);
|
|
66
60
|
|
|
67
|
-
const supportedUniqueSwappersGroups =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(s) => s.title === item.title && s.type === item.type
|
|
73
|
-
).length > 0
|
|
74
|
-
)
|
|
75
|
-
: uniqueSwappersGroups;
|
|
61
|
+
const supportedUniqueSwappersGroups = supportedSwappers
|
|
62
|
+
? uniqueSwappersGroups.filter(
|
|
63
|
+
(item) => supportedSwappers.filter((s) => s === item.title).length > 0
|
|
64
|
+
)
|
|
65
|
+
: uniqueSwappersGroups;
|
|
76
66
|
|
|
77
67
|
return (
|
|
78
68
|
<Settings
|
|
@@ -4,7 +4,7 @@ import useCopyToClipboard from '../hooks/useCopyToClipboard';
|
|
|
4
4
|
import { useManager } from '@rango-dev/queue-manager-react';
|
|
5
5
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
6
6
|
import { getPendingSwaps } from '../utils/queue';
|
|
7
|
-
import { SwapHistory } from '@rango-dev/ui';
|
|
7
|
+
import { SwapHistory, Spacer } from '@rango-dev/ui';
|
|
8
8
|
import { useUiStore } from '../store/ui';
|
|
9
9
|
import {
|
|
10
10
|
cancelSwap,
|
|
@@ -26,7 +26,6 @@ import {
|
|
|
26
26
|
shouldRetrySwap,
|
|
27
27
|
} from '../utils/swap';
|
|
28
28
|
import { TokenPreview } from '../components/TokenPreview';
|
|
29
|
-
import { Spacer } from '@rango-dev/ui';
|
|
30
29
|
import { numberToString } from '../utils/numbers';
|
|
31
30
|
//@ts-ignore
|
|
32
31
|
import { t } from 'i18next';
|
|
@@ -127,7 +126,7 @@ export function SwapDetailsPage() {
|
|
|
127
126
|
<TokenPreview
|
|
128
127
|
chain={{
|
|
129
128
|
displayName: lastStep?.toBlockchain || '',
|
|
130
|
-
|
|
129
|
+
//@ts-ignore
|
|
131
130
|
logo: lastStep?.toBlockchainLogo || '',
|
|
132
131
|
}}
|
|
133
132
|
token={{
|
|
@@ -141,7 +140,6 @@ export function SwapDetailsPage() {
|
|
|
141
140
|
</>
|
|
142
141
|
}
|
|
143
142
|
//todo: move PendingSwap type to rango-types
|
|
144
|
-
//@ts-ignore
|
|
145
143
|
pendingSwap={swap}
|
|
146
144
|
onCopy={handleCopy}
|
|
147
145
|
isCopied={isCopied}
|
|
@@ -20,7 +20,7 @@ import { Spinner } from '@rango-dev/ui';
|
|
|
20
20
|
import { LoadingFailedAlert } from '@rango-dev/ui';
|
|
21
21
|
|
|
22
22
|
interface PropTypes {
|
|
23
|
-
supportedWallets
|
|
23
|
+
supportedWallets?: WalletType[];
|
|
24
24
|
multiWallets: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -50,7 +50,7 @@ export function WalletsPage({ supportedWallets, multiWallets }: PropTypes) {
|
|
|
50
50
|
const wallets = getlistWallet(
|
|
51
51
|
state,
|
|
52
52
|
getWalletInfo,
|
|
53
|
-
supportedWallets
|
|
53
|
+
supportedWallets || Object.values(WalletType)
|
|
54
54
|
);
|
|
55
55
|
const walletsRef = useRef<WalletInfo[]>();
|
|
56
56
|
|
package/src/store/bestRoute.ts
CHANGED
|
@@ -249,7 +249,7 @@ const bestRoute = (
|
|
|
249
249
|
let abortController: AbortController | null = null;
|
|
250
250
|
const fetchBestRoute = () => {
|
|
251
251
|
const { fromToken, toToken, inputAmount } = bestRouteStore.getState();
|
|
252
|
-
const { slippage, customSlippage, disabledLiquiditySources } =
|
|
252
|
+
const { slippage, customSlippage, disabledLiquiditySources, affiliateRef } =
|
|
253
253
|
settingsStore.getState();
|
|
254
254
|
if (!fromToken || !toToken || !inputAmount || inputAmount === '0') return;
|
|
255
255
|
abortController?.abort();
|
|
@@ -263,7 +263,8 @@ const bestRoute = (
|
|
|
263
263
|
[],
|
|
264
264
|
disabledLiquiditySources,
|
|
265
265
|
userSlippage,
|
|
266
|
-
false
|
|
266
|
+
false,
|
|
267
|
+
affiliateRef
|
|
267
268
|
);
|
|
268
269
|
if (!bestRouteStore.getState().loading)
|
|
269
270
|
bestRouteStore.setState({
|
package/src/store/settings.ts
CHANGED
|
@@ -13,12 +13,14 @@ export interface SettingsState {
|
|
|
13
13
|
infiniteApprove: boolean;
|
|
14
14
|
disabledLiquiditySources: string[];
|
|
15
15
|
theme: Theme;
|
|
16
|
+
affiliateRef: string | null;
|
|
16
17
|
setSlippage: (slippage: number) => void;
|
|
17
18
|
setCustomSlippage: (customSlippage: number | null) => void;
|
|
18
19
|
toggleInfiniteApprove: () => void;
|
|
19
20
|
toggleLiquiditySource: (name: string) => void;
|
|
20
21
|
setTheme: (theme: Theme) => void;
|
|
21
22
|
toggleAllLiquiditySources: () => void;
|
|
23
|
+
setAffiliateRef: (affiliateRef: string | null) => void;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
export const useSettingsStore = createSelectors(
|
|
@@ -28,6 +30,7 @@ export const useSettingsStore = createSelectors(
|
|
|
28
30
|
slippage: DEFAULT_SLIPPAGE,
|
|
29
31
|
customSlippage: null,
|
|
30
32
|
infiniteApprove: false,
|
|
33
|
+
affiliateRef: null,
|
|
31
34
|
disabledLiquiditySources: [],
|
|
32
35
|
theme: 'auto',
|
|
33
36
|
setSlippage: (slippage) =>
|
|
@@ -38,6 +41,10 @@ export const useSettingsStore = createSelectors(
|
|
|
38
41
|
set(() => ({
|
|
39
42
|
customSlippage: customSlippage,
|
|
40
43
|
})),
|
|
44
|
+
setAffiliateRef: (affiliateRef) =>
|
|
45
|
+
set(() => ({
|
|
46
|
+
affiliateRef,
|
|
47
|
+
})),
|
|
41
48
|
toggleAllLiquiditySources: () =>
|
|
42
49
|
set((state) => {
|
|
43
50
|
const { swappers } = useMetaStore.getState().meta;
|
package/src/types/config.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Asset } from 'rango-sdk';
|
|
2
2
|
import { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
-
export interface Source {
|
|
4
|
-
title: string;
|
|
5
|
-
type: 'BRIDGE' | 'AGGREGATOR' | 'DEX';
|
|
6
|
-
}
|
|
7
3
|
|
|
8
4
|
export type Colors = {
|
|
9
5
|
background?: string;
|
|
@@ -17,28 +13,30 @@ export type Colors = {
|
|
|
17
13
|
warning?: string;
|
|
18
14
|
};
|
|
19
15
|
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
16
|
+
export type Theme = {
|
|
17
|
+
mode?: 'dark' | 'light' | 'auto';
|
|
18
|
+
fontFamily?: string;
|
|
19
|
+
colors?: Colors;
|
|
20
|
+
borderRadius?: number;
|
|
21
|
+
width?: number;
|
|
22
|
+
height?: number;
|
|
23
|
+
};
|
|
24
|
+
export type Support = {
|
|
25
|
+
blockchain?: string;
|
|
26
|
+
token?: Asset;
|
|
27
|
+
blockchains?: string[];
|
|
28
|
+
tokens?: Asset[];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type WidgetConfig = {
|
|
32
|
+
affiliateRef?: string;
|
|
33
|
+
amount?: number;
|
|
34
|
+
from?: Support;
|
|
35
|
+
to?: Support;
|
|
36
|
+
liquiditySources?: string[];
|
|
37
|
+
wallets?: WalletType[];
|
|
38
|
+
multiWallets?: boolean;
|
|
39
|
+
customAddress?: boolean;
|
|
40
|
+
language?: string;
|
|
41
|
+
theme?: Theme;
|
|
44
42
|
};
|
package/src/utils/swap.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
WalletTypeAndAddress,
|
|
3
|
-
SwapSavedSettings,
|
|
4
|
-
} from '@rango-dev/ui/dist/types/swaps';
|
|
5
1
|
import BigNumber from 'bignumber.js';
|
|
6
2
|
import {
|
|
7
3
|
BestRouteRequest,
|
|
8
4
|
BestRouteResponse,
|
|
9
5
|
RecommendedSlippage,
|
|
10
6
|
SwapResult,
|
|
11
|
-
MetaResponse,
|
|
12
7
|
Token,
|
|
13
8
|
} from 'rango-sdk';
|
|
14
9
|
import { Account } from '../store/wallets';
|
|
@@ -176,96 +171,6 @@ export function canComputePriceImpact(
|
|
|
176
171
|
);
|
|
177
172
|
}
|
|
178
173
|
|
|
179
|
-
export function calculatePendingSwap(
|
|
180
|
-
inputAmount: string,
|
|
181
|
-
bestRoute: BestRouteResponse,
|
|
182
|
-
wallets: { [p: string]: WalletTypeAndAddress },
|
|
183
|
-
settings: Omit<SwapSavedSettings, 'disabledSwappersIds'>,
|
|
184
|
-
validateBalanceOrFee: boolean,
|
|
185
|
-
meta: MetaResponse
|
|
186
|
-
): PendingSwap {
|
|
187
|
-
const simulationResult = bestRoute.result;
|
|
188
|
-
if (!simulationResult) throw Error('Simulation result should not be null');
|
|
189
|
-
|
|
190
|
-
return {
|
|
191
|
-
creationTime: new Date().getTime().toString(),
|
|
192
|
-
finishTime: null,
|
|
193
|
-
requestId: bestRoute.requestId || '',
|
|
194
|
-
inputAmount: inputAmount,
|
|
195
|
-
//@ts-ignore
|
|
196
|
-
wallets,
|
|
197
|
-
status: 'running',
|
|
198
|
-
isPaused: false,
|
|
199
|
-
extraMessage: null,
|
|
200
|
-
extraMessageSeverity: null,
|
|
201
|
-
extraMessageDetail: null,
|
|
202
|
-
extraMessageErrorCode: null,
|
|
203
|
-
networkStatusExtraMessage: null,
|
|
204
|
-
networkStatusExtraMessageDetail: null,
|
|
205
|
-
lastNotificationTime: null,
|
|
206
|
-
//@ts-ignore
|
|
207
|
-
settings: settings,
|
|
208
|
-
simulationResult: simulationResult,
|
|
209
|
-
validateBalanceOrFee,
|
|
210
|
-
//@ts-ignore
|
|
211
|
-
steps:
|
|
212
|
-
bestRoute.result?.swaps?.map((swap, index) => {
|
|
213
|
-
const swapper = meta.swappers.find(
|
|
214
|
-
(swapper) => swapper.id === swap.swapperId
|
|
215
|
-
);
|
|
216
|
-
const swapperType = swapper?.types[0];
|
|
217
|
-
const fromBlockchain = meta.blockchains.find(
|
|
218
|
-
(blockchain) => blockchain.name === swap.from.blockchain
|
|
219
|
-
);
|
|
220
|
-
const toBlockchain = meta.blockchains.find(
|
|
221
|
-
(blockchain) => blockchain.name === swap.to.blockchain
|
|
222
|
-
);
|
|
223
|
-
return {
|
|
224
|
-
id: index + 1,
|
|
225
|
-
fromBlockchain: swap.from.blockchain,
|
|
226
|
-
fromSymbol: swap.from.symbol,
|
|
227
|
-
fromSymbolAddress: swap.from.address,
|
|
228
|
-
fromDecimals: swap.from.decimals,
|
|
229
|
-
fromAmountPrecision: swap.fromAmountPrecision,
|
|
230
|
-
fromAmountMinValue: swap.fromAmountMinValue,
|
|
231
|
-
fromAmountMaxValue: swap.fromAmountMaxValue,
|
|
232
|
-
toBlockchain: swap.to.blockchain,
|
|
233
|
-
fromLogo: swap.from.logo,
|
|
234
|
-
toSymbol: swap.to.symbol,
|
|
235
|
-
toSymbolAddress: swap.to.address,
|
|
236
|
-
toDecimals: swap.to.decimals,
|
|
237
|
-
toLogo: swap.to.logo,
|
|
238
|
-
startTransactionTime: new Date().getTime(),
|
|
239
|
-
swapperId: swap.swapperId,
|
|
240
|
-
feeInUsd: numberToString(getUsdFeeOfStep(swap, meta.tokens), null, 2),
|
|
241
|
-
expectedOutputAmountHumanReadable: swap.toAmount,
|
|
242
|
-
outputAmount: '',
|
|
243
|
-
status: 'created',
|
|
244
|
-
networkStatus: null,
|
|
245
|
-
executedTransactionId: null,
|
|
246
|
-
externalTransactionId: null,
|
|
247
|
-
explorerUrl: null,
|
|
248
|
-
trackingCode: null,
|
|
249
|
-
cosmosTransaction: null,
|
|
250
|
-
solanaTransaction: null,
|
|
251
|
-
starknetTransaction: null,
|
|
252
|
-
starknetApprovalTransaction: null,
|
|
253
|
-
tronTransaction: null,
|
|
254
|
-
tronApprovalTransaction: null,
|
|
255
|
-
evmTransaction: null,
|
|
256
|
-
evmApprovalTransaction: null,
|
|
257
|
-
transferTransaction: null,
|
|
258
|
-
diagnosisUrl: null,
|
|
259
|
-
internalSteps: null,
|
|
260
|
-
fromBlockchainLogo: fromBlockchain?.logo || '',
|
|
261
|
-
toBlockchainLogo: toBlockchain?.logo || '',
|
|
262
|
-
swapperLogo: swapper?.logo || '',
|
|
263
|
-
swapperType: swapperType || '',
|
|
264
|
-
};
|
|
265
|
-
}) || [],
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
|
|
269
174
|
export function requiredWallets(route: BestRouteResponse | null) {
|
|
270
175
|
const wallets: string[] = [];
|
|
271
176
|
|
|
@@ -408,7 +313,8 @@ export function createBestRouteRequestBody(
|
|
|
408
313
|
selectedWallets: SelectedWallet[],
|
|
409
314
|
disabledLiquiditySources: string[],
|
|
410
315
|
slippage: number,
|
|
411
|
-
checkPrerequisites: boolean
|
|
316
|
+
checkPrerequisites: boolean,
|
|
317
|
+
affiliateRef: string | null
|
|
412
318
|
): BestRouteRequest {
|
|
413
319
|
const selectedWalletsMap = selectedWallets.reduce(
|
|
414
320
|
(
|
|
@@ -439,6 +345,7 @@ export function createBestRouteRequestBody(
|
|
|
439
345
|
|
|
440
346
|
const requestBody: BestRouteRequest = {
|
|
441
347
|
amount: inputAmount.toString(),
|
|
348
|
+
affiliateRef,
|
|
442
349
|
checkPrerequisites,
|
|
443
350
|
from: {
|
|
444
351
|
address: fromToken.address,
|