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

Pr issue 6 #11

Merged
merged 4 commits into from Jul 8, 2018
Merged

Pr issue 6 #11

merged 4 commits into from Jul 8, 2018

Conversation

peertrade
Copy link
Contributor

@peertrade peertrade commented Jul 8, 2018

This implements the requests in issue #6 for the /trades api, namely:

  1. include payment method in the response
  2. include volume field to indicate precise amount of primary currency traded.

note that volume could be calculated previously by multiplying price*amount, but the floating point multiplication often leaves numbers like 1.999999999 instead of 2.

note also that primary currency does not mean basecurrency aka bitcoin. Rather, primary currency is always the currency that is 2nd in the market identifer, eg xmr_btc, btc is primary. or btc_usd, usd is primary. The rule in bisq is that fiat currencies are always primary against basecurrency (btc), and basecurrency is primary against other cryptocurrencies. So if one wants to know amount of btc traded for any given market, one would use this logic:

    list($left, $right) = explode('_', $market_id);
    $btc_amount = $right == 'BTC' ? $volume : $amount;

I needed to link to PaymentMethod.java in the apidoc, and it was escaping all html entities, so I added a capability to detect markdown-style links in an API description or notes.

Sample Response ( from the updated apidoc )

[
    {
        "direction": "SELL",
        "price": "2375.72500000",
        "amount": "0.05000000",
        "volume": "118.78620000",
        "payment_method": "SEPA",
        "trade_id": "BLBJHGL-b644851d-f822-418a-8035-955f7a02eff9-051",
        "trade_date": 1501095828824
    },
    ...
]

Copy link
Member

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ManfredKarrer ManfredKarrer merged commit 77c1f33 into bisq-network:master Jul 8, 2018
wiz added a commit that referenced this pull request Nov 12, 2019
Add market to Trades response (fix null page)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants