Documentation
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
#compdef rgb-cli

autoload -U is-at-least

_rgb-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[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
":: :_rgb-cli_commands" \
"*::: :->rgb-cli" \
&& ret=0
    case $state in
    (rgb-cli)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rgb-cli-command-$line[1]:"
        case $line[1] in
            (contract)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
":: :_rgb-cli__contract_commands" \
"*::: :->contract" \
&& ret=0

    case $state in
    (contract)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rgb-cli-contract-command-$line[1]:"
        case $line[1] in
            (list)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(register)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'--force[Force importing of valid contract containing non-mined transactions]' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':contract -- Contract source in Bech32m encoding (starting with `rgbc1...`):' \
&& ret=0
;;
(state)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':contract-id -- Contract id to read state:' \
&& ret=0
;;
(consignment)
_arguments "${_arguments_options[@]}" \
'*-t+[Transition types to be always included into the consignment]:NODE_TYPES: ' \
'*--node-type=[Transition types to be always included into the consignment]:NODE_TYPES: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':contract-id -- Contract id to read source:' \
&& ret=0
;;
(embed)
_arguments "${_arguments_options[@]}" \
'*-t+[Transition types to be always included into the consignment]:NODE_TYPES: ' \
'*--node-type=[Transition types to be always included into the consignment]:NODE_TYPES: ' \
'-o+[Output file to save the PSBT updated with state transition(s) information. If not given, the source PSBT file is overwritten]:PSBT_OUT: ' \
'--out=[Output file to save the PSBT updated with state transition(s) information. If not given, the source PSBT file is overwritten]:PSBT_OUT: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':contract-id -- Contract id to read state:' \
':psbt-in -- Input file containing PSBT of the transfer witness transaction:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
        esac
    ;;
esac
;;
(outpoint)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
":: :_rgb-cli__outpoint_commands" \
"*::: :->outpoint" \
&& ret=0

    case $state in
    (outpoint)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rgb-cli-outpoint-command-$line[1]:"
        case $line[1] in
            (state)
_arguments "${_arguments_options[@]}" \
'*-o+[Outpoints to return the state for]:OUTPOINTS: ' \
'*--outpoint=[Outpoints to return the state for]:OUTPOINTS: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
        esac
    ;;
esac
;;
(transfer)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
":: :_rgb-cli__transfer_commands" \
"*::: :->transfer" \
&& ret=0

    case $state in
    (transfer)
        words=($line[1] "${words[@]}")
        (( CURRENT += 1 ))
        curcontext="${curcontext%:*:*}:rgb-cli-transfer-command-$line[1]:"
        case $line[1] in
            (compose)
_arguments "${_arguments_options[@]}" \
'*-t+[Transition types to be always included into the state transfer]:NODE_TYPES: ' \
'*--node-type=[Transition types to be always included into the state transfer]:NODE_TYPES: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':contract-id -- Contract id to read source:' \
'*::outpoints -- Bitcoin transaction UTXOs which will be spent by the transfer:' \
':output -- Output file to save consignment prototype to:' \
&& ret=0
;;
(combine)
_arguments "${_arguments_options[@]}" \
'-o+[Output file to save the PSBT updated with state transition(s) information. If not given, the source PSBT file is overwritten]:PSBT_OUT: ' \
'--out=[Output file to save the PSBT updated with state transition(s) information. If not given, the source PSBT file is overwritten]:PSBT_OUT: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':contract-id -- Contract id under which the main state transfer is happening:' \
':transition -- File containing main state transition for the transfer:' \
':psbt-in -- Input file containing PSBT of the transfer witness transaction:' \
'*::outpoints -- Bitcoin transaction UTXOs which will be spent by the transfer:' \
&& ret=0
;;
(finalize)
_arguments "${_arguments_options[@]}" \
'-s+[Bifrost server to send state transfer to]:SEND: ' \
'--send=[Bifrost server to send state transfer to]:SEND: ' \
'*-e+[Beneficiary blinded TXO seal - or witness transaction output numbers containing allocations for the beneficiary]:ENDSEALS: ' \
'*--endseal=[Beneficiary blinded TXO seal - or witness transaction output numbers containing allocations for the beneficiary]:ENDSEALS: ' \
'-o+[Output file to save the PSBT updated with state transition(s) information. If not given, the source PSBT file is overwritten]:PSBT_OUT: ' \
'--out=[Output file to save the PSBT updated with state transition(s) information. If not given, the source PSBT file is overwritten]:PSBT_OUT: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':psbt -- The final PSBT (not modified):' \
':consignment-in -- State transfer consignment draft file prepared with `compose` command:' \
'::consignment-out -- Output file to save the final consignment. If not given, the source consignment file is overwritten:' \
&& ret=0
;;
(consume)
_arguments "${_arguments_options[@]}" \
'-r+[Try reveal the conceal seal]:REVEAL: ' \
'--reveal=[Try reveal the conceal seal]:REVEAL: ' \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'-f[Consume even if the endpoint witness transaction is not yet mined]' \
'--force[Consume even if the endpoint witness transaction is not yet mined]' \
'-h[Print help information]' \
'--help[Print help information]' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
':consignment -- State transfer consignment send by the payee:' \
&& ret=0
;;
(help)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
        esac
    ;;
esac
;;
(help)
_arguments "${_arguments_options[@]}" \
'-R+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'--rpc=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \
'-n+[Blockchain to use]:CHAIN: ' \
'--chain=[Blockchain to use]:CHAIN: ' \
'*-v[Set verbosity level]' \
'*--verbose[Set verbosity level]' \
'*::subcommand -- The subcommand whose help message to display:' \
&& ret=0
;;
        esac
    ;;
esac
}

(( $+functions[_rgb-cli_commands] )) ||
_rgb-cli_commands() {
    local commands; commands=(
'contract:Contract management' \
'outpoint:Information on outpoints' \
'transfer:Work with state transfers' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rgb-cli commands' commands "$@"
}
(( $+functions[_rgb-cli__transfer__combine_commands] )) ||
_rgb-cli__transfer__combine_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli transfer combine commands' commands "$@"
}
(( $+functions[_rgb-cli__transfer__compose_commands] )) ||
_rgb-cli__transfer__compose_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli transfer compose commands' commands "$@"
}
(( $+functions[_rgb-cli__contract__consignment_commands] )) ||
_rgb-cli__contract__consignment_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli contract consignment commands' commands "$@"
}
(( $+functions[_rgb-cli__transfer__consume_commands] )) ||
_rgb-cli__transfer__consume_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli transfer consume commands' commands "$@"
}
(( $+functions[_rgb-cli__contract_commands] )) ||
_rgb-cli__contract_commands() {
    local commands; commands=(
'list:List all known contract ids' \
'register:Add new contract to the node' \
'state:Query contract state' \
'consignment:Request contract consignment' \
'embed:Embed contract information into PSBT file' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rgb-cli contract commands' commands "$@"
}
(( $+functions[_rgb-cli__contract__embed_commands] )) ||
_rgb-cli__contract__embed_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli contract embed commands' commands "$@"
}
(( $+functions[_rgb-cli__transfer__finalize_commands] )) ||
_rgb-cli__transfer__finalize_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli transfer finalize commands' commands "$@"
}
(( $+functions[_rgb-cli__contract__help_commands] )) ||
_rgb-cli__contract__help_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli contract help commands' commands "$@"
}
(( $+functions[_rgb-cli__help_commands] )) ||
_rgb-cli__help_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli help commands' commands "$@"
}
(( $+functions[_rgb-cli__outpoint__help_commands] )) ||
_rgb-cli__outpoint__help_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli outpoint help commands' commands "$@"
}
(( $+functions[_rgb-cli__transfer__help_commands] )) ||
_rgb-cli__transfer__help_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli transfer help commands' commands "$@"
}
(( $+functions[_rgb-cli__contract__list_commands] )) ||
_rgb-cli__contract__list_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli contract list commands' commands "$@"
}
(( $+functions[_rgb-cli__outpoint_commands] )) ||
_rgb-cli__outpoint_commands() {
    local commands; commands=(
'state:Return known outpoint state' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rgb-cli outpoint commands' commands "$@"
}
(( $+functions[_rgb-cli__contract__register_commands] )) ||
_rgb-cli__contract__register_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli contract register commands' commands "$@"
}
(( $+functions[_rgb-cli__contract__state_commands] )) ||
_rgb-cli__contract__state_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli contract state commands' commands "$@"
}
(( $+functions[_rgb-cli__outpoint__state_commands] )) ||
_rgb-cli__outpoint__state_commands() {
    local commands; commands=()
    _describe -t commands 'rgb-cli outpoint state commands' commands "$@"
}
(( $+functions[_rgb-cli__transfer_commands] )) ||
_rgb-cli__transfer_commands() {
    local commands; commands=(
'compose:Build state transfer consignment draft' \
'combine:Update PSBT with the information from the state transition' \
'finalize:Finalize and (optionally) send state transfer consignment to beneficiary' \
'consume:Validate incoming transfer consignment and consume it into the stash' \
'help:Print this message or the help of the given subcommand(s)' \
    )
    _describe -t commands 'rgb-cli transfer commands' commands "$@"
}

_rgb-cli "$@"