Metadata-Version: 2.4
Name: cryptocom-tools-token
Version: 2.0.0
Summary: Token tools for Crypto.com Developer Platform
Author-email: "Crypto.com" <support@crypto.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/crypto-com/agent-client-py
Project-URL: Documentation, https://github.com/crypto-com/agent-client-py
Project-URL: Repository, https://github.com/crypto-com/agent-client-py
Project-URL: Bug Tracker, https://github.com/crypto-com/agent-client-py/issues
Keywords: blockchain,crypto,token,transfer,swap,defi,web3
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: cryptocom-tools-core>=2.0.0
Requires-Dist: crypto-com-developer-platform-client>=1.0.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: web3>=6.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: basedpyright>=1.13.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Dynamic: license-file

# cryptocom-tools-token

Token tools for Crypto.com Developer Platform.

## Installation

```bash
pip install cryptocom-tools-token
```

## Read Tools (No Signer Required)

Query token balances without signing transactions.

```python
from cryptocom_tools_token import GetNativeBalanceTool, GetERC20BalanceTool

# Query native CRO balance
balance_tool = GetNativeBalanceTool()
result = balance_tool.invoke({"address": "0x..."})

# Query ERC20 token balance
erc20_tool = GetERC20BalanceTool()
result = erc20_tool.invoke({
    "address": "0x...",
    "contract_address": "0x..."
})
```

## Write Tools (Signer Required)

Execute token operations that require transaction signing.

```python
from cryptocom_tools_token import TransferNativeTool, SwapTokenTool, WrapTokenTool
from cryptocom_tools_wallet import PrivateKeySigner

# Create a signer (implements Signer protocol)
signer = PrivateKeySigner.from_env()

# Transfer native tokens
transfer_tool = TransferNativeTool(signer=signer)
result = transfer_tool.invoke({"to": "0x...", "amount": 1.5})

# Swap tokens
swap_tool = SwapTokenTool(signer=signer)
result = swap_tool.invoke({
    "token_in": "native",  # or token address
    "token_out": "0x5C7F8...",  # USDC address
    "amount": 100
})

# Wrap CRO to WCRO
wrap_tool = WrapTokenTool(signer=signer)
result = wrap_tool.invoke({"amount": 50})
```

## License

MIT
