📑Create SmartContract

Create a new SmartContract

Endpoint

POST /v1/smart-contract

Authentication

API key is required in the headers.

Request Body

ParameterTypeDescriptionRequired

name

string

The name of the SmartContract.

description

string

The description of the SmartContract.

symbol

string

The symbol of the SmartContract.

maxNFTs

number

The maximum number of NFTs that can be created.

walletOwner

string

The address of the wallet owner for the SmartContract.

configuration

object

Additional configuration settings for the SmartContract. See Configuration.

blockchain

number

Blockchain choosen.

standard

string

Values "ERC_721" | "ERC_1155"

attributes

object

Custom details for the SmartContract.

Configuration Object:

ParameterTypeDescriptionRequired

percentFees

number

The percentage fees for the SmartContract creator (could be zero).

uniqueImage

string

Image url for all NFTs.

folderImages

string

Image used by all NFTs. Each image in the folder must be named <number>.<extension>. Example: 0.png.

mintPrice

boolean

Indicates if the minting price can be changed for the SmartContract

marketPausable

boolean

Indicates if the market is pausable for the SmartContract.

marketBlocked

boolean

Indicates if the market is blocked for the SmartContract.

burnNFTs

boolean

Indicates if NFTs can be burned for the SmartContract.

transferPausable

boolean

Indicates if NFT transfers are pausable for the SmartContract.

dynamicsNFTs

boolean

Indicates if the SmartContract supports dynamic NFTs.

dynamicSupply

boolean

Indicates if the SmartContract supports dynamic supply.

Attributes Object

ParameterTypeDescription

key

string

Key of the dict

value

string

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

Status: 200 OK
{
  "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