7
7
AvatarAccount ,
8
8
AvatarAccountSize ,
9
9
AvatarAccountVariant ,
10
+ AvatarIcon ,
11
+ AvatarIconSize ,
10
12
BannerAlert ,
11
13
BannerAlertSeverity ,
12
14
Box ,
@@ -88,7 +90,7 @@ export default function RemoteModeSetupSwaps() {
88
90
TokenSymbol . USDC ,
89
91
) ;
90
92
const [ selectedToToken , setSelectedToToken ] = useState < ToTokenOption > (
91
- ToTokenOption . Any ,
93
+ ToTokenOption . AllowedOutcome ,
92
94
) ;
93
95
const [ dailyLimit , setDailyLimit ] = useState < string > ( '' ) ;
94
96
const [ isAllowancesExpanded , setIsAllowancesExpanded ] =
@@ -155,7 +157,7 @@ export default function RemoteModeSetupSwaps() {
155
157
} ) ;
156
158
157
159
setSelectedFromToken ( TokenSymbol . USDC ) ;
158
- setSelectedToToken ( ToTokenOption . Any ) ;
160
+ setSelectedToToken ( ToTokenOption . AllowedOutcome ) ;
159
161
setDailyLimit ( '' ) ;
160
162
} ;
161
163
@@ -281,16 +283,10 @@ export default function RemoteModeSetupSwaps() {
281
283
onChange = { ( value ) =>
282
284
setSelectedFromToken ( value as TokenSymbol )
283
285
}
284
- options = { [
285
- {
286
- name : 'USDC' ,
287
- value : TokenSymbol . USDC ,
288
- } ,
289
- {
290
- name : 'WETH' ,
291
- value : TokenSymbol . WETH ,
292
- } ,
293
- ] }
286
+ options = { Object . values ( TokenSymbol ) . map ( ( value ) => ( {
287
+ name : value ,
288
+ value,
289
+ } ) ) }
294
290
selectedOption = { selectedFromToken }
295
291
title = "Select token"
296
292
style = { { width : '100%' } }
@@ -319,35 +315,28 @@ export default function RemoteModeSetupSwaps() {
319
315
flexDirection = { FlexDirection . Column }
320
316
gap = { 2 }
321
317
marginTop = { 2 }
318
+ marginBottom = { 4 }
322
319
>
323
320
< Text > Swap to</ Text >
324
321
< Dropdown
325
322
onChange = { ( value ) =>
326
323
setSelectedToToken ( value as ToTokenOption )
327
324
}
328
- options = { [
329
- {
330
- name : ToTokenOption . Any ,
331
- value : ToTokenOption . Any ,
332
- } ,
333
- {
334
- name : ToTokenOption . HighLiquidity ,
335
- value : ToTokenOption . HighLiquidity ,
336
- } ,
337
- ] }
325
+ options = { Object . values ( ToTokenOption ) . map ( ( value ) => ( {
326
+ name : value ,
327
+ value,
328
+ } ) ) }
338
329
selectedOption = { selectedToToken }
339
330
title = "Select token"
340
331
style = { { width : '100%' } }
341
332
/>
342
333
</ Box >
343
- < Text
344
- variant = { TextVariant . bodySm }
345
- marginTop = { 1 }
346
- marginBottom = { 2 }
347
- >
348
- Tip: This is a higher risk option if your authorized account
349
- is compromised.
350
- </ Text >
334
+ { selectedToToken === ToTokenOption . Any && (
335
+ < Text variant = { TextVariant . bodySm } marginBottom = { 4 } >
336
+ Tip: This is a higher risk option if your authorized account
337
+ is compromised.
338
+ </ Text >
339
+ ) }
351
340
< Button
352
341
width = { BlockSize . Full }
353
342
size = { ButtonSize . Lg }
@@ -369,15 +358,16 @@ export default function RemoteModeSetupSwaps() {
369
358
</ Box >
370
359
</ Card >
371
360
< Box marginTop = { 4 } marginBottom = { 2 } >
372
- < Text > Only redeemable with MetaMask Swaps</ Text >
361
+ < Text > Only for MetaMask Swaps</ Text >
373
362
< Text color = { TextColor . textMuted } >
374
- The allowances are only redeemable by the authorized account to
375
- use MetaMask Swaps, which comes with MEV protection.
363
+ The authorized account can only use these allowances for
364
+ MetaMask Swaps, which includes MEV protection to help prevent
365
+ front-running and sandwich attacks.
376
366
</ Text >
377
- < Text > Slippage protection</ Text >
367
+ < Text marginTop = { 2 } > Slippage protection</ Text >
378
368
< Text color = { TextColor . textMuted } >
379
369
Swap quotes are only received from DEX aggregators that have
380
- slippage/ price protections.
370
+ slippage and price protections.
381
371
</ Text >
382
372
</ Box >
383
373
</ Box >
@@ -431,26 +421,33 @@ export default function RemoteModeSetupSwaps() {
431
421
< >
432
422
< Card
433
423
backgroundColor = { BackgroundColor . backgroundMuted }
424
+ marginTop = { 2 }
434
425
marginBottom = { 4 }
435
426
>
436
427
< Box
437
428
display = { Display . Flex }
438
429
gap = { 2 }
439
430
justifyContent = { JustifyContent . spaceBetween }
440
431
>
441
- < Box >
442
- < Text > Enable Remote Swaps</ Text >
443
- < Text
444
- color = { TextColor . textMuted }
445
- variant = { TextVariant . bodySm }
446
- >
447
- Permission from { selectedHardwareAccount . metadata . name }
448
- </ Text >
432
+ < Box display = { Display . Flex } gap = { 2 } >
433
+ < AvatarIcon
434
+ iconName = { IconName . Star }
435
+ size = { AvatarIconSize . Lg }
436
+ />
437
+ < Box >
438
+ < Text > Switch to to smart account</ Text >
439
+ < Text
440
+ color = { TextColor . textMuted }
441
+ variant = { TextVariant . bodySm }
442
+ >
443
+ Permission from { selectedHardwareAccount . metadata . name }
444
+ </ Text >
445
+ </ Box >
449
446
</ Box >
450
447
< Text
451
448
color = { TextColor . infoDefault }
452
449
onClick = { ( ) => {
453
- setCurrentStep ( 1 ) ;
450
+ setCurrentStep ( 2 ) ;
454
451
} }
455
452
style = { { cursor : 'pointer' } }
456
453
>
@@ -470,19 +467,25 @@ export default function RemoteModeSetupSwaps() {
470
467
gap = { 2 }
471
468
justifyContent = { JustifyContent . spaceBetween }
472
469
>
473
- < Box >
474
- < Text > Update to smart account</ Text >
475
- < Text
476
- color = { TextColor . textMuted }
477
- variant = { TextVariant . bodySm }
478
- >
479
- Permission from { selectedHardwareAccount . metadata . name }
480
- </ Text >
470
+ < Box display = { Display . Flex } gap = { 2 } >
471
+ < AvatarIcon
472
+ iconName = { IconName . SwapHorizontal }
473
+ size = { AvatarIconSize . Lg }
474
+ />
475
+ < Box >
476
+ < Text > Set up Remote Swaps</ Text >
477
+ < Text
478
+ color = { TextColor . textMuted }
479
+ variant = { TextVariant . bodySm }
480
+ >
481
+ Permission from { selectedHardwareAccount . metadata . name }
482
+ </ Text >
483
+ </ Box >
481
484
</ Box >
482
485
< Text
483
486
color = { TextColor . infoDefault }
484
487
onClick = { ( ) => {
485
- setCurrentStep ( 2 ) ;
488
+ setCurrentStep ( 1 ) ;
486
489
} }
487
490
style = { { cursor : 'pointer' } }
488
491
>
@@ -503,9 +506,9 @@ export default function RemoteModeSetupSwaps() {
503
506
</ Text >
504
507
< Text color = { TextColor . infoDefault } >
505
508
{ isAllowancesExpanded ? (
506
- < Icon name = { IconName . ArrowUp } size = { IconSize . Sm } />
507
- ) : (
508
509
< Icon name = { IconName . ArrowDown } size = { IconSize . Sm } />
510
+ ) : (
511
+ < Icon name = { IconName . ArrowUp } size = { IconSize . Sm } />
509
512
) }
510
513
</ Text >
511
514
</ Box >
0 commit comments