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
Parameter | Description |
---|---|
HM_ACCESS_KEY | HyperMint Access Key |
HM_ACCESS_KEY_SECRET | HyperMint Access Key Secret |
Body
Parameter | Type | Description |
---|---|---|
name | string | name of the contract |
network | object | Please See CreateNFTNetworkRequest interface below for details |
symbol | string | Symbol for the contract |
allowBuyOnNetwork | boolean | Allow for users to be able to buy the NFTs directly through their crypto wallets on network. |
metadata | object | Please See CreateNFTContractMetadataRequest Interface below for details |
publicSaleAt | date | Date format is YYYY-MM-DDTHH:mm:ss.sssZ |
saleCloseAt | date | Date format is YYYY-MM-DDTHH:mm:ss.sssZ |
secondarySaleBasisPoints | number | Note: one basis point = 0.01% and ten thousand basis points = 100% |
erc721Price | number | Price of the token in ETH |
erc721MaxPerTransaction | number | Max tokens that can be purchased in a single transaction |
allowBuyWithMoonPay | boolean | Allows end users to purchase with fiat via MoonPay Checkout which requires an account in the MoonPay Dashboard |
enableOpenSeaOperatorFilterRegistry | boolean | When enabled tokens can only be traded on marketplaces which enforce secondary royalties |
Responses
Code | Meaning |
---|---|
🟢 200: OK | Response with contractId which is used later to deploy (see below) |
🟠 400: Bad Request | The request sent was malformed or did not pass as a valid contract creation request. The error message should explain what happened. |
🟠 404: Not Found | The 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.
Updated 9 months ago
What’s Next