# YellowChangerAPI
`YellowChangerAPI` is a Python library for interacting with the [YellowChanger](https://yellowchanger.com) service API. The library allows you to get exchange rates, create trades, and get information about trades.
## Installation
To install the library, use the following command:
```sh
pip install yellowchangerapi
```
## Usage
Example of using the library:
```python
from yellow_changer_api import YellowChanger
def main():
public_api_key = "your_public_api_key"
secret_api_key = "your_secret_api_key"
yellow_changer = YellowChanger(public_api_key, secret_api_key)
# Get all rates
rates = yellow_changer.all_rates()
print(rates)
# Get destinations list
destinations_list = yellow_changer.destinations_list()
print(destinations_list)
# Get rates in direction USDT
rates_in_direction_USDT = yellow_changer.rates_in_direction('USDT')
print(rates_in_direction_USDT)
# Create a trade
trade = yellow_changer.create_trade(
send_name='USDT',
get_name='USDT',
send_value=100,
send_network='TRC20',
get_network='ERC20',
get_creds='0x4c...'
)
trade_uniq_id = trade.get('uniq_id')
# Get trade information
trade_info = yellow_changer.get_info(trade_uniq_id)
print(trade_info)
if __name__ == '__main__':
main()
```
## Methods
### `all_rates()`
Gets all exchange rates.
**Example:**
```python
rates = yellow_changer.all_rates()
print(rates)
```
### `destinations_list()`
Gets the list of all destinations.
**Example:**
```python
destinations = yellow_changer.destinations_list()
print(destinations)
```
### `rates_in_direction(direction: str)`
Gets all exchange rates in a specific direction.
**Parameters:**
- `direction` (str): The direction of the rate, for example, 'USDT'.
**Example:**
```python
rates = yellow_changer.rates_in_direction('USDT')
print(rates)
```
### `get_info(uniq_id: str)`
Gets information about a trade by the unique ID of the trade.
**Parameters:**
- `uniq_id` (str): The unique ID of the trade.
**Example:**
```python
info = yellow_changer.get_info('your_unique_id')
print(info)
```
### `create_trade(**kwargs)`
Creates a new trade based on the provided parameters.
**Example:**
```python
trade = yellow_changer.create_trade(
send_name='USDT',
get_name='USDT',
send_value=100,
send_network='TRC20',
get_network='ERC20',
get_creds='0x4c...'
)
print(trade)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Whom-m0rty/YellowChangerAPI",
"name": "yellowchangerapi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "whom",
"author_email": "m0rtydisg@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/cf/58/4324795a86a94a7fdaca4bf55517cd5d79707d6c82dad2ebf5f7425197fb/yellowchangerapi-1.0.3.tar.gz",
"platform": null,
"description": "# YellowChangerAPI\n\n`YellowChangerAPI` is a Python library for interacting with the [YellowChanger](https://yellowchanger.com) service API. The library allows you to get exchange rates, create trades, and get information about trades.\n\n## Installation\n\nTo install the library, use the following command:\n\n```sh\npip install yellowchangerapi\n```\n\n## Usage\n\nExample of using the library:\n\n```python\nfrom yellow_changer_api import YellowChanger\n\ndef main():\n public_api_key = \"your_public_api_key\"\n secret_api_key = \"your_secret_api_key\"\n\n yellow_changer = YellowChanger(public_api_key, secret_api_key)\n\n # Get all rates\n rates = yellow_changer.all_rates()\n print(rates)\n\n # Get destinations list\n destinations_list = yellow_changer.destinations_list()\n print(destinations_list)\n\n # Get rates in direction USDT\n rates_in_direction_USDT = yellow_changer.rates_in_direction('USDT')\n print(rates_in_direction_USDT)\n\n # Create a trade\n trade = yellow_changer.create_trade(\n send_name='USDT',\n get_name='USDT',\n send_value=100,\n send_network='TRC20',\n get_network='ERC20',\n get_creds='0x4c...'\n )\n\n trade_uniq_id = trade.get('uniq_id')\n\n # Get trade information\n trade_info = yellow_changer.get_info(trade_uniq_id)\n print(trade_info)\n\nif __name__ == '__main__':\n main()\n```\n\n## Methods\n\n### `all_rates()`\n\nGets all exchange rates.\n\n**Example:**\n```python\nrates = yellow_changer.all_rates()\nprint(rates)\n```\n\n### `destinations_list()`\n\nGets the list of all destinations.\n\n**Example:**\n```python\ndestinations = yellow_changer.destinations_list()\nprint(destinations)\n```\n\n### `rates_in_direction(direction: str)`\n\nGets all exchange rates in a specific direction.\n\n**Parameters:**\n- `direction` (str): The direction of the rate, for example, 'USDT'.\n\n**Example:**\n```python\nrates = yellow_changer.rates_in_direction('USDT')\nprint(rates)\n```\n\n### `get_info(uniq_id: str)`\n\nGets information about a trade by the unique ID of the trade.\n\n**Parameters:**\n- `uniq_id` (str): The unique ID of the trade.\n\n**Example:**\n```python\ninfo = yellow_changer.get_info('your_unique_id')\nprint(info)\n```\n\n### `create_trade(**kwargs)`\n\nCreates a new trade based on the provided parameters.\n\n**Example:**\n```python\ntrade = yellow_changer.create_trade(\n send_name='USDT',\n get_name='USDT',\n send_value=100,\n send_network='TRC20',\n get_network='ERC20',\n get_creds='0x4c...'\n)\nprint(trade)\n```\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A Python library for interacting with the YellowChanger service API.",
"version": "1.0.3",
"project_urls": {
"Bug Reports": "https://github.com/Whom-m0rty/YellowChangerAPI/issues",
"Homepage": "https://github.com/Whom-m0rty/YellowChangerAPI",
"Source": "https://github.com/Whom-m0rty/YellowChangerAPI/tree/main"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e0774ee728ba583f9f8e5c686d5c3add7b1fec20320e1aa3b99db6b8fe720124",
"md5": "d73e67c7c6c107db56481ef1db469a4e",
"sha256": "d7c13ef832c5b7988d69c729c2474716d666a0d1aa3dc85ef3cf34b921739945"
},
"downloads": -1,
"filename": "yellowchangerapi-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d73e67c7c6c107db56481ef1db469a4e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 4269,
"upload_time": "2024-08-12T22:51:35",
"upload_time_iso_8601": "2024-08-12T22:51:35.675717Z",
"url": "https://files.pythonhosted.org/packages/e0/77/4ee728ba583f9f8e5c686d5c3add7b1fec20320e1aa3b99db6b8fe720124/yellowchangerapi-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cf584324795a86a94a7fdaca4bf55517cd5d79707d6c82dad2ebf5f7425197fb",
"md5": "e88ff69004319705a060cd2b07b712b8",
"sha256": "de49b4157e4dbbc4624fe9f2e2c7449d5f28e4ea0b5ab7e2d70400ca13a19355"
},
"downloads": -1,
"filename": "yellowchangerapi-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "e88ff69004319705a060cd2b07b712b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 3746,
"upload_time": "2024-08-12T22:51:37",
"upload_time_iso_8601": "2024-08-12T22:51:37.357155Z",
"url": "https://files.pythonhosted.org/packages/cf/58/4324795a86a94a7fdaca4bf55517cd5d79707d6c82dad2ebf5f7425197fb/yellowchangerapi-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-12 22:51:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Whom-m0rty",
"github_project": "YellowChangerAPI",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "yellowchangerapi"
}