forked from TheCryptoFarm/toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
guide.helper.js
147 lines (146 loc) · 3.71 KB
/
guide.helper.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
const commandLineUsage = require("command-line-usage");
const sections = [
{
header: "The Crypto Farm Toolkit",
content: "A toolkit for interacting with smart contracts",
},
{
content: "Usage: node app COMMAND [OPTIONS]",
},
{
header: "Options",
optionList: [
{
name: "env",
typeLabel: "{underline file}",
description: "JSON file to use [defaults to env.json]",
},
{
name: "token",
typeLabel: "{underline string}",
description: "Token contract address to interact with",
},
{
name: "wbnb",
typeLabel: "{underline string}",
description:
"WBNB Token contract to interact with [defaults to mainnet contract]",
},
{
name: "router",
typeLabel: "{underline string}",
description: "Router contract to interact with [defaults to PCSv2]",
},
{
name: "factory",
typeLabel: "{underline string}",
description: "Factory contract to interact with [defaults to PCS]",
},
{
name: "gasLimit",
typeLabel: "{underline integer}",
description: "Gas limit to use [defaults to 2,000,000]",
},
{
name: "gasPrice",
typeLabel: "{underline integer}",
description: "Gas Price to use [defaults to 7]",
},
{
name: "deadline",
typeLabel: "{underline integer}",
description:
"Seconds to allow transaction to process before revert [defaults to 120]",
},
{
name: "slippage",
typeLabel: "{underline integer}",
description: "Slippage to use (percentage) [defaults to 1]",
},
{
name: "depositAmount",
typeLabel: "{underline float}",
description: "Amount of BNB to Wrap",
},
{
name: "withdrawAmount",
typeLabel: "{underline float}",
description: "Amount of BNB to Unrwap",
},
{
name: "purchaseAmount",
typeLabel: "{underline float}",
description: "Amount of [token] to buy in BNB",
},
{
name: "sellAmount",
typeLabel: "{underline float}",
description: "Amount of [token] to sell for BNB",
},
{
name: "sellDelay",
typeLabel: "{underline integer}",
description: "SOON: Delay (in ms) to add before selling (EXPERT)",
},
{
name: "sellPercent",
typeLabel: "{underline integer}",
description: "SOON: Percentage of [token] to sell (EXPERT)",
},
],
},
{
header: "Command List",
content: [
{
name: "approve",
summary: "Approve your Tokens for sale on [router]",
},
{
name: "buy",
summary: "Buy tokens using [router]",
},
{
name: "sell",
summary: "Sell tokens using [router]",
},
{
name: "balance",
summary: "Balance of BNB in wallet",
},
{
name: "tokenBalance",
summary: "Balance of [token] in wallet",
},
{
name: "deposit",
summary: "Wrap BNB",
},
{
name: "withdraw",
summary: "UnWrap BNB",
},
{
name: "getPair",
summary: "Get Pancake Pair contract from [token]",
},
{
name: "getReserves",
summary: "Get Reserves for [token]",
},
{
name: "txpool",
summary: "SOON: EXPERT: Snipe direct liquidity events using [router]",
},
{
name: "dxsale",
summary: "SOON: ELITE: Snipe dxSale finalizations",
},
],
},
];
const displayGuide = () => {
console.log(commandLineUsage(sections));
process.exit();
};
module.exports = displayGuide;