Giter Club home page Giter Club logo

python-ripple-lib's People

Contributors

arsenlosenko avatar hroff-1902 avatar jcperkins12 avatar

Stargazers

 avatar  avatar  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

python-ripple-lib's Issues

Parameters of RippleDataAPIClient functions are not used

Problem

The Ripple Data API server is not applying the parameters of the RippleDataAPIClient functions

Context

I run a script using this code every day and the the code seemed to be working fine until 2/19/2020.

  • If I submit the same information using the Requests module with the parameters packaged under the 'data' argument of Requests(), then the parameters are not applied.
  • If I submit the request with the parameters encoded into the URL then the parameters are correctly applied in the ripple data api server.

My environment:
Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32

Example

Data request using the Data API v2 Tool provided by Ripple [https://xrpl.org/data-api-v2-tool.html#get-account-value-stats] (https://xrpl.org/data-api-v2-tool.html#get-account-value-stats)

URL:

https://data.ripple.com/v2/accounts/rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn/stats/value?limit=2&descending=true&start=2020-02-20T01:00:00Z

Response:

{
  "result": "success",
  "count": 2,
  "marker": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn|20200229000000",
  "rows": [
    {
      "date": "2020-03-02T00:00:00Z",
      "account_value": "423.0136879999998",
      "balance_change_count": 0
    },
    {
      "date": "2020-03-01T00:00:00Z",
      "account_value": "423.0136879999957",
      "balance_change_count": 0
    }
  ]
}

When I try the equivalent request with the RippleDataAPIClient:

>>> import pandas as pd
>>> from ripple_api import RippleDataAPIClient
>>> ts = pd.Timestamp("2020-02-20 01:00:00").strftime("%Y-%m-%dT%H:%M:%SZ")
>>> ts
'2020-02-20T01:00:00Z'
>>> acct = "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn"
>>> api = RippleDataAPIClient("https://data.ripple.com")
>>> api.get_account_value_stats(acct, start=ts, limit=2, descending=True)

Response:

{'result': 'success',
 'count': 200,
 'marker': 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn|20141215000000',
 'rows': [{'date': '2014-05-29T00:00:00Z',
   'account_value': '100.0',
   'balance_change_count': 1},
  {'date': '2014-05-30T00:00:00Z',
   'account_value': '100.0',
   'balance_change_count': 0},
  {'date': '2014-05-31T00:00:00Z',
   'account_value': '100.0',
   'balance_change_count': 0},
  {'date': '2014-06-01T00:00:00Z',
   'account_value': '100.0',
   'balance_change_count': 0},
    ... for 196 more records

Invalid parameters.

The Account transaction example seems to be flawed. The message "Invalid parameters." is all it will produce. I have tried multi servers and multiple account.
Also, the amount must be a string if I read this correctly in the send_xrp function.

transactions example

Can we get an example of a tx query ?

I have tried different combinations of this.


from ripple_api import RippleDataAPIClient
from pprint import pprint

api = RippleDataAPIClient('https://data.ripple.com')
query_params = dict(type='payment')
get_tx = api.get_transactions()
pprint(get_tx)

TypeError: get_transactions() takes 1 positional argument but 2 were given

Authorization support

Hi, I've tried to connect to my node which is running with auth enabled but had no success.
Tried to specify credentials in URL as for basic auth as follows https://user:pass@host:port/ but got:
URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>.

It would be great if RippleRPCClient allowed to specify user and password as parameters to __init__ method, which would be passed then in Request of urllib.

Transactions can be signed locally

I have noticed that ripple only supports now local signing transactions.

Tries send_xrp method, got an error:
{'status': 'error', 'error': urllib.error.URLError(socket.gaierror(-2, 'Name or service not known'))}

Could someone provide please pythonic ripple transaction signing methods? thanks!

Add link to new Ripple xrpl-py library

Hi Arsen,
I don't know if you saw, but recently Ripple released an 'official' XRPL python library hosted at the XRP Ledger Foundation's github:

https://pypi.org/project/xrpl-py/
https://github.com/XRPLF/xrpl-py

I noticed your library hasn't been updated in a number of years, and was wondering if you are still maintaining it? Would you be interested in putting a link in your README to xrpl-py which is under active maintenance? I'm happy to submit a PR for this to your repo, but wanted to ask first!

Thanks,
Matt

Sending transactions

Hi, I'm trying to use your python-ripple-lib and I'm trying to make trancastion from one account on testnet to another. In the code bellow you can see, that I replace parameters from example by mine parameters, but I didn't figure out what this parameters mean. Would you mind explain it to me what should I insert to parameter seed and url for Account?

`rpc = RippleRPCClient('https://s.altnet.rippletest.net:51234/', username='', password='')
account_info = rpc.account_info('rUjtNMGKsDjaopy6X8wonVPAeWAGzugYiT')

taker = 'rfqRW3XUfB9uib2iMJU7rH1WHEnAtY33nw'
issuer = 'rUjtNMGKsDjaopy6X8wonVPAeWAGzugYiT'
seed = '<account_seed>'
account = Account('http://localhost:5005', issuer, seed)
tx_info = account.send_xrp(issuer=issuer, taker=taker, secret=seed, amount=10)`

Console gives me this error:
{'status': 'error', 'error': URLError(ConnectionRefusedError(61, 'Connection refused'),)}

offline transaction

Hi. does this library support offline transactions? by offline transactions I mean a transaction that can be signed locally.

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.