βοΈdeployNFTContract
Last updated
npm install @nest25/casper-lib
OR
yarn add @nest25/casper-lib// import Nest25 Casper library
const { Casper } = require('@nest25/casper-lib');
// create a new Casper instance
const casper = new Casper();
// set testnet variables
const privateKey = 'your-private-key';
const RPC_API = 'https://rpc.testnet.casperlabs.io/rpc';
async function main() {
// contract name for nft contract
const contractName = 'RWSCT NFT Contract';
// token name for nft contract
const tokenName = 'Real World Smart Contract Token';
// token symbol for nft contract
const symbol = 'RWSCT';
// metadata for nft contract
const metadata = 'name RWSCT, description NFT_Contract, image img, royalty null, royaltyReceiver null';
// deploy nft contract
const txHash = await casper.deployNFTContract(RPC_API, privateKey, contractName, tokenName, symbol, metadata);
// print txHash
console.log(`Contract hash: ${txHash.hash}`);
}
// call main function
main();
{
hash: '20366757cf99cd8bb3db1ff2bb3b515dbb1a603bfba1e8633eab7b5cd310d4e0'
}