Deploy NFT Gen2

Deploy NFT Schema

Initial Project

npm init -y

install typescript

npm install --save-dev typescript
npm install --save ts-node

create and modify tsconfig.json

vim tsconfig.json
tsconfig.json
{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2022",
    "sourceMap": true,
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": true,
    "noFallthroughCasesInSwitch": false,
    "resolveJsonModule": true,          
    "esModuleInterop": true,            
  }
}

Create resource directory

Download or Save all resource from Example Resources Page to this directory

Install DataChainSdk package

create file deploy.ts

To obtain mnemonic seed or private key, please read at Create Account Page

Execute deploy.ts

When it is successful it will response similar to:

If return code != 0 then execution is failed.

Create NFT Metadata (mint)

create file mint.ts

Execute mint.ts

When it is successful it will response similar to:

Last updated