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

API BSQ swap simulation script and doc updates #5 #5876

Merged
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5924312
Adjust bsq-swap-offer related gRPC services & msgs
ghubstan Nov 11, 2021
c6aceb0
Adjust bsq-swap-offer related gRPC daemon services
ghubstan Nov 11, 2021
5d63fd7
Partially adjust api proto wrappers for bsq-swap support
ghubstan Nov 11, 2021
713b309
Add String getRole(BsqSwapTrade trade) method
ghubstan Nov 11, 2021
521495c
Add conveniences isFiatOffer(offer), isAltcoinOffer(offer)
ghubstan Nov 11, 2021
3dfbf3f
Partially adjust core api for bsq-swap support
ghubstan Nov 11, 2021
16be357
Paritally adjust bsq-swap-offer related gRPC CLI side classes
ghubstan Nov 11, 2021
c5f50b5
Paritally adjust bsq-swap-offer related apitest cases
ghubstan Nov 11, 2021
564303a
Normalize API gRPC bsq-swap related protos & wrappers
ghubstan Nov 12, 2021
9f01279
Merge branch 'master' into 1-basic-api-bsqswap-support
ghubstan Nov 12, 2021
fc53ca4
Add CLI output IntegerColumn
ghubstan Nov 14, 2021
4ca878a
Adjust API 'gettrade' for Bsq swaps
ghubstan Nov 14, 2021
d8f1e44
Try to hide from pesky codacy
ghubstan Nov 14, 2021
b65cc9c
Merge branch 'master' into 1-basic-api-bsqswap-support
ghubstan Nov 23, 2021
17277c4
Remove Get/Take BSQSwap Offer/Trade rpc service defs
ghubstan Nov 24, 2021
f88c151
Refactor GrpcTradesService: use GetTrade & TakeOffer services for BSQ…
ghubstan Nov 24, 2021
3aae052
Refactor core.api trade service implemenentations for BSQ swaps
ghubstan Nov 24, 2021
0c5c343
Adjust CLI to support getting/taking BSQ swaps
ghubstan Nov 24, 2021
6403fc1
Adjust apitest cases to rpc BSQ wwap related changes
ghubstan Nov 24, 2021
c177b3b
Merge branch 'master' into 2-api-bsq-swap-scratch
ghubstan Nov 24, 2021
00a5e2b
Merge branch 'master' into 2-refactor-api-bsqswap-support
ghubstan Nov 25, 2021
3077be5
Remove API createoffer's paymentAcctId request param (BSQ swap)
ghubstan Nov 25, 2021
b1c872c
Adjust createoffer opt parser/test for bsq swaps
ghubstan Nov 25, 2021
35aeb61
Adjust createoffer opt parser for bsq swaps
ghubstan Nov 25, 2021
eff1084
Tighten createoffer param validation (only bsq swaps supported)
ghubstan Nov 25, 2021
15621d4
Re-@Disable method tests (don't run 2x from gradle)
ghubstan Nov 25, 2021
132ecc9
Adjust CliMain's createoffer for BSQ swaps
ghubstan Nov 25, 2021
0aa0852
Add CLI createoffer smoketest (for bsq swaps)
ghubstan Nov 25, 2021
05d1916
Fix help text typo
ghubstan Nov 26, 2021
64f228d
Make rpc GetOfferCategory service work for my+avail offers
ghubstan Nov 27, 2021
b95e4b3
Block attempts to edit BsqSwap offers from CLI
ghubstan Nov 27, 2021
000fe9b
Test blocking attempts to edit BsqSwap offers on server
ghubstan Nov 27, 2021
b5981b5
There is no --swap opt in editoffer command
ghubstan Nov 27, 2021
0d8559d
Force rebuild after github action ECONNRESET
ghubstan Nov 27, 2021
66115f3
Revert "There is no --swap opt in editoffer command"
ghubstan Nov 28, 2021
1b7e43a
Add apitest/scripts/bsqswap-simulation.sh script
ghubstan Nov 28, 2021
8b2dec7
Remove unused function outputs
ghubstan Nov 28, 2021
6b89254
Adjust core api method help docs for bsq swaps
ghubstan Nov 29, 2021
b1dd205
Allow unrecognized options in OfferIdOptionParser where appropriate
ghubstan Nov 29, 2021
a1db0d1
Update API docs for Bitcoin Core version v22.0
ghubstan Nov 29, 2021
3015554
Adjust API beta-test guide for BSQ swaps
ghubstan Nov 29, 2021
946ca46
Merge branch 'master' into 5-api-bsqswap-simulation-n-docs-update
ghubstan Nov 30, 2021
bb68605
Add missing --currency-code=bsq param to createoffer example
ghubstan Dec 3, 2021
f195b76
Tell user bsqswap offer cannot be edited, but can be canceled at no c…
ghubstan Dec 3, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 28 additions & 3 deletions apitest/docs/api-beta-test-guide.md
Expand Up @@ -372,6 +372,21 @@ The `trade-simulation.sh` script options that would generate the previous `creat
$ apitest/scripts/trade-simulation.sh -d sell -c jp -m 0.5 -a 0.125
```

The `createoffer` command can also be used to create BSQ swap offers, where trade execution is performed immediately
after a BSQ swap offer is taken. To swap 0.5 BTC for BSQ at a price of 0.00005 BSQ per 1 BTC:
```
$ ./bisq-cli --password=xyz --port=9998 createoffer \
--swap=true \
--direction=BUY \
--amount=0.5 \
--fixed-price=0.00005
```

The `bsqswap-simulation.sh` script options that would generate the previous `createoffer` example is:
```
$ apitest/scripts/bsqswap-simulation.sh -d buy -a 0.5 -f 0.00005
```

### Browsing Your Own Offers

There are different commands to browse available offers you can take, and offers you created.
Expand Down Expand Up @@ -530,16 +545,18 @@ A CLI user browses available offers with the getoffers command. For example, th
$ ./bisq-cli --password=xyz --port=9998 getoffers --direction=SELL --currency-code=EUR
```

And takes one of the available offers with an EUR payment account ( id `fe20cdbd-22be-4b8a-a4b6-d2608ff09d6e`)
Then takes one of the available offers with an EUR payment account ( id `fe20cdbd-22be-4b8a-a4b6-d2608ff09d6e`)
with the `takeoffer` command:
```
$ ./bisq-cli --password=xyz --port=9998 takeoffer \
--offer-id=83e8b2e2-51b6-4f39-a748-3ebd29c22aea \
--payment-account=fe20cdbd-22be-4b8a-a4b6-d2608ff09d6e \
--fee-currency=btc
```
The taken offer will be used to create a trade contract. The next section describes how to use the Api to execute
the trade.
Depending on the offer type, the taken offer will be used to (1) create a trade contract, or (2) execute a BSQ swap.

The next section describes how to use the Api to execute a trade. The following <b>Completing a BSQ Swap Trade</b>
section explains how to use the `takeoffer` command to complete a BSQ swap.

### Completing Trade Protocol

Expand Down Expand Up @@ -598,6 +615,14 @@ $ ./bisq-cli --password=xyz --port=9998 keepfunds --trade-id=<trade-id>
$ ./bisq-cli --password=xyz --port=9999 withdrawfunds --trade-id=<trade-id> --address=<btc-address> [--memo=<"memo">]
```

### Completing a BSQ Swap Trade

The `takeoffer` command will immediately perform the BSQ swap, assuming both sides' wallets have sufficient BTC and
BSQ to cover the trade amount, and maker or taker fee. It takes one argument: `--offer-id=<offer-id>`:
```
$ ./bisq-cli --password=xyz --port=9998 takeoffer --offer-id=Xge8b2e2-51b6-3TOOB-z748-3ebd29c2kj99
```

## Shutting Down Test Harness

The test harness should cleanly shutdown all the background apps in proper order after entering ^C.
Expand Down