Skip to main content

aioxrpy

Documentation Status codecov Python package Upload Python Package

Ripple blockchain library for Python.

Features

  1. Async JSON-RPC client.
  2. Signing and verifying transactions using private and public keys.
  3. Support for signing transactions with multiple keys.
  4. Serializer and deserializer for Ripple objects.

Installation

Library is available on PyPi, you can simply install it using pip.

$ pip install aioxrpy

Usage

Keys

Signing and verifying transactions, as well as generating new accounts is done through RippleKey class.

from aioxrpy.keys import RippleKey

# New key
key = RippleKey()

# From public key
key = RippleKey(public_key=b'public key')

# From master seed
key = RippleKey(private_key='seed')

# From private key
key = RippleKey(private_key=b'private key')

Such key can be converted to Account ID and public key.

Submitting transactions

RPC client provides a helper which signs and submits transaction. As a first argument it takes a transaction dict. The second one is a RippleKey instance used for signing this transaction.

from aioxrpy.rpc import RippleJsonRpc

rpc = RippleJsonRpc(url)
await rpc.sign_and_submit(
    {
        'Account': account,
        'TransactionType': RippleTransactionType.Payment,
        'Amount': decimals.xrp_to_drops(200),
        'Destination': destination,
        'Fee': 10
    },
    signer
)

Multi-signed transactions

RPC client provides a helper which signs and submits transaction using multiple keys. As a second argument, it expects a list of RippleKey instances. Please don't forget that each signer increases transaction fees.

from aioxrpy.rpc import RippleJsonRpc

rpc = RippleJsonRpc(url)
await rpc.multisign_and_submit(
    {
        'Account': account,
        'TransactionType': RippleTransactionType.Payment,
        'Amount': decimals.xrp_to_drops(200),
        'Destination': destination,
        'Fee': 30
    },
    [signer_1, signer_2]
)

Documentation

Docs and usage examples are available here.

Unit testing

To run unit tests, you need to bootstrap a Rippled regtest node first. Use the provided docker-compose.yml file.

$ docker-compose up -d

Metadata

Release files for aioxrpy 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aioxrpy 1.0.0
File Size Uploaded Provenance
aioxrpy-1.0.0.tar.gz 16.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aioxrpy 1.0.0
File Interpreter ABI Platform
aioxrpy-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / aioxrpy-1.0.0.tar.gz

Download URL aioxrpy-1.0.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cdccecd82e8716db3c663c2e9ced56c7feb6e141041a64ff8d99f21a9dadd350
BLAKE2b-256 checksum
How to use checksums
9dd7465f9ea2d3d5394a27082107369028a5bcf23665894d824036971c632c1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1035-azure

Release files / aioxrpy-1.0.0-py3-none-any.whl

Download URL aioxrpy-1.0.0-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46c5a75be6fcf3e83ca31d07fb70ba015c792055ac8ca7072bb86b84884a9604
BLAKE2b-256 checksum
How to use checksums
97442a548727b10f507a2ef46ff8a8aad333aaa614a11bb0eb9d46e4c720c965
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.8.2 Linux/5.0.0-1035-azure

Security for aioxrpy 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page