#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 "$@"