import { ProjectResponseData } from "./ProjectTypes";
/**
* @typedef {Object} CollectionTypes
* @property {number} id Id of the collection
* @property {string} createdAt Created time of collection
* @property {string} updatedAt Updated time of collection
* @property {string} name Name of the collection
* @property {string} collectionImageUrl Collection image URL
* @property {string} description Description of the collection
* @property {string} iconUrl Url of the icon's collection
* @property {string} contractAddress Smart contract address of the collection
* @property {string} ownerPublicKey Stark key owner of the collection
* @property {string} metadataApiUrl Metadata url of the collection
* @property {string} starkKey Stark key of the collection
* @property {string} publicId Unique public ID (UUID) to identify the collection
* @property {string} isHot The isHot flag is to recognized the hot status of collection
* + (hot mean it's currently shown on the Marketplace homepage)
*/
export interface CollectionTypes {
id: number;
createdAt?: string;
updatedAt?: string;
name: string;
collectionImageUrl?: string;
description?: string;
iconUrl?: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
starkKey: string;
publicId?: string;
isHot: false;
}
/**
* @typedef {Object} GetTotalAssetsByOwnerParams
* @property {id} collectionId Id of the collection
* @property {string} starkKey Stark key of collection's owner
* @property {PaginationType} paginationType Pagination options for request including limit and page
*/
export interface GetTotalAssetsByOwnerParams {
collectionId: number;
starkKey: string;
paginationType?: PaginationType;
}
/**
* @typedef {GetCollectionParams}
* @property {number=} limit Collections limit per page
* @property {number=} page Page in collection list
* @property {boolean=} isHot hot status (true/false)
* + Hot Collections are the ones displayed in marketplace homepage.
*/
export interface GetCollectionParams {
limit?: number;
page?: number;
isHot?: boolean;
}
/**
* @typedef {GetCollectionByApiKeyParams}
* @property {string} accountId Myria user ID
* @property {string} apiKey Developer API Key which can retrieve via Developer portal
* @description Params to get all of collections belong to developers
*/
export interface GetCollectionByApiKeyParams {
accountId: string;
apiKey: string;
}
/**
* @typedef {Object} CreateCollectionParams
* @property {string} name Name of the collection
* @property {string=} collectionImageUrl Banner image of the collection (shown on Myria marketplace)
* @property {string=} description Collection description
* @property {string=} iconUrl Avatar of the collection
* @property {string} contractAddress The unique smart contract for specific collection
* @property {string} ownerPublicKey Public stark key for the owner (collection creator)
* @property {string} metadataApiUrl URL pointing to metadata files for assets in collection (example: https://gateway.pinata.cloud/ipfs/Qma8R9U69cASBfvUiLKrxfssVgrtGHfydTHvCYFW4Aiw5a)
* @property {string} starkKey Registered stark key of collection owner
* @property {string} projectId Project ID for collection
*/
export interface CreateCollectionParams {
name: string;
collectionImageUrl?: string;
description?: string;
iconUrl?: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
starkKey: string;
projectId: number;
}
/**
* @typedef {Object} CreateCollectionByApiKeyParams
* @property {string} name Name of the collection
* @property {string=} collectionImageUrl Banner image of the collection (shown on Myria marketplace)
* @property {string=} description Collection description
* @property {string=} iconUrl Avatar of the collection
* @property {string} contractAddress The unique smart contract for specific collection
* @property {string} ownerPublicKey Public stark key for the owner (collection creator)
* @property {string} metadataApiUrl URL pointing to metadata files for assets in collection (example: https://gateway.pinata.cloud/ipfs/Qma8R9U69cASBfvUiLKrxfssVgrtGHfydTHvCYFW4Aiw5a)
* @property {string} projectId Project ID for collection
* @property {string} accountId Unique ID (uuid) of myria user
* @property {string} apiKey Partner's API key
*/
export interface CreateCollectionByApiKeyParams {
name: string;
collectionImageUrl?: string;
description: string;
iconUrl?: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
projectId: number;
accountId: string;
apiKey: string;
}
/**
* @typedef {Object} CreateCollectionResponse
* @property {id} id unique ID of the collection
* @property {string} createdAt created time of the collection
* @property {string} updatedAt updated time of the collection
* @property {string} name Name of the collection
* @property {string} collectionImageUrl Banner image of the collection (shown on Myria marketplace)
* @property {string} description Description about the collections
* @property {string} iconUrl Avatar of the collection
* @property {string} contractAddress The unique smart contract for specific collection
* @property {string} ownerPublicKey Public stark key for owner
* @property {string} metadataApiUrl URL pointing to metadata files for assets in collection (example: https://gateway.pinata.cloud/ipfs/Qma8R9U69cASBfvUiLKrxfssVgrtGHfydTHvCYFW4Aiw5a)
* @property {string} accountID Registered stark key of owner of collection
* @property {string} publicId unique public ID (UUID) to identify the collection
*/
export interface CreateCollectionByAccountID {
id: number;
createdAt: string;
updatedAt: string;
name: string;
collectionImageUrl: string;
description: string;
iconUrl: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
accountID: string;
pubicId: string;
}
export interface CreateCollectionByAccountIDResponse {
status: string;
data: CreateCollectionByAccountID | undefined;
}
/**
* @typedef {Object} CreateCollectionResponse
* @property {id} id unique ID of the collection
* @property {string} createdAt created time of the collection
* @property {string} updatedAt updated time of the collection
* @property {string} name Name of the collection
* @property {string} collectionImageUrl Banner image of the collection (shown on Myria marketplace)
* @property {string} description Description about the collections
* @property {string} iconUrl Avatar of the collection
* @property {string} contractAddress The unique smart contract for specific collection
* @property {string} ownerPublicKey Public stark key for owner
* @property {string} metadataApiUrl URL pointing to metadata files for assets in collection (example: https://gateway.pinata.cloud/ipfs/Qma8R9U69cASBfvUiLKrxfssVgrtGHfydTHvCYFW4Aiw5a)
* @property {string} starkKey Registered stark key of owner of collection
* @property {string} publicId unique public ID (UUID) to identify the collection
*/
export interface CreateCollectionResponse {
id: number;
createdAt: string;
updatedAt: string;
name: string;
collectionImageUrl: string;
description: string;
iconUrl: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
starkKey: string;
pubicId: string;
}
/**
* @typedef {Object} MetadataSchema
* @property {name} name key of the property in metadata schema
* @property {string=} type Type of data field (integer/string/enum/boolean)
* @property {string=} filterable Filterable flag to allow the searching and filtering NFT's
* in the collection details page
*/
export interface MetadataSchema {
name: string;
type?: string;
filterable?: boolean;
}
/**
* @typedef {Object} CollectionListResponse
* @property {id} id unique ID of the collection
* @property {string} createdAt created time of the collection
* @property {string} updatedAt updated time of the collection
* @property {string} name Name of the collection
* @property {string} collectionImageUrl Banner image of the collection (shown on Myria marketplace)
* @property {string} description Description about the collections
* @property {string} iconUrl Avatar of the collection
* @property {string} contractAddress The unique smart contract for specific collection
* @property {string} ownerPublicKey Public stark key for the owner (who created this collection)
* @property {string} metadataApiUrl URL pointing to metadata files for assets in collection (example: https://gateway.pinata.cloud/ipfs/Qma8R9U69cASBfvUiLKrxfssVgrtGHfydTHvCYFW4Aiw5a)
* @property {string} starkKey Registered stark key of collection owner
* @property {string} publicId unique public ID (UUID) to identify the collection
* @property {string} isHot Hot status of the collection (true/false)
* + If hot is true, then the collection is shown on Myria's Marketplace Homepage
* @property {Metadata[]} metadataSchema the metadata schema of the collection
* @property {ProjectResponseData} project Project details information
*/
export interface CollectionListResponse {
id: number;
createdAt: string;
updatedAt: string;
name: string;
collectionImageUrl: string;
description: string;
iconUrl: null;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
starkKey: string;
publicId: string;
isHot: boolean;
metadataSchema: MetadataSchema[];
project: ProjectResponseData;
__entity: string;
}
/**
* @typedef {Object} CollectionMetadataSchemaParams
* @property {name} name key of the property in metadata schema
* @property {string=} type Type of data field (integer/string/enum/boolean)
* @property {string=} filterable Filterable flag to allow the searching and filtering NFT's
* in the collection details page
*/
export interface CollectionMetadataSchemaParams {
name: string;
type?: string;
filterable?: boolean;
}
export interface CreateCollectionMetadataResponseType {
metadata: CollectionMetadataSchemaParams[];
}
/**
* @typedef {Object} CollectionDetailsResponseData
* @property {id} id unique ID of the collection
* @property {string} createdAt created time of the collection
* @property {string} updatedAt updated time of the collection
* @property {string} name Name of the collection
* @property {string} collectionImageUrl Banner image of the collection (shown on Myria marketplace)
* @property {string} description Description about the collections
* @property {string} iconUrl Avatar of the collection
* @property {string} contractAddress The unique smart contract for specific collection
* @property {string} ownerPublicKey Public stark key for collection owner
* @property {string} metadataApiUrl URL pointing to metadata files for assets in collection (example: https://gateway.pinata.cloud/ipfs/Qma8R9U69cASBfvUiLKrxfssVgrtGHfydTHvCYFW4Aiw5a)
* @property {string} starkKey Registered stark key of owner of collection
* @property {string} publicId unique public ID (UUID) to identify the collection
* @property {string} isHot Hot status of the collection (true/false)
* + If hot is true, then the collection is shown on Myria's Marketplace Homepage
* @property {Metadata[]} metadataSchema the metadata schema of the collection
* @property {ProjectResponseData} project Project details information
*/
export interface CollectionDetailsResponseData {
id: number;
createdAt: string;
updatedAt: string;
name: string;
collectionImageUrl: string;
description: string;
iconUrl: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
starkKey: string;
publicId: string;
isHot: boolean;
metadataSchema: MetadataSchema[];
project: ProjectResponseData;
}
/**
* @typedef {Object} AssetListResponse
* @property {number} id unique ID of the individual asset
* @property {string} publicId The public ID of the Asset NFT
* @property {string} name Name of the Asset
* @property {string} description Description about the assets
* @property {number} collectionId The ID of the collection that own assets
* @property {string} uri The url of the NFTs
* @property {string} assetType For example (ALL / NON_SALE / FOR_SALE)
* @property {string} imageUrl The image (avatar) of the asset NFTs
* @property {Object} metadata The structure of metadata schema (key/value[])
* @property {string} tokenAddress The smart contract address of the collection
* @property {Object} metadataOptional Fields are not defined on the metadata schema would be manage by Metadata Optional
* @property {string} creator.name Name of the project that the collection is belonging to
* @property {string} creator.starkKey Stark key of the creator
* @property {string} owner The owner stark key
* @property {number} order.id The unique ID of the order
* @property {number} order.assetRefId The asset reference ID (sequence ID for the asset in database)
* @property {string} order.amountSell The quantized amount sell of the assets (it's always 1 if asset is NFT - MINTABLE_ERC721/ERC_721)
* @property {string} order.amountBuy The ETH price that owner set for the listing assets (quantized amount)
* @property {string} order.nonQuantizedAmountSell The original amount token sell (it's always 1 if asset is NFT - MINTABLE_ERC721/ERC_721)
* @property {string} order.nonQuantizedAmountBuy The ETH price that owner set for the listing assets (original amount)
* + For example, if the asset is listing with 2 ETH (nonQuantizedAmountSell = 1, nonQuantizedAmountBuy = 2 ETH)
* @property {string} order.assetIdSell The hex string of the token sell (NFT / MINTABLE_ERC721 / ERC721)
* @property {string} order.assetIdBuy The hex string of the token buy (ETH / ERC_20 / MYRIA_TOKEN)
* @property {string} order.status Status of the order (ACTIVE / INACTIVE)
*/
export interface AssetListResponse {
id: number;
publicId: string;
name: string | null;
description: string;
collectionId: number;
uri: string;
assetType: string;
imageUrl: string | null;
metadata: any;
tokenAddress: string;
metadataOptional: any;
creator: {
name: string; // Project Name
starkKey: string; // Stark key of the creator
};
owner: string;
order: {
id: number,
assetRefId: number,
amountSell: string | number,
amountBuy: string | number,
price: number,
ethusdRate: number,
nonQuantizedAmountSell: string;
nonQuantizedAmountBuy: string;
assetIdSell: string;
assetIdBuy: string;
orderType: string;
status: string,
expiredAt: string
}
}
/**
* @typedef {Object} OwnerAssetsCount
* @property {string} starkKey Stark key of the owner's NFT
* @property {string} totalAssets Total assets that the users owns
*/
export type OwnerAssetsCount = {
starkKey: string;
totalAssets: string;
}
/**
* @typedef {Object} CreateCollectionMetadataParams
* @property {MetadataSchema[]} metadata Metadata structure params
* @property {string} starkKey Public stark key of collection owner
*/
export interface CreateCollectionMetadataParams {
metadata: MetadataSchema[];
starkKey: string;
}
/**
* @typedef {Object} UpdateCollectionByContractAddressParams
* @property {string} contractAddress The smart contract address of the collection
* @property {string} name The name of the collection
* @property {string} starkKey The owner stark key of the collection
* @property {string=} description The details description of the collection
* @property {string=} collectionImageUrl The collection banner image which is shown on the Marketplace
* @property {string=} iconUrl The avatar of the collection
*/
export interface UpdateCollectionByContractAddressParams {
contractAddress: string;
name: string;
starkKey: string;
description?: string;
collectionImageUrl?: string;
iconUrl?: string;
}
/**
* @typedef {Object} UpdateCollectionByCollectionIdAndApiKeyParams
* @property {string} contractAddress The smart contract address of the collection
* @property {string} name The name of the collection
* @property {string} accountId The Myria user ID (unique and identical for account)
* @property {string} apiKey The partner's api key
* @property {string=} description The details description of the collection
* @property {string=} collectionImageUrl The collection banner image which is shown on the Marketplace
* @property {string=} iconUrl The avatar of the collection
*/
export interface UpdateCollectionByCollectionIdAndApiKeyParams {
collectionId: string;
name: string;
accountId: string;
apiKey: string;
description?: string;
collectionImageUrl?: string;
iconUrl?: string;
}
/**
* @typedef {Object} UpdateCollectionMetadataParams
* @property {string} name Key of metadata property
* @property {string=} type Data type of the field on metadata
* @property {string=} filterable Filterable flag to allow filtering the attributes based the metadata schema
* @property {string} starkKey The owner stark key of the collection
*/
export interface UpdateCollectionMetadataParams {
name: string;
type?: string;
filterable?: boolean;
starkKey: string;
}
/**
* @typedef {Object} GetAssetByCollectionParams
* @property {number} collectionId The unique sequence ID of the collection
* @property {string} assetType The type of the asset (ALL, NON_SALE, FOR_SALE)
* @property {number=} limit Limit items per page when getting the query
* @property {number=} page The paginable index to indicate the current page
* @property {string=} assetTypeOutput LIST_ASSET_ID (get id only) | ASSETS (get all information)
*/
export interface GetAssetByCollectionParams {
collectionId: number;
assetType: string;
limit?: number;
page?: number;
assetTypeOutput?: string;
}
/**
* @typedef {Object} PaginationType
* @property {number=} limit Maximum items per page
* @property {page=} page the index of page
* @property {route=} route the suggested link to route to related API
*/
export type PaginationType = {
limit?: number;
page?: number;
route?: string;
}
export interface AttributesResponse {
collectionId: number,
attribute: {
[key: string]: ItemAttributeResponse
}
}
export interface ItemAttributeResponse {
type: string,
values: string[],
filterable: boolean
}
/**
* @typedef {Object} ValidateMetadataParams
* @property {MetadataSchema[]} metadata The metadata structure format with Myria standard
* @property {string} assetMetadataUri The test metadata url of specific NFTs
*/
export interface ValidateMetadataParams {
metadata: MetadataSchema[];
assetMetadataUri: string;
}
/**
* @typedef {Object} ErrorCodeValidateMetadata
* @property {number} errorCode errorCode Explicit error code that our system response
* @property {string} message message Details message of error code of the validation metadata response
*/
export interface ErrorCodeValidateMetadata {
errorCode: number;
message: string;
}
/**
* @typedef {Object} ValidateMetadataResponse
* @property {boolean} isValid isValid The results of validation with metadata json and metadata URL (true/false)
* @property {ErrorCodeValidateMetadata[]} errors List of specific error code for the metadata validation
*/
export interface ValidateMetadataResponse {
isValid: boolean;
errors?: ErrorCodeValidateMetadata[];
}
Source