🔗deployContract
Description
The deployContract
function is an asynchronous function that deploys a contract on a specified blockchain.
It deploys different types of contracts based on the provided contract type, blockchain, and other parameters. The function utilizes other contract-specific deployment functions to handle the deployment process.
Parameters
Parameter | Data Type | Description |
---|---|---|
| string | The type of contract to be deployed. |
| string | The target blockchain for contract deployment. |
| string | The private key associated with the deploying account. |
| nftParams | Additional parameters required for contract deployment. |
| string | The environment for contract deployment. |
Response
Field | Data Type | Description |
---|---|---|
| Number | A numeric value indicating the execution status (1 for success, 0 for error). |
| any | The error object containing details about the encountered error, if applicable. |
Example Request and Response
Prerequisites
Before making requests with NEST® SDK, you must have it installed.
You can install NEST® SDK using either npm
or yarn
. Use the following commands to install NEST® SDK:
Request
Here is an example of how to make a deployContract
request using the NEST® SDK:
Response
Use Cases
Deploying an ERC721 contract: This function deploys an ERC721 contract on the specified blockchain, using the provided private key and deployment environment.
Deploying an ERC1155 contract: If the contract type is ERC1155, this function deploys an ERC1155 contract on the target blockchain.
Deploying an ERC20 contract: For the ERC20 contract type, this function deploys an ERC20 contract with the specified maximum cap, name, symbol, private key, and deployment environment.
Deploying a SoulBound contract: If the contract type is SoulBound, this function deploys a SoulBound contract with the specified name, symbol, private key, and deployment environment.
Handling unsupported contract types: If the provided contract type is not supported, the function returns an error indicating that the contract type is not supported.
Last updated