Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core api method help docs #5084

Merged
merged 15 commits into from
Jan 21, 2021
5 changes: 3 additions & 2 deletions cli/src/main/java/bisq/cli/CliMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -806,11 +806,12 @@ 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.format(rowFormat, "", "[--memo=<\"memo\">]", "");
stream.println();
stream.format(rowFormat, gettxfeerate.name(), "", "Get current tx fee rate in sats/byte");
stream.println();
Expand Down
44 changes: 22 additions & 22 deletions cli/src/main/java/bisq/cli/Method.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/bisq/core/api/CoreApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 25 additions & 0 deletions core/src/main/resources/help/canceloffer-help.txt
Original file line number Diff line number Diff line change
@@ -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

27 changes: 27 additions & 0 deletions core/src/main/resources/help/confirmpaymentreceived-help.txt
Original file line number Diff line number Diff line change
@@ -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
26 changes: 26 additions & 0 deletions core/src/main/resources/help/confirmpaymentstarted-help.txt
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions core/src/main/resources/help/createpaymentacct-help.txt
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions core/src/main/resources/help/getaddressbalance-help.txt
Original file line number Diff line number Diff line change
@@ -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
30 changes: 30 additions & 0 deletions core/src/main/resources/help/getbalance-help.txt
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions core/src/main/resources/help/getmyoffer-help.txt
Original file line number Diff line number Diff line change
@@ -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

33 changes: 33 additions & 0 deletions core/src/main/resources/help/getmyoffers-help.txt
Original file line number Diff line number Diff line change
@@ -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


26 changes: 26 additions & 0 deletions core/src/main/resources/help/getoffer-help.txt
Original file line number Diff line number Diff line change
@@ -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

Loading