From 5538914cf87f194874d5263a7af732d8a8e041ce Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 12:03:06 -0300 Subject: [PATCH 01/14] Add line break --- core/src/main/java/bisq/core/api/CoreApi.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/bisq/core/api/CoreApi.java b/core/src/main/java/bisq/core/api/CoreApi.java index bfc814c67a6..fb3c8f8a380 100644 --- a/core/src/main/java/bisq/core/api/CoreApi.java +++ b/core/src/main/java/bisq/core/api/CoreApi.java @@ -73,7 +73,8 @@ public class CoreApi { @Inject public CoreApi(Config config, CoreDisputeAgentsService coreDisputeAgentsService, - CoreHelpService coreHelpService, CoreOffersService coreOffersService, + CoreHelpService coreHelpService, + CoreOffersService coreOffersService, CorePaymentAccountsService paymentAccountsService, CorePriceService corePriceService, CoreTradesService coreTradesService, From ef4acc0b732700de2da188180ac772c6201d779a Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 13:44:02 -0300 Subject: [PATCH 02/14] Make opt description generic --- cli/src/main/java/bisq/cli/opts/WithdrawFundsOptionParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/main/java/bisq/cli/opts/WithdrawFundsOptionParser.java b/cli/src/main/java/bisq/cli/opts/WithdrawFundsOptionParser.java index 382fe2c883a..f47432fa860 100644 --- a/cli/src/main/java/bisq/cli/opts/WithdrawFundsOptionParser.java +++ b/cli/src/main/java/bisq/cli/opts/WithdrawFundsOptionParser.java @@ -27,7 +27,7 @@ public class WithdrawFundsOptionParser extends AbstractMethodOptionParser implements MethodOpts { - final OptionSpec<String> tradeIdOpt = parser.accepts(OPT_TRADE_ID, "id of trade to get") + final OptionSpec<String> tradeIdOpt = parser.accepts(OPT_TRADE_ID, "id of trade") .withRequiredArg() .defaultsTo(EMPTY); From 629f408bdf0b6825c4bf9632bdcd19c5a379ba72 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 13:45:07 -0300 Subject: [PATCH 03/14] Add method help docs --- .../main/resources/help/canceloffer-help.txt | 25 ++++++++++ .../help/confirmpaymentreceived-help.txt | 27 ++++++++++ .../help/confirmpaymentstarted-help.txt | 26 ++++++++++ .../main/resources/help/getmyoffer-help.txt | 25 ++++++++++ .../main/resources/help/getmyoffers-help.txt | 33 ++++++++++++ .../src/main/resources/help/getoffer-help.txt | 26 ++++++++++ .../main/resources/help/getoffers-help.txt | 39 +++++++++++++++ .../src/main/resources/help/gettrade-help.txt | 32 ++++++++++++ .../main/resources/help/keepfunds-help.txt | 31 ++++++++++++ .../resources/help/withdrawfunds-help.txt | 50 +++++++++++++++++++ 10 files changed, 314 insertions(+) create mode 100644 core/src/main/resources/help/canceloffer-help.txt create mode 100644 core/src/main/resources/help/confirmpaymentreceived-help.txt create mode 100644 core/src/main/resources/help/confirmpaymentstarted-help.txt create mode 100644 core/src/main/resources/help/getmyoffer-help.txt create mode 100644 core/src/main/resources/help/getmyoffers-help.txt create mode 100644 core/src/main/resources/help/getoffer-help.txt create mode 100644 core/src/main/resources/help/getoffers-help.txt create mode 100644 core/src/main/resources/help/gettrade-help.txt create mode 100644 core/src/main/resources/help/keepfunds-help.txt create mode 100644 core/src/main/resources/help/withdrawfunds-help.txt diff --git a/core/src/main/resources/help/canceloffer-help.txt b/core/src/main/resources/help/canceloffer-help.txt new file mode 100644 index 00000000000..10627ce7045 --- /dev/null +++ b/core/src/main/resources/help/canceloffer-help.txt @@ -0,0 +1,25 @@ +canceloffer + +NAME +---- +canceloffer - cancel an existing offer to buy or sell BTC + +SYNOPSIS +-------- +canceloffer + --offer-id=<offer-id> + +DESCRIPTION +----------- +Cancel an existing offer. The offer will be removed from other Bisq users' offer views. + +OPTIONS +------- +--offer-id + The ID of the buy or sell offer to cancel. + +EXAMPLES +-------- +To cancel an offer with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea: +$ ./bisq-cli --password=xyz --port=9998 canceloffer -offer-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea + diff --git a/core/src/main/resources/help/confirmpaymentreceived-help.txt b/core/src/main/resources/help/confirmpaymentreceived-help.txt new file mode 100644 index 00000000000..dc43cba2fa4 --- /dev/null +++ b/core/src/main/resources/help/confirmpaymentreceived-help.txt @@ -0,0 +1,27 @@ +confirmpaymentreceived + +NAME +---- +confirmpaymentreceived - confirm payment has been received + +SYNOPSIS +-------- +confirmpaymentreceived + --trade-id=<trade-id> + +DESCRIPTION +----------- +After the seller receives payment from the BTC buyer, confirmpaymentreceived notifies +the buyer the payment has arrived. The seller can release locked BTC only after the +this confirmation message has been sent. + +OPTIONS +------- +--trade-id + The ID of the trade (the full offer-id). + +EXAMPLES +-------- +A BTC seller has taken an offer with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea, and has recently +received the required fiat payment from the buyer's fiat account: +$ ./bisq-cli --password=xyz --port=9998 confirmpaymentreceived -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea diff --git a/core/src/main/resources/help/confirmpaymentstarted-help.txt b/core/src/main/resources/help/confirmpaymentstarted-help.txt new file mode 100644 index 00000000000..e266e2ef3e6 --- /dev/null +++ b/core/src/main/resources/help/confirmpaymentstarted-help.txt @@ -0,0 +1,26 @@ +confirmpaymentstarted + +NAME +---- +confirmpaymentstarted - confirm payment has been sent + +SYNOPSIS +-------- +confirmpaymentstarted + --trade-id=<trade-id> + +DESCRIPTION +----------- +After the buyer initiates payment to the BTC seller, confirmpaymentstarted notifies +the seller to begin watching for a funds deposit in her payment account. + +OPTIONS +------- +--trade-id + The ID of the trade (the full offer-id). + +EXAMPLES +-------- +A BTC buyer has taken an offer with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea, and has recently +initiated the required fiat payment to the seller's fiat account: +$ ./bisq-cli --password=xyz --port=9998 confirmpaymentstarted -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea diff --git a/core/src/main/resources/help/getmyoffer-help.txt b/core/src/main/resources/help/getmyoffer-help.txt new file mode 100644 index 00000000000..4e93e43f1cd --- /dev/null +++ b/core/src/main/resources/help/getmyoffer-help.txt @@ -0,0 +1,25 @@ +getmyoffer + +NAME +---- +getmyoffer - get your offer to buy or sell BTC + +SYNOPSIS +-------- +getmyoffer + --offer-id=<offer-id> + +DESCRIPTION +----------- +List one of your existing offer's details. + +OPTIONS +------- +--offer-id + The ID of your buy or sell offer. + +EXAMPLES +-------- +To view your offer with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea: +$ ./bisq-cli --password=xyz --port=9998 getmyoffer -offer-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea + diff --git a/core/src/main/resources/help/getmyoffers-help.txt b/core/src/main/resources/help/getmyoffers-help.txt new file mode 100644 index 00000000000..7d2c3d3eb85 --- /dev/null +++ b/core/src/main/resources/help/getmyoffers-help.txt @@ -0,0 +1,33 @@ +getmyoffers + +NAME +---- +getmyoffers - get your own buy or sell BTC offers for a fiat currency + +SYNOPSIS +-------- +getmyoffers + --direction=<buy|sell> + --currency-code=<eur|usd> + +DESCRIPTION +----------- +List your existing offers for a direction (SELL|BUY) and currency (EUR|GBP|USD|BRL|...). + +OPTIONS +------- +--direction + The direction of the offer (BUY or SELL). + +--currency-code + The three letter code for the fiat used to buy or sell BTC, e.g., EUR, USD, BRL, ... + +EXAMPLES +-------- +List all of your existing BUY offers for BRL: +$ ./bisq-cli --password=xyz --port=9998 getmyoffers --direction=buy --currency-code=brl + +List all of your existing SELL offers for EUR: +$ ./bisq-cli --password=xyz --port=9998 getmyoffers --direction=sell --currency-code=eur + + diff --git a/core/src/main/resources/help/getoffer-help.txt b/core/src/main/resources/help/getoffer-help.txt new file mode 100644 index 00000000000..23056674387 --- /dev/null +++ b/core/src/main/resources/help/getoffer-help.txt @@ -0,0 +1,26 @@ +getoffer + +NAME +---- +getoffer - get an offer to buy or sell BTC + +SYNOPSIS +-------- +getoffer + --offer-id=<offer-id> + +DESCRIPTION +----------- +List an existing offer's details. The offer cannot be one of your own, and be +available for the taking, or it will not be viewable. + +OPTIONS +------- +--offer-id + The ID of the buy or sell offer to view. + +EXAMPLES +-------- +To view an offer with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea: +$ ./bisq-cli --password=xyz --port=9998 getoffer -offer-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea + diff --git a/core/src/main/resources/help/getoffers-help.txt b/core/src/main/resources/help/getoffers-help.txt new file mode 100644 index 00000000000..c76c2dfbda9 --- /dev/null +++ b/core/src/main/resources/help/getoffers-help.txt @@ -0,0 +1,39 @@ +getoffers + +NAME +---- +getoffers - get available buy or sell BTC offers for a fiat currency + +SYNOPSIS +-------- +getoffers + --direction=<buy|sell> + --currency-code=<eur|usd> + +DESCRIPTION +----------- +List existing offers for a direction (SELL|BUY) and currency (EUR|GBP|USD|BRL|...). +All of the listed offers will be available for the taking because you have a +matching payment account, and none of the offers listed will be one of yours. + +OPTIONS +------- +--direction + The direction of the offer (BUY or SELL). + +--currency-code + The three letter code for the fiat used to buy or sell BTC, e.g., EUR, USD, BRL, ... + +EXAMPLES +-------- +You have one Brazilian Real payment account with a face-to-face payment method type. +To view available offers to BUY BTC with BRL, created by other users with the same +face-to-fact account type: +$ ./bisq-cli --password=xyz --port=9998 getoffers --direction=buy --currency-code=brl + +You have several EUR payment accounts, each with a different payment method type. +To view available offers to SELL BTC with EUR, created by other users having at +least one payment account that matches any of your own: +$ ./bisq-cli --password=xyz --port=9998 getoffers --direction=sell --currency-code=eur + + diff --git a/core/src/main/resources/help/gettrade-help.txt b/core/src/main/resources/help/gettrade-help.txt new file mode 100644 index 00000000000..1c54c96ab58 --- /dev/null +++ b/core/src/main/resources/help/gettrade-help.txt @@ -0,0 +1,32 @@ +gettrade + +NAME +---- +gettrade - get a buy or sell BTC trade + +SYNOPSIS +-------- +gettrade + --trade-id=<trade-id> + [--show-contract=<true|false>] + +DESCRIPTION +----------- +List details of a trade with the given trade-id. If the trade has not yet been completed, +the details can inform each side of the trade of the current phase of the trade protocol. + +OPTIONS +------- +--trade-id + The ID of the trade (the full offer-id). + +--show-contract + Optionally display the trade's full contract details in json format. The default = false. + +EXAMPLES +-------- +To see the summary of a trade with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea: +$ ./bisq-cli --password=xyz --port=9998 gettrade -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea + +To see the full contract for a trade with ID 83e8b2e2-51b6-4f39-a748-3ebd29c22aea: +$ ./bisq-cli --password=xyz --port=9998 gettrade -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea --show-contract=true diff --git a/core/src/main/resources/help/keepfunds-help.txt b/core/src/main/resources/help/keepfunds-help.txt new file mode 100644 index 00000000000..b5739744e8b --- /dev/null +++ b/core/src/main/resources/help/keepfunds-help.txt @@ -0,0 +1,31 @@ +keepfunds + +NAME +---- +keepfunds - keep BTC received during a trade in Bisq wallet + +SYNOPSIS +-------- +keepfunds + --trade-id=<trade-id> + +DESCRIPTION +----------- +A BTC buyer completes the final step in the trade protocol by keeping received BTC in his +Bisq wallet. This step may not seem necessary from the buyer's perspective, but it is +necessary for correct transition of a trade's state to CLOSED, within the Bisq server. + +The alternative way to close out the trade is to sen the received BTC to an external +BTC wallet, using the withdrawfunds command. + +OPTIONS +------- +--trade-id + The ID of the trade (the full offer-id). + +EXAMPLES +-------- +A BTC seller has informed the buyer that fiat payment has been received for trade with ID +83e8b2e2-51b6-4f39-a748-3ebd29c22aea, and locked BTC has been released to the buyer. +The BTC buyer closes out the trade by keeping the received BTC in her Bisq wallet: +$ ./bisq-cli --password=xyz --port=9998 keepfunds -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea diff --git a/core/src/main/resources/help/withdrawfunds-help.txt b/core/src/main/resources/help/withdrawfunds-help.txt new file mode 100644 index 00000000000..dbef9e277d0 --- /dev/null +++ b/core/src/main/resources/help/withdrawfunds-help.txt @@ -0,0 +1,50 @@ +withdrawfunds + +NAME +---- +withdrawfunds - send BTC received during a trade to an external BTC wallet + +SYNOPSIS +-------- +withdrawfunds + --trade-id=<trade-id> + --address=<btc-address> + [--memo=<"memo">] + +DESCRIPTION +----------- +A BTC buyer completes the final step in the trade protocol by sending received BTC to +an external BTC wallet. + +The alternative way to close out the trade is to keep the received BTC in the Bisq wallet, +using the keepfunds command. + +The buyer needs to complete the trade protocol using the keepfunds or withdrawfunds or command. +This step may not seem necessary from the buyer's perspective, but it is necessary for correct +transition of a trade's state to CLOSED, within the Bisq server. + +OPTIONS +------- +--trade-id + The ID of the trade (the full offer-id). + +--address + The destination btc address for the send btc transaction. + +--memo + An optional memo to be saved with the send btc transaction. + A multi word memo must be enclosed in double quotes. + +EXAMPLES +-------- +A BTC seller has informed the buyer that fiat payment has been received for trade with ID +83e8b2e2-51b6-4f39-a748-3ebd29c22aea, and locked BTC has been released to the buyer. +The BTC buyer closes out the trade by sending the received BTC to an external BTC wallet: +$ ./bisq-cli --password=xyz --port=9998 withdrawfunds -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea \ + --address=2N5J6MyjAsWnashimGiNwoRzUXThsQzRmbv (bitcoin regtest address) + + +A seller sends a trade's BTC proceeds to an external wallet, and includes an optional memo: +$ ./bisq-cli --password=xyz --port=9998 withdrawfunds -trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea \ + --address=2N5J6MyjAsWnashimGiNwoRzUXThsQzRmbv + --memo="note to self" From 03f6c2a4d3b8c9ddd4157ddb93bedd750941aec4 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:04:23 -0300 Subject: [PATCH 04/14] Add method help docs --- .../resources/help/createpaymentacct-help.txt | 46 +++++++++++++++++++ .../resources/help/getaddressbalance-help.txt | 23 ++++++++++ .../main/resources/help/getbalance-help.txt | 30 ++++++++++++ .../help/getpaymentacctform-help.txt | 44 ++++++++++++++++++ 4 files changed, 143 insertions(+) create mode 100644 core/src/main/resources/help/createpaymentacct-help.txt create mode 100644 core/src/main/resources/help/getaddressbalance-help.txt create mode 100644 core/src/main/resources/help/getbalance-help.txt create mode 100644 core/src/main/resources/help/getpaymentacctform-help.txt diff --git a/core/src/main/resources/help/createpaymentacct-help.txt b/core/src/main/resources/help/createpaymentacct-help.txt new file mode 100644 index 00000000000..cdc837f7f15 --- /dev/null +++ b/core/src/main/resources/help/createpaymentacct-help.txt @@ -0,0 +1,46 @@ +createpaymentacct + +NAME +---- +createpaymentacct - create a payment account + +SYNOPSIS +-------- +createpaymentacct + --payment-account-form=<path> + +DESCRIPTION +----------- +Create a Bisq trading account with a payment account form. + +The details of the payment account are defined in a manually edited json file generated +by a getpaymentacctform command, e.g., + + { + "_COMMENTS_": [ + "Do not manually edit the paymentMethodId field.", + "Edit the salt field only if you are recreating a payment account on a new installation and wish to preserve the account age." + ], + "paymentMethodId": "SEPA", + "accountName": "your accountname", + "bic": "your bic", + "country": "your country", + "holderName": "your holdername", + "iban": "your iban", + "salt": "" + } + + +EXAMPLES +-------- +To create a new SEPA payment account, find the payment-method-id for the getpaymentacctform command: +$ ./bisq-cli --password=xyz --port=9998 getpaymentmethods + +Get a new, blank SEPA payment account form: +$ ./bisq-cli --password=xyz --port=9998 getpaymentacctform --payment-method-id=SEPA + +The previous command created a json file named sepa_1610817857085.json. The timestamp +in the file name is to ensure each generated file is uniquely named (you can rename the file). + +Manually edit the json file, and pass the file's path to the createpaymentacct command: +$ ./bisq-cli --password=xyz --port=9998 createpaymentacct --payment-account-form=sepa_1610817857085.json diff --git a/core/src/main/resources/help/getaddressbalance-help.txt b/core/src/main/resources/help/getaddressbalance-help.txt new file mode 100644 index 00000000000..ff8149a285a --- /dev/null +++ b/core/src/main/resources/help/getaddressbalance-help.txt @@ -0,0 +1,23 @@ +getaddressbalance + +NAME +---- +getaddressbalance - get btc address balance + +SYNOPSIS +-------- +getaddressbalance + --address=<btc-address> + +DESCRIPTION +----------- +Returns the balance of a BTC address in the Bisq server's wallet. + +OPTIONS +------- +--address=<btc-address> + The BTC address. + +EXAMPLES +-------- +$ ./bisq-cli --password=xyz --port=9998 getaddressbalance -address=bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 diff --git a/core/src/main/resources/help/getbalance-help.txt b/core/src/main/resources/help/getbalance-help.txt new file mode 100644 index 00000000000..52e27e8de98 --- /dev/null +++ b/core/src/main/resources/help/getbalance-help.txt @@ -0,0 +1,30 @@ +getbalance + +NAME +---- +getbalance - get wallet balance(s) + +SYNOPSIS +-------- +getbalance + [--currency-code=<bsq|btc>] + +DESCRIPTION +----------- +Returns full balance information for Bisq BSQ and/or BTC wallets. + +OPTIONS +------- +--currency-code=<bsq|btc> + The three letter Bisq wallet crypto currency code. + +EXAMPLES +-------- +Show full BSQ and BTC wallet balance information: +$ ./bisq-cli --password=xyz --port=9998 getbalance + +Show full BSQ wallet balance information: +$ ./bisq-cli --password=xyz --port=9998 getbalance --currency-code=bsq + +Show full BTC wallet balance information: +$ ./bisq-cli --password=xyz --port=9998 getbalance --currency-code=btc diff --git a/core/src/main/resources/help/getpaymentacctform-help.txt b/core/src/main/resources/help/getpaymentacctform-help.txt new file mode 100644 index 00000000000..5086728c35b --- /dev/null +++ b/core/src/main/resources/help/getpaymentacctform-help.txt @@ -0,0 +1,44 @@ +getpaymentacctform + +NAME +---- +getpaymentacctform - get a blank payment account form for a payment method + +SYNOPSIS +-------- +getpaymentacctform + --payment-method-id=<payment-method-id> + +DESCRIPTION +----------- +Returns a new, blank payment account form as a json file, e.g., + + { + "_COMMENTS_": [ + "Do not manually edit the paymentMethodId field.", + "Edit the salt field only if you are recreating a payment account on a new installation and wish to preserve the account age." + ], + "paymentMethodId": "CLEAR_X_CHANGE", + "accountName": "your accountname", + "emailOrMobileNr": "your emailormobilenr", + "holderName": "your holdername", + "salt": "" + } + +This form is manually edited, and used as a parameter to the createpaymentacct command, +which creates the new payment account. + +EXAMPLES +-------- +To create a new CLEAR_X_CHANGE (Zelle) payment account, find the payment-method-id for +the getpaymentacctform command: +$ ./bisq-cli --password=xyz --port=9998 getpaymentmethods + +Get a new, blank CLEAR_X_CHANGE (Zelle) payment account form: +$ ./bisq-cli --password=xyz --port=9998 getpaymentacctform --payment-method-id=CLEAR_X_CHANGE_ID + +The previous command created a json file named clear_x_change_1610818248040.json. The timestamp +in the file name is to ensure each generated file is uniquely named (you can rename the file). + +Manually edit the json file, and pass the file's path to the createpaymentacct command: +$ ./bisq-cli --password=xyz --port=9998 createpaymentacct --payment-account-form=clear_x_change_1610818248040.json From d14fc4002904c968e457e992175d005c74bf3170 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:07:06 -0300 Subject: [PATCH 05/14] Fix help text typos --- cli/src/main/java/bisq/cli/CliMain.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/main/java/bisq/cli/CliMain.java b/cli/src/main/java/bisq/cli/CliMain.java index 6c3e796942f..cadde5d405d 100644 --- a/cli/src/main/java/bisq/cli/CliMain.java +++ b/cli/src/main/java/bisq/cli/CliMain.java @@ -806,10 +806,10 @@ private static void printHelp(OptionParser parser, @SuppressWarnings("SameParame stream.println(); stream.format(rowFormat, getunusedbsqaddress.name(), "", "Get unused BSQ address"); stream.println(); - stream.format(rowFormat, sendbsq.name(), "--address=<btc-address> --amount=<btc-amount> \\", "Send BSQ"); + stream.format(rowFormat, sendbsq.name(), "--address=<bsq-address> --amount=<bsq-amount> \\", "Send BSQ"); stream.format(rowFormat, "", "[--tx-fee-rate=<sats/byte>]", ""); stream.println(); - stream.format(rowFormat, sendbtc.name(), "--address=<bsq-address> --amount=<bsq-amount> \\", "Send BTC"); + stream.format(rowFormat, sendbtc.name(), "--address=<btc-address> --amount=<btc-amount> \\", "Send BTC"); stream.format(rowFormat, "", "[--tx-fee-rate=<sats/byte>]", ""); stream.println(); stream.format(rowFormat, gettxfeerate.name(), "", "Get current tx fee rate in sats/byte"); From 68092a0f82b619b0e5e14f6d41cef2e9e6fb08f2 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:09:52 -0300 Subject: [PATCH 06/14] Add --memo opt to help text --- cli/src/main/java/bisq/cli/CliMain.java | 1 + 1 file changed, 1 insertion(+) diff --git a/cli/src/main/java/bisq/cli/CliMain.java b/cli/src/main/java/bisq/cli/CliMain.java index cadde5d405d..eb9253b3be7 100644 --- a/cli/src/main/java/bisq/cli/CliMain.java +++ b/cli/src/main/java/bisq/cli/CliMain.java @@ -811,6 +811,7 @@ private static void printHelp(OptionParser parser, @SuppressWarnings("SameParame stream.println(); stream.format(rowFormat, sendbtc.name(), "--address=<btc-address> --amount=<btc-amount> \\", "Send BTC"); stream.format(rowFormat, "", "[--tx-fee-rate=<sats/byte>]", ""); + stream.format(rowFormat, "", "[--memo=<\"memo\">]", ""); stream.println(); stream.format(rowFormat, gettxfeerate.name(), "", "Get current tx fee rate in sats/byte"); stream.println(); From cde9a6d7c8361f3b4d64eccf0d75fd17e36d4828 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:27:14 -0300 Subject: [PATCH 07/14] Add method help docs --- core/src/main/resources/help/sendbsq-help.txt | 38 ++++++++++++++ core/src/main/resources/help/sendbtc-help.txt | 51 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 core/src/main/resources/help/sendbsq-help.txt create mode 100644 core/src/main/resources/help/sendbtc-help.txt diff --git a/core/src/main/resources/help/sendbsq-help.txt b/core/src/main/resources/help/sendbsq-help.txt new file mode 100644 index 00000000000..92a03cea1a6 --- /dev/null +++ b/core/src/main/resources/help/sendbsq-help.txt @@ -0,0 +1,38 @@ +sendbsq + +NAME +---- +sendbsq - send BSQ to an external wallet + +SYNOPSIS +-------- +sendbsq + --address=<btc-address> + --amount=<btc-amount> + [--tx-fee-rate=<sats/byte>] + +DESCRIPTION +----------- +Send BSQ from your Bisq wallet to an external BSQ address. + +OPTIONS +------- +--address + The destination BSQ address for the send transaction. + +--amount + The amount of BSQ to send. + +--tx-fee-rate + An optional transaction fee rate (sats/byte) for the transaction. The user is + responsible for choosing a fee rate that will be accepted by the network in a + reasonable amount of time, and the fee rate must be greater than 0. + +EXAMPLES +-------- +Send 500 BSQ to address Bn3PCQgRwhkrGnaMp1RYwt9tFwL51YELqne with a default transaction fee rate: +$ ./bisq-cli --password=xyz --port=9998 sendbsq --address=Bn3PCQgRwhkrGnaMp1RYwt9tFwL51YELqne --amount=500.00 + +Send 3000 BSQ to address Bn3PCQgRwhkrGnaMp1RYwt9tFwL51YELqne with transaction fee rate of 40 sats/byte: +$ ./bisq-cli --password=xyz --port=9998 sendbsq --address=Bn3PCQgRwhkrGnaMp1RYwt9tFwL51YELqne --amount=3000.00 \ + --tx-fee-rate=40 diff --git a/core/src/main/resources/help/sendbtc-help.txt b/core/src/main/resources/help/sendbtc-help.txt new file mode 100644 index 00000000000..31ad5db0e51 --- /dev/null +++ b/core/src/main/resources/help/sendbtc-help.txt @@ -0,0 +1,51 @@ +sendbtc + +NAME +---- +sendbtc - send BTC to an external wallet + +SYNOPSIS +-------- +sendbtc + --address=<btc-address> + --amount=<btc-amount> + [--tx-fee-rate=<sats/byte>] + [--memo=<"memo">] + +DESCRIPTION +----------- +Send BTC from your Bisq wallet to an external BTC address. + +OPTIONS +------- +--address + The destination BTC address for the send transaction. + +--amount + The amount of BTC to send. + +--tx-fee-rate + An optional transaction fee rate (sats/byte) for the transaction. The user is + responsible for choosing a fee rate that will be accepted by the network in a + reasonable amount of time, and the fee rate must be greater than 0. + +--memo + An optional memo to be saved with the send btc transaction. + A multi word memo must be enclosed in double quotes. + +EXAMPLES +-------- +Send 0.10 BTC to address bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 with a default +transaction fee rate: +$ ./bisq-cli --password=xyz --port=9998 sendbtc --address=bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 --amount=0.10 + +Send 0.05 BTC to address bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 with a transaction +fee rate of 10 sats/byte: +$ ./bisq-cli --password=xyz --port=9998 sendbtc --address=bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 --amount=0.05 \ + --tx-fee-rate=10 + +Send 0.005 BTC to address bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 with a transaction +fee rate of 40 sats/byte, and save a memo with the send transaction: +$ ./bisq-cli --password=xyz --port=9998 sendbtc --address=bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 --amount=0.005 \ + --tx-fee-rate=40 + --memo="note to self" From dab65e7f78cff0023f180dd72bbbff9fc531a503 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:27:46 -0300 Subject: [PATCH 08/14] Fix typo --- core/src/main/resources/help/getaddressbalance-help.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/help/getaddressbalance-help.txt b/core/src/main/resources/help/getaddressbalance-help.txt index ff8149a285a..279c58309dc 100644 --- a/core/src/main/resources/help/getaddressbalance-help.txt +++ b/core/src/main/resources/help/getaddressbalance-help.txt @@ -20,4 +20,4 @@ OPTIONS EXAMPLES -------- -$ ./bisq-cli --password=xyz --port=9998 getaddressbalance -address=bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 +$ ./bisq-cli --password=xyz --port=9998 getaddressbalance --address=bcrt1qygvsqmyt8jyhtp7l3zwqm7s7v3nar6vkc2luz3 From a133b0d7e3c2a5cdf885b2d8ab963e304ed0ae52 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:35:14 -0300 Subject: [PATCH 09/14] Add method help doc --- .../main/resources/help/settxfeerate-help.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 core/src/main/resources/help/settxfeerate-help.txt diff --git a/core/src/main/resources/help/settxfeerate-help.txt b/core/src/main/resources/help/settxfeerate-help.txt new file mode 100644 index 00000000000..557d7ee5c5b --- /dev/null +++ b/core/src/main/resources/help/settxfeerate-help.txt @@ -0,0 +1,19 @@ +settxfeerate + +NAME +---- +settxfeerate - set custom transaction fee rate preference + +SYNOPSIS +-------- +settxfeerate + --tx-fee-rate=<sats/byte> + +DESCRIPTION +----------- +Sets the user's custom transaction fee rate preference. + +EXAMPLES +-------- +Set custom transaction fee rate to 25 sats/byte: +$ ./bisq-cli --password=xyz --port=9998 settxfeerate --tx-fee-rate=25 From 9efeee83e3a213c77fa5c3626e1fe591dcc4a748 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:35:43 -0300 Subject: [PATCH 10/14] Explain example --- core/src/main/resources/help/unsettxfeerate-help.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/resources/help/unsettxfeerate-help.txt b/core/src/main/resources/help/unsettxfeerate-help.txt index 36767e6f1f0..d3ec0f96a16 100644 --- a/core/src/main/resources/help/unsettxfeerate-help.txt +++ b/core/src/main/resources/help/unsettxfeerate-help.txt @@ -14,4 +14,5 @@ Unsets (removes) the transaction fee rate user preference. EXAMPLES -------- +Remove the user's custom transaction fee rate preference: $ ./bisq-cli --password=xyz --port=9998 unsettxfeerate From 13d0d3e9f13ddef9a1f2faa42952c7a1e72443bc Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:43:59 -0300 Subject: [PATCH 11/14] Add method help doc --- .../resources/help/gettransaction-help.txt | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 core/src/main/resources/help/gettransaction-help.txt diff --git a/core/src/main/resources/help/gettransaction-help.txt b/core/src/main/resources/help/gettransaction-help.txt new file mode 100644 index 00000000000..6b1b7b05cec --- /dev/null +++ b/core/src/main/resources/help/gettransaction-help.txt @@ -0,0 +1,27 @@ +gettransaction + +NAME +---- +gettransaction - get transaction summary + +SYNOPSIS +-------- +gettransaction + --transaction-id=<transaction-id> + +DESCRIPTION +----------- +Returns a very brief summary of a BTC transaction created by the Bisq server. + +To see full transaction details, use a bitcoin-core client or an online block explorer. + +OPTIONS +------- +--transaction-id + The ID of the BTC transaction. + +EXAMPLES +-------- +To see the summary of a transaction with ID 282dc2a5755219a49ee9f6d46a31a2cbaec6624beba96548180eccb1f004cdd8: +$ ./bisq-cli --password=xyz --port=9998 gettransaction \ + -transaction-id=282dc2a5755219a49ee9f6d46a31a2cbaec6624beba96548180eccb1f004cdd8 From 44c11922a61f50de0ef3685707e6de72edcfb74e Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sun, 17 Jan 2021 12:58:26 -0300 Subject: [PATCH 12/14] Add method help docs --- .../help/removewalletpassword-help.txt | 19 ++++++++++++++ .../resources/help/setwalletpassword-help.txt | 25 +++++++++++++++++++ .../main/resources/help/unlockwallet-help.txt | 21 ++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 core/src/main/resources/help/removewalletpassword-help.txt create mode 100644 core/src/main/resources/help/setwalletpassword-help.txt create mode 100644 core/src/main/resources/help/unlockwallet-help.txt diff --git a/core/src/main/resources/help/removewalletpassword-help.txt b/core/src/main/resources/help/removewalletpassword-help.txt new file mode 100644 index 00000000000..73b6d311e91 --- /dev/null +++ b/core/src/main/resources/help/removewalletpassword-help.txt @@ -0,0 +1,19 @@ +removewalletpassword + +NAME +---- +removewalletpassword - remove a Bisq wallet's encryption password + +SYNOPSIS +-------- +removewalletpassword + --wallet-password=<wallet-password> + --timeout=<seconds> + +DESCRIPTION +----------- +Remove an encryption password from an encrypted Bisq wallet. + +EXAMPLES +-------- +$ ./bisq-cli --password=xyz --port=9998 removewalletpassword --wallet-password=mypassword diff --git a/core/src/main/resources/help/setwalletpassword-help.txt b/core/src/main/resources/help/setwalletpassword-help.txt new file mode 100644 index 00000000000..da372d9857a --- /dev/null +++ b/core/src/main/resources/help/setwalletpassword-help.txt @@ -0,0 +1,25 @@ +setwalletpassword + +NAME +---- +setwalletpassword - set Bisq wallet password + +SYNOPSIS +-------- +setwalletpassword + --wallet-password=<wallet-password> + --new-wallet-password=<new-wallet-password> + +DESCRIPTION +----------- +Encrypts a Bisq wallet with a password. If the optional new wallet password option is +present, a new wallet password replaces the existing password + +EXAMPLES +-------- +Encrypt an unencrypted Bisq wallet with a password: +$ ./bisq-cli --password=xyz --port=9998 setwalletpassword --wallet-password=mypassword + +Set a new password on a Bisq wallet that is already encrypted: +$ ./bisq-cli --password=xyz --port=9998 setwalletpassword --wallet-password=myoldpassword \ + --new-wallet-password=mynewpassword diff --git a/core/src/main/resources/help/unlockwallet-help.txt b/core/src/main/resources/help/unlockwallet-help.txt new file mode 100644 index 00000000000..388117caf25 --- /dev/null +++ b/core/src/main/resources/help/unlockwallet-help.txt @@ -0,0 +1,21 @@ +unlockwallet + +NAME +---- +unlockwallet - unlock an encrypted Bisq wallet + +SYNOPSIS +-------- +unlockwallet + --wallet-password=<wallet-password> + --timeout=<seconds> + +DESCRIPTION +----------- +Unlocks an encrypted Bisq wallet for a specified number of seconds. +The timeout can be manually overridden with the lockwallet command. + +EXAMPLES +-------- +Unlock a wallet encrypted with the wallet-password "mypassword" for 30 seconds: +$ ./bisq-cli --password=xyz --port=9998 unlockwallet --wallet-password=mypassword --timeout=30 From 04657d90547aa5a23d492b9b499df7a580dabc40 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sun, 17 Jan 2021 12:59:54 -0300 Subject: [PATCH 13/14] Explain example --- core/src/main/resources/help/lockwallet-help.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/main/resources/help/lockwallet-help.txt b/core/src/main/resources/help/lockwallet-help.txt index 6639dcef5ea..58cb5668abd 100644 --- a/core/src/main/resources/help/lockwallet-help.txt +++ b/core/src/main/resources/help/lockwallet-help.txt @@ -14,4 +14,5 @@ Locks an unlocked wallet before an unlockwallet timeout expires. EXAMPLES -------- +Immediately lock an encrypted wallet set to automatically lock in the future: $ ./bisq-cli --password=xyz --port=9998 lockwallet From 8907d6b4a8005c8621ec6527c1207f50ea432ab6 Mon Sep 17 00:00:00 2001 From: ghubstan <36207203+ghubstan@users.noreply.github.com> Date: Sun, 17 Jan 2021 13:05:07 -0300 Subject: [PATCH 14/14] Keep CLI method enum members in alphabetical order --- cli/src/main/java/bisq/cli/Method.java | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/cli/src/main/java/bisq/cli/Method.java b/cli/src/main/java/bisq/cli/Method.java index 037468b9bd0..c2490ee1d44 100644 --- a/cli/src/main/java/bisq/cli/Method.java +++ b/cli/src/main/java/bisq/cli/Method.java @@ -21,36 +21,36 @@ * Currently supported api methods. */ public enum Method { - createoffer, canceloffer, - getoffer, - getmyoffer, - getoffers, - getmyoffers, - takeoffer, - gettrade, - confirmpaymentstarted, confirmpaymentreceived, - keepfunds, - withdrawfunds, - getpaymentmethods, - getpaymentacctform, + confirmpaymentstarted, + createoffer, createpaymentacct, - getpaymentaccts, - getversion, - getbalance, getaddressbalance, + getbalance, getfundingaddresses, + getmyoffer, + getmyoffers, + getoffer, + getoffers, + getpaymentacctform, + getpaymentaccts, + getpaymentmethods, + gettrade, + gettransaction, + gettxfeerate, getunusedbsqaddress, + getversion, + keepfunds, + lockwallet, + registerdisputeagent, + removewalletpassword, sendbsq, sendbtc, - gettxfeerate, settxfeerate, - unsettxfeerate, - gettransaction, - lockwallet, - unlockwallet, - removewalletpassword, setwalletpassword, - registerdisputeagent + takeoffer, + unlockwallet, + unsettxfeerate, + withdrawfunds }