Type definitions for Turnkey API
Project description
Turnkey SDK Types
Generated type definitions for the Turnkey API based on the OpenAPI specification.
Why Pydantic?
This package uses Pydantic models to handle field name conflicts with Python keywords. For example, some Turnkey API requests include a from field (like v1EthSendTransactionIntent), which is a reserved keyword in Python.
Pydantic's Field aliasing allows us to:
- Use
from_in Python code (avoiding syntax errors) - Automatically serialize to
fromwhen making API requests to Turnkey
class v1EthSendTransactionIntent(TurnkeyBaseModel):
from_: str = Field(alias="from")
# ... other fields
Installation
pip install -e .
Or install from the repository root:
pip install -e packages/sdk-types
Usage
from turnkey_sdk_types import (
# Generated types will be available here
# Example: CreateApiKeyRequest, CreateApiKeyResponse, etc.
)
Code Generation
This package uses code generation to create type definitions from the OpenAPI specification located in schema/public_api.swagger.json.
Generate Types
To regenerate the types:
cd packages/sdk-types
python scripts/generate.py
Development Setup
Install with dev dependencies to access code generation tools:
pip install -e ".[dev]"
Structure
sdk-types/
├── src/
│ └── turnkey_sdk_types/
│ ├── __init__.py # Package exports
│ ├── types.py # RequestType, SignedRequest (not generated)
│ ├── errors.py # TurnkeyError, TurnkeyNetworkError (not generated)
│ └── generated/ # Auto-generated from OpenAPI spec
│ └── types.py
├── scripts/
│ └── generate.py # Code generation script
├── pyproject.toml
└── README.md
Requirements
- Python >= 3.8
Development
Generated Types
The types in generated/types.py are automatically created from the OpenAPI specification at schema/public_api.swagger.json. These include all request/response models like v1EthSendTransactionIntent, CreateWalletBody, etc.
Important: Never edit files in src/turnkey_sdk_types/generated/ manually. They will be overwritten on the next generation run.
Non-Generated Types
Files outside the generated/ directory are maintained as part of the SDK and are not auto-generated:
types.py- Core SDK types likeRequestType,SignedRequesterrors.py- Error classes likeTurnkeyError,TurnkeyNetworkError
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file turnkey_sdk_types-0.1.0.tar.gz.
File metadata
- Download URL: turnkey_sdk_types-0.1.0.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f02217aad659f0d21ef0f8aff0451179d667e5fde783f55ba4be07ed6b8cea1e
|
|
| MD5 |
746059648f7ea5fda4a88586e8bcf299
|
|
| BLAKE2b-256 |
d8ba5cd93b7f9eae2cc5f710cd52c8fa16dc8e668461a9a8c3e2256be754c88a
|
Provenance
The following attestation bundles were made for turnkey_sdk_types-0.1.0.tar.gz:
Publisher:
validate-and-publish.yml on tkhq/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turnkey_sdk_types-0.1.0.tar.gz -
Subject digest:
f02217aad659f0d21ef0f8aff0451179d667e5fde783f55ba4be07ed6b8cea1e - Sigstore transparency entry: 1067229760
- Sigstore integration time:
-
Permalink:
tkhq/python-sdk@09843d9d51f150a6f49969b45f417714a7f75f77 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tkhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
validate-and-publish.yml@09843d9d51f150a6f49969b45f417714a7f75f77 -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file turnkey_sdk_types-0.1.0-py3-none-any.whl.
File metadata
- Download URL: turnkey_sdk_types-0.1.0-py3-none-any.whl
- Upload date:
- Size: 47.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7ee0ecf6cc2ca0902db526aca9b791c9133dd6020c44ce3fc7b44ceb35c83f9
|
|
| MD5 |
c343cada67f2a02c10de0604f11f5045
|
|
| BLAKE2b-256 |
3982772c1560f520f1369904e5a225b8061afafd7bfb1ebe373818ac5e443a38
|
Provenance
The following attestation bundles were made for turnkey_sdk_types-0.1.0-py3-none-any.whl:
Publisher:
validate-and-publish.yml on tkhq/python-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
turnkey_sdk_types-0.1.0-py3-none-any.whl -
Subject digest:
b7ee0ecf6cc2ca0902db526aca9b791c9133dd6020c44ce3fc7b44ceb35c83f9 - Sigstore transparency entry: 1067229804
- Sigstore integration time:
-
Permalink:
tkhq/python-sdk@09843d9d51f150a6f49969b45f417714a7f75f77 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tkhq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
validate-and-publish.yml@09843d9d51f150a6f49969b45f417714a7f75f77 -
Trigger Event:
pull_request
-
Statement type: