Skip to main content

The Python SDK Utility for Circle Web3 Services

Project description

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.

PyPI packages:

Requirements

Python 3.10+.

Installation

Install one or more of the SDK packages from PyPI:

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 for details.

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

Initialize the clients:

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:

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circle_web3_sdk_util-9.5.0.tar.gz (739.7 kB view details)

Uploaded Source

File details

Details for the file circle_web3_sdk_util-9.5.0.tar.gz.

File metadata

  • Download URL: circle_web3_sdk_util-9.5.0.tar.gz
  • Upload date:
  • Size: 739.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for circle_web3_sdk_util-9.5.0.tar.gz
Algorithm Hash digest
SHA256 0968d586ab8f715031d888b6e4a920392c6ad9f1360ec077db36b8013ed48e70
MD5 ba69df2929846daa72866fdfda47d238
BLAKE2b-256 0bd9de8db4f1457f22344076744de422bfb65cf4d829e93209dfe96b7c9d5e69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page