Assets Reference
This document is a reference to the Onchain Assets module of the Myria Core SDK. The module contains information about Myria assets.
Interfaces
AssetResponse
Data structure returned by the refreshAssetMetadata(), getAssets(), getAssetById() methods.
interface AssetResponse {
starkKey: string;
uri: string;
assetType: string;
tokenId: string;
tokenAddress: string;
status: string;
name: string;
imgUrl: string;
animationUrl: string;
description: string;
animationUrlMimeType: string;
collectionId: number;
updatedAt: string;
imageUrl: string | null;
assetMintId: string | null;
id: number;
createdAt: string;
metadata: Object | {};
publicId: string;
}
AssetDetailsResponse
Data structure returned by the refreshAssetMetadata(), getAssets(), getAssetById() methods.
interface AssetDetailsResponse {
id: number;
createdAt: string;
updatedAt: string;
starkKey: string;
uri: string;
assetType: string;
tokenId: string;
tokenAddress: string;
status: string;
name: string;
description: string;
imageUrl: string;
animationUrl: null;
animationUrlMimeType: string;
collectionId: number;
metadata: MetadataTypes;
metadataOptional: {};
owner: {
createdAt: string;
ethAddress: string;
starkKey: string;
};
creator: {
name: string;
starkKey: string;
};
publicId: string;
assetMintId: string;
collectionName: string;
collectionContractAddress: string;
fee: FeeTypes[];
order: OrderType;
totalMintedAssets: number;
__entity: string;
}
Attributes
id
- unique identifier of the asset on the Myria networkcreatedAt
- the date when the asset was createdupdatedAt
- the date when the asset was updated last timestarkKey
- Stark Key, has to start with0x
uri
- URL path to the asset metadataassetType
- asset typetokenId
- unique identifier of the asset, an incremental numeric value starting from 1tokenAddress
- contract address of the assetstatus
- response status: success, failurename
- displayed name of the assetdescription
- description of the assetimageUrl
- URL for the display image of this asset, used on the Myria marketplaceanimationUrl
- URL to a multi-media attachment for the assetanimationUrlMimeType
- Mime type of the file to whichanimation_url
pointscollectionId
- the id of the collection to which the asset belongsmetadata
- an array of metadata properties of the assetmetadataOptional
- optional metadata propertiesowner
- an object that describes the wallet details of the owner of this assetcreator
- an object that describes details of the creator of this assetpublicId
- public id of the assetassetMintId
- a hexadecimal value of the asset, combined fromtokenId
+tokenAddress
collectionName
- collection namecollectionContractAddress
- contract address to which the asset belongsfee
- an array of FeeTypes that defines royalty fees for the secondary salesorder
- an OrderType object that gives details of the order used to purchase this assettotalMintedAssets
- the number of assets minted within the same collectioncontractAddress
- contract address associated with the collection to which this asset belongs, used to withdraw assets to the Ethereum network
AssetVaultDetailsResponseAPI
Data structure returned by the getAssetVaultDetails() method.
interface AssetVaultDetailsResponseAPI {
vaultId: number;
tokenName: string;
quantum: string;
id: string;
starkKey: string;
assetId: string;
assetType: string;
quantizedAmount: string;
createdAt: number;
updatedAt: number;
}
Attributes
vaultId
- vault idtokenName
- token namequantum
- a quantum value of the asset, default: 10^10id
- unique identifier of the asset on the Myria networkstarkKey
- Stark Key of the asset owner, has to start with0x
assetId
- a hexadecimal value of the asset, combined fromtokenId
+tokenAddress
assetType
- asset typequantizedAmount
- the calculated amount with Quantum:Wei/QUANTUM
where Wei is the actual amount and Quantum is the constant number 10^10createdAt
- the date when the asset was createdupdatedAt
- the date when the asset was updated last time
AssetByCollectionIdResponse
Data structure returned by the getAssetsByCollectionId() method.
interface AssetByCollectionIdResponse {
id: number;
name: string;
collectionImageUrl: string;
description: string;
iconUrl: string;
contractAddress: string;
ownerPublicKey: string;
metadataApiUrl: string;
starkKey: string;
publicId: string;
isHot: boolean;
metadataSchema: [];
createdAt: string;
updatedAt: string;
project: {
id: number;
name: string;
companyName: string;
contactEmail: string;
publicId: string;
};
totalAssets: number;
totalAssetsForSale: number;
}
Attributes
id
- id of this asset, e,g.123
name
- a displayed name of the assetcollectionImageUrl
- URL for the collection imagedescription
- description of the asseticonUrl
- URL for the collection icon imagecontractAddress
- contract address to which the asset belongsownerPublicKey
- the public key of the ownermetadataApiUrl
- Metadata API URL of the collection to which the asset belongsstarkKey
- Stark Key of the asset owner, has to start with0x
publicId
- public id of the assetisHot
- whether the marketplace should include the collection to which the asset belongs in the hot sectionmetadataSchema
- metadata schema of the collection to which this asset belongscreatedAt
- the date when the asset was createdupdatedAt
- the date when the asset was updated last timeproject
- an object that defines details of the project to which the asset belongstotalAssets
- total number of assets within a collection to which the assset belongstotalAssetsForSale
- total number of assets for sale within a collection to which the asset belongs
GetAssetsByStarkKeyParams
interface GetAssetsByStarkKeyParams extends PagingDataParams {
starkKey: number;
}
Attributes
starkKey
- Stark Key of the asset owner, has to start with0x
CollectionDetailsParams
Data structure passed to getAssetsByCollectionId() method.
interface CollectionDetailsParams extends PagingDataParams {
sortingField?: string;
orderBy?: AssetOrderBy;
filterValue?: string[];
filterField?: string[];
collectionId: number;
}
Attributes
sortingField
- field used to sort the assets within the collectionorderBy
- the order direction by which to sort the values. AcceptsASC
,DESC
filterValue
- value by which the result should be filteredcollectionId
- collection id
CollectionByIdDetailsParams
Data structure passed to getAssetsWithFilter() method.
interface CollectionByIdDetailsParams extends PagingDataParams {
sortingField?: string;
orderBy?: AssetOrderBy;
filterValue?: any;
filterField?: string;
collectionId: number;
}
OrderType
Data structure used as the order
value in the AssetDetailsResponse() response.
interface OrderType {
orderId: number;
createdAt: string;
expiredAt: string;
status: string;
fees: {
address: string;
percentage: number;
}[];
includeFees: boolean;
assetIdSell: number;
vaultIdSell: number;
amountSell: string;
assetIdBuy: number;
vaultIdBuy: number;
amountBuy: string;
price: number;
}
Attributes
orderId
- order idcreatedAt
- the date when the order was createdexpiredAt
- the date when the order expiresstatus
- order statusfees
- an array of objects that defines fees used to execute the orderincludeFees
- a flag that defines if the fees should be included during the order execution. Acceptstrue
orfalse
assetIdSell
- a computed hex string of the sold asset, retrieved from the SignableOrder response before submitting an ordervaultIdSell
- the key number to locate the fund of the sold asset and link the fund on-chainamountSell
- amount of assets to sellassetIdBuy
- a computed hex string of the buy asset. If the asset is bought by ETH, then it's the Ethereum token hex. This value would be retrieved from the SignableOrder response before submitting an order.vaultIdBuy
- the key number to locate the fund of the buy asset and link the fund on-chain. If the asset is purchased with ETH, then the vaultIDBuy will located to the ETH fundamountBuy
- price of the token that the users need to payprice
- order price
OrderTypeEqual
Data structure used as the order
value in the NftAssetEqualMetadataResponse() response.
interface OrderTypeEqual extends OrderType {
amountSellUsd: number;
amountBuyUsd: number;
orderRequestId: null;
assetRefId: number;
}
Attributes
amountSellUsd
- amount to sell in $amountBuyUsd
- amount to buy in $orderRequestId
- order idassetRefId
- unique identifier of the asset on the Myria network
Types
FeeTypes
declare type FeeTypes = {
id: number;
address: string;
percentage: number;
feeType: string;
};
Attributes
id
- fee type idaddress
- address where the royalty fees will be sentpercentage
- a percentage of the royalty fee the creator will receive from secondary salesfeeType
- fee type
AssetDictData
declare type AssetDictData = {
quantum?: string;
blob?: string;
tokenAddress?: string;
};
Methods
getAssets()
Returns all assets on the Myria network.
Parameters
PagingDataParams
object that contains pagination parameters:limit
,page
Returns
Returns an object with response call status and the data
object that contains an items
array of all assets on the Myria network.
getAssets(data?: PagingDataParams): Promise<APIResponseType<CommonPaginateDataTypes<AssetDetailsResponse[]>> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getAssets();
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetDetailsResponse[]
{
"status": "success",
"data": {
"items": [
{
"id": 1,
"createdAt": "2022-09-06T03:50:12.188Z",
"updatedAt": "2022-11-13T08:45:11.420Z",
"starkKey": "0x42fdc02e5f3518576f3f941a0edeee8b2ea318e55e2263c1c86f962f946b6c2",
"uri": "https://staging.myriaverse-api.nonprod-myria.com/v1/sigil/metadata/1",
"assetType": "MINTABLE_ERC721",
"tokenId": "1",
"tokenAddress": "0x28331533eadc566c04e137f510dafdcb59ff813d",
"status": "MINTED",
"name": "Equinox Common Sigil",
"description": "A Common Sigil of the Equinox Alliance. This item pledges your loyalty to the oldest Alliance in existence. Sigils unlock certain benefits and utility for different Myria games and products.",
"imageUrl": "https://assets-staging.nonprod-myria.com/marketplace/sigil/equinox/common.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 1,
"metadata": {
"type": "Sigil",
"rarity": "Common",
"alliance": "Equinox"
},
"metadataOptional": {
"imageUrl": "https://assets-staging.nonprod-myria.com/marketplace/sigil/equinox/common.png",
"description": "A Common Sigil of the Equinox Alliance. This item pledges your loyalty to the oldest Alliance in existence. Sigils unlock certain benefits and utility for different Myria games and products."
},
"creatorStarkKey": "0x5eb1a04db9190230f231627c1b673cdb19f77374ff4780158322f23177e872",
"publicId": "beffc255-b277-4a76-ae9b-498d28d691be",
"assetMintId": "0x400f4b13c12169922d0f49a52c3bcb2ca01a78ab06f7b9bb7d94cf0ec77b605",
"transactionId": 65420,
"views": "55",
"collection": {
"id": 1,
"createdAt": "2022-09-06T03:48:05.453Z",
"updatedAt": "2022-10-10T09:56:43.201Z",
"name": "Starstar",
"collectionImageUrl": "https://admin-tool-assets-dev.s3.amazonaws.com/photo-1459666644539-a9755287d6b0.png",
"description": "Star2sgrg",
"iconUrl": "https://admin-tool-assets-dev.s3.amazonaws.com/Angular-logo.png",
"contractAddress": "0x28331533eadc566c04e137f510dafdcb59ff813d",
"ownerPublicKey": "0x663217fd41198bc5db2f69313a324d0628daa9e8",
"metadataApiUrl": "https://staging.myriaverse-api.nonprod-myria.com/v1/sigil/metadata",
"starkKey": "0x5eb1a04db9190230f231627c1b673cdb19f77374ff4780158322f23177e872",
"publicId": "00933489-17b8-4925-90da-974de45f2370",
"isHot": true,
"metadataSchema": [
{
"name": "alliance",
"type": "enum",
"filterable": true
},
{
"name": "rarity",
"type": "enum",
"filterable": true
},
{
"name": "type",
"type": "enum",
"filterable": true
}
],
"project": {
"id": 1,
"createdAt": "2022-09-06T03:46:55.002Z",
"updatedAt": "2022-10-29T14:38:03.162Z",
"name": "Myria System",
"companyName": "Myria Staging",
"contactEmail": "duy.le@myria.com",
"collectionLimitExpiresAt": "2022-11-26T03:48:05.201Z",
"collectionMonthlyLimit": 5,
"collectionRemaining": 4,
"mintLimitExpiresAt": null,
"mintMonthlyLimit": 50000,
"mintRemaining": 49928,
"publicId": "eeda808b-560d-4e87-a3c2-2519671af09a",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"__entity": "AssetEntity"
},
...
],
"meta": {
"totalItems": 218529,
"itemCount": 10,
"itemsPerPage": 10,
"totalPages": 21853,
"currentPage": 1
},
"links": {
"first": "http://localhost:8081/v1/assets?limit=10",
"previous": "",
"next": "http://localhost:8081/v1/assets?page=2&limit=10",
"last": "http://localhost:8081/v1/assets?page=21853&limit=10"
}
}
}
getAssetsByCollectionId()
Returns assets by a collection id.
Parameters
- CollectionDetailsParams object
Returns
Returns an object with response call status and the data
object that contains an items
array of assets that belong to a given collection.
getAssetsByCollectionId(payload: CollectionDetailsParams): Promise<APIResponseType<CommonPaginateDataTypes<AssetByCollectionIdResponse>> | undefined>;
Example
- Typescript
import { CollectionDetailsParams, IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const payload: CollectionDetailsParams = {
collectionId: COLLECTION_ID,
limit: LIMIT,
page: PAGE_NUMBER,
filterField: [""],
filterValue: [""]
}
let assetsResponse = await assetManager.getAssetsByCollectionId(payload);
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetByCollectionIdResponse
{
"status": "success",
"data": {
"items": [
{
"id": 1864,
"createdAt": "2022-09-22T10:57:24.311Z",
"updatedAt": "2022-11-01T10:59:30.398Z",
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"uri": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc/7",
"assetType": "MINTABLE_ERC721",
"tokenId": "7",
"tokenAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"status": "MINTED",
"name": "EverydaySHEROE #218",
"description": "218",
"imageUrl": null,
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 82,
"metadata": {},
"metadataOptional": {
"image": "https://ipfs.moralis.io:2053/ipfs/Qmbcm3o2obZbn9VFiw2zcswQfCxhmQVrAcrrBS8sGfyWC7/218.jpeg",
"attributes": [
{
"lips": "BROWN",
"skin": "Blue",
"trait_type": "Category"
},
{
"value": 2,
"trait_type": "Edition"
},
{
"state": "FLORIDA",
"trait_type": "State"
}
],
"description": "218",
"externalUrl": ""
},
"creatorStarkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "bc744995-ad78-44b4-8129-bcaeafcac5e2",
"assetMintId": "0x400347cb98dcbcd11c440713ab140f2d865b41bb0cb1456298f961c087efaef",
"transactionId": 68636,
"views": "191",
"collection": {
"id": 82,
"createdAt": "2022-09-22T10:55:00.375Z",
"updatedAt": "2022-09-22T10:55:00.375Z",
"name": "EverydaySHEROE",
"collectionImageUrl": null,
"description": "EverydaySHEROE COllection description",
"iconUrl": null,
"contractAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"ownerPublicKey": "0x488a8ca56f29bfbe28e6f4cf898d5c3c1455deda",
"metadataApiUrl": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc",
"starkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "6d7fbacf-7710-4471-8ad9-61ead4bd1737",
"isHot": false,
"metadataSchema": [],
"project": {
"name": "Kaizen",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"order": [
{
"id": 363,
"createdAt": "2022-09-22T17:00:07.571Z",
"updatedAt": "2022-09-22T17:00:08.054Z",
"assetRefId": 1864,
"orderType": "SELL",
"status": "ACTIVE",
"expiredAt": "2034-09-22T17:00:00.000Z",
"fees": [
{}
],
"includeFees": false,
"assetIdSell": "0x400347cb98dcbcd11c440713ab140f2d865b41bb0cb1456298f961c087efaef",
"vaultIdSell": 73671,
"amountSell": "1",
"nonQuantizedAmountSell": "1",
"assetIdBuy": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6",
"vaultIdBuy": 73665,
"amountBuy": "1000000000000",
"amountBuyNonFee": null,
"nonQuantizedAmountBuy": "10000",
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"nonce": 40,
"orderRequestId": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452#40",
"starkSignature": {
"r": "0x6c3f11ab423d6b3600131bb9a021b537e5e21757285c5be3c47ae91c3e40a92",
"s": "0x6c65dbe70a041ccbd6c6995c1b4c07258198ef121ef51274f53c5a9ca4f9b84"
},
"__entity": "OrderEntity",
"amountSellUsd": 1265.31,
"amountBuyUsd": 1265310000000000
}
],
"__entity": "AssetEntity",
"creator": {
"name": "Kaizen",
"starkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872"
}
},
...
],
"meta": {
"totalItems": 2,
"itemCount": 2,
"itemsPerPage": 10,
"totalPages": 1,
"currentPage": 1
},
"links": {
"first": "http://localhost:8081/v1/assets/collection-id/82?limit=10",
"previous": "",
"next": "",
"last": "http://localhost:8081/v1/assets/collection-id/82?page=1&limit=10"
},
"owner": {
"signature": {
"r": "0x56957ce3163a913177cc705afc5d7c0605309f0dbd5e7a61af893880b884593",
"s": "0xee1654900754b3ab766be06b9168f4c5eaea25013a3fedb2f75744699d003c"
},
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"ethAddress": "0x543c1e9873a17954b57d414028c8f9372476bd5f"
}
}
}
getAssetById()
Returns details of an asset by a given asset id.
Parameters
assetId
- asset id, unique identifier of the asset on the Myria network
Returns
Returns an object with response call status and the data
object that contains information about the requested asset.
getAssetById(assetId: string): Promise<APIResponseType<AssetDetailsResponse> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getAssetById("ASSET_ID");
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetDetailsResponse
{
"status": "success",
"data": {
"id": 26149,
"assetMintId": "0x400114617324d82d699a7a0a3f7f7f878f718853764cbd0563f1ae4908167d7",
"status": "MINTED",
"publicId": "2b825ae9-cc4c-4962-a4e2-a2ab26aafeed",
"collectionId": 53,
"collectionName": "Moon Pedestal",
"collectionContractAddress": "0x472aea7b0e0dedffe641ee49edadc452be44c62b",
"name": "Supernova Maxi",
"tokenAddress": "0x472aea7b0e0dedffe641ee49edadc452be44c62b",
"tokenId": "447502",
"assetType": "MINTABLE_ERC721",
"ownedBy": "0x61b721a3f7b04524dc8919840b83094e080ad41de44caee78ccc36b61b07fea",
"metadata": {
"name": "Supernova Maxi",
"model": "",
"rarity": "Common",
"imageUrl": "https://assets-dev.nonprod-myria.com/marketplace/moonPedestal/moonville_supernova.gif",
"description": "Supernova Maxi NFTs are automatically airdropped to Sigil NFT holders. Digital assets from this collection can be converted to raffle entries during Moonville Farms events for a chance to earn valuable NFTs that improve in-game efficiency.",
"pointsTitle": "Score",
"pointsValue": "0",
"propertyType": "No Effect",
"propertyValue": "0"
},
"metadataOptional": {
"type": "Decorative",
"tokenId": "447502"
},
"description": "Supernova Maxi NFTs are automatically airdropped to Sigil NFT holders. Digital assets from this collection can be converted to raffle entries during Moonville Farms events for a chance to earn valuable NFTs that improve in-game efficiency.",
"uri": "https://dev.myriasolarfest-api.nonprod-myria.com/v1/solar-festival/metadata/moon-pedestal/447502",
"imageUrl": "https://assets-dev.nonprod-myria.com/marketplace/moonPedestal/moonville_supernova.gif",
"totalMintedAssets": "35331",
"owner": {
"signature": {
"r": "0x3855bd31fae88311aac94c61c4bf9d4d04d91b514fe052ddc918877a3160ff7",
"s": "0x206cd377724a1802a8976d0e90bad7d3894bd5c8e582f87682451a7ad71f6ee"
},
"starkKey": "0x61b721a3f7b04524dc8919840b83094e080ad41de44caee78ccc36b61b07fea",
"ethAddress": "0x0fc4603d6deddadc9e829679c2538688d40b46c5"
},
"fee": [
{
"id": 23569,
"address": "0x0fc4603d6deddadc9e829679c2538688d40b46c5",
"percentage": 0,
"feeType": "ROYALTY"
}
],
"creator": {
"name": "Myria",
"starkKey": "0x61b721a3f7b04524dc8919840b83094e080ad41de44caee78ccc36b61b07fea"
}
}
}
getAssetsByOwnerPublicKey()
Returns all assets minted by a given public key, even if the owner of the assets has changed.
Parameters
ownerPublicKey
- public key
Returns
Returns an object with response call status and the data
array with assets minted by a given public key.
getAssetsByOwnerPublicKey(ownerPublicKey: string): Promise<APIResponseType<AssetOwnerPublicKeyResponse> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getAssetsByOwnerPublicKey("PUBLIC_KEY", PAGE_NUMBER, LIMIT);
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetOwnerPublicKeyResponse
{
"status": "success",
"data": [
{
"id": 117812,
"createdAt": "2022-10-05T11:00:33.836Z",
"updatedAt": "2022-10-20T08:21:18.141Z",
"starkKey": "0x7d682c993fa1090bf7cdc9598bf7e0062b1d0308c90e1fafca44d867cdf05f4",
"uri": "https://gateway.pinata.cloud/ipfs/QmXe7YfTbd5fWh1F7eNXvGNgxaASDb6fKikrZBLCgxYW4v/1",
"assetType": "MINTABLE_ERC721",
"tokenId": "1",
"tokenAddress": "0x615876a6978986e1fe3ef9e8404ae41e61196c62",
"status": "MINTED",
"name": "Airdrop Gatherer 1",
"description": "The first puzzle of Airdrop Gatherer",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 129,
"metadata": {
"race": "Collectors",
"power": "Magnet"
},
"metadataOptional": {
"image": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"description": "The first puzzle of Airdrop Gatherer",
"externalUrl": ""
},
"creatorStarkKey": "0x7d682c993fa1090bf7cdc9598bf7e0062b1d0308c90e1fafca44d867cdf05f4",
"publicId": "a01435ca-a837-41f4-989b-b990325f1236",
"assetMintId": "0x400815239257c199289db4882b0ce3928f13bddf90bebbdec812b0a244283b7",
"transactionId": 180632,
"views": "278",
"collection": {
"id": 129,
"createdAt": "2022-10-05T10:55:28.253Z",
"updatedAt": "2022-10-06T03:29:52.757Z",
"name": "Buidlers v3",
"collectionImageUrl": null,
"description": "A third iteration of Buidlers collection",
"iconUrl": null,
"contractAddress": "0x615876a6978986e1fe3ef9e8404ae41e61196c62",
"ownerPublicKey": "0x7b08c88a6d0f27620798b57f3d744c62b0dea634",
"metadataApiUrl": "https://gateway.pinata.cloud/ipfs/QmXe7YfTbd5fWh1F7eNXvGNgxaASDb6fKikrZBLCgxYW4v",
"starkKey": "0x7d682c993fa1090bf7cdc9598bf7e0062b1d0308c90e1fafca44d867cdf05f4",
"publicId": "d300e048-fd74-4c1c-b967-35ed0982e0f3",
"isHot": false,
"metadataSchema": [
{
"name": "Race",
"type": "enum",
"filterable": true
},
{
"name": "Power",
"type": "enum",
"filterable": true
}
],
"project": {
"id": 120,
"createdAt": "2022-10-05T09:31:27.517Z",
"updatedAt": "2022-10-06T06:47:22.351Z",
"name": "Solid project",
"companyName": "Solid company",
"contactEmail": "solid@gmail.com",
"collectionLimitExpiresAt": "2022-11-02T09:32:51.771Z",
"collectionMonthlyLimit": 5,
"collectionRemaining": 2,
"mintLimitExpiresAt": null,
"mintMonthlyLimit": 50000,
"mintRemaining": 49962,
"publicId": "69a7f268-4f9b-4f3f-b46a-b8830a589399",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"__entity": "AssetEntity"
},
{
"id": 117709,
"createdAt": "2022-10-05T09:41:04.624Z",
"updatedAt": "2022-10-11T08:06:23.013Z",
"starkKey": "0x7d682c993fa1090bf7cdc9598bf7e0062b1d0308c90e1fafca44d867cdf05f4",
"uri": "https://gateway.pinata.cloud/ipfs/QmXe7YfTbd5fWh1F7eNXvGNgxaASDb6fKikrZBLCgxYW4v/1",
"assetType": "MINTABLE_ERC721",
"tokenId": "1",
"tokenAddress": "0x6615dbdde86117a035b33fbdc6cbd9e6f89664f8",
"status": "MINTED",
"name": "Airdrop Gatherer 1",
"description": "The first puzzle of Airdrop Gatherer",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 126,
"metadata": {},
"metadataOptional": {
"race": "Collectors",
"image": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"power": "Magnet",
"description": "The first puzzle of Airdrop Gatherer",
"externalUrl": ""
},
"creatorStarkKey": "0x7d682c993fa1090bf7cdc9598bf7e0062b1d0308c90e1fafca44d867cdf05f4",
"publicId": "cbf2cf37-410f-4425-8c79-4a2a242e9858",
"assetMintId": "0x400e13d87f1d077702bbeaf68d6d6c35a8bdf199a8f3cdca8373bda5b28477f",
"transactionId": 180600,
"views": "103",
"collection": {
"id": 126,
"createdAt": "2022-10-05T09:40:36.223Z",
"updatedAt": "2022-10-05T09:59:33.635Z",
"name": "Buidlers v2",
"collectionImageUrl": null,
"description": "A second iteration of Buidlers collection",
"iconUrl": null,
"contractAddress": "0x6615dbdde86117a035b33fbdc6cbd9e6f89664f8",
"ownerPublicKey": "0x7b08c88a6d0f27620798b57f3d744c62b0dea634",
"metadataApiUrl": "https://gateway.pinata.cloud/ipfs/QmXe7YfTbd5fWh1F7eNXvGNgxaASDb6fKikrZBLCgxYW4v",
"starkKey": "0x7d682c993fa1090bf7cdc9598bf7e0062b1d0308c90e1fafca44d867cdf05f4",
"publicId": "55c446ac-c5b2-4ec7-a8fe-24aea3f66110",
"isHot": false,
"metadataSchema": [
{
"name": "race",
"type": "enum",
"filterable": true
},
{
"name": "power",
"type": "enum",
"filterable": true
}
],
"project": {
"id": 120,
"createdAt": "2022-10-05T09:31:27.517Z",
"updatedAt": "2022-10-06T06:47:22.351Z",
"name": "Solid project",
"companyName": "Solid company",
"contactEmail": "solid@gmail.com",
"collectionLimitExpiresAt": "2022-11-02T09:32:51.771Z",
"collectionMonthlyLimit": 5,
"collectionRemaining": 2,
"mintLimitExpiresAt": null,
"mintMonthlyLimit": 50000,
"mintRemaining": 49962,
"publicId": "69a7f268-4f9b-4f3f-b46a-b8830a589399",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"__entity": "AssetEntity"
},
...
]
}
getAssetByStarkKey()
Returns assets by a given Stark Key.
Parameters
starkKey
- Stark Key, has to start with0x
limit
- the max number of assets to return per response, optionalpage
- the page number of returned assets based on the definedlimit
, optional
Returns
Returns an object with response call status and the data
object that contains an items
array of requested assets.
getAssetByStarkKey(starkKey: string, page?: number, limit?: number): Promise<APIResponseType<CommonPaginateDataTypes<AssetStarkKeyResponse>> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getAssetByStarkKey("STARK_KEY");
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetStarkKeyResponse
{
"status": "success",
"data": {
"items": [
{
"id": 21,
"createdAt": "2022-09-06T06:47:57.315Z",
"updatedAt": "2022-09-06T08:30:38.171Z",
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"uri": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj/01",
"assetType": "MINTABLE_ERC721",
"tokenId": "01",
"tokenAddress": "0x7d8a0f44704c2a2c3c8a0c7bc878a47fda27c5e6",
"status": "WITHDRAWING",
"name": "Airdrop Gatherer 01",
"description": "The first puzzle of Airdrop Gatherer",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 3,
"metadata": {},
"metadataOptional": {
"image": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-01.png",
"attributes": [
{
"value": "Collectors",
"trait_type": "Race"
},
{
"value": "Sketch",
"trait_type": "Art Stage"
}
],
"description": "The first puzzle of Airdrop Gatherer",
"externalUrl": ""
},
"creatorStarkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"publicId": "48a87889-c4ff-48ad-9a8f-7ec629e09763",
"assetMintId": "0x40018fb80b5e8d80f299007fd685490c26d06228b0b2cd9cf53592cb0359b33",
"transactionId": 65468,
"views": "0",
"collection": {
"id": 3,
"createdAt": "2022-09-06T06:33:16.977Z",
"updatedAt": "2022-10-07T06:07:07.535Z",
"name": "Emily's Demo Video",
"collectionImageUrl": "https://admin-tools-assets-staging.s3.amazonaws.com/Emily%20Banner.png",
"description": "This is an updated description",
"iconUrl": "https://admin-tools-assets-staging.s3.amazonaws.com/Emily%20Logo.png",
"contractAddress": "0x7d8a0f44704c2a2c3c8a0c7bc878a47fda27c5e6",
"ownerPublicKey": "0xc5e958cffd97a47783a74074940a1b2989b8bf57",
"metadataApiUrl": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj",
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"publicId": "59328c8a-17fd-459d-8d12-37507945cdf7",
"isHot": true,
"metadataSchema": [],
"project": {
"id": 2,
"createdAt": "2022-09-06T05:26:24.857Z",
"updatedAt": "2022-10-06T05:33:04.445Z",
"name": "Project XYZ",
"companyName": "Myria Staging",
"contactEmail": "test@myria.com",
"collectionLimitExpiresAt": "2022-11-03T06:33:16.693Z",
"collectionMonthlyLimit": 5,
"collectionRemaining": 4,
"mintLimitExpiresAt": null,
"mintMonthlyLimit": 50000,
"mintRemaining": 49957,
"publicId": "17ca4116-e191-41f2-a969-1bb27b04e7e2",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"__entity": "AssetEntity"
},
{
"id": 23,
"createdAt": "2022-09-06T06:49:24.777Z",
"updatedAt": "2022-09-27T06:41:38.262Z",
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"uri": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj/03",
"assetType": "MINTABLE_ERC721",
"tokenId": "03",
"tokenAddress": "0x7d8a0f44704c2a2c3c8a0c7bc878a47fda27c5e6",
"status": "WITHDRAWING",
"name": "Airdrop Gatherer 03",
"description": "The third puzzle of Airdrop Gatherer",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-03.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 3,
"metadata": {},
"metadataOptional": {
"image": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-03.png",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/collectors/collectors-03.png",
"attributes": [
{
"value": "Collectors",
"trait_type": "Race"
},
{
"value": "Sketch",
"trait_type": "Art Stage"
}
],
"description": "The third puzzle of Airdrop Gatherer",
"externalUrl": ""
},
"creatorStarkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"publicId": "666214f6-2434-41a1-bc68-23fa7ef89db5",
"assetMintId": "0x40024945c9062c338caf2bbc6cb8879be13f71f3bde8834d3d0351537090863",
"transactionId": 68861,
"views": "0",
"collection": {
"id": 3,
"createdAt": "2022-09-06T06:33:16.977Z",
"updatedAt": "2022-10-07T06:07:07.535Z",
"name": "Emily's Demo Video",
"collectionImageUrl": "https://admin-tools-assets-staging.s3.amazonaws.com/Emily%20Banner.png",
"description": "This is an updated description",
"iconUrl": "https://admin-tools-assets-staging.s3.amazonaws.com/Emily%20Logo.png",
"contractAddress": "0x7d8a0f44704c2a2c3c8a0c7bc878a47fda27c5e6",
"ownerPublicKey": "0xc5e958cffd97a47783a74074940a1b2989b8bf57",
"metadataApiUrl": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj",
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"publicId": "59328c8a-17fd-459d-8d12-37507945cdf7",
"isHot": true,
"metadataSchema": [],
"project": {
"id": 2,
"createdAt": "2022-09-06T05:26:24.857Z",
"updatedAt": "2022-10-06T05:33:04.445Z",
"name": "Project XYZ",
"companyName": "Myria Staging",
"contactEmail": "test@myria.com",
"collectionLimitExpiresAt": "2022-11-03T06:33:16.693Z",
"collectionMonthlyLimit": 5,
"collectionRemaining": 4,
"mintLimitExpiresAt": null,
"mintMonthlyLimit": 50000,
"mintRemaining": 49957,
"publicId": "17ca4116-e191-41f2-a969-1bb27b04e7e2",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"__entity": "AssetEntity"
},
],
"meta": {
"totalItems": 15,
"itemCount": 10,
"itemsPerPage": 10,
"totalPages": 2,
"currentPage": 1,
"totalAssetsForSale": 0
},
"links": {
"first": "http://localhost:8081/v1/assets/stark-key/0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685?limit=10",
"previous": "",
"next": "http://localhost:8081/v1/assets/stark-key/0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685?page=2&limit=10",
"last": "http://localhost:8081/v1/assets/stark-key/0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685?page=2&limit=10"
}
}
}
getListAssetsByStarkKey()
Returns a minimized list of assets by a given Stark Key.
Parameters
starkKey
- Stark Key, has to start with0x
Returns
Returns an object with response call status and the data
array of assets that a given Stark Key owns.
getListAssetsByStarkKey(starkKey: string): Promise<any>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getListAssetsByStarkKey("STARK_KEY");
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
Assets
{
"status": "success",
"data": [
{
"tokenId": "23",
"vaultId": 73728,
"assetType": "0x322790a1378be74646101c816feefa381765a5d5d7d7c25d1884b4ce06ac603",
"quantum": "1",
"createdAt": 1664187356449,
"tokenType": "MINTABLE_ERC721",
"quantizedAmount": "0",
"tokenAddress": "0xa1976c7214f76f8e094517df4c002f100a1e58d9",
"assetId": "0x40001065c349eeee66c55952b1f24337041fcc4c3d71b18d14489394ff0d284",
"updatedAt": 1664187356925,
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"id": "fcd86daa-fcc0-456f-b913-da9b6aab414a"
},
{
"tokenId": "43",
"vaultId": 73842,
"assetType": "0xa6a68e69703a42b99bdbd782f97e6773136c87a6666263fd3e7b1a85149d78",
"quantum": "1",
"createdAt": 1664264608964,
"tokenType": "MINTABLE_ERC721",
"quantizedAmount": "0",
"tokenAddress": "0x2eabfae376fdfac57f3f3f356e9eda1bda2bf689",
"assetId": "0x400010894ed5479f72e5ca1e8677e9e8b6e21242b58fc1950c588f20ea9d13f",
"updatedAt": 1664264612834,
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"id": "50668163-79e8-4568-8f6f-0934aa20e2fc"
},
...
]
}
getNftAssets()
Returns NFT assets by a given Stark Key.
Parameters
starkKey
- Stark Key, has to start with0x
Returns
Returns an object with response call status and the data
array of assets that a given Stark Key owns.
getNftAssets(starkKey: string): Promise<APIResponseType<MintedAssetType[]> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getNftAssets("STARK_KEY");
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
MintedAssetType[]
{
"status": "success",
"data": [
{
"tokenId": "25",
"assetId": "0x4004ab754cca362abb8f7cae88b1ffc7b2f3f032e908427b34cc9b8aaf74e7e",
"vaultId": 71258,
"createdAt": 1662447564461,
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"contractAddress": "0x37a611adcb9e76bb858c30fbbe33c4db0ca620d5",
"transactionId": 65465,
"blueprint": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj/25"
},
{
"tokenId": "17",
"assetId": "0x400a1dbf50bd3a8e44c1303c85300dac3560e0e0dc55791307a6e2f7872e4ac",
"vaultId": 71250,
"createdAt": 1662447513272,
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"contractAddress": "0xa1d8eafe21fad96449f373bd7ac7b9fb618a4cd7",
"transactionId": 65457,
"blueprint": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj/17"
},
...
]
}
getNftAssetsByStatus()
Returns all NFT assets on the Myria network by a given status.
Parameters
QueryAssetParams
object that containsorderType
,status
,sortingField
andorderBy
parameters.
Returns
Returns an object with response call status and the data
object that contains an items
array of assets with given status.
getNftAssetsByStatus(payload: QueryAssetParams): Promise<APIResponseType<CommonPaginateDataTypes<AssetHaveOrderResponse[]>> | undefined>;
Example
- Typescript
import { AssetOrderBy, IMyriaClient, ModuleFactory, MyriaClient, OrderStatus, OrderType, QueryAssetParams } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const params: QueryAssetParams = {
orderType: OrderType.SELL,
status: OrderStatus.ACTIVE,
sortingField: "amountSell",
orderBy: AssetOrderBy.ASC
}
const assetsResponse = await assetManager.getNftAssetsByStatus(
params
);
})();
Response
AssetHaveOrderResponse[]
{
"status": "success",
"data": {
"items": [
{
"id": 129392,
"createdAt": "2022-10-13T01:03:56.545Z",
"updatedAt": "2022-10-14T05:49:53.549Z",
"starkKey": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98",
"uri": "https://nft.crystalsoffate.com/data/heroes",
"assetType": "MINTABLE_ERC721",
"tokenId": "2000003",
"tokenAddress": "0x6113f3a1531934038fab7ab56606009a563d286f",
"status": "MINTED",
"name": "Zamir Nightbane",
"description": "no desc",
"imageUrl": "https://nft.crystalsoffate.com/image/heroes/2.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 162,
"metadata": {},
"metadataOptional": {
"id": 2,
"class": "Assassin",
"image": "https://nft.crystalsoffate.com/image/heroes/2.png",
"rarity": "Rare",
"imageUrl": "https://nft.crystalsoffate.com/image/heroes/2.png",
"attributes": [
{
"value": "Rare",
"trait_type": "Rarity"
},
{
"value": "Assassin",
"trait_type": "Class"
}
],
"description": "no desc"
},
"creatorStarkKey": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98",
"publicId": "23afb6d5-9983-4096-b7f8-846d0de933e8",
"assetMintId": "0x400f216506ad00969342746668899c0fe7255ea557967f3db5d93e59bada387",
"transactionId": 187141,
"views": "135",
"collection": {
"id": 162,
"createdAt": "2022-10-13T01:01:54.666Z",
"updatedAt": "2022-10-13T01:01:54.666Z",
"name": "Heroes",
"collectionImageUrl": "https://nft.crystalsoffate.com/background/heroes.png",
"description": "no desc",
"iconUrl": "https://nft.crystalsoffate.com/icon/heroes.png",
"contractAddress": "0x6113f3a1531934038fab7ab56606009a563d286f",
"ownerPublicKey": "0xb573e2d626de1125fc82ac5896fc3720b3b44880",
"metadataApiUrl": "https://nft.crystalsoffate.com/data/heroes/",
"starkKey": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98",
"publicId": "a6145e9b-96e9-4401-a881-3baa04720f50",
"isHot": false,
"metadataSchema": [],
"project": {
"name": "CoF Test 2",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"order": [
{
"id": 2646,
"createdAt": "2022-10-13T01:09:12.937Z",
"updatedAt": "2022-10-13T01:09:13.636Z",
"assetRefId": 129392,
"orderType": "SELL",
"status": "ACTIVE",
"expiredAt": "2034-10-13T01:00:00.000Z",
"fees": [
{
"address": "0xb573e2d626de1125fc82ac5896fc3720b3b44880",
"feeType": "ROYALTY",
"percentage": 2
}
],
"includeFees": true,
"assetIdSell": "0x400f216506ad00969342746668899c0fe7255ea557967f3db5d93e59bada387",
"vaultIdSell": 192717,
"amountSell": "1",
"nonQuantizedAmountSell": "1",
"assetIdBuy": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6",
"vaultIdBuy": 187867,
"amountBuy": "75068000",
"amountBuyNonFee": null,
"nonQuantizedAmountBuy": "0.766",
"starkKey": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98",
"nonce": 14,
"orderRequestId": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98#14",
"starkSignature": {
"r": "0x38019f7a50fe105214a1704d5982ecbd483a21648b03b8b9560f16c7f2c2361",
"s": "0x2aa5a4bff169a935174407fb00efe93777da78957e1d0baae5bf546307abe23"
},
"__entity": "OrderEntity",
"amountSellUsd": 1204.46,
"amountBuyUsd": 90416403280
}
],
"__entity": "AssetEntity",
"creator": {
"name": "CoF Test 2",
"starkKey": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98"
}
},
...
],
"meta": {
"totalItems": 3081,
"itemCount": 100,
"itemsPerPage": 100,
"totalPages": 31,
"currentPage": 1
},
"links": {
"first": "http://localhost:8081/v1/assets/order/status?limit=100",
"previous": "",
"next": "http://localhost:8081/v1/assets/order/status?page=2&limit=100",
"last": "http://localhost:8081/v1/assets/order/status?page=31&limit=100"
},
"owner": {
"signature": {
"r": "0x68b48de6977562e635780847120cf90b491dc764b56ebd3438db72d2a2ac817",
"s": "0x525b70c0284533ddff9a610bb7f5db529903e5778a6a41b95598e965055b88c"
},
"starkKey": "0x76d56eb16204dfdd95a4c71ab97834915736ddece59a9dc8358cfe1e2299c98",
"ethAddress": "0xb573e2d626de1125fc82ac5896fc3720b3b44880"
}
}
}
getAssetsWithFilter()
Returns assets within a collection by a given filter.
Parameters
- CollectionByIdDetailsParams object.
Returns
Returns an object with response call status and the data
object that contains an items
array of assets with given status.
getAssetsWithFilter(payload: CollectionByIdDetailsParams): Promise<APIResponseType<CommonPaginateDataTypes<AssetByCollectionIdResponse>> | undefined>;
Example
- Typescript
import { CollectionByIdDetailsParams, IMyriaClient, ModuleFactory, MyriaClient } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const payload: CollectionByIdDetailsParams = {
collectionId: 82,
limit: 10,
page: 1,
filterField: "orderType",
filterValue: "SELL"
}
const assetsResponse = await assetManager.getAssetsWithFilter(
payload
);
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetHaveOrderResponse[]
{
"status": "success",
"data": {
"items": [
{
"id": 1864,
"createdAt": "2022-09-22T10:57:24.311Z",
"updatedAt": "2022-11-01T10:59:30.398Z",
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"uri": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc/7",
"assetType": "MINTABLE_ERC721",
"tokenId": "7",
"tokenAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"status": "MINTED",
"name": "EverydaySHEROE #218",
"description": "218",
"imageUrl": null,
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 82,
"metadata": {},
"metadataOptional": {
"image": "https://ipfs.moralis.io:2053/ipfs/Qmbcm3o2obZbn9VFiw2zcswQfCxhmQVrAcrrBS8sGfyWC7/218.jpeg",
"attributes": [
{
"lips": "BROWN",
"skin": "Blue",
"trait_type": "Category"
},
{
"value": 2,
"trait_type": "Edition"
},
{
"state": "FLORIDA",
"trait_type": "State"
}
],
"description": "218",
"externalUrl": ""
},
"creatorStarkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "bc744995-ad78-44b4-8129-bcaeafcac5e2",
"assetMintId": "0x400347cb98dcbcd11c440713ab140f2d865b41bb0cb1456298f961c087efaef",
"transactionId": 68636,
"views": "191",
"collection": {
"id": 82,
"createdAt": "2022-09-22T10:55:00.375Z",
"updatedAt": "2022-09-22T10:55:00.375Z",
"name": "EverydaySHEROE",
"collectionImageUrl": null,
"description": "EverydaySHEROE COllection description",
"iconUrl": null,
"contractAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"ownerPublicKey": "0x488a8ca56f29bfbe28e6f4cf898d5c3c1455deda",
"metadataApiUrl": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc",
"starkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "6d7fbacf-7710-4471-8ad9-61ead4bd1737",
"isHot": false,
"metadataSchema": [],
"project": {
"name": "Kaizen",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"order": [
{
"id": 363,
"createdAt": "2022-09-22T17:00:07.571Z",
"updatedAt": "2022-09-22T17:00:08.054Z",
"assetRefId": 1864,
"orderType": "SELL",
"status": "ACTIVE",
"expiredAt": "2034-09-22T17:00:00.000Z",
"fees": [
{}
],
"includeFees": false,
"assetIdSell": "0x400347cb98dcbcd11c440713ab140f2d865b41bb0cb1456298f961c087efaef",
"vaultIdSell": 73671,
"amountSell": "1",
"nonQuantizedAmountSell": "1",
"assetIdBuy": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6",
"vaultIdBuy": 73665,
"amountBuy": "1000000000000",
"amountBuyNonFee": null,
"nonQuantizedAmountBuy": "10000",
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"nonce": 40,
"orderRequestId": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452#40",
"starkSignature": {
"r": "0x6c3f11ab423d6b3600131bb9a021b537e5e21757285c5be3c47ae91c3e40a92",
"s": "0x6c65dbe70a041ccbd6c6995c1b4c07258198ef121ef51274f53c5a9ca4f9b84"
},
"__entity": "OrderEntity",
"amountSellUsd": 1202.89,
"amountBuyUsd": 1202890000000000
}
],
"__entity": "AssetEntity",
"creator": {
"name": "Kaizen",
"starkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872"
}
},
{
"id": 1862,
"createdAt": "2022-09-22T10:57:15.227Z",
"updatedAt": "2022-10-27T09:01:50.487Z",
"starkKey": "0x735247afda7cb58e02d1522678369b1879d909e046678f9fd323f5425f35314",
"uri": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc/5",
"assetType": "MINTABLE_ERC721",
"tokenId": "5",
"tokenAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"status": "MINTED",
"name": "EverydaySHEROE #234",
"description": "234",
"imageUrl": null,
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 82,
"metadata": {},
"metadataOptional": {
"image": "https://ipfs.moralis.io:2053/ipfs/Qmbcm3o2obZbn9VFiw2zcswQfCxhmQVrAcrrBS8sGfyWC7/234.jpeg",
"attributes": [
{
"lips": "BROWN",
"skin": "Blue",
"trait_type": "Category"
},
{
"value": 2,
"trait_type": "Edition"
},
{
"state": "FLORIDA",
"trait_type": "State"
}
],
"description": "234",
"externalUrl": ""
},
"creatorStarkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "98c73a99-5e1e-4562-84e4-e1683c72e962",
"assetMintId": "0x400136c5deac8dc5002183b39bfa4cf87ae2c7adc8d79f10ad04f613ab71c17",
"transactionId": 68634,
"views": "173",
"collection": {
"id": 82,
"createdAt": "2022-09-22T10:55:00.375Z",
"updatedAt": "2022-09-22T10:55:00.375Z",
"name": "EverydaySHEROE",
"collectionImageUrl": null,
"description": "EverydaySHEROE COllection description",
"iconUrl": null,
"contractAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"ownerPublicKey": "0x488a8ca56f29bfbe28e6f4cf898d5c3c1455deda",
"metadataApiUrl": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc",
"starkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "6d7fbacf-7710-4471-8ad9-61ead4bd1737",
"isHot": false,
"metadataSchema": [],
"project": {
"name": "Kaizen",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"order": [
{
"id": 766,
"createdAt": "2022-09-30T09:53:04.985Z",
"updatedAt": "2022-09-30T09:53:05.594Z",
"assetRefId": 1862,
"orderType": "SELL",
"status": "ACTIVE",
"expiredAt": "2034-09-30T09:00:00.000Z",
"fees": [
{
"address": "0xaf96126b89f64603d49e52794a9a0ade19ae3e96",
"feeType": "ROYALTY",
"percentage": 2
}
],
"includeFees": true,
"assetIdSell": "0x400136c5deac8dc5002183b39bfa4cf87ae2c7adc8d79f10ad04f613ab71c17",
"vaultIdSell": 116932,
"amountSell": "1",
"nonQuantizedAmountSell": "1",
"assetIdBuy": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6",
"vaultIdBuy": 84714,
"amountBuy": "98000000",
"amountBuyNonFee": null,
"nonQuantizedAmountBuy": "1",
"starkKey": "0x735247afda7cb58e02d1522678369b1879d909e046678f9fd323f5425f35314",
"nonce": 60,
"orderRequestId": "0x735247afda7cb58e02d1522678369b1879d909e046678f9fd323f5425f35314#60",
"starkSignature": {
"r": "0x154723c28c19d336e494d704e92efc55807d353ee4fdbe7cbed663e6871889b",
"s": "0x192dcf8a7d951e04ee1703622b76ef3b53dd818e5ba3cbdc3ce5148a5066372"
},
"__entity": "OrderEntity",
"amountSellUsd": 1202.89,
"amountBuyUsd": 117883220000.00002
}
],
"__entity": "AssetEntity",
"creator": {
"name": "Kaizen",
"starkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872"
}
}
],
"meta": {
"totalItems": 2,
"itemCount": 2,
"itemsPerPage": 10,
"totalPages": 1,
"currentPage": 1
},
"links": {
"first": "http://localhost:8081/v1/assets/collection-id/82?limit=10",
"previous": "",
"next": "",
"last": "http://localhost:8081/v1/assets/collection-id/82?page=1&limit=10"
},
"owner": {
"signature": {
"r": "0x56957ce3163a913177cc705afc5d7c0605309f0dbd5e7a61af893880b884593",
"s": "0xee1654900754b3ab766be06b9168f4c5eaea25013a3fedb2f75744699d003c"
},
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"ethAddress": "0x543c1e9873a17954b57d414028c8f9372476bd5f"
}
}
}
getAssetEqualMetadataById()
Returns full into about assets by a given Stark Key.
Parameters
QueryEqualMetadataNftAssetParams
object that contains theassetId
parameter
Returns
Returns an object with response call status and the data
object that contains an items
array of assets with the same metadata.
getAssetEqualMetadataById(payload: QueryEqualMetadataNftAssetParams): Promise<APIResponseType<CommonPaginateDataTypes<NftAssetEqualMetadataResponse>> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, QueryEqualMetadataNftAssetParams, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const payload: QueryEqualMetadataNftAssetParams = {
assetId: ASSET_ID
}
const assetsResponse = await assetManager.getAssetEqualMetadataById(payload);
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
NftAssetEqualMetadataResponse
{
"status": "success",
"data": {
"items": [
{
"id": 1862,
"createdAt": "2022-09-22T10:57:15.227Z",
"updatedAt": "2022-10-27T09:01:50.487Z",
"starkKey": "0x735247afda7cb58e02d1522678369b1879d909e046678f9fd323f5425f35314",
"uri": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc/5",
"assetType": "MINTABLE_ERC721",
"tokenId": "5",
"tokenAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"status": "MINTED",
"name": "EverydaySHEROE #234",
"description": "234",
"imageUrl": null,
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 82,
"metadata": {},
"metadataOptional": {
"image": "https://ipfs.moralis.io:2053/ipfs/Qmbcm3o2obZbn9VFiw2zcswQfCxhmQVrAcrrBS8sGfyWC7/234.jpeg",
"attributes": [
{
"lips": "BROWN",
"skin": "Blue",
"trait_type": "Category"
},
{
"value": 2,
"trait_type": "Edition"
},
{
"state": "FLORIDA",
"trait_type": "State"
}
],
"description": "234",
"externalUrl": ""
},
"creatorStarkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "98c73a99-5e1e-4562-84e4-e1683c72e962",
"assetMintId": "0x400136c5deac8dc5002183b39bfa4cf87ae2c7adc8d79f10ad04f613ab71c17",
"transactionId": 68634,
"views": "173",
"order": [
{
"id": 766,
"createdAt": "2022-09-30T09:53:04.985Z",
"updatedAt": "2022-09-30T09:53:05.594Z",
"assetRefId": 1862,
"orderType": "SELL",
"status": "ACTIVE",
"expiredAt": "2034-09-30T09:00:00.000Z",
"fees": [
{
"address": "0xaf96126b89f64603d49e52794a9a0ade19ae3e96",
"feeType": "ROYALTY",
"percentage": 2
}
],
"includeFees": true,
"assetIdSell": "0x400136c5deac8dc5002183b39bfa4cf87ae2c7adc8d79f10ad04f613ab71c17",
"vaultIdSell": 116932,
"amountSell": "1",
"nonQuantizedAmountSell": "1",
"assetIdBuy": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6",
"vaultIdBuy": 84714,
"amountBuy": "98000000",
"amountBuyNonFee": null,
"nonQuantizedAmountBuy": "1",
"starkKey": "0x735247afda7cb58e02d1522678369b1879d909e046678f9fd323f5425f35314",
"nonce": 60,
"orderRequestId": "0x735247afda7cb58e02d1522678369b1879d909e046678f9fd323f5425f35314#60",
"starkSignature": {
"r": "0x154723c28c19d336e494d704e92efc55807d353ee4fdbe7cbed663e6871889b",
"s": "0x192dcf8a7d951e04ee1703622b76ef3b53dd818e5ba3cbdc3ce5148a5066372"
},
"__entity": "OrderEntity",
"amountSellUsd": 1273.17,
"amountBuyUsd": 124770660000
}
],
"__entity": "AssetEntity"
},
{
"id": 1864,
"createdAt": "2022-09-22T10:57:24.311Z",
"updatedAt": "2022-11-01T10:59:30.398Z",
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"uri": "https://ipfs.moralis.io:2053/ipfs/QmdCMf4w2AYQTuSDmhMSWBYqnsUt1YvtTy4uAM3ZYbNyYc/7",
"assetType": "MINTABLE_ERC721",
"tokenId": "7",
"tokenAddress": "0xd57b8c6c518b1f81d3e321d916db57bf845a2686",
"status": "MINTED",
"name": "EverydaySHEROE #218",
"description": "218",
"imageUrl": null,
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 82,
"metadata": {},
"metadataOptional": {
"image": "https://ipfs.moralis.io:2053/ipfs/Qmbcm3o2obZbn9VFiw2zcswQfCxhmQVrAcrrBS8sGfyWC7/218.jpeg",
"attributes": [
{
"lips": "BROWN",
"skin": "Blue",
"trait_type": "Category"
},
{
"value": 2,
"trait_type": "Edition"
},
{
"state": "FLORIDA",
"trait_type": "State"
}
],
"description": "218",
"externalUrl": ""
},
"creatorStarkKey": "0x6f2ee28f45bee2d20f14a371d3f3a0b862accf1db4219f4b20de71f6cbaa872",
"publicId": "bc744995-ad78-44b4-8129-bcaeafcac5e2",
"assetMintId": "0x400347cb98dcbcd11c440713ab140f2d865b41bb0cb1456298f961c087efaef",
"transactionId": 68636,
"views": "191",
"order": [
{
"id": 363,
"createdAt": "2022-09-22T17:00:07.571Z",
"updatedAt": "2022-09-22T17:00:08.054Z",
"assetRefId": 1864,
"orderType": "SELL",
"status": "ACTIVE",
"expiredAt": "2034-09-22T17:00:00.000Z",
"fees": [
{}
],
"includeFees": false,
"assetIdSell": "0x400347cb98dcbcd11c440713ab140f2d865b41bb0cb1456298f961c087efaef",
"vaultIdSell": 73671,
"amountSell": "1",
"nonQuantizedAmountSell": "1",
"assetIdBuy": "0xb333e3142fe16b78628f19bb15afddaef437e72d6d7f5c6c20c6801a27fba6",
"vaultIdBuy": 73665,
"amountBuy": "1000000000000",
"amountBuyNonFee": null,
"nonQuantizedAmountBuy": "10000",
"starkKey": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452",
"nonce": 40,
"orderRequestId": "0x6ae765f79e7e5010306b24109e63dd9882517505c2f319f6e10cd9041f29452#40",
"starkSignature": {
"r": "0x6c3f11ab423d6b3600131bb9a021b537e5e21757285c5be3c47ae91c3e40a92",
"s": "0x6c65dbe70a041ccbd6c6995c1b4c07258198ef121ef51274f53c5a9ca4f9b84"
},
"__entity": "OrderEntity",
"amountSellUsd": 1273.17,
"amountBuyUsd": 1273170000000000
}
],
"__entity": "AssetEntity"
}
],
"meta": {
"totalItems": 2,
"itemCount": 2,
"itemsPerPage": 10,
"totalPages": 1,
"currentPage": 1
},
"links": {
"first": "http://localhost:8081/v1/assets/1861/equal-metadata?limit=10",
"previous": "",
"next": "",
"last": "http://localhost:8081/v1/assets/1861/equal-metadata?page=1&limit=10"
}
}
}
getAssetVaultDetails()
Returns details about the vault to which the asset belongs.
Parameters
starkKey
- Stark Key, has to start with0x
assetId
- a hexadecimal value of the asset, combined fromtokenId
+tokenAddress
Returns
Returns an object with response call status and the data
object that contains information about the vault to which the asset belongs.
getAssetVaultDetails(starkKey: string, assetId: string): Promise<APIResponseType<AssetVaultDetailsResponseAPI> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.getAssetVaultDetails("STARK_KEY", "ASSET_ID");
console.log(JSON.stringify(assetsResponse, null, 2));
})();
Response
AssetVaultDetailsResponseAPI
{
"status": "success",
"data": {
"tokenId": "36",
"vaultId": 85218,
"assetType": "0x322790a1378be74646101c816feefa381765a5d5d7d7c25d1884b4ce06ac603",
"quantum": "1",
"createdAt": 1664339370909,
"tokenType": "MINTABLE_ERC721",
"quantizedAmount": "1",
"tokenAddress": "0xa1976c7214f76f8e094517df4c002f100a1e58d9",
"assetId": "0x400663ffc30c382646de8ba441bef0432e915d25d645911c3d76b819bdca0cf",
"updatedAt": 1664862277900,
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"id": "87eacb07-3c8d-415b-9489-16f5c6c96315"
}
}
refreshAssetMetadata()
Refreshes metadata of a given asset.
Parameters
assetId
- asset id, unique identifier of the asset on the Myria networkstarkKey
- Stark Key, has to start with0x
Returns
Returns an object with response call status and the data
object that contains information about the asset.
refreshAssetMetadata(assetId: string, starkKey: string): Promise<APIResponseType<AssetDetailsResponse> | undefined>;
Example
- Typescript
import { IMyriaClient, ModuleFactory, MyriaClient, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const iClient: IMyriaClient = {
provider: null,
networkId: null,
web3: null,
env: env
};
const mClient = new MyriaClient(iClient);
const moduleFactory = new ModuleFactory(mClient);
const assetManager = moduleFactory.getAssetOnchainManager();
const assetsResponse = await assetManager.refreshAssetMetadata("ASSET_ID", "STARK_KEY");
console.log(JSON.stringify(syncAssets, null, 2));
})();
Response
AssetDetailsResponse
{
"status": "success",
"data": {
"id": 13287,
"createdAt": "2022-09-28T04:29:30.686Z",
"updatedAt": "2022-11-15T05:57:23.968Z",
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"uri": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj/36",
"assetType": "MINTABLE_ERC721",
"tokenId": "36",
"tokenAddress": "0xa1976c7214f76f8e094517df4c002f100a1e58d9",
"status": "MINTED",
"name": "Troll Assassin 09",
"description": "The ninth puzzle of Troll Assassin",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/visionaries/visionaries-09.png",
"animationUrl": null,
"animationUrlMimeType": null,
"collectionId": 6,
"metadata": {},
"metadataOptional": {
"description": "The ninth puzzle of Troll Assassin",
"externalUrl": "",
"image": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/visionaries/visionaries-09.png",
"imageUrl": "https://gateway.pinata.cloud/ipfs/QmQrT18jMqdZQ7QUiMoaLucZh2yWiuFVCJpjwhdKdrc7vk/visionaries/visionaries-09.png",
"attributes": [
{
"trait_type": "Race",
"value": "Protectors"
},
{
"trait_type": "Art Stage",
"value": "Sketch"
}
],
"race": "Protectors",
"artStage": "Sketch"
},
"creatorStarkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"publicId": "7bfd328e-35f0-4187-8104-8ebb74ad2d5b",
"assetMintId": "0x400663ffc30c382646de8ba441bef0432e915d25d645911c3d76b819bdca0cf",
"transactionId": 80288,
"views": "0",
"collection": {
"id": 6,
"createdAt": "2022-09-06T06:40:12.983Z",
"updatedAt": "2022-09-30T10:57:09.610Z",
"name": "Buidlers Universe 4",
"collectionImageUrl": "https://admin-tools-assets-staging.s3.amazonaws.com/tapet12.png",
"description": "A fourth collection of the Buidlers universe",
"iconUrl": "https://admin-tools-assets-staging.s3.amazonaws.com/banner.jpeg",
"contractAddress": "0xa1976c7214f76f8e094517df4c002f100a1e58d9",
"ownerPublicKey": "0xc5e958cffd97a47783a74074940a1b2989b8bf57",
"metadataApiUrl": "https://gateway.pinata.cloud/ipfs/QmRxVjXonWNeBbzLavVGJgNThARF7JTJXYddRMFFvyEiwj",
"starkKey": "0x775ec39911758a8234fb76392914e1c2fb2bd804d82ca0a9dbe55ca8e4f4685",
"publicId": "7d39ae45-2ff6-4bea-bb4c-25130d1060a7",
"isHot": false,
"metadataSchema": [],
"project": {
"id": 2,
"createdAt": "2022-09-06T05:26:24.857Z",
"updatedAt": "2022-10-06T05:33:04.445Z",
"name": "Project XYZ",
"companyName": "Myria Staging",
"contactEmail": "test@myria.com",
"collectionLimitExpiresAt": "2022-11-03T06:33:16.693Z",
"collectionMonthlyLimit": 5,
"collectionRemaining": 4,
"mintLimitExpiresAt": null,
"mintMonthlyLimit": 50000,
"mintRemaining": 49957,
"publicId": "17ca4116-e191-41f2-a969-1bb27b04e7e2",
"__entity": "ProjectEntity"
},
"__entity": "CollectionEntity"
},
"__entity": "AssetEntity"
}
}