Metadata-Version: 2.4
Name: yativo-crypto-sdk
Version: 1.0.1
Summary: Official Yativo Crypto SDK for Python
Home-page: https://github.com/yativo/crypto-sdk-python
Author: Sotonye McLeod Bob-Manuel, Yativo
Author-email: support@yativo.com
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Requires-Dist: typing-extensions>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: flake8>=4.0.0; extra == "dev"
Requires-Dist: mypy>=0.990; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Yativo Crypto SDK - Python

Official Python SDK for the Yativo Crypto Platform. Accept and move **USDC on Solana** and **USDC on XDC** with a few lines of Python.

## Installation

```bash
pip install yativo-crypto-sdk
```

## Quick Start

```python
from yativo import YativoSDK

# Initialize SDK
yativo = YativoSDK(base_url="https://crypto-api.yativo.com")

# --- Authentication (passwordless) ---

# Step 1: Request OTP — sends a one-time code to the user's email
yativo.auth.login(email="user@example.com")

# Step 2: Verify OTP — returns access token if 2FA is not enabled
response = yativo.auth.verify_otp(otp="123456", email="user@example.com")

# Step 2b: If the account has 2FA enabled, verify the authenticator code instead
response = yativo.auth.verify_2fa(code="654321", email="user@example.com")

# Step 2c: Or authenticate with a passkey
options = yativo.auth.passkey_options(email="user@example.com")
# ... complete WebAuthn ceremony client-side, then:
response = yativo.auth.passkey_verify(data=options)

# Alternatively, authenticate with an API key + secret (server-to-server)
response = yativo.auth.get_token(
    api_key="yat_your_api_key",
    api_secret="your_api_secret"
)

# --- USDC on Solana ---

account = yativo.accounts.create(account_name="My Account")

sol_wallet = yativo.assets.create(
    account_id=account["account"]["account_id"],
    chain="solana",
    ticker="USDC_SOL"
)
print(f"Solana deposit address: {sol_wallet['asset']['wallet_address']}")

# Send USDC on Solana (~2-5 second finality)
yativo.transactions.send(
    from_asset_id=sol_wallet["asset"]["asset_id"],
    to_address="RecipientSolanaAddressHere",
    amount="10.00",
    chain="solana",
    ticker="USDC_SOL"
)

# --- USDC on XDC ---

xdc_wallet = yativo.assets.create(
    account_id=account["account"]["account_id"],
    chain="xdc",
    ticker="USDC_XDC"
)
print(f"XDC deposit address: {xdc_wallet['asset']['wallet_address']}")

# Send USDC on XDC (~2 second finality, ultra-low fees)
tx = yativo.transactions.send(
    from_asset_id=xdc_wallet["asset"]["asset_id"],
    to_address="xdcRecipientAddressHere",
    amount="50.00",
    chain="xdc",
    ticker="USDC_XDC"
)

print(f"Transaction hash: {tx['transaction']['tx_hash']}")
```

## Supported Assets

| Asset | Chain | Use case |
|-------|-------|----------|
| USDC_SOL | Solana | Fast consumer payments, ~2–5 sec finality |
| USDC_XDC | XDC Network | Enterprise payments, ~2 sec finality, near-zero fees |

## Features

- ✅ USDC on Solana and XDC
- ✅ Passwordless auth — OTP, 2FA (TOTP), and passkey
- ✅ Full type hints
- ✅ Automatic token refresh
- ✅ Webhook verification
- ✅ Comprehensive error handling

## Documentation

See the [Yativo API docs](https://docs.yativo.com) for the full API reference.
