forked from farcaster-project/farcaster-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_swap-cli
273 lines (267 loc) · 11.7 KB
/
_swap-cli
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
#compdef swap-cli
autoload -U is-at-least
_swap-cli() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
":: :_swap-cli_commands" \
"*::: :->swap-cli" \
&& ret=0
case $state in
(swap-cli)
words=($line[1] "${words[@]}")
(( CURRENT += 1 ))
curcontext="${curcontext%:*:*}:swap-cli-command-$line[1]:"
case $line[1] in
(info)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'::subject -- Remote peer address or temporary/permanent/short channel id. If absent, returns information about the node itself:' \
&& ret=0
;;
(peers)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(list-swaps)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(list-offers)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(make)
_arguments "${_arguments_options[@]}" \
'--btc-addr=[Bitcoin address used as destination or refund address]' \
'--xmr-addr=[Monero address used as destination or refund address]' \
'-n+[Network to use to execute the swap between the chosen blockchains]: :(Testnet testnet Mainnet mainnet Local local)' \
'--network=[Network to use to execute the swap between the chosen blockchains]: :(Testnet testnet Mainnet mainnet Local local)' \
'--arb-blockchain=[The chosen arbitrating blockchain]: :(Bitcoin bitcoin ECDSA)' \
'--acc-blockchain=[The chosen accordant blockchain]: :(Monero monero)' \
'--btc-amount=[Amount of arbitrating assets to exchanged]' \
'--xmr-amount=[Amount of accordant assets to exchanged]' \
'-r+[The future maker swap role, either Alice of Bob. This will dictate with asset will be exchanged for which asset. Alice will sell accordant assets for arbitrating ones and Bob the inverse, sell arbitrating assets for accordant ones]: :(Alice Bob)' \
'--maker-role=[The future maker swap role, either Alice of Bob. This will dictate with asset will be exchanged for which asset. Alice will sell accordant assets for arbitrating ones and Bob the inverse, sell arbitrating assets for accordant ones]: :(Alice Bob)' \
'--cancel-timelock=[The cancel timelock parameter of the arbitrating blockchain]' \
'--punish-timelock=[The punish timelock parameter of the arbitrating blockchain]' \
'--fee-strategy=[The chosen fee strategy for the arbitrating transactions]' \
'-I+[Public IPv4 or IPv6 address present in the public offer allowing taker to connect]' \
'--public-ip-addr=[Public IPv4 or IPv6 address present in the public offer allowing taker to connect]' \
'-b+[IPv4 or IPv6 address to bind to, listening for takers]' \
'--bind-ip-addr=[IPv4 or IPv6 address to bind to, listening for takers]' \
'-p+[Port to use; defaults to the native LN port]' \
'--port=[Port to use; defaults to the native LN port]' \
'--overlay=[Use overlay protocol (http, websocket etc)]' \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(take)
_arguments "${_arguments_options[@]}" \
'--btc-addr=[Bitcoin address used as destination or refund address]' \
'--xmr-addr=[Monero address used as destination or refund address]' \
'-o+[An encoded public offer]' \
'--offer=[An encoded public offer]' \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-w[Accept the public offer without validation]' \
'--without-validation[Accept the public offer without validation]' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(progress)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':swapid -- The swap id requested:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-d+[Data directory path]: :_files -/' \
'--data-dir=[Data directory path]: :_files -/' \
'-T+[Use Tor]: :_hosts' \
'--tor-proxy=[Use Tor]: :_hosts' \
'-m+[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'--msg-socket=[ZMQ socket name/address to forward all incoming protocol messages]: :_files' \
'-x+[ZMQ socket name/address for daemon control interface]: :_files' \
'--ctl-socket=[ZMQ socket name/address for daemon control interface]: :_files' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
esac
;;
esac
}
(( $+functions[_swap-cli_commands] )) ||
_swap-cli_commands() {
local commands; commands=(
'info:General information about the running node' \
'peers:Lists existing peer connections' \
'list-swaps:Lists running swaps' \
'list-offers:Lists public offers created by daemon' \
'make:Maker creates offer and start listening for incoming connections. Command used to to print the resulting public offer that shall be shared with Taker. Additionally it spins up the listener awaiting for connection related to this offer' \
'take:Taker accepts offer and connects to maker'\''s daemon to start the trade' \
'progress:Request swap progress report' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'swap-cli commands' commands "$@"
}
(( $+functions[_swap-cli__help_commands] )) ||
_swap-cli__help_commands() {
local commands; commands=()
_describe -t commands 'swap-cli help commands' commands "$@"
}
(( $+functions[_swap-cli__info_commands] )) ||
_swap-cli__info_commands() {
local commands; commands=()
_describe -t commands 'swap-cli info commands' commands "$@"
}
(( $+functions[_swap-cli__list-offers_commands] )) ||
_swap-cli__list-offers_commands() {
local commands; commands=()
_describe -t commands 'swap-cli list-offers commands' commands "$@"
}
(( $+functions[_swap-cli__list-swaps_commands] )) ||
_swap-cli__list-swaps_commands() {
local commands; commands=()
_describe -t commands 'swap-cli list-swaps commands' commands "$@"
}
(( $+functions[_swap-cli__make_commands] )) ||
_swap-cli__make_commands() {
local commands; commands=()
_describe -t commands 'swap-cli make commands' commands "$@"
}
(( $+functions[_swap-cli__peers_commands] )) ||
_swap-cli__peers_commands() {
local commands; commands=()
_describe -t commands 'swap-cli peers commands' commands "$@"
}
(( $+functions[_swap-cli__progress_commands] )) ||
_swap-cli__progress_commands() {
local commands; commands=()
_describe -t commands 'swap-cli progress commands' commands "$@"
}
(( $+functions[_swap-cli__take_commands] )) ||
_swap-cli__take_commands() {
local commands; commands=()
_describe -t commands 'swap-cli take commands' commands "$@"
}
_swap-cli "$@"