0.1.0 • Published 8 months ago

neftyblocks-cli v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

NeftyBlocks CLI

The NeftyBlocks CLI is a tool that will help you manage your collections by creating templates and minting assests.

oclif GitHub license

Requirements

The CLI asks for the following minimum requirements installed:

Installation

To install the CLI you can run the following command:

npm install -g neftyblocks-cli

This will download and install the CLI, after its installed you can quickly start by configuring your CLI settings

$ npm install -g neftyblocks-cli
$ nefty COMMAND
running command...
$ nefty (--version)
neftyblocks-cli/0.1.0 darwin-arm64 node-v18.12.1
$ nefty --help [COMMAND]
USAGE
  $ nefty COMMAND
...

Configuration

Neftyblocks-CLI works based on a configuration file that you will need to generate first. This file contains the urls and defined values to be able to communicate with the Chain. In order to generate this configuration you will need to run the following command:

nefty config init

Then you will be prompt/asked to enter the required information.

Configuration file

The neftyblocks-cli requires a configuration that will include all the properties with the information to connect to the proper endpoints.
You can locate the configuration directory in

Unix: ~/.config/nefty/config.json Windows: %LOCALAPPDATA%\nefty\config.json

The required properties are as follows:

PropertyDescriptionExample value
rpcUrlUrl that points to your preferred eos node apihttps://wax-testnet.neftyblocks.com
aaUrlUrl that points to your preferred atomic assets apihttps://aa-testnet.neftyblocks.com
explorerUrlUrl that points to your preferred blocks explorerhttps://wax-test.bloks.io
chainIdThe chain id of the blockchain to interact with1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4
sessionDirDirectory where the session information is stored/User/user/.config/nefty/sessions

Quick Start

The CLI is able to create templates and mint assets based on xls templates that contains the required informations. The required parameters are the collection name and the path where the file will be downloaded. If no schema is passed to the command it will retrieve all available schemas for the collection and place them one per sheet inside the xls file You can also filter by schema in case you just want to work based on 1 schema You can generate and download these templates by running the following commands:

Generate XLS Template for Template Creation

nefty generate template-metadata ~/Downloads/template-file-path -c yourCollectionName -s yourSchemaName

Generate XLS Template for Minting Assets

nefty generate mint-metadata ~/Downloads/mint-file-path -c yourCollectionName -s yourSchemaName

Create Templates

You can create your templates by running the following command:

nefty templates create ~/path/to/xls/file -c collectionName

Mint Assets

You can mint NFTs by running the following command:

nefty assets mint ~/path/to/xls/file -c collectionName

XLS files

The CLI will read from a XLS template that will contain the schema(s) of the template(s) that we want to create.

Template creation file

This file will have to contain the following headers with the template information:

HeaderDescription
template_max_supplyThe amount of assets that will be available to mint for this template (0 means infinite supply)
template_is_burnableIndicates if you will be able to burn your assets
template_is_transferableIndicates if you can transfer your assets to another account

After that we can add the custom attributes for the templates

template_max_supplytemplate_is_burnabletemplate_is_transferablenameimagecustom attr1custom attr2...
2000TRUE/FALSETRUE/FALSEneftyipfs_hashcustom value1custom value2...
4000TRUE/FALSETRUE/FALSEneftyipfs_hashcustom value1custom value2...

Mint file

This file will have to contain the following headers with the asset information:

HeaderDescription
templateThe id of the template to mint the asset (-1 if no template should be used)
amountThe amount of NFTs to be minted
ownerThe owner of minted NFT

After that we can add the custom attributes for the templates

templateamountownernameimagecustom attr1custom attr2...
-110superaccountneftyipfs_hashcustom value1custom value2...
63183920superaccountneftyipfs_hashcustom value1custom value2...

Commands

nefty assets

Manages a collection's assets.

USAGE
  $ nefty assets

DESCRIPTION
  Manages a collection's assets.

See code: dist/commands/assets/index.ts

nefty assets mint INPUT

Mints assets in batches using a spreadsheet.

USAGE
  $ nefty assets mint INPUT -c <value> [-b <value>] [-i]

ARGUMENTS
  INPUT  Excel file with the templates and amounts

FLAGS
  -b, --batchSize=<value>       [default: 100] Transactions batch size
  -c, --collectionName=<value>  (required) Collection name
  -i, --ignoreSupply            Ignore supply errors

DESCRIPTION
  Mints assets in batches using a spreadsheet.

EXAMPLES
  $ nefty assets mint test.xls -c alpacaworlds

See code: dist/commands/assets/mint.ts

nefty config

Manages the configuration.

USAGE
  $ nefty config

DESCRIPTION
  Manages the configuration.

See code: dist/commands/config/index.ts

nefty config auth

Authenticates the CLI with a different account

USAGE
  $ nefty config auth

DESCRIPTION
  Authenticates the CLI with a different account

EXAMPLES
  Logs in to the CLI with a different account

    $ nefty config auth auth

See code: dist/commands/config/auth.ts

nefty config get

Display all the configuration parameters.

USAGE
  $ nefty config get

DESCRIPTION
  Display all the configuration parameters.

EXAMPLES
  $ nefty config get

See code: dist/commands/config/get.ts

nefty config init

Configure the parameters to interact with the blockchain.

USAGE
  $ nefty config init [-d]

FLAGS
  -d, --deleteConfig  Deletes configuration file

DESCRIPTION
  Configure the parameters to interact with the blockchain.

EXAMPLES
  $ nefty config init

See code: dist/commands/config/init.ts

nefty config set [PROPERTY] [VALUE]

Sets a configuration property

USAGE
  $ nefty config set [PROPERTY] [VALUE]

ARGUMENTS
  PROPERTY  (explorerUrl|rpcUrl|aaUrl) Configuration property.
  VALUE     Configuration value.

DESCRIPTION
  Sets a configuration property

EXAMPLES
  Sets the explorer url property

    $ nefty config set explorerUrl https://waxblock.io

See code: dist/commands/config/set.ts

nefty generate

Generates files to use in other batch commands.

USAGE
  $ nefty generate

DESCRIPTION
  Generates files to use in other batch commands.

See code: dist/commands/generate/index.ts

nefty generate mint-metadata OUTPUT

Generates the file to batch mint assets in a collection. Each schema will be a different sheet.

USAGE
  $ nefty generate mint-metadata OUTPUT -c <value> [-s <value>]

ARGUMENTS
  OUTPUT  Location where the file will be generated.

FLAGS
  -c, --collection=<value>  (required) Collection name to generate the file.
  -s, --schema=<value>      Schema to use to generate the file. If not provided, all schemas will be used.

DESCRIPTION
  Generates the file to batch mint assets in a collection. Each schema will be a different sheet.

EXAMPLES
  Generates the file for the collection alpacaworlds, schema thejourney and saves it in the current directory in a
  file called mints.xlsx.

    $ nefty generate mint-metadata mints.xlsx -c alpacaworlds -s thejourney

  Generates the file for the collection alpacaworlds, all schemas and saves it in the current directory in a file
  called mints.xlsx.

    $ nefty generate mint-metadata mints.xlsx -c alpacaworlds

See code: dist/commands/generate/mint-metadata.ts

nefty generate template-metadata OUTPUT

Generates the file to batch create templates in a collection. Each schema will be a different sheet.

USAGE
  $ nefty generate template-metadata OUTPUT -c <value> [-s <value>]

ARGUMENTS
  OUTPUT  Location where the file will be generated.

FLAGS
  -c, --collection=<value>  (required) Collection name to generate the file.
  -s, --schema=<value>      Schema to use to generate the file. If not provided, all schemas will be used.

DESCRIPTION
  Generates the file to batch create templates in a collection. Each schema will be a different sheet.

EXAMPLES
  Generates the file for the collection alpacaworlds, schema thejourney and saves it in the current directory in a
  file called templates.xlsx.

    $ nefty generate template-metadata templates.xlsx -c alpacaworlds -s thejourney

  Generates the file for the collection alpacaworlds, all schemas and saves it in the current directory in a file
  called templates.xlsx.

    $ nefty generate template-metadata templates.xlsx -c alpacaworlds

See code: dist/commands/generate/template-metadata.ts

nefty help [COMMANDS]

Display help for nefty.

USAGE
  $ nefty help [COMMANDS] [-n]

ARGUMENTS
  COMMANDS  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for nefty.

See code: @oclif/plugin-help

nefty templates

Manages a collection's templates.

USAGE
  $ nefty templates

DESCRIPTION
  Manages a collection's templates.

See code: dist/commands/templates/index.ts

nefty templates create INPUT

Create templates in a collection by batches using a spreadsheet.

USAGE
  $ nefty templates create INPUT -c <value> [-b <value>]

ARGUMENTS
  INPUT  Excel file with the assets to mint

FLAGS
  -b, --batchSize=<value>   [default: 100] Transactions batch size
  -c, --collection=<value>  (required) Collection name

DESCRIPTION
  Create templates in a collection by batches using a spreadsheet.

EXAMPLES
  $ nefty templates create template.xls -c alpacaworlds

See code: dist/commands/templates/create.ts