You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
LocalMonero 3ae052551c Correct README.md to specify that the rate limit mentioned is for unauthenticated requests 7 months ago
src/agoradesk_py General updates 7 months ago
tests General updates 7 months ago
.flake8 General updates 7 months ago
.gitignore Restructure project according to recommendations from James Murphy (mCoding) in video: https://youtu.be/DhUpxWjOhME 11 months ago
.pre-commit-config.yaml General updates 7 months ago
.woodpecker.yml Re-ordered CI tests 7 months ago
LICENSE.md Added pre-commit processing / checking: 10 months ago
README.md Correct README.md to specify that the rate limit mentioned is for unauthenticated requests 7 months ago
changelog.md General updates 7 months ago
get_my_trades.py Addressed all pylint messages in modules other than agoradesk.py 9 months ago
poetry.lock General updates 7 months ago
pyproject.toml General updates 7 months ago

README.md

agoradesk_py

Python interface for AgoraDesk.com/LocalMonero.co API.

This is currently not a complete implementation of the Agoradesk API.

The following API calls are currently not supported.

  • /trade/contact_release/{trade_id} • Release trade escrow
  • /contact_fund/{trade_id} • Fund a trade
  • /contact_dispute/{trade_id} • Start a trade dispute
  • /contact_escrow/{trade_id} • Enable escrow
  • Image uploading in chat
  • /contact_message_attachment/{trade_id}/{attachment_id} • Get a trade chat attachment

I offer no warranty of any kind -- use this at your own risk!

I am not associated with AgoraDesk.com or LocalMonero.co.

Requirements:

  • httpx
  • arrow

Install

pip install agoradesk_py

How to Use

This is an example about how you can use the library

#!/usr/bin/env python3

from agoradesk import AgoraDesk

api_key = <YourAPIKey>

api = AgoraDesk(api_key)

# Get information about all released trades
api_response = api.dashboard_released()

if api_response["success"]:
    trades = api_response["response"]["data"]["contact_list"]

    for trade in trades:
        trade_data = trade["data"]
        print(
            f"Traded "
            f"{trade_data['amount_xmr']} XMR with a fee of {trade_data['fee_xmr']} XMR "
            f"for {trade_data['amount']} {trade_data['currency']} "
            f"on {trade_data['released_at']}"
        )

else:
     print(f"Error: {api_response['response']['error']}")

Running Tests

Please be aware of the unauthenticated API requests limit of 20 req/h

I use pytest. The tests depend on the two following environment variables being set to the api_keys of two testing accounts at LocalMonero.co.

  • api_key
  • api_key2

Please be aware that:

  • LocalMonero.co or AgoraDesk.com are not currently providing a testing setup and all testes are running in their production environment.
  • For some tests to run successfully the account for api_key2 needs to have a balance of currently about 0.1 XMR

To run the actual tests:

  1. Install Poetry
  2. Install all dependencies / requirements by running poetry install
  3. Finally, enter poetry run pytest . in the project directory.

Contribute

Do you have an idea or found a bug in agoradesk_py? Please file an issue and/or submit a pull request! :)

Source code is currently on Codeberg at https://codeberg.org/MarvinsCryptoTools/agoradesk_py

Support

If you like the API and want to support me you can do so with Monero: 88NszkQU9qsafT9obFaDZSi7RvHSM76exJ1vvgVShTwM4HjvLr7XjJ7jDkFGnxr3UsDXLgT5t569N6uB7Gn4znjAFjUuN1q