Giter Club home page Giter Club logo

ripple-lib-extensions's Introduction

ripple-lib-extensions's People

Contributors

alandotcom avatar clark800 avatar darkdarkdragon avatar dependabot[bot] avatar geertweening-admin avatar intelliot avatar okipol88 avatar r0bertz avatar shekenahglory avatar sublimator avatar wltsmrz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ripple-lib-extensions's Issues

How to use ripple-lib-extension

Hi guys,
sorry my ignorance in js and npm and so on, but I'm not able to use this library.
I have a root folder with the package.json to use RippleAPI, where all the node-modules were created.
Now I cloned this ripple-lib-extension into the root folder and?? If I try to use RippleOrderbook it sais it is not defined. Should I add something into the package.json and do some npm install?

Questions about transactionparser

Hello!

I've been fetching some transactions from Ripple:
https://ripple.com/build/data-api-v2/#get-transactions

I want to use this data for academic research, but I have a lot of questions about how to interpret the affected nodes. I've found some information in the API:

https://ripple.com/build/transactions/#transaction-results

in this official blog post:

https://ripple.com/dev-blog/calculating-balance-changes-for-transaction/#

and also looking at your code:

https://github.com/ripple/ripple-lib-extensions/blob/master/transactionparser/src/orderbookchanges.js

Where can I find more information?
For example, where did you get the information in this comment:

https://github.com/ripple/ripple-lib-extensions/blob/master/transactionparser/src/orderbookchanges.js#L71

Thank you very much.
Ramiro.

[ripple-lib-value] typecheck fails

value master % npm run typecheck

> [email protected] typecheck /Users/elliotlee/ripple/ripple-lib-extensions/value
> babel --optional runtime --blacklist flow -d build/flow/ src/ && flow check

src/index.js -> build/flow/index.js
src/iouvalue.js -> build/flow/iouvalue.js
src/value.js -> build/flow/value.js
src/xrpvalue.js -> build/flow/xrpvalue.js
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ build/flow/iouvalue.js:36:44

Cannot use Value as a type. A name can be used as a type only if it refers to a type definition, an interface
definition, or a class definition. To get the type of a non-class value, use typeof.

     33│
     34│   _createClass(IOUValue, [{
     35│     key: 'multiply',
     36│     value: function multiply(multiplicand: Value) {
     37│       if (multiplicand instanceof XRPValue) {
     38│         return _get(Object.getPrototypeOf(IOUValue.prototype), 'multiply', this).call(this, new IOUValue(multiplicand._value.times(rippleUnits)));
     39│       }


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ build/flow/iouvalue.js:44:37

Cannot use Value as a type. A name can be used as a type only if it refers to a type definition, an interface
definition, or a class definition. To get the type of a non-class value, use typeof.

     41│     }
     42│   }, {
     43│     key: 'divide',
     44│     value: function divide(divisor: Value) {
     45│       if (divisor instanceof XRPValue) {
     46│         return _get(Object.getPrototypeOf(IOUValue.prototype), 'divide', this).call(this, new IOUValue(divisor._value.times(rippleUnits)));
     47│       }
[...]

On Trade event in Orderbook doesnt seem to work

  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.

Orderbook clarification

this is not more on issue but is there any documentation on you ripple-lib-extensions orderbook because i'm confused whats what are the commands on this extensions :) like offer_removed and offer_change ?

What's the point of having XRPValue and IOUValue?

I thought the unit of XRPValue was drops. But it is not.

The only difference this makes is that when either of them is multiplied or divided by an XRPValue, that XRPValue is turned into drops before actually doing the multiplication or division. And this is not right.

Amount.prototype.ratio_human from the old ripple-lib core api had to work around this by multiplying the numerator by 1e6 if the denominator is XRPValue. This doesn't make sense to me.

[Orderbook] - 'transaction' and 'trade' event - unexpected behavior

The orderbook subscribes to the transaction stream of the rippled server. So all the transactions that are validated on the RCL are received by the the orderbook.
I double checked everything but I cannot find any line of code that separates the transactions and trades that belong to the book from the ones that don't.

I don't think this is intended because the callback for the trade event only has to numbers as parameter (TakerGets, and TakerPays amount). If the listener receives random trades and you can't even tell which asset pair it belongs to that would be pretty useless.

Also I used the code that parses the exchanges for the historical-database and passed all the transactions from the transaction stream (without the orderbook api). Then I added a little filter to remove all the transactions that don't belong to my pair (USD-XRP e.g) and still the orderbook trade event gave me more events than I got from the parser with the filter.
That was another point that seems suspicious

[ripple-lib-orderbook] not published to npm

It appears there's a different package called ripple-lib-orderbook which is not from this repo. I also don't have permission to publish the "ripple-lib-orderbook" package on npm. If we still want this package to be published to npm, I think we'll need to come up with a different name for it (or get in touch with the owner of the current "ripple-lib-orderbook" package and ask them to make us an owner of it).

Orderbook extension always crashes after running for a while

Every time I use the orderbook extension it crashes after running for a couple of hours with the following stack trace:

assert.js:89
throw new assert.AssertionError({
^
AssertionError: Offer total cannot be negative
at OrderBook._subtractOwnerOfferTotal (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:693:7)
at OrderBook._deleteOffer (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:660:16)
at OrderBook._processTransactionNode (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:448:18)
at Array.forEach (native)
at OrderBook._processTransaction (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:426:23)
at OrderBook._onTransaction (/home/bot/ripple-lib-extensions/orderbook/dist/npm/orderbook.js:378:14)
at emitOne (events.js:101:20)
at RestrictedConnection.emit (events.js:188:7)
at RestrictedConnection._onMessage (/home/bot/app/node_modules/ripple-lib/dist/npm/common/connection.js:123:17)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:191:7)

I tried with a variety of different asset pairs but every time I receive the same result. I use the orderbook extension just to receive the events emmited by it. And since this stack trace doesnt involve any of my own code I really think this is flaw in the code of the Orderbook.js.
What would happen if we just delete this assertion line ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.