Skip to main content

Raiblocks Python RPC client

Project description


prai 🙏
===========
Raiblocks Python RPC client

Install
-------
A somewhat stable version from pypi:

.. code-block:: bash

$ pip install prai

Or the most recent master version from Github:

.. code-block:: bash

$ git clone https://github.com/jxub/prai

Usage
-----
.. code-block:: Python

>>> from prai import Wallet, Account

# creating a wallet with the rai node url
>>> w = Wallet(http://localhost:7475)

>>> w.account_list()
{
"accounts" : [
]
}

>>> w.accounts_create(count=2)
{
"accounts": [
"xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000",
"xrb_1e5aqegc1jb7qe964u4adzmcezyo6o146zb8hm6dft8tkp79za3s00000000"
]
}

>>> w.account_balance("xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000")
{
"balance": "10000",
"pending": "10000"
}

# using unpacking to pass in the params with *
>>> w.send(*w.account_list()['accounts'], 10000)
{
"block": "000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B2489A277D81789F3F"
}

# query the same account as before
>>> w.account_balance("xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000")
{
"balance": "0",
"pending": "0"
}


Some notes
----------
Prai is a work in progress, so expect some rough edges and stay tuned for updates 🙈.

Roadmap
-------
- Finish basic API.
- Add some higher-level features, for example a simple e-commerce payment API.
- Add more validation and tests (ughhh).
- Add hashing of Rai addrsses to shorter to be better for end-user (??!)
🍻




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prai-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prai-1.0.0-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file prai-1.0.0.tar.gz.

File metadata

  • Download URL: prai-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for prai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 27d37db27ebf0fc0eff05512d7484350dbd7a6458876cae3b3b7ab63f3d1884d
MD5 447706146c2485ab34273336e6fd5e8c
BLAKE2b-256 cad72b77010383ba81fa08aafceceac607bc0531ec380917ef33e0f244202763

See more details on using hashes here.

File details

Details for the file prai-1.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for prai-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8cb1dab28d7c4fdae6d70e1e37bb08a7e66e5147dab6ed7f2b2485f94a915f3f
MD5 7650df85aeca0821e321cbd579d12238
BLAKE2b-256 e4ea423198b732e83fc750f108d8a7002da5dd1f6b35bfdc31be208aa1884d39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page