📑Create SmartContract
Create a new SmartContract
Endpoint
POST /v1/smart-contract
Authentication
API key is required in the headers.
Request Body
Parameter
Type
Description
Required
Configuration Object:
Parameter
Type
Description
Required
Attributes Object
Whichever value you need to add to the SmartContract metadata
Example
RAW
POST /v1/smart-contract
Headers:
API_KEY: YOUR_API_KEY
Content-Type: application/json
Body:
{
"maxNFTs": 100,
"name": "Collection Name",
"symbol": "TF0",
"blockchain": 1,
"standard": "ERC_1155",
"configuration": {
"percentFees" : 0,
"uniqueImage": "imageForAllNFTs.png",
"dateInitMint": "06-01-2022 09:00",
"dateEndMint": "07-01-2022 09:00",
"whiteList": true,
"dateInitWhiteList": "05-01-2022 09:00",
"dateEndWhiteList": "06-01-2022 08:00",
"marketBlocked": false;
"burnNFTs": true;
"transferPausable": true;
"dynamicsNFTs": true;
},
"attributes": [
{
"key": "Custom attributes off-chain",
"value": "Value of attribute"
}
]
}
Response
result
SmartContract information
error:
Error data if request fail
{
"result" : {
"walletOwner": "Ox00000000000000000000000",
"standard": "ERC_1155",
"maxNFTs": 100,
"name": "Collection Name",
"symbol": "TF0",
"nftsSigned": 0,
"nftsGenerated": 0,
"nftsMinted": 0,
"blockchain": 4,
"blockchainId": "80001",
"configuration": {
"feesMTM": 10,
"percentFees" : 0,
},
"attributes": [{
"key" : "Custom attributes off-chain",
"value" : "Value of attribute"
}],
"status": 0,
"_id": "632eda0dbe7cad29f89e5487",
"smartContractType": 3,
"smartContractCompiled" : "Ox00000 | Hex to sign Smart Contract",
},
"error" : null
}
CURL
curl --location --request POST 'http://api-testnet.minteando.me/v1/smart-contract' \
--header 'API_KEY: <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"maxNFTs": 100,
"name": "Collection Name",
"symbol": "Symbol Name",
"configuration" : {
"feesMTM": 10
},
"blockchain": 4,
"standard": "ERC_1155",
"attributes" : [
]
}'
Example Typescript (axios)
import axios from 'axios';
const API_KEY = 'YOUR_API_KEY';
const endpoint = 'http://api-testnet.minteando.me/v1/smart-contract';
// Request data
const requestData = {
name: 'ST3',
description: 'ST3',
symbol: 'ST3',
maxNFTs: '10',
walletOwner: '0x8f03a2f23d1A99ddad859f2405A7Dcc90a29E852',
configuration: {
percentFees: 0,
marketPausable: false,
marketBlocked: false,
burnNFTs: false,
transferPausable: false,
dynamicsNFTs: false,
dynamicSupply: false,
},
blockchain: 4,
standard: 'ERC-1155',
};
// Set request headers
const headers = {
API_KEY,
'Content-Type': 'application/json',
};
// Make the request
axios
.post(endpoint, requestData, { headers })
.then((response) => {
const responseData = response.data;
// Process the response data
console.log(responseData);
})
.catch((error) => {
console.error('Error:', error.message);
});
Example PHP
<?php
$apiKey = 'YOUR_API_KEY';
$endpoint = 'http://api-testnet.minteando.me/v1/smart-contract';
// Request data
$data = [
'name' => 'ST3',
'description' => 'ST3',
'symbol' => 'ST3',
'maxNFTs' => '10',
'walletOwner' => '0x8f03a2f23d1A99ddad859f2405A7Dcc90a29E852',
'configuration' => [
'percentFees' => 0,
'marketPausable' => false,
'marketBlocked' => false,
'burnNFTs' => false,
'transferPausable' => false,
'dynamicsNFTs' => false,
'dynamicSupply' => false
],
'blockchain' => 4,
'standard' => 'ERC-1155'
];
// Create request headers
$headers = [
'API_KEY: ' . $apiKey,
'Content-Type: application/json'
];
// Initialize cURL
$ch = curl_init();
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute the request
$response = curl_exec($ch);
// Check for errors
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
} else {
// Process the response
$responseData = json_decode($response, true);
// Do something with the response data
var_dump($responseData);
}
// Close cURL
curl_close($ch);
?>
Last updated