# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['xrpl',
 'xrpl.account',
 'xrpl.clients',
 'xrpl.core',
 'xrpl.core.addresscodec',
 'xrpl.core.binarycodec',
 'xrpl.core.binarycodec.binary_wrappers',
 'xrpl.core.binarycodec.definitions',
 'xrpl.core.binarycodec.types',
 'xrpl.core.keypairs',
 'xrpl.ledger',
 'xrpl.models',
 'xrpl.models.amounts',
 'xrpl.models.currencies',
 'xrpl.models.requests',
 'xrpl.models.transactions',
 'xrpl.transaction',
 'xrpl.utils',
 'xrpl.wallet']

package_data = \
{'': ['*']}

install_requires = \
['ECPy>=1.2.5,<2.0.0',
 'base58>=2.1.0,<3.0.0',
 'requests>=2.25.1,<3.0.0',
 'typing-extensions>=3.7.4,<4.0.0']

setup_kwargs = {
    'name': 'xrpl-py',
    'version': '1.0.0',
    'description': 'A complete Python library for interacting with the XRP ledger',
    'long_description': '[![Documentation Status](https://readthedocs.org/projects/xrpl-py/badge)](https://xrpl-py.readthedocs.io/)\n\n# xrpl-py\n\nA pure Python implementation for interacting with the XRP Ledger, the `xrpl-py` library simplifies the hardest parts of XRP Ledger interaction, like serialization and transaction signing, by providing native Python methods and models for [XRP Ledger transactions](https://xrpl.org/transaction-formats.html) and core server [API](https://xrpl.org/api-conventions.html) ([`rippled`](https://github.com/ripple/rippled)) objects.\n\n\n\n```py\n# create a network client\n>>> from xrpl.clients.json_rpc_client import JsonRpcClient\n>>> client = JsonRpcClient("https://s.altnet.rippletest.net:51234/")\n# create a wallet on the testnet\n>>> from xrpl.wallet import generate_faucet_wallet\n>>> test_wallet = generate_faucet_wallet(client)\n>>> print(test_wallet)\nseed: shA5izLnSNFxNwGMV1ar6WJnnsNbo\npublic_key: ED3CC1BBD0952A60088E89FA502921895FC81FBD79CAE9109A8FE2D23659AD5D56\nprivate_key: -HIDDEN-\nclassic_address: rBtXmAdEYcno9LWRnAGfT9qBxCeDvuVRZo\n# look up account info\n>>> from xrpl.models.requests.account_info import AccountInfo\n>>> acct_info = AccountInfo(\n...         account="rBtXmAdEYcno9LWRnAGfT9qBxCeDvuVRZo",\n...         ledger_index="current",\n...         queue=True,\n...         strict=True,\n...     )\n>>> response = client.request(acct_info)\n>>> result = response.result\n>>> import json\n>>> print(json.dumps(result["account_data"], indent=4, sort_keys=True))\n{\n    "Account": "rBtXmAdEYcno9LWRnAGfT9qBxCeDvuVRZo",\n    "Balance": "1000000000",\n    "Flags": 0,\n    "LedgerEntryType": "AccountRoot",\n    "OwnerCount": 0,\n    "PreviousTxnID": "73CD4A37537A992270AAC8472F6681F44E400CBDE04EC8983C34B519F56AB107",\n    "PreviousTxnLgrSeq": 16233962,\n    "Sequence": 16233962,\n    "index": "FD66EC588B52712DCE74831DCB08B24157DC3198C29A0116AA64D310A58512D7"\n}\n```\n\n\n[![Downloads](https://pepy.tech/badge/xrpl-py/month)](https://pepy.tech/project/xrpl-py/month)\n[![Contributors](https://img.shields.io/github/contributors/xpring-eng/xrpl-py.svg)](https://github.com/xpring-eng/xrpl-py/graphs/contributors)\n\n\n## Installation and supported versions\n\nThe `xrpl-py` library is available on [PyPI](https://pypi.org/). Install with `pip`:\n\n\n```\npip3 install xrpl-py\n```\n\nThe library supports [Python 3.7](https://www.python.org/downloads/) and later.\n\n[![Supported Versions](https://img.shields.io/pypi/pyversions/xrpl-py.svg)](https://pypi.org/project/xrpl-py)\n\n\n## Features\n\nUse `xrpl-py` to build Python applications that leverage the [XRP Ledger](https://xrpl.org/). The library helps with all aspects of interacting with the XRP Ledger, including:\n\n* Key and wallet management\n* Serialization\n* Transaction Signing\n\n`xrpl-py` also provides:\n\n* A network client — See [`xrpl.clients`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.clients.html) for more information.\n* Methods for inspecting accounts — See [XRPL Account Methods](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.account.html) for more information.\n* Codecs for encoding and decoding addresses and other objects — See [Core Codecs](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.core.html) for more information.\n\n## [➡️ Reference Documentation](https://xrpl-py.readthedocs.io/en/latest/)\n\nSee the complete [`xrpl-py` reference documentation on Read the Docs](https://xrpl-py.readthedocs.io/en/latest/index.html).\n\n\n## Usage\n\nThe following sections describe some of the most commonly used modules in the `xrpl-py` library and provide sample code.\n\n### Network client\n\nUse the `xrpl.clients` library to create a network client for connecting to the XRP Ledger.\n\n```py\nfrom xrpl.clients.json_rpc_client import JsonRpcClient\nJSON_RPC_URL = "https://s.altnet.rippletest.net:51234/"\nclient = JsonRpcClient(JSON_RPC_URL)\n```\n\n### Manage keys and wallets\n\n#### `xrpl.wallet`\n\nUse the [`xrpl.wallet`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.wallet.html) module to create a wallet from a given seed or or via a [Testnet faucet](https://xrpl.org/xrp-testnet-faucet.html).\n\nTo create a wallet from a seed (in this case, the value generated using [`xrpl.keypairs`](#xrpl-keypairs)):\n\n```py\nwallet_from_seed = xrpl.wallet.Wallet(seed, 0)\nprint(wallet_from_seed)\n\n# print output\nseed: sEdTNFV69uSpcHpCppa6VzMvmC68CVY\npub_key: ED46949E414A3D6D758D347BAEC9340DC78F7397FEE893132AAF5D56E4D7DE77B0\npriv_key: EDE65EE7882847EF5345A43BFB8E6F5EEC60F45461696C384639B99B26AAA7A5CD\nclassic_address: rG5ZvYsK5BPi9f1Nb8mhFGDTNMJhEhufn6\n```\n\nTo create a wallet from a Testnet faucet:\n\n```py\ntest_wallet = generate_faucet_wallet(client)\ntest_account = test_wallet.classic_address\nprint("Classic address:\\n", test_account)\n\n# print output\nClassic address:\n\n rEQB2hhp3rg7sHj6L8YyR4GG47Cb7pfcuw\n```\n\n#### `xrpl.core.keypairs`\n\nUse the [`xrpl.core.keypairs`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.core.keypairs.html#module-xrpl.core.keypairs) module to generate seeds and derive keypairs and addresses from those seed values.\n\nHere\'s an example of how to generate a `seed` value and derive an [XRP Ledger "classic" address](https://xrpl.org/cryptographic-keys.html#account-id-and-address) from that seed.\n\n\n```py\nfrom xrpl.core import keypairs\nseed = keypairs.generate_seed()\npublic, private = keypairs.derive_keypair(seed)\ntest_account = keypairs.derive_classic_address(public)\nprint(f"Here\'s the public key:\\n", public)\nprint(f"Here\'s the private key:\\n", private +  "\\nStore this in a secure place.")\n```\n\n**Note:** You can use `xrpl.core.keypairs.sign` to sign transactions but `xrpl-py` also provides explicit methods for safely signing and submitting transactions. See [Transaction Signing](#transaction-signing) and [XRPL Transaction Methods](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html#module-xrpl.transaction) for more information.\n\n\n### Serialize and sign transactions\n\nTo securely submit transactions to the XRP Ledger, you need to first serialize data from JSON and other formats into the [XRP Ledger\'s canonical format](https://xrpl.org/serialization.html), then to [authorize the transaction](https://xrpl.org/transaction-basics.html#authorizing-transactions) by digitally [signing it](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.core.keypairs.html?highlight=sign#xrpl.core.keypairs.sign) with the account\'s private key. The `xrpl-py` library provides several methods to simplify this process.\n\n\nUse the [`xrpl.transaction`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html) module to sign and submit transactions. The module offers three ways to do this:\n\n* [`safe_sign_and_submit_transaction`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html#xrpl.transaction.safe_sign_and_submit_transaction) — Signs a transaction locally, then submits it to the XRP Ledger. This method does not implement [reliable transaction submission](https://xrpl.org/reliable-transaction-submission.html#reliable-transaction-submission) best practices, so only use it for development or testing purposes.\n\n* [`safe_sign_transaction`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html#xrpl.transaction.safe_sign_transaction) — Signs a transaction locally. This method **does  not** submit the transaction to the XRP Ledger.\n\n* [`send_reliable_submission`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.transaction.html#xrpl.transaction.send_reliable_submission) — An implementation of the [reliable transaction submission guidelines](https://xrpl.org/reliable-transaction-submission.html#reliable-transaction-submission), this method signs a transaction locally, submits the transaction to the XRP Ledger, and then verifies that it has been included in a validated ledger (or has failed to do so). Use this method to submit transactions for production purposes.\n\n\n```py\nfrom xrpl.models.transactions import Payment\nfrom xrpl.transaction import send_reliable_submission\nfrom xrpl.ledger import get_latest_validated_ledger_sequence\n\ncurrent_validated_ledger = get_latest_validated_ledger_sequence(client)\n\n# prepare the transaction\n# the amount is expressed in drops, not XRP\n# see https://xrpl.org/basic-data-types.html#specifying-currency-amounts\nmy_tx_payment = Payment(\n    account="rMPUKmzmDWEX1tQhzQ8oGFNfAEhnWNFwz",\n    amount="2200000",\n    destination="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",\n    last_ledger_sequence=current_validated_ledger + 20,\n    sequence=test_wallet.sequence,\n    fee="10",\n)\n# sign the transaction\nmy_tx_payment_signed = safe_sign_transaction(my_tx_payment,test_wallet)\n\n# submit the transaction\ntx_response = send_reliable_submission(my_tx_payment, test_wallet, client)\n```\n\n#### Get fee from the XRP Ledger\n\n\nIn most cases, you can specify the minimum [transaction cost](https://xrpl.org/transaction-cost.html#current-transaction-cost) of `"10"` for the `fee` field unless you have a strong reason not to. But if you want to get the [current load-balanced transaction cost](https://xrpl.org/transaction-cost.html#current-transaction-cost) from the network, you can use the `get_fee` function:\n\n```py\nfrom xrpl.ledger import get_fee\n\nFEE = get_fee(client)\nprint(FEE)\n\n# print output\n10\n```\n\n#### Auto-filled fields\n\nThe `xrpl-py` library automatically populates the `fee` and `last_ledger_sequence` fields when you create transactions. In the example above, you could omit those fields and let the library fill them in for you.\n\n```py\nfrom xrpl.models.transactions import Payment\nfrom xrpl.transaction import send_reliable_submission\n\n# prepare the transaction\n# the amount is expressed in drops, not XRP\n# see https://xrpl.org/basic-data-types.html#specifying-currency-amounts\nmy_tx_payment = Payment(\n    account="rMPUKmzmDWEX1tQhzQ8oGFNfAEhnWNFwz",\n    amount="2200000",\n    destination="rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",\n    sequence=test_wallet.sequence,\n)\n\n# sign the transaction\nmy_tx_payment_signed = safe_sign_transaction(my_tx_payment,test_wallet)\n\n# submit the transaction\ntx_response = send_reliable_submission(my_tx_payment, test_wallet, client)\n\nprint(my_tx_payment)\nPayment(account=\'rMPUKmzmDWEX1tQhzQ8oGFNfAEhnWNFwz\', transaction_type=<TransactionType.PAYMENT: \'Payment\'>, fee=10000, sequence=16034065, account_txn_id=None, flags=0, last_ledger_sequence=10268600, memos=None, signers=None, source_tag=None, signing_pub_key=None, txn_signature=None, amount=\'2200000\', destination=\'rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe\', destination_tag=None, invoice_id=None, paths=None, send_max=None, deliver_min=None)\n```\n\n\n### Encode addresses\n\nUse the [`xrpl.core.addresscodec`](https://xrpl-py.readthedocs.io/en/latest/source/xrpl.core.addresscodec.html) to encode and decode addresses into and from the ["classic" and X-address formats](https://xrpl.org/accounts.html#addresses).\n\n```py\n# convert classic address to x-address\n>>> from xrpl.core import addresscodec\n>>> tesnet_xaddress = addresscodec.classic_address_to_xaddress("rMPUKmzmDWEX1tQhzQ8oGFNfAEhnWNFwz", tag=0, is_test_network=True)\n>>> print(tesnet_xaddress)\nT7QDemmxnuN7a52A62nx2fxGPWcRahLCf3qaswfrsNW9Lps\n```\n\n\n## Contributing\n\nIf you want to contribute to this project, see [CONTRIBUTING.md].\n\n\n## License\n\nThe `xrpl-py` library is licensed under the ISC License. See [LICENSE] for more information.\n\n\n\n[CONTRIBUTING.md]: CONTRIBUTING.md\n[LICENSE]: LICENSE\n',
    'author': 'Amie Corso',
    'author_email': 'acorso@ripple.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/XRPLF/xrpl-py',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'python_requires': '>=3.7,<4.0',
}


setup(**setup_kwargs)
