PUT: Create Draft Contract

Creates a contract on the HyperMint platform and places it in the "Draft" state. The Deploy Contract endpoint can then be used to deploy it onto the blockchain of choice.

https://api.hypermint.com/v1/nft-contract

Creates a Contract

Creates a contract on the HyperMint platform and places it in the "Draft" state.

Parameters

Header

ParameterDescription
HM_ACCESS_KEYHyperMint Access Key
HM_ACCESS_KEY_SECRETHyperMint Access Key Secret

Body

ParameterTypeDescription
namestringname of the contract
networkobjectPlease See CreateNFTNetworkRequest interface below for details
symbolstringSymbol for the contract
allowBuyOnNetworkbooleanAllow for users to be able to buy the NFTs directly through their crypto wallets on network.
metadataobjectPlease See CreateNFTContractMetadataRequest Interface below for details
publicSaleAtdateDate format is YYYY-MM-DDTHH:mm:ss.sssZ
saleCloseAtdateDate format is YYYY-MM-DDTHH:mm:ss.sssZ
secondarySaleBasisPointsnumberNote: one basis point = 0.01% and ten thousand basis points = 100%
erc721PricenumberPrice of the token in ETH
erc721MaxPerTransactionnumberMax tokens that can be purchased in a single transaction
allowBuyWithMoonPaybooleanAllows end users to purchase with fiat via MoonPay Checkout which requires an account in the MoonPay Dashboard
enableOpenSeaOperatorFilterRegistrybooleanWhen enabled tokens can only be traded on marketplaces which enforce secondary royalties

Responses

CodeMeaning
🟢 200: OKResponse with contractId which is used later to deploy (see below)
🟠 400: Bad RequestThe request sent was malformed or did not pass as a valid contract creation request. The error message should explain what happened.
🟠 404: Not FoundThe contract was not found
{
    id?: string;
}

Request and Object Interfaces

interface CreateNFTContractRequest {
    name: string;
    network: CreateNFTNetworkRequest;
    symbol: string;
    allowBuyOnNetwork: boolean;
    metadata: CreateNFTContractMetadataRequest;
    publicSaleAt?: Date; // Date Format is YYYY-MM-DDTHH:mm:ss.sssZ
    saleClosesAt?: Date; // Date Format is YYYY-MM-DDTHH:mm:ss.sssZ
    secondarySaleBasisPoints: number;
    erc721Price?: number; // Price in ETH
    erc721MaxPerTransaction?: number;
    allowBuyWithMoonPay?: boolean;
}

interface CreateNFTNetworkRequest {
    type: NetworkType;
    environment: NetworkEnvironment;
    chain: NetworkChain;
    // Address used to reclaim control of the contract from HM if desired in the future
    recoveryAddress: string;
    // Used when providing custom access list behavior via an external API
    presaleAddress?: string;
    customerPrimaryRoyaltyAddress: string;
    // Address show as the owner on marketplaces
    collectionOwnerAddress: string;
    contractType: NFTContractType;
    useManagedAccessList: boolean;
    usePrimarySaleSplitter?: boolean;
    //primarySaleSplitterId will be required if usePrimarySaleSplitter is set to true
    primarySaleSplitterId?: string;
    secondaryRoyaltyAddress: string;
    useSecondarySaleSplitter?: boolean;
    //secondarySaleSplitterId will be required if useSecondarySaleSplitter is set to true
    secondarySaleSplitterId?: string;
   
}

interface CreateNFTContractMetadataRequest {
    type: NFTContractMetadataType;
    contractUrl?: string;
    tokenUrl?: string;
    description?: string;
    externalLink?: string;
}

enum NetworkType {
    Ethereum = 'Ethereum',
    Polygon = 'Polygon'
}

enum NetworkEnvironment {
    Emulator = 'Emulator',
    Testnet = 'Testnet',
    Mainnet = 'Mainnet'
}

enum NFTContractType {
    ERC721 = 'ERC721',
    ERC1155 = 'ERC1155'
}

enum NetworkChain {
    EVMLocal = 'EVMLocal',
    Ethereum = 'Ethereum',
    Goerli = 'Goerli',
    Polygon = 'Polygon',
    Mumbai = 'Mumbai'
}

enum NFTContractMetadataType {
    None = 'None',
    Hosted = 'Hosted',
    Url = 'Url'
}

📘

You can use the Upload Contract Metadata Media endpoint to upload an image to your contract's metadata if you've selected Hosted as the metadata type

Feedback

Something not quite right, unclear or can't find what you are looking for? Please let us know at [email protected] and we will get back to you as soon as we can.