Minting Reference
This document is a reference to the Minting module of the Myria Core SDK. The module contains information about Myria mint transactions.
Interfaces
MintERC721Params
Data structure passed to createMintTransactionERC721() method, which contains required data to create a new ERC721 mint transaction.
interface MintERC721Params {
starkKey: string;
contractAddress: string;
uri: string;
tokenId: string;
description?: string;
fees: [
{
percentage: number;
receiptAddress: string;
feeType: FeeType;
}
];
}
Attributes
starkKey
- Stark Key, has to start with0x
contractAddress
- contract address used to withdraw assets to the Ethereum networkuri
- URL path to the mintable asset metadatatokenId
- unique identifier of a given asset, should be an incremental numeric value starting from 1description
- description of a given assetfees
- an array of fees details for a given asset. FeeType accepts:ROYALTY
,TAKER
,MAKER
,PROTOCOL
MintERC721Response
Data structure returned by the createMintTransactionERC721() method.
interface MintERC721Response {
status: string;
data: any;
}
Attributes
status
- response status: success, faildata
- response data
GetMintedTransactionParams
Data structure passed to getMintTransactionList() method, which contains required parameters to get details of a given minted transaction.
interface GetMintedTransactionParams {
transactionId: number;
}
Attributes
transactionId
- unique id of a minted transaction
GetMintedTransactionResponse
Data structure passed to getMintTransactionList() method, which contains required data to get details of the minted asset.
interface GetMintedTransactionResponse {
status: string;
data: {
data: string;
updatedAt: number;
vaultId: number;
transactionStatus: string;
createdAt: number;
starkKey: string;
transactionId: number;
transactionType: string;
batchId: number;
quantizedAmount: string;
assetId: string;
};
}
Attributes
status
- response status: success, failuredata
- response dataupdatedAt
- date of the latest transaction updatevaultId
- vault idtransactionStatus
- transaction statuscreatedAt
- date of transaction creationstarkKey
- Stark Key, has to start with0x
transactionId
- unique transaction idtransactionType
- transaction typebatchId
- batch idquantizedAmount
- quantized amountassetId
- unique asset id
GetMintedAssetsParams
Data structure passed to getMintedAssetByStarkKey() method, which contains required parameters to get a list of minted assets.
interface GetMintedAssetsParams {
starkKey: string;
}
Attributes
starkKey
- Stark Key, has to start with0x
GetMintedAssetsResponse
Data structure returned by the getMintedAssetByStarkKey() method.
interface GetMintedStarkKeyResponse {
status: string;
}
Attributes
status
- response status: success, faildata
- response data
Methods
createMintTransactionERC721()
Creates a mint transaction of an ERC721 asset.
createMintTransactionERC721(data: MintERC721Params): Promise<MintERC721Response | undefined>;
Parameters
- MintERC721Params object
Returns
Returns an object with response call status and the data
object that contains details of the mint transaction.
Example
- Typescript
import { MintingManager, MintERC721Params, MintERC721Response, FeeType, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const mintingManager: MintingManager = new MintingManager(env);
const params: MintERC721Params = {
starkKey: "STARK_KEY",
contractAddress: "CONTRACT_ADDRESS",
uri: "TOKEN_URI",
tokenId: "TOKEN_ID",
description: "DESCRIPTION",
royalties: [
{
percentage: 10,
receiptAddress: "ROYALTY_RECIPIENT_ADDRESS",
},
],
};
const mintTransactionResponse: MintERC721Response | undefined =
await mintingManager.createMintTransactionERC721(params);
})();
Note, the default value for the ROYALTY_RECIPIENT_ADDRESS
is the collection creator address.
Response
MintERC721Response
{
"asset": {
"uri": "https://gateway.pinata.cloud/ipfs/QmSjWbBS3rPu5K2TnhyXmwGE1GcVZMRFKg5K3iMLGca1m8/1",
"starkKey": "0x7fe1b18d74145afd74c0b84b693c9e8eb4de49a3972743f4cd2fbfc3904e9cb",
"assetType": "MINTABLE_ERC721",
"tokenId": "1",
"tokenAddress": "0x3bb911f179f34aac30ef4e175f57dedf49312cb7",
"status": "MINTED",
"description": "Asset X",
"collectionId": 39,
"creatorStarkKey": "0x7fe1b18d74145afd74c0b84b693c9e8eb4de49a3972743f4cd2fbfc3904e9cb",
"updatedAt": "2022-08-17T04:11:27.763Z",
"name": "mto1",
"imageUrl": null,
"animationUrl": null,
"animationUrlMimeType": null,
"assetMintId": "0x400d7f08c2bd93fded45000d55f20a1eb52a8d90c6912a1315533179219937c",
"transactionId": 39026,
"id": 26149,
"createdAt": "2022-08-17T04:11:26.013Z",
"metadata": {},
"metadataOptional": {
"description": "MT Original 1",
"externalUrl": "",
"image": "https://gateway.pinata.cloud/ipfs/Qmae3dbyXos21g7oSeK3g4C7GyhSV8pxXrkWFmekgaMLPt",
"attributes": [
{
"trait_type": "Category",
"value": "Silver"
},
{
"trait_type": "Edition",
"value": 1
},
{
"trait_type": "Level",
"value": 1
}
]
},
"publicId": "74eab8f4-b68d-410c-a8f6-513a05b2d135"
},
"transaction": {
"tokenType": "MINTABLE_ERC721",
"vaultId": 54424,
"quantizedAmount": "1",
"starkKey": "0x7fe1b18d74145afd74c0b84b693c9e8eb4de49a3972743f4cd2fbfc3904e9cb",
"transactionCategory": "MintRequest#0x3bb911f179f34aac30ef4e175f57dedf49312cb7#1",
"transactionId": 39026,
"transactionType": "MintRequest",
"transactionStatus": "Prepare",
"createdAt": 1660709487350,
"tokenAddress": "0x3bb911f179f34aac30ef4e175f57dedf49312cb7",
"assetType": "0x23d90e1e5140402f246c683dcd6c3d6876968ff03c0187eddc9c255b3a0f4c5",
"assetId": "0x400d7f08c2bd93fded45000d55f20a1eb52a8d90c6912a1315533179219937c",
"tokenId": "1",
"quantum": "1",
"blueprint": "https://gateway.pinata.cloud/ipfs/QmSjWbBS3rPu5K2TnhyXmwGE1GcVZMRFKg5K3iMLGca1m8/1",
"nonce": 1,
"environment": "staging"
}
}
getMintTransactionList()
Returns details of the minted asset by a given transaction id.
getMintTransactionList(data: GetMintedTransactionParams): Promise<GetMintedTransactionResponse>;
Parameters
- GetMintedTransactionParams object
Returns
Returns an object with response call status and the data
object that contains details of the minted asset.
Example
- Typescript
import { MintingManager, GetMintedTransactionParams, GetMintedTransactionResponse, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const mintingManager: MintingManager = new MintingManager(env);
const params: GetMintedTransactionParams = {
transactionId: TRANSACTION_ID,
};
const mintTransactionResponse: GetMintedTransactionResponse | undefined =
await mintingManager.getMintTransactionList(params);
})();
Response
GetMintedTransactionResponse
{
"status": "success",
"data": {
"environment": "staging",
"tokenId": "1",
"vaultId": 54424,
"assetType": "0x23d90e1e5140402f246c683dcd6c3d6876968ff03c0187eddc9c255b3a0f4c5",
"transactionStatus": "Success",
"quantum": "1",
"createdAt": 1660709487350,
"tokenType": "MINTABLE_ERC721",
"transactionId": 39026,
"transactionType": "MintRequest",
"quantizedAmount": "1",
"tokenAddress": "0x3bb911f179f34aac30ef4e175f57dedf49312cb7",
"assetId": "0x400d7f08c2bd93fded45000d55f20a1eb52a8d90c6912a1315533179219937c",
"updatedAt": 1660710180241,
"nonce": 1,
"starkKey": "0x7fe1b18d74145afd74c0b84b693c9e8eb4de49a3972743f4cd2fbfc3904e9cb",
"transactionCategory": "MintRequest#0x3bb911f179f34aac30ef4e175f57dedf49312cb7#1",
"blueprint": "https://gateway.pinata.cloud/ipfs/QmSjWbBS3rPu5K2TnhyXmwGE1GcVZMRFKg5K3iMLGca1m8/1"
}
}
getMintedAssetByStarkKey()
Returns a list of minted assets by a given Stark Key.
getMintedAssetByStarkKey(data: GetMintedAssetsParams): Promise<GetMintedAssetsResponse>;
Parameters
- GetMintedAssetsParams object
Returns
Returns an object with response call status and the data
object that contains a list of minted assets by a given Stark Key.
Example
- Typescript
import { MintingManager, GetMintedTransactionParams, GetMintedTransactionResponse, EnvTypes } from "myria-core-sdk";
(async (): Promise<void> => {
// STAGING or PRODUCTION
const env = EnvTypes.STAGING;
const mintingManager: MintingManager = new MintingManager(env);
const params: GetMintedAssetsParams = {
starkKey: "STARK_KEY",
};
const mintStarkKeyResponse: GetMintedAssetsResponse | undefined =
await mintingManager.getMintedAssetByStarkKey(params);
})();
Response
GetMintedAssetsResponse
{
"status": "success",
"data": [
{
"environment": "staging",
"tokenId": "1",
"assetType": "0x23d90e1e5140402f246c683dcd6c3d6876968ff03c0187eddc9c255b3a0f4c5",
"vaultId": 54424,
"quantum": "1",
"transactionStatus": "Success",
"createdAt": 1660709487350,
"tokenType": "MINTABLE_ERC721",
"transactionId": 39026,
"transactionType": "MintRequest",
"quantizedAmount": "1",
"tokenAddress": "0x3bb911f179f34aac30ef4e175f57dedf49312cb7",
"assetId": "0x400d7f08c2bd93fded45000d55f20a1eb52a8d90c6912a1315533179219937c",
"updatedAt": 1660710180241,
"nonce": 1,
"starkKey": "0x7fe1b18d74145afd74c0b84b693c9e8eb4de49a3972743f4cd2fbfc3904e9cb",
"transactionCategory": "MintRequest#0x3bb911f179f34aac30ef4e175f57dedf49312cb7#1",
"blueprint": "https://gateway.pinata.cloud/ipfs/QmSjWbBS3rPu5K2TnhyXmwGE1GcVZMRFKg5K3iMLGca1m8/1"
}
]
}