cryptocloud-sdk


Namecryptocloud-sdk JSON
Version 0.1.0 PyPI version JSON
download
home_pagehttps://github.com/fofmow/crypto-cloud-sdk
SummaryNone
upload_time2025-02-03 03:09:28
maintainerNone
docs_urlNone
authorНикита Прожога
requires_python>=3.10
licenseNone
keywords async crypto cloud python sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Crypto Cloud SDK — простая асинхронная библиотека для работы с API [CryptoCloud](https://cryptocloud.plus/)

### 💡 Регистрация мерчанта и получение API ключей [описаны в документации](https://docs.cryptocloud.plus/ru/start/get-api-keys)

## Примеры использования / Use cases

```python
import asyncio
from datetime import date, timedelta

from cryptocloud_sdk import CryptoCloud, dto, errors


async def main():
    merchant = CryptoCloud(
        api_token="YOUR_API_TOKEN",
        shop_id="YOUR_SHOP_ID"
    )
    
    invoice: dto.CreatedInvoice = await merchant.create_invoice(
        invoice=dto.InvoiceInput(
            amount=250,
            currency="USD"  # or dto.currency.SupportedFiatCurrency.USD
        )
    )
    print(f"Invoice url is {invoice.link}")
    
    invoices: list[dto.InvoiceInfo] = await merchant.get_invoices(uuids=[invoice.uuid])
    
    canceled = await merchant.cancel_invoice(invoice.uuid)
    
    balances: list[dto.CoinBalance] = await merchant.get_balance()
    
    statictics: dto.Stats = await merchant.get_stats(
        start=date.today() - timedelta(days=3),
        end=date.today()
    )
    
    static_wallet: dto.StaticWallet = await merchant.create_static_wallet(
        currency="BTC",  # or dto.currency.SupportedCryptoCurrency.BTC , 
        identify="my-new-user-7"
    )
    
    # Handling errors
    try:
        await merchant.get_balance()
    except errors.UnauthorizedError:
        ...  # your code
    except errors.ForbiddenError:
        ...  # your code
    except errors.BadRequestError:
        ...  # your code


if __name__ == "__main__":
    asyncio.run(main())
```

####

## [Want to donate? Look at real app used CryptoCloud 😎](https://t.me/todonators_bot)

##



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fofmow/crypto-cloud-sdk",
    "name": "cryptocloud-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "async, crypto cloud, python, sdk",
    "author": "\u041d\u0438\u043a\u0438\u0442\u0430 \u041f\u0440\u043e\u0436\u043e\u0433\u0430",
    "author_email": "fofmow@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/22/2b34020c495f57b02cfda6e460bcc0f64e857755a7a3cee10bfcb7002acd/cryptocloud_sdk-0.1.0.tar.gz",
    "platform": null,
    "description": "# Crypto Cloud SDK \u2014 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API [CryptoCloud](https://cryptocloud.plus/)\n\n### \ud83d\udca1 \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043c\u0435\u0440\u0447\u0430\u043d\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 API \u043a\u043b\u044e\u0447\u0435\u0439 [\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438](https://docs.cryptocloud.plus/ru/start/get-api-keys)\n\n## \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f / Use cases\n\n```python\nimport asyncio\nfrom datetime import date, timedelta\n\nfrom cryptocloud_sdk import CryptoCloud, dto, errors\n\n\nasync def main():\n    merchant = CryptoCloud(\n        api_token=\"YOUR_API_TOKEN\",\n        shop_id=\"YOUR_SHOP_ID\"\n    )\n    \n    invoice: dto.CreatedInvoice = await merchant.create_invoice(\n        invoice=dto.InvoiceInput(\n            amount=250,\n            currency=\"USD\"  # or dto.currency.SupportedFiatCurrency.USD\n        )\n    )\n    print(f\"Invoice url is {invoice.link}\")\n    \n    invoices: list[dto.InvoiceInfo] = await merchant.get_invoices(uuids=[invoice.uuid])\n    \n    canceled = await merchant.cancel_invoice(invoice.uuid)\n    \n    balances: list[dto.CoinBalance] = await merchant.get_balance()\n    \n    statictics: dto.Stats = await merchant.get_stats(\n        start=date.today() - timedelta(days=3),\n        end=date.today()\n    )\n    \n    static_wallet: dto.StaticWallet = await merchant.create_static_wallet(\n        currency=\"BTC\",  # or dto.currency.SupportedCryptoCurrency.BTC , \n        identify=\"my-new-user-7\"\n    )\n    \n    # Handling errors\n    try:\n        await merchant.get_balance()\n    except errors.UnauthorizedError:\n        ...  # your code\n    except errors.ForbiddenError:\n        ...  # your code\n    except errors.BadRequestError:\n        ...  # your code\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n####\n\n## [Want to donate? Look at real app used CryptoCloud \ud83d\ude0e](https://t.me/todonators_bot)\n\n##\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.1.0",
    "project_urls": {
        "Homepage": "https://github.com/fofmow/crypto-cloud-sdk",
        "Repository": "https://github.com/fofmow/crypto-cloud-sdk"
    },
    "split_keywords": [
        "async",
        " crypto cloud",
        " python",
        " sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ea2a73181fc1158d27b654ee5ecc1304c7604f4c4c5f77c94e05bc5b3aafa390",
                "md5": "f1d312258bb2289cb1e6555eab8c639e",
                "sha256": "ee0b5f09a4c0ee2646b45ac6cd5f510148714e6b3ae60c319b08c7106d2d4e02"
            },
            "downloads": -1,
            "filename": "cryptocloud_sdk-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f1d312258bb2289cb1e6555eab8c639e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 8444,
            "upload_time": "2025-02-03T03:09:26",
            "upload_time_iso_8601": "2025-02-03T03:09:26.698843Z",
            "url": "https://files.pythonhosted.org/packages/ea/2a/73181fc1158d27b654ee5ecc1304c7604f4c4c5f77c94e05bc5b3aafa390/cryptocloud_sdk-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b222b34020c495f57b02cfda6e460bcc0f64e857755a7a3cee10bfcb7002acd",
                "md5": "e0338ef6381b6664188c90dd9fd515b5",
                "sha256": "1b6addfafa9152f4db5a5173acdd03fb99d1c186da2286d3939b3c258b82ba07"
            },
            "downloads": -1,
            "filename": "cryptocloud_sdk-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e0338ef6381b6664188c90dd9fd515b5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 4880,
            "upload_time": "2025-02-03T03:09:28",
            "upload_time_iso_8601": "2025-02-03T03:09:28.757084Z",
            "url": "https://files.pythonhosted.org/packages/0b/22/2b34020c495f57b02cfda6e460bcc0f64e857755a7a3cee10bfcb7002acd/cryptocloud_sdk-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-03 03:09:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fofmow",
    "github_project": "crypto-cloud-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "cryptocloud-sdk"
}
        
Elapsed time: 0.47137s