Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
58 changes: 29 additions & 29 deletions __tests__/cli-integration.test.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
const { system, filesystem } = require('gluegun')

const src = filesystem.path(__dirname, '..')

const cli = async cmd =>
system.run('node ' + filesystem.path(src, 'bin', 'hentools') + ` ${cmd}`)

test('outputs version', async () => {
const output = await cli('--version')
expect(output).toContain('0.0.1')
})

test('outputs help', async () => {
const output = await cli('--help')
expect(output).toContain('0.0.1')
})

test('generates file', async () => {
const output = await cli('generate foo')

expect(output).toContain('Generated file at models/foo-model.ts')
const foomodel = filesystem.read('models/foo-model.ts')

expect(foomodel).toContain(`module.exports = {`)
expect(foomodel).toContain(`name: 'foo'`)

// cleanup artifact
filesystem.remove('models')
})
const { system, filesystem } = require('gluegun')
const src = filesystem.path(__dirname, '..')
const cli = async cmd =>
system.run('node ' + filesystem.path(src, 'bin', 'hentools') + ` ${cmd}`)
test('outputs version', async () => {
const output = await cli('--version')
expect(output).toContain('0.0.1')
})
test('outputs help', async () => {
const output = await cli('--help')
expect(output).toContain('0.0.1')
})
test('generates file', async () => {
const output = await cli('generate foo')
expect(output).toContain('Generated file at models/foo-model.ts')
const foomodel = filesystem.read('models/foo-model.ts')
expect(foomodel).toContain(`module.exports = {`)
expect(foomodel).toContain(`name: 'foo'`)
// cleanup artifact
filesystem.remove('models')
})
42 changes: 21 additions & 21 deletions bin/hentools
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/usr/bin/env node


/* eslint:disable */
// check if we're running in dev mode
var devMode = require('fs').existsSync(`${__dirname}/../src`)
// or want to "force" running the compiled version with --compiled-build
var wantsCompiled = process.argv.indexOf('--compiled-build') >= 0

if (wantsCompiled || !devMode) {
// this runs from the compiled javascript source
require(`${__dirname}/../build/cli`).run(process.argv)
} else {
// this runs from the typescript source (for dev only)
// hook into ts-node so we can run typescript on the fly
require('ts-node').register({ project: `${__dirname}/../tsconfig.json` })
// run the CLI with the current process arguments
require(`${__dirname}/../src/cli`).run(process.argv)
}


#!/usr/bin/env node
/* eslint:disable */
// check if we're running in dev mode
var devMode = require('fs').existsSync(`${__dirname}/../src`)
// or want to "force" running the compiled version with --compiled-build
var wantsCompiled = process.argv.indexOf('--compiled-build') >= 0
if (wantsCompiled || !devMode) {
// this runs from the compiled javascript source
require(`${__dirname}/../build/cli`).run(process.argv)
} else {
// this runs from the typescript source (for dev only)
// hook into ts-node so we can run typescript on the fly
require('ts-node').register({ project: `${__dirname}/../tsconfig.json` })
// run the CLI with the current process arguments
require(`${__dirname}/../src/cli`).run(process.argv)
}
2 changes: 1 addition & 1 deletion bin/run-hentools.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require(`${__dirname}/../build/cli`).run(process.argv)
require(`${__dirname}/../build/cli`).run(process.argv)
228 changes: 114 additions & 114 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -1,114 +1,114 @@
# Command Reference for hentools

## setup

**NAME**
setup

**SYNOPSIS**
``setup [-r]``

**DESCRIPTION**
``setup`` hentools by saving the secret key.
Generates Tz Address associated to it via the Tezos Wallet PKH method.

**OPTIONS**
``-r`` reset the secret key by deleting the file

## mint

**NAME**
mint

**SYNOPSIS**
``mint [-s] folder``

**DESCRIPTION**
``mint`` NFTs by parsing a csv file from *folder* (file format: *automint.csv*).
Uploads the files to IPFS, followed by interaction with hic et nunc's smart contracts.
Direct follow-up swapping is possible.

**OPTIONS**
``-s`` allows to swap directly after the mint process (*autoswaps.csv* can be generated via the **csv-generator**)

**EXAMPLE**
Minting all images from ``./data`` folder and swapping them after
``hentools mint './data' -s``

## swap
**NAME**
swap

**SYNOPSIS**
``swap folder``

**DESCRIPTION**
``swap`` NFTs by parsing a csv file from *folder* (file format: *swaps.csv* / *swaps.x.csv* where x is a digit)

**OPTIONS**
none

**EXAMPLE**
Swapping all OBJKTs from ``./data/swaps.csv`` file
``hentools swap './data'``

## cancel
**NAME**
cancel

**SYNOPSIS**
``cancel objkt1 ...``

**DESCRIPTION**
``cancel`` swaps by pulling latest swap ID from owner and cancelling it

**OPTIONS**
none

**EXAMPLE**
Cancelling OBJKTs #1234 and #1345
``hentools cancel 1234 1345``

## buy
**NAME**
buy

**SYNOPSIS**
``buy objkt1 ...``

**DESCRIPTION**
``buy`` objkt directly from creator. Batch buying is possible. Currently only one edition per NFT.
The buying process needs a confirmation before being activated (yes or No).

**OPTIONS**
none

**EXAMPLE**
Buying OBJKT #1234 and #19283
``hentools buy 1234 19283``

## hicdex
**NAME**
hicdex

**SYNOPSIS**
``hicdex [-c] [-s] [-r] objktId``

**DESCRIPTION**
Pull various informations from ``hicdex.com``. Used by the tools internally.

**OPTIONS**
``-c`` get the creator of the OBJKT
``-s`` get the latest Swap ID from the OBJKT from the wallet registered with hentools
``-r`` get the royalties from the OBJKT

**EXAMPLE**



// TODO: burn

// TODO: csv templates



# Command Reference for hentools
## setup
**NAME**
setup
**SYNOPSIS**
``setup [-r]``
**DESCRIPTION**
``setup`` hentools by saving the secret key.
Generates Tz Address associated to it via the Tezos Wallet PKH method.
**OPTIONS**
``-r`` reset the secret key by deleting the file
## mint
**NAME**
mint
**SYNOPSIS**
``mint [-s] folder``
**DESCRIPTION**
``mint`` NFTs by parsing a csv file from *folder* (file format: *automint.csv*).
Uploads the files to IPFS, followed by interaction with hic et nunc's smart contracts.
Direct follow-up swapping is possible.
**OPTIONS**
``-s`` allows to swap directly after the mint process (*autoswaps.csv* can be generated via the **csv-generator**)
**EXAMPLE**
Minting all images from ``./data`` folder and swapping them after
``hentools mint './data' -s``
## swap
**NAME**
swap
**SYNOPSIS**
``swap folder``
**DESCRIPTION**
``swap`` NFTs by parsing a csv file from *folder* (file format: *swaps.csv* / *swaps.x.csv* where x is a digit)
**OPTIONS**
none
**EXAMPLE**
Swapping all OBJKTs from ``./data/swaps.csv`` file
``hentools swap './data'``
## cancel
**NAME**
cancel
**SYNOPSIS**
``cancel objkt1 ...``
**DESCRIPTION**
``cancel`` swaps by pulling latest swap ID from owner and cancelling it
**OPTIONS**
none
**EXAMPLE**
Cancelling OBJKTs #1234 and #1345
``hentools cancel 1234 1345``
## buy
**NAME**
buy
**SYNOPSIS**
``buy objkt1 ...``
**DESCRIPTION**
``buy`` objkt directly from creator. Batch buying is possible. Currently only one edition per NFT.
The buying process needs a confirmation before being activated (yes or No).
**OPTIONS**
none
**EXAMPLE**
Buying OBJKT #1234 and #19283
``hentools buy 1234 19283``
## hicdex
**NAME**
hicdex
**SYNOPSIS**
``hicdex [-c] [-s] [-r] objktId``
**DESCRIPTION**
Pull various informations from ``hicdex.com``. Used by the tools internally.
**OPTIONS**
``-c`` get the creator of the OBJKT
``-s`` get the latest Swap ID from the OBJKT from the wallet registered with hentools
``-r`` get the royalties from the OBJKT
**EXAMPLE**
// TODO: burn
// TODO: csv templates
Loading