Skip to main content

Raiden Python Client Library

Project description

raiden_py

Raiden Python Client Library

Installation

python 3.7+

pip install raiden-py

Documentation

https://viraja1.github.io/raiden_py/docs/raiden_py/raiden.html

Sample Usage

from raiden_py import Raiden
raiden = Raiden("http://localhost:5001", "v1")

# Querying Information About Your Raiden Node
raiden.get_address()

# Register a token
raiden.register_token(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C')

# Get a list of all unsettled channels
raiden.get_channels()

# Get a list of all unsettled channels for the given token address.
raiden.get_channels_token(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C')

#  Query information about one of your channels
raiden.get_channel_info(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                        partner_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b')

# Get a list of addresses of all registered tokens.
raiden.get_token_addresses()

# Get the address of the corresponding token network for the given token, if the token is registered.
raiden.get_token_network_address(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C')

# Get a list of all partners with whom you have non-settled channels for a certain token.
raiden.get_partners(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C')

# Get a list of all transfers that have not been completed yet
raiden.get_pending_transfers()

# Get a list of all transfers that have not been completed yet for specified token
raiden.get_pending_transfers_token(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C')

# Returns a list of all transfers that have not been completed yet for specified channel
raiden.get_pending_transfers_channel(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                                     partner_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b')

# Create a channel
raiden.create_channel(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                      partner_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b', 
                      total_deposit=1, settle_timeout=500)

# Close a channel
raiden.close_channel(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                     partner_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b')

# Increase the deposit in the channel
raiden.increase_deposit_channel(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                                partner_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b',
                                total_deposit=1)

# Withdraw token
raiden.withdraw_token_channel(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                              partner_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b',
                              total_withdraw=1)                      

# Get a dict containing all joined token networks.
raiden.get_joined_token_networks()

# Automatically join a token network
raiden.join_token_network(token_address='0x46E75a569Be6BdDe5d5E8351c5c035e8DfEa5C62', funds=1)

# Leave a token network
raiden.leave_token_network(token_address='0x46E75a569Be6BdDe5d5E8351c5c035e8DfEa5C62')

# Initiate a payment
raiden.initiate_payment(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                        target_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b', 
                        amount=1)

# Query the payment history
raiden.get_payment_history(token_address='0x9B740B496dea54d747680e941921aD28BDA5789C', 
                           target_address='0x2645bcF95d1c3fE89dB435be8AaEFb887832803b')

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

raiden_py-0.1.2.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

raiden_py-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file raiden_py-0.1.2.tar.gz.

File metadata

  • Download URL: raiden_py-0.1.2.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2

File hashes

Hashes for raiden_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 adc0914cb439410ced289d1e39e7f6c8cf7b50cd9bdab5e23d4f529f6ce8e6d5
MD5 544c00b41a0ec2e4df2cf1e2160ce504
BLAKE2b-256 89c94a8d37744fbc414c8333a8016d07698b69eb2e508b8e94a7e95c35b6f6ba

See more details on using hashes here.

File details

Details for the file raiden_py-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: raiden_py-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2

File hashes

Hashes for raiden_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cea4f62e30c4ef7a1ee4e9510d17590849b2ffb760b0a52daf047431eaadf412
MD5 d77ff4f095d73d976c722c6cf8ca730f
BLAKE2b-256 d59c30d5e7889e0f5920dd67be6d9f2a412c88ad3ab7be01bf396c2024f92d93

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