[bisq-network/bisq] Add rpc method 'getoffers' (#4329)

Stan notifications at github.com
Mon Jun 22 17:51:15 UTC 2020


The new method returns current buy or sell offers for a fiat ccy.

This PR should be reviewed/merged after PR [4324](https://github.com/bisq-network/bisq/pull/4324).

Changes include:

* New core.grpc classes
CoreOffersService
GrpcOffersService
model.OfferInfo

* CoreApi -- The new CoreOffersService is injected into CoreApi and
the old getOffers() and placeOffer() impls were moved into the
new CoreOffersService.  The getOffers implementation was re-done.
Other changes are just rearranging location of core method calls.

* GrpcServer -- The new GrpcOffersService replaced the old
GetOffersService and PlaceOfferService.

* grpc.proto -- The old GetOffers and PlaceOffer services were combined
into a single Offers service, and the PlaceOffer rpc was renamed
as CreateOffer.  These are the only substantive changes; the rest
is just rearranging location of the service defs in the file.
Also created a lighterweight OfferInfo proto message wrapper to
be passed between server & client (client has no access to core's
Offer and OfferPayload).

* OfferInfo -- A new wrapper around the OfferInfo proto message.

* CliMain -- The new GetOffers service stub was added.
Some (maybe too much) number and ccy formatting logic was
copied & modified from core.  Some tedius string formatting
was added too (needs to be tidied up).

* License comments were also copied to several classes, and I
made a mistake in reverting changes to the wrong file.

* Added 4 simple unit tests to cli/test.sh.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4329

-- Commit Summary --

  * Rename CoreWalletService -> CoreWalletsService
  * Add rpc wallet(s) protection tests
  * Add rpc method 'getfundingaddresses'
  * Replace duplicate code in getFundingAddresses
  * Add rpc method 'getaddressbalance'
  * Add rpc method 'createpaymentacct'
  * Call core wallets service methods from CoreApi
  * Factor duplicate unlocked wallet checks into new method
  * Replace Tuple3 with memoization
  * Merge pull request #2 from dmos62/Z-getfundingaddresses-patch
  * Refactor getFundingAddresses to use memoization
  * Rmove blank line
  * Add rpc method 'getpaymentaccts'
  * Return protos from funding address methods
  * Refactor AddressBalanceInfo display logic
  * Add license comment
  * Add license comment
  * Add license comment
  * Wrap Exception from core in gRPC StatusRuntimeException
  * Revert "Add license comment"
  * Re-add license comment
  * Remove try catch block
  * Add rpc method 'getoffers'
  * Do not use protobuf.OfferPayload.Direction in client
  * Fix comments
  * Refactor CLI output table formatting
  * Add 'getoffers' unit tests

-- File Changes --

    M cli/src/main/java/bisq/cli/CliMain.java (140)
    A cli/src/main/java/bisq/cli/CurrencyFormat.java (47)
    M cli/src/main/java/bisq/cli/PasswordCallCredentials.java (17)
    A cli/src/main/java/bisq/cli/TableFormat.java (116)
    M cli/test.sh (150)
    M core/src/main/java/bisq/core/grpc/CoreApi.java (175)
    A core/src/main/java/bisq/core/grpc/CoreOffersService.java (138)
    A core/src/main/java/bisq/core/grpc/CorePaymentAccountsService.java (74)
    R core/src/main/java/bisq/core/grpc/CoreWalletsService.java (129)
    A core/src/main/java/bisq/core/grpc/GrpcOffersService.java (105)
    A core/src/main/java/bisq/core/grpc/GrpcPaymentAccountsService.java (63)
    M core/src/main/java/bisq/core/grpc/GrpcServer.java (77)
    R core/src/main/java/bisq/core/grpc/GrpcWalletsService.java (81)
    M core/src/main/java/bisq/core/grpc/PasswordAuthInterceptor.java (17)
    A core/src/main/java/bisq/core/grpc/model/AddressBalanceInfo.java (60)
    A core/src/main/java/bisq/core/grpc/model/OfferInfo.java (215)
    M proto/src/main/proto/grpc.proto (120)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4329.patch
https://github.com/bisq-network/bisq/pull/4329.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4329
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200622/960fdb0d/attachment-0001.html>


More information about the bisq-github mailing list