-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
executable file
·104 lines (87 loc) · 2.39 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#! /usr/bin/env node
const { program } = require('commander')
const check = require('./src/checkAccount')
const payment = require('./src/makePayment')
const assets = require('./src/checkAssets')
const orderbook = require('./src/checkOrderBook')
const purchase = require('./src/purchaseAsset')
const sell = require('./src/sellAsset')
const creatasset = require('./src/createAsset')
const trustline = require('./src/setTrustline')
const createacct = require('./src/createAccount')
const set = require('./src/setAccount')
const unset = require('./src/unsetAccount')
const stream = require('./src/streamActivity')
const uploadFile = require('./src/uploadIPFS')
const config = require('./src/config')
const info = require('./src/info')
program
.command('config')
.description('Set Network Configurations')
.action(config)
program
.command('set')
.description('Set an Account')
.action(set)
program
.command('unset')
.description('Unset an Account')
.action(unset)
program
.command('check')
.description('Check Account Balance')
.action(check)
program
.command('pay')
.description('Make a Payment')
.action(payment)
program
.command('assets')
.description('Check all Assets')
.action(assets)
program
.command('orderbook')
.description('Check Order Book')
.action(orderbook)
program
.command('trust')
.description('Create Trustline')
.action(trustline)
program
.command('purchase')
.description('Purchase an Asset')
.action(purchase)
program
.command('sell')
.description('Sell an Asset')
.action(sell)
program
.command('createasset')
.description('Create an Asset')
.action(creatasset)
program
.command('createacct')
.description('Create an Account')
.action(createacct)
program
.command('stream')
.description('Stream Activity')
.action(stream)
program
.command('upfile')
.requiredOption('-f, --file <file>', 'path to file')
.on("option:file", (file) => {
process.env["file"] = file;
})
.requiredOption('-o, --host <host>', 'host for file [ex. https://ipfs.infura.io:5001]')
.on("option:host", (host) => {
process.env["host"] = host;
})
.option('-p, --pin', 'pin file')
.description('Upload a File to IPFS')
.action(uploadFile)
program
.command('info')
.description('Info')
.action(info)
program.parse()