Name | dedust JSON |
Version |
1.1.4
JSON |
| download |
home_page | None |
Summary | DeDust - DeDust SDK for Python. |
upload_time | 2024-05-08 18:45:09 |
maintainer | None |
docs_url | None |
author | Shibdev, Dalvpv |
requires_python | None |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DeDust SDK for Python
Analogue of DeDust SDK for Python.
## Description
You can swap tokens, deposit liquidity and many more.
## Getting Started
### Dependencies
* pytoniq
### Installing
```
pip install dedust
```
### Using
Example of buying $SCALE using SDK.
```python
from dedust import Asset, Factory, PoolType, SwapParams, VaultNative
from pytoniq import WalletV4R2, LiteBalancer
import asyncio
import time
mnemonics = ["your", "mnemonics", "here"]
async def main():
provider = LiteBalancer.from_mainnet_config(1)
await provider.start_up()
wallet = await WalletV4R2.from_mnemonic(provider=provider, mnemonics=mnemonics)
SCALE_ADDRESS = "EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE"
TON = Asset.native()
SCALE = Asset.jetton(SCALE_ADDRESS)
pool = await Factory.get_pool(pool_type=PoolType.VOLATILE,
assets=[TON, SCALE],
provider=provider)
swap_params = SwapParams(deadline=int(time.time() + 60 * 5),
recipient_address=wallet.address)
swap_amount = int(float(input("Enter swap amount: ")) * 1e9)
swap = VaultNative.create_swap_payload(amount=swap_amount,
pool_address=pool.address,
swap_params=swap_params)
swap_amount = int(swap_amount + (0.25*1e9)) # 0.25 = gas_value
await wallet.transfer(destination="EQDa4VOnTYlLvDJ0gZjNYm5PXfSmmtL6Vs6A_CZEtXCNICq_", # native vault
amount=swap_amount,
body=swap)
asyncio.run(main())
```
## Authors
[@shibdev](https://t.me/dogpy)
[@VladPavly](https://t.me/dalvpv)
## Version History
* 1.1.4
* Fixed `estimate_deposit_out` get method
* 1.1.2
* Update examples, fix bug with VaultNative
* 1.1.1
* Removed httpx from dependencies
* 1.1.0
* Change tonsdk to pytoniq
* 1.0.5
* Changes
* 1.0.4
* Bug fix
* 1.0.3
* Fixes
* 1.0.2
* Fixes and changes
* 1.0.1
* Small fix
* 1.0.0
* Remake to DeDust SDK analogue
* 0.0.5
* License change
* 0.0.4
* Dependecies fix
* 0.0.3
* Examples fix
* 0.0.2
* LP token address getting
* 0.0.1
* Initial Beta
## License
This project is licensed under the MIT License - see the LICENSE.md file for details
## Donate
If you like the library, I will be glad to accept donations.
* TON: EQCgphx8rTI0PukwmgpVqiPgqguTujhQscg2h7jgc4U0t347
## Acknowledgments
* [dedust-sdk](https://github.com/dedust-io/sdk)
* [dedust-docs](https://api.dedust.io)
Raw data
{
"_id": null,
"home_page": null,
"name": "dedust",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Shibdev, Dalvpv",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/17/56/2650b26a89e882e87f2578562071f26b8b0815bc842b9db36e94b126b131/dedust-1.1.4.tar.gz",
"platform": null,
"description": "# DeDust SDK for Python\n\nAnalogue of DeDust SDK for Python.\n\n## Description\n\nYou can swap tokens, deposit liquidity and many more.\n\n## Getting Started\n\n### Dependencies\n\n* pytoniq\n\n### Installing\n\n```\npip install dedust\n```\n\n### Using\n\nExample of buying $SCALE using SDK.\n\n```python\nfrom dedust import Asset, Factory, PoolType, SwapParams, VaultNative\nfrom pytoniq import WalletV4R2, LiteBalancer\nimport asyncio\nimport time\n\nmnemonics = [\"your\", \"mnemonics\", \"here\"]\n\nasync def main():\n provider = LiteBalancer.from_mainnet_config(1)\n await provider.start_up()\n\n wallet = await WalletV4R2.from_mnemonic(provider=provider, mnemonics=mnemonics)\n\n SCALE_ADDRESS = \"EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE\"\n\n TON = Asset.native()\n SCALE = Asset.jetton(SCALE_ADDRESS)\n\n pool = await Factory.get_pool(pool_type=PoolType.VOLATILE,\n assets=[TON, SCALE],\n provider=provider)\n \n swap_params = SwapParams(deadline=int(time.time() + 60 * 5),\n recipient_address=wallet.address)\n swap_amount = int(float(input(\"Enter swap amount: \")) * 1e9)\n\n swap = VaultNative.create_swap_payload(amount=swap_amount,\n pool_address=pool.address,\n swap_params=swap_params)\n\n swap_amount = int(swap_amount + (0.25*1e9)) # 0.25 = gas_value\n\n await wallet.transfer(destination=\"EQDa4VOnTYlLvDJ0gZjNYm5PXfSmmtL6Vs6A_CZEtXCNICq_\", # native vault\n amount=swap_amount,\n body=swap)\n\nasyncio.run(main())\n```\n\n## Authors\n\n[@shibdev](https://t.me/dogpy)\n[@VladPavly](https://t.me/dalvpv)\n\n## Version History\n\n* 1.1.4\n * Fixed `estimate_deposit_out` get method\n* 1.1.2\n * Update examples, fix bug with VaultNative\n* 1.1.1\n * Removed httpx from dependencies\n* 1.1.0\n * Change tonsdk to pytoniq\n* 1.0.5\n * Changes\n* 1.0.4\n * Bug fix\n* 1.0.3\n * Fixes\n* 1.0.2\n * Fixes and changes\n* 1.0.1\n * Small fix\n* 1.0.0\n * Remake to DeDust SDK analogue\n* 0.0.5\n * License change\n* 0.0.4\n * Dependecies fix\n* 0.0.3\n * Examples fix\n* 0.0.2\n * LP token address getting\n* 0.0.1\n * Initial Beta\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE.md file for details\n\n## Donate\n\nIf you like the library, I will be glad to accept donations.\n\n* TON: EQCgphx8rTI0PukwmgpVqiPgqguTujhQscg2h7jgc4U0t347\n\n## Acknowledgments\n\n* [dedust-sdk](https://github.com/dedust-io/sdk)\n* [dedust-docs](https://api.dedust.io)\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "DeDust - DeDust SDK for Python.",
"version": "1.1.4",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9441a1a4edabd6b05cb8870edbe9cf41aba8416b9a3acc18ff0a41af5280daff",
"md5": "3adcce7e372e17b69cdbb557c6f7e78a",
"sha256": "769b61ea2635d691659376ab30bd63645c292a98209bd76f252f1924d8b4e4d2"
},
"downloads": -1,
"filename": "dedust-1.1.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3adcce7e372e17b69cdbb557c6f7e78a",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 14595,
"upload_time": "2024-05-08T18:45:07",
"upload_time_iso_8601": "2024-05-08T18:45:07.706497Z",
"url": "https://files.pythonhosted.org/packages/94/41/a1a4edabd6b05cb8870edbe9cf41aba8416b9a3acc18ff0a41af5280daff/dedust-1.1.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "17562650b26a89e882e87f2578562071f26b8b0815bc842b9db36e94b126b131",
"md5": "ddbdac9453bec45bb489b2fd2d8d6a22",
"sha256": "25969563aa8d86546b2beb344f690a5b8df9e2899c420ec33addd861acea8eaf"
},
"downloads": -1,
"filename": "dedust-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "ddbdac9453bec45bb489b2fd2d8d6a22",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9234,
"upload_time": "2024-05-08T18:45:09",
"upload_time_iso_8601": "2024-05-08T18:45:09.610811Z",
"url": "https://files.pythonhosted.org/packages/17/56/2650b26a89e882e87f2578562071f26b8b0815bc842b9db36e94b126b131/dedust-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-08 18:45:09",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dedust"
}