@@ -40,6 +40,7 @@ import { Fullscreen, FullscreenExit, Refresh } from '@mui/icons-material';
40
40
import { AppContext , type UseAppStoreType } from '../../contexts/AppContext' ;
41
41
import { FederationContext , type UseFederationStoreType } from '../../contexts/FederationContext' ;
42
42
import headerStyleFix from '../DataGrid/HeaderFix' ;
43
+ import thirdParties from '../../../static/thirdparties.json' ;
43
44
44
45
const ClickThroughDataGrid = styled ( DataGrid ) ( {
45
46
'& .MuiDataGrid-overlayWrapperInner' : {
@@ -183,6 +184,7 @@ const BookTable = ({
183
184
headerName : t ( 'Robot' ) ,
184
185
width : width * fontSize ,
185
186
renderCell : ( params : any ) => {
187
+ const thirdParty = thirdParties [ params . row . coordinatorShortAlias ] ;
186
188
return (
187
189
< ListItemButton
188
190
style = { { cursor : 'pointer' } }
@@ -203,7 +205,7 @@ const BookTable = ({
203
205
/>
204
206
</ ListItemAvatar >
205
207
< ListItemText
206
- primary = { params . row . maker_nick }
208
+ primary = { params . row . maker_nick ?? thirdParty . longAlias }
207
209
sx = { { position : 'relative' , left : '-1.3em' , bottom : '0.6em' } }
208
210
/>
209
211
</ ListItemButton >
@@ -218,9 +220,11 @@ const BookTable = ({
218
220
headerName : t ( 'Robot' ) ,
219
221
width : width * fontSize ,
220
222
renderCell : ( params : any ) => {
223
+ const coordinator = federation . getCoordinator ( params . row . coordinatorShortAlias ) ;
224
+ const thirdParty = thirdParties [ params . row . coordinatorShortAlias ] ;
221
225
return (
222
226
< div
223
- style = { { position : 'relative' , left : '-0.34em' , cursor : 'pointer' , bottom : '0.2em' } }
227
+ style = { { position : 'relative' , cursor : 'pointer' , bottom : '0.2em' } }
224
228
onClick = { ( ) => {
225
229
onOrderClicked ( params . row . id , params . row . coordinatorShortAlias ) ;
226
230
} }
@@ -233,6 +237,10 @@ const BookTable = ({
233
237
orderType = { params . row . type }
234
238
statusColor = { statusBadgeColor ( params . row . maker_status ) }
235
239
tooltip = { t ( params . row . maker_status ) }
240
+ coordinatorShortAlias = {
241
+ thirdParty ?. shortAlias ??
242
+ ( coordinator ?. federated ? params . row . coordinatorShortAlias : undefined )
243
+ }
236
244
/>
237
245
</ div >
238
246
) ;
@@ -242,7 +250,12 @@ const BookTable = ({
242
250
243
251
const onClickCoordinator = function ( shortAlias : string ) : void {
244
252
setOpen ( ( open ) => {
245
- return { ...open , coordinator : shortAlias } ;
253
+ const thirdParty = thirdParties [ shortAlias ] ;
254
+ if ( thirdParty ) {
255
+ return { ...open , thirdParty : shortAlias } ;
256
+ } else {
257
+ return { ...open , coordinator : shortAlias } ;
258
+ }
246
259
} ) ;
247
260
} ;
248
261
@@ -252,7 +265,8 @@ const BookTable = ({
252
265
headerName : t ( 'Host' ) ,
253
266
width : width * fontSize ,
254
267
renderCell : ( params : any ) => {
255
- const coordinator = federation . coordinators [ params . row . coordinatorShortAlias ] ;
268
+ const coordinator = federation . getCoordinator ( params . row . coordinatorShortAlias ) ;
269
+ const thirdParty = thirdParties [ params . row . coordinatorShortAlias ] ;
256
270
return (
257
271
< ListItemButton
258
272
style = { { cursor : 'pointer' } }
@@ -262,8 +276,11 @@ const BookTable = ({
262
276
>
263
277
< ListItemAvatar sx = { { position : 'relative' , left : '-1.54em' , bottom : '0.4em' } } >
264
278
< RobotAvatar
265
- shortAlias = { coordinator . federated ? params . row . coordinatorShortAlias : undefined }
266
- hashId = { coordinator . federated ? undefined : coordinator . mainnet . onion }
279
+ shortAlias = {
280
+ thirdParty ?. shortAlias ??
281
+ ( coordinator ?. federated ? params . row . coordinatorShortAlias : undefined )
282
+ }
283
+ hashId = { coordinator ?. federated ? undefined : coordinator ?. shortAlias }
267
284
style = { { width : '3.215em' , height : '3.215em' } }
268
285
smooth = { true }
269
286
small = { true }
@@ -426,7 +443,9 @@ const BookTable = ({
426
443
width : width * fontSize ,
427
444
renderCell : ( params : any ) => {
428
445
const currencyCode = String ( currencyDict [ params . row . currency . toString ( ) ] ) ;
429
- const coordinator = federation . getCoordinator ( params . row . coordinatorShortAlias ) ;
446
+ const coordinator =
447
+ federation . getCoordinator ( params . row . coordinatorShortAlias ) ??
448
+ federation . getCoordinators ( ) [ 0 ] ;
430
449
const premium = parseFloat ( params . row . premium ) ;
431
450
const limitPrice = coordinator . limits [ params . row . currency . toString ( ) ] ?. price ;
432
451
const price = ( limitPrice ?? 1 ) * ( 1 + premium / 100 ) ;
@@ -523,7 +542,7 @@ const BookTable = ({
523
542
onOrderClicked ( params . row . id , params . row . coordinatorShortAlias ) ;
524
543
} }
525
544
>
526
- { hours > 0 ? `${ hours } h` : `${ minutes } m` }
545
+ { hours > 0 ? `${ hours } h` : minutes ? `${ minutes } m` : '-' }
527
546
</ div >
528
547
) ;
529
548
} ,
@@ -585,7 +604,9 @@ const BookTable = ({
585
604
type : 'number' ,
586
605
width : width * fontSize ,
587
606
renderCell : ( params : any ) => {
588
- const coordinator = federation . getCoordinator ( params . row . coordinatorShortAlias ) ;
607
+ const coordinator =
608
+ federation . getCoordinator ( params . row . coordinatorShortAlias ) ??
609
+ federation . getCoordinators ( ) [ 0 ] ;
589
610
const amount =
590
611
params . row . has_range === true
591
612
? parseFloat ( params . row . max_amount )
@@ -646,7 +667,9 @@ const BookTable = ({
646
667
onClick = { ( ) => {
647
668
onOrderClicked ( params . row . id , params . row . coordinatorShortAlias ) ;
648
669
} }
649
- > { `${ Number ( params . row . bond_size ) } %` } </ div >
670
+ >
671
+ { params . row . bond_size ? `${ Number ( params . row . bond_size ) } %` : '-' }
672
+ </ div >
650
673
) ;
651
674
} ,
652
675
} ;
@@ -698,18 +721,10 @@ const BookTable = ({
698
721
object : robotObj ,
699
722
} ,
700
723
small : {
701
- width : 4 .1,
724
+ width : 5 .1,
702
725
object : robotSmallObj ,
703
726
} ,
704
727
} ,
705
- coordinatorShortAlias : {
706
- priority : 5 ,
707
- order : 3 ,
708
- normal : {
709
- width : 4.1 ,
710
- object : coordinatorObj ,
711
- } ,
712
- } ,
713
728
price : {
714
729
priority : 6 ,
715
730
order : 11 ,
@@ -742,24 +757,43 @@ const BookTable = ({
742
757
object : satoshisObj ,
743
758
} ,
744
759
} ,
745
- type : {
760
+ coordinatorShortAlias : {
746
761
priority : 10 ,
762
+ order : 3 ,
763
+ normal : {
764
+ width : 4.1 ,
765
+ object : coordinatorObj ,
766
+ } ,
767
+ small : {
768
+ width : 5.1 ,
769
+ object : ( ) => {
770
+ return {
771
+ field : 'coordinatorShortAlias' ,
772
+ headerName : '' ,
773
+ width : 0 ,
774
+ renderCell : ( ) => < > </ > ,
775
+ } ;
776
+ } ,
777
+ } ,
778
+ } ,
779
+ type : {
780
+ priority : 11 ,
747
781
order : 2 ,
748
782
normal : {
749
783
width : fav . mode === 'swap' ? 7 : 4.3 ,
750
784
object : typeObj ,
751
785
} ,
752
786
} ,
753
787
bond_size : {
754
- priority : 11 ,
788
+ priority : 12 ,
755
789
order : 11 ,
756
790
normal : {
757
791
width : 4.2 ,
758
792
object : bondObj ,
759
793
} ,
760
794
} ,
761
795
id : {
762
- priority : 12 ,
796
+ priority : 13 ,
763
797
order : 13 ,
764
798
normal : {
765
799
width : 4.8 ,
0 commit comments