Minting SDK
Introduction
The minting SDK provides the most comprehensive and indepth route for minting a collection on the Aspen network. With a direct connection to the smart contracts that deal with minting tokens on the blockchain, but the web3 infrastructure and complexity abstracted away, Aspen's minting SDK allows you use knowledge from a language you already know to create new experiences in this brave new world of NFTs and web3.
If you plan to use the Aspen minting SDk, please get in contact with the team and we shall get back to you on authentication, how to deploy your minting contracts and other sundry activities to use the SDK.
Setting up the SDK
The first step to using the SDK is to make a pull from the GitHub repository to get sources.
$ git clone https://github.com/monax/aspen-publishing-sdk.git
$ cd aspen-publishing-sdk
Next, install the general dependencies
$ yarn install
Finally, go to the pkg/sdk
and create the types
files in Typescript from the contracts.
$ cd sdk
$ yarn generate
$ yarn build
$ yarn prettier
$ yarn lint
And you should be able to use the aspen minting SDK!
Example Code
If you are a javascript developer - specifically React, we have created a codebase of how you can integrate the minting SDK into your project. The code is available here and it could be a faster route to getting your project. Please find that hosted here
SDK Functions
The minting SDK exposes the following functions for integrating with our smart contracts
Function Name |
---|
CedarERC1155DropV0__factory |
CedarERC721DropV0__factory |
ICedarAgreementV0__factory |
ICedarAgreementV0__factory
The ICedarAgreementV0__factory
is the factory function need to check if the collector has accepted the terms of use before they can mint the token. As a necessary prerequisite, if the accept terms function is enabled, it allows the mint function to become inaccessible till accept terms are activated. A connection to the factory function will routinely require two of more of the following fields.
contractAddress | The address of the contract against which the mint of the tokens will be happening |
library.getSigner | the signed in |
nftContractAddress | the NFT address |
CedarERC1155DropV0factory and CedarERC721DropV0factory
Understanding the Factory Functions
The two function factories provides the collectors ability to mint your tokens directly into their wallets via lazy minting.
The core difference between these two functions is
CedarERC721DropV0__factory
should be used for contracts that are ERC-721 compliant whileCedarERC1155DropV0__factory
should be used for contracts and tokens that are ERC-1155 compliant.
The CedarERC1155DropV0__factory
and CedarERC721DropV0__factory
functions require two parameters to be executed: a contractAddress
value and the library.getSigner()
function.
The contractAddress
is the address of the deployed contract that is to be minted. If this value isn't available because you haven't had your contracts deployed with Aspen, please reach out in via the discord community, the discussions forum or via a direct email to the team.
The library.getSigner()
function is an autogenerated value that returns from when the collector connects their web wallet platform.
const contract = CedarERC1155DropV0__factory.connect(
contractAddress,
library.getSigner()
);
const contract = CedarERC721DropV0__factory.connect(
contractAddress,
library.getSigner());
ICedarAgreementV0__factory
The ICedarAgreementV0__factory
is the factory function need to check if the collector has accepted the terms of use before they can mint the token. As a necessary prerequisite, if the accept terms function is enabled, it allows the mint function to become inaccessible till accept terms are activated. A connection to the factory function will routinely require two of more of the following fields.
Updated about 2 months ago