Metadata-Version: 2.4
Name: circle-web3-sdk-util
Version: 9.4.1
Summary: The Python SDK Utility for Circle Web3 Services
Author-email: Circle Technology Inc <bohan.li@circle.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: Circle,Developer Controlled Wallets,Python,Smart Contract Platform,User Controlled Wallets,Web3
Requires-Python: <4,>=3.10
Requires-Dist: pycryptodome>=3.20.0
Provides-Extra: dev
Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
Requires-Dist: ruff>=0.11.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: pycryptodome>=3.20.0; extra == 'test'
Requires-Dist: pytest-cov>=5.0.0; extra == 'test'
Requires-Dist: pytest-mock>=3.12.0; extra == 'test'
Requires-Dist: pytest>=8.3.0; extra == 'test'
Requires-Dist: types-python-dateutil>=2.8.19.14; extra == 'test'
Description-Content-Type: text/markdown

# Circle Web3 APIs Python SDK

The Circle Web3 Python SDK provides convenient access to the Circle Web3 APIs for applications written in Python. For the API reference, see the [Circle Web3 API Docs](https://developers.circle.com/w3s/reference/getping).

PyPI packages:

- [`circle-developer-controlled-wallets`](https://pypi.org/project/circle-developer-controlled-wallets/)
- [`circle-smart-contract-platform`](https://pypi.org/project/circle-smart-contract-platform/)
- [`circle-user-controlled-wallets`](https://pypi.org/project/circle-user-controlled-wallets/)
- [`circle-configurations`](https://pypi.org/project/circle-configurations/) — base client (installed transitively by the others)

## Requirements

Python 3.10+.

## Installation

Install one or more of the SDK packages from PyPI:

```sh
pip install circle-developer-controlled-wallets
pip install circle-smart-contract-platform
pip install circle-user-controlled-wallets
```

## Usage

Secure your API key and entity secret by setting them as environment variables. See the [entity secret management guide](https://developers.circle.com/w3s/docs/entity-secret-management) for details.

```sh
export CIRCLE_WEB3_API_KEY="Your API KEY"
export CIRCLE_ENTITY_SECRET="Your entity secret"
```

Initialize the clients:

```python
from circle.web3 import utils

dcw_client = utils.init_developer_controlled_wallets_client(api_key="Your API KEY", entity_secret="Your entity secret")
scp_client = utils.init_smart_contract_platform_client(api_key="Your API KEY", entity_secret="Your entity secret")
ucw_client = utils.init_user_controlled_wallets_client(api_key="Your API KEY")
```

Make a request:

```python
from circle.web3 import user_controlled_wallets, utils

ucw_client = utils.init_user_controlled_wallets_client(api_key="<your-api-key>")

api_instance = user_controlled_wallets.PINAuthenticationApi(ucw_client)
try:
    api_request = user_controlled_wallets.UserTokenRequest.from_dict({"userId": "test-user"})
    api_response = api_instance.get_user_token(api_request)
    print(api_response.data.user_token)
except user_controlled_wallets.ApiException as e:
    print("Exception when calling PINAuthenticationApi->get_user_token: %s\n" % e)
```

## Development and contributing

- Architecture overview: [docs/architecture.md](docs/architecture.md)
- Environment setup, build, lint, and verification: [docs/development.md](docs/development.md)
- Test framework, markers, and CI matrix: [docs/testing.md](docs/testing.md)
- Contribution workflow and commit style: [CONTRIBUTING.md](CONTRIBUTING.md)
