@@ -173,12 +173,16 @@ const ParsedAccountPubkeyRow = ({
173
173
}
174
174
175
175
const Proposal = ( {
176
+ publisherKeyToNameMapping,
177
+ multisigSignerKeyToNameMapping,
176
178
proposal,
177
179
proposalIndex,
178
180
instructions,
179
181
verified,
180
182
multisig,
181
183
} : {
184
+ publisherKeyToNameMapping : Record < string , string >
185
+ multisigSignerKeyToNameMapping : Record < string , string >
182
186
proposal : TransactionAccount | undefined
183
187
proposalIndex : number
184
188
instructions : MultisigInstruction [ ]
@@ -425,10 +429,20 @@ const Proposal = ({
425
429
</ h4 >
426
430
< hr className = "border-gray-700" />
427
431
{ currentProposal . approved . map ( ( pubkey , idx ) => (
428
- < div className = "flex justify-between" key = { pubkey . toBase58 ( ) } >
429
- < div > Key { idx + 1 } </ div >
430
- < CopyPubkey pubkey = { pubkey . toBase58 ( ) } />
431
- </ div >
432
+ < >
433
+ < div className = "flex justify-between" key = { pubkey . toBase58 ( ) } >
434
+ < div > Key { idx + 1 } </ div >
435
+ < CopyPubkey pubkey = { pubkey . toBase58 ( ) } />
436
+ </ div >
437
+ { pubkey . toBase58 ( ) in multisigSignerKeyToNameMapping ? (
438
+ < ParsedAccountPubkeyRow
439
+ key = { `${ idx } _${ pubkey . toBase58 ( ) } _confirmed` }
440
+ mapping = { multisigSignerKeyToNameMapping }
441
+ title = "owner"
442
+ pubkey = { pubkey . toBase58 ( ) }
443
+ />
444
+ ) : null }
445
+ </ >
432
446
) ) }
433
447
</ div >
434
448
) : null }
@@ -439,10 +453,20 @@ const Proposal = ({
439
453
</ h4 >
440
454
< hr className = "border-gray-700" />
441
455
{ currentProposal . rejected . map ( ( pubkey , idx ) => (
442
- < div className = "flex justify-between" key = { pubkey . toBase58 ( ) } >
443
- < div > Key { idx + 1 } </ div >
444
- < CopyPubkey pubkey = { pubkey . toBase58 ( ) } />
445
- </ div >
456
+ < >
457
+ < div className = "flex justify-between" key = { pubkey . toBase58 ( ) } >
458
+ < div > Key { idx + 1 } </ div >
459
+ < CopyPubkey pubkey = { pubkey . toBase58 ( ) } />
460
+ </ div >
461
+ { pubkey . toBase58 ( ) in multisigSignerKeyToNameMapping ? (
462
+ < ParsedAccountPubkeyRow
463
+ key = { `${ idx } _${ pubkey . toBase58 ( ) } _rejected` }
464
+ mapping = { multisigSignerKeyToNameMapping }
465
+ title = "owner"
466
+ pubkey = { pubkey . toBase58 ( ) }
467
+ />
468
+ ) : null }
469
+ </ >
446
470
) ) }
447
471
</ div >
448
472
) : null }
@@ -525,28 +549,42 @@ const Proposal = ({
525
549
< div > Value</ div >
526
550
</ div >
527
551
{ Object . keys ( instruction . args ) . map ( ( key , index ) => (
528
- < div
529
- key = { index }
530
- className = "flex justify-between border-t border-beige-300 py-3"
531
- >
532
- < div > { key } </ div >
533
- { instruction . args [ key ] instanceof PublicKey ? (
534
- < CopyPubkey
552
+ < >
553
+ < div
554
+ key = { index }
555
+ className = "flex justify-between border-t border-beige-300 py-3"
556
+ >
557
+ < div > { key } </ div >
558
+ { instruction . args [ key ] instanceof PublicKey ? (
559
+ < CopyPubkey
560
+ pubkey = { instruction . args [ key ] . toBase58 ( ) }
561
+ />
562
+ ) : typeof instruction . args [ key ] === 'string' &&
563
+ isPubkey ( instruction . args [ key ] ) ? (
564
+ < CopyPubkey pubkey = { instruction . args [ key ] } />
565
+ ) : (
566
+ < div className = "max-w-sm break-all" >
567
+ { typeof instruction . args [ key ] === 'string'
568
+ ? instruction . args [ key ]
569
+ : instruction . args [ key ] instanceof Uint8Array
570
+ ? instruction . args [ key ] . toString ( 'hex' )
571
+ : JSON . stringify ( instruction . args [ key ] ) }
572
+ </ div >
573
+ ) }
574
+ </ div >
575
+ { key === 'pub' &&
576
+ instruction . args [ key ] . toBase58 ( ) in
577
+ publisherKeyToNameMapping ? (
578
+ < ParsedAccountPubkeyRow
579
+ key = { `${ index } _${ instruction . args [
580
+ key
581
+ ] . toBase58 ( ) } `}
582
+ mapping = { publisherKeyToNameMapping }
583
+ title = "publisher"
535
584
pubkey = { instruction . args [ key ] . toBase58 ( ) }
536
585
/>
537
- ) : typeof instruction . args [ key ] === 'string' &&
538
- isPubkey ( instruction . args [ key ] ) ? (
539
- < CopyPubkey pubkey = { instruction . args [ key ] } />
540
- ) : (
541
- < div className = "max-w-sm break-all" >
542
- { typeof instruction . args [ key ] === 'string'
543
- ? instruction . args [ key ]
544
- : instruction . args [ key ] instanceof Uint8Array
545
- ? instruction . args [ key ] . toString ( 'hex' )
546
- : JSON . stringify ( instruction . args [ key ] ) }
547
- </ div >
548
- ) }
549
- </ div >
586
+ ) : null }
587
+ </ >
550
588
) ) }
551
589
</ div >
552
590
) : (
@@ -739,45 +777,69 @@ const Proposal = ({
739
777
</ div >
740
778
{ Object . keys ( parsedInstruction . args ) . map (
741
779
( key , index ) => (
742
- < div
743
- key = { index }
744
- className = "flex justify-between border-t border-beige-300 py-3"
745
- >
746
- < div > { key } </ div >
747
- { parsedInstruction . args [
780
+ < >
781
+ < div
782
+ key = { index }
783
+ className = "flex justify-between border-t border-beige-300 py-3"
784
+ >
785
+ < div > { key } </ div >
786
+ { parsedInstruction . args [
787
+ key
788
+ ] instanceof PublicKey ? (
789
+ < CopyPubkey
790
+ pubkey = { parsedInstruction . args [
791
+ key
792
+ ] . toBase58 ( ) }
793
+ />
794
+ ) : typeof instruction . args [ key ] ===
795
+ 'string' &&
796
+ isPubkey (
797
+ instruction . args [ key ]
798
+ ) ? (
799
+ < CopyPubkey
800
+ pubkey = {
801
+ parsedInstruction . args [ key ]
802
+ }
803
+ />
804
+ ) : (
805
+ < div className = "max-w-sm break-all" >
806
+ { typeof parsedInstruction . args [
807
+ key
808
+ ] === 'string'
809
+ ? parsedInstruction . args [ key ]
810
+ : parsedInstruction . args [
811
+ key
812
+ ] instanceof Uint8Array
813
+ ? parsedInstruction . args [
814
+ key
815
+ ] . toString ( 'hex' )
816
+ : JSON . stringify (
817
+ parsedInstruction . args [
818
+ key
819
+ ]
820
+ ) }
821
+ </ div >
822
+ ) }
823
+ </ div >
824
+ { key === 'pub' &&
825
+ parsedInstruction . args [
748
826
key
749
- ] instanceof PublicKey ? (
750
- < CopyPubkey
827
+ ] . toBase58 ( ) in
828
+ publisherKeyToNameMapping ? (
829
+ < ParsedAccountPubkeyRow
830
+ key = { `${ index } _${ parsedInstruction . args [
831
+ key
832
+ ] . toBase58 ( ) } `}
833
+ mapping = {
834
+ publisherKeyToNameMapping
835
+ }
836
+ title = "publisher"
751
837
pubkey = { parsedInstruction . args [
752
838
key
753
839
] . toBase58 ( ) }
754
840
/>
755
- ) : typeof instruction . args [ key ] ===
756
- 'string' &&
757
- isPubkey ( instruction . args [ key ] ) ? (
758
- < CopyPubkey
759
- pubkey = {
760
- parsedInstruction . args [ key ]
761
- }
762
- />
763
- ) : (
764
- < div className = "max-w-sm break-all" >
765
- { typeof parsedInstruction . args [
766
- key
767
- ] === 'string'
768
- ? parsedInstruction . args [ key ]
769
- : parsedInstruction . args [
770
- key
771
- ] instanceof Uint8Array
772
- ? parsedInstruction . args [
773
- key
774
- ] . toString ( 'hex' )
775
- : JSON . stringify (
776
- parsedInstruction . args [ key ]
777
- ) }
778
- </ div >
779
- ) }
780
- </ div >
841
+ ) : null }
842
+ </ >
781
843
)
782
844
) }
783
845
</ div >
@@ -962,7 +1024,13 @@ const Proposal = ({
962
1024
)
963
1025
}
964
1026
965
- const Proposals = ( ) => {
1027
+ const Proposals = ( {
1028
+ publisherKeyToNameMapping,
1029
+ multisigSignerKeyToNameMapping,
1030
+ } : {
1031
+ publisherKeyToNameMapping : Record < string , string >
1032
+ multisigSignerKeyToNameMapping : Record < string , string >
1033
+ } ) => {
966
1034
const router = useRouter ( )
967
1035
const [ currentProposal , setCurrentProposal ] = useState < TransactionAccount > ( )
968
1036
const [ currentProposalIndex , setCurrentProposalIndex ] = useState < number > ( )
@@ -1112,6 +1180,8 @@ const Proposals = () => {
1112
1180
</ div >
1113
1181
< div className = "relative mt-6" >
1114
1182
< Proposal
1183
+ publisherKeyToNameMapping = { publisherKeyToNameMapping }
1184
+ multisigSignerKeyToNameMapping = { multisigSignerKeyToNameMapping }
1115
1185
proposal = { currentProposal }
1116
1186
proposalIndex = { currentProposalIndex }
1117
1187
instructions = { allProposalsIxsParsed [ currentProposalIndex ] }
0 commit comments