From: Andrew LeCody <andrewlecody@gmail.com>
To: Marcel Jamin <marcel@jamin.net>,
Bitcoin Protocol Discussion
<bitcoin-dev@lists.linuxfoundation.org>,
Luke Dashjr <luke@dashjr.org>
Subject: Re: [bitcoin-dev] Currency/exchange rate information API
Date: Mon, 13 Mar 2017 18:10:57 +0000 [thread overview]
Message-ID: <CAEX2NSd7GAHa+-ge6r8RORnyLBV0j6ET5L1iMNH+YOWhO2VCgw@mail.gmail.com> (raw)
In-Reply-To: <CAAUq487pjZYTZJDNv2TL8Vwh-nGqaFVZLG1v4VUJu=ejcx45nw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2783 bytes --]
This formatting of JSON isn't unheard of though, it's typically called JSON
Streaming[1]. As long as exchanges implementing the API actually follow the
BIP and keep one JSON object per line, it shouldn't be a problem to decode.
1. https://en.wikipedia.org/wiki/JSON_Streaming
On Tue, Mar 7, 2017 at 8:07 AM Marcel Jamin via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:
> > Why are multiple results separated by a line-feed rather than using a
> JSON Array?
> > * Clients ought to cache historical data, and using a line-feed format
> allows them to simply append to a cache file.
> > * Parsing JSON typically requires the entire data parsed together as a
> single memory object. Using simple lines to separate results, however,
> allows parsing a single result at a time.
> > What if long descriptions require line and paragraph breaks?
> > * Clients should word-wrap long lines, and JSON escapes newlines as "\n"
> which can be used doubly ("\n\n") for paragraph breaks.
>
> I'd file this under premature optimization at the cost of
> interoperability. If you use JSON, then please use it properly.
>
> I'd also say it's the job of the parser to offer a way of doing that,
> e.g. in .NET you can easily achieve that with Newtonsoft's JSON
> parser:
> http://stackoverflow.com/questions/20374083/deserialize-json-array-stream-one-item-at-a-time
> .
>
> On 4 March 2017 at 09:27, Luke Dashjr via bitcoin-dev
> <bitcoin-dev@lists.linuxfoundation.org> wrote:
> >
> > Investigating what it would take to add fiat currency information to
> Bitcoin
> > Knots, I noticed Electrum currently has many implementations, one for
> each
> > exchange rate provider, due to lack of a common format for such data.
> >
> > Therefore, I put together an initial draft of a BIP that could
> standardise
> > this so wallets (or other software) and exchange rate providers can
> simply
> > interoperate without a lot of overhead reimplementing the same thing many
> > ways.
> >
> > One thing I am unsure about, is that currently this draft requires using
> XBT
> > (as BTC) for Bitcoin amounts. It would seem nicer to use satoshis, but
> those
> > don't really have a pseudo-ISO currency code to fit in nicely...
> >
> > Current draft here:
> >
> https://github.com/luke-jr/bips/blob/bip-xchgrate/bip-xchgrate.mediawiki
> >
> > Thoughts? Anything critical missing? Ways to make the interface better?
> >
> > Luke
> > _______________________________________________
> > bitcoin-dev mailing list
> > bitcoin-dev@lists.linuxfoundation.org
> > https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
[-- Attachment #2: Type: text/html, Size: 4983 bytes --]
prev parent reply other threads:[~2017-03-13 18:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-04 8:27 [bitcoin-dev] Currency/exchange rate information API Luke Dashjr
2017-03-04 15:18 ` アルム カールヨハン
2017-03-06 5:37 ` Tim Ruffing
2017-03-06 7:09 ` Luke Dashjr
2017-03-06 8:14 ` Jonas Schnelli
2017-03-06 21:54 ` Tim Ruffing
2017-03-06 22:02 ` Tim Ruffing
2017-03-06 22:21 ` Luke Dashjr
2017-03-06 22:14 ` Luke Dashjr
2017-03-06 22:30 ` Tim Ruffing
2017-03-06 22:38 ` Tim Ruffing
2017-03-06 23:14 ` Andreas Schildbach
2017-03-07 9:29 ` Marcel Jamin
2017-03-13 18:10 ` Andrew LeCody [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEX2NSd7GAHa+-ge6r8RORnyLBV0j6ET5L1iMNH+YOWhO2VCgw@mail.gmail.com \
--to=andrewlecody@gmail.com \
--cc=bitcoin-dev@lists.linuxfoundation.org \
--cc=luke@dashjr.org \
--cc=marcel@jamin.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox