ripple / ripple-lib-extensions

[Deprecated] A collection of extensions to ripple-lib. Instead, see https://github.com/XRPLF/xrpl.js
https://github.com/XRPLF/xrpl.js
22 stars 31 forks source link

On Trade event in Orderbook doesnt seem to work #26

Closed flxh closed 8 years ago

flxh commented 8 years ago
  const ob_bid = Orderbook.createOrderBook(api, {
        currency_gets: XRP.currency,
        currency_pays: USD.currency,
        issuer_pays: USD.issuer
    });

    ob_bid.on('trade', function(pays,gets){
       console.log(pays);
       console.log(gets);
    });

This code outputs:

`IOUValue { _value: { [String: '216.2619683587484'] s: 1, e: 2, c: [ 216, 26196835874840 ] } } XRPValue { _value: { [String: '33528020514'] s: 1, e: 10, c: [ 33528020514 ] } }

Process finished with exit code 139`

This doesn't seem like intended behavior to me. Hopefully somebody can fix this. I was using this pretty extensively in the last couple of days.

flxh commented 8 years ago

Seems like this strange formating is rigth indeed:

`IOUValue { _value: { [String: '216.2619683587484'] s: 1, e: 2, c: [ 216, 26196835874840 ] } } XRPValue { _value: { [String: '33528020514'] s: 1, e: 10, c: [ 33528020514 ] } }

Never saw something like this. Regarding the weird exit code: That was an issue with node js which could be fixed by updating to Node 6.x

So it looks like it was just an unfavorable combination of strange things not really an issue with this lib.