Skip to content

Commit

Permalink
refactor: add missing types for LSP3/4
Browse files Browse the repository at this point in the history
  • Loading branch information
CJ42 committed Apr 5, 2024
1 parent fbbd048 commit 1799237
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 20 deletions.
2 changes: 2 additions & 0 deletions packages/lsp-smart-contracts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export type {
LSP4DigitalAssetMetadataJSON,
LSP4DigitalAssetMetadata,
AttributeMetadata,
AssetFile,
DigitalAsset,
} from '@lukso/lsp4-contracts';
export type { LSP6PermissionName } from '@lukso/lsp6-contracts';

Expand Down
2 changes: 1 addition & 1 deletion packages/lsp10-contracts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LSP2ArrayKey } from '@lukso/lsp2-contracts';
import type { LSP2ArrayKey } from '@lukso/lsp2-contracts';

export const LSP10DataKeys = {
// keccak256('LSP10VaultsMap') + bytes2(0)
Expand Down
2 changes: 1 addition & 1 deletion packages/lsp12-contracts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LSP2ArrayKey } from '@lukso/lsp2-contracts';
import type { LSP2ArrayKey } from '@lukso/lsp2-contracts';

export const LSP12DataKeys = {
// LSP12IssuedAssetsMap:<address> + bytes2(0)
Expand Down
19 changes: 13 additions & 6 deletions packages/lsp3-contracts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Verification } from '@lukso/lsp2-contracts';
import type { Verification } from '@lukso/lsp2-contracts';

export type LSP3ProfileMetadataJSON = {
LSP3Profile: LSP3ProfileMetadata;
Expand All @@ -7,10 +7,10 @@ export type LSP3ProfileMetadataJSON = {
export type LSP3ProfileMetadata = {
name: string;
description: string;
links?: LinkMetadata[];
tags?: string[];
profileImage?: ImageMetadata[];
backgroundImage?: ImageMetadata[];
tags?: string[];
links?: LinkMetadata[];
avatar?: AssetMetadata[];
};

Expand All @@ -26,10 +26,17 @@ export type LinkMetadata = {
url: string;
};

export type AssetMetadata = {
verification?: Verification;
export type AssetMetadata = AssetFile | DigitalAsset;

export type AssetFile = {
url: string;
fileType: string;
verification?: Verification;
fileType?: string;
};

export type DigitalAsset = {
address: string;
tokenId?: string;
};

export const LSP3SupportedStandard = {
Expand Down
28 changes: 18 additions & 10 deletions packages/lsp4-contracts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import { Verification, LSP2ArrayKey } from '@lukso/lsp2-contracts';
import type { Verification, LSP2ArrayKey } from '@lukso/lsp2-contracts';

export type LSP4DigitalAssetMetadataJSON = {
LSP4Metadata: LSP4DigitalAssetMetadata;
};

export type LSP4DigitalAssetMetadata = {
name: string;
description: string;
links: LinkMetadata[];
images: ImageMetadata[][];
assets: AssetMetadata[];
icon: ImageMetadata[];
attributes: AttributeMetadata[];
};

export type LinkMetadata = {
title: string;
url: string;
attributes?: AttributeMetadata[];
};

export type ImageMetadata = {
Expand All @@ -25,10 +21,9 @@ export type ImageMetadata = {
url: string;
};

export type AssetMetadata = {
verification?: Verification;
export type LinkMetadata = {
title: string;
url: string;
fileType: string;
};

export type AttributeMetadata = {
Expand All @@ -37,6 +32,19 @@ export type AttributeMetadata = {
type: string | number | boolean;
};

export type AssetMetadata = AssetFile | DigitalAsset;

export type AssetFile = {
url: string;
verification?: Verification;
fileType?: string;
};

export type DigitalAsset = {
address: string;
tokenId?: string;
};

export const LSP4SupportedStandard = {
key: '0xeafec4d89fa9619884b60000a4d96624a38f7ac2d8d9a604ecf07c12c77e480c',
value: '0xa4d96624',
Expand Down
2 changes: 1 addition & 1 deletion packages/lsp5-contracts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LSP2ArrayKey } from '@lukso/lsp2-contracts';
import type { LSP2ArrayKey } from '@lukso/lsp2-contracts';

export const LSP5DataKeys = {
// LSP5ReceivedAssetsMap:<address> + bytes2(0)
Expand Down
2 changes: 1 addition & 1 deletion packages/lsp6-contracts/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LSP2ArrayKey } from '@lukso/lsp2-contracts';
import type { LSP2ArrayKey } from '@lukso/lsp2-contracts';

export const INTERFACE_ID_LSP6 = '0x23f34c62';

Expand Down

0 comments on commit 1799237

Please sign in to comment.