Mint SFTs (editions)
SFTs (semifungible tokens) follow the ERC1155 standard. Each token is a replica of a predefined template. Each collection (smart contract) can contain multiple templates, which can contain many tokens.
Note that Crossmint currently only supports SFTs on EVM chains.
To get started:
Step 1: Create a SFT collection
Create a collection to hold your templates:
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-client-secret: sk_test.xxxxxx' \
--header 'x-project-id: 123456-xxxx' \
--data '
{
"chain": "polygon",
"fungibility": "semi-fungible",
"metadata": {
"name": "My New Collection",
"imageUrl": "https://www.crossmint.com/assets/crossmint/logo.png",
"description": "A new collection with its own dedicated smart contract"
}
}
'
Response
{
"id": "00bfac36-8a8a-464d-86ed-063318f6aa8e",
"metadata": {
"name": "My New Collection",
"imageUrl": "ipfs://bafkreigbqsmxzkbjgbwtj6exfdt5z3t3swgoysf7hr6vjzddqnmykj6x2u",
"description": "A new collection with its own dedicated smart contract"
},
"fungibility": "semi-fungible",
"onChain": {
"chain": "polygon",
"type": "erc-1155"
}
}
Step 2: Create a template
Create templates within that collection:
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/[collectionId]/templates \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-client-secret: sk_test.xxxx' \
--header 'x-project-id: 123456-xxxx' \
--data '
{
"onChain": {
"tokenId": "2"
},
supply: {
limit: 10
},
"metadata": {
"name": "My template",
"image": "https://www.crossmint.com/assets/crossmint/logo.png",
"description": "A new token template for my ERC1155 collection"
}
}
'
Response:
{
"templateId": "58b0c1aa-e457-48dd-bb55-5a27e6a92f74",
"metadata": {
"name": "My template",
"image": "ipfs://bafkreigbqsmxzkbjgbwtj6exfdt5z3t3swgoysf7hr6vjzddqnmykj6x2u",
"description": "A new token template for my ERC1155 collection"
},
"onChain": {
"tokenId": "2"
},
"supply": {
"limit": "10",
"minted": "0"
}
}
Step 3: Mint an SFT from a Template
Mint SFTs from the template and send them to wallets or email addresses.
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/default/sfts \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-client-secret: sk_test.xxxxx' \
--header 'x-project-id: 123456-xxxx' \
--data '
{
"templateId": "58b0c1aa-e457-48dd-bb55-5a27e6a92f74",
"recipient": "email:u[email protected]:polygon",
"amount": 1
}
'
Example response
{
"transactionId": "20ed0963-0185-49af-b4a0-2de3169bb367"
}
All set!
To confirm delivery, call the Transaction status API or set up a webhook to receive notifications upon success.
Updated 21 days ago