Wallet management tools for Crypto.com blockchain operations including signing and transactions
Project description
cryptocom-tools-wallet
Wallet management tools for Crypto.com blockchain operations. Part of the Crypto.com tools ecosystem.
Overview
This package provides framework-agnostic wallet management tools for blockchain operations. It handles wallet creation, storage, and state management without any dependencies on specific AI frameworks like LangChain or LangGraph.
Features
- Create new wallets
- Manage multiple wallets
- Switch between active wallets
- Delete wallets from session
- Get wallet balances
- Wallet state management
Installation
pip install cryptocom-tools-wallet
For development:
pip install -e .
Usage
Basic Wallet Operations
from cryptocom_tools_wallet import CreateWalletTool, WalletState
# Initialize wallet state
state = WalletState()
# Create wallet tool with explicit dependency injection
create_tool = CreateWalletTool()
# Create a new wallet (returns WalletCredentials)
result = create_tool.execute(state=state)
print(f"Created wallet: {result.address}")
Wallet State Management
from cryptocom_tools_wallet import WalletState, WalletRegistry
# Initialize state
state = WalletState()
# Register a wallet
state.register_wallet("0x123...")
# Set active wallet
state.set_active_wallet("0x123...")
# Get active wallet
active = state.get_active_wallet()
# List all wallets
wallets = state.list_wallets()
Framework Adapters
This package is designed to work with framework adapters from cryptocom-tool-adapters:
# With LangGraph adapter
from cryptocom_tool_adapters import to_langgraph_tool
create_wallet_lg = to_langgraph_tool(
create_tool,
state_extractor=lambda s: {"state": s.get("wallet_state")}
)
# With OpenAI SDK adapter
from cryptocom_tool_adapters import to_openai_function
create_wallet_openai = to_openai_function(
create_tool,
context={"state": wallet_state}
)
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Type checking
basedpyright
# Linting
ruff check .
# Formatting
black .
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cryptocom_tools_wallet-2.0.0.tar.gz.
File metadata
- Download URL: cryptocom_tools_wallet-2.0.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cad0a4af8424830de148beeb359a6cbce74518ad83c70a21f46a813d77fc5c6
|
|
| MD5 |
ad535d5fd4c129a4d8d5e77adf648f7d
|
|
| BLAKE2b-256 |
894d1d0f6e2c5b96306303ee70645fa8750d06c77dbf431dea0334a39e98e321
|