diff --git a/apitest/docs/api-beta-test-guide.md b/apitest/docs/api-beta-test-guide.md index 9929f4df75c..3b6396fcf61 100644 --- a/apitest/docs/api-beta-test-guide.md +++ b/apitest/docs/api-beta-test-guide.md @@ -637,19 +637,19 @@ protocol completed. There are three CLI commands that must be performed in coor ``` confirmpaymentstarted Buyer sends seller a message confirming payment has been sent. confirmpaymentreceived Seller sends buyer a message confirming payment has been received. -keepfunds Keep trade proceeds in their Bisq wallets. +closetrade Set trade state to CLOSED, and keep trade proceeds in user's Bisq wallet. OR -withdrawfunds Send trade proceeds to an external wallet. +withdrawfunds Set trade state to CLOSED, and send trade proceeds to an external wallet. ``` -The last two mutually exclusive commands (`keepfunds` or `withdrawfunds`) may seem unnecessary, but they are critical -because they inform the Bisq node that a trade’s state can be set to `CLOSED`. Please close out your trades with one +The last two mutually exclusive commands (`closetrade` or `withdrawfunds`) may seem unnecessary, but they are critical +because they tell the Bisq node to set a completed trade’s state `CLOSED`. Please close out your trades with one or the other command. Each of the CLI commands above takes one argument: `--trade-id=`: ``` $ ./bisq-cli --password=xyz --port=9998 confirmpaymentstarted --trade-id= $ ./bisq-cli --password=xyz --port=9999 confirmpaymentreceived --trade-id= -$ ./bisq-cli --password=xyz --port=9998 keepfunds --trade-id= +$ ./bisq-cli --password=xyz --port=9998 closetrade --trade-id= $ ./bisq-cli --password=xyz --port=9999 withdrawfunds --trade-id= --address= [--memo=<"memo">] ``` diff --git a/apitest/scripts/trade-simulation-utils.sh b/apitest/scripts/trade-simulation-utils.sh index 91e5f2bdd97..fee096fd17a 100755 --- a/apitest/scripts/trade-simulation-utils.sh +++ b/apitest/scripts/trade-simulation-utils.sh @@ -536,22 +536,22 @@ executetrade() { printbreak # Complete the trade on both sides - printdate "BOB $BOB_ROLE: Closing trade by keeping funds in Bisq wallet." - CMD="$CLI_BASE --port=$BOB_PORT keepfunds --trade-id=$OFFER_ID" + printdate "BOB $BOB_ROLE: Closing trade and keeping funds in Bisq wallet." + CMD="$CLI_BASE --port=$BOB_PORT closetrade --trade-id=$OFFER_ID" printdate "BOB CLI: $CMD" KEEP_FUNDS_MSG=$($CMD) - commandalert $? "Could close trade with keepfunds command." - # Print the keepfunds command's console output. + commandalert $? "Closed trade with closetrade command." + # Print the closetrade command's console output. printdate "$KEEP_FUNDS_MSG" sleeptraced 3 printbreak - printdate "ALICE (taker): Closing trade by keeping funds in Bisq wallet." - CMD="$CLI_BASE --port=$ALICE_PORT keepfunds --trade-id=$OFFER_ID" + printdate "ALICE (taker): Closing trade and keeping funds in Bisq wallet." + CMD="$CLI_BASE --port=$ALICE_PORT closetrade --trade-id=$OFFER_ID" printdate "ALICE CLI: $CMD" KEEP_FUNDS_MSG=$($CMD) - commandalert $? "Could close trade with keepfunds command." - # Print the keepfunds command's console output. + commandalert $? "Closed trade with closetrade command." + # Print the closetrade command's console output. printdate "$KEEP_FUNDS_MSG" sleeptraced 3 printbreak diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBSQOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBSQOfferTest.java index 5d43b935778..6a37a3d1217 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBSQOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBSQOfferTest.java @@ -162,10 +162,10 @@ public void testKeepFunds(final TestInfo testInfo) { genBtcBlocksThenWait(1, 1_000); var trade = bobClient.getTrade(tradeId); - logTrade(log, testInfo, "Alice's view before keeping funds", trade); + logTrade(log, testInfo, "Alice's view before closing trade", trade); - aliceClient.keepFunds(tradeId); - bobClient.keepFunds(tradeId); + aliceClient.closeTrade(tradeId); + bobClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = bobClient.getTrade(tradeId); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java index b9c761d3561..26ac9d24666 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java @@ -137,9 +137,9 @@ public void testKeepFunds(final TestInfo testInfo) { try { genBtcBlocksThenWait(1, 1_000); var trade = aliceClient.getTrade(tradeId); - logTrade(log, testInfo, "Alice's view before keeping funds", trade); - aliceClient.keepFunds(tradeId); - bobClient.keepFunds(tradeId); + logTrade(log, testInfo, "Alice's view before closing trade and keeping funds", trade); + aliceClient.closeTrade(tradeId); + bobClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = aliceClient.getTrade(tradeId); EXPECTED_PROTOCOL_STATUS.setState(BUYER_RECEIVED_PAYOUT_TX_PUBLISHED_MSG).setPhase(PAYOUT_PUBLISHED); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java index 210d58192ec..e0e2ee746bd 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferWithNationalBankAcctTest.java @@ -213,9 +213,9 @@ public void testKeepFunds(final TestInfo testInfo) { genBtcBlocksThenWait(1, 1_000); var trade = aliceClient.getTrade(tradeId); - logTrade(log, testInfo, "Alice's view before keeping funds", trade); - aliceClient.keepFunds(tradeId); - bobClient.keepFunds(tradeId); + logTrade(log, testInfo, "Alice's view before closing trade and keeping funds", trade); + aliceClient.closeTrade(tradeId); + bobClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = aliceClient.getTrade(tradeId); EXPECTED_PROTOCOL_STATUS.setState(BUYER_RECEIVED_PAYOUT_TX_PUBLISHED_MSG) diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java index 868d5c83b5c..d59bc02bc6c 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyXMROfferTest.java @@ -156,9 +156,9 @@ public void testKeepFunds(final TestInfo testInfo) { try { genBtcBlocksThenWait(1, 1_000); var trade = bobClient.getTrade(tradeId); - logTrade(log, testInfo, "Alice's view before keeping funds", trade); - aliceClient.keepFunds(tradeId); - bobClient.keepFunds(tradeId); + logTrade(log, testInfo, "Alice's view before closing trade and keeping funds", trade); + aliceClient.closeTrade(tradeId); + bobClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = bobClient.getTrade(tradeId); diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBSQOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBSQOfferTest.java index d830a78e13f..f4411c51789 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBSQOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBSQOfferTest.java @@ -155,11 +155,14 @@ public void testAlicesBtcWithdrawalToExternalAddress(final TestInfo testInfo) { genBtcBlocksThenWait(1, 1_000); var trade = aliceClient.getTrade(tradeId); - logTrade(log, testInfo, "Alice's view before withdrawing BTC funds to external wallet", trade); + logTrade(log, + testInfo, + "Alice's view before closing trade and withdrawing BTC funds to external wallet", + trade); String toAddress = bitcoinCli.getNewBtcAddress(); aliceClient.withdrawFunds(tradeId, toAddress, WITHDRAWAL_TX_MEMO); - // Bob keeps funds. - bobClient.keepFunds(tradeId); + // Bob closes trade and keeps funds. + bobClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = aliceClient.getTrade(tradeId); EXPECTED_PROTOCOL_STATUS.setState(WITHDRAW_COMPLETED) diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java index 8bd13fff096..9e205f5ef37 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java @@ -144,7 +144,7 @@ public void testBobsBtcWithdrawalToExternalAddress(final TestInfo testInfo) { logTrade(log, testInfo, "Bob's view before withdrawing funds to external wallet", trade); String toAddress = bitcoinCli.getNewBtcAddress(); bobClient.withdrawFunds(tradeId, toAddress, WITHDRAWAL_TX_MEMO); - aliceClient.keepFunds(tradeId); + aliceClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = bobClient.getTrade(tradeId); EXPECTED_PROTOCOL_STATUS.setState(WITHDRAW_COMPLETED) diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java index 247b5320164..ec048da8923 100644 --- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java +++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellXMROfferTest.java @@ -165,7 +165,7 @@ public void testAlicesBtcWithdrawalToExternalAddress(final TestInfo testInfo) { String toAddress = bitcoinCli.getNewBtcAddress(); aliceClient.withdrawFunds(tradeId, toAddress, WITHDRAWAL_TX_MEMO); - bobClient.keepFunds(tradeId); + bobClient.closeTrade(tradeId); genBtcBlocksThenWait(1, 1_000); trade = aliceClient.getTrade(tradeId); diff --git a/apitest/src/test/java/bisq/apitest/scenario/bot/BotClient.java b/apitest/src/test/java/bisq/apitest/scenario/bot/BotClient.java index 062ee742b19..3ae53d7d55c 100644 --- a/apitest/src/test/java/bisq/apitest/scenario/bot/BotClient.java +++ b/apitest/src/test/java/bisq/apitest/scenario/bot/BotClient.java @@ -282,12 +282,12 @@ public void sendConfirmPaymentReceivedMessage(String tradeId) { } /** - * Sends a 'keep funds in wallet message' for a trade with the given tradeId, + * Sends a 'closetrade' for a trade with the given tradeId, * or throws an exception. * @param tradeId */ - public void sendKeepFundsMessage(String tradeId) { - grpcClient.keepFunds(tradeId); + public void sendCloseTradeMessage(String tradeId) { + grpcClient.closeTrade(tradeId); } /** diff --git a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/BotProtocol.java b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/BotProtocol.java index 51d59e7537d..b090742a917 100644 --- a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/BotProtocol.java +++ b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/BotProtocol.java @@ -219,8 +219,8 @@ protected void printBotProtocolStep() { } }; - protected final Function keepFundsFromTrade = (trade) -> { - initProtocolStep.accept(KEEP_FUNDS); + protected final Function closeTrade = (trade) -> { + initProtocolStep.accept(CLOSE_TRADE); var isBuy = trade.getOffer().getDirection().equalsIgnoreCase(BUY); var isSell = trade.getOffer().getDirection().equalsIgnoreCase(SELL); var cliUserIsSeller = (this instanceof MakerBotProtocol && isBuy) || (this instanceof TakerBotProtocol && isSell); @@ -229,8 +229,8 @@ protected void printBotProtocolStep() { } else { createGetBalanceScript(); } - checkIfShutdownCalled("Interrupted before closing trade with 'keep funds' command."); - this.getBotClient().sendKeepFundsMessage(trade.getTradeId()); + checkIfShutdownCalled("Interrupted before closing trade with 'closetrade' command."); + this.getBotClient().sendCloseTradeMessage(trade.getTradeId()); return trade; }; diff --git a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/MakerBotProtocol.java b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/MakerBotProtocol.java index e251150cf16..3f757dbbd28 100644 --- a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/MakerBotProtocol.java +++ b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/MakerBotProtocol.java @@ -56,7 +56,7 @@ public void run() { : waitForPaymentStartedMessage.andThen(sendPaymentReceivedMessage); completeFiatTransaction.apply(trade); - Function closeTrade = waitForPayoutTx.andThen(keepFundsFromTrade); + Function closeTrade = waitForPayoutTx.andThen(this.closeTrade); closeTrade.apply(trade); currentProtocolStep = DONE; diff --git a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/ProtocolStep.java b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/ProtocolStep.java index def2a0bb663..2c8c8cd07f7 100644 --- a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/ProtocolStep.java +++ b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/ProtocolStep.java @@ -12,6 +12,6 @@ public enum ProtocolStep { SEND_PAYMENT_RECEIVED_CONFIRMATION_MESSAGE, WAIT_FOR_PAYMENT_RECEIVED_CONFIRMATION_MESSAGE, WAIT_FOR_PAYOUT_TX, - KEEP_FUNDS, + CLOSE_TRADE, DONE } diff --git a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/TakerBotProtocol.java b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/TakerBotProtocol.java index 22964d0f160..dd04b5c5bff 100644 --- a/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/TakerBotProtocol.java +++ b/apitest/src/test/java/bisq/apitest/scenario/bot/protocol/TakerBotProtocol.java @@ -55,7 +55,7 @@ public void run() { : sendPaymentStartedMessage.andThen(waitForPaymentReceivedConfirmation); completeFiatTransaction.apply(trade); - Function closeTrade = waitForPayoutTx.andThen(keepFundsFromTrade); + Function closeTrade = waitForPayoutTx.andThen(this.closeTrade); closeTrade.apply(trade); currentProtocolStep = DONE; diff --git a/apitest/src/test/java/bisq/apitest/scenario/bot/script/BashScriptGenerator.java b/apitest/src/test/java/bisq/apitest/scenario/bot/script/BashScriptGenerator.java index d41e8a1acd3..4c6b73f8084 100644 --- a/apitest/src/test/java/bisq/apitest/scenario/bot/script/BashScriptGenerator.java +++ b/apitest/src/test/java/bisq/apitest/scenario/bot/script/BashScriptGenerator.java @@ -167,10 +167,10 @@ public File createPaymentReceivedScript(TradeInfo trade) { } public File createKeepFundsScript(TradeInfo trade) { - String paymentStartedCmd = format("%s keepfunds --trade-id=%s", cliBase, trade.getTradeId()); + String paymentStartedCmd = format("%s closetrade --trade-id=%s", cliBase, trade.getTradeId()); String getTradeCmd = format("%s gettrade --trade-id=%s", cliBase, trade.getTradeId()); String getBalanceCmd = format("%s getbalance", cliBase); - return createCliScript("keepfunds.sh", + return createCliScript("closetrade.sh", paymentStartedCmd, "sleep 2", getTradeCmd, diff --git a/cli/src/main/java/bisq/cli/CliMain.java b/cli/src/main/java/bisq/cli/CliMain.java index 1170774e3e7..b0bd24b84c8 100644 --- a/cli/src/main/java/bisq/cli/CliMain.java +++ b/cli/src/main/java/bisq/cli/CliMain.java @@ -525,15 +525,15 @@ public static void run(String[] args) { out.printf("trade %s payment received message sent%n", tradeId); return; } - case keepfunds: { + case closetrade: { var opts = new GetTradeOptionParser(args).parse(); if (opts.isForHelp()) { out.println(client.getMethodHelp(method)); return; } var tradeId = opts.getTradeId(); - client.keepFunds(tradeId); - out.printf("funds from trade %s saved in bisq wallet%n", tradeId); + client.closeTrade(tradeId); + out.printf("trade %s is closed%n", tradeId); return; } case withdrawfunds: { @@ -864,10 +864,10 @@ private static void printHelp(OptionParser parser, @SuppressWarnings("SameParame stream.println(); stream.format(rowFormat, confirmpaymentreceived.name(), "--trade-id=", "Confirm payment received"); stream.println(); - stream.format(rowFormat, keepfunds.name(), "--trade-id=", "Keep received funds in Bisq wallet"); + stream.format(rowFormat, closetrade.name(), "--trade-id=", "Close completed trade"); stream.println(); stream.format(rowFormat, withdrawfunds.name(), "--trade-id= --address= \\", - "Withdraw received funds to external wallet address"); + "Withdraw received trade funds to external wallet address"); stream.format(rowFormat, "", "[--memo=<\"memo\">]", ""); stream.println(); stream.format(rowFormat, getpaymentmethods.name(), "", "Get list of supported payment account method ids"); diff --git a/cli/src/main/java/bisq/cli/GrpcClient.java b/cli/src/main/java/bisq/cli/GrpcClient.java index 99af68ca30d..57312abc034 100644 --- a/cli/src/main/java/bisq/cli/GrpcClient.java +++ b/cli/src/main/java/bisq/cli/GrpcClient.java @@ -372,8 +372,8 @@ public void confirmPaymentReceived(String tradeId) { tradesServiceRequest.confirmPaymentReceived(tradeId); } - public void keepFunds(String tradeId) { - tradesServiceRequest.keepFunds(tradeId); + public void closeTrade(String tradeId) { + tradesServiceRequest.closeTrade(tradeId); } public void withdrawFunds(String tradeId, String address, String memo) { diff --git a/cli/src/main/java/bisq/cli/Method.java b/cli/src/main/java/bisq/cli/Method.java index 273150aad5d..3e097238a86 100644 --- a/cli/src/main/java/bisq/cli/Method.java +++ b/cli/src/main/java/bisq/cli/Method.java @@ -22,6 +22,7 @@ */ public enum Method { canceloffer, + closetrade, confirmpaymentreceived, confirmpaymentstarted, createoffer, @@ -45,7 +46,6 @@ public enum Method { gettxfeerate, getunusedbsqaddress, getversion, - keepfunds, lockwallet, registerdisputeagent, removewalletpassword, diff --git a/cli/src/main/java/bisq/cli/request/TradesServiceRequest.java b/cli/src/main/java/bisq/cli/request/TradesServiceRequest.java index cf95506615e..080be70e026 100644 --- a/cli/src/main/java/bisq/cli/request/TradesServiceRequest.java +++ b/cli/src/main/java/bisq/cli/request/TradesServiceRequest.java @@ -17,10 +17,10 @@ package bisq.cli.request; +import bisq.proto.grpc.CloseTradeRequest; import bisq.proto.grpc.ConfirmPaymentReceivedRequest; import bisq.proto.grpc.ConfirmPaymentStartedRequest; import bisq.proto.grpc.GetTradeRequest; -import bisq.proto.grpc.KeepFundsRequest; import bisq.proto.grpc.TakeOfferReply; import bisq.proto.grpc.TakeOfferRequest; import bisq.proto.grpc.TradeInfo; @@ -86,12 +86,12 @@ public void confirmPaymentReceived(String tradeId) { grpcStubs.tradesService.confirmPaymentReceived(request); } - public void keepFunds(String tradeId) { - var request = KeepFundsRequest.newBuilder() + public void closeTrade(String tradeId) { + var request = CloseTradeRequest.newBuilder() .setTradeId(tradeId) .build(); //noinspection ResultOfMethodCallIgnored - grpcStubs.tradesService.keepFunds(request); + grpcStubs.tradesService.closeTrade(request); } public void withdrawFunds(String tradeId, String address, String memo) { diff --git a/core/src/main/java/bisq/core/api/CoreApi.java b/core/src/main/java/bisq/core/api/CoreApi.java index 9808d2e7d9f..2794db47bbb 100644 --- a/core/src/main/java/bisq/core/api/CoreApi.java +++ b/core/src/main/java/bisq/core/api/CoreApi.java @@ -315,8 +315,8 @@ public void confirmPaymentReceived(String tradeId) { coreTradesService.confirmPaymentReceived(tradeId); } - public void keepFunds(String tradeId) { - coreTradesService.keepFunds(tradeId); + public void closeTrade(String tradeId) { + coreTradesService.closeTrade(tradeId); } public void withdrawFunds(String tradeId, String address, String memo) { diff --git a/core/src/main/java/bisq/core/api/CoreTradesService.java b/core/src/main/java/bisq/core/api/CoreTradesService.java index 3184ff31477..f28e2f36cc2 100644 --- a/core/src/main/java/bisq/core/api/CoreTradesService.java +++ b/core/src/main/java/bisq/core/api/CoreTradesService.java @@ -180,14 +180,14 @@ void confirmPaymentReceived(String tradeId) { } } - void keepFunds(String tradeId) { + void closeTrade(String tradeId) { coreWalletsService.verifyWalletsAreAvailable(); coreWalletsService.verifyEncryptedWalletIsUnlocked(); verifyTradeIsNotClosed(tradeId); var trade = getOpenTrade(tradeId).orElseThrow(() -> new IllegalArgumentException(format("trade with id '%s' not found", tradeId))); - log.info("Keeping funds received from trade {}", tradeId); + log.info("Closing trade {}", tradeId); tradeManager.onTradeCompleted(trade); } diff --git a/core/src/main/resources/help/closetrade-help.txt b/core/src/main/resources/help/closetrade-help.txt new file mode 100644 index 00000000000..a26d4310b2c --- /dev/null +++ b/core/src/main/resources/help/closetrade-help.txt @@ -0,0 +1,29 @@ +closetrade + +NAME +---- +closetrade - close open trade + +SYNOPSIS +-------- +closetrade + --trade-id= + +DESCRIPTION +----------- +This final step in the trade protocol moves a completed trade from the open trades list +to the closed trade list, where it becomes part of the user's trade history. +The step is necessary for correct transition of a trade's state to CLOSED. + +The alternative way to close a trade is to send the received BTC to an external +BTC wallet, using the withdrawfunds command. + +OPTIONS +------- +--trade-id + The ID of the completed trade (the full offer-id). + +EXAMPLES +-------- +The BTC buyer or seller closes out trade 83e8b2e2-51b6-4f39-a748-3ebd29c22aea: +$ ./bisq-cli --password=xyz --port=9998 closetrade --trade-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea diff --git a/core/src/main/resources/help/keepfunds-help.txt b/core/src/main/resources/help/keepfunds-help.txt deleted file mode 100644 index 4e8232df043..00000000000 --- a/core/src/main/resources/help/keepfunds-help.txt +++ /dev/null @@ -1,31 +0,0 @@ -keepfunds - -NAME ----- -keepfunds - keep BTC received during a trade in Bisq wallet - -SYNOPSIS --------- -keepfunds - --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 send 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 index edc69dddcb8..cdee6362f4a 100644 --- a/core/src/main/resources/help/withdrawfunds-help.txt +++ b/core/src/main/resources/help/withdrawfunds-help.txt @@ -2,7 +2,7 @@ withdrawfunds NAME ---- -withdrawfunds - send BTC received during a trade to an external BTC wallet +withdrawfunds - send BTC received during a trade to an external BTC wallet and close trade SYNOPSIS -------- @@ -16,10 +16,10 @@ 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 alternative way to close out the trade is to keep the received BTC in the Bisq wallet +with the closetrade command. -The buyer needs to complete the trade protocol using the keepfunds or withdrawfunds or command. +The buyer needs to complete the trade protocol using the closetrade or withdrawfunds 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. @@ -29,11 +29,11 @@ OPTIONS The ID of the trade (the full offer-id). --address - The destination btc address for the send btc transaction. + The destination btc address for the btc transaction. --memo - An optional memo to be saved with the send btc transaction. - A multi word memo must be enclosed in double quotes. + An optional memo to be saved with the btc transaction. + A multi-word memo must be enclosed in double quotes. EXAMPLES -------- diff --git a/daemon/src/main/java/bisq/daemon/grpc/GrpcTradesService.java b/daemon/src/main/java/bisq/daemon/grpc/GrpcTradesService.java index 4d2605b109a..38d03382552 100644 --- a/daemon/src/main/java/bisq/daemon/grpc/GrpcTradesService.java +++ b/daemon/src/main/java/bisq/daemon/grpc/GrpcTradesService.java @@ -23,14 +23,14 @@ import bisq.core.trade.model.bisq_v1.Trade; import bisq.core.trade.model.bsq_swap.BsqSwapTrade; +import bisq.proto.grpc.CloseTradeReply; +import bisq.proto.grpc.CloseTradeRequest; import bisq.proto.grpc.ConfirmPaymentReceivedReply; import bisq.proto.grpc.ConfirmPaymentReceivedRequest; import bisq.proto.grpc.ConfirmPaymentStartedReply; import bisq.proto.grpc.ConfirmPaymentStartedRequest; import bisq.proto.grpc.GetTradeReply; import bisq.proto.grpc.GetTradeRequest; -import bisq.proto.grpc.KeepFundsReply; -import bisq.proto.grpc.KeepFundsRequest; import bisq.proto.grpc.TakeOfferReply; import bisq.proto.grpc.TakeOfferRequest; import bisq.proto.grpc.WithdrawFundsReply; @@ -152,11 +152,11 @@ public void confirmPaymentReceived(ConfirmPaymentReceivedRequest req, } @Override - public void keepFunds(KeepFundsRequest req, - StreamObserver responseObserver) { + public void closeTrade(CloseTradeRequest req, + StreamObserver responseObserver) { try { - coreApi.keepFunds(req.getTradeId()); - var reply = KeepFundsReply.newBuilder().build(); + coreApi.closeTrade(req.getTradeId()); + var reply = CloseTradeReply.newBuilder().build(); responseObserver.onNext(reply); responseObserver.onCompleted(); } catch (Throwable cause) { @@ -189,10 +189,9 @@ final Optional rateMeteringInterceptor() { new HashMap<>() {{ put(getGetTradeMethod().getFullMethodName(), new GrpcCallRateMeter(1, SECONDS)); put(getTakeOfferMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); - // put(getTakeBsqSwapOfferMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); put(getConfirmPaymentStartedMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); put(getConfirmPaymentReceivedMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); - put(getKeepFundsMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); + put(getCloseTradeMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); put(getWithdrawFundsMethod().getFullMethodName(), new GrpcCallRateMeter(1, MINUTES)); }} ))); diff --git a/proto/src/main/proto/grpc.proto b/proto/src/main/proto/grpc.proto index 646ab0a85c8..1af7e69ab01 100644 --- a/proto/src/main/proto/grpc.proto +++ b/proto/src/main/proto/grpc.proto @@ -394,7 +394,7 @@ service Trades { } rpc ConfirmPaymentReceived (ConfirmPaymentReceivedRequest) returns (ConfirmPaymentReceivedReply) { } - rpc KeepFunds (KeepFundsRequest) returns (KeepFundsReply) { + rpc CloseTrade (CloseTradeRequest) returns (CloseTradeReply) { } rpc WithdrawFunds (WithdrawFundsRequest) returns (WithdrawFundsReply) { } @@ -433,11 +433,11 @@ message GetTradeReply { TradeInfo trade = 1; } -message KeepFundsRequest { +message CloseTradeRequest { string tradeId = 1; } -message KeepFundsReply { +message CloseTradeReply { } message WithdrawFundsRequest {