Skip to main content

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 from when 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 like RequestType, SignedRequest
  • errors.py - Error classes like TurnkeyError, TurnkeyNetworkError

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

turnkey_sdk_types-0.1.0.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

turnkey_sdk_types-0.1.0-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

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

Hashes for turnkey_sdk_types-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f02217aad659f0d21ef0f8aff0451179d667e5fde783f55ba4be07ed6b8cea1e
MD5 746059648f7ea5fda4a88586e8bcf299
BLAKE2b-256 d8ba5cd93b7f9eae2cc5f710cd52c8fa16dc8e668461a9a8c3e2256be754c88a

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file turnkey_sdk_types-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for turnkey_sdk_types-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ee0ecf6cc2ca0902db526aca9b791c9133dd6020c44ce3fc7b44ceb35c83f9
MD5 c343cada67f2a02c10de0604f11f5045
BLAKE2b-256 3982772c1560f520f1369904e5a225b8061afafd7bfb1ebe373818ac5e443a38

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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