Skip to content

Commit

Permalink
feat: add schemas to display addresses for LSP1 Type Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Aug 16, 2024
1 parent e5643c8 commit 580f6a7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/AddressInfos/AddressInfos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ const AddressInfos: React.FC<Props> = ({ assetAddress, userAddress = '' }) => {
);
};

if (assetAddress === null) {
return <span>no address set</span>;
}

return (
<div>
<code className="mr-2">
Expand All @@ -275,7 +279,6 @@ const AddressInfos: React.FC<Props> = ({ assetAddress, userAddress = '' }) => {
</a>
</code>
<AddressTypeBadge text={addressTypeText} isLight={true} />

{renderTags()}
</div>
);
Expand Down
29 changes: 29 additions & 0 deletions components/DataKeysTable/ProfileSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"valueType": "address",
"valueContent": "Address"
},

{
"name": "SupportedStandards:LSP3Profile",
"key": "0xeafec4d89fa9619884b600005ef83ad9559033e6e941db7d7c495acdce616347",
Expand Down Expand Up @@ -47,5 +48,33 @@
"keyType": "Array",
"valueType": "address",
"valueContent": "Address"
},
{
"name": "LSP1UniversalReceiverDelegate:LSP7Tokens_SenderNotification",
"key": "0x0cfc51aec37c55a4d0b10000429ac7a06903dbc9c13dfcb3c9d11df8194581fa",
"keyType": "Mapping",
"valueType": "address",
"valueContent": "Address"
},
{
"name": "LSP1UniversalReceiverDelegate:LSP7Tokens_RecipientNotification",
"key": "0x0cfc51aec37c55a4d0b1000020804611b3e2ea21c480dc465142210acf4a2485",
"keyType": "Mapping",
"valueType": "address",
"valueContent": "Address"
},
{
"name": "LSP1UniversalReceiverDelegate:LSP8Tokens_SenderNotification",
"key": "0x0cfc51aec37c55a4d0b10000b23eae7e6d1564b295b4c3e3be402d9a2f0776c5",
"keyType": "Mapping",
"valueType": "address",
"valueContent": "Address"
},
{
"name": "LSP1UniversalReceiverDelegate:LSP8Tokens_RecipientNotification",
"key": "0x0cfc51aec37c55a4d0b100000b084a55ebf70fd3c06fd755269dac2212c4d3f0",
"keyType": "Mapping",
"valueType": "address",
"valueContent": "Address"
}
]
12 changes: 12 additions & 0 deletions components/ValueTypeDecoder/ValueTypeDecoder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ const ValueTypeDecoder: React.FC<Props> = ({
}, [address, web3, erc725JSONSchema, value]);

try {
if (decodedDataOneKey[0].name.startsWith('LSP1UniversalReceiverDelegate')) {
let badgeContent = decodedDataOneKey[0].value;

return (
<>
<code>{value}</code>
<div className="mt-4"></div>
<AddressInfos assetAddress={badgeContent} userAddress={address} />
<AddressButtons address={badgeContent} />
</>
);
}
if (
!decodedDataOneKey[0].name.endsWith('[]') &&
(typeof decodedDataOneKey[0].value === 'string' ||
Expand Down

0 comments on commit 580f6a7

Please sign in to comment.