Non-Fungible token
Get Smart Contract list
Retrieves all smart contract records for an organization.
GET
API_URL/api/certificate/get-smart-contract
HEADERS
client_id 9b16ae5638534ae1961fb370f874b6cc
client_secret sk_9b16ae5638534ae1961fb370f874b6cc
content-type application/json
{
"status": 200,
"result": [
{
"contract_address": "0x74f558bDcC18F56042B811f91...",
"transactionHash": "0x000807941722a178dc6f4e185...",
"contract_name": "Test NFT",
"logo": null,
"name": "Test NFT",
"symbol": "TESTNFT"
}
],
"pagination": {
"current_page": 1,
"first_page_url": "https://service-testnet.maschain.com/api/certificate/get-smart-contract?page=1",
"last_page": 1,
"last_page_url": "https://service-testnet.maschain.com/api/certificate/get-smart-contract?page=1",
"next_page_url": null,
"per_page": 100,
"prev_page_url": null,
"total": 7
}
}
Get Smart Contract by contract address
Retrieves all smart contract records for an organization.
GET
API_URL/api/certificate/get-smart-contract/{id}
HEADERS
client_id 9b16ae5638534ae1961fb370f874b6cc
client_secret sk_9b16ae5638534ae1961fb370f874b6cc
content-type application/json
{
"status": 200,
"result": {
"contract_address": "0xcfeEfA3684d...",
"contract_name": "Contract 1",
"transactionHash": "0x151f2f1821cf0ef5ec8772854b...",
"logo": null,
"name": "CONTRACT1",
"symbol": "CONTRACT1"
}
}
Create Smart Contract
Create New NFT Smart Contract to MasChain with fields. You may also create this smart contract in the portal.
POST
API_URL/api/certificate/create-smartcontract
HEADERS
client_id 9b16ae5638534ae1961fb370f874b6cc
client_secret sk_9b16ae5638534ae1961fb370f874b6cc
content-type application/json
BODY
| Name | Type | Required |
|---|---|---|
| wallet_address | string | Yes |
| name | string | Yes |
| field | object | Yes |
| callback_url | string | No |
| image | string | No |
- wallet_address is used to deploy this smart contract and it can set a different or separate owner for this contract in the ownerAddress field. Be careful to set a proper owner address.
- name is just to give a nickname for the smart contract.
- field is an object that contains the required properties to create this smart contract.
- wallet_address_owner : owner of the smart contract
- max_supply : Total maximum supply of NFT ( max 2^256 ) *Put 0 for unlimited supply
- name : Name of the NFT
- symbol : Symbol of the NFT
- image A base64 image with max size of 0.5mb
- callback_url response after data is minted into blockchain
**IMPORTANT : Only Owner can mint NFT
{
"wallet_address":"0x3423BF219008A8D6b644b79.....", //Address used to deploy this contract
"name" : "NFT2", //Contract Nickname
"field":{
"wallet_address_owner":"0x3423BF219008A8D6b644b79.....", //Owner of the NFT contract
"max_supply":1000, //Maximum supply
"name":"MasChain", //Name of NFT
"symbol":"MT" //NFT Symbol
},
"image": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAA..."
"callback_url": "https://postman-echo.com/post?"
}
{
"status": 200,
"result": {
"status": "pending",
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...."
}
}
{
"status": 200,
"result": {
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...",
"nonce": 752,
"from": "0x147f20a28739da15419AdC0...",
"status": "success"
"receipt" : { Transaction Receipt Object }
}
}
{
"status": 200,
"result": {
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...",
"nonce": 752,
"from": "0x147f20a28739da15419AdC0...",
"status": "failed"
"message": "Error message"
}
}
Mint NFT
Mint NFT by contract_address and storing it in MasChain.
POST
Maximum 1 MB
API_URL/api/certificate/mint-certificate
Maximum 10 MB
API_URL/api/certificate/mint-certificate-small
Maximum 30 MB
API_URL/api/certificate/mint-certificate-medium
Maximum 100 MB
API_URL/api/certificate/mint-certificate-large
HEADERS
client_id 9b16ae5638534ae1961fb370f874b6cc
client_secret sk_9b16ae5638534ae1961fb370f874b6cc
content-type multipart/form-data
body form-data
BODY ( form-data )
| Name | Type | Required |
|---|---|---|
| wallet_address | string | Yes |
| to | string | Yes |
| contract_address | string | Yes |
| file | file | Yes |
| attributes | json | No |
| name | string | Yes |
| description | string | Yes |
| callback_url | string | Yes |
NOTE : Attributes fields can be empty or many
wallet_address : 0x3423BF219008A8D6b644b79.....
to : 0xbD8992F758B4429b92D1Afc1b53aB5Bc16bD8475
contract_address : 0xb988C69344505faf6F804A7bfcC7c81FdFb59B4c
file : upload an image
attributes : [{"trait":"New Cert","value":"10001"},{"Student":"yes","value":"Chan"}]
name : NFT CERT
description : NFT CERT
callback_url : https://your.domain/
- wallet_address must be the owner of the smart contract.
- to is the receiver of the NFT.
- contract_address is the NFT contract address.
- attributes is the additional attribute of a NFT being minted. Could be none and not required. Also no limitation.
- name name of the NFT being minted.
- file max size of 1mb
- description description of the NFT being minted.
- callback_url response after data is minted into blockchain
{
"status": 200,
"result": {
"nft_token_id": 17,
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...",
"nonce": 752,
"from": "0x147f20a28739da15419AdC0...",
"receiver_wallet_address": "0x147f20a28739da15419AdC0...",
"organisation_id": 2,
"certificate": "https://storage.maschain.con/....../metadata/1.json",
"certificate_image": "https://storage.maschain.con/....../image/example_image.pdf",
"status": "pending"
}
}
{
"status": 200,
"result": {
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...",
"nonce": 752,
"from": "0x147f20a28739da15419AdC0...",
"status": "success"
"receipt" : { Transaction Receipt Object }
}
}
{
"status": 200,
"result": {
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...",
"nonce": 752,
"from": "0x147f20a28739da15419AdC0...",
"status": "failed"
"message": "Error message"
}
}
Transfer NFT
Transfer your NFT to another wallet
POST
API_URL/api/certificate/transfer
HEADERS
client_id 9b16ae5638534ae1961fb370f874b6cc
client_secret sk_9b16ae5638534ae1961fb370f874b6cc
content-type application/json
BODY
| Name | Type | Required |
|---|---|---|
| wallet_address | string | Yes |
| to | string | Yes |
| nft_id | string | Yes |
| contract_address | string | Yes |
| callback_url | string | Yes |
{
"wallet_address":"0x147f20a28739da1.....",
"to":"0xbD8992F758B4429b92D1Af....",
"contract_address":"0x4175a3EE7fbD167EAd1a.....",
"nft_id": "1",
"callback_url": "https://postman-echo.com/post?"
}
{
"status": 200,
"result": {
"nft_token_id": 17,
"transactionHash": "0xf519ba69ba0e603583e0e885786f5ad1...",
"nonce": 1,
"from": "0x147f20a28739da1...",
"receiver_wallet_address": "0xbD8992F758B4429b92D1Af...",
"organisation_id": 2,
"certificate": "https://storage.maschain.con/....../metadata/1.json",
"certificate_image": "https://storage.maschain.con/....../image/example_image.pdf",
"status": "pending"
}
}
Get NFT
Get NFT details. Parameter can be null.
GET
API_URL/api/certificate/get-certificate?from={address}&to={address}&contract_address={address}&transaction_id={tx_id}&status={status}