Generate an NFT Contract
After creating an NFT collection and adding NFT items to it, you will generate a smart contract for the NFT collection, then deploy it.
To generate the NFT collection smart contract, you need to connect to MetaMask. Then, send a POST request to the /nft/<nft_collection_name>
endpoint, calling the :generateContract
method.
Generate the contract for an NFT.
POST
https://api.playfix.io/nft/<nft_collection_name>:generateContract
Path Parameters
nft_collection_name*
String
Name of the NFT collection. This will start with a prefix of "nfts/
" followed by a ULID.
Headers
Authorization*
String
Bearer <your_access_token>
Example Curl API Call
Example Python API Call
Response
This sample response is compressed.
Response Fields
contract
- An object containing the details of the NFT collection smart contract.source
- An object containing the source code of the smart contract.main
- source code of the main functionalities of the NFT collection contract.imports
- imported libraries and dependencies of the smart contract.
abi
: Method names, parameters and arguments, and data types that can be used to interact with the smart contract.bytecode:
The NFT collection contract in low-level binary.
Last updated