Helpers for Unique Network chain
src/lib/unique.js
contains all available minting utils for Unique Network chain.
You can copy this file into your project (It requires only @polkadot/*
and @unique-nft/types
packages (Plus web3
for nesting), see their list in package.json
)
You can see documentation in docs.md or see usages in tests (like tests/mint.test.js
and tests/collection.test.js
)
You can show example usage by adding --help
argument to your commands
You can export collection and tokens from chain by
npm run -- command export --ws-endpoint wss://quartz.unique.network --output-dir /tmp/punks-and-chels 1 2
You can import collection and tokens to chain by
npm run -- command import --ws-endpoint ws://localhost:9944 --signer-seed 'electric suit ...' 1 2
You can get mirrors of accounts and its balances by
npm run -- command sub_to_eth --ws-endpoint wss://quartz.unique.network 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY 5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty
You can check remote marketplace installation by its api url
npm run -- command check_marketplace_config https://api.unqnft.io
It will check escrow balance, EVM contract and collections
You can automatically sell token to unique marketplace using its api url by
npm run -- command sell_token_to_marketplace --collection-id 1 --token-id 1 --signer-seed 'electric suit ...' --price 99000000000000 https://api.unqnft.io
You can check marketplace EVM contract configuration by its address
npm run -- command check_marketplace_contract --ws-endpoint wss://quartz.unique.network 0x5c03d3976Ad16F50451d95113728E0229C50cAB8
You can check marketplace NFT collections by ids
npm run -- command check_marketplace_collection --ws-endpoint wss://quartz.unique.network 1 2
You can get all available playgrounds by
npm run -- playground list
You can run playground by
npm run -- playground <playground_name>
You can create your own playground by placing it to src/playgrounds
folder.
For example, you can create src/playgrouns/helloworld.dev.js
playground:
const { getUsage } = require('../lib/cli');
const main = async (args) => {
console.log('Hello world,', args[0]);
}
module.exports = {
main,
description: 'Hello world playground',
help: getUsage('npm run -- playground helloworld.dev', {positional: [{key: 'name', help: 'User name to greet'}], help: 'Playground to say "Hello world" to user'})
}
Now you can run your own playground:
npm run -- playground helloworld.dev Bob
It will print:
Hello world, Bob