dv-net-client


Namedv-net-client JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://docs.dv.net
SummaryA convenient way to integrate DV.net to your platform
upload_time2025-10-22 07:25:41
maintainerNone
docs_urlNone
authorKurt Morgan
requires_python<4.0,>=3.9
licenseMIT
keywords api client dv.net payment crypto
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DV.net Python Client

A Python client for DV.net API integration.

## Documentation

You can find extended documentation at https://docs.dv.net/

## Installation

```bash
pip install dv-net-client
# For the async client, also install aiohttp
pip install aiohttp
```

## Setup

### Synchronous Client
```python
from dv_net_client.client import MerchantClient
# Initialize the client with host and API key
client = MerchantClient(
    host='[https://api.example.com](https://api.example.com)', # Your DV.net API host
    x_api_key='your-api-key'
)

# You can also pass the host and key in each request
# client = MerchantClient()
# client.get_exchange_balances(host='...', x_api_key='...')
```

### Asynchronous Client
```python
import asyncio
from dv_net_client.async_client import AsyncMerchantClient

async def main():
    # Initialize the client
    async_client = AsyncMerchantClient(
        host='[https://api.example.com](https://api.example.com)',
        x_api_key='your-api-key'
    )
    
    # Example call
    balances = await async_client.get_exchange_balances()
    print(balances)

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

## Usage

### Signature Verification

Verify the authenticity of webhook signatures.
```python
from dv_net_client.utils import MerchantUtilsManager

manager = MerchantUtilsManager()
is_valid = manager.check_sign(
    client_signature='received-signature-hash',
    client_key='your-client-key',
    request_body={'data': 'request-payload'}
)
# Returns True if the signature is valid
```

### Webhook Processing
```python
from dv_net_client.mappers import WebhookMapper

mapper = WebhookMapper()
webhook_data = {'type': 'PaymentReceived', ...} # your webhook data
webhook_dto = mapper.map_webhook(webhook_data)
# Returns a ConfirmedWebhookResponse, UnconfirmedWebhookResponse, or WithdrawalWebhookResponse object
```

### API Call Examples (Synchronous Client)

All methods of the synchronous client have asynchronous counterparts in AsyncMerchantClient.

#### Get Exchange Balances:

```python
balances = client.get_exchange_balances()
# Returns a TotalExchangeBalanceResponse object
```

#### Create External Wallet:
```python
wallet = client.get_external_wallet(
    store_external_id='store-123',
    email='user@example.com',
    ip='127.0.0.1',
    amount='100.00',
    currency='USD'
)
# Returns an ExternalAddressesResponse object
```

#### Initialize Withdrawal:
```python
withdrawal = client.initialize_transfer(
    address_to='0x123...',
    currency_id='ETH',
    amount='1.5',
    request_id='unique-request-id'
)
# Returns a WithdrawalResponse object
```
            

Raw data

            {
    "_id": null,
    "home_page": "https://docs.dv.net",
    "name": "dv-net-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "api, client, dv.net, payment, crypto",
    "author": "Kurt Morgan",
    "author_email": "kurt.morgan@dv.net",
    "download_url": "https://files.pythonhosted.org/packages/ce/21/76caa3e4be215a060ebcf1aa3b0b37031cfb22b27e725e139aa6591520a7/dv_net_client-1.0.0.tar.gz",
    "platform": null,
    "description": "# DV.net Python Client\n\nA Python client for DV.net API integration.\n\n## Documentation\n\nYou can find extended documentation at https://docs.dv.net/\n\n## Installation\n\n```bash\npip install dv-net-client\n# For the async client, also install aiohttp\npip install aiohttp\n```\n\n## Setup\n\n### Synchronous Client\n```python\nfrom dv_net_client.client import MerchantClient\n# Initialize the client with host and API key\nclient = MerchantClient(\n    host='[https://api.example.com](https://api.example.com)', # Your DV.net API host\n    x_api_key='your-api-key'\n)\n\n# You can also pass the host and key in each request\n# client = MerchantClient()\n# client.get_exchange_balances(host='...', x_api_key='...')\n```\n\n### Asynchronous Client\n```python\nimport asyncio\nfrom dv_net_client.async_client import AsyncMerchantClient\n\nasync def main():\n    # Initialize the client\n    async_client = AsyncMerchantClient(\n        host='[https://api.example.com](https://api.example.com)',\n        x_api_key='your-api-key'\n    )\n    \n    # Example call\n    balances = await async_client.get_exchange_balances()\n    print(balances)\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Usage\n\n### Signature Verification\n\nVerify the authenticity of webhook signatures.\n```python\nfrom dv_net_client.utils import MerchantUtilsManager\n\nmanager = MerchantUtilsManager()\nis_valid = manager.check_sign(\n    client_signature='received-signature-hash',\n    client_key='your-client-key',\n    request_body={'data': 'request-payload'}\n)\n# Returns True if the signature is valid\n```\n\n### Webhook Processing\n```python\nfrom dv_net_client.mappers import WebhookMapper\n\nmapper = WebhookMapper()\nwebhook_data = {'type': 'PaymentReceived', ...} # your webhook data\nwebhook_dto = mapper.map_webhook(webhook_data)\n# Returns a ConfirmedWebhookResponse, UnconfirmedWebhookResponse, or WithdrawalWebhookResponse object\n```\n\n### API Call Examples (Synchronous Client)\n\nAll methods of the synchronous client have asynchronous counterparts in AsyncMerchantClient.\n\n#### Get Exchange Balances:\n\n```python\nbalances = client.get_exchange_balances()\n# Returns a TotalExchangeBalanceResponse object\n```\n\n#### Create External Wallet:\n```python\nwallet = client.get_external_wallet(\n    store_external_id='store-123',\n    email='user@example.com',\n    ip='127.0.0.1',\n    amount='100.00',\n    currency='USD'\n)\n# Returns an ExternalAddressesResponse object\n```\n\n#### Initialize Withdrawal:\n```python\nwithdrawal = client.initialize_transfer(\n    address_to='0x123...',\n    currency_id='ETH',\n    amount='1.5',\n    request_id='unique-request-id'\n)\n# Returns a WithdrawalResponse object\n```",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A convenient way to integrate DV.net to your platform",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://docs.dv.net",
        "Repository": "https://github.com/dv-net/dv-python"
    },
    "split_keywords": [
        "api",
        " client",
        " dv.net",
        " payment",
        " crypto"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9273bdbeaa190e31abaa49efe78595597737e5f250eb7d6c3269331cf939a64",
                "md5": "0b16e389cfe233a725a0752bcd30beaf",
                "sha256": "dc8d6802cea84b763b02f6cb460ffca98069541a62a44b719ef6aeedbcffb5c6"
            },
            "downloads": -1,
            "filename": "dv_net_client-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0b16e389cfe233a725a0752bcd30beaf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 12509,
            "upload_time": "2025-10-22T07:25:40",
            "upload_time_iso_8601": "2025-10-22T07:25:40.777006Z",
            "url": "https://files.pythonhosted.org/packages/b9/27/3bdbeaa190e31abaa49efe78595597737e5f250eb7d6c3269331cf939a64/dv_net_client-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ce2176caa3e4be215a060ebcf1aa3b0b37031cfb22b27e725e139aa6591520a7",
                "md5": "d9bf8f5376b96e9baf21da05f5ff9bba",
                "sha256": "ae4fef6fd517a4af1ace592b9c3e60e0084ef44af4573bd762704bb60e9c1b0f"
            },
            "downloads": -1,
            "filename": "dv_net_client-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d9bf8f5376b96e9baf21da05f5ff9bba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 9257,
            "upload_time": "2025-10-22T07:25:41",
            "upload_time_iso_8601": "2025-10-22T07:25:41.834864Z",
            "url": "https://files.pythonhosted.org/packages/ce/21/76caa3e4be215a060ebcf1aa3b0b37031cfb22b27e725e139aa6591520a7/dv_net_client-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-22 07:25:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dv-net",
    "github_project": "dv-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dv-net-client"
}
        
Elapsed time: 0.51182s