@@ -173,12 +173,16 @@ const ParsedAccountPubkeyRow = ({
173173}
174174
175175const Proposal = ( {
176+ publisherKeyToNameMapping,
177+ multisigSignerKeyToNameMapping,
176178 proposal,
177179 proposalIndex,
178180 instructions,
179181 verified,
180182 multisig,
181183} : {
184+ publisherKeyToNameMapping : Record < string , string >
185+ multisigSignerKeyToNameMapping : Record < string , string >
182186 proposal : TransactionAccount | undefined
183187 proposalIndex : number
184188 instructions : MultisigInstruction [ ]
@@ -425,10 +429,20 @@ const Proposal = ({
425429 </ h4 >
426430 < hr className = "border-gray-700" />
427431 { 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+ </ >
432446 ) ) }
433447 </ div >
434448 ) : null }
@@ -439,10 +453,20 @@ const Proposal = ({
439453 </ h4 >
440454 < hr className = "border-gray-700" />
441455 { 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+ </ >
446470 ) ) }
447471 </ div >
448472 ) : null }
@@ -525,28 +549,42 @@ const Proposal = ({
525549 < div > Value</ div >
526550 </ div >
527551 { 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"
535584 pubkey = { instruction . args [ key ] . toBase58 ( ) }
536585 />
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+ </ >
550588 ) ) }
551589 </ div >
552590 ) : (
@@ -739,45 +777,69 @@ const Proposal = ({
739777 </ div >
740778 { Object . keys ( parsedInstruction . args ) . map (
741779 ( 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 [
748826 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"
751837 pubkey = { parsedInstruction . args [
752838 key
753839 ] . toBase58 ( ) }
754840 />
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+ </ >
781843 )
782844 ) }
783845 </ div >
@@ -962,7 +1024,13 @@ const Proposal = ({
9621024 )
9631025}
9641026
965- const Proposals = ( ) => {
1027+ const Proposals = ( {
1028+ publisherKeyToNameMapping,
1029+ multisigSignerKeyToNameMapping,
1030+ } : {
1031+ publisherKeyToNameMapping : Record < string , string >
1032+ multisigSignerKeyToNameMapping : Record < string , string >
1033+ } ) => {
9661034 const router = useRouter ( )
9671035 const [ currentProposal , setCurrentProposal ] = useState < TransactionAccount > ( )
9681036 const [ currentProposalIndex , setCurrentProposalIndex ] = useState < number > ( )
@@ -1112,6 +1180,8 @@ const Proposals = () => {
11121180 </ div >
11131181 < div className = "relative mt-6" >
11141182 < Proposal
1183+ publisherKeyToNameMapping = { publisherKeyToNameMapping }
1184+ multisigSignerKeyToNameMapping = { multisigSignerKeyToNameMapping }
11151185 proposal = { currentProposal }
11161186 proposalIndex = { currentProposalIndex }
11171187 instructions = { allProposalsIxsParsed [ currentProposalIndex ] }
0 commit comments