GithubHelp home page GithubHelp logo

kennell / rai Goto Github PK

View Code? Open in Web Editor NEW
20.0 6.0 2.0 44 KB

๐Ÿ—ฟ rai is a pythonic client for interacting with Raiblocks nodes

License: MIT License

Python 100.00%
raiblocks cryptocurrency python nano nano-currency

rai's Introduction

๐Ÿ—ฟ rai

PyPI Code Climate Travis

rai is a high-level, pythonic client for interacting with Raiblocks nodes. It allows you to easily build applications that make use of the Raiblocks cryptocurrency.

โš  rai is not yet suited for use in production systems. It only covers a limited set of node functionality and things may break in future versions.

Install

โš โš โš  On 2022-09-30 ownership and full control of PyPI package rai was handed over to simonbiggs. Please install this code from source if required. โš โš โš 

Note: rai requires a running Raiblocks node with RPC enabled. Read more about installing and configuring a node here.

Usage example

from rai import Wallet


wallet = Wallet(id='4A84E2353EA3F363094EC7844A33B395E2BFDFCE19506FAFC37C73E7653D430F')
print(wallet.total_balance)
# 2500000000
block = wallet.send(
    source='xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000',
    destination='xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000',
    amount='1000000'
)
print(block)
# 000D1BAEC8EC208142C99059B393051BAC8380F9B5A2E6B2489A277D81789F3F

ToDo priority

  • Implement all RPC calls
  • Write Sphinx documentation
  • Add usage examples
  • Test coverage

rai's People

Contributors

crolfe avatar kennell avatar

Stargazers

 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

Forkers

crolfe jrmtoubrhl

rai's Issues

Introduce AccountSet class

Currently, the accounts property of a Wallet instance simply returns a list of Account instances.

I am thinking about implementing a holder class named AccountSet which contains a set of Account's and returning that as the Wallet accounts property. This would allow for a cleaner API in some cases, e.g. with such a class one could do things like:

wallet = Wallet(id='AAAABBBBCCCCDDDD')
new_acc = wallet.accounts.new()
acc = wallet.accounts['xrb_123123123123123']

And by implementing __iter__ or a generator it would still be possible to iterate over all accounts in a comfortable way as it is right now:

wallet = Wallet(id='AAAABBBBCCCCDDDD')
for a in wallet.accounts:
    print(a.balance)

Any input/ideas on this is appreciated @crolfe @jordancoil @jdistler

where is the send method?

The README comes with an example of how to send a transaction, but where is the send method in the Wallet class?

Supported Python version(s)?

Which version of Python should we support?

Python 2.7 is end of life in 2020, but given this is a brand new library, and RaiBlocks itself is a fairly nascent technology, there shouldn't be much, if any, legacy code out there that needs 2.7 support.

Supporting both isn't too onerous using compatibility libraries such as six, but it's going to lock us out of using the newer features in 3.5+.

My vote is to try to officially support 3.4+, and try for unofficial/best-effort support of 2.7.

Either way, we should update the setup.py to reflect which version(s) we support, and look at testing against all supported versions using tox once CI gets setup.

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.