Name | rhea-sdk JSON |
Version |
0.2.16
JSON |
| download |
home_page | None |
Summary | Asynchronous SDK for interacting with Rhea Finance DEX |
upload_time | 2025-08-06 18:08:56 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3 |
license | None |
keywords |
python
near
rhea
dex
trading
ref
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# rhea-sdk
[](https://pypi.org/project/rhea-sdk)
[](https://pypi.python.org/pypi/rhea-sdk)
[](https://twitter.com/MaksimA30)
[//]: # ([](https://pypi.org/project/rhea-sdk))
**rhea-sdk** is an asynchronous SDK for interacting with Rhea Finance DEX.
It is made on top of [py-near](https://github.com/pvolnov/py-near) - a pretty simple and fully asynchronous framework for working with NEAR blockchain.
## Examples
<details>
<summary>π Click to see some basic examples</summary>
**Few steps before getting started...**
- Install the latest stable version of rhea-sdk, simply running `pip install rhea-sdk`
- Create NEAR account and get your private key [wallet](https://wallet.near.org/create)
### Usage examples
```python
from py_near.account import Account
from rhea_sdk import Rhea
wnear_contract = "wrap.near"
usdc_contract = "17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1"
async def main():
account = Account(account_id="example.near", private_key="ed25519:...")
await account.startup()
rhea = Rhea(account=account)
# Get account tokens balance
near_balance = await rhea.get_near_balance()
usdc_balance = await rhea.get_token_balance(usdc_contract)
wnear_balance = await rhea.get_token_balance(wnear_contract)
# Wrap or Unwrap some NEAR
await rhea.wrap_near(0.15)
await rhea.unwrap_near(0.05)
# List all DLC pools
pools = await rhea.dcl.get_pools()
# Get DLC pool_id by tokens and commission
pool_id = rhea.dcl.get_pool_id(wnear_contract, usdc_contract, 100)
# Get pool extended info by pool_id
pool = await rhea.dcl.get_pool(pool_id)
# Get current tokens price in the pool
prices = await rhea.dcl.get_tokens_price(pool_id)
# Quote output amount of token for swap
amount_to_swap = "0.1"
output_amount = await rhea.dcl.quote(usdc_contract, wnear_contract, pool_id, amount_to_swap)
# Quote input amount of token for swap
desired_output_amount = "0.1"
input_amount = await rhea.dcl.quote_by_output(wnear_contract, usdc_contract, pool_id, desired_output_amount)
# Swap
amount_to_swap = "0.1"
await rhea.dcl.swap(wnear_contract, usdc_contract, pool_id, amount_to_swap)
# Swap by output
desired_output_amount = "0.1"
max_input_amount = "0.5"
await rhea.dcl.swap_by_output(wnear_contract, usdc_contract, pool_id, desired_output_amount, max_input_amount)
```
</details>
## Official rhea-sdk resources:
- Social media:
- πΊπΈ [Telegram](https://t.me/maksim30)
- πΊπΈ [Twitter](https://twitter.com/MaksimA30)
- PyPI: [rhea-sdk](https://pypi.python.org/pypi/rhea-sdk)
- Documentation: [Github repo](https://github.com/MaximAntsiferov/rhea-sdk)
- Source: [Github repo](https://github.com/MaximAntsiferov/rhea-sdk)
- Issues/Bug tracker: [Github issues tracker](https://github.com/MaximAntsiferov/rhea-sdk/issues)
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/MaximAntsiferov/rhea-sdk/graphs/contributors"><img src="https://opencollective.com/rhea-sdk/contributors.svg?width=890&button=false" /></a>
Raw data
{
"_id": null,
"home_page": null,
"name": "rhea-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3",
"maintainer_email": null,
"keywords": "python, near, rhea, dex, trading, ref",
"author": null,
"author_email": "Maksim_Antsiferov <antsiferov.ms@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/59/ba/6b1ec46474c0df7b453fd7ff70c8bba3979c102e3ac4f56629bf6b1a655b/rhea_sdk-0.2.16.tar.gz",
"platform": null,
"description": "# rhea-sdk\r\n\r\n[](https://pypi.org/project/rhea-sdk)\r\n[](https://pypi.python.org/pypi/rhea-sdk)\r\n[](https://twitter.com/MaksimA30)\r\n\r\n[//]: # ([](https://pypi.org/project/rhea-sdk))\r\n\r\n\r\n**rhea-sdk** is an asynchronous SDK for interacting with Rhea Finance DEX. \r\nIt is made on top of [py-near](https://github.com/pvolnov/py-near) - a pretty simple and fully asynchronous framework for working with NEAR blockchain.\r\n## Examples\r\n<details>\r\n <summary>\ud83d\udcda Click to see some basic examples</summary>\r\n\r\n\r\n**Few steps before getting started...**\r\n- Install the latest stable version of rhea-sdk, simply running `pip install rhea-sdk`\r\n- Create NEAR account and get your private key [wallet](https://wallet.near.org/create)\r\n\r\n### Usage examples\r\n\r\n```python\r\nfrom py_near.account import Account\r\nfrom rhea_sdk import Rhea\r\n\r\nwnear_contract = \"wrap.near\"\r\nusdc_contract = \"17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1\"\r\n\r\n\r\nasync def main():\r\n account = Account(account_id=\"example.near\", private_key=\"ed25519:...\")\r\n await account.startup()\r\n \r\n rhea = Rhea(account=account)\r\n\r\n # Get account tokens balance\r\n near_balance = await rhea.get_near_balance()\r\n usdc_balance = await rhea.get_token_balance(usdc_contract)\r\n wnear_balance = await rhea.get_token_balance(wnear_contract)\r\n\r\n # Wrap or Unwrap some NEAR\r\n await rhea.wrap_near(0.15)\r\n await rhea.unwrap_near(0.05)\r\n\r\n # List all DLC pools\r\n pools = await rhea.dcl.get_pools()\r\n\r\n # Get DLC pool_id by tokens and commission\r\n pool_id = rhea.dcl.get_pool_id(wnear_contract, usdc_contract, 100)\r\n\r\n # Get pool extended info by pool_id\r\n pool = await rhea.dcl.get_pool(pool_id)\r\n \r\n # Get current tokens price in the pool\r\n prices = await rhea.dcl.get_tokens_price(pool_id)\r\n \r\n # Quote output amount of token for swap\r\n amount_to_swap = \"0.1\"\r\n output_amount = await rhea.dcl.quote(usdc_contract, wnear_contract, pool_id, amount_to_swap)\r\n \r\n # Quote input amount of token for swap\r\n desired_output_amount = \"0.1\"\r\n input_amount = await rhea.dcl.quote_by_output(wnear_contract, usdc_contract, pool_id, desired_output_amount)\r\n \r\n # Swap\r\n amount_to_swap = \"0.1\"\r\n await rhea.dcl.swap(wnear_contract, usdc_contract, pool_id, amount_to_swap)\r\n\r\n # Swap by output\r\n desired_output_amount = \"0.1\"\r\n max_input_amount = \"0.5\"\r\n await rhea.dcl.swap_by_output(wnear_contract, usdc_contract, pool_id, desired_output_amount, max_input_amount)\r\n\r\n```\r\n\r\n</details>\r\n\r\n\r\n## Official rhea-sdk resources:\r\n - Social media:\r\n - \ud83c\uddfa\ud83c\uddf8 [Telegram](https://t.me/maksim30)\r\n - \ud83c\uddfa\ud83c\uddf8 [Twitter](https://twitter.com/MaksimA30)\r\n - PyPI: [rhea-sdk](https://pypi.python.org/pypi/rhea-sdk)\r\n - Documentation: [Github repo](https://github.com/MaximAntsiferov/rhea-sdk)\r\n - Source: [Github repo](https://github.com/MaximAntsiferov/rhea-sdk)\r\n - Issues/Bug tracker: [Github issues tracker](https://github.com/MaximAntsiferov/rhea-sdk/issues)\r\n\r\n## Contributors\r\n\r\n### Code Contributors\r\n\r\nThis project exists thanks to all the people who contribute.\r\n<a href=\"https://github.com/MaximAntsiferov/rhea-sdk/graphs/contributors\"><img src=\"https://opencollective.com/rhea-sdk/contributors.svg?width=890&button=false\" /></a>\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Asynchronous SDK for interacting with Rhea Finance DEX",
"version": "0.2.16",
"project_urls": {
"changelog": "https://github.com/MaximAntsiferov/rhea-sdk/blob/main/CHANGELOG.md",
"documentation": "https://github.com/MaximAntsiferov/rhea-sdk",
"homepage": "https://github.com/MaximAntsiferov/rhea-sdk",
"repository": "https://github.com/MaximAntsiferov/rhea-sdk",
"twitter": "https://twitter.com/MaksimA30"
},
"split_keywords": [
"python",
" near",
" rhea",
" dex",
" trading",
" ref"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "94a82f15ce498f1c9ea5288506dd2571b9e060be6c60228cb7fff3b30b15506e",
"md5": "62d8141eaea2b17b4941f246103d4f14",
"sha256": "b5847259d2a2122f480ba9064173c029988e635ebd11f0778ffff03bc2c23598"
},
"downloads": -1,
"filename": "rhea_sdk-0.2.16-py3-none-any.whl",
"has_sig": false,
"md5_digest": "62d8141eaea2b17b4941f246103d4f14",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3",
"size": 9830,
"upload_time": "2025-08-06T18:08:55",
"upload_time_iso_8601": "2025-08-06T18:08:55.283847Z",
"url": "https://files.pythonhosted.org/packages/94/a8/2f15ce498f1c9ea5288506dd2571b9e060be6c60228cb7fff3b30b15506e/rhea_sdk-0.2.16-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "59ba6b1ec46474c0df7b453fd7ff70c8bba3979c102e3ac4f56629bf6b1a655b",
"md5": "74b761f54859546b65c7e5ef9cf332a7",
"sha256": "5e99fed8605f94f9ff1a9c9b2408b042f68e55d11a793880405b52e5aac778c1"
},
"downloads": -1,
"filename": "rhea_sdk-0.2.16.tar.gz",
"has_sig": false,
"md5_digest": "74b761f54859546b65c7e5ef9cf332a7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3",
"size": 10028,
"upload_time": "2025-08-06T18:08:56",
"upload_time_iso_8601": "2025-08-06T18:08:56.475653Z",
"url": "https://files.pythonhosted.org/packages/59/ba/6b1ec46474c0df7b453fd7ff70c8bba3979c102e3ac4f56629bf6b1a655b/rhea_sdk-0.2.16.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-06 18:08:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MaximAntsiferov",
"github_project": "rhea-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "rhea-sdk"
}