diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9a71b60 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# Python +__pycache__/ +*.py[cod] +*$py.class +*.so +.Python + +# Virtual environments +venv/ +env/ +ENV/ +.venv + +# Environment variables +.env + +# Distribution / packaging +build/ +dist/ +*.egg-info/ +.eggs/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Testing +.pytest_cache/ +.coverage +htmlcov/ + +# Ruff +.ruff_cache/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cdcd567 --- /dev/null +++ b/Makefile @@ -0,0 +1,51 @@ +.PHONY: generate generate-types generate-http test format typecheck install clean help + +help: + @echo "Available commands:" + @echo " make generate - Generate all code (types + HTTP client)" + @echo " make generate-types - Generate type definitions" + @echo " make generate-http - Generate HTTP client" + @echo " make test - Run tests" + @echo " make format - Format all Python files with ruff" + @echo " make typecheck - Run mypy type checking" + @echo " make install - Install all packages in dev mode" + @echo " make clean - Remove generated files and caches" + +generate: generate-types generate-http + +generate-types: + @echo "๐Ÿ”ง Generating types..." + @python codegen/types/generate_types.py + +generate-http: + @echo "๐Ÿ”ง Generating HTTP client..." + @python codegen/http/generate_http.py + +test: + @echo "๐Ÿงช Running tests..." + @pytest packages/*/tests/ -v + +format: + @echo "๐ŸŽจ Formatting code..." + @ruff format . + +typecheck: + @echo "๐Ÿ” Running type checks..." + @mypy packages/ + @echo "โœ… Type checking complete" + +install: + @echo "๐Ÿ“ฆ Installing packages in dev mode..." + @pip install -e .[dev] + @pip install -e ./packages/sdk-types[dev] + @pip install -e ./packages/api-key-stamper[dev] + @pip install -e ./packages/http[dev] + @echo "โœ… All packages installed" + +clean: + @echo "๐Ÿงน Cleaning up..." + @find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true + @find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true + @echo "โœ… Cleanup complete" diff --git a/README.md b/README.md index bab4541..b00f420 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,119 @@ -# python-sdk -This repository contains support for interacting with the Turnkey API using Python +# Turnkey Python SDK -Unlike other languages ([Typescript](https://github.com/tkhq/sdk), [Ruby](https://github.com/tkhq/ruby-sdk)), we do not yet offer a full SDK for Python. +Python SDK for interacting with the Turnkey API. -If you are working on a project in Python and would benefit from a Python SDK please open an issue or get in touch with us (hello@turnkey.com) and we can discuss prioritizing this. +## ๐Ÿ“ฆ Packages -## Stamper +This is a monorepo containing multiple packages: -The stamper utility stamps requests to the Turnkey API and authenticates the requests. In order to use the stamper to successfully make API calls you need to have a Turnkey organization and an associated API key that is authorized to make requests. +- **`turnkey-sdk-types`** - Pydantic type definitions for Turnkey API +- **`turnkey-http`** - HTTP client for making API requests +- **`turnkey-api-key-stamper`** - API key authentication stamper -Fill out the fields at the beginning of the python stamper script with the correct information. +## ๐Ÿš€ Quick Start +### Installation + +```bash +pip install turnkey-http turnkey-api-key-stamper +``` + +### Usage + +```python +from turnkey_http import TurnkeyClient +from turnkey_api_key_stamper import ApiKeyStamper, ApiKeyStamperConfig + +# Initialize stamper +config = ApiKeyStamperConfig( + api_public_key="your-api-public-key", + api_private_key="your-api-private-key" +) +stamper = ApiKeyStamper(config) + +# Create client +client = TurnkeyClient( + base_url="https://api.turnkey.com", + stamper=stamper, + organization_id="your-org-id" +) + +# Make API calls +response = client.get_whoami() +print(response) +``` + +## ๐Ÿ’ป Development Setup + +### Prerequisites + +- Python 3.8+ +- pip + +### Setup + +1. Clone the repository: +```bash +git clone https://github.com/tkhq/python-sdk.git +cd python-sdk +``` + +2. Create and activate virtual environment: +```bash +python3 -m venv venv +source venv/bin/activate # On Windows: venv\Scripts\activate +``` + +3. Install all packages in editable mode: +```bash +make install ``` -ENDPOINT = "https://api.turnkey.com/public/v1/whoami" -API_PUBLIC_KEY="" -API_PRIVATE_KEY="" -ORG_ID = "" + +This installs all packages with their dev dependencies in editable mode, so changes take effect immediately. + + +### Code Generation + +This SDK uses code generation to stay in sync with the Turnkey API: + +```bash +make generate # Generate both types and HTTP client +# or +make generate-types # Generate types only +make generate-http # Generate HTTP client only ``` + +### Testing + +```bash +make test +``` + +### Code Quality + +Before committing, run these commands to ensure code cleanliness: + +```bash +make format # Format code with ruff +make typecheck # Check types with mypy +make test # Run tests +``` + +## ๐Ÿ“ Project Structure + +``` +python-sdk/ +โ”œโ”€โ”€ packages/ +โ”‚ โ”œโ”€โ”€ sdk-types/ # Type definitions +โ”‚ โ”‚ โ”œโ”€โ”€ src/ +โ”‚ โ”‚ โ””โ”€โ”€ scripts/ # Code generator +โ”‚ โ”œโ”€โ”€ http/ # HTTP client +โ”‚ โ”‚ โ”œโ”€โ”€ src/ +โ”‚ โ”‚ โ”œโ”€โ”€ scripts/ # Code generator +โ”‚ โ”‚ โ””โ”€โ”€ tests/ +โ”‚ โ””โ”€โ”€ api-key-stamper/ # Authentication +โ”‚ โ””โ”€โ”€ src/ +โ”œโ”€โ”€ schema/ # OpenAPI spec +โ””โ”€โ”€ examples/ # Example usage +``` + diff --git a/codegen/README.md b/codegen/README.md new file mode 100644 index 0000000..dc5f853 --- /dev/null +++ b/codegen/README.md @@ -0,0 +1,26 @@ +# Codegen + +Internal code generation scripts for the Turnkey Python SDK. + +This directory contains utilities and scripts to generate: +- Type definitions from OpenAPI spec +- HTTP client from OpenAPI spec + +## Usage + +These scripts are called via the Makefile: + +```bash +make generate # Generate all code +make generate-types # Generate type definitions only +make generate-http # Generate HTTP client only +``` + +## Structure + +- `utils.py` - Shared utilities and constants +- `pydantic_helpers.py` - Helper functions for Pydantic model generation +- `generate_types.py` - Generates type definitions +- `generate_http.py` - Generates HTTP client + +This is not a package and is not published to PyPI. It's only used during development. diff --git a/codegen/constants.py b/codegen/constants.py new file mode 100644 index 0000000..3c326de --- /dev/null +++ b/codegen/constants.py @@ -0,0 +1,102 @@ +"""Constants for code generation from OpenAPI spec.""" + +# Code generation header +COMMENT_HEADER = "# @generated by codegen. DO NOT EDIT BY HAND" + +# Activity type version mappings +# Each entry maps to a tuple of (versioned_type, intent_type, result_type) +VERSIONED_ACTIVITY_TYPES = { + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS": ( + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + "v1CreateAuthenticatorsIntentV2", + "v1CreateAuthenticatorsResult", + ), + "ACTIVITY_TYPE_CREATE_API_KEYS": ( + "ACTIVITY_TYPE_CREATE_API_KEYS_V2", + "v1CreateApiKeysIntentV2", + "v1CreateApiKeysResult", + ), + "ACTIVITY_TYPE_CREATE_POLICY": ( + "ACTIVITY_TYPE_CREATE_POLICY_V3", + "v1CreatePolicyIntentV3", + "v1CreatePolicyResult", + ), + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS": ( + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", + "v1CreatePrivateKeysIntentV2", + "v1CreatePrivateKeysResultV2", + ), + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION": ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + "v1CreateSubOrganizationIntentV7", + "v1CreateSubOrganizationResultV7", + ), + "ACTIVITY_TYPE_CREATE_USERS": ( + "ACTIVITY_TYPE_CREATE_USERS_V3", + "v1CreateUsersIntentV3", + "v1CreateUsersResult", + ), + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD": ( + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", + "v1SignRawPayloadIntentV2", + "v1SignRawPayloadResult", + ), + "ACTIVITY_TYPE_SIGN_TRANSACTION": ( + "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + "v1SignTransactionIntentV2", + "v1SignTransactionResult", + ), + "ACTIVITY_TYPE_EMAIL_AUTH": ( + "ACTIVITY_TYPE_EMAIL_AUTH_V3", + "v1EmailAuthIntentV3", + "v1EmailAuthResult", + ), + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION": ( + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + "v1CreateReadWriteSessionIntentV2", + "v1CreateReadWriteSessionResultV2", + ), + "ACTIVITY_TYPE_UPDATE_POLICY": ( + "ACTIVITY_TYPE_UPDATE_POLICY_V2", + "v1UpdatePolicyIntentV2", + "v1UpdatePolicyResultV2", + ), + "ACTIVITY_TYPE_INIT_OTP_AUTH": ( + "ACTIVITY_TYPE_INIT_OTP_AUTH_V3", + "v1InitOtpAuthIntentV3", + "v1InitOtpAuthResultV2", + ), + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY": ( + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2", + "v1InitUserEmailRecoveryIntentV2", + "v1InitUserEmailRecoveryResult", + ), + "ACTIVITY_TYPE_INIT_OTP": ( + "ACTIVITY_TYPE_INIT_OTP_V2", + "v1InitOtpIntentV2", + "v1InitOtpResult", + ), +} + +# Methods that have only optional parameters +METHODS_WITH_ONLY_OPTIONAL_PARAMETERS = [ + "getActivities", + "getApiKeys", + "getOrganization", + "getPolicies", + "getPrivateKeys", + "getSubOrgIds", + "getUsers", + "getWallets", + "getWhoami", + "listPrivateKeys", + "listUserTags", +] + +# Terminal activity statuses +TERMINAL_ACTIVITY_STATUSES = [ + "ACTIVITY_STATUS_COMPLETED", + "ACTIVITY_STATUS_FAILED", + "ACTIVITY_STATUS_CONSENSUS_NEEDED", + "ACTIVITY_STATUS_REJECTED", +] diff --git a/codegen/http/generate_http.py b/codegen/http/generate_http.py new file mode 100644 index 0000000..3bc57b8 --- /dev/null +++ b/codegen/http/generate_http.py @@ -0,0 +1,585 @@ +#!/usr/bin/env python3 +"""Generate HTTP client from OpenAPI specification.""" + +import json +import subprocess +import sys +from pathlib import Path +from typing import Dict, Any + +# Add codegen directory to Python path +CODEGEN_DIR = Path(__file__).parent.parent +sys.path.insert(0, str(CODEGEN_DIR)) + +from constants import ( + COMMENT_HEADER, + METHODS_WITH_ONLY_OPTIONAL_PARAMETERS, + TERMINAL_ACTIVITY_STATUSES, +) +from utils import ( + to_snake_case, + extract_latest_versions, + method_type_from_method_name, + resolve_versioned_activity_type, +) + +# Get the project root directory +PROJECT_ROOT = Path(__file__).parent.parent.parent +SCHEMA_PATH = PROJECT_ROOT / "schema" / "public_api.swagger.json" +OUTPUT_DIR = PROJECT_ROOT / "packages" / "http" / "src" / "turnkey_http" / "generated" +OUTPUT_FILE = OUTPUT_DIR / "client.py" + + +def generate_sdk_client(swagger: Dict[str, Any]) -> str: + """Generate the SDK client from Swagger spec.""" + namespace = next( + (tag["name"] for tag in swagger.get("tags", []) if "name" in tag), None + ) + code_buffer = [] + latest_versions = extract_latest_versions(swagger["definitions"]) + + # Generate class header + code_buffer.append(""" +class TurnkeyClient: + \"\"\"Turnkey API HTTP client with auto-generated methods.\"\"\" + + def __init__( + self, + base_url: str, + stamper: ApiKeyStamper, + organization_id: str, + default_timeout: int = 30, + polling_interval_ms: int = 1000, + max_polling_retries: int = 3 + ): + \"\"\"Initialize the Turnkey client. + + Args: + base_url: Base URL for the Turnkey API + stamper: API key stamper for authentication + organization_id: Organization ID + default_timeout: Default request timeout in seconds + polling_interval_ms: Polling interval for activity status in milliseconds + max_polling_retries: Maximum number of polling retries + \"\"\" + self.base_url = base_url.rstrip("/") + self.stamper = stamper + self.organization_id = organization_id + self.default_timeout = default_timeout + self.polling_interval_ms = polling_interval_ms + self.max_polling_retries = max_polling_retries + + def _serialize_body(self, body: Any) -> str: + \"\"\"Serialize request body, handling Pydantic models recursively. + + Args: + body: Request body (dict, Pydantic model, list, or primitive) + + Returns: + JSON string + \"\"\" + def serialize_value(value): + \"\"\"Recursively serialize values, converting Pydantic models to dicts.\"\"\" + if hasattr(value, 'model_dump'): + return value.model_dump(by_alias=True, exclude_none=True) + elif isinstance(value, dict): + return {k: serialize_value(v) for k, v in value.items()} + elif isinstance(value, list): + return [serialize_value(item) for item in value] + else: + return value + + serialized = serialize_value(body) + return json.dumps(serialized) + + def _request(self, url: str, body: Dict[str, Any], response_type: type) -> Any: + \"\"\"Make a request to the Turnkey API. + + Args: + url: Endpoint URL + body: Request body + response_type: Pydantic model class for response parsing + + Returns: + Parsed response as Pydantic model + + Raises: + TurnkeyNetworkError: If request fails + \"\"\" + full_url = self.base_url + url + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + headers = { + stamp.stamp_header_name: stamp.stamp_header_value, + "Content-Type": "application/json", + "X-Client-Version": VERSION + } + + try: + response = requests.post( + full_url, + headers=headers, + data=body_str, + timeout=self.default_timeout + ) + except requests.RequestException as exc: + raise TurnkeyNetworkError( + "Request failed", + None, + TurnkeyErrorCodes.NETWORK_ERROR, + str(exc) + ) from exc + + if not response.ok: + try: + error_data = response.json() + error_message = error_data.get("message", str(error_data)) + except ValueError: + error_message = response.text or f"{response.status_code} {response.reason}" + + raise TurnkeyNetworkError( + error_message, + response.status_code, + TurnkeyErrorCodes.BAD_RESPONSE, + response.text + ) + + response_data = response.json() + return response_type(**response_data) + + def _poll_for_completion(self, activity: Any) -> Any: + \"\"\"Poll until activity reaches terminal status. + + Args: + activity: Initial activity object with id and status attributes. + + Returns: + Activity object after reaching terminal status or max retries. + \"\"\" + if activity.status in TERMINAL_ACTIVITY_STATUSES: + return activity + + attempts = 0 + while attempts < self.max_polling_retries: + time.sleep(self.polling_interval_ms / 1000.0) + poll_response = self.get_activity(GetActivityBody(activityId=activity.id)) + activity = poll_response.activity + if activity.status in TERMINAL_ACTIVITY_STATUSES: + break + attempts += 1 + + return activity + + def _activity(self, url: str, body: Dict[str, Any], result_key: str, response_type: type) -> Any: + \"\"\"Execute an activity and poll for completion. + + Args: + url: Endpoint URL + body: Request body + result_key: Key to extract result from activity when completed + response_type: Pydantic model class for response parsing + + Returns: + Parsed response as Pydantic model with flattened result fields + \"\"\" + # Make initial request, we parse as activity response without result fields + initial_response = self._request(url, body, GetActivityResponse) + + # Poll for completion + activity = self._poll_for_completion(initial_response.activity) + + # If activity completed successfully, flatten result fields into response + if activity.status == "ACTIVITY_STATUS_COMPLETED" and hasattr(activity, 'result') and activity.result: + result = activity.result + # Get the versioned result key (e.g., 'createApiKeysResultV2') + if hasattr(result, result_key): + result_data = getattr(result, result_key) + if result_data and hasattr(result_data, 'model_dump'): + # Flatten result fields into response + result_dict = result_data.model_dump(by_alias=True, exclude_none=True) + # Construct final response with activity and result fields + response = response_type( + activity=activity, + **result_dict + ) + return response + + # Return response with just the activity (no result fields) + return response_type(activity=activity) + + def _activity_decision(self, url: str, body: Dict[str, Any], response_type: type) -> Any: + \"\"\"Execute an activity decision. + + Args: + url: Endpoint URL + body: Request body + response_type: Pydantic model class for response parsing + + Returns: + Parsed response as Pydantic model + \"\"\" + return self._request(url, body, response_type) + + @overload + def send_signed_request(self, signed_request: SignedRequest, response_type: type[T]) -> T: ... + + @overload + def send_signed_request(self, signed_request: SignedRequest) -> Any: ... + + def send_signed_request(self, signed_request: SignedRequest, response_type: type[T] | None = None) -> Any: + \"\"\"Submit a signed request and poll for activity completion if needed. + + You can pass in the SignedRequest returned by any of the SDK's + stamping methods (stamp_create_api_keys, stamp_get_policies, etc.). + + For activities, this will poll until the activity reaches a terminal status. + + Args: + signed_request: A SignedRequest object returned by a stamping method. + response_type: Optional callable to convert the JSON payload to a typed value. + Typically a Pydantic model class. + + Returns: + The parsed response via response_type, or raw JSON dict if no type provided. + + Raises: + TurnkeyNetworkError: If the request fails. + \"\"\" + headers = { + signed_request.stamp.stamp_header_name: signed_request.stamp.stamp_header_value, + "Content-Type": "application/json", + "X-Client-Version": VERSION, + } + + try: + response = requests.post( + signed_request.url, + headers=headers, + data=signed_request.body, + timeout=self.default_timeout + ) + except requests.RequestException as exc: + raise TurnkeyNetworkError( + "Signed request failed", + None, + TurnkeyErrorCodes.NETWORK_ERROR, + str(exc) + ) from exc + + if not response.ok: + try: + error_data = response.json() + error_message = error_data.get("message", str(error_data)) + except ValueError: + error_message = response.text or f"{response.status_code} {response.reason}" + + raise TurnkeyNetworkError( + error_message, + response.status_code, + TurnkeyErrorCodes.BAD_RESPONSE, + response.text + ) + + payload = response.json() + + # Poll for activity completion if this is an activity request + if signed_request.type == RequestType.ACTIVITY: + activity_response = GetActivityResponse(**payload) + activity = self._poll_for_completion(activity_response.activity) + + # Update payload with polled activity + activity_dict = activity.model_dump(by_alias=True, exclude_none=True) if hasattr(activity, 'model_dump') else {} + payload["activity"] = activity_dict + + # Extract result fields if activity completed successfully + if activity.status == "ACTIVITY_STATUS_COMPLETED" and hasattr(activity, 'result') and activity.result: + result = activity.result + # Find the first result field (e.g., createApiKeysResult, createPolicyResult, etc.) + for attr_name in dir(result): + if not attr_name.startswith('_') and attr_name.endswith('Result'): + result_data = getattr(result, attr_name, None) + if result_data and hasattr(result_data, 'model_dump'): + # Flatten result fields into payload + result_dict = result_data.model_dump(by_alias=True, exclude_none=True) + payload.update(result_dict) + break + + return response_type(**payload) if response_type is not None else payload +""") + + # Generate methods for each endpoint + for path, methods in swagger["paths"].items(): + operation = methods.get("post") + if not operation: + continue + + operation_id = operation.get("operationId") + if not operation_id: + continue + + operation_name_without_namespace = operation_id.replace(f"{namespace}_", "") + + if operation_name_without_namespace == "NOOPCodegenAnchor": + continue + + method_name = ( + operation_name_without_namespace[0].lower() + + operation_name_without_namespace[1:] + ) + snake_method_name = to_snake_case(method_name) + method_type = method_type_from_method_name(method_name) + + # Extract description from OpenAPI spec + summary = operation.get("summary", "") + + input_type = f"{operation_name_without_namespace}Body" + response_type = f"{operation_name_without_namespace}Response" + + unversioned_activity_type = ( + f"ACTIVITY_TYPE_{to_snake_case(operation_name_without_namespace).upper()}" + ) + versioned_activity_type = resolve_versioned_activity_type( + unversioned_activity_type + ) + + # Generate method + if method_type == "query": + has_optional_params = method_name in METHODS_WITH_ONLY_OPTIONAL_PARAMETERS + + if has_optional_params: + # Method has only optional parameters so we allow None with default + code_buffer.append(f""" + def {snake_method_name}(self, input: Optional[{input_type}] = None) -> {response_type}: + if input is None: + input_dict = {{}} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {{ + "organizationId": organization_id, + **input_dict + }} + + return self._request("{path}", body, {response_type}) + + def stamp_{snake_method_name}(self, input: Optional[{input_type}] = None) -> SignedRequest: + \"\"\"Stamp a {method_name} request without sending it.\"\"\" + + if input is None: + input_dict = {{}} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {{ + "organizationId": organization_id, + **input_dict + }} + + full_url = self.base_url + "{path}" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest(url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY) +""") + else: + # Method has required parameters so input is required, not Optional + code_buffer.append(f""" + def {snake_method_name}(self, input: {input_type}) -> {response_type}: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {{ + "organizationId": organization_id, + **input_dict + }} + + return self._request("{path}", body, {response_type}) + + def stamp_{snake_method_name}(self, input: {input_type}) -> SignedRequest: + \"\"\"Stamp a {method_name} request without sending it.\"\"\" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {{ + "organizationId": organization_id, + **input_dict + }} + + full_url = self.base_url + "{path}" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest(url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY) +""") + + elif method_type == "activity": + result_key = operation_name_without_namespace + "Result" + versioned_method_name = latest_versions[result_key]["formatted_key_name"] + + code_buffer.append(f""" + def {snake_method_name}(self, input: {input_type}) -> {response_type}: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = {{ + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "{versioned_activity_type}" + }} + + return self._activity("{path}", body, "{versioned_method_name}", {response_type}) + + def stamp_{snake_method_name}(self, input: {input_type}) -> SignedRequest: + \"\"\"Stamp a {method_name} request without sending it.\"\"\" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = {{ + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "{versioned_activity_type}" + }} + + full_url = self.base_url + "{path}" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest(url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY) +""") + + elif method_type == "activityDecision": + code_buffer.append(f""" + def {snake_method_name}(self, input: {input_type}) -> {response_type}: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = {{ + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "{unversioned_activity_type}" + }} + + return self._activity_decision("{path}", body, {response_type}) + + def stamp_{snake_method_name}(self, input: {input_type}) -> SignedRequest: + \"\"\"Stamp a {method_name} request without sending it.\"\"\" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = {{ + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "{unversioned_activity_type}" + }} + + full_url = self.base_url + "{path}" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest(url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY_DECISION) +""") + + return "\n".join(code_buffer) + + +def main(): + """Generate HTTP client from OpenAPI spec.""" + print("๐Ÿ”ง Turnkey SDK HTTP Generator") + print("=" * 50) + + # Check if schema file exists + if not SCHEMA_PATH.exists(): + print(f"โŒ Error: Schema file not found at {SCHEMA_PATH}") + print( + f" Please ensure public_api.swagger.json exists in the schema directory" + ) + return 1 + + print(f"๐Ÿ“„ Schema: {SCHEMA_PATH}") + print(f"๐Ÿ“ Output: {OUTPUT_FILE}") + print() + + # Load swagger + with open(SCHEMA_PATH, "r") as f: + swagger = json.load(f) + + print(f"โœ“ Loaded OpenAPI spec") + print(f" Found {len(swagger['paths'])} API endpoints") + print() + + # Generate client + print("๐Ÿ”จ Generating HTTP client...") + client_code = generate_sdk_client(swagger) + + # Build full output + output = f"{COMMENT_HEADER}\n\n" + output += "import json\nimport time\nfrom typing import Any, Callable, Dict, Optional, TypeVar, overload\nimport requests\n" + output += "from turnkey_api_key_stamper import ApiKeyStamper\n" + output += "from turnkey_sdk_types import *\n" + output += "from ..version import VERSION\n\n" + output += "T = TypeVar('T')\n\n" + output += f"TERMINAL_ACTIVITY_STATUSES = {TERMINAL_ACTIVITY_STATUSES}\n\n" + output += client_code + + # Ensure output directory exists + OUTPUT_DIR.mkdir(parents=True, exist_ok=True) + + # Write output + with open(OUTPUT_FILE, "w") as f: + f.write(output) + + print(f"โœ… Generated {OUTPUT_FILE}") + print(f" {len(swagger['paths'])} API methods") + + # Format with ruff + print() + print("๐ŸŽจ Formatting with ruff...") + try: + subprocess.run( + ["ruff", "format", str(OUTPUT_FILE)], + check=True, + capture_output=True, + text=True, + ) + print(f"โœ… Formatted {OUTPUT_FILE}") + except subprocess.CalledProcessError as e: + print(f"โš ๏ธ Formatting failed: {e.stderr}") + except FileNotFoundError: + print("โš ๏ธ ruff not found so skipping formatting") + print(" Install with: pip install ruff") + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/codegen/types/generate_types.py b/codegen/types/generate_types.py new file mode 100644 index 0000000..db52478 --- /dev/null +++ b/codegen/types/generate_types.py @@ -0,0 +1,487 @@ +#!/usr/bin/env python3 +"""Generate type definitions from OpenAPI specification.""" + +import json +import re +import subprocess +import sys +from pathlib import Path +from typing import Dict, List, Optional, Any + +# Add codegen directory to Python path +CODEGEN_DIR = Path(__file__).parent.parent +sys.path.insert(0, str(CODEGEN_DIR)) + +from pydantic_helpers import needs_field_alias, safe_property_name +from constants import ( + COMMENT_HEADER, + METHODS_WITH_ONLY_OPTIONAL_PARAMETERS, +) +from utils import ( + extract_latest_versions, + method_type_from_method_name, + get_versioned_intent_type, + get_versioned_result_type, +) + +# Get the project root directory +PROJECT_ROOT = Path(__file__).parent.parent.parent +SCHEMA_PATH = PROJECT_ROOT / "schema" / "public_api.swagger.json" +OUTPUT_DIR = ( + PROJECT_ROOT / "packages" / "sdk-types" / "src" / "turnkey_sdk_types" / "generated" +) +OUTPUT_FILE = OUTPUT_DIR / "types.py" + + +def swagger_type_to_python(swagger_type: str, schema: Dict[str, Any]) -> str: + """Convert Swagger type to Python type hint.""" + if swagger_type in ("integer", "number"): + return "int" + if swagger_type == "boolean": + return "bool" + if swagger_type == "string": + return "str" + if swagger_type == "array": + if "items" in schema: + if "$ref" in schema["items"]: + return f"List[{ref_to_python(schema['items']['$ref'])}]" + elif "type" in schema["items"]: + return f"List[{swagger_type_to_python(schema['items']['type'], schema['items'])}]" + return "List[Any]" + if swagger_type == "object": + return "Dict[str, Any]" + return "Any" + + +def ref_to_python(ref: str) -> str: + """Convert $ref to Python type name.""" + return ref.replace("#/definitions/", "") + + +def strip_version_suffix(activity_type: str) -> str: + """Remove version suffix from activity type.""" + return re.sub(r"(_V\d+)$", "", activity_type) + + +def is_valid_identifier(name: str) -> bool: + """Check if a string is a valid Python identifier.""" + return name.isidentifier() + + +def generate_python_type(name: str, definition: Dict[str, Any]) -> str: + """Generate Pydantic model from Swagger definition.""" + if definition.get("type") == "object" and ( + "properties" in definition or "additionalProperties" in definition + ): + output = f"class {name}(TurnkeyBaseModel):\n" + + if "properties" in definition: + required = definition.get("required", []) + for prop, schema in definition["properties"].items(): + prop_type = "Any" + if "$ref" in schema: + prop_type = ref_to_python(schema["$ref"]) + elif "type" in schema: + prop_type = swagger_type_to_python(schema["type"], schema) + + # Make field optional if not required + is_required = prop in required + if not is_required: + prop_type = f"Optional[{prop_type}]" + + desc = schema.get("description", "") + safe_prop = safe_property_name(prop) + needs_alias, original_prop = needs_field_alias(prop) + + # Build Field definition + if needs_alias: + field_params = [] + if not is_required: + field_params.append("default=None") + field_params.append(f'alias="{original_prop}"') + if desc: + field_params.append(f'description="{desc}"') + field_def = f"Field({', '.join(field_params)})" + output += f" {safe_prop}: {prop_type} = {field_def}\n" + elif desc or not is_required: + field_params = [] + if not is_required: + field_params.append("default=None") + if desc: + field_params.append(f'description="{desc}"') + field_def = f"Field({', '.join(field_params)})" + output += f" {safe_prop}: {prop_type} = {field_def}\n" + else: + # Required field with no description or alias: bare annotation + output += f" {safe_prop}: {prop_type}\n" + + if not definition.get("properties"): + output += " pass\n" + + return output + "\n" + + if definition.get("type") == "string" and "enum" in definition: + # Generate proper enum members: MEMBER_NAME = "MEMBER_VALUE" + enum_members = [] + for e in definition["enum"]: + # Use the enum value as both the member name and value + # This allows both EnumClass.MEMBER_NAME and "MEMBER_VALUE" string to work + enum_members.append(f'{e} = "{e}"') + enum_values = "\n ".join(enum_members) + return f"class {name}(str, Enum):\n {enum_values}\n\n" + + return f"class {name}(TurnkeyBaseModel):\n pass\n\n" + + +def generate_inline_properties( + definition: Optional[Dict[str, Any]], is_all_optional: bool = False +) -> str: + """Generate inline Pydantic properties.""" + output = "" + if definition and "properties" in definition: + required_props = definition.get("required", []) + for prop, schema in definition["properties"].items(): + prop_type = "Any" + if "$ref" in schema: + prop_type = ref_to_python(schema["$ref"]) + elif "type" in schema: + prop_type = swagger_type_to_python(schema["type"], schema) + + # For activity response types, result fields should be optional since they're only present when completed + is_required = prop in required_props and not is_all_optional + if not is_required: + prop_type = f"Optional[{prop_type}]" + + desc = schema.get("description", "") + safe_prop = safe_property_name(prop) + needs_alias, original_prop = needs_field_alias(prop) + + # Build Field definition + if needs_alias: + field_params = [] + if not is_required: + field_params.append("default=None") + field_params.append(f'alias="{original_prop}"') + if desc: + field_params.append(f'description="{desc}"') + field_def = f"Field({', '.join(field_params)})" + output += f" {safe_prop}: {prop_type} = {field_def}\n" + elif desc or not is_required: + field_params = [] + if not is_required: + field_params.append("default=None") + if desc: + field_params.append(f'description="{desc}"') + field_def = f"Field({', '.join(field_params)})" + output += f" {safe_prop}: {prop_type} = {field_def}\n" + else: + # Required field with no description or alias: bare annotation + output += f" {safe_prop}: {prop_type}\n" + + return output + + +def generate_api_types(swagger: Dict[str, Any], prefix: str = "") -> str: + """Generate API types from Swagger paths.""" + namespace = next( + (tag["name"] for tag in swagger.get("tags", []) if "name" in tag), None + ) + output = "" + latest_versions = extract_latest_versions(swagger["definitions"]) + definitions = swagger["definitions"] + + for path, methods in swagger["paths"].items(): + operation = methods.get("post") + if not operation: + continue + + operation_id = operation.get("operationId") + if not operation_id: + continue + + operation_name_without_namespace = operation_id.replace(f"{namespace}_", prefix) + method_name = ( + operation_name_without_namespace[0].lower() + + operation_name_without_namespace[1:] + ) + method_type = method_type_from_method_name(method_name) + + # Get response schema + response_schema = None + if "responses" in operation and "200" in operation["responses"]: + response_schema = ( + operation["responses"]["200"].get("schema", {}).get("$ref") + ) + response_type_name = ref_to_python(response_schema) if response_schema else None + + # Compose API type names + api_type_name = ( + operation_name_without_namespace[0].upper() + + operation_name_without_namespace[1:] + + "Response" + ) + api_body_type_name = ( + operation_name_without_namespace[0].upper() + + operation_name_without_namespace[1:] + + "Body" + ) + api_input_type_name = ( + operation_name_without_namespace[0].upper() + + operation_name_without_namespace[1:] + + "Input" + ) + + # --- RESPONSE TYPE GENERATION --- + if method_type == "activity": + result_type_name = None + activity_type_key = None + version_suffix = None + + parameters = operation.get("parameters", []) + for param in parameters: + if param.get("in") == "body" and "$ref" in param.get("schema", {}): + req_type_name = ref_to_python(param["schema"]["$ref"]) + req_def = definitions.get(req_type_name) + if ( + req_def + and "properties" in req_def + and "type" in req_def["properties"] + ): + type_prop = req_def["properties"]["type"] + if "enum" in type_prop and type_prop["enum"]: + activity_type_key = strip_version_suffix( + type_prop["enum"][0] + ) + versioned_result = get_versioned_result_type( + activity_type_key + ) + + base_activity = re.sub(r"^v\d+", "", req_type_name) + base_activity = re.sub( + r"Request(V\d+)?$", "", base_activity + ) + result_base = base_activity + "Result" + result_key = None + + if result_base in latest_versions: + # Use mapped result type directly if available + if versioned_result and versioned_result in definitions: + result_key = versioned_result + if not result_key: + result_key = latest_versions[result_base][ + "full_name" + ] + + if result_key: + result_type_name = result_key + + output += f"class {api_type_name}(TurnkeyBaseModel):\n" + output += " activity: v1Activity\n" + if result_type_name and result_type_name in definitions: + # Include result fields as required - they're present when function returns successfully + result_props = generate_inline_properties( + definitions[result_type_name], is_all_optional=False + ) + if result_props.strip(): # Only add if there are actual properties + output += result_props + output += "\n\n" + + elif method_type in ("query", "noop"): + resp_def = ( + definitions.get(response_type_name) if response_type_name else None + ) + if resp_def: + if "properties" in resp_def: + output += f"class {api_type_name}(TurnkeyBaseModel):\n" + output += generate_inline_properties(resp_def) + output += "\n\n" + else: + output += f"class {api_type_name}(TurnkeyBaseModel):\n pass\n\n" + + elif method_type == "activityDecision": + activity_type = ( + definitions.get(response_type_name) if response_type_name else None + ) + if activity_type and "properties" in activity_type: + output += f"class {api_type_name}(TurnkeyBaseModel):\n" + output += generate_inline_properties(activity_type) + output += "\n\n" + + # --- REQUEST TYPE GENERATION --- + request_type_def = None + request_type_name = None + parameters = operation.get("parameters", []) + + for param in parameters: + if param.get("in") == "body" and "$ref" in param.get("schema", {}): + request_type_name = ref_to_python(param["schema"]["$ref"]) + request_type_def = definitions.get(request_type_name) + + if not request_type_def: + continue + + output += f"class {api_body_type_name}(TurnkeyBaseModel):\n" + + if method_type in ("activity", "activityDecision"): + output += " timestampMs: Optional[str] = None\n" + output += " organizationId: Optional[str] = None\n" + + if ( + "properties" in request_type_def + and "parameters" in request_type_def["properties"] + ): + params_prop = request_type_def["properties"]["parameters"] + if "$ref" in params_prop: + is_all_optional = ( + method_name in METHODS_WITH_ONLY_OPTIONAL_PARAMETERS + ) + intent_type_name = ref_to_python(params_prop["$ref"]) + + base_activity = re.sub(r"^v\d+", "", request_type_name).replace( + re.compile(r"Request(V\d+)?$").pattern, "" + ) + activity_type_key = strip_version_suffix( + request_type_def["properties"]["type"]["enum"][0] + ) + versioned_intent = get_versioned_intent_type(activity_type_key) + + adjusted_intent_type_name = intent_type_name + if versioned_intent and versioned_intent in definitions: + adjusted_intent_type_name = versioned_intent + + intent_def = definitions.get(adjusted_intent_type_name) + output += generate_inline_properties(intent_def, is_all_optional) + + elif method_type in ("query", "noop"): + output += " organizationId: Optional[str] = None\n" + if "properties" in request_type_def: + is_all_optional = method_name in METHODS_WITH_ONLY_OPTIONAL_PARAMETERS + required_props = request_type_def.get("required", []) + for prop, schema in request_type_def["properties"].items(): + if prop == "organizationId": + continue + prop_type = "Any" + if "$ref" in schema: + prop_type = ref_to_python(schema["$ref"]) + elif "type" in schema: + prop_type = swagger_type_to_python(schema["type"], schema) + + # Check if field is required + is_required = prop in required_props and not is_all_optional + if not is_required: + prop_type = f"Optional[{prop_type}]" + + desc = schema.get("description", "") + safe_prop = safe_property_name(prop) + needs_alias, original_prop = needs_field_alias(prop) + + # Build Field definition + if needs_alias: + field_params = [] + if not is_required: + field_params.append("default=None") + field_params.append(f'alias="{original_prop}"') + if desc: + field_params.append(f'description="{desc}"') + field_def = f"Field({', '.join(field_params)})" + output += f" {safe_prop}: {prop_type} = {field_def}\n" + elif desc or not is_required: + field_params = [] + if not is_required: + field_params.append("default=None") + if desc: + field_params.append(f'description="{desc}"') + field_def = f"Field({', '.join(field_params)})" + output += f" {safe_prop}: {prop_type} = {field_def}\n" + else: + # Required field with no description or alias: bare annotation + output += f" {safe_prop}: {prop_type}\n" + + output += "\n\n" + output += f"class {api_input_type_name}(TurnkeyBaseModel):\n" + output += f" body: {api_body_type_name}\n\n\n" + + return output + + +def main(): + """Generate types from OpenAPI spec.""" + print("๐Ÿ”ง Turnkey SDK Types Generator") + print("=" * 50) + + # Check if schema file exists + if not SCHEMA_PATH.exists(): + print(f"โŒ Error: Schema file not found at {SCHEMA_PATH}") + print( + f" Please ensure public_api.swagger.json exists in the schema directory" + ) + return 1 + + print(f"๐Ÿ“„ Schema: {SCHEMA_PATH}") + print(f"๐Ÿ“ Output: {OUTPUT_FILE}") + print() + + # Load swagger + with open(SCHEMA_PATH, "r") as f: + swagger_main = json.load(f) + + print(f"โœ“ Loaded OpenAPI spec") + + # Generate output + output = f"{COMMENT_HEADER}\n\n" + output += "from __future__ import annotations\n" + output += "from typing import Any, Dict, List, Optional\n" + output += "from enum import Enum\n" + output += "from pydantic import BaseModel, Field, ConfigDict\n\n" + output += "\n# Base class with shared configuration\n" + output += "class TurnkeyBaseModel(BaseModel):\n" + output += " model_config = ConfigDict(populate_by_name=True)\n\n" + + # --- Base Types --- + output += "# --- Base Types from Swagger Definitions ---\n\n" + + for def_name, definition in swagger_main["definitions"].items(): + if (definition.get("type") == "object" and "properties" in definition) or ( + definition.get("type") == "string" and "enum" in definition + ): + output += generate_python_type(def_name, definition) + else: + output += f"class {def_name}(TurnkeyBaseModel):\n pass\n\n" + + # --- API Types --- + output += "\n# --- API Types from Swagger Paths ---\n\n" + output += generate_api_types(swagger_main) + + # Ensure output directory exists + OUTPUT_DIR.mkdir(parents=True, exist_ok=True) + + # Write output + with open(OUTPUT_FILE, "w") as f: + f.write(output) + + print(f"โœ… Generated {OUTPUT_FILE}") + print(f" {len(swagger_main['definitions'])} base types") + print(f" {len(swagger_main['paths'])} API endpoints") + + # Format with ruff + print() + print("๐ŸŽจ Formatting with ruff...") + try: + subprocess.run( + ["ruff", "format", str(OUTPUT_FILE)], + check=True, + capture_output=True, + text=True, + ) + print(f"โœ… Formatted {OUTPUT_FILE}") + except subprocess.CalledProcessError as e: + print(f"โš ๏ธ Formatting failed: {e.stderr}") + except FileNotFoundError: + print("โš ๏ธ ruff not found - skipping formatting") + print(" Install with: pip install ruff") + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/codegen/types/pydantic_helpers.py b/codegen/types/pydantic_helpers.py new file mode 100644 index 0000000..9f5d3e9 --- /dev/null +++ b/codegen/types/pydantic_helpers.py @@ -0,0 +1,44 @@ +"""Helper functions for Pydantic model generation.""" + +import keyword +from typing import Dict, Any, Tuple + + +def needs_field_alias(prop: str) -> Tuple[bool, str]: + """Check if property needs a Field alias and return (needs_alias, original_name).""" + # Check for @ prefix + if prop.startswith("@"): + return True, prop + + # Check for Python keywords + if keyword.iskeyword(prop): + return True, prop + + # Check for invalid identifiers + if not prop.isidentifier(): + return True, prop + + return False, prop + + +def safe_property_name(name: str) -> str: + """Convert a property name to a safe Python identifier.""" + # If it starts with @, remove it + if name.startswith("@"): + name = name[1:] + + # If it's a Python keyword, append underscore + if keyword.iskeyword(name): + return name + "_" + + # If it's not a valid identifier, try to make it one + if not name.isidentifier(): + # Replace invalid chars with underscore + import re + + name = re.sub(r"[^a-zA-Z0-9_]", "_", name) + # If it starts with a digit, prepend underscore + if name and name[0].isdigit(): + name = "_" + name + + return name diff --git a/codegen/utils.py b/codegen/utils.py new file mode 100644 index 0000000..dcaf713 --- /dev/null +++ b/codegen/utils.py @@ -0,0 +1,137 @@ +"""Shared utilities for code generation from OpenAPI spec.""" + +import re +from typing import Dict, Any + +from constants import VERSIONED_ACTIVITY_TYPES + + +def to_snake_case(name: str) -> str: + """Convert camelCase to snake_case. + + Args: + name: CamelCase or camelCase string + + Returns: + snake_case string + """ + s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name) + return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() + + +def extract_latest_versions(definitions: Dict[str, Any]) -> Dict[str, Dict[str, str]]: + """Extract the latest versions of definitions from OpenAPI spec. + + Args: + definitions: Dictionary of OpenAPI definitions + + Returns: + Dictionary mapping base names to their latest version info + """ + latest_versions = {} + key_version_regex = re.compile(r"^(v\d+)([A-Za-z0-9]+?)(V\d+)?$") + + for key in definitions.keys(): + match = key_version_regex.match(key) + if match: + full_name = match.group(0) + base_name = match.group(2) + version_suffix = match.group(3) or "" + formatted_key_name = base_name[0].lower() + base_name[1:] + version_suffix + + if base_name not in latest_versions or version_suffix > latest_versions[ + base_name + ].get("version_suffix", ""): + latest_versions[base_name] = { + "full_name": full_name, + "formatted_key_name": formatted_key_name, + "version_suffix": version_suffix, + } + + return latest_versions + + +def method_type_from_method_name(method_name: str) -> str: + """Determine method type from method name. + + Args: + method_name: The method name (e.g., "getWhoami", "tGetWhoami", "createPrivateKeys") + + Returns: + Method type: "query", "activity", "activityDecision", or "noop" + """ + method_name_lower = method_name.lower() + + if method_name in ["approveActivity", "rejectActivity"]: + return "activityDecision" + if method_name.startswith("nOOP"): + return "noop" + # Note: method names may have 't' prefix from types generation (e.g., "tGetWhoami") + # or no prefix from HTTP generation (e.g., "getWhoami") + if ( + method_name_lower.startswith("get") + or method_name_lower.startswith("list") + or method_name_lower.startswith("test") + or method_name_lower.startswith("tget") + or method_name_lower.startswith("tlist") + or method_name_lower.startswith("ttest") + ): + return "query" + return "activity" + + +def resolve_versioned_activity_type(activity_type: str) -> str: + """Resolve an activity type to its versioned form. + + Args: + activity_type: The unversioned activity type (e.g., "ACTIVITY_TYPE_CREATE_USERS") + + Returns: + The versioned activity type if found in the mapping, otherwise the input activity type + + Example: + >>> resolve_versioned_activity_type("ACTIVITY_TYPE_CREATE_USERS") + "ACTIVITY_TYPE_CREATE_USERS_V3" + >>> resolve_versioned_activity_type("ACTIVITY_TYPE_UNKNOWN") + "ACTIVITY_TYPE_UNKNOWN" + """ + versioned = VERSIONED_ACTIVITY_TYPES.get(activity_type) + return versioned[0] if versioned else activity_type + + +def get_versioned_intent_type(activity_type: str) -> str | None: + """Get the versioned intent type for an activity. + + Args: + activity_type: The unversioned activity type (e.g., "ACTIVITY_TYPE_CREATE_USERS") + + Returns: + The intent type name if found in the mapping, None otherwise + + Example: + >>> get_versioned_intent_type("ACTIVITY_TYPE_CREATE_USERS") + "v1CreateUsersIntentV3" + >>> get_versioned_intent_type("ACTIVITY_TYPE_UNKNOWN") + None + """ + versioned = VERSIONED_ACTIVITY_TYPES.get(activity_type) + return versioned[1] if versioned else None + + +def get_versioned_result_type(activity_type: str) -> str | None: + """Get the versioned result type for an activity. + + Args: + activity_type: The unversioned activity type (e.g., "ACTIVITY_TYPE_CREATE_USERS") + + Returns: + The result type name if found in the mapping, None otherwise + + Example: + >>> get_versioned_result_type("ACTIVITY_TYPE_CREATE_USERS") + "v1CreateUsersResult" + >>> get_versioned_result_type("ACTIVITY_TYPE_UNKNOWN") + None + """ + versioned = VERSIONED_ACTIVITY_TYPES.get(activity_type) + return versioned[2] if versioned else None diff --git a/packages/api-key-stamper/README.md b/packages/api-key-stamper/README.md new file mode 100644 index 0000000..3489aaf --- /dev/null +++ b/packages/api-key-stamper/README.md @@ -0,0 +1,34 @@ +# Turnkey API Key Stamper + +Authentication utility for Turnkey API requests. The stamper signs requests with your API key credentials. + +## Installation + +```bash +pip install turnkey-api-key-stamper +``` + +## Usage + +```python +from turnkey_api_key_stamper import ApiKeyStamper, ApiKeyStamperConfig +import requests +import json + +# Initialize the stamper with your API credentials +config = ApiKeyStamperConfig( + api_public_key="", + api_private_key="" +) +stamper = ApiKeyStamper(config) + +# Create your request payload +payload = { + "organizationId": "" +} +payload_str = json.dumps(payload) + +# Generate the authentication stamp +stamp = stamper.stamp(payload_str) +``` + diff --git a/packages/api-key-stamper/pyproject.toml b/packages/api-key-stamper/pyproject.toml new file mode 100644 index 0000000..128d863 --- /dev/null +++ b/packages/api-key-stamper/pyproject.toml @@ -0,0 +1,40 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "turnkey-api-key-stamper" +version = "0.1.0" +description = "API key authentication stamper for Turnkey API" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +authors = [ + {name = "Turnkey", email = "hello@turnkey.com"} +] +keywords = ["turnkey", "api", "authentication", "stamper"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "cryptography>=41.0.0", +] + +[project.urls] +Homepage = "https://github.com/tkhq/python-sdk" +Repository = "https://github.com/tkhq/python-sdk" +Documentation = "https://github.com/tkhq/python-sdk/tree/main/packages/stamper" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +turnkey_api_key_stamper = ["py.typed"] diff --git a/packages/api-key-stamper/src/turnkey_api_key_stamper/__init__.py b/packages/api-key-stamper/src/turnkey_api_key_stamper/__init__.py new file mode 100644 index 0000000..be1947e --- /dev/null +++ b/packages/api-key-stamper/src/turnkey_api_key_stamper/__init__.py @@ -0,0 +1 @@ +from .stamper import * diff --git a/packages/api-key-stamper/src/turnkey_api_key_stamper/stamper.py b/packages/api-key-stamper/src/turnkey_api_key_stamper/stamper.py new file mode 100644 index 0000000..6f3caf6 --- /dev/null +++ b/packages/api-key-stamper/src/turnkey_api_key_stamper/stamper.py @@ -0,0 +1,106 @@ +import json +from base64 import urlsafe_b64encode +from dataclasses import dataclass +from typing import Optional +from cryptography.hazmat.primitives import hashes, serialization +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.backends import default_backend + + +@dataclass +class ApiKeyStamperConfig: + """Configuration for API key stamper.""" + + api_public_key: str + api_private_key: str + + +@dataclass +class TStamp: + """Stamp result containing header name and value.""" + + stamp_header_name: str + stamp_header_value: str + + +def _sign_with_api_key(public_key: str, private_key: str, content: str) -> str: + """Sign content with API key and validate public key matches. + + Args: + public_key: Expected public key (compressed, hex format) + private_key: Private key (hex format) + content: Content to sign + + Returns: + Hex-encoded signature + + Raises: + ValueError: If public key doesn't match private key + """ + # Derive private key from hex + ec_private_key = ec.derive_private_key( + int(private_key, 16), ec.SECP256R1(), default_backend() + ) + + # Get the public key from the private key to validate + public_key_obj = ec_private_key.public_key() + public_key_bytes = public_key_obj.public_bytes( + encoding=serialization.Encoding.X962, + format=serialization.PublicFormat.CompressedPoint, + ) + derived_public_key = public_key_bytes.hex() + + # Validate that the provided public key matches + if derived_public_key != public_key: + raise ValueError( + f"Bad API key. Expected to get public key {public_key}, " + f"got {derived_public_key}" + ) + + # Sign the content + signature = ec_private_key.sign(content.encode(), ec.ECDSA(hashes.SHA256())) + + return signature.hex() + + +class ApiKeyStamper: + """Stamps requests to the Turnkey API for authentication using API keys.""" + + def __init__(self, config: ApiKeyStamperConfig): + """Initialize the stamper with API key configuration. + + Args: + config: API key stamper configuration + """ + self.api_public_key = config.api_public_key + self.api_private_key = config.api_private_key + self.stamp_header_name = "X-Stamp" + + def stamp(self, content: str) -> TStamp: + """Create an authentication stamp for the given content. + + Args: + content: The request content/payload to stamp (as JSON string) + + Returns: + TStamp object with header name and base64url-encoded stamp value + """ + signature = _sign_with_api_key( + self.api_public_key, self.api_private_key, content + ) + + stamp = { + "publicKey": self.api_public_key, + "scheme": "SIGNATURE_SCHEME_TK_API_P256", + "signature": signature, + } + + # Encode stamp to base64url + stamp_header_value = ( + urlsafe_b64encode(json.dumps(stamp).encode()).decode().rstrip("=") + ) + + return TStamp( + stamp_header_name=self.stamp_header_name, + stamp_header_value=stamp_header_value, + ) diff --git a/packages/http/README.md b/packages/http/README.md new file mode 100644 index 0000000..c3510ec --- /dev/null +++ b/packages/http/README.md @@ -0,0 +1,94 @@ +# Turnkey HTTP + +HTTP client for the Turnkey API with auto-generated methods from the OpenAPI specification. + +## Installation + +```bash +pip install turnkey-http +``` + +Or install from the repository in editable mode: + +```bash +pip install -e packages/http +``` + +## Usage + +```python +from turnkey_http import TurnkeyClient +from turnkey_api_key_stamper import ApiKeyStamper, ApiKeyStamperConfig + +# Initialize the stamper +config = ApiKeyStamperConfig( + api_public_key="your-api-public-key", + api_private_key="your-api-private-key" +) +stamper = ApiKeyStamper(config) + +# Create the HTTP client +client = TurnkeyClient( + base_url="https://api.turnkey.com", + stamper=stamper, + organization_id="your-org-id" +) + +# Make API calls with typed methods +response = client.get_whoami() +print(response) +``` + +## Code Generation + +This package uses code generation to create HTTP client methods from the OpenAPI specification located in `schema/public_api.swagger.json`. + +### Generate Client + +To regenerate the HTTP client: + +```bash +cd packages/http +python3 scripts/generate.py +``` + +The generator automatically formats code with `ruff`. + +### Development Setup + +Install with dev dependencies: + +```bash +pip install -e ".[dev]" +``` + +## Structure + +``` +http/ +โ”œโ”€โ”€ src/ +โ”‚ โ””โ”€โ”€ turnkey_http/ +โ”‚ โ”œโ”€โ”€ __init__.py +โ”‚ โ””โ”€โ”€ generated/ # Auto-generated client (do not edit manually) +โ”œโ”€โ”€ scripts/ +โ”‚ โ””โ”€โ”€ generate.py # Code generation script +โ”œโ”€โ”€ tests/ # Test suite +โ”œโ”€โ”€ pyproject.toml +โ””โ”€โ”€ README.md +``` + +## Dependencies + +- Python >= 3.8 +- requests >= 2.31.0 +- turnkey-api-key-stamper +- turnkey-sdk-types + +## Development + +The generated client is created from the OpenAPI specification with: +- Typed methods for each API endpoint +- Automatic request signing via stamper integration +- Type hints using types from `turnkey-sdk-types` + +**Important:** Never edit files in `src/turnkey_http/generated/` manually. They will be overwritten on the next generation run. diff --git a/packages/http/pyproject.toml b/packages/http/pyproject.toml new file mode 100644 index 0000000..a6d0a3c --- /dev/null +++ b/packages/http/pyproject.toml @@ -0,0 +1,49 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "turnkey-http" +version = "0.1.0" +description = "HTTP client for Turnkey API" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +authors = [ + {name = "Turnkey", email = "hello@turnkey.com"} +] +keywords = ["turnkey", "api", "http", "client", "sdk"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "requests>=2.31.0", + "turnkey-api-key-stamper", + "turnkey-sdk-types", +] + +[project.optional-dependencies] +dev = [ + "pytest>=7.0.0", + "pytest-asyncio>=0.21.0", + "ruff>=0.1.0", +] + +[project.urls] +Homepage = "https://github.com/tkhq/python-sdk" +Repository = "https://github.com/tkhq/python-sdk" +Documentation = "https://github.com/tkhq/python-sdk/tree/main/packages/sdk-http" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +turnkey_http = ["py.typed"] diff --git a/packages/http/src/turnkey_http/__init__.py b/packages/http/src/turnkey_http/__init__.py new file mode 100644 index 0000000..aa2593e --- /dev/null +++ b/packages/http/src/turnkey_http/__init__.py @@ -0,0 +1 @@ +from .generated.client import * diff --git a/packages/http/src/turnkey_http/generated/client.py b/packages/http/src/turnkey_http/generated/client.py new file mode 100644 index 0000000..64afdb1 --- /dev/null +++ b/packages/http/src/turnkey_http/generated/client.py @@ -0,0 +1,5110 @@ +# @generated by codegen. DO NOT EDIT BY HAND + +import json +import time +from typing import Any, Callable, Dict, Optional, TypeVar, overload +import requests +from turnkey_api_key_stamper import ApiKeyStamper +from turnkey_sdk_types import * +from ..version import VERSION + +T = TypeVar("T") + +TERMINAL_ACTIVITY_STATUSES = [ + "ACTIVITY_STATUS_COMPLETED", + "ACTIVITY_STATUS_FAILED", + "ACTIVITY_STATUS_CONSENSUS_NEEDED", + "ACTIVITY_STATUS_REJECTED", +] + + +class TurnkeyClient: + """Turnkey API HTTP client with auto-generated methods.""" + + def __init__( + self, + base_url: str, + stamper: ApiKeyStamper, + organization_id: str, + default_timeout: int = 30, + polling_interval_ms: int = 1000, + max_polling_retries: int = 3, + ): + """Initialize the Turnkey client. + + Args: + base_url: Base URL for the Turnkey API + stamper: API key stamper for authentication + organization_id: Organization ID + default_timeout: Default request timeout in seconds + polling_interval_ms: Polling interval for activity status in milliseconds + max_polling_retries: Maximum number of polling retries + """ + self.base_url = base_url.rstrip("/") + self.stamper = stamper + self.organization_id = organization_id + self.default_timeout = default_timeout + self.polling_interval_ms = polling_interval_ms + self.max_polling_retries = max_polling_retries + + def _serialize_body(self, body: Any) -> str: + """Serialize request body, handling Pydantic models recursively. + + Args: + body: Request body (dict, Pydantic model, list, or primitive) + + Returns: + JSON string + """ + + def serialize_value(value): + """Recursively serialize values, converting Pydantic models to dicts.""" + if hasattr(value, "model_dump"): + return value.model_dump(by_alias=True, exclude_none=True) + elif isinstance(value, dict): + return {k: serialize_value(v) for k, v in value.items()} + elif isinstance(value, list): + return [serialize_value(item) for item in value] + else: + return value + + serialized = serialize_value(body) + return json.dumps(serialized) + + def _request(self, url: str, body: Dict[str, Any], response_type: type) -> Any: + """Make a request to the Turnkey API. + + Args: + url: Endpoint URL + body: Request body + response_type: Pydantic model class for response parsing + + Returns: + Parsed response as Pydantic model + + Raises: + TurnkeyNetworkError: If request fails + """ + full_url = self.base_url + url + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + headers = { + stamp.stamp_header_name: stamp.stamp_header_value, + "Content-Type": "application/json", + "X-Client-Version": VERSION, + } + + try: + response = requests.post( + full_url, headers=headers, data=body_str, timeout=self.default_timeout + ) + except requests.RequestException as exc: + raise TurnkeyNetworkError( + "Request failed", None, TurnkeyErrorCodes.NETWORK_ERROR, str(exc) + ) from exc + + if not response.ok: + try: + error_data = response.json() + error_message = error_data.get("message", str(error_data)) + except ValueError: + error_message = ( + response.text or f"{response.status_code} {response.reason}" + ) + + raise TurnkeyNetworkError( + error_message, + response.status_code, + TurnkeyErrorCodes.BAD_RESPONSE, + response.text, + ) + + response_data = response.json() + return response_type(**response_data) + + def _poll_for_completion(self, activity: Any) -> Any: + """Poll until activity reaches terminal status. + + Args: + activity: Initial activity object with id and status attributes. + + Returns: + Activity object after reaching terminal status or max retries. + """ + if activity.status in TERMINAL_ACTIVITY_STATUSES: + return activity + + attempts = 0 + while attempts < self.max_polling_retries: + time.sleep(self.polling_interval_ms / 1000.0) + poll_response = self.get_activity(GetActivityBody(activityId=activity.id)) + activity = poll_response.activity + if activity.status in TERMINAL_ACTIVITY_STATUSES: + break + attempts += 1 + + return activity + + def _activity( + self, url: str, body: Dict[str, Any], result_key: str, response_type: type + ) -> Any: + """Execute an activity and poll for completion. + + Args: + url: Endpoint URL + body: Request body + result_key: Key to extract result from activity when completed + response_type: Pydantic model class for response parsing + + Returns: + Parsed response as Pydantic model with flattened result fields + """ + # Make initial request, we parse as activity response without result fields + initial_response = self._request(url, body, GetActivityResponse) + + # Poll for completion + activity = self._poll_for_completion(initial_response.activity) + + # If activity completed successfully, flatten result fields into response + if ( + activity.status == "ACTIVITY_STATUS_COMPLETED" + and hasattr(activity, "result") + and activity.result + ): + result = activity.result + # Get the versioned result key (e.g., 'createApiKeysResultV2') + if hasattr(result, result_key): + result_data = getattr(result, result_key) + if result_data and hasattr(result_data, "model_dump"): + # Flatten result fields into response + result_dict = result_data.model_dump( + by_alias=True, exclude_none=True + ) + # Construct final response with activity and result fields + response = response_type(activity=activity, **result_dict) + return response + + # Return response with just the activity (no result fields) + return response_type(activity=activity) + + def _activity_decision( + self, url: str, body: Dict[str, Any], response_type: type + ) -> Any: + """Execute an activity decision. + + Args: + url: Endpoint URL + body: Request body + response_type: Pydantic model class for response parsing + + Returns: + Parsed response as Pydantic model + """ + return self._request(url, body, response_type) + + @overload + def send_signed_request( + self, signed_request: SignedRequest, response_type: type[T] + ) -> T: ... + + @overload + def send_signed_request(self, signed_request: SignedRequest) -> Any: ... + + def send_signed_request( + self, signed_request: SignedRequest, response_type: type[T] | None = None + ) -> Any: + """Submit a signed request and poll for activity completion if needed. + + You can pass in the SignedRequest returned by any of the SDK's + stamping methods (stamp_create_api_keys, stamp_get_policies, etc.). + + For activities, this will poll until the activity reaches a terminal status. + + Args: + signed_request: A SignedRequest object returned by a stamping method. + response_type: Optional callable to convert the JSON payload to a typed value. + Typically a Pydantic model class. + + Returns: + The parsed response via response_type, or raw JSON dict if no type provided. + + Raises: + TurnkeyNetworkError: If the request fails. + """ + headers = { + signed_request.stamp.stamp_header_name: signed_request.stamp.stamp_header_value, + "Content-Type": "application/json", + "X-Client-Version": VERSION, + } + + try: + response = requests.post( + signed_request.url, + headers=headers, + data=signed_request.body, + timeout=self.default_timeout, + ) + except requests.RequestException as exc: + raise TurnkeyNetworkError( + "Signed request failed", None, TurnkeyErrorCodes.NETWORK_ERROR, str(exc) + ) from exc + + if not response.ok: + try: + error_data = response.json() + error_message = error_data.get("message", str(error_data)) + except ValueError: + error_message = ( + response.text or f"{response.status_code} {response.reason}" + ) + + raise TurnkeyNetworkError( + error_message, + response.status_code, + TurnkeyErrorCodes.BAD_RESPONSE, + response.text, + ) + + payload = response.json() + + # Poll for activity completion if this is an activity request + if signed_request.type == RequestType.ACTIVITY: + activity_response = GetActivityResponse(**payload) + activity = self._poll_for_completion(activity_response.activity) + + # Update payload with polled activity + activity_dict = ( + activity.model_dump(by_alias=True, exclude_none=True) + if hasattr(activity, "model_dump") + else {} + ) + payload["activity"] = activity_dict + + # Extract result fields if activity completed successfully + if ( + activity.status == "ACTIVITY_STATUS_COMPLETED" + and hasattr(activity, "result") + and activity.result + ): + result = activity.result + # Find the first result field (e.g., createApiKeysResult, createPolicyResult, etc.) + for attr_name in dir(result): + if not attr_name.startswith("_") and attr_name.endswith("Result"): + result_data = getattr(result, attr_name, None) + if result_data and hasattr(result_data, "model_dump"): + # Flatten result fields into payload + result_dict = result_data.model_dump( + by_alias=True, exclude_none=True + ) + payload.update(result_dict) + break + + return response_type(**payload) if response_type is not None else payload + + def get_activity(self, input: GetActivityBody) -> GetActivityResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_activity", body, GetActivityResponse) + + def stamp_get_activity(self, input: GetActivityBody) -> SignedRequest: + """Stamp a getActivity request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_activity" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_api_key(self, input: GetApiKeyBody) -> GetApiKeyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_api_key", body, GetApiKeyResponse) + + def stamp_get_api_key(self, input: GetApiKeyBody) -> SignedRequest: + """Stamp a getApiKey request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_api_key" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_api_keys( + self, input: Optional[GetApiKeysBody] = None + ) -> GetApiKeysResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_api_keys", body, GetApiKeysResponse) + + def stamp_get_api_keys( + self, input: Optional[GetApiKeysBody] = None + ) -> SignedRequest: + """Stamp a getApiKeys request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_api_keys" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_attestation_document( + self, input: GetAttestationDocumentBody + ) -> GetAttestationDocumentResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_attestation", body, GetAttestationDocumentResponse + ) + + def stamp_get_attestation_document( + self, input: GetAttestationDocumentBody + ) -> SignedRequest: + """Stamp a getAttestationDocument request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_attestation" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_authenticator( + self, input: GetAuthenticatorBody + ) -> GetAuthenticatorResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_authenticator", body, GetAuthenticatorResponse + ) + + def stamp_get_authenticator(self, input: GetAuthenticatorBody) -> SignedRequest: + """Stamp a getAuthenticator request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_authenticator" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_authenticators( + self, input: GetAuthenticatorsBody + ) -> GetAuthenticatorsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_authenticators", body, GetAuthenticatorsResponse + ) + + def stamp_get_authenticators(self, input: GetAuthenticatorsBody) -> SignedRequest: + """Stamp a getAuthenticators request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_authenticators" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_boot_proof(self, input: GetBootProofBody) -> GetBootProofResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_boot_proof", body, GetBootProofResponse + ) + + def stamp_get_boot_proof(self, input: GetBootProofBody) -> SignedRequest: + """Stamp a getBootProof request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_boot_proof" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_gas_usage(self, input: GetGasUsageBody) -> GetGasUsageResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_gas_usage", body, GetGasUsageResponse + ) + + def stamp_get_gas_usage(self, input: GetGasUsageBody) -> SignedRequest: + """Stamp a getGasUsage request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_gas_usage" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_latest_boot_proof( + self, input: GetLatestBootProofBody + ) -> GetLatestBootProofResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_latest_boot_proof", body, GetLatestBootProofResponse + ) + + def stamp_get_latest_boot_proof( + self, input: GetLatestBootProofBody + ) -> SignedRequest: + """Stamp a getLatestBootProof request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_latest_boot_proof" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_nonces(self, input: GetNoncesBody) -> GetNoncesResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_nonces", body, GetNoncesResponse) + + def stamp_get_nonces(self, input: GetNoncesBody) -> SignedRequest: + """Stamp a getNonces request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_nonces" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_oauth2_credential( + self, input: GetOauth2CredentialBody + ) -> GetOauth2CredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_oauth2_credential", body, GetOauth2CredentialResponse + ) + + def stamp_get_oauth2_credential( + self, input: GetOauth2CredentialBody + ) -> SignedRequest: + """Stamp a getOauth2Credential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_oauth2_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_oauth_providers( + self, input: GetOauthProvidersBody + ) -> GetOauthProvidersResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_oauth_providers", body, GetOauthProvidersResponse + ) + + def stamp_get_oauth_providers(self, input: GetOauthProvidersBody) -> SignedRequest: + """Stamp a getOauthProviders request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_oauth_providers" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_on_ramp_transaction_status( + self, input: GetOnRampTransactionStatusBody + ) -> GetOnRampTransactionStatusResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_onramp_transaction_status", + body, + GetOnRampTransactionStatusResponse, + ) + + def stamp_get_on_ramp_transaction_status( + self, input: GetOnRampTransactionStatusBody + ) -> SignedRequest: + """Stamp a getOnRampTransactionStatus request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_onramp_transaction_status" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_organization( + self, input: Optional[GetOrganizationBody] = None + ) -> GetOrganizationResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_organization", body, GetOrganizationResponse + ) + + def stamp_get_organization( + self, input: Optional[GetOrganizationBody] = None + ) -> SignedRequest: + """Stamp a getOrganization request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_organization" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_organization_configs( + self, input: GetOrganizationConfigsBody + ) -> GetOrganizationConfigsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_organization_configs", + body, + GetOrganizationConfigsResponse, + ) + + def stamp_get_organization_configs( + self, input: GetOrganizationConfigsBody + ) -> SignedRequest: + """Stamp a getOrganizationConfigs request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_organization_configs" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_policy(self, input: GetPolicyBody) -> GetPolicyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_policy", body, GetPolicyResponse) + + def stamp_get_policy(self, input: GetPolicyBody) -> SignedRequest: + """Stamp a getPolicy request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_policy" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_policy_evaluations( + self, input: GetPolicyEvaluationsBody + ) -> GetPolicyEvaluationsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_policy_evaluations", + body, + GetPolicyEvaluationsResponse, + ) + + def stamp_get_policy_evaluations( + self, input: GetPolicyEvaluationsBody + ) -> SignedRequest: + """Stamp a getPolicyEvaluations request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_policy_evaluations" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_private_key(self, input: GetPrivateKeyBody) -> GetPrivateKeyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_private_key", body, GetPrivateKeyResponse + ) + + def stamp_get_private_key(self, input: GetPrivateKeyBody) -> SignedRequest: + """Stamp a getPrivateKey request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_private_key" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_send_transaction_status( + self, input: GetSendTransactionStatusBody + ) -> GetSendTransactionStatusResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_send_transaction_status", + body, + GetSendTransactionStatusResponse, + ) + + def stamp_get_send_transaction_status( + self, input: GetSendTransactionStatusBody + ) -> SignedRequest: + """Stamp a getSendTransactionStatus request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_send_transaction_status" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_smart_contract_interface( + self, input: GetSmartContractInterfaceBody + ) -> GetSmartContractInterfaceResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_smart_contract_interface", + body, + GetSmartContractInterfaceResponse, + ) + + def stamp_get_smart_contract_interface( + self, input: GetSmartContractInterfaceBody + ) -> SignedRequest: + """Stamp a getSmartContractInterface request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_smart_contract_interface" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_user(self, input: GetUserBody) -> GetUserResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_user", body, GetUserResponse) + + def stamp_get_user(self, input: GetUserBody) -> SignedRequest: + """Stamp a getUser request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_user" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_wallet(self, input: GetWalletBody) -> GetWalletResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/get_wallet", body, GetWalletResponse) + + def stamp_get_wallet(self, input: GetWalletBody) -> SignedRequest: + """Stamp a getWallet request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_wallet" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_wallet_account( + self, input: GetWalletAccountBody + ) -> GetWalletAccountResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/get_wallet_account", body, GetWalletAccountResponse + ) + + def stamp_get_wallet_account(self, input: GetWalletAccountBody) -> SignedRequest: + """Stamp a getWalletAccount request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/get_wallet_account" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_activities( + self, input: Optional[GetActivitiesBody] = None + ) -> GetActivitiesResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_activities", body, GetActivitiesResponse + ) + + def stamp_get_activities( + self, input: Optional[GetActivitiesBody] = None + ) -> SignedRequest: + """Stamp a getActivities request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_activities" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_app_proofs(self, input: GetAppProofsBody) -> GetAppProofsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_app_proofs", body, GetAppProofsResponse + ) + + def stamp_get_app_proofs(self, input: GetAppProofsBody) -> SignedRequest: + """Stamp a getAppProofs request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_app_proofs" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def list_fiat_on_ramp_credentials( + self, input: ListFiatOnRampCredentialsBody + ) -> ListFiatOnRampCredentialsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_fiat_on_ramp_credentials", + body, + ListFiatOnRampCredentialsResponse, + ) + + def stamp_list_fiat_on_ramp_credentials( + self, input: ListFiatOnRampCredentialsBody + ) -> SignedRequest: + """Stamp a listFiatOnRampCredentials request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_fiat_on_ramp_credentials" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def list_oauth2_credentials( + self, input: ListOauth2CredentialsBody + ) -> ListOauth2CredentialsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_oauth2_credentials", + body, + ListOauth2CredentialsResponse, + ) + + def stamp_list_oauth2_credentials( + self, input: ListOauth2CredentialsBody + ) -> SignedRequest: + """Stamp a listOauth2Credentials request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_oauth2_credentials" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_policies( + self, input: Optional[GetPoliciesBody] = None + ) -> GetPoliciesResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_policies", body, GetPoliciesResponse + ) + + def stamp_get_policies( + self, input: Optional[GetPoliciesBody] = None + ) -> SignedRequest: + """Stamp a getPolicies request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_policies" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def list_private_key_tags( + self, input: ListPrivateKeyTagsBody + ) -> ListPrivateKeyTagsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_private_key_tags", body, ListPrivateKeyTagsResponse + ) + + def stamp_list_private_key_tags( + self, input: ListPrivateKeyTagsBody + ) -> SignedRequest: + """Stamp a listPrivateKeyTags request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_private_key_tags" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_private_keys( + self, input: Optional[GetPrivateKeysBody] = None + ) -> GetPrivateKeysResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_private_keys", body, GetPrivateKeysResponse + ) + + def stamp_get_private_keys( + self, input: Optional[GetPrivateKeysBody] = None + ) -> SignedRequest: + """Stamp a getPrivateKeys request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_private_keys" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_smart_contract_interfaces( + self, input: GetSmartContractInterfacesBody + ) -> GetSmartContractInterfacesResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_smart_contract_interfaces", + body, + GetSmartContractInterfacesResponse, + ) + + def stamp_get_smart_contract_interfaces( + self, input: GetSmartContractInterfacesBody + ) -> SignedRequest: + """Stamp a getSmartContractInterfaces request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_smart_contract_interfaces" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_sub_org_ids( + self, input: Optional[GetSubOrgIdsBody] = None + ) -> GetSubOrgIdsResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_suborgs", body, GetSubOrgIdsResponse + ) + + def stamp_get_sub_org_ids( + self, input: Optional[GetSubOrgIdsBody] = None + ) -> SignedRequest: + """Stamp a getSubOrgIds request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_suborgs" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def list_user_tags( + self, input: Optional[ListUserTagsBody] = None + ) -> ListUserTagsResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_user_tags", body, ListUserTagsResponse + ) + + def stamp_list_user_tags( + self, input: Optional[ListUserTagsBody] = None + ) -> SignedRequest: + """Stamp a listUserTags request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_user_tags" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_users(self, input: Optional[GetUsersBody] = None) -> GetUsersResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/list_users", body, GetUsersResponse) + + def stamp_get_users(self, input: Optional[GetUsersBody] = None) -> SignedRequest: + """Stamp a getUsers request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_users" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_verified_sub_org_ids( + self, input: GetVerifiedSubOrgIdsBody + ) -> GetVerifiedSubOrgIdsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_verified_suborgs", body, GetVerifiedSubOrgIdsResponse + ) + + def stamp_get_verified_sub_org_ids( + self, input: GetVerifiedSubOrgIdsBody + ) -> SignedRequest: + """Stamp a getVerifiedSubOrgIds request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_verified_suborgs" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_wallet_accounts( + self, input: GetWalletAccountsBody + ) -> GetWalletAccountsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/public/v1/query/list_wallet_accounts", body, GetWalletAccountsResponse + ) + + def stamp_get_wallet_accounts(self, input: GetWalletAccountsBody) -> SignedRequest: + """Stamp a getWalletAccounts request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_wallet_accounts" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_wallets(self, input: Optional[GetWalletsBody] = None) -> GetWalletsResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/list_wallets", body, GetWalletsResponse) + + def stamp_get_wallets( + self, input: Optional[GetWalletsBody] = None + ) -> SignedRequest: + """Stamp a getWallets request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/list_wallets" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def get_whoami(self, input: Optional[GetWhoamiBody] = None) -> GetWhoamiResponse: + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request("/public/v1/query/whoami", body, GetWhoamiResponse) + + def stamp_get_whoami(self, input: Optional[GetWhoamiBody] = None) -> SignedRequest: + """Stamp a getWhoami request without sending it.""" + + if input is None: + input_dict = {} + else: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/public/v1/query/whoami" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) + + def approve_activity(self, input: ApproveActivityBody) -> ApproveActivityResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_APPROVE_ACTIVITY", + } + + return self._activity_decision( + "/public/v1/submit/approve_activity", body, ApproveActivityResponse + ) + + def stamp_approve_activity(self, input: ApproveActivityBody) -> SignedRequest: + """Stamp a approveActivity request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_APPROVE_ACTIVITY", + } + + full_url = self.base_url + "/public/v1/submit/approve_activity" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY_DECISION + ) + + def create_api_keys(self, input: CreateApiKeysBody) -> CreateApiKeysResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_API_KEYS_V2", + } + + return self._activity( + "/public/v1/submit/create_api_keys", + body, + "createApiKeysResult", + CreateApiKeysResponse, + ) + + def stamp_create_api_keys(self, input: CreateApiKeysBody) -> SignedRequest: + """Stamp a createApiKeys request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_API_KEYS_V2", + } + + full_url = self.base_url + "/public/v1/submit/create_api_keys" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_api_only_users( + self, input: CreateApiOnlyUsersBody + ) -> CreateApiOnlyUsersResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", + } + + return self._activity( + "/public/v1/submit/create_api_only_users", + body, + "createApiOnlyUsersResult", + CreateApiOnlyUsersResponse, + ) + + def stamp_create_api_only_users( + self, input: CreateApiOnlyUsersBody + ) -> SignedRequest: + """Stamp a createApiOnlyUsers request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", + } + + full_url = self.base_url + "/public/v1/submit/create_api_only_users" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_authenticators( + self, input: CreateAuthenticatorsBody + ) -> CreateAuthenticatorsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + } + + return self._activity( + "/public/v1/submit/create_authenticators", + body, + "createAuthenticatorsResult", + CreateAuthenticatorsResponse, + ) + + def stamp_create_authenticators( + self, input: CreateAuthenticatorsBody + ) -> SignedRequest: + """Stamp a createAuthenticators request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + } + + full_url = self.base_url + "/public/v1/submit/create_authenticators" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_fiat_on_ramp_credential( + self, input: CreateFiatOnRampCredentialBody + ) -> CreateFiatOnRampCredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL", + } + + return self._activity( + "/public/v1/submit/create_fiat_on_ramp_credential", + body, + "createFiatOnRampCredentialResult", + CreateFiatOnRampCredentialResponse, + ) + + def stamp_create_fiat_on_ramp_credential( + self, input: CreateFiatOnRampCredentialBody + ) -> SignedRequest: + """Stamp a createFiatOnRampCredential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL", + } + + full_url = self.base_url + "/public/v1/submit/create_fiat_on_ramp_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_invitations( + self, input: CreateInvitationsBody + ) -> CreateInvitationsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_INVITATIONS", + } + + return self._activity( + "/public/v1/submit/create_invitations", + body, + "createInvitationsResult", + CreateInvitationsResponse, + ) + + def stamp_create_invitations(self, input: CreateInvitationsBody) -> SignedRequest: + """Stamp a createInvitations request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_INVITATIONS", + } + + full_url = self.base_url + "/public/v1/submit/create_invitations" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_oauth2_credential( + self, input: CreateOauth2CredentialBody + ) -> CreateOauth2CredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL", + } + + return self._activity( + "/public/v1/submit/create_oauth2_credential", + body, + "createOauth2CredentialResult", + CreateOauth2CredentialResponse, + ) + + def stamp_create_oauth2_credential( + self, input: CreateOauth2CredentialBody + ) -> SignedRequest: + """Stamp a createOauth2Credential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL", + } + + full_url = self.base_url + "/public/v1/submit/create_oauth2_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_oauth_providers( + self, input: CreateOauthProvidersBody + ) -> CreateOauthProvidersResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", + } + + return self._activity( + "/public/v1/submit/create_oauth_providers", + body, + "createOauthProvidersResult", + CreateOauthProvidersResponse, + ) + + def stamp_create_oauth_providers( + self, input: CreateOauthProvidersBody + ) -> SignedRequest: + """Stamp a createOauthProviders request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", + } + + full_url = self.base_url + "/public/v1/submit/create_oauth_providers" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_policies(self, input: CreatePoliciesBody) -> CreatePoliciesResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_POLICIES", + } + + return self._activity( + "/public/v1/submit/create_policies", + body, + "createPoliciesResult", + CreatePoliciesResponse, + ) + + def stamp_create_policies(self, input: CreatePoliciesBody) -> SignedRequest: + """Stamp a createPolicies request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_POLICIES", + } + + full_url = self.base_url + "/public/v1/submit/create_policies" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_policy(self, input: CreatePolicyBody) -> CreatePolicyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_POLICY_V3", + } + + return self._activity( + "/public/v1/submit/create_policy", + body, + "createPolicyResult", + CreatePolicyResponse, + ) + + def stamp_create_policy(self, input: CreatePolicyBody) -> SignedRequest: + """Stamp a createPolicy request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_POLICY_V3", + } + + full_url = self.base_url + "/public/v1/submit/create_policy" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_private_key_tag( + self, input: CreatePrivateKeyTagBody + ) -> CreatePrivateKeyTagResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", + } + + return self._activity( + "/public/v1/submit/create_private_key_tag", + body, + "createPrivateKeyTagResult", + CreatePrivateKeyTagResponse, + ) + + def stamp_create_private_key_tag( + self, input: CreatePrivateKeyTagBody + ) -> SignedRequest: + """Stamp a createPrivateKeyTag request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", + } + + full_url = self.base_url + "/public/v1/submit/create_private_key_tag" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_private_keys( + self, input: CreatePrivateKeysBody + ) -> CreatePrivateKeysResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", + } + + return self._activity( + "/public/v1/submit/create_private_keys", + body, + "createPrivateKeysResultV2", + CreatePrivateKeysResponse, + ) + + def stamp_create_private_keys(self, input: CreatePrivateKeysBody) -> SignedRequest: + """Stamp a createPrivateKeys request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", + } + + full_url = self.base_url + "/public/v1/submit/create_private_keys" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_read_only_session( + self, input: CreateReadOnlySessionBody + ) -> CreateReadOnlySessionResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION", + } + + return self._activity( + "/public/v1/submit/create_read_only_session", + body, + "createReadOnlySessionResult", + CreateReadOnlySessionResponse, + ) + + def stamp_create_read_only_session( + self, input: CreateReadOnlySessionBody + ) -> SignedRequest: + """Stamp a createReadOnlySession request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION", + } + + full_url = self.base_url + "/public/v1/submit/create_read_only_session" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_read_write_session( + self, input: CreateReadWriteSessionBody + ) -> CreateReadWriteSessionResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + } + + return self._activity( + "/public/v1/submit/create_read_write_session", + body, + "createReadWriteSessionResultV2", + CreateReadWriteSessionResponse, + ) + + def stamp_create_read_write_session( + self, input: CreateReadWriteSessionBody + ) -> SignedRequest: + """Stamp a createReadWriteSession request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + } + + full_url = self.base_url + "/public/v1/submit/create_read_write_session" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_smart_contract_interface( + self, input: CreateSmartContractInterfaceBody + ) -> CreateSmartContractInterfaceResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", + } + + return self._activity( + "/public/v1/submit/create_smart_contract_interface", + body, + "createSmartContractInterfaceResult", + CreateSmartContractInterfaceResponse, + ) + + def stamp_create_smart_contract_interface( + self, input: CreateSmartContractInterfaceBody + ) -> SignedRequest: + """Stamp a createSmartContractInterface request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", + } + + full_url = self.base_url + "/public/v1/submit/create_smart_contract_interface" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_sub_organization( + self, input: CreateSubOrganizationBody + ) -> CreateSubOrganizationResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + } + + return self._activity( + "/public/v1/submit/create_sub_organization", + body, + "createSubOrganizationResultV7", + CreateSubOrganizationResponse, + ) + + def stamp_create_sub_organization( + self, input: CreateSubOrganizationBody + ) -> SignedRequest: + """Stamp a createSubOrganization request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + } + + full_url = self.base_url + "/public/v1/submit/create_sub_organization" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_user_tag(self, input: CreateUserTagBody) -> CreateUserTagResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_USER_TAG", + } + + return self._activity( + "/public/v1/submit/create_user_tag", + body, + "createUserTagResult", + CreateUserTagResponse, + ) + + def stamp_create_user_tag(self, input: CreateUserTagBody) -> SignedRequest: + """Stamp a createUserTag request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_USER_TAG", + } + + full_url = self.base_url + "/public/v1/submit/create_user_tag" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_users(self, input: CreateUsersBody) -> CreateUsersResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_USERS_V3", + } + + return self._activity( + "/public/v1/submit/create_users", + body, + "createUsersResult", + CreateUsersResponse, + ) + + def stamp_create_users(self, input: CreateUsersBody) -> SignedRequest: + """Stamp a createUsers request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_USERS_V3", + } + + full_url = self.base_url + "/public/v1/submit/create_users" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_wallet(self, input: CreateWalletBody) -> CreateWalletResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_WALLET", + } + + return self._activity( + "/public/v1/submit/create_wallet", + body, + "createWalletResult", + CreateWalletResponse, + ) + + def stamp_create_wallet(self, input: CreateWalletBody) -> SignedRequest: + """Stamp a createWallet request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_WALLET", + } + + full_url = self.base_url + "/public/v1/submit/create_wallet" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def create_wallet_accounts( + self, input: CreateWalletAccountsBody + ) -> CreateWalletAccountsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS", + } + + return self._activity( + "/public/v1/submit/create_wallet_accounts", + body, + "createWalletAccountsResult", + CreateWalletAccountsResponse, + ) + + def stamp_create_wallet_accounts( + self, input: CreateWalletAccountsBody + ) -> SignedRequest: + """Stamp a createWalletAccounts request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS", + } + + full_url = self.base_url + "/public/v1/submit/create_wallet_accounts" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_api_keys(self, input: DeleteApiKeysBody) -> DeleteApiKeysResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_API_KEYS", + } + + return self._activity( + "/public/v1/submit/delete_api_keys", + body, + "deleteApiKeysResult", + DeleteApiKeysResponse, + ) + + def stamp_delete_api_keys(self, input: DeleteApiKeysBody) -> SignedRequest: + """Stamp a deleteApiKeys request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_API_KEYS", + } + + full_url = self.base_url + "/public/v1/submit/delete_api_keys" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_authenticators( + self, input: DeleteAuthenticatorsBody + ) -> DeleteAuthenticatorsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_AUTHENTICATORS", + } + + return self._activity( + "/public/v1/submit/delete_authenticators", + body, + "deleteAuthenticatorsResult", + DeleteAuthenticatorsResponse, + ) + + def stamp_delete_authenticators( + self, input: DeleteAuthenticatorsBody + ) -> SignedRequest: + """Stamp a deleteAuthenticators request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_AUTHENTICATORS", + } + + full_url = self.base_url + "/public/v1/submit/delete_authenticators" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_fiat_on_ramp_credential( + self, input: DeleteFiatOnRampCredentialBody + ) -> DeleteFiatOnRampCredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL", + } + + return self._activity( + "/public/v1/submit/delete_fiat_on_ramp_credential", + body, + "deleteFiatOnRampCredentialResult", + DeleteFiatOnRampCredentialResponse, + ) + + def stamp_delete_fiat_on_ramp_credential( + self, input: DeleteFiatOnRampCredentialBody + ) -> SignedRequest: + """Stamp a deleteFiatOnRampCredential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL", + } + + full_url = self.base_url + "/public/v1/submit/delete_fiat_on_ramp_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_invitation( + self, input: DeleteInvitationBody + ) -> DeleteInvitationResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_INVITATION", + } + + return self._activity( + "/public/v1/submit/delete_invitation", + body, + "deleteInvitationResult", + DeleteInvitationResponse, + ) + + def stamp_delete_invitation(self, input: DeleteInvitationBody) -> SignedRequest: + """Stamp a deleteInvitation request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_INVITATION", + } + + full_url = self.base_url + "/public/v1/submit/delete_invitation" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_oauth2_credential( + self, input: DeleteOauth2CredentialBody + ) -> DeleteOauth2CredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL", + } + + return self._activity( + "/public/v1/submit/delete_oauth2_credential", + body, + "deleteOauth2CredentialResult", + DeleteOauth2CredentialResponse, + ) + + def stamp_delete_oauth2_credential( + self, input: DeleteOauth2CredentialBody + ) -> SignedRequest: + """Stamp a deleteOauth2Credential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL", + } + + full_url = self.base_url + "/public/v1/submit/delete_oauth2_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_oauth_providers( + self, input: DeleteOauthProvidersBody + ) -> DeleteOauthProvidersResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS", + } + + return self._activity( + "/public/v1/submit/delete_oauth_providers", + body, + "deleteOauthProvidersResult", + DeleteOauthProvidersResponse, + ) + + def stamp_delete_oauth_providers( + self, input: DeleteOauthProvidersBody + ) -> SignedRequest: + """Stamp a deleteOauthProviders request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS", + } + + full_url = self.base_url + "/public/v1/submit/delete_oauth_providers" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_policies(self, input: DeletePoliciesBody) -> DeletePoliciesResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_POLICIES", + } + + return self._activity( + "/public/v1/submit/delete_policies", + body, + "deletePoliciesResult", + DeletePoliciesResponse, + ) + + def stamp_delete_policies(self, input: DeletePoliciesBody) -> SignedRequest: + """Stamp a deletePolicies request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_POLICIES", + } + + full_url = self.base_url + "/public/v1/submit/delete_policies" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_policy(self, input: DeletePolicyBody) -> DeletePolicyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_POLICY", + } + + return self._activity( + "/public/v1/submit/delete_policy", + body, + "deletePolicyResult", + DeletePolicyResponse, + ) + + def stamp_delete_policy(self, input: DeletePolicyBody) -> SignedRequest: + """Stamp a deletePolicy request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_POLICY", + } + + full_url = self.base_url + "/public/v1/submit/delete_policy" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_private_key_tags( + self, input: DeletePrivateKeyTagsBody + ) -> DeletePrivateKeyTagsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS", + } + + return self._activity( + "/public/v1/submit/delete_private_key_tags", + body, + "deletePrivateKeyTagsResult", + DeletePrivateKeyTagsResponse, + ) + + def stamp_delete_private_key_tags( + self, input: DeletePrivateKeyTagsBody + ) -> SignedRequest: + """Stamp a deletePrivateKeyTags request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS", + } + + full_url = self.base_url + "/public/v1/submit/delete_private_key_tags" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_private_keys( + self, input: DeletePrivateKeysBody + ) -> DeletePrivateKeysResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", + } + + return self._activity( + "/public/v1/submit/delete_private_keys", + body, + "deletePrivateKeysResult", + DeletePrivateKeysResponse, + ) + + def stamp_delete_private_keys(self, input: DeletePrivateKeysBody) -> SignedRequest: + """Stamp a deletePrivateKeys request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", + } + + full_url = self.base_url + "/public/v1/submit/delete_private_keys" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_smart_contract_interface( + self, input: DeleteSmartContractInterfaceBody + ) -> DeleteSmartContractInterfaceResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE", + } + + return self._activity( + "/public/v1/submit/delete_smart_contract_interface", + body, + "deleteSmartContractInterfaceResult", + DeleteSmartContractInterfaceResponse, + ) + + def stamp_delete_smart_contract_interface( + self, input: DeleteSmartContractInterfaceBody + ) -> SignedRequest: + """Stamp a deleteSmartContractInterface request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE", + } + + full_url = self.base_url + "/public/v1/submit/delete_smart_contract_interface" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_sub_organization( + self, input: DeleteSubOrganizationBody + ) -> DeleteSubOrganizationResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION", + } + + return self._activity( + "/public/v1/submit/delete_sub_organization", + body, + "deleteSubOrganizationResult", + DeleteSubOrganizationResponse, + ) + + def stamp_delete_sub_organization( + self, input: DeleteSubOrganizationBody + ) -> SignedRequest: + """Stamp a deleteSubOrganization request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION", + } + + full_url = self.base_url + "/public/v1/submit/delete_sub_organization" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_user_tags(self, input: DeleteUserTagsBody) -> DeleteUserTagsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_USER_TAGS", + } + + return self._activity( + "/public/v1/submit/delete_user_tags", + body, + "deleteUserTagsResult", + DeleteUserTagsResponse, + ) + + def stamp_delete_user_tags(self, input: DeleteUserTagsBody) -> SignedRequest: + """Stamp a deleteUserTags request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_USER_TAGS", + } + + full_url = self.base_url + "/public/v1/submit/delete_user_tags" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_users(self, input: DeleteUsersBody) -> DeleteUsersResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_USERS", + } + + return self._activity( + "/public/v1/submit/delete_users", + body, + "deleteUsersResult", + DeleteUsersResponse, + ) + + def stamp_delete_users(self, input: DeleteUsersBody) -> SignedRequest: + """Stamp a deleteUsers request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_USERS", + } + + full_url = self.base_url + "/public/v1/submit/delete_users" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_wallet_accounts( + self, input: DeleteWalletAccountsBody + ) -> DeleteWalletAccountsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS", + } + + return self._activity( + "/public/v1/submit/delete_wallet_accounts", + body, + "deleteWalletAccountsResult", + DeleteWalletAccountsResponse, + ) + + def stamp_delete_wallet_accounts( + self, input: DeleteWalletAccountsBody + ) -> SignedRequest: + """Stamp a deleteWalletAccounts request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS", + } + + full_url = self.base_url + "/public/v1/submit/delete_wallet_accounts" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def delete_wallets(self, input: DeleteWalletsBody) -> DeleteWalletsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_WALLETS", + } + + return self._activity( + "/public/v1/submit/delete_wallets", + body, + "deleteWalletsResult", + DeleteWalletsResponse, + ) + + def stamp_delete_wallets(self, input: DeleteWalletsBody) -> SignedRequest: + """Stamp a deleteWallets request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_DELETE_WALLETS", + } + + full_url = self.base_url + "/public/v1/submit/delete_wallets" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def email_auth(self, input: EmailAuthBody) -> EmailAuthResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EMAIL_AUTH_V3", + } + + return self._activity( + "/public/v1/submit/email_auth", body, "emailAuthResult", EmailAuthResponse + ) + + def stamp_email_auth(self, input: EmailAuthBody) -> SignedRequest: + """Stamp a emailAuth request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EMAIL_AUTH_V3", + } + + full_url = self.base_url + "/public/v1/submit/email_auth" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def eth_send_raw_transaction( + self, input: EthSendRawTransactionBody + ) -> EthSendRawTransactionResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION", + } + + return self._activity( + "/public/v1/submit/eth_send_raw_transaction", + body, + "ethSendRawTransactionResult", + EthSendRawTransactionResponse, + ) + + def stamp_eth_send_raw_transaction( + self, input: EthSendRawTransactionBody + ) -> SignedRequest: + """Stamp a ethSendRawTransaction request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION", + } + + full_url = self.base_url + "/public/v1/submit/eth_send_raw_transaction" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def eth_send_transaction( + self, input: EthSendTransactionBody + ) -> EthSendTransactionResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_ETH_SEND_TRANSACTION", + } + + return self._activity( + "/public/v1/submit/eth_send_transaction", + body, + "ethSendTransactionResult", + EthSendTransactionResponse, + ) + + def stamp_eth_send_transaction( + self, input: EthSendTransactionBody + ) -> SignedRequest: + """Stamp a ethSendTransaction request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_ETH_SEND_TRANSACTION", + } + + full_url = self.base_url + "/public/v1/submit/eth_send_transaction" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def export_private_key( + self, input: ExportPrivateKeyBody + ) -> ExportPrivateKeyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY", + } + + return self._activity( + "/public/v1/submit/export_private_key", + body, + "exportPrivateKeyResult", + ExportPrivateKeyResponse, + ) + + def stamp_export_private_key(self, input: ExportPrivateKeyBody) -> SignedRequest: + """Stamp a exportPrivateKey request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY", + } + + full_url = self.base_url + "/public/v1/submit/export_private_key" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def export_wallet(self, input: ExportWalletBody) -> ExportWalletResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EXPORT_WALLET", + } + + return self._activity( + "/public/v1/submit/export_wallet", + body, + "exportWalletResult", + ExportWalletResponse, + ) + + def stamp_export_wallet(self, input: ExportWalletBody) -> SignedRequest: + """Stamp a exportWallet request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EXPORT_WALLET", + } + + full_url = self.base_url + "/public/v1/submit/export_wallet" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def export_wallet_account( + self, input: ExportWalletAccountBody + ) -> ExportWalletAccountResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", + } + + return self._activity( + "/public/v1/submit/export_wallet_account", + body, + "exportWalletAccountResult", + ExportWalletAccountResponse, + ) + + def stamp_export_wallet_account( + self, input: ExportWalletAccountBody + ) -> SignedRequest: + """Stamp a exportWalletAccount request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", + } + + full_url = self.base_url + "/public/v1/submit/export_wallet_account" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def import_private_key( + self, input: ImportPrivateKeyBody + ) -> ImportPrivateKeyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY", + } + + return self._activity( + "/public/v1/submit/import_private_key", + body, + "importPrivateKeyResult", + ImportPrivateKeyResponse, + ) + + def stamp_import_private_key(self, input: ImportPrivateKeyBody) -> SignedRequest: + """Stamp a importPrivateKey request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY", + } + + full_url = self.base_url + "/public/v1/submit/import_private_key" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def import_wallet(self, input: ImportWalletBody) -> ImportWalletResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_IMPORT_WALLET", + } + + return self._activity( + "/public/v1/submit/import_wallet", + body, + "importWalletResult", + ImportWalletResponse, + ) + + def stamp_import_wallet(self, input: ImportWalletBody) -> SignedRequest: + """Stamp a importWallet request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_IMPORT_WALLET", + } + + full_url = self.base_url + "/public/v1/submit/import_wallet" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def init_fiat_on_ramp(self, input: InitFiatOnRampBody) -> InitFiatOnRampResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", + } + + return self._activity( + "/public/v1/submit/init_fiat_on_ramp", + body, + "initFiatOnRampResult", + InitFiatOnRampResponse, + ) + + def stamp_init_fiat_on_ramp(self, input: InitFiatOnRampBody) -> SignedRequest: + """Stamp a initFiatOnRamp request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", + } + + full_url = self.base_url + "/public/v1/submit/init_fiat_on_ramp" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def init_import_private_key( + self, input: InitImportPrivateKeyBody + ) -> InitImportPrivateKeyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", + } + + return self._activity( + "/public/v1/submit/init_import_private_key", + body, + "initImportPrivateKeyResult", + InitImportPrivateKeyResponse, + ) + + def stamp_init_import_private_key( + self, input: InitImportPrivateKeyBody + ) -> SignedRequest: + """Stamp a initImportPrivateKey request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", + } + + full_url = self.base_url + "/public/v1/submit/init_import_private_key" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def init_import_wallet( + self, input: InitImportWalletBody + ) -> InitImportWalletResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_IMPORT_WALLET", + } + + return self._activity( + "/public/v1/submit/init_import_wallet", + body, + "initImportWalletResult", + InitImportWalletResponse, + ) + + def stamp_init_import_wallet(self, input: InitImportWalletBody) -> SignedRequest: + """Stamp a initImportWallet request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_IMPORT_WALLET", + } + + full_url = self.base_url + "/public/v1/submit/init_import_wallet" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def init_otp(self, input: InitOtpBody) -> InitOtpResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_OTP_V2", + } + + return self._activity( + "/public/v1/submit/init_otp", body, "initOtpResult", InitOtpResponse + ) + + def stamp_init_otp(self, input: InitOtpBody) -> SignedRequest: + """Stamp a initOtp request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_OTP_V2", + } + + full_url = self.base_url + "/public/v1/submit/init_otp" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def init_otp_auth(self, input: InitOtpAuthBody) -> InitOtpAuthResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V3", + } + + return self._activity( + "/public/v1/submit/init_otp_auth", + body, + "initOtpAuthResultV2", + InitOtpAuthResponse, + ) + + def stamp_init_otp_auth(self, input: InitOtpAuthBody) -> SignedRequest: + """Stamp a initOtpAuth request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_OTP_AUTH_V3", + } + + full_url = self.base_url + "/public/v1/submit/init_otp_auth" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def init_user_email_recovery( + self, input: InitUserEmailRecoveryBody + ) -> InitUserEmailRecoveryResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2", + } + + return self._activity( + "/public/v1/submit/init_user_email_recovery", + body, + "initUserEmailRecoveryResult", + InitUserEmailRecoveryResponse, + ) + + def stamp_init_user_email_recovery( + self, input: InitUserEmailRecoveryBody + ) -> SignedRequest: + """Stamp a initUserEmailRecovery request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2", + } + + full_url = self.base_url + "/public/v1/submit/init_user_email_recovery" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def oauth(self, input: OauthBody) -> OauthResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OAUTH", + } + + return self._activity( + "/public/v1/submit/oauth", body, "oauthResult", OauthResponse + ) + + def stamp_oauth(self, input: OauthBody) -> SignedRequest: + """Stamp a oauth request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OAUTH", + } + + full_url = self.base_url + "/public/v1/submit/oauth" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def oauth2_authenticate( + self, input: Oauth2AuthenticateBody + ) -> Oauth2AuthenticateResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE", + } + + return self._activity( + "/public/v1/submit/oauth2_authenticate", + body, + "oauth2AuthenticateResult", + Oauth2AuthenticateResponse, + ) + + def stamp_oauth2_authenticate(self, input: Oauth2AuthenticateBody) -> SignedRequest: + """Stamp a oauth2Authenticate request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE", + } + + full_url = self.base_url + "/public/v1/submit/oauth2_authenticate" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def oauth_login(self, input: OauthLoginBody) -> OauthLoginResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OAUTH_LOGIN", + } + + return self._activity( + "/public/v1/submit/oauth_login", + body, + "oauthLoginResult", + OauthLoginResponse, + ) + + def stamp_oauth_login(self, input: OauthLoginBody) -> SignedRequest: + """Stamp a oauthLogin request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OAUTH_LOGIN", + } + + full_url = self.base_url + "/public/v1/submit/oauth_login" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def otp_auth(self, input: OtpAuthBody) -> OtpAuthResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OTP_AUTH", + } + + return self._activity( + "/public/v1/submit/otp_auth", body, "otpAuthResult", OtpAuthResponse + ) + + def stamp_otp_auth(self, input: OtpAuthBody) -> SignedRequest: + """Stamp a otpAuth request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OTP_AUTH", + } + + full_url = self.base_url + "/public/v1/submit/otp_auth" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def otp_login(self, input: OtpLoginBody) -> OtpLoginResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OTP_LOGIN", + } + + return self._activity( + "/public/v1/submit/otp_login", body, "otpLoginResult", OtpLoginResponse + ) + + def stamp_otp_login(self, input: OtpLoginBody) -> SignedRequest: + """Stamp a otpLogin request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_OTP_LOGIN", + } + + full_url = self.base_url + "/public/v1/submit/otp_login" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def recover_user(self, input: RecoverUserBody) -> RecoverUserResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_RECOVER_USER", + } + + return self._activity( + "/public/v1/submit/recover_user", + body, + "recoverUserResult", + RecoverUserResponse, + ) + + def stamp_recover_user(self, input: RecoverUserBody) -> SignedRequest: + """Stamp a recoverUser request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_RECOVER_USER", + } + + full_url = self.base_url + "/public/v1/submit/recover_user" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def reject_activity(self, input: RejectActivityBody) -> RejectActivityResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_REJECT_ACTIVITY", + } + + return self._activity_decision( + "/public/v1/submit/reject_activity", body, RejectActivityResponse + ) + + def stamp_reject_activity(self, input: RejectActivityBody) -> SignedRequest: + """Stamp a rejectActivity request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_REJECT_ACTIVITY", + } + + full_url = self.base_url + "/public/v1/submit/reject_activity" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY_DECISION + ) + + def remove_organization_feature( + self, input: RemoveOrganizationFeatureBody + ) -> RemoveOrganizationFeatureResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE", + } + + return self._activity( + "/public/v1/submit/remove_organization_feature", + body, + "removeOrganizationFeatureResult", + RemoveOrganizationFeatureResponse, + ) + + def stamp_remove_organization_feature( + self, input: RemoveOrganizationFeatureBody + ) -> SignedRequest: + """Stamp a removeOrganizationFeature request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE", + } + + full_url = self.base_url + "/public/v1/submit/remove_organization_feature" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def set_organization_feature( + self, input: SetOrganizationFeatureBody + ) -> SetOrganizationFeatureResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE", + } + + return self._activity( + "/public/v1/submit/set_organization_feature", + body, + "setOrganizationFeatureResult", + SetOrganizationFeatureResponse, + ) + + def stamp_set_organization_feature( + self, input: SetOrganizationFeatureBody + ) -> SignedRequest: + """Stamp a setOrganizationFeature request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE", + } + + full_url = self.base_url + "/public/v1/submit/set_organization_feature" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def sign_raw_payload(self, input: SignRawPayloadBody) -> SignRawPayloadResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", + } + + return self._activity( + "/public/v1/submit/sign_raw_payload", + body, + "signRawPayloadResult", + SignRawPayloadResponse, + ) + + def stamp_sign_raw_payload(self, input: SignRawPayloadBody) -> SignedRequest: + """Stamp a signRawPayload request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", + } + + full_url = self.base_url + "/public/v1/submit/sign_raw_payload" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def sign_raw_payloads(self, input: SignRawPayloadsBody) -> SignRawPayloadsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS", + } + + return self._activity( + "/public/v1/submit/sign_raw_payloads", + body, + "signRawPayloadsResult", + SignRawPayloadsResponse, + ) + + def stamp_sign_raw_payloads(self, input: SignRawPayloadsBody) -> SignedRequest: + """Stamp a signRawPayloads request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS", + } + + full_url = self.base_url + "/public/v1/submit/sign_raw_payloads" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def sign_transaction(self, input: SignTransactionBody) -> SignTransactionResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + } + + return self._activity( + "/public/v1/submit/sign_transaction", + body, + "signTransactionResult", + SignTransactionResponse, + ) + + def stamp_sign_transaction(self, input: SignTransactionBody) -> SignedRequest: + """Stamp a signTransaction request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + } + + full_url = self.base_url + "/public/v1/submit/sign_transaction" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def stamp_login(self, input: StampLoginBody) -> StampLoginResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_STAMP_LOGIN", + } + + return self._activity( + "/public/v1/submit/stamp_login", + body, + "stampLoginResult", + StampLoginResponse, + ) + + def stamp_stamp_login(self, input: StampLoginBody) -> SignedRequest: + """Stamp a stampLogin request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_STAMP_LOGIN", + } + + full_url = self.base_url + "/public/v1/submit/stamp_login" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_fiat_on_ramp_credential( + self, input: UpdateFiatOnRampCredentialBody + ) -> UpdateFiatOnRampCredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL", + } + + return self._activity( + "/public/v1/submit/update_fiat_on_ramp_credential", + body, + "updateFiatOnRampCredentialResult", + UpdateFiatOnRampCredentialResponse, + ) + + def stamp_update_fiat_on_ramp_credential( + self, input: UpdateFiatOnRampCredentialBody + ) -> SignedRequest: + """Stamp a updateFiatOnRampCredential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL", + } + + full_url = self.base_url + "/public/v1/submit/update_fiat_on_ramp_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_oauth2_credential( + self, input: UpdateOauth2CredentialBody + ) -> UpdateOauth2CredentialResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL", + } + + return self._activity( + "/public/v1/submit/update_oauth2_credential", + body, + "updateOauth2CredentialResult", + UpdateOauth2CredentialResponse, + ) + + def stamp_update_oauth2_credential( + self, input: UpdateOauth2CredentialBody + ) -> SignedRequest: + """Stamp a updateOauth2Credential request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL", + } + + full_url = self.base_url + "/public/v1/submit/update_oauth2_credential" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_policy(self, input: UpdatePolicyBody) -> UpdatePolicyResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_POLICY_V2", + } + + return self._activity( + "/public/v1/submit/update_policy", + body, + "updatePolicyResultV2", + UpdatePolicyResponse, + ) + + def stamp_update_policy(self, input: UpdatePolicyBody) -> SignedRequest: + """Stamp a updatePolicy request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_POLICY_V2", + } + + full_url = self.base_url + "/public/v1/submit/update_policy" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_private_key_tag( + self, input: UpdatePrivateKeyTagBody + ) -> UpdatePrivateKeyTagResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", + } + + return self._activity( + "/public/v1/submit/update_private_key_tag", + body, + "updatePrivateKeyTagResult", + UpdatePrivateKeyTagResponse, + ) + + def stamp_update_private_key_tag( + self, input: UpdatePrivateKeyTagBody + ) -> SignedRequest: + """Stamp a updatePrivateKeyTag request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", + } + + full_url = self.base_url + "/public/v1/submit/update_private_key_tag" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_root_quorum( + self, input: UpdateRootQuorumBody + ) -> UpdateRootQuorumResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", + } + + return self._activity( + "/public/v1/submit/update_root_quorum", + body, + "updateRootQuorumResult", + UpdateRootQuorumResponse, + ) + + def stamp_update_root_quorum(self, input: UpdateRootQuorumBody) -> SignedRequest: + """Stamp a updateRootQuorum request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", + } + + full_url = self.base_url + "/public/v1/submit/update_root_quorum" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_user(self, input: UpdateUserBody) -> UpdateUserResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER", + } + + return self._activity( + "/public/v1/submit/update_user", + body, + "updateUserResult", + UpdateUserResponse, + ) + + def stamp_update_user(self, input: UpdateUserBody) -> SignedRequest: + """Stamp a updateUser request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER", + } + + full_url = self.base_url + "/public/v1/submit/update_user" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_user_email(self, input: UpdateUserEmailBody) -> UpdateUserEmailResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_EMAIL", + } + + return self._activity( + "/public/v1/submit/update_user_email", + body, + "updateUserEmailResult", + UpdateUserEmailResponse, + ) + + def stamp_update_user_email(self, input: UpdateUserEmailBody) -> SignedRequest: + """Stamp a updateUserEmail request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_EMAIL", + } + + full_url = self.base_url + "/public/v1/submit/update_user_email" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_user_name(self, input: UpdateUserNameBody) -> UpdateUserNameResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_NAME", + } + + return self._activity( + "/public/v1/submit/update_user_name", + body, + "updateUserNameResult", + UpdateUserNameResponse, + ) + + def stamp_update_user_name(self, input: UpdateUserNameBody) -> SignedRequest: + """Stamp a updateUserName request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_NAME", + } + + full_url = self.base_url + "/public/v1/submit/update_user_name" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_user_phone_number( + self, input: UpdateUserPhoneNumberBody + ) -> UpdateUserPhoneNumberResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", + } + + return self._activity( + "/public/v1/submit/update_user_phone_number", + body, + "updateUserPhoneNumberResult", + UpdateUserPhoneNumberResponse, + ) + + def stamp_update_user_phone_number( + self, input: UpdateUserPhoneNumberBody + ) -> SignedRequest: + """Stamp a updateUserPhoneNumber request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", + } + + full_url = self.base_url + "/public/v1/submit/update_user_phone_number" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_user_tag(self, input: UpdateUserTagBody) -> UpdateUserTagResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_TAG", + } + + return self._activity( + "/public/v1/submit/update_user_tag", + body, + "updateUserTagResult", + UpdateUserTagResponse, + ) + + def stamp_update_user_tag(self, input: UpdateUserTagBody) -> SignedRequest: + """Stamp a updateUserTag request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_USER_TAG", + } + + full_url = self.base_url + "/public/v1/submit/update_user_tag" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def update_wallet(self, input: UpdateWalletBody) -> UpdateWalletResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_WALLET", + } + + return self._activity( + "/public/v1/submit/update_wallet", + body, + "updateWalletResult", + UpdateWalletResponse, + ) + + def stamp_update_wallet(self, input: UpdateWalletBody) -> SignedRequest: + """Stamp a updateWallet request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_UPDATE_WALLET", + } + + full_url = self.base_url + "/public/v1/submit/update_wallet" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def verify_otp(self, input: VerifyOtpBody) -> VerifyOtpResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_VERIFY_OTP", + } + + return self._activity( + "/public/v1/submit/verify_otp", body, "verifyOtpResult", VerifyOtpResponse + ) + + def stamp_verify_otp(self, input: VerifyOtpBody) -> SignedRequest: + """Stamp a verifyOtp request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + timestamp_ms = input_dict.pop("timestampMs", str(int(time.time() * 1000))) + + body = { + "parameters": input_dict, + "organizationId": organization_id, + "timestampMs": timestamp_ms, + "type": "ACTIVITY_TYPE_VERIFY_OTP", + } + + full_url = self.base_url + "/public/v1/submit/verify_otp" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.ACTIVITY + ) + + def test_rate_limits(self, input: TestRateLimitsBody) -> TestRateLimitsResponse: + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + return self._request( + "/tkhq/api/v1/test_rate_limits", body, TestRateLimitsResponse + ) + + def stamp_test_rate_limits(self, input: TestRateLimitsBody) -> SignedRequest: + """Stamp a testRateLimits request without sending it.""" + + # Convert Pydantic model to dict + input_dict = input.model_dump(by_alias=True, exclude_none=True) + + organization_id = input_dict.pop("organizationId", self.organization_id) + + body = {"organizationId": organization_id, **input_dict} + + full_url = self.base_url + "/tkhq/api/v1/test_rate_limits" + body_str = self._serialize_body(body) + stamp = self.stamper.stamp(body_str) + + return SignedRequest( + url=full_url, body=body_str, stamp=stamp, type=RequestType.QUERY + ) diff --git a/packages/http/src/turnkey_http/version.py b/packages/http/src/turnkey_http/version.py new file mode 100644 index 0000000..6d61cdf --- /dev/null +++ b/packages/http/src/turnkey_http/version.py @@ -0,0 +1,4 @@ +"""Package version for Turnkey HTTP client.""" + +# Version is updated automatically during publish +VERSION = "turnkey-http@0.1.0" diff --git a/packages/http/tests/.env.example b/packages/http/tests/.env.example new file mode 100644 index 0000000..0831386 --- /dev/null +++ b/packages/http/tests/.env.example @@ -0,0 +1,17 @@ +# Turnkey API credentials for testing +# Copy this file to .env and fill in your actual values + +# Your Turnkey API public key +TURNKEY_API_PUBLIC_KEY=""" + +# Your Turnkey API private key +TURNKEY_API_PRIVATE_KEY=""" + +# Your Turnkey organization ID +TURNKEY_ORGANIZATION_ID="" + +# A valid user ID in your organization (for command tests) +TURNKEY_USER_ID="" + +# Turnkey API base URL (optional, defaults to https://api.turnkey.com) +TURNKEY_BASE_URL="https://api.turnkey.com" diff --git a/packages/http/tests/conftest.py b/packages/http/tests/conftest.py new file mode 100644 index 0000000..0f53536 --- /dev/null +++ b/packages/http/tests/conftest.py @@ -0,0 +1,42 @@ +"""Shared test fixtures and configuration.""" + +import os +import pytest +from pathlib import Path +from dotenv import load_dotenv +from turnkey_api_key_stamper import ApiKeyStamper, ApiKeyStamperConfig +from turnkey_http.generated.client import TurnkeyClient + +# Load environment variables from .env file +env_path = Path(__file__).parent / ".env" +load_dotenv(dotenv_path=env_path) + +# Turnkey test credentials from environment variables +API_PUBLIC_KEY = os.getenv("TURNKEY_API_PUBLIC_KEY") +API_PRIVATE_KEY = os.getenv("TURNKEY_API_PRIVATE_KEY") +ORG_ID = os.getenv("TURNKEY_ORGANIZATION_ID") +USER_ID = os.getenv("TURNKEY_USER_ID") +BASE_URL = os.getenv("TURNKEY_BASE_URL", "https://api.turnkey.com") + + +@pytest.fixture +def client(): + """Create a Turnkey client instance for testing.""" + config = ApiKeyStamperConfig( + api_public_key=API_PUBLIC_KEY, api_private_key=API_PRIVATE_KEY + ) + stamper = ApiKeyStamper(config) + + return TurnkeyClient(base_url=BASE_URL, stamper=stamper, organization_id=ORG_ID) + + +@pytest.fixture +def org_id(): + """Return the organization ID for assertions.""" + return ORG_ID + + +@pytest.fixture +def user_id(): + """Return a test user ID.""" + return USER_ID diff --git a/packages/http/tests/test_activities.py b/packages/http/tests/test_activities.py new file mode 100644 index 0000000..c0e6795 --- /dev/null +++ b/packages/http/tests/test_activities.py @@ -0,0 +1,127 @@ +"""Test Turnkey HTTP client activity methods""" + +import pytest +import secrets +from turnkey_sdk_types import ( + v1ApiKeyParamsV2, + v1ApiKeyCurve, + CreateApiKeysBody, + CreateApiKeysResponse, + TurnkeyNetworkError, +) + + +def test_create_api_keys(client, user_id): + """Test createApiKeys command method.""" + print("๐Ÿ”ง Testing createApiKeys") + + # Generate a new key pair for the API key + private_key = secrets.token_bytes(32) + # For P256, derive public key (simplified - in production use proper crypto library) + public_key = private_key.hex() + + # Create the API key parameters + api_key = v1ApiKeyParamsV2( + apiKeyName="Test API Key from Python SDK", + publicKey=f"02{public_key[:64]}", # Compressed public key format + curveType=v1ApiKeyCurve.API_KEY_CURVE_P256, + expirationSeconds="3600", # 1 hour + ) + + # Create the typed request + request = CreateApiKeysBody(userId=user_id, apiKeys=[api_key]) + + # Make the createApiKeys request with typed input + response = client.create_api_keys(request) + + # Assertions + assert response is not None + assert response.activity is not None + assert response.activity.id is not None + assert response.activity.status in [ + "ACTIVITY_STATUS_COMPLETED", + "ACTIVITY_STATUS_PENDING", + "ACTIVITY_STATUS_CONSENSUS_NEEDED", + ] + + print("โœ… createApiKeys request successful!") + print("\nActivity:") + print(f" Activity ID: {response.activity.id}") + print(f" Status: {response.activity.status}") + print(f" Type: {response.activity.type}") + + # Check if apiKeyIds were flattened into response + if hasattr(response, "apiKeyIds") and response.apiKeyIds: + print(f" Created API Key IDs: {response.apiKeyIds}") + + +def test_organization_id_override(client, user_id): + """Test that organizationId in request body overrides client config.""" + print("๐Ÿ”ง Testing organizationId override") + + # Generate a new key pair for the API key + private_key = secrets.token_bytes(32) + public_key = private_key.hex() + + # Create the API key parameters + api_key = v1ApiKeyParamsV2( + apiKeyName="Test API Key - Should Fail", + publicKey=f"02{public_key[:64]}", + curveType=v1ApiKeyCurve.API_KEY_CURVE_P256, + expirationSeconds="3600", + ) + + # Create request with WRONG organization ID to prove override works + wrong_org_id = "00000000-0000-0000-0000-000000000000" + request = CreateApiKeysBody( + organizationId=wrong_org_id, # Override with wrong org ID + userId=user_id, + apiKeys=[api_key], + ) + + # This should fail because we're using a wrong organization ID + with pytest.raises(TurnkeyNetworkError) as exc_info: + client.create_api_keys(request) + + # Verify the error is related to the wrong organization + error = exc_info.value + error_msg = str(error) + print(f"\nโŒ Error message: {error_msg}") + print(f" Status code: {error.status_code}") + print(f"โœ… Request failed as expected with wrong organization ID") + + # Assert that we got the expected error for organization not found + assert "no organization found" in error_msg.lower() + assert wrong_org_id in error_msg + + +def test_stamp_create_api_keys_send_signed_request(client, user_id): + """Stamp an activity and submit via send_signed_request.""" + print("\n๐Ÿ”ง Testing stamp + send for createApiKeys") + + private_key = secrets.token_bytes(32) + public_key = private_key.hex() + + api_key = v1ApiKeyParamsV2( + apiKeyName="Test API Key via Stamp", + publicKey=f"02{public_key[:64]}", + curveType=v1ApiKeyCurve.API_KEY_CURVE_P256, + expirationSeconds="3600", + ) + + request = CreateApiKeysBody(userId=user_id, apiKeys=[api_key]) + + # Stamp only (do not auto-send) + signed_req = client.stamp_create_api_keys(request) + + # Send stamped request via client with type (includes polling) + resp = client.send_signed_request(signed_req, CreateApiKeysResponse) + + assert resp is not None + assert resp.activity is not None + assert resp.activity.id is not None + assert resp.apiKeyIds is not None + assert isinstance(resp.apiKeyIds, list) + print( + f"โœ… Stamped createApiKeys submitted; activity {resp.activity.id} apiKeyIds: {resp.apiKeyIds}" + ) diff --git a/packages/http/tests/test_queries.py b/packages/http/tests/test_queries.py new file mode 100644 index 0000000..94a2531 --- /dev/null +++ b/packages/http/tests/test_queries.py @@ -0,0 +1,121 @@ +"""Test Turnkey HTTP client query methods""" + +from turnkey_sdk_types import ( + GetOrganizationBody, + GetOrganizationResponse, + TurnkeyNetworkError, +) + +import pytest + + +def test_get_whoami(client, org_id): + """Test getWhoami query method.""" + print("๐Ÿ”ง Testing getWhoami") + + response = client.get_whoami() + + # Assertions + assert response is not None + assert response.organizationId == org_id + assert response.userId is not None + assert response.username is not None + + print("โœ… getWhoami successful!") + print("\nResponse:") + print(f" Organization ID: {response.organizationId}") + print(f" Organization Name: {response.organizationName}") + print(f" User ID: {response.userId}") + print(f" Username: {response.username}") + + +def test_get_organization(client, org_id): + """Test getOrganization query method.""" + print("\n๐Ÿ”ง Testing getOrganization") + + response = client.get_organization() + + # Assertions + assert response is not None + assert response.organizationData is not None + assert response.organizationData.organizationId == org_id + assert response.organizationData.name is not None + + print("โœ… getOrganization successful!") + print("\nOrganization:") + print(f" ID: {response.organizationData.organizationId}") + print(f" Name: {response.organizationData.name}") + + +def test_get_users(client): + """Test getUsers (list) query method.""" + print("\n๐Ÿ”ง Testing getUsers") + + response = client.get_users() + + # Assertions + assert response is not None + assert response.users is not None + assert isinstance(response.users, list) + + print("โœ… getUsers successful!") + print(f"\nFound {len(response.users)} users") + if response.users: + first_user = response.users[0] + print(f" First user: {first_user.userName} ({first_user.userId})") + + +def test_get_wallets(client): + """Test getWallets (list) query method.""" + print("\n๐Ÿ”ง Testing getWallets") + + response = client.get_wallets() + + # Assertions + assert response is not None + assert response.wallets is not None + assert isinstance(response.wallets, list) + + print("โœ… getWallets successful!") + print(f"\nFound {len(response.wallets)} wallets") + + +def test_stamp_get_organization_send_signed_request(client, org_id): + """Stamp a query and submit via send_signed_request.""" + print("\n๐Ÿ”ง Testing stamp + send for getOrganization") + + # Stamp only (queries have flat bodies) + signed_req = client.stamp_get_organization(GetOrganizationBody()) + + # Send stamped request via client with type + org_resp = client.send_signed_request(signed_req, GetOrganizationResponse) + + assert org_resp is not None + assert org_resp.organizationData is not None + assert org_resp.organizationData.organizationId == org_id + print( + f"โœ… Stamped getOrganization submitted; org: {org_resp.organizationData.organizationId}" + ) + + +def test_organization_id_override_query(client): + """Test that organizationId in request body overrides client config for queries.""" + print("\n๐Ÿ”ง Testing organizationId override for queries") + + # Create request with WRONG organization ID to prove override works + wrong_org_id = "00000000-0000-0000-0000-000000000000" + request = GetOrganizationBody(organizationId=wrong_org_id) + + # This should fail because we're using a wrong organization ID + with pytest.raises(TurnkeyNetworkError) as exc_info: + client.get_organization(request) + + # Verify the error is related to the wrong organization + error = exc_info.value + error_msg = str(error) + print(f"\nโŒ Error message: {error_msg}") + print(f" Status code: {error.status_code}") + print(f"โœ… Request failed as expected with wrong organization ID") + + # Assert that we got an error for invalid organization (different error than activities) + assert "invalid organization ID" in error_msg diff --git a/packages/sdk-types/README.md b/packages/sdk-types/README.md new file mode 100644 index 0000000..66b5288 --- /dev/null +++ b/packages/sdk-types/README.md @@ -0,0 +1,94 @@ +# 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 + +```python +class v1EthSendTransactionIntent(TurnkeyBaseModel): + from_: str = Field(alias="from") + # ... other fields +``` + +## Installation + +```bash +pip install -e . +``` + +Or install from the repository root: + +```bash +pip install -e packages/sdk-types +``` + +## Usage + +```python +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: + +```bash +cd packages/sdk-types +python scripts/generate.py +``` + +### Development Setup + +Install with dev dependencies to access code generation tools: + +```bash +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` diff --git a/packages/sdk-types/pyproject.toml b/packages/sdk-types/pyproject.toml new file mode 100644 index 0000000..1018c93 --- /dev/null +++ b/packages/sdk-types/pyproject.toml @@ -0,0 +1,46 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "turnkey-sdk-types" +version = "0.1.0" +description = "Type definitions for Turnkey API" +readme = "README.md" +requires-python = ">=3.8" +license = {text = "MIT"} +authors = [ + {name = "Turnkey", email = "hello@turnkey.com"} +] +keywords = ["turnkey", "api", "types", "sdk"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [ + "pydantic>=2.0.0", +] + +[project.optional-dependencies] +dev = [ + "datamodel-code-generator>=0.25.0", + "ruff>=0.1.0", +] + +[project.urls] +Homepage = "https://github.com/tkhq/python-sdk" +Repository = "https://github.com/tkhq/python-sdk" +Documentation = "https://github.com/tkhq/python-sdk/tree/main/packages/sdk-types" + +[tool.setuptools.packages.find] +where = ["src"] + +[tool.setuptools.package-data] +turnkey_sdk_types = ["py.typed"] diff --git a/packages/sdk-types/src/turnkey_sdk_types/__init__.py b/packages/sdk-types/src/turnkey_sdk_types/__init__.py new file mode 100644 index 0000000..c76c1f3 --- /dev/null +++ b/packages/sdk-types/src/turnkey_sdk_types/__init__.py @@ -0,0 +1,3 @@ +from .errors import * +from .types import * +from .generated.types import * diff --git a/packages/sdk-types/src/turnkey_sdk_types/errors.py b/packages/sdk-types/src/turnkey_sdk_types/errors.py new file mode 100644 index 0000000..9e4ce8b --- /dev/null +++ b/packages/sdk-types/src/turnkey_sdk_types/errors.py @@ -0,0 +1,41 @@ +"""Turnkey SDK error classes.""" + +from enum import Enum +from typing import Optional, Any + + +class TurnkeyErrorCodes(str, Enum): + """Error codes for Turnkey API errors.""" + + NETWORK_ERROR = "NETWORK_ERROR" + BAD_RESPONSE = "BAD_RESPONSE" + + +class TurnkeyError(Exception): + """Base exception for Turnkey SDK errors.""" + + def __init__( + self, + message: str, + code: Optional[TurnkeyErrorCodes] = None, + cause: Optional[Any] = None, + ): + super().__init__(message) + self.name = "TurnkeyError" + self.code = code + self.cause = cause + + +class TurnkeyNetworkError(TurnkeyError): + """Exception raised for network-related errors.""" + + def __init__( + self, + message: str, + status_code: Optional[int] = None, + code: Optional[TurnkeyErrorCodes] = None, + cause: Optional[Any] = None, + ): + super().__init__(message, code, cause) + self.name = "TurnkeyNetworkError" + self.status_code = status_code diff --git a/packages/sdk-types/src/turnkey_sdk_types/generated/.gitkeep b/packages/sdk-types/src/turnkey_sdk_types/generated/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/sdk-types/src/turnkey_sdk_types/generated/README.md b/packages/sdk-types/src/turnkey_sdk_types/generated/README.md new file mode 100644 index 0000000..56e9f4b --- /dev/null +++ b/packages/sdk-types/src/turnkey_sdk_types/generated/README.md @@ -0,0 +1,12 @@ +# Generated Types + +This directory contains auto-generated type definitions from the OpenAPI specification. + +**DO NOT EDIT FILES IN THIS DIRECTORY MANUALLY** + +These files are generated by running: +```bash +python scripts/generate.py +``` + +Any manual changes will be overwritten on the next generation. diff --git a/packages/sdk-types/src/turnkey_sdk_types/generated/types.py b/packages/sdk-types/src/turnkey_sdk_types/generated/types.py new file mode 100644 index 0000000..9e66c57 --- /dev/null +++ b/packages/sdk-types/src/turnkey_sdk_types/generated/types.py @@ -0,0 +1,7755 @@ +# @generated by codegen. DO NOT EDIT BY HAND + +from __future__ import annotations +from typing import Any, Dict, List, Optional +from enum import Enum +from pydantic import BaseModel, Field, ConfigDict + + +# Base class with shared configuration +class TurnkeyBaseModel(BaseModel): + model_config = ConfigDict(populate_by_name=True) + + +# --- Base Types from Swagger Definitions --- + + +class apiApiKeyParams(TurnkeyBaseModel): + apiKeyName: str = Field(description="Human-readable name for an API Key.") + publicKey: str = Field( + description="The public component of a cryptographic key pair used to sign messages and transactions." + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Optional window (in seconds) indicating how long the API Key should last.", + ) + + +class billingActivateBillingTierIntent(TurnkeyBaseModel): + productId: str = Field( + description="The product that the customer wants to subscribe to." + ) + + +class billingActivateBillingTierResult(TurnkeyBaseModel): + productId: str = Field(description="The id of the product being subscribed to.") + + +class billingDeletePaymentMethodIntent(TurnkeyBaseModel): + paymentMethodId: str = Field( + description="The payment method that the customer wants to remove." + ) + + +class billingDeletePaymentMethodResult(TurnkeyBaseModel): + paymentMethodId: str = Field(description="The payment method that was removed.") + + +class billingSetPaymentMethodIntent(TurnkeyBaseModel): + number: str = Field(description="The account number of the customer's credit card.") + cvv: str = Field( + description="The verification digits of the customer's credit card." + ) + expiryMonth: str = Field(description="The month that the credit card expires.") + expiryYear: str = Field(description="The year that the credit card expires.") + cardHolderEmail: str = Field( + description="The email that will receive invoices for the credit card." + ) + cardHolderName: str = Field(description="The name associated with the credit card.") + + +class billingSetPaymentMethodIntentV2(TurnkeyBaseModel): + paymentMethodId: str = Field( + description="The id of the payment method that was created clientside." + ) + cardHolderEmail: str = Field( + description="The email that will receive invoices for the credit card." + ) + cardHolderName: str = Field(description="The name associated with the credit card.") + + +class billingSetPaymentMethodResult(TurnkeyBaseModel): + lastFour: str = Field(description="The last four digits of the credit card added.") + cardHolderName: str = Field( + description="The name associated with the payment method." + ) + cardHolderEmail: str = Field( + description="The email address associated with the payment method." + ) + + +class datav1Tag(TurnkeyBaseModel): + tagId: str = Field(description="Unique identifier for a given Tag.") + tagName: str = Field(description="Human-readable name for a Tag.") + tagType: v1TagType + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class externalactivityv1PolicyEvaluation(TurnkeyBaseModel): + id: str = Field(description="Unique identifier for a given policy evaluation.") + activityId: str = Field(description="Unique identifier for a given Activity.") + organizationId: str = Field( + description="Unique identifier for the Organization the Activity belongs to." + ) + voteId: str = Field( + description="Unique identifier for the Vote associated with this policy evaluation." + ) + policyEvaluations: List[immutablecommonv1PolicyEvaluation] = Field( + description="Detailed evaluation result for each Policy that was run." + ) + createdAt: externaldatav1Timestamp + + +class externaldatav1Address(TurnkeyBaseModel): + format: Optional[v1AddressFormat] = Field(default=None) + address: Optional[str] = Field(default=None) + + +class externaldatav1Credential(TurnkeyBaseModel): + publicKey: str = Field( + description="The public component of a cryptographic key pair used to sign messages and transactions." + ) + type: v1CredentialType + + +class externaldatav1Quorum(TurnkeyBaseModel): + threshold: int = Field( + description="Count of unique approvals required to meet quorum." + ) + userIds: List[str] = Field(description="Unique identifiers of quorum set members.") + + +class externaldatav1SignatureScheme(str, Enum): + SIGNATURE_SCHEME_EPHEMERAL_KEY_P256 = "SIGNATURE_SCHEME_EPHEMERAL_KEY_P256" + + +class externaldatav1SmartContractInterface(TurnkeyBaseModel): + organizationId: str = Field( + description="The Organization the Smart Contract Interface belongs to." + ) + smartContractInterfaceId: str = Field( + description="Unique identifier for a given Smart Contract Interface (ABI or IDL)." + ) + smartContractAddress: str = Field( + description="The address corresponding to the Smart Contract or Program." + ) + smartContractInterface: str = Field( + description="The JSON corresponding to the Smart Contract Interface (ABI or IDL)." + ) + type: str = Field( + description="The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + ) + label: str = Field( + description="The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + ) + notes: str = Field( + description="The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class externaldatav1Timestamp(TurnkeyBaseModel): + seconds: str + nanos: str + + +class immutableactivityv1Address(TurnkeyBaseModel): + format: Optional[v1AddressFormat] = Field(default=None) + address: Optional[str] = Field(default=None) + + +class immutablecommonv1PolicyEvaluation(TurnkeyBaseModel): + policyId: Optional[str] = Field(default=None) + outcome: Optional[v1Outcome] = Field(default=None) + + +class protobufAny(TurnkeyBaseModel): + type: Optional[str] = Field(default=None, alias="@type") + + +class rpcStatus(TurnkeyBaseModel): + code: Optional[int] = Field(default=None) + message: Optional[str] = Field(default=None) + details: Optional[List[protobufAny]] = Field(default=None) + + +class v1AcceptInvitationIntent(TurnkeyBaseModel): + invitationId: str = Field( + description="Unique identifier for a given Invitation object." + ) + userId: str = Field(description="Unique identifier for a given User.") + authenticator: v1AuthenticatorParams = Field( + description="WebAuthN hardware devices that can be used to log in to the Turnkey web app." + ) + + +class v1AcceptInvitationIntentV2(TurnkeyBaseModel): + invitationId: str = Field( + description="Unique identifier for a given Invitation object." + ) + userId: str = Field(description="Unique identifier for a given User.") + authenticator: v1AuthenticatorParamsV2 = Field( + description="WebAuthN hardware devices that can be used to log in to the Turnkey web app." + ) + + +class v1AcceptInvitationResult(TurnkeyBaseModel): + invitationId: str = Field(description="Unique identifier for a given Invitation.") + userId: str = Field(description="Unique identifier for a given User.") + + +class v1AccessType(str, Enum): + ACCESS_TYPE_WEB = "ACCESS_TYPE_WEB" + ACCESS_TYPE_API = "ACCESS_TYPE_API" + ACCESS_TYPE_ALL = "ACCESS_TYPE_ALL" + + +class v1Activity(TurnkeyBaseModel): + id: str = Field(description="Unique identifier for a given Activity object.") + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + status: v1ActivityStatus = Field( + description="The current processing status of a specified Activity." + ) + type: v1ActivityType = Field( + description="Type of Activity, such as Add User, or Sign Transaction." + ) + intent: v1Intent = Field( + description="Intent object crafted by Turnkey based on the user request, used to assess the permissibility of an action." + ) + result: v1Result = Field(description="Result of the intended action.") + votes: List[v1Vote] = Field( + description="A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata." + ) + appProofs: Optional[List[v1AppProof]] = Field( + default=None, + description="A list of App Proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations.", + ) + fingerprint: str = Field(description="An artifact verifying a User's action.") + canApprove: bool + canReject: bool + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + failure: Optional[rpcStatus] = Field( + default=None, description="Failure reason of the intended action." + ) + + +class v1ActivityResponse(TurnkeyBaseModel): + activity: v1Activity = Field( + description="An action that can be taken within the Turnkey infrastructure." + ) + + +class v1ActivityStatus(str, Enum): + ACTIVITY_STATUS_CREATED = "ACTIVITY_STATUS_CREATED" + ACTIVITY_STATUS_PENDING = "ACTIVITY_STATUS_PENDING" + ACTIVITY_STATUS_COMPLETED = "ACTIVITY_STATUS_COMPLETED" + ACTIVITY_STATUS_FAILED = "ACTIVITY_STATUS_FAILED" + ACTIVITY_STATUS_CONSENSUS_NEEDED = "ACTIVITY_STATUS_CONSENSUS_NEEDED" + ACTIVITY_STATUS_REJECTED = "ACTIVITY_STATUS_REJECTED" + + +class v1ActivityType(str, Enum): + ACTIVITY_TYPE_CREATE_API_KEYS = "ACTIVITY_TYPE_CREATE_API_KEYS" + ACTIVITY_TYPE_CREATE_USERS = "ACTIVITY_TYPE_CREATE_USERS" + ACTIVITY_TYPE_CREATE_PRIVATE_KEYS = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS" + ACTIVITY_TYPE_SIGN_RAW_PAYLOAD = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD" + ACTIVITY_TYPE_CREATE_INVITATIONS = "ACTIVITY_TYPE_CREATE_INVITATIONS" + ACTIVITY_TYPE_ACCEPT_INVITATION = "ACTIVITY_TYPE_ACCEPT_INVITATION" + ACTIVITY_TYPE_CREATE_POLICY = "ACTIVITY_TYPE_CREATE_POLICY" + ACTIVITY_TYPE_DISABLE_PRIVATE_KEY = "ACTIVITY_TYPE_DISABLE_PRIVATE_KEY" + ACTIVITY_TYPE_DELETE_USERS = "ACTIVITY_TYPE_DELETE_USERS" + ACTIVITY_TYPE_DELETE_API_KEYS = "ACTIVITY_TYPE_DELETE_API_KEYS" + ACTIVITY_TYPE_DELETE_INVITATION = "ACTIVITY_TYPE_DELETE_INVITATION" + ACTIVITY_TYPE_DELETE_ORGANIZATION = "ACTIVITY_TYPE_DELETE_ORGANIZATION" + ACTIVITY_TYPE_DELETE_POLICY = "ACTIVITY_TYPE_DELETE_POLICY" + ACTIVITY_TYPE_CREATE_USER_TAG = "ACTIVITY_TYPE_CREATE_USER_TAG" + ACTIVITY_TYPE_DELETE_USER_TAGS = "ACTIVITY_TYPE_DELETE_USER_TAGS" + ACTIVITY_TYPE_CREATE_ORGANIZATION = "ACTIVITY_TYPE_CREATE_ORGANIZATION" + ACTIVITY_TYPE_SIGN_TRANSACTION = "ACTIVITY_TYPE_SIGN_TRANSACTION" + ACTIVITY_TYPE_APPROVE_ACTIVITY = "ACTIVITY_TYPE_APPROVE_ACTIVITY" + ACTIVITY_TYPE_REJECT_ACTIVITY = "ACTIVITY_TYPE_REJECT_ACTIVITY" + ACTIVITY_TYPE_DELETE_AUTHENTICATORS = "ACTIVITY_TYPE_DELETE_AUTHENTICATORS" + ACTIVITY_TYPE_CREATE_AUTHENTICATORS = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS" + ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG = "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG" + ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS = "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS" + ACTIVITY_TYPE_SET_PAYMENT_METHOD = "ACTIVITY_TYPE_SET_PAYMENT_METHOD" + ACTIVITY_TYPE_ACTIVATE_BILLING_TIER = "ACTIVITY_TYPE_ACTIVATE_BILLING_TIER" + ACTIVITY_TYPE_DELETE_PAYMENT_METHOD = "ACTIVITY_TYPE_DELETE_PAYMENT_METHOD" + ACTIVITY_TYPE_CREATE_POLICY_V2 = "ACTIVITY_TYPE_CREATE_POLICY_V2" + ACTIVITY_TYPE_CREATE_POLICY_V3 = "ACTIVITY_TYPE_CREATE_POLICY_V3" + ACTIVITY_TYPE_CREATE_API_ONLY_USERS = "ACTIVITY_TYPE_CREATE_API_ONLY_USERS" + ACTIVITY_TYPE_UPDATE_ROOT_QUORUM = "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM" + ACTIVITY_TYPE_UPDATE_USER_TAG = "ACTIVITY_TYPE_UPDATE_USER_TAG" + ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG = "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG" + ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2 = "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2" + ACTIVITY_TYPE_CREATE_ORGANIZATION_V2 = "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2" + ACTIVITY_TYPE_CREATE_USERS_V2 = "ACTIVITY_TYPE_CREATE_USERS_V2" + ACTIVITY_TYPE_ACCEPT_INVITATION_V2 = "ACTIVITY_TYPE_ACCEPT_INVITATION_V2" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION = "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2 = ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2" + ) + ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS = "ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS" + ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2 = "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2" + ACTIVITY_TYPE_UPDATE_USER = "ACTIVITY_TYPE_UPDATE_USER" + ACTIVITY_TYPE_UPDATE_POLICY = "ACTIVITY_TYPE_UPDATE_POLICY" + ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2 = "ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3 = ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3" + ) + ACTIVITY_TYPE_CREATE_WALLET = "ACTIVITY_TYPE_CREATE_WALLET" + ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS = "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS" + ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY = "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY" + ACTIVITY_TYPE_RECOVER_USER = "ACTIVITY_TYPE_RECOVER_USER" + ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE = "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE" + ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE = ( + "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE" + ) + ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2 = "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2" + ACTIVITY_TYPE_SIGN_TRANSACTION_V2 = "ACTIVITY_TYPE_SIGN_TRANSACTION_V2" + ACTIVITY_TYPE_EXPORT_PRIVATE_KEY = "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY" + ACTIVITY_TYPE_EXPORT_WALLET = "ACTIVITY_TYPE_EXPORT_WALLET" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4 = ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4" + ) + ACTIVITY_TYPE_EMAIL_AUTH = "ACTIVITY_TYPE_EMAIL_AUTH" + ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT = "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT" + ACTIVITY_TYPE_INIT_IMPORT_WALLET = "ACTIVITY_TYPE_INIT_IMPORT_WALLET" + ACTIVITY_TYPE_IMPORT_WALLET = "ACTIVITY_TYPE_IMPORT_WALLET" + ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY = "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY" + ACTIVITY_TYPE_IMPORT_PRIVATE_KEY = "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY" + ACTIVITY_TYPE_CREATE_POLICIES = "ACTIVITY_TYPE_CREATE_POLICIES" + ACTIVITY_TYPE_SIGN_RAW_PAYLOADS = "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS" + ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION = "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION" + ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS = "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS" + ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS = "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5 = ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5" + ) + ACTIVITY_TYPE_OAUTH = "ACTIVITY_TYPE_OAUTH" + ACTIVITY_TYPE_CREATE_API_KEYS_V2 = "ACTIVITY_TYPE_CREATE_API_KEYS_V2" + ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION = "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION" + ACTIVITY_TYPE_EMAIL_AUTH_V2 = "ACTIVITY_TYPE_EMAIL_AUTH_V2" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6 = ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6" + ) + ACTIVITY_TYPE_DELETE_PRIVATE_KEYS = "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS" + ACTIVITY_TYPE_DELETE_WALLETS = "ACTIVITY_TYPE_DELETE_WALLETS" + ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2 = ( + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2" + ) + ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION = "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION" + ACTIVITY_TYPE_INIT_OTP_AUTH = "ACTIVITY_TYPE_INIT_OTP_AUTH" + ACTIVITY_TYPE_OTP_AUTH = "ACTIVITY_TYPE_OTP_AUTH" + ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7 = ( + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7" + ) + ACTIVITY_TYPE_UPDATE_WALLET = "ACTIVITY_TYPE_UPDATE_WALLET" + ACTIVITY_TYPE_UPDATE_POLICY_V2 = "ACTIVITY_TYPE_UPDATE_POLICY_V2" + ACTIVITY_TYPE_CREATE_USERS_V3 = "ACTIVITY_TYPE_CREATE_USERS_V3" + ACTIVITY_TYPE_INIT_OTP_AUTH_V2 = "ACTIVITY_TYPE_INIT_OTP_AUTH_V2" + ACTIVITY_TYPE_INIT_OTP = "ACTIVITY_TYPE_INIT_OTP" + ACTIVITY_TYPE_VERIFY_OTP = "ACTIVITY_TYPE_VERIFY_OTP" + ACTIVITY_TYPE_OTP_LOGIN = "ACTIVITY_TYPE_OTP_LOGIN" + ACTIVITY_TYPE_STAMP_LOGIN = "ACTIVITY_TYPE_STAMP_LOGIN" + ACTIVITY_TYPE_OAUTH_LOGIN = "ACTIVITY_TYPE_OAUTH_LOGIN" + ACTIVITY_TYPE_UPDATE_USER_NAME = "ACTIVITY_TYPE_UPDATE_USER_NAME" + ACTIVITY_TYPE_UPDATE_USER_EMAIL = "ACTIVITY_TYPE_UPDATE_USER_EMAIL" + ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER = "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER" + ACTIVITY_TYPE_INIT_FIAT_ON_RAMP = "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP" + ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE = ( + "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE" + ) + ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE = ( + "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE" + ) + ACTIVITY_TYPE_ENABLE_AUTH_PROXY = "ACTIVITY_TYPE_ENABLE_AUTH_PROXY" + ACTIVITY_TYPE_DISABLE_AUTH_PROXY = "ACTIVITY_TYPE_DISABLE_AUTH_PROXY" + ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG = "ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG" + ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL = "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL" + ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL = "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL" + ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL = "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL" + ACTIVITY_TYPE_OAUTH2_AUTHENTICATE = "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE" + ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS = "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS" + ACTIVITY_TYPE_DELETE_POLICIES = "ACTIVITY_TYPE_DELETE_POLICIES" + ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION = "ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION" + ACTIVITY_TYPE_ETH_SEND_TRANSACTION = "ACTIVITY_TYPE_ETH_SEND_TRANSACTION" + ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL = ( + "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL" + ) + ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL = ( + "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL" + ) + ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL = ( + "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL" + ) + ACTIVITY_TYPE_EMAIL_AUTH_V3 = "ACTIVITY_TYPE_EMAIL_AUTH_V3" + ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2 = ( + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2" + ) + ACTIVITY_TYPE_INIT_OTP_AUTH_V3 = "ACTIVITY_TYPE_INIT_OTP_AUTH_V3" + ACTIVITY_TYPE_INIT_OTP_V2 = "ACTIVITY_TYPE_INIT_OTP_V2" + ACTIVITY_TYPE_UPSERT_GAS_USAGE_CONFIG = "ACTIVITY_TYPE_UPSERT_GAS_USAGE_CONFIG" + + +class v1AddressFormat(str, Enum): + ADDRESS_FORMAT_UNCOMPRESSED = "ADDRESS_FORMAT_UNCOMPRESSED" + ADDRESS_FORMAT_COMPRESSED = "ADDRESS_FORMAT_COMPRESSED" + ADDRESS_FORMAT_ETHEREUM = "ADDRESS_FORMAT_ETHEREUM" + ADDRESS_FORMAT_SOLANA = "ADDRESS_FORMAT_SOLANA" + ADDRESS_FORMAT_COSMOS = "ADDRESS_FORMAT_COSMOS" + ADDRESS_FORMAT_TRON = "ADDRESS_FORMAT_TRON" + ADDRESS_FORMAT_SUI = "ADDRESS_FORMAT_SUI" + ADDRESS_FORMAT_APTOS = "ADDRESS_FORMAT_APTOS" + ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH" + ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH" + ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH" + ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH" + ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR = "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR" + ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH" + ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH" + ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH" + ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH" + ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR = "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR" + ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH" + ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH" + ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH" + ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH" + ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR = "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR" + ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH" + ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH" + ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH" + ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH" + ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR = "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR" + ADDRESS_FORMAT_SEI = "ADDRESS_FORMAT_SEI" + ADDRESS_FORMAT_XLM = "ADDRESS_FORMAT_XLM" + ADDRESS_FORMAT_DOGE_MAINNET = "ADDRESS_FORMAT_DOGE_MAINNET" + ADDRESS_FORMAT_DOGE_TESTNET = "ADDRESS_FORMAT_DOGE_TESTNET" + ADDRESS_FORMAT_TON_V3R2 = "ADDRESS_FORMAT_TON_V3R2" + ADDRESS_FORMAT_TON_V4R2 = "ADDRESS_FORMAT_TON_V4R2" + ADDRESS_FORMAT_TON_V5R1 = "ADDRESS_FORMAT_TON_V5R1" + ADDRESS_FORMAT_XRP = "ADDRESS_FORMAT_XRP" + + +class v1ApiKey(TurnkeyBaseModel): + credential: externaldatav1Credential = Field( + description="A User credential that can be used to authenticate to Turnkey." + ) + apiKeyId: str = Field(description="Unique identifier for a given API Key.") + apiKeyName: str = Field(description="Human-readable name for an API Key.") + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + expirationSeconds: Optional[str] = Field( + default=None, + description="Optional window (in seconds) indicating how long the API Key should last.", + ) + + +class v1ApiKeyCurve(str, Enum): + API_KEY_CURVE_P256 = "API_KEY_CURVE_P256" + API_KEY_CURVE_SECP256K1 = "API_KEY_CURVE_SECP256K1" + API_KEY_CURVE_ED25519 = "API_KEY_CURVE_ED25519" + + +class v1ApiKeyParamsV2(TurnkeyBaseModel): + apiKeyName: str = Field(description="Human-readable name for an API Key.") + publicKey: str = Field( + description="The public component of a cryptographic key pair used to sign messages and transactions." + ) + curveType: v1ApiKeyCurve = Field( + description="The curve type to be used for processing API key signatures." + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Optional window (in seconds) indicating how long the API Key should last.", + ) + + +class v1ApiOnlyUserParams(TurnkeyBaseModel): + userName: str = Field(description="The name of the new API-only User.") + userEmail: Optional[str] = Field( + default=None, description="The email address for this API-only User (optional)." + ) + userTags: List[str] = Field( + description="A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body." + ) + apiKeys: List[apiApiKeyParams] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + + +class v1AppProof(TurnkeyBaseModel): + scheme: externaldatav1SignatureScheme = Field(description="Scheme of signing key.") + publicKey: str = Field(description="Ephemeral public key.") + proofPayload: str = Field(description="JSON serialized AppProofPayload.") + signature: str = Field(description="Signature over hashed proof_payload.") + + +class v1ApproveActivityIntent(TurnkeyBaseModel): + fingerprint: str = Field(description="An artifact verifying a User's action.") + + +class v1ApproveActivityRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1ApproveActivityIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1Attestation(TurnkeyBaseModel): + credentialId: str = Field( + description="The cbor encoded then base64 url encoded id of the credential." + ) + clientDataJson: str = Field( + description="A base64 url encoded payload containing metadata about the signing context and the challenge." + ) + attestationObject: str = Field( + description="A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses." + ) + transports: List[v1AuthenticatorTransport] = Field( + description="The type of authenticator transports." + ) + + +class v1Authenticator(TurnkeyBaseModel): + transports: List[v1AuthenticatorTransport] = Field( + description="Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE)." + ) + attestationType: str + aaguid: str = Field( + description="Identifier indicating the type of the Security Key." + ) + credentialId: str = Field( + description="Unique identifier for a WebAuthn credential." + ) + model: str = Field(description="The type of Authenticator device.") + credential: externaldatav1Credential = Field( + description="A User credential that can be used to authenticate to Turnkey." + ) + authenticatorId: str = Field( + description="Unique identifier for a given Authenticator." + ) + authenticatorName: str = Field( + description="Human-readable name for an Authenticator." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class v1AuthenticatorAttestationResponse(TurnkeyBaseModel): + clientDataJson: str + attestationObject: str + transports: Optional[List[v1AuthenticatorTransport]] = Field(default=None) + authenticatorAttachment: Optional[str] = Field(default=None) + + +class v1AuthenticatorParams(TurnkeyBaseModel): + authenticatorName: str = Field( + description="Human-readable name for an Authenticator." + ) + userId: str = Field(description="Unique identifier for a given User.") + attestation: v1PublicKeyCredentialWithAttestation + challenge: str = Field( + description="Challenge presented for authentication purposes." + ) + + +class v1AuthenticatorParamsV2(TurnkeyBaseModel): + authenticatorName: str = Field( + description="Human-readable name for an Authenticator." + ) + challenge: str = Field( + description="Challenge presented for authentication purposes." + ) + attestation: v1Attestation = Field( + description="The attestation that proves custody of the authenticator and provides metadata about it." + ) + + +class v1AuthenticatorTransport(str, Enum): + AUTHENTICATOR_TRANSPORT_BLE = "AUTHENTICATOR_TRANSPORT_BLE" + AUTHENTICATOR_TRANSPORT_INTERNAL = "AUTHENTICATOR_TRANSPORT_INTERNAL" + AUTHENTICATOR_TRANSPORT_NFC = "AUTHENTICATOR_TRANSPORT_NFC" + AUTHENTICATOR_TRANSPORT_USB = "AUTHENTICATOR_TRANSPORT_USB" + AUTHENTICATOR_TRANSPORT_HYBRID = "AUTHENTICATOR_TRANSPORT_HYBRID" + + +class v1BootProof(TurnkeyBaseModel): + ephemeralPublicKeyHex: str = Field( + description="The hex encoded Ephemeral Public Key." + ) + awsAttestationDocB64: str = Field( + description="The DER encoded COSE Sign1 struct Attestation doc." + ) + qosManifestB64: str = Field( + description="The borsch serialized base64 encoded Manifest." + ) + qosManifestEnvelopeB64: str = Field( + description="The borsch serialized base64 encoded Manifest Envelope." + ) + deploymentLabel: str = Field( + description="The label under which the enclave app was deployed." + ) + enclaveApp: str = Field(description="Name of the enclave app") + owner: str = Field(description="Owner of the app i.e. 'tkhq'") + createdAt: externaldatav1Timestamp + + +class v1BootProofResponse(TurnkeyBaseModel): + bootProof: v1BootProof + + +class v1ClientSignature(TurnkeyBaseModel): + publicKey: str = Field( + description="The public component of a cryptographic key pair used to create the signature." + ) + scheme: v1ClientSignatureScheme = Field( + description="The signature scheme used to generate the client signature." + ) + message: str = Field(description="The message that was signed.") + signature: str = Field(description="The cryptographic signature over the message.") + + +class v1ClientSignatureScheme(str, Enum): + CLIENT_SIGNATURE_SCHEME_API_P256 = "CLIENT_SIGNATURE_SCHEME_API_P256" + + +class v1Config(TurnkeyBaseModel): + features: Optional[List[v1Feature]] = Field(default=None) + quorum: Optional[externaldatav1Quorum] = Field(default=None) + + +class v1CreateApiKeysIntent(TurnkeyBaseModel): + apiKeys: List[apiApiKeyParams] = Field(description="A list of API Keys.") + userId: str = Field(description="Unique identifier for a given User.") + + +class v1CreateApiKeysIntentV2(TurnkeyBaseModel): + apiKeys: List[v1ApiKeyParamsV2] = Field(description="A list of API Keys.") + userId: str = Field(description="Unique identifier for a given User.") + + +class v1CreateApiKeysRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateApiKeysIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateApiKeysResult(TurnkeyBaseModel): + apiKeyIds: List[str] = Field(description="A list of API Key IDs.") + + +class v1CreateApiOnlyUsersIntent(TurnkeyBaseModel): + apiOnlyUsers: List[v1ApiOnlyUserParams] = Field( + description="A list of API-only Users to create." + ) + + +class v1CreateApiOnlyUsersRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateApiOnlyUsersIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateApiOnlyUsersResult(TurnkeyBaseModel): + userIds: List[str] = Field(description="A list of API-only User IDs.") + + +class v1CreateAuthenticatorsIntent(TurnkeyBaseModel): + authenticators: List[v1AuthenticatorParams] = Field( + description="A list of Authenticators." + ) + userId: str = Field(description="Unique identifier for a given User.") + + +class v1CreateAuthenticatorsIntentV2(TurnkeyBaseModel): + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticators." + ) + userId: str = Field(description="Unique identifier for a given User.") + + +class v1CreateAuthenticatorsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateAuthenticatorsIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateAuthenticatorsResult(TurnkeyBaseModel): + authenticatorIds: List[str] = Field(description="A list of Authenticator IDs.") + + +class v1CreateFiatOnRampCredentialIntent(TurnkeyBaseModel): + onrampProvider: v1FiatOnRampProvider = Field( + description="The fiat on-ramp provider" + ) + projectId: Optional[str] = Field( + default=None, + description="Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier", + ) + publishableApiKey: str = Field( + description="Publishable API key for the on-ramp provider" + ) + encryptedSecretApiKey: str = Field( + description="Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key" + ) + encryptedPrivateApiKey: Optional[str] = Field( + default=None, + description="Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key.", + ) + sandboxMode: Optional[bool] = Field( + default=None, description="If the on-ramp credential is a sandbox credential" + ) + + +class v1CreateFiatOnRampCredentialRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateFiatOnRampCredentialIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateFiatOnRampCredentialResult(TurnkeyBaseModel): + fiatOnRampCredentialId: str = Field( + description="Unique identifier of the Fiat On-Ramp credential that was created" + ) + + +class v1CreateInvitationsIntent(TurnkeyBaseModel): + invitations: List[v1InvitationParams] = Field(description="A list of Invitations.") + + +class v1CreateInvitationsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateInvitationsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateInvitationsResult(TurnkeyBaseModel): + invitationIds: List[str] = Field(description="A list of Invitation IDs") + + +class v1CreateOauth2CredentialIntent(TurnkeyBaseModel): + provider: v1Oauth2Provider = Field(description="The OAuth 2.0 provider") + clientId: str = Field(description="The Client ID issued by the OAuth 2.0 provider") + encryptedClientSecret: str = Field( + description="The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + ) + + +class v1CreateOauth2CredentialRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateOauth2CredentialIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateOauth2CredentialResult(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="Unique identifier of the OAuth 2.0 credential that was created" + ) + + +class v1CreateOauthProvidersIntent(TurnkeyBaseModel): + userId: str = Field(description="The ID of the User to add an Oauth provider to") + oauthProviders: List[v1OauthProviderParams] = Field( + description="A list of Oauth providers." + ) + + +class v1CreateOauthProvidersRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateOauthProvidersIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateOauthProvidersResult(TurnkeyBaseModel): + providerIds: List[str] = Field( + description="A list of unique identifiers for Oauth Providers" + ) + + +class v1CreateOrganizationIntent(TurnkeyBaseModel): + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + rootEmail: str = Field(description="The root user's email address.") + rootAuthenticator: v1AuthenticatorParams = Field( + description="The root user's Authenticator." + ) + rootUserId: Optional[str] = Field( + default=None, description="Unique identifier for the root user object." + ) + + +class v1CreateOrganizationIntentV2(TurnkeyBaseModel): + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + rootEmail: str = Field(description="The root user's email address.") + rootAuthenticator: v1AuthenticatorParamsV2 = Field( + description="The root user's Authenticator." + ) + rootUserId: Optional[str] = Field( + default=None, description="Unique identifier for the root user object." + ) + + +class v1CreateOrganizationResult(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + + +class v1CreatePoliciesIntent(TurnkeyBaseModel): + policies: List[v1CreatePolicyIntentV3] = Field( + description="An array of policy intents to be created." + ) + + +class v1CreatePoliciesRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreatePoliciesIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreatePoliciesResult(TurnkeyBaseModel): + policyIds: List[str] = Field( + description="A list of unique identifiers for the created policies." + ) + + +class v1CreatePolicyIntent(TurnkeyBaseModel): + policyName: str = Field(description="Human-readable name for a Policy.") + selectors: List[v1Selector] = Field( + description="A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details." + ) + effect: v1Effect = Field( + description="The instruction to DENY or ALLOW a particular activity following policy selector(s)." + ) + notes: Optional[str] = Field(default=None) + + +class v1CreatePolicyIntentV2(TurnkeyBaseModel): + policyName: str = Field(description="Human-readable name for a Policy.") + selectors: List[v1SelectorV2] = Field( + description="A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details." + ) + effect: v1Effect = Field( + description="Whether to ALLOW or DENY requests that match the condition and consensus requirements." + ) + notes: Optional[str] = Field(default=None) + + +class v1CreatePolicyIntentV3(TurnkeyBaseModel): + policyName: str = Field(description="Human-readable name for a Policy.") + effect: v1Effect = Field( + description="The instruction to DENY or ALLOW an activity." + ) + condition: Optional[str] = Field( + default=None, description="The condition expression that triggers the Effect" + ) + consensus: Optional[str] = Field( + default=None, description="The consensus expression that triggers the Effect" + ) + notes: str = Field(description="Notes for a Policy.") + + +class v1CreatePolicyRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreatePolicyIntentV3 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreatePolicyResult(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class v1CreatePrivateKeyTagIntent(TurnkeyBaseModel): + privateKeyTagName: str = Field( + description="Human-readable name for a Private Key Tag." + ) + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class v1CreatePrivateKeyTagRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreatePrivateKeyTagIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreatePrivateKeyTagResult(TurnkeyBaseModel): + privateKeyTagId: str = Field( + description="Unique identifier for a given Private Key Tag." + ) + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class v1CreatePrivateKeysIntent(TurnkeyBaseModel): + privateKeys: List[v1PrivateKeyParams] = Field(description="A list of Private Keys.") + + +class v1CreatePrivateKeysIntentV2(TurnkeyBaseModel): + privateKeys: List[v1PrivateKeyParams] = Field(description="A list of Private Keys.") + + +class v1CreatePrivateKeysRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreatePrivateKeysIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreatePrivateKeysResult(TurnkeyBaseModel): + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class v1CreatePrivateKeysResultV2(TurnkeyBaseModel): + privateKeys: List[v1PrivateKeyResult] = Field( + description="A list of Private Key IDs and addresses." + ) + + +class v1CreateReadOnlySessionIntent(TurnkeyBaseModel): + pass + + +class v1CreateReadOnlySessionRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateReadOnlySessionIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateReadOnlySessionResult(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + ) + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + userId: str = Field(description="Unique identifier for a given User.") + username: str = Field(description="Human-readable name for a User.") + session: str = Field(description="String representing a read only session") + sessionExpiry: str = Field( + description="UTC timestamp in seconds representing the expiry time for the read only session." + ) + + +class v1CreateReadWriteSessionIntent(TurnkeyBaseModel): + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + ) + email: str = Field( + description="Email of the user to create a read write session for" + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Read Write Session - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + + +class v1CreateReadWriteSessionIntentV2(TurnkeyBaseModel): + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + ) + userId: Optional[str] = Field( + default=None, description="Unique identifier for a given User." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Read Write Session - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated ReadWriteSession API keys", + ) + + +class v1CreateReadWriteSessionRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateReadWriteSessionIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateReadWriteSessionResult(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + ) + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + userId: str = Field(description="Unique identifier for a given User.") + username: str = Field(description="Human-readable name for a User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + credentialBundle: str = Field(description="HPKE encrypted credential bundle") + + +class v1CreateReadWriteSessionResultV2(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + ) + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + userId: str = Field(description="Unique identifier for a given User.") + username: str = Field(description="Human-readable name for a User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + credentialBundle: str = Field(description="HPKE encrypted credential bundle") + + +class v1CreateSmartContractInterfaceIntent(TurnkeyBaseModel): + smartContractAddress: str = Field( + description="Corresponding contract address or program ID" + ) + smartContractInterface: str = Field( + description="ABI/IDL as a JSON string. Limited to 400kb" + ) + type: v1SmartContractInterfaceType + label: str = Field( + description="Human-readable name for a Smart Contract Interface." + ) + notes: Optional[str] = Field( + default=None, description="Notes for a Smart Contract Interface." + ) + + +class v1CreateSmartContractInterfaceRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateSmartContractInterfaceIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateSmartContractInterfaceResult(TurnkeyBaseModel): + smartContractInterfaceId: str = Field( + description="The ID of the created Smart Contract Interface." + ) + + +class v1CreateSubOrganizationIntent(TurnkeyBaseModel): + name: str = Field(description="Name for this sub-organization") + rootAuthenticator: v1AuthenticatorParamsV2 = Field( + description="Root User authenticator for this new sub-organization" + ) + + +class v1CreateSubOrganizationIntentV2(TurnkeyBaseModel): + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParams] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + + +class v1CreateSubOrganizationIntentV3(TurnkeyBaseModel): + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParams] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + privateKeys: List[v1PrivateKeyParams] = Field(description="A list of Private Keys.") + + +class v1CreateSubOrganizationIntentV4(TurnkeyBaseModel): + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParams] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + wallet: Optional[v1WalletParams] = Field( + default=None, description="The wallet to create for the sub-organization" + ) + disableEmailRecovery: Optional[bool] = Field( + default=None, description="Disable email recovery for the sub-organization" + ) + disableEmailAuth: Optional[bool] = Field( + default=None, description="Disable email auth for the sub-organization" + ) + + +class v1CreateSubOrganizationIntentV5(TurnkeyBaseModel): + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParamsV2] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + wallet: Optional[v1WalletParams] = Field( + default=None, description="The wallet to create for the sub-organization" + ) + disableEmailRecovery: Optional[bool] = Field( + default=None, description="Disable email recovery for the sub-organization" + ) + disableEmailAuth: Optional[bool] = Field( + default=None, description="Disable email auth for the sub-organization" + ) + + +class v1CreateSubOrganizationIntentV6(TurnkeyBaseModel): + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParamsV3] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + wallet: Optional[v1WalletParams] = Field( + default=None, description="The wallet to create for the sub-organization" + ) + disableEmailRecovery: Optional[bool] = Field( + default=None, description="Disable email recovery for the sub-organization" + ) + disableEmailAuth: Optional[bool] = Field( + default=None, description="Disable email auth for the sub-organization" + ) + + +class v1CreateSubOrganizationIntentV7(TurnkeyBaseModel): + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParamsV4] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + wallet: Optional[v1WalletParams] = Field( + default=None, description="The wallet to create for the sub-organization" + ) + disableEmailRecovery: Optional[bool] = Field( + default=None, description="Disable email recovery for the sub-organization" + ) + disableEmailAuth: Optional[bool] = Field( + default=None, description="Disable email auth for the sub-organization" + ) + disableSmsAuth: Optional[bool] = Field( + default=None, description="Disable OTP SMS auth for the sub-organization" + ) + disableOtpEmailAuth: Optional[bool] = Field( + default=None, description="Disable OTP email auth for the sub-organization" + ) + verificationToken: Optional[str] = Field( + default=None, + description="Signed JWT containing a unique id, expiry, verification type, contact", + ) + clientSignature: Optional[v1ClientSignature] = Field( + default=None, + description="Optional signature proving authorization for this sub-organization creation. The signature is over the verification token ID and the root user parameters for the root user associated with the verification token. Only required if a public key was provided during the verification step.", + ) + + +class v1CreateSubOrganizationRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateSubOrganizationIntentV7 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateSubOrganizationResult(TurnkeyBaseModel): + subOrganizationId: str + rootUserIds: Optional[List[str]] = Field(default=None) + + +class v1CreateSubOrganizationResultV3(TurnkeyBaseModel): + subOrganizationId: str + privateKeys: List[v1PrivateKeyResult] = Field( + description="A list of Private Key IDs and addresses." + ) + rootUserIds: Optional[List[str]] = Field(default=None) + + +class v1CreateSubOrganizationResultV4(TurnkeyBaseModel): + subOrganizationId: str + wallet: Optional[v1WalletResult] = Field(default=None) + rootUserIds: Optional[List[str]] = Field(default=None) + + +class v1CreateSubOrganizationResultV5(TurnkeyBaseModel): + subOrganizationId: str + wallet: Optional[v1WalletResult] = Field(default=None) + rootUserIds: Optional[List[str]] = Field(default=None) + + +class v1CreateSubOrganizationResultV6(TurnkeyBaseModel): + subOrganizationId: str + wallet: Optional[v1WalletResult] = Field(default=None) + rootUserIds: Optional[List[str]] = Field(default=None) + + +class v1CreateSubOrganizationResultV7(TurnkeyBaseModel): + subOrganizationId: str + wallet: Optional[v1WalletResult] = Field(default=None) + rootUserIds: Optional[List[str]] = Field(default=None) + + +class v1CreateUserTagIntent(TurnkeyBaseModel): + userTagName: str = Field(description="Human-readable name for a User Tag.") + userIds: List[str] = Field(description="A list of User IDs.") + + +class v1CreateUserTagRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateUserTagIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateUserTagResult(TurnkeyBaseModel): + userTagId: str = Field(description="Unique identifier for a given User Tag.") + userIds: List[str] = Field(description="A list of User IDs.") + + +class v1CreateUsersIntent(TurnkeyBaseModel): + users: List[v1UserParams] = Field(description="A list of Users.") + + +class v1CreateUsersIntentV2(TurnkeyBaseModel): + users: List[v1UserParamsV2] = Field(description="A list of Users.") + + +class v1CreateUsersIntentV3(TurnkeyBaseModel): + users: List[v1UserParamsV3] = Field(description="A list of Users.") + + +class v1CreateUsersRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateUsersIntentV3 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateUsersResult(TurnkeyBaseModel): + userIds: List[str] = Field(description="A list of User IDs.") + + +class v1CreateWalletAccountsIntent(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a given Wallet.") + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts." + ) + persist: Optional[bool] = Field( + default=None, + description="Indicates if the wallet accounts should be persisted. This is helpful if you'd like to see the addresses of different derivation paths without actually creating the accounts. Defaults to true.", + ) + + +class v1CreateWalletAccountsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateWalletAccountsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateWalletAccountsResult(TurnkeyBaseModel): + addresses: List[str] = Field(description="A list of derived addresses.") + + +class v1CreateWalletIntent(TurnkeyBaseModel): + walletName: str = Field(description="Human-readable name for a Wallet.") + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + ) + mnemonicLength: Optional[int] = Field( + default=None, + description="Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24.", + ) + + +class v1CreateWalletRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1CreateWalletIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1CreateWalletResult(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a Wallet.") + addresses: List[str] = Field(description="A list of account addresses.") + + +class v1CredPropsAuthenticationExtensionsClientOutputs(TurnkeyBaseModel): + rk: bool + + +class v1CredentialType(str, Enum): + CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR = "CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR" + CREDENTIAL_TYPE_API_KEY_P256 = "CREDENTIAL_TYPE_API_KEY_P256" + CREDENTIAL_TYPE_RECOVER_USER_KEY_P256 = "CREDENTIAL_TYPE_RECOVER_USER_KEY_P256" + CREDENTIAL_TYPE_API_KEY_SECP256K1 = "CREDENTIAL_TYPE_API_KEY_SECP256K1" + CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256 = "CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256" + CREDENTIAL_TYPE_API_KEY_ED25519 = "CREDENTIAL_TYPE_API_KEY_ED25519" + CREDENTIAL_TYPE_OTP_AUTH_KEY_P256 = "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256" + CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256 = ( + "CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256" + ) + CREDENTIAL_TYPE_OAUTH_KEY_P256 = "CREDENTIAL_TYPE_OAUTH_KEY_P256" + CREDENTIAL_TYPE_LOGIN = "CREDENTIAL_TYPE_LOGIN" + + +class v1Curve(str, Enum): + CURVE_SECP256K1 = "CURVE_SECP256K1" + CURVE_ED25519 = "CURVE_ED25519" + + +class v1DeleteApiKeysIntent(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + apiKeyIds: List[str] = Field(description="A list of API Key IDs.") + + +class v1DeleteApiKeysRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteApiKeysIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteApiKeysResult(TurnkeyBaseModel): + apiKeyIds: List[str] = Field(description="A list of API Key IDs.") + + +class v1DeleteAuthenticatorsIntent(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + authenticatorIds: List[str] = Field(description="A list of Authenticator IDs.") + + +class v1DeleteAuthenticatorsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteAuthenticatorsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteAuthenticatorsResult(TurnkeyBaseModel): + authenticatorIds: List[str] = Field( + description="Unique identifier for a given Authenticator." + ) + + +class v1DeleteFiatOnRampCredentialIntent(TurnkeyBaseModel): + fiatOnrampCredentialId: str = Field( + description="The ID of the fiat on-ramp credential to delete" + ) + + +class v1DeleteFiatOnRampCredentialRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteFiatOnRampCredentialIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteFiatOnRampCredentialResult(TurnkeyBaseModel): + fiatOnRampCredentialId: str = Field( + description="Unique identifier of the Fiat On-Ramp credential that was deleted" + ) + + +class v1DeleteInvitationIntent(TurnkeyBaseModel): + invitationId: str = Field( + description="Unique identifier for a given Invitation object." + ) + + +class v1DeleteInvitationRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteInvitationIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteInvitationResult(TurnkeyBaseModel): + invitationId: str = Field(description="Unique identifier for a given Invitation.") + + +class v1DeleteOauth2CredentialIntent(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="The ID of the OAuth 2.0 credential to delete" + ) + + +class v1DeleteOauth2CredentialRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteOauth2CredentialIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteOauth2CredentialResult(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="Unique identifier of the OAuth 2.0 credential that was deleted" + ) + + +class v1DeleteOauthProvidersIntent(TurnkeyBaseModel): + userId: str = Field( + description="The ID of the User to remove an Oauth provider from" + ) + providerIds: List[str] = Field( + description="Unique identifier for a given Provider." + ) + + +class v1DeleteOauthProvidersRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteOauthProvidersIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteOauthProvidersResult(TurnkeyBaseModel): + providerIds: List[str] = Field( + description="A list of unique identifiers for Oauth Providers" + ) + + +class v1DeleteOrganizationIntent(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + + +class v1DeleteOrganizationResult(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + + +class v1DeletePoliciesIntent(TurnkeyBaseModel): + policyIds: List[str] = Field( + description="List of unique identifiers for policies within an organization" + ) + + +class v1DeletePoliciesRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeletePoliciesIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeletePoliciesResult(TurnkeyBaseModel): + policyIds: List[str] = Field( + description="A list of unique identifiers for the deleted policies." + ) + + +class v1DeletePolicyIntent(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class v1DeletePolicyRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeletePolicyIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeletePolicyResult(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class v1DeletePrivateKeyTagsIntent(TurnkeyBaseModel): + privateKeyTagIds: List[str] = Field(description="A list of Private Key Tag IDs.") + + +class v1DeletePrivateKeyTagsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeletePrivateKeyTagsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeletePrivateKeyTagsResult(TurnkeyBaseModel): + privateKeyTagIds: List[str] = Field(description="A list of Private Key Tag IDs.") + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class v1DeletePrivateKeysIntent(TurnkeyBaseModel): + privateKeyIds: List[str] = Field( + description="List of unique identifiers for private keys within an organization" + ) + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored.", + ) + + +class v1DeletePrivateKeysRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeletePrivateKeysIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeletePrivateKeysResult(TurnkeyBaseModel): + privateKeyIds: List[str] = Field( + description="A list of private key unique identifiers that were removed" + ) + + +class v1DeleteSmartContractInterfaceIntent(TurnkeyBaseModel): + smartContractInterfaceId: str = Field( + description="The ID of a Smart Contract Interface intended for deletion." + ) + + +class v1DeleteSmartContractInterfaceRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteSmartContractInterfaceIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteSmartContractInterfaceResult(TurnkeyBaseModel): + smartContractInterfaceId: str = Field( + description="The ID of the deleted Smart Contract Interface." + ) + + +class v1DeleteSubOrganizationIntent(TurnkeyBaseModel): + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false.", + ) + + +class v1DeleteSubOrganizationRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteSubOrganizationIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteSubOrganizationResult(TurnkeyBaseModel): + subOrganizationUuid: str = Field( + description="Unique identifier of the sub organization that was removed" + ) + + +class v1DeleteUserTagsIntent(TurnkeyBaseModel): + userTagIds: List[str] = Field(description="A list of User Tag IDs.") + + +class v1DeleteUserTagsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteUserTagsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteUserTagsResult(TurnkeyBaseModel): + userTagIds: List[str] = Field(description="A list of User Tag IDs.") + userIds: List[str] = Field(description="A list of User IDs.") + + +class v1DeleteUsersIntent(TurnkeyBaseModel): + userIds: List[str] = Field(description="A list of User IDs.") + + +class v1DeleteUsersRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteUsersIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteUsersResult(TurnkeyBaseModel): + userIds: List[str] = Field(description="A list of User IDs.") + + +class v1DeleteWalletAccountsIntent(TurnkeyBaseModel): + walletAccountIds: List[str] = Field( + description="List of unique identifiers for wallet accounts within an organization" + ) + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Optional parameter for deleting the wallet accounts, even if any have not been previously exported. If they have been exported, this field is ignored.", + ) + + +class v1DeleteWalletAccountsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteWalletAccountsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteWalletAccountsResult(TurnkeyBaseModel): + walletAccountIds: List[str] = Field( + description="A list of wallet account unique identifiers that were removed" + ) + + +class v1DeleteWalletsIntent(TurnkeyBaseModel): + walletIds: List[str] = Field( + description="List of unique identifiers for wallets within an organization" + ) + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored.", + ) + + +class v1DeleteWalletsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1DeleteWalletsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1DeleteWalletsResult(TurnkeyBaseModel): + walletIds: List[str] = Field( + description="A list of wallet unique identifiers that were removed" + ) + + +class v1DisableAuthProxyIntent(TurnkeyBaseModel): + pass + + +class v1DisableAuthProxyResult(TurnkeyBaseModel): + pass + + +class v1DisablePrivateKeyIntent(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + + +class v1DisablePrivateKeyResult(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + + +class v1Effect(str, Enum): + EFFECT_ALLOW = "EFFECT_ALLOW" + EFFECT_DENY = "EFFECT_DENY" + + +class v1EmailAuthCustomizationParams(TurnkeyBaseModel): + appName: str = Field( + description="The name of the application. This field is required and will be used in email notifications if an email template is not provided." + ) + logoUrl: Optional[str] = Field( + default=None, + description="A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.", + ) + magicLinkTemplate: Optional[str] = Field( + default=None, + description="A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`.", + ) + templateVariables: Optional[str] = Field( + default=None, + description="JSON object containing key/value pairs to be used with custom templates.", + ) + templateId: Optional[str] = Field( + default=None, + description="Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.", + ) + + +class v1EmailAuthIntent(TurnkeyBaseModel): + email: str = Field(description="Email of the authenticating user.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Email Auth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Email Auth API keys", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1EmailAuthIntentV2(TurnkeyBaseModel): + email: str = Field(description="Email of the authenticating user.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Email Auth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Email Auth API keys", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1EmailAuthIntentV3(TurnkeyBaseModel): + email: str = Field(description="Email of the authenticating user.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Email Auth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: v1EmailAuthCustomizationParams = Field( + description="Parameters for customizing emails. If not provided, the default email will be used. Note that app_name is required." + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Email Auth API keys", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1EmailAuthRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1EmailAuthIntentV3 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1EmailAuthResult(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for the authenticating User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + + +class v1EmailCustomizationParams(TurnkeyBaseModel): + appName: Optional[str] = Field( + default=None, description="The name of the application." + ) + logoUrl: Optional[str] = Field( + default=None, + description="A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.", + ) + magicLinkTemplate: Optional[str] = Field( + default=None, + description="A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`.", + ) + templateVariables: Optional[str] = Field( + default=None, + description="JSON object containing key/value pairs to be used with custom templates.", + ) + templateId: Optional[str] = Field( + default=None, + description="Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.", + ) + + +class v1EmailCustomizationParamsV2(TurnkeyBaseModel): + logoUrl: Optional[str] = Field( + default=None, + description="A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px.", + ) + magicLinkTemplate: Optional[str] = Field( + default=None, + description="A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`.", + ) + templateVariables: Optional[str] = Field( + default=None, + description="JSON object containing key/value pairs to be used with custom templates.", + ) + templateId: Optional[str] = Field( + default=None, + description="Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template.", + ) + + +class v1EnableAuthProxyIntent(TurnkeyBaseModel): + pass + + +class v1EnableAuthProxyResult(TurnkeyBaseModel): + userId: str = Field( + description="A User ID with permission to initiate authentication." + ) + + +class v1EthSendRawTransactionIntent(TurnkeyBaseModel): + signedTransaction: str = Field( + description="The raw, signed transaction to be sent." + ) + caip2: str = Field( + description="CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet)." + ) + + +class v1EthSendRawTransactionRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1EthSendRawTransactionIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1EthSendRawTransactionResult(TurnkeyBaseModel): + transactionHash: str = Field( + description="The transaction hash of the sent transaction" + ) + + +class v1EthSendTransactionIntent(TurnkeyBaseModel): + from_: str = Field( + alias="from", + description="A wallet or private key address to sign with. This does not support private key IDs.", + ) + sponsor: Optional[bool] = Field( + default=None, description="Whether to sponsor this transaction via Gas Station." + ) + caip2: str = Field( + description="CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet)." + ) + to: str = Field(description="Recipient address as a hex string with 0x prefix.") + value: Optional[str] = Field( + default=None, description="Amount of native asset to send in wei." + ) + data: Optional[str] = Field( + default=None, description="Hex-encoded call data for contract interactions." + ) + nonce: Optional[str] = Field( + default=None, + description="Transaction nonce, for EIP-1559 and Turnkey Gas Station authorizations.", + ) + gasLimit: Optional[str] = Field( + default=None, + description="Maximum amount of gas to use for this transaction, for EIP-1559 transactions.", + ) + maxFeePerGas: Optional[str] = Field( + default=None, + description="Maximum total fee per gas unit (base fee + priority fee) in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions.", + ) + maxPriorityFeePerGas: Optional[str] = Field( + default=None, + description="Maximum priority fee (tip) per gas unit in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions.", + ) + gasStationNonce: Optional[str] = Field( + default=None, + description="The gas station delegate contract nonce. Only used when sponsor=true. Include this if you want maximal security posture.", + ) + + +class v1EthSendTransactionRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1EthSendTransactionIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1EthSendTransactionResult(TurnkeyBaseModel): + sendTransactionStatusId: str = Field( + description="The send_transaction_status ID associated with the transaction submission for sponsored transactions" + ) + + +class v1EthSendTransactionStatus(TurnkeyBaseModel): + txHash: Optional[str] = Field( + default=None, description="The Ethereum transaction hash, if available." + ) + + +class v1ExportPrivateKeyIntent(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the export bundle will be encrypted." + ) + + +class v1ExportPrivateKeyRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1ExportPrivateKeyIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1ExportPrivateKeyResult(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + exportBundle: str = Field( + description="Export bundle containing a private key encrypted to the client's target public key." + ) + + +class v1ExportWalletAccountIntent(TurnkeyBaseModel): + address: str = Field(description="Address to identify Wallet Account.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the export bundle will be encrypted." + ) + + +class v1ExportWalletAccountRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1ExportWalletAccountIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1ExportWalletAccountResult(TurnkeyBaseModel): + address: str = Field(description="Address to identify Wallet Account.") + exportBundle: str = Field( + description="Export bundle containing a private key encrypted by the client's target public key." + ) + + +class v1ExportWalletIntent(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a given Wallet.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the export bundle will be encrypted." + ) + language: Optional[v1MnemonicLanguage] = Field( + default=None, + description="The language of the mnemonic to export. Defaults to English.", + ) + + +class v1ExportWalletRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1ExportWalletIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1ExportWalletResult(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a given Wallet.") + exportBundle: str = Field( + description="Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key." + ) + + +class v1Feature(TurnkeyBaseModel): + name: Optional[v1FeatureName] = Field(default=None) + value: Optional[str] = Field(default=None) + + +class v1FeatureName(str, Enum): + FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY = "FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY" + FEATURE_NAME_WEBAUTHN_ORIGINS = "FEATURE_NAME_WEBAUTHN_ORIGINS" + FEATURE_NAME_EMAIL_AUTH = "FEATURE_NAME_EMAIL_AUTH" + FEATURE_NAME_EMAIL_RECOVERY = "FEATURE_NAME_EMAIL_RECOVERY" + FEATURE_NAME_WEBHOOK = "FEATURE_NAME_WEBHOOK" + FEATURE_NAME_SMS_AUTH = "FEATURE_NAME_SMS_AUTH" + FEATURE_NAME_OTP_EMAIL_AUTH = "FEATURE_NAME_OTP_EMAIL_AUTH" + FEATURE_NAME_AUTH_PROXY = "FEATURE_NAME_AUTH_PROXY" + + +class v1FiatOnRampBlockchainNetwork(str, Enum): + FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN" + FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM = ( + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM" + ) + FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA" + FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE = "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE" + + +class v1FiatOnRampCredential(TurnkeyBaseModel): + fiatOnrampCredentialId: str = Field( + description="Unique identifier for a given Fiat On-Ramp Credential." + ) + organizationId: str = Field(description="Unique identifier for an Organization.") + onrampProvider: v1FiatOnRampProvider = Field( + description="The fiat on-ramp provider." + ) + projectId: Optional[str] = Field( + default=None, + description="Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier.", + ) + publishableApiKey: str = Field( + description="Publishable API key for the on-ramp provider." + ) + encryptedSecretApiKey: str = Field( + description="Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key." + ) + encryptedPrivateApiKey: Optional[str] = Field( + default=None, + description="Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key.", + ) + sandboxMode: Optional[bool] = Field( + default=None, description="If the on-ramp credential is a sandbox credential." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class v1FiatOnRampCryptoCurrency(str, Enum): + FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC = "FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC" + FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH = "FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH" + FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL = "FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL" + FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC = "FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC" + + +class v1FiatOnRampCurrency(str, Enum): + FIAT_ON_RAMP_CURRENCY_AUD = "FIAT_ON_RAMP_CURRENCY_AUD" + FIAT_ON_RAMP_CURRENCY_BGN = "FIAT_ON_RAMP_CURRENCY_BGN" + FIAT_ON_RAMP_CURRENCY_BRL = "FIAT_ON_RAMP_CURRENCY_BRL" + FIAT_ON_RAMP_CURRENCY_CAD = "FIAT_ON_RAMP_CURRENCY_CAD" + FIAT_ON_RAMP_CURRENCY_CHF = "FIAT_ON_RAMP_CURRENCY_CHF" + FIAT_ON_RAMP_CURRENCY_COP = "FIAT_ON_RAMP_CURRENCY_COP" + FIAT_ON_RAMP_CURRENCY_CZK = "FIAT_ON_RAMP_CURRENCY_CZK" + FIAT_ON_RAMP_CURRENCY_DKK = "FIAT_ON_RAMP_CURRENCY_DKK" + FIAT_ON_RAMP_CURRENCY_DOP = "FIAT_ON_RAMP_CURRENCY_DOP" + FIAT_ON_RAMP_CURRENCY_EGP = "FIAT_ON_RAMP_CURRENCY_EGP" + FIAT_ON_RAMP_CURRENCY_EUR = "FIAT_ON_RAMP_CURRENCY_EUR" + FIAT_ON_RAMP_CURRENCY_GBP = "FIAT_ON_RAMP_CURRENCY_GBP" + FIAT_ON_RAMP_CURRENCY_HKD = "FIAT_ON_RAMP_CURRENCY_HKD" + FIAT_ON_RAMP_CURRENCY_IDR = "FIAT_ON_RAMP_CURRENCY_IDR" + FIAT_ON_RAMP_CURRENCY_ILS = "FIAT_ON_RAMP_CURRENCY_ILS" + FIAT_ON_RAMP_CURRENCY_JOD = "FIAT_ON_RAMP_CURRENCY_JOD" + FIAT_ON_RAMP_CURRENCY_KES = "FIAT_ON_RAMP_CURRENCY_KES" + FIAT_ON_RAMP_CURRENCY_KWD = "FIAT_ON_RAMP_CURRENCY_KWD" + FIAT_ON_RAMP_CURRENCY_LKR = "FIAT_ON_RAMP_CURRENCY_LKR" + FIAT_ON_RAMP_CURRENCY_MXN = "FIAT_ON_RAMP_CURRENCY_MXN" + FIAT_ON_RAMP_CURRENCY_NGN = "FIAT_ON_RAMP_CURRENCY_NGN" + FIAT_ON_RAMP_CURRENCY_NOK = "FIAT_ON_RAMP_CURRENCY_NOK" + FIAT_ON_RAMP_CURRENCY_NZD = "FIAT_ON_RAMP_CURRENCY_NZD" + FIAT_ON_RAMP_CURRENCY_OMR = "FIAT_ON_RAMP_CURRENCY_OMR" + FIAT_ON_RAMP_CURRENCY_PEN = "FIAT_ON_RAMP_CURRENCY_PEN" + FIAT_ON_RAMP_CURRENCY_PLN = "FIAT_ON_RAMP_CURRENCY_PLN" + FIAT_ON_RAMP_CURRENCY_RON = "FIAT_ON_RAMP_CURRENCY_RON" + FIAT_ON_RAMP_CURRENCY_SEK = "FIAT_ON_RAMP_CURRENCY_SEK" + FIAT_ON_RAMP_CURRENCY_THB = "FIAT_ON_RAMP_CURRENCY_THB" + FIAT_ON_RAMP_CURRENCY_TRY = "FIAT_ON_RAMP_CURRENCY_TRY" + FIAT_ON_RAMP_CURRENCY_TWD = "FIAT_ON_RAMP_CURRENCY_TWD" + FIAT_ON_RAMP_CURRENCY_USD = "FIAT_ON_RAMP_CURRENCY_USD" + FIAT_ON_RAMP_CURRENCY_VND = "FIAT_ON_RAMP_CURRENCY_VND" + FIAT_ON_RAMP_CURRENCY_ZAR = "FIAT_ON_RAMP_CURRENCY_ZAR" + + +class v1FiatOnRampPaymentMethod(str, Enum): + FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY = "FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY" + FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY = "FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY" + FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL = "FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL" + FIAT_ON_RAMP_PAYMENT_METHOD_VENMO = "FIAT_ON_RAMP_PAYMENT_METHOD_VENMO" + FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT" + ) + FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET = "FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET" + FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT = ( + "FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT" + ) + + +class v1FiatOnRampProvider(str, Enum): + FIAT_ON_RAMP_PROVIDER_COINBASE = "FIAT_ON_RAMP_PROVIDER_COINBASE" + FIAT_ON_RAMP_PROVIDER_MOONPAY = "FIAT_ON_RAMP_PROVIDER_MOONPAY" + + +class v1GetActivitiesRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + filterByStatus: Optional[List[v1ActivityStatus]] = Field( + default=None, + description="Array of activity statuses filtering which activities will be listed in the response.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + filterByType: Optional[List[v1ActivityType]] = Field( + default=None, + description="Array of activity types filtering which activities will be listed in the response.", + ) + + +class v1GetActivitiesResponse(TurnkeyBaseModel): + activities: List[v1Activity] = Field(description="A list of activities.") + + +class v1GetActivityRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + activityId: str = Field( + description="Unique identifier for a given activity object." + ) + + +class v1GetApiKeyRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + apiKeyId: str = Field(description="Unique identifier for a given API key.") + + +class v1GetApiKeyResponse(TurnkeyBaseModel): + apiKey: v1ApiKey = Field(description="An API key.") + + +class v1GetApiKeysRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + userId: Optional[str] = Field( + default=None, description="Unique identifier for a given user." + ) + + +class v1GetApiKeysResponse(TurnkeyBaseModel): + apiKeys: List[v1ApiKey] = Field(description="A list of API keys.") + + +class v1GetAppProofsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + activityId: str = Field(description="Unique identifier for a given activity.") + + +class v1GetAppProofsResponse(TurnkeyBaseModel): + appProofs: List[v1AppProof] + + +class v1GetAttestationDocumentRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + enclaveType: str = Field( + description="The enclave type, one of: ump, notarizer, signer, evm-parser." + ) + + +class v1GetAttestationDocumentResponse(TurnkeyBaseModel): + attestationDocument: str = Field( + description="Raw (CBOR-encoded) attestation document." + ) + + +class v1GetAuthenticatorRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + authenticatorId: str = Field( + description="Unique identifier for a given authenticator." + ) + + +class v1GetAuthenticatorResponse(TurnkeyBaseModel): + authenticator: v1Authenticator = Field(description="An authenticator.") + + +class v1GetAuthenticatorsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + userId: str = Field(description="Unique identifier for a given user.") + + +class v1GetAuthenticatorsResponse(TurnkeyBaseModel): + authenticators: List[v1Authenticator] = Field( + description="A list of authenticators." + ) + + +class v1GetBootProofRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + ephemeralKey: str = Field(description="Hex encoded ephemeral public key.") + + +class v1GetGasUsageRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + + +class v1GetGasUsageResponse(TurnkeyBaseModel): + windowDurationMinutes: int = Field( + description="The window duration (in minutes) for the organization or sub-organization." + ) + windowLimitUsd: str = Field( + description="The window limit (in USD) for the organization or sub-organization." + ) + usageUsd: str = Field( + description="The total gas usage (in USD) of all sponsored transactions processed over the last `window_duration_minutes`" + ) + + +class v1GetLatestBootProofRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + appName: str = Field(description="Name of enclave app.") + + +class v1GetNoncesRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + address: str = Field(description="The Ethereum address to query nonces for.") + caip2: str = Field( + description="The network identifier in CAIP-2 format (e.g., 'eip155:1' for Ethereum mainnet)." + ) + nonce: Optional[bool] = Field( + default=None, description="Whether to fetch the standard on-chain nonce." + ) + gasStationNonce: Optional[bool] = Field( + default=None, + description="Whether to fetch the gas station nonce used for sponsored transactions.", + ) + + +class v1GetNoncesResponse(TurnkeyBaseModel): + nonce: Optional[str] = Field( + default=None, + description="The standard on-chain nonce for the address, if requested.", + ) + gasStationNonce: Optional[str] = Field( + default=None, + description="The gas station nonce for sponsored transactions, if requested.", + ) + + +class v1GetOauth2CredentialRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + oauth2CredentialId: str = Field( + description="Unique identifier for a given OAuth 2.0 Credential." + ) + + +class v1GetOauth2CredentialResponse(TurnkeyBaseModel): + oauth2Credential: v1Oauth2Credential + + +class v1GetOauthProvidersRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + userId: Optional[str] = Field( + default=None, description="Unique identifier for a given user." + ) + + +class v1GetOauthProvidersResponse(TurnkeyBaseModel): + oauthProviders: List[v1OauthProvider] = Field( + description="A list of Oauth providers." + ) + + +class v1GetOnRampTransactionStatusRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + transactionId: str = Field( + description="The unique identifier for the fiat on ramp transaction." + ) + refresh: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the transaction status should be refreshed from the fiat on ramp provider. Default = false.", + ) + + +class v1GetOnRampTransactionStatusResponse(TurnkeyBaseModel): + transactionStatus: str = Field( + description="The status of the fiat on ramp transaction." + ) + + +class v1GetOrganizationConfigsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetOrganizationConfigsResponse(TurnkeyBaseModel): + configs: v1Config = Field( + description="Organization configs including quorum settings and organization features." + ) + + +class v1GetOrganizationRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetOrganizationResponse(TurnkeyBaseModel): + organizationData: v1OrganizationData = Field( + description="Object representing the full current and deleted / disabled collection of users, policies, private keys, and invitations attributable to a particular organization." + ) + + +class v1GetPoliciesRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetPoliciesResponse(TurnkeyBaseModel): + policies: List[v1Policy] = Field(description="A list of policies.") + + +class v1GetPolicyEvaluationsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + activityId: str = Field(description="Unique identifier for a given activity.") + + +class v1GetPolicyEvaluationsResponse(TurnkeyBaseModel): + policyEvaluations: List[externalactivityv1PolicyEvaluation] + + +class v1GetPolicyRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + policyId: str = Field(description="Unique identifier for a given policy.") + + +class v1GetPolicyResponse(TurnkeyBaseModel): + policy: v1Policy = Field( + description="Object that codifies rules defining the actions that are permissible within an organization." + ) + + +class v1GetPrivateKeyRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + privateKeyId: str = Field(description="Unique identifier for a given private key.") + + +class v1GetPrivateKeyResponse(TurnkeyBaseModel): + privateKey: v1PrivateKey = Field( + description="Cryptographic public/private key pair that can be used for cryptocurrency needs or more generalized encryption." + ) + + +class v1GetPrivateKeysRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetPrivateKeysResponse(TurnkeyBaseModel): + privateKeys: List[v1PrivateKey] = Field(description="A list of private keys.") + + +class v1GetSendTransactionStatusRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + sendTransactionStatusId: str = Field( + description="The unique identifier of a send transaction request." + ) + + +class v1GetSendTransactionStatusResponse(TurnkeyBaseModel): + txStatus: str = Field(description="The current status of the send transaction.") + eth: Optional[v1EthSendTransactionStatus] = Field( + default=None, description="Ethereum-specific transaction status." + ) + txError: Optional[str] = Field( + default=None, + description="The error encountered when broadcasting or confirming the transaction, if any.", + ) + + +class v1GetSmartContractInterfaceRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + smartContractInterfaceId: str = Field( + description="Unique identifier for a given smart contract interface." + ) + + +class v1GetSmartContractInterfaceResponse(TurnkeyBaseModel): + smartContractInterface: externaldatav1SmartContractInterface = Field( + description="Object to be used in conjunction with policies to guard transaction signing." + ) + + +class v1GetSmartContractInterfacesRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetSmartContractInterfacesResponse(TurnkeyBaseModel): + smartContractInterfaces: List[externaldatav1SmartContractInterface] = Field( + description="A list of smart contract interfaces." + ) + + +class v1GetSubOrgIdsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for the parent organization. This is used to find sub-organizations within it." + ) + filterType: Optional[str] = Field( + default=None, + description="Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY'", + ) + filterValue: Optional[str] = Field( + default=None, + description="The value of the filter to apply for the specified type. For example, a specific email or name string.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + + +class v1GetSubOrgIdsResponse(TurnkeyBaseModel): + organizationIds: List[str] = Field( + description="List of unique identifiers for the matching sub-organizations." + ) + + +class v1GetUserRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + userId: str = Field(description="Unique identifier for a given user.") + + +class v1GetUserResponse(TurnkeyBaseModel): + user: v1User = Field(description="Web and/or API user within your organization.") + + +class v1GetUsersRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetUsersResponse(TurnkeyBaseModel): + users: List[v1User] = Field(description="A list of users.") + + +class v1GetVerifiedSubOrgIdsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for the parent organization. This is used to find sub-organizations within it." + ) + filterType: Optional[str] = Field( + default=None, + description="Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'.", + ) + filterValue: Optional[str] = Field( + default=None, + description="The value of the filter to apply for the specified type. For example, a specific email or phone number string.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + + +class v1GetVerifiedSubOrgIdsResponse(TurnkeyBaseModel): + organizationIds: List[str] = Field( + description="List of unique identifiers for the matching sub-organizations." + ) + + +class v1GetWalletAccountRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + walletId: str = Field(description="Unique identifier for a given wallet.") + address: Optional[str] = Field( + default=None, description="Address corresponding to a wallet account." + ) + path: Optional[str] = Field( + default=None, description="Path corresponding to a wallet account." + ) + + +class v1GetWalletAccountResponse(TurnkeyBaseModel): + account: v1WalletAccount = Field(description="The resulting wallet account.") + + +class v1GetWalletAccountsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + walletId: Optional[str] = Field( + default=None, + description="Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned.", + ) + includeWalletDetails: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the wallet details should be included in the response. Default = false.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + + +class v1GetWalletAccountsResponse(TurnkeyBaseModel): + accounts: List[v1WalletAccount] = Field( + description="A list of accounts generated from a wallet that share a common seed." + ) + + +class v1GetWalletRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + walletId: str = Field(description="Unique identifier for a given wallet.") + + +class v1GetWalletResponse(TurnkeyBaseModel): + wallet: v1Wallet = Field( + description="A collection of deterministically generated cryptographic public / private key pairs that share a common seed." + ) + + +class v1GetWalletsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1GetWalletsResponse(TurnkeyBaseModel): + wallets: List[v1Wallet] = Field(description="A list of wallets.") + + +class v1GetWhoamiRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." + ) + + +class v1GetWhoamiResponse(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + organizationName: str = Field( + description="Human-readable name for an organization." + ) + userId: str = Field(description="Unique identifier for a given user.") + username: str = Field(description="Human-readable name for a user.") + + +class v1HashFunction(str, Enum): + HASH_FUNCTION_NO_OP = "HASH_FUNCTION_NO_OP" + HASH_FUNCTION_SHA256 = "HASH_FUNCTION_SHA256" + HASH_FUNCTION_KECCAK256 = "HASH_FUNCTION_KECCAK256" + HASH_FUNCTION_NOT_APPLICABLE = "HASH_FUNCTION_NOT_APPLICABLE" + + +class v1ImportPrivateKeyIntent(TurnkeyBaseModel): + userId: str = Field(description="The ID of the User importing a Private Key.") + privateKeyName: str = Field(description="Human-readable name for a Private Key.") + encryptedBundle: str = Field( + description="Bundle containing a raw private key encrypted to the enclave's target public key." + ) + curve: v1Curve = Field( + description="Cryptographic Curve used to generate a given Private Key." + ) + addressFormats: List[v1AddressFormat] = Field( + description="Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + ) + + +class v1ImportPrivateKeyRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1ImportPrivateKeyIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1ImportPrivateKeyResult(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a Private Key.") + addresses: List[immutableactivityv1Address] = Field( + description="A list of addresses." + ) + + +class v1ImportWalletIntent(TurnkeyBaseModel): + userId: str = Field(description="The ID of the User importing a Wallet.") + walletName: str = Field(description="Human-readable name for a Wallet.") + encryptedBundle: str = Field( + description="Bundle containing a wallet mnemonic encrypted to the enclave's target public key." + ) + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts." + ) + + +class v1ImportWalletRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1ImportWalletIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1ImportWalletResult(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a Wallet.") + addresses: List[str] = Field(description="A list of account addresses.") + + +class v1InitFiatOnRampIntent(TurnkeyBaseModel): + onrampProvider: v1FiatOnRampProvider = Field( + description="Enum to specifiy which on-ramp provider to use" + ) + walletAddress: str = Field( + description="Destination wallet address for the buy transaction." + ) + network: v1FiatOnRampBlockchainNetwork = Field( + description="Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork." + ) + cryptoCurrencyCode: v1FiatOnRampCryptoCurrency = Field( + description="Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset." + ) + fiatCurrencyCode: Optional[v1FiatOnRampCurrency] = Field( + default=None, + description="Code for the fiat currency to be used in the transaction, e.g., USD, EUR.", + ) + fiatCurrencyAmount: Optional[str] = Field( + default=None, + description="Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount.", + ) + paymentMethod: Optional[v1FiatOnRampPaymentMethod] = Field( + default=None, + description="Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider.", + ) + countryCode: Optional[str] = Field( + default=None, + description="ISO 3166-1 two-digit country code for Coinbase representing the purchasing userโ€™s country of residence, e.g., US, GB.", + ) + countrySubdivisionCode: Optional[str] = Field( + default=None, + description="ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing userโ€™s subdivision of residence within their country, e.g. NY. Required if country_code=US.", + ) + sandboxMode: Optional[bool] = Field( + default=None, + description="Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false.", + ) + urlForSignature: Optional[str] = Field( + default=None, + description="Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled.", + ) + + +class v1InitFiatOnRampRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1InitFiatOnRampIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1InitFiatOnRampResult(TurnkeyBaseModel): + onRampUrl: str = Field(description="Unique URL for a given fiat on-ramp flow.") + onRampTransactionId: str = Field( + description="Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow." + ) + onRampUrlSignature: Optional[str] = Field( + default=None, + description="Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project.", + ) + + +class v1InitImportPrivateKeyIntent(TurnkeyBaseModel): + userId: str = Field(description="The ID of the User importing a Private Key.") + + +class v1InitImportPrivateKeyRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1InitImportPrivateKeyIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1InitImportPrivateKeyResult(TurnkeyBaseModel): + importBundle: str = Field( + description="Import bundle containing a public key and signature to use for importing client data." + ) + + +class v1InitImportWalletIntent(TurnkeyBaseModel): + userId: str = Field(description="The ID of the User importing a Wallet.") + + +class v1InitImportWalletRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1InitImportWalletIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1InitImportWalletResult(TurnkeyBaseModel): + importBundle: str = Field( + description="Import bundle containing a public key and signature to use for importing client data." + ) + + +class v1InitOtpAuthIntent(TurnkeyBaseModel): + otpType: str = Field( + description="Enum to specifiy whether to send OTP via SMS or email" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + emailCustomization: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default sms message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitOtpAuthIntentV2(TurnkeyBaseModel): + otpType: str = Field( + description="Enum to specifiy whether to send OTP via SMS or email" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + otpLength: Optional[int] = Field( + default=None, description="Optional length of the OTP code. Default = 9" + ) + emailCustomization: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default SMS message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + alphanumeric: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitOtpAuthIntentV3(TurnkeyBaseModel): + otpType: str = Field( + description="Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + otpLength: Optional[int] = Field( + default=None, description="Optional length of the OTP code. Default = 9" + ) + appName: str = Field( + description="The name of the application. This field is required and will be used in email notifications if an email template is not provided." + ) + emailCustomization: Optional[v1EmailCustomizationParamsV2] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default SMS message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + alphanumeric: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitOtpAuthRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1InitOtpAuthIntentV3 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1InitOtpAuthResult(TurnkeyBaseModel): + otpId: str = Field(description="Unique identifier for an OTP authentication") + + +class v1InitOtpAuthResultV2(TurnkeyBaseModel): + otpId: str = Field(description="Unique identifier for an OTP authentication") + + +class v1InitOtpIntent(TurnkeyBaseModel): + otpType: str = Field( + description="Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + otpLength: Optional[int] = Field( + default=None, description="Optional length of the OTP code. Default = 9" + ) + emailCustomization: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default sms message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + alphanumeric: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitOtpIntentV2(TurnkeyBaseModel): + otpType: str = Field( + description="Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + otpLength: Optional[int] = Field( + default=None, description="Optional length of the OTP code. Default = 9" + ) + appName: str = Field( + description="The name of the application. This field is required and will be used in email notifications if an email template is not provided." + ) + emailCustomization: Optional[v1EmailCustomizationParamsV2] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default SMS message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + alphanumeric: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitOtpRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1InitOtpIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1InitOtpResult(TurnkeyBaseModel): + otpId: str = Field(description="Unique identifier for an OTP authentication") + + +class v1InitUserEmailRecoveryIntent(TurnkeyBaseModel): + email: str = Field(description="Email of the user starting recovery") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the recovery bundle will be encrypted." + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitUserEmailRecoveryIntentV2(TurnkeyBaseModel): + email: str = Field(description="Email of the user starting recovery") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the recovery bundle will be encrypted." + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: v1EmailAuthCustomizationParams = Field( + description="Parameters for customizing emails. If not provided, the default email will be used. Note that `app_name` is required." + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class v1InitUserEmailRecoveryRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1InitUserEmailRecoveryIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1InitUserEmailRecoveryResult(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for the user being recovered.") + + +class v1Intent(TurnkeyBaseModel): + createOrganizationIntent: Optional[v1CreateOrganizationIntent] = Field(default=None) + createAuthenticatorsIntent: Optional[v1CreateAuthenticatorsIntent] = Field( + default=None + ) + createUsersIntent: Optional[v1CreateUsersIntent] = Field(default=None) + createPrivateKeysIntent: Optional[v1CreatePrivateKeysIntent] = Field(default=None) + signRawPayloadIntent: Optional[v1SignRawPayloadIntent] = Field(default=None) + createInvitationsIntent: Optional[v1CreateInvitationsIntent] = Field(default=None) + acceptInvitationIntent: Optional[v1AcceptInvitationIntent] = Field(default=None) + createPolicyIntent: Optional[v1CreatePolicyIntent] = Field(default=None) + disablePrivateKeyIntent: Optional[v1DisablePrivateKeyIntent] = Field(default=None) + deleteUsersIntent: Optional[v1DeleteUsersIntent] = Field(default=None) + deleteAuthenticatorsIntent: Optional[v1DeleteAuthenticatorsIntent] = Field( + default=None + ) + deleteInvitationIntent: Optional[v1DeleteInvitationIntent] = Field(default=None) + deleteOrganizationIntent: Optional[v1DeleteOrganizationIntent] = Field(default=None) + deletePolicyIntent: Optional[v1DeletePolicyIntent] = Field(default=None) + createUserTagIntent: Optional[v1CreateUserTagIntent] = Field(default=None) + deleteUserTagsIntent: Optional[v1DeleteUserTagsIntent] = Field(default=None) + signTransactionIntent: Optional[v1SignTransactionIntent] = Field(default=None) + createApiKeysIntent: Optional[v1CreateApiKeysIntent] = Field(default=None) + deleteApiKeysIntent: Optional[v1DeleteApiKeysIntent] = Field(default=None) + approveActivityIntent: Optional[v1ApproveActivityIntent] = Field(default=None) + rejectActivityIntent: Optional[v1RejectActivityIntent] = Field(default=None) + createPrivateKeyTagIntent: Optional[v1CreatePrivateKeyTagIntent] = Field( + default=None + ) + deletePrivateKeyTagsIntent: Optional[v1DeletePrivateKeyTagsIntent] = Field( + default=None + ) + createPolicyIntentV2: Optional[v1CreatePolicyIntentV2] = Field(default=None) + setPaymentMethodIntent: Optional[billingSetPaymentMethodIntent] = Field( + default=None + ) + activateBillingTierIntent: Optional[billingActivateBillingTierIntent] = Field( + default=None + ) + deletePaymentMethodIntent: Optional[billingDeletePaymentMethodIntent] = Field( + default=None + ) + createPolicyIntentV3: Optional[v1CreatePolicyIntentV3] = Field(default=None) + createApiOnlyUsersIntent: Optional[v1CreateApiOnlyUsersIntent] = Field(default=None) + updateRootQuorumIntent: Optional[v1UpdateRootQuorumIntent] = Field(default=None) + updateUserTagIntent: Optional[v1UpdateUserTagIntent] = Field(default=None) + updatePrivateKeyTagIntent: Optional[v1UpdatePrivateKeyTagIntent] = Field( + default=None + ) + createAuthenticatorsIntentV2: Optional[v1CreateAuthenticatorsIntentV2] = Field( + default=None + ) + acceptInvitationIntentV2: Optional[v1AcceptInvitationIntentV2] = Field(default=None) + createOrganizationIntentV2: Optional[v1CreateOrganizationIntentV2] = Field( + default=None + ) + createUsersIntentV2: Optional[v1CreateUsersIntentV2] = Field(default=None) + createSubOrganizationIntent: Optional[v1CreateSubOrganizationIntent] = Field( + default=None + ) + createSubOrganizationIntentV2: Optional[v1CreateSubOrganizationIntentV2] = Field( + default=None + ) + updateAllowedOriginsIntent: Optional[v1UpdateAllowedOriginsIntent] = Field( + default=None + ) + createPrivateKeysIntentV2: Optional[v1CreatePrivateKeysIntentV2] = Field( + default=None + ) + updateUserIntent: Optional[v1UpdateUserIntent] = Field(default=None) + updatePolicyIntent: Optional[v1UpdatePolicyIntent] = Field(default=None) + setPaymentMethodIntentV2: Optional[billingSetPaymentMethodIntentV2] = Field( + default=None + ) + createSubOrganizationIntentV3: Optional[v1CreateSubOrganizationIntentV3] = Field( + default=None + ) + createWalletIntent: Optional[v1CreateWalletIntent] = Field(default=None) + createWalletAccountsIntent: Optional[v1CreateWalletAccountsIntent] = Field( + default=None + ) + initUserEmailRecoveryIntent: Optional[v1InitUserEmailRecoveryIntent] = Field( + default=None + ) + recoverUserIntent: Optional[v1RecoverUserIntent] = Field(default=None) + setOrganizationFeatureIntent: Optional[v1SetOrganizationFeatureIntent] = Field( + default=None + ) + removeOrganizationFeatureIntent: Optional[v1RemoveOrganizationFeatureIntent] = ( + Field(default=None) + ) + signRawPayloadIntentV2: Optional[v1SignRawPayloadIntentV2] = Field(default=None) + signTransactionIntentV2: Optional[v1SignTransactionIntentV2] = Field(default=None) + exportPrivateKeyIntent: Optional[v1ExportPrivateKeyIntent] = Field(default=None) + exportWalletIntent: Optional[v1ExportWalletIntent] = Field(default=None) + createSubOrganizationIntentV4: Optional[v1CreateSubOrganizationIntentV4] = Field( + default=None + ) + emailAuthIntent: Optional[v1EmailAuthIntent] = Field(default=None) + exportWalletAccountIntent: Optional[v1ExportWalletAccountIntent] = Field( + default=None + ) + initImportWalletIntent: Optional[v1InitImportWalletIntent] = Field(default=None) + importWalletIntent: Optional[v1ImportWalletIntent] = Field(default=None) + initImportPrivateKeyIntent: Optional[v1InitImportPrivateKeyIntent] = Field( + default=None + ) + importPrivateKeyIntent: Optional[v1ImportPrivateKeyIntent] = Field(default=None) + createPoliciesIntent: Optional[v1CreatePoliciesIntent] = Field(default=None) + signRawPayloadsIntent: Optional[v1SignRawPayloadsIntent] = Field(default=None) + createReadOnlySessionIntent: Optional[v1CreateReadOnlySessionIntent] = Field( + default=None + ) + createOauthProvidersIntent: Optional[v1CreateOauthProvidersIntent] = Field( + default=None + ) + deleteOauthProvidersIntent: Optional[v1DeleteOauthProvidersIntent] = Field( + default=None + ) + createSubOrganizationIntentV5: Optional[v1CreateSubOrganizationIntentV5] = Field( + default=None + ) + oauthIntent: Optional[v1OauthIntent] = Field(default=None) + createApiKeysIntentV2: Optional[v1CreateApiKeysIntentV2] = Field(default=None) + createReadWriteSessionIntent: Optional[v1CreateReadWriteSessionIntent] = Field( + default=None + ) + emailAuthIntentV2: Optional[v1EmailAuthIntentV2] = Field(default=None) + createSubOrganizationIntentV6: Optional[v1CreateSubOrganizationIntentV6] = Field( + default=None + ) + deletePrivateKeysIntent: Optional[v1DeletePrivateKeysIntent] = Field(default=None) + deleteWalletsIntent: Optional[v1DeleteWalletsIntent] = Field(default=None) + createReadWriteSessionIntentV2: Optional[v1CreateReadWriteSessionIntentV2] = Field( + default=None + ) + deleteSubOrganizationIntent: Optional[v1DeleteSubOrganizationIntent] = Field( + default=None + ) + initOtpAuthIntent: Optional[v1InitOtpAuthIntent] = Field(default=None) + otpAuthIntent: Optional[v1OtpAuthIntent] = Field(default=None) + createSubOrganizationIntentV7: Optional[v1CreateSubOrganizationIntentV7] = Field( + default=None + ) + updateWalletIntent: Optional[v1UpdateWalletIntent] = Field(default=None) + updatePolicyIntentV2: Optional[v1UpdatePolicyIntentV2] = Field(default=None) + createUsersIntentV3: Optional[v1CreateUsersIntentV3] = Field(default=None) + initOtpAuthIntentV2: Optional[v1InitOtpAuthIntentV2] = Field(default=None) + initOtpIntent: Optional[v1InitOtpIntent] = Field(default=None) + verifyOtpIntent: Optional[v1VerifyOtpIntent] = Field(default=None) + otpLoginIntent: Optional[v1OtpLoginIntent] = Field(default=None) + stampLoginIntent: Optional[v1StampLoginIntent] = Field(default=None) + oauthLoginIntent: Optional[v1OauthLoginIntent] = Field(default=None) + updateUserNameIntent: Optional[v1UpdateUserNameIntent] = Field(default=None) + updateUserEmailIntent: Optional[v1UpdateUserEmailIntent] = Field(default=None) + updateUserPhoneNumberIntent: Optional[v1UpdateUserPhoneNumberIntent] = Field( + default=None + ) + initFiatOnRampIntent: Optional[v1InitFiatOnRampIntent] = Field(default=None) + createSmartContractInterfaceIntent: Optional[ + v1CreateSmartContractInterfaceIntent + ] = Field(default=None) + deleteSmartContractInterfaceIntent: Optional[ + v1DeleteSmartContractInterfaceIntent + ] = Field(default=None) + enableAuthProxyIntent: Optional[v1EnableAuthProxyIntent] = Field(default=None) + disableAuthProxyIntent: Optional[v1DisableAuthProxyIntent] = Field(default=None) + updateAuthProxyConfigIntent: Optional[v1UpdateAuthProxyConfigIntent] = Field( + default=None + ) + createOauth2CredentialIntent: Optional[v1CreateOauth2CredentialIntent] = Field( + default=None + ) + updateOauth2CredentialIntent: Optional[v1UpdateOauth2CredentialIntent] = Field( + default=None + ) + deleteOauth2CredentialIntent: Optional[v1DeleteOauth2CredentialIntent] = Field( + default=None + ) + oauth2AuthenticateIntent: Optional[v1Oauth2AuthenticateIntent] = Field(default=None) + deleteWalletAccountsIntent: Optional[v1DeleteWalletAccountsIntent] = Field( + default=None + ) + deletePoliciesIntent: Optional[v1DeletePoliciesIntent] = Field(default=None) + ethSendRawTransactionIntent: Optional[v1EthSendRawTransactionIntent] = Field( + default=None + ) + ethSendTransactionIntent: Optional[v1EthSendTransactionIntent] = Field(default=None) + createFiatOnRampCredentialIntent: Optional[v1CreateFiatOnRampCredentialIntent] = ( + Field(default=None) + ) + updateFiatOnRampCredentialIntent: Optional[v1UpdateFiatOnRampCredentialIntent] = ( + Field(default=None) + ) + deleteFiatOnRampCredentialIntent: Optional[v1DeleteFiatOnRampCredentialIntent] = ( + Field(default=None) + ) + emailAuthIntentV3: Optional[v1EmailAuthIntentV3] = Field(default=None) + initUserEmailRecoveryIntentV2: Optional[v1InitUserEmailRecoveryIntentV2] = Field( + default=None + ) + initOtpIntentV2: Optional[v1InitOtpIntentV2] = Field(default=None) + initOtpAuthIntentV3: Optional[v1InitOtpAuthIntentV3] = Field(default=None) + upsertGasUsageConfigIntent: Optional[v1UpsertGasUsageConfigIntent] = Field( + default=None + ) + + +class v1Invitation(TurnkeyBaseModel): + invitationId: str = Field( + description="Unique identifier for a given Invitation object." + ) + receiverUserName: str = Field( + description="The name of the intended Invitation recipient." + ) + receiverEmail: str = Field( + description="The email address of the intended Invitation recipient." + ) + receiverUserTags: List[str] = Field( + description="A list of tags assigned to the Invitation recipient." + ) + accessType: v1AccessType = Field( + description="The User's permissible access method(s)." + ) + status: v1InvitationStatus = Field( + description="The current processing status of a specified Invitation." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + senderUserId: str = Field( + description="Unique identifier for the Sender of an Invitation." + ) + + +class v1InvitationParams(TurnkeyBaseModel): + receiverUserName: str = Field( + description="The name of the intended Invitation recipient." + ) + receiverUserEmail: str = Field( + description="The email address of the intended Invitation recipient." + ) + receiverUserTags: List[str] = Field( + description="A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body." + ) + accessType: v1AccessType = Field( + description="The User's permissible access method(s)." + ) + senderUserId: str = Field( + description="Unique identifier for the Sender of an Invitation." + ) + + +class v1InvitationStatus(str, Enum): + INVITATION_STATUS_CREATED = "INVITATION_STATUS_CREATED" + INVITATION_STATUS_ACCEPTED = "INVITATION_STATUS_ACCEPTED" + INVITATION_STATUS_REVOKED = "INVITATION_STATUS_REVOKED" + + +class v1ListFiatOnRampCredentialsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + + +class v1ListFiatOnRampCredentialsResponse(TurnkeyBaseModel): + fiatOnRampCredentials: List[v1FiatOnRampCredential] + + +class v1ListOauth2CredentialsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + + +class v1ListOauth2CredentialsResponse(TurnkeyBaseModel): + oauth2Credentials: List[v1Oauth2Credential] + + +class v1ListPrivateKeyTagsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1ListPrivateKeyTagsResponse(TurnkeyBaseModel): + privateKeyTags: List[datav1Tag] = Field(description="A list of private key tags.") + + +class v1ListUserTagsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + + +class v1ListUserTagsResponse(TurnkeyBaseModel): + userTags: List[datav1Tag] = Field(description="A list of user tags.") + + +class v1LoginUsage(TurnkeyBaseModel): + publicKey: str = Field(description="Public key for authentication") + + +class v1MnemonicLanguage(str, Enum): + MNEMONIC_LANGUAGE_ENGLISH = "MNEMONIC_LANGUAGE_ENGLISH" + MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE = "MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE" + MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE = "MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE" + MNEMONIC_LANGUAGE_CZECH = "MNEMONIC_LANGUAGE_CZECH" + MNEMONIC_LANGUAGE_FRENCH = "MNEMONIC_LANGUAGE_FRENCH" + MNEMONIC_LANGUAGE_ITALIAN = "MNEMONIC_LANGUAGE_ITALIAN" + MNEMONIC_LANGUAGE_JAPANESE = "MNEMONIC_LANGUAGE_JAPANESE" + MNEMONIC_LANGUAGE_KOREAN = "MNEMONIC_LANGUAGE_KOREAN" + MNEMONIC_LANGUAGE_SPANISH = "MNEMONIC_LANGUAGE_SPANISH" + + +class v1NOOPCodegenAnchorResponse(TurnkeyBaseModel): + stamp: v1WebAuthnStamp + tokenUsage: Optional[v1TokenUsage] = Field(default=None) + + +class v1Oauth2AuthenticateIntent(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow" + ) + authCode: str = Field( + description="The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow" + ) + redirectUri: str = Field( + description="The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider" + ) + codeVerifier: str = Field( + description="The code verifier used by OAuth 2.0 PKCE providers" + ) + nonce: Optional[str] = Field( + default=None, + description="An optional nonce used by the client to prevent replay/substitution of an ID token", + ) + bearerTokenTargetPublicKey: Optional[str] = Field( + default=None, + description="An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token", + ) + + +class v1Oauth2AuthenticateRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1Oauth2AuthenticateIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1Oauth2AuthenticateResult(TurnkeyBaseModel): + oidcToken: str = Field( + description="Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity" + ) + + +class v1Oauth2Credential(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="Unique identifier for a given OAuth 2.0 Credential." + ) + organizationId: str = Field(description="Unique identifier for an Organization.") + provider: v1Oauth2Provider = Field( + description="The provider for a given OAuth 2.0 Credential." + ) + clientId: str = Field(description="The client id for a given OAuth 2.0 Credential.") + encryptedClientSecret: str = Field( + description="The encrypted client secret for a given OAuth 2.0 Credential encrypted to the TLS Fetcher quorum key." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class v1Oauth2Provider(str, Enum): + OAUTH2_PROVIDER_X = "OAUTH2_PROVIDER_X" + OAUTH2_PROVIDER_DISCORD = "OAUTH2_PROVIDER_DISCORD" + + +class v1OauthIntent(TurnkeyBaseModel): + oidcToken: str = Field(description="Base64 encoded OIDC token") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Oauth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Oauth API keys", + ) + + +class v1OauthLoginIntent(TurnkeyBaseModel): + oidcToken: str = Field(description="Base64 encoded OIDC token") + publicKey: str = Field( + description="Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request" + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Login API keys", + ) + + +class v1OauthLoginRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1OauthLoginIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1OauthLoginResult(TurnkeyBaseModel): + session: str = Field( + description="Signed JWT containing an expiry, public key, session type, user id, and organization id" + ) + + +class v1OauthProvider(TurnkeyBaseModel): + providerId: str = Field(description="Unique identifier for an OAuth Provider") + providerName: str = Field(description="Human-readable name to identify a Provider.") + issuer: str = Field( + description="The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com" + ) + audience: str = Field( + description="Expected audience ('aud' attribute of the signed token) which represents the app ID" + ) + subject: str = Field( + description="Expected subject ('sub' attribute of the signed token) which represents the user ID" + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class v1OauthProviderParams(TurnkeyBaseModel): + providerName: str = Field(description="Human-readable name to identify a Provider.") + oidcToken: str = Field(description="Base64 encoded OIDC token") + + +class v1OauthRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1OauthIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1OauthResult(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for the authenticating User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + credentialBundle: str = Field(description="HPKE encrypted credential bundle") + + +class v1Operator(str, Enum): + OPERATOR_EQUAL = "OPERATOR_EQUAL" + OPERATOR_MORE_THAN = "OPERATOR_MORE_THAN" + OPERATOR_MORE_THAN_OR_EQUAL = "OPERATOR_MORE_THAN_OR_EQUAL" + OPERATOR_LESS_THAN = "OPERATOR_LESS_THAN" + OPERATOR_LESS_THAN_OR_EQUAL = "OPERATOR_LESS_THAN_OR_EQUAL" + OPERATOR_CONTAINS = "OPERATOR_CONTAINS" + OPERATOR_NOT_EQUAL = "OPERATOR_NOT_EQUAL" + OPERATOR_IN = "OPERATOR_IN" + OPERATOR_NOT_IN = "OPERATOR_NOT_IN" + OPERATOR_CONTAINS_ONE = "OPERATOR_CONTAINS_ONE" + OPERATOR_CONTAINS_ALL = "OPERATOR_CONTAINS_ALL" + + +class v1OrganizationData(TurnkeyBaseModel): + organizationId: Optional[str] = Field(default=None) + name: Optional[str] = Field(default=None) + users: Optional[List[v1User]] = Field(default=None) + policies: Optional[List[v1Policy]] = Field(default=None) + privateKeys: Optional[List[v1PrivateKey]] = Field(default=None) + invitations: Optional[List[v1Invitation]] = Field(default=None) + tags: Optional[List[datav1Tag]] = Field(default=None) + rootQuorum: Optional[externaldatav1Quorum] = Field(default=None) + features: Optional[List[v1Feature]] = Field(default=None) + wallets: Optional[List[v1Wallet]] = Field(default=None) + smartContractInterfaceReferences: Optional[ + List[v1SmartContractInterfaceReference] + ] = Field(default=None) + + +class v1OtpAuthIntent(TurnkeyBaseModel): + otpId: str = Field( + description="ID representing the result of an init OTP activity." + ) + otpCode: str = Field(description="OTP sent out to a user's contact (email or SMS)") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to OTP Auth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated OTP Auth API keys", + ) + + +class v1OtpAuthRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1OtpAuthIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1OtpAuthResult(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for the authenticating User.") + apiKeyId: Optional[str] = Field( + default=None, description="Unique identifier for the created API key." + ) + credentialBundle: Optional[str] = Field( + default=None, description="HPKE encrypted credential bundle" + ) + + +class v1OtpLoginIntent(TurnkeyBaseModel): + verificationToken: str = Field( + description="Signed JWT containing a unique id, expiry, verification type, contact" + ) + publicKey: str = Field( + description="Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token" + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Login API keys", + ) + clientSignature: Optional[v1ClientSignature] = Field( + default=None, + description="Optional signature proving authorization for this login. The signature is over the verification token ID and the public key. Only required if a public key was provided during the verification step.", + ) + + +class v1OtpLoginRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1OtpLoginIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1OtpLoginResult(TurnkeyBaseModel): + session: str = Field( + description="Signed JWT containing an expiry, public key, session type, user id, and organization id" + ) + + +class v1Outcome(str, Enum): + OUTCOME_ALLOW = "OUTCOME_ALLOW" + OUTCOME_DENY_EXPLICIT = "OUTCOME_DENY_EXPLICIT" + OUTCOME_DENY_IMPLICIT = "OUTCOME_DENY_IMPLICIT" + OUTCOME_REQUIRES_CONSENSUS = "OUTCOME_REQUIRES_CONSENSUS" + OUTCOME_REJECTED = "OUTCOME_REJECTED" + OUTCOME_ERROR = "OUTCOME_ERROR" + + +class v1Pagination(TurnkeyBaseModel): + limit: Optional[str] = Field( + default=None, + description="A limit of the number of object to be returned, between 1 and 100. Defaults to 10.", + ) + before: Optional[str] = Field( + default=None, + description="A pagination cursor. This is an object ID that enables you to fetch all objects before this ID.", + ) + after: Optional[str] = Field( + default=None, + description="A pagination cursor. This is an object ID that enables you to fetch all objects after this ID.", + ) + + +class v1PathFormat(str, Enum): + PATH_FORMAT_BIP32 = "PATH_FORMAT_BIP32" + + +class v1PayloadEncoding(str, Enum): + PAYLOAD_ENCODING_HEXADECIMAL = "PAYLOAD_ENCODING_HEXADECIMAL" + PAYLOAD_ENCODING_TEXT_UTF8 = "PAYLOAD_ENCODING_TEXT_UTF8" + PAYLOAD_ENCODING_EIP712 = "PAYLOAD_ENCODING_EIP712" + PAYLOAD_ENCODING_EIP7702_AUTHORIZATION = "PAYLOAD_ENCODING_EIP7702_AUTHORIZATION" + + +class v1Policy(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + policyName: str = Field(description="Human-readable name for a Policy.") + effect: v1Effect = Field( + description="The instruction to DENY or ALLOW a particular activity following policy selector(s)." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + notes: str = Field( + description="Human-readable notes added by a User to describe a particular policy." + ) + consensus: str = Field( + description="A consensus expression that evalutes to true or false." + ) + condition: str = Field( + description="A condition expression that evalutes to true or false." + ) + + +class v1PrivateKey(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + publicKey: str = Field( + description="The public component of a cryptographic key pair used to sign messages and transactions." + ) + privateKeyName: str = Field(description="Human-readable name for a Private Key.") + curve: v1Curve = Field( + description="Cryptographic Curve used to generate a given Private Key." + ) + addresses: List[externaldatav1Address] = Field( + description="Derived cryptocurrency addresses for a given Private Key." + ) + privateKeyTags: List[str] = Field(description="A list of Private Key Tag IDs.") + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + exported: bool = Field( + description="True when a given Private Key is exported, false otherwise." + ) + imported: bool = Field( + description="True when a given Private Key is imported, false otherwise." + ) + + +class v1PrivateKeyParams(TurnkeyBaseModel): + privateKeyName: str = Field(description="Human-readable name for a Private Key.") + curve: v1Curve = Field( + description="Cryptographic Curve used to generate a given Private Key." + ) + privateKeyTags: List[str] = Field( + description="A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body." + ) + addressFormats: List[v1AddressFormat] = Field( + description="Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + ) + + +class v1PrivateKeyResult(TurnkeyBaseModel): + privateKeyId: Optional[str] = Field(default=None) + addresses: Optional[List[immutableactivityv1Address]] = Field(default=None) + + +class v1PublicKeyCredentialWithAttestation(TurnkeyBaseModel): + id: str + type: str + rawId: str + authenticatorAttachment: Optional[str] = Field(default=None) + response: v1AuthenticatorAttestationResponse + clientExtensionResults: v1SimpleClientExtensionResults + + +class v1RecoverUserIntent(TurnkeyBaseModel): + authenticator: v1AuthenticatorParamsV2 = Field( + description="The new authenticator to register." + ) + userId: str = Field( + description="Unique identifier for the user performing recovery." + ) + + +class v1RecoverUserRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1RecoverUserIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1RecoverUserResult(TurnkeyBaseModel): + authenticatorId: List[str] = Field(description="ID of the authenticator created.") + + +class v1RejectActivityIntent(TurnkeyBaseModel): + fingerprint: str = Field(description="An artifact verifying a User's action.") + + +class v1RejectActivityRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1RejectActivityIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1RemoveOrganizationFeatureIntent(TurnkeyBaseModel): + name: v1FeatureName = Field(description="Name of the feature to remove") + + +class v1RemoveOrganizationFeatureRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1RemoveOrganizationFeatureIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1RemoveOrganizationFeatureResult(TurnkeyBaseModel): + features: List[v1Feature] = Field( + description="Resulting list of organization features." + ) + + +class v1Result(TurnkeyBaseModel): + createOrganizationResult: Optional[v1CreateOrganizationResult] = Field(default=None) + createAuthenticatorsResult: Optional[v1CreateAuthenticatorsResult] = Field( + default=None + ) + createUsersResult: Optional[v1CreateUsersResult] = Field(default=None) + createPrivateKeysResult: Optional[v1CreatePrivateKeysResult] = Field(default=None) + createInvitationsResult: Optional[v1CreateInvitationsResult] = Field(default=None) + acceptInvitationResult: Optional[v1AcceptInvitationResult] = Field(default=None) + signRawPayloadResult: Optional[v1SignRawPayloadResult] = Field(default=None) + createPolicyResult: Optional[v1CreatePolicyResult] = Field(default=None) + disablePrivateKeyResult: Optional[v1DisablePrivateKeyResult] = Field(default=None) + deleteUsersResult: Optional[v1DeleteUsersResult] = Field(default=None) + deleteAuthenticatorsResult: Optional[v1DeleteAuthenticatorsResult] = Field( + default=None + ) + deleteInvitationResult: Optional[v1DeleteInvitationResult] = Field(default=None) + deleteOrganizationResult: Optional[v1DeleteOrganizationResult] = Field(default=None) + deletePolicyResult: Optional[v1DeletePolicyResult] = Field(default=None) + createUserTagResult: Optional[v1CreateUserTagResult] = Field(default=None) + deleteUserTagsResult: Optional[v1DeleteUserTagsResult] = Field(default=None) + signTransactionResult: Optional[v1SignTransactionResult] = Field(default=None) + deleteApiKeysResult: Optional[v1DeleteApiKeysResult] = Field(default=None) + createApiKeysResult: Optional[v1CreateApiKeysResult] = Field(default=None) + createPrivateKeyTagResult: Optional[v1CreatePrivateKeyTagResult] = Field( + default=None + ) + deletePrivateKeyTagsResult: Optional[v1DeletePrivateKeyTagsResult] = Field( + default=None + ) + setPaymentMethodResult: Optional[billingSetPaymentMethodResult] = Field( + default=None + ) + activateBillingTierResult: Optional[billingActivateBillingTierResult] = Field( + default=None + ) + deletePaymentMethodResult: Optional[billingDeletePaymentMethodResult] = Field( + default=None + ) + createApiOnlyUsersResult: Optional[v1CreateApiOnlyUsersResult] = Field(default=None) + updateRootQuorumResult: Optional[v1UpdateRootQuorumResult] = Field(default=None) + updateUserTagResult: Optional[v1UpdateUserTagResult] = Field(default=None) + updatePrivateKeyTagResult: Optional[v1UpdatePrivateKeyTagResult] = Field( + default=None + ) + createSubOrganizationResult: Optional[v1CreateSubOrganizationResult] = Field( + default=None + ) + updateAllowedOriginsResult: Optional[v1UpdateAllowedOriginsResult] = Field( + default=None + ) + createPrivateKeysResultV2: Optional[v1CreatePrivateKeysResultV2] = Field( + default=None + ) + updateUserResult: Optional[v1UpdateUserResult] = Field(default=None) + updatePolicyResult: Optional[v1UpdatePolicyResult] = Field(default=None) + createSubOrganizationResultV3: Optional[v1CreateSubOrganizationResultV3] = Field( + default=None + ) + createWalletResult: Optional[v1CreateWalletResult] = Field(default=None) + createWalletAccountsResult: Optional[v1CreateWalletAccountsResult] = Field( + default=None + ) + initUserEmailRecoveryResult: Optional[v1InitUserEmailRecoveryResult] = Field( + default=None + ) + recoverUserResult: Optional[v1RecoverUserResult] = Field(default=None) + setOrganizationFeatureResult: Optional[v1SetOrganizationFeatureResult] = Field( + default=None + ) + removeOrganizationFeatureResult: Optional[v1RemoveOrganizationFeatureResult] = ( + Field(default=None) + ) + exportPrivateKeyResult: Optional[v1ExportPrivateKeyResult] = Field(default=None) + exportWalletResult: Optional[v1ExportWalletResult] = Field(default=None) + createSubOrganizationResultV4: Optional[v1CreateSubOrganizationResultV4] = Field( + default=None + ) + emailAuthResult: Optional[v1EmailAuthResult] = Field(default=None) + exportWalletAccountResult: Optional[v1ExportWalletAccountResult] = Field( + default=None + ) + initImportWalletResult: Optional[v1InitImportWalletResult] = Field(default=None) + importWalletResult: Optional[v1ImportWalletResult] = Field(default=None) + initImportPrivateKeyResult: Optional[v1InitImportPrivateKeyResult] = Field( + default=None + ) + importPrivateKeyResult: Optional[v1ImportPrivateKeyResult] = Field(default=None) + createPoliciesResult: Optional[v1CreatePoliciesResult] = Field(default=None) + signRawPayloadsResult: Optional[v1SignRawPayloadsResult] = Field(default=None) + createReadOnlySessionResult: Optional[v1CreateReadOnlySessionResult] = Field( + default=None + ) + createOauthProvidersResult: Optional[v1CreateOauthProvidersResult] = Field( + default=None + ) + deleteOauthProvidersResult: Optional[v1DeleteOauthProvidersResult] = Field( + default=None + ) + createSubOrganizationResultV5: Optional[v1CreateSubOrganizationResultV5] = Field( + default=None + ) + oauthResult: Optional[v1OauthResult] = Field(default=None) + createReadWriteSessionResult: Optional[v1CreateReadWriteSessionResult] = Field( + default=None + ) + createSubOrganizationResultV6: Optional[v1CreateSubOrganizationResultV6] = Field( + default=None + ) + deletePrivateKeysResult: Optional[v1DeletePrivateKeysResult] = Field(default=None) + deleteWalletsResult: Optional[v1DeleteWalletsResult] = Field(default=None) + createReadWriteSessionResultV2: Optional[v1CreateReadWriteSessionResultV2] = Field( + default=None + ) + deleteSubOrganizationResult: Optional[v1DeleteSubOrganizationResult] = Field( + default=None + ) + initOtpAuthResult: Optional[v1InitOtpAuthResult] = Field(default=None) + otpAuthResult: Optional[v1OtpAuthResult] = Field(default=None) + createSubOrganizationResultV7: Optional[v1CreateSubOrganizationResultV7] = Field( + default=None + ) + updateWalletResult: Optional[v1UpdateWalletResult] = Field(default=None) + updatePolicyResultV2: Optional[v1UpdatePolicyResultV2] = Field(default=None) + initOtpAuthResultV2: Optional[v1InitOtpAuthResultV2] = Field(default=None) + initOtpResult: Optional[v1InitOtpResult] = Field(default=None) + verifyOtpResult: Optional[v1VerifyOtpResult] = Field(default=None) + otpLoginResult: Optional[v1OtpLoginResult] = Field(default=None) + stampLoginResult: Optional[v1StampLoginResult] = Field(default=None) + oauthLoginResult: Optional[v1OauthLoginResult] = Field(default=None) + updateUserNameResult: Optional[v1UpdateUserNameResult] = Field(default=None) + updateUserEmailResult: Optional[v1UpdateUserEmailResult] = Field(default=None) + updateUserPhoneNumberResult: Optional[v1UpdateUserPhoneNumberResult] = Field( + default=None + ) + initFiatOnRampResult: Optional[v1InitFiatOnRampResult] = Field(default=None) + createSmartContractInterfaceResult: Optional[ + v1CreateSmartContractInterfaceResult + ] = Field(default=None) + deleteSmartContractInterfaceResult: Optional[ + v1DeleteSmartContractInterfaceResult + ] = Field(default=None) + enableAuthProxyResult: Optional[v1EnableAuthProxyResult] = Field(default=None) + disableAuthProxyResult: Optional[v1DisableAuthProxyResult] = Field(default=None) + updateAuthProxyConfigResult: Optional[v1UpdateAuthProxyConfigResult] = Field( + default=None + ) + createOauth2CredentialResult: Optional[v1CreateOauth2CredentialResult] = Field( + default=None + ) + updateOauth2CredentialResult: Optional[v1UpdateOauth2CredentialResult] = Field( + default=None + ) + deleteOauth2CredentialResult: Optional[v1DeleteOauth2CredentialResult] = Field( + default=None + ) + oauth2AuthenticateResult: Optional[v1Oauth2AuthenticateResult] = Field(default=None) + deleteWalletAccountsResult: Optional[v1DeleteWalletAccountsResult] = Field( + default=None + ) + deletePoliciesResult: Optional[v1DeletePoliciesResult] = Field(default=None) + ethSendRawTransactionResult: Optional[v1EthSendRawTransactionResult] = Field( + default=None + ) + createFiatOnRampCredentialResult: Optional[v1CreateFiatOnRampCredentialResult] = ( + Field(default=None) + ) + updateFiatOnRampCredentialResult: Optional[v1UpdateFiatOnRampCredentialResult] = ( + Field(default=None) + ) + deleteFiatOnRampCredentialResult: Optional[v1DeleteFiatOnRampCredentialResult] = ( + Field(default=None) + ) + ethSendTransactionResult: Optional[v1EthSendTransactionResult] = Field(default=None) + upsertGasUsageConfigResult: Optional[v1UpsertGasUsageConfigResult] = Field( + default=None + ) + + +class v1RootUserParams(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + apiKeys: List[apiApiKeyParams] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + + +class v1RootUserParamsV2(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + apiKeys: List[apiApiKeyParams] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + oauthProviders: List[v1OauthProviderParams] = Field( + description="A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + ) + + +class v1RootUserParamsV3(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + apiKeys: List[v1ApiKeyParamsV2] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + oauthProviders: List[v1OauthProviderParams] = Field( + description="A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + ) + + +class v1RootUserParamsV4(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + userPhoneNumber: Optional[str] = Field( + default=None, + description="The user's phone number in E.164 format e.g. +13214567890", + ) + apiKeys: List[v1ApiKeyParamsV2] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + oauthProviders: List[v1OauthProviderParams] = Field( + description="A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + ) + + +class v1Selector(TurnkeyBaseModel): + subject: Optional[str] = Field(default=None) + operator: Optional[v1Operator] = Field(default=None) + target: Optional[str] = Field(default=None) + + +class v1SelectorV2(TurnkeyBaseModel): + subject: Optional[str] = Field(default=None) + operator: Optional[v1Operator] = Field(default=None) + targets: Optional[List[str]] = Field(default=None) + + +class v1SetOrganizationFeatureIntent(TurnkeyBaseModel): + name: v1FeatureName = Field(description="Name of the feature to set") + value: str = Field( + description="Optional value for the feature. Will override existing values if feature is already set." + ) + + +class v1SetOrganizationFeatureRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1SetOrganizationFeatureIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1SetOrganizationFeatureResult(TurnkeyBaseModel): + features: List[v1Feature] = Field( + description="Resulting list of organization features." + ) + + +class v1SignRawPayloadIntent(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + payload: str = Field(description="Raw unsigned payload to be signed.") + encoding: v1PayloadEncoding = Field( + description="Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + ) + hashFunction: v1HashFunction = Field( + description="Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + ) + + +class v1SignRawPayloadIntentV2(TurnkeyBaseModel): + signWith: str = Field( + description="A Wallet account address, Private Key address, or Private Key identifier." + ) + payload: str = Field(description="Raw unsigned payload to be signed.") + encoding: v1PayloadEncoding = Field( + description="Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + ) + hashFunction: v1HashFunction = Field( + description="Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + ) + + +class v1SignRawPayloadRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1SignRawPayloadIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1SignRawPayloadResult(TurnkeyBaseModel): + r: str = Field(description="Component of an ECSDA signature.") + s: str = Field(description="Component of an ECSDA signature.") + v: str = Field(description="Component of an ECSDA signature.") + + +class v1SignRawPayloadsIntent(TurnkeyBaseModel): + signWith: str = Field( + description="A Wallet account address, Private Key address, or Private Key identifier." + ) + payloads: List[str] = Field( + description="An array of raw unsigned payloads to be signed." + ) + encoding: v1PayloadEncoding = Field( + description="Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + ) + hashFunction: v1HashFunction = Field( + description="Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + ) + + +class v1SignRawPayloadsRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1SignRawPayloadsIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1SignRawPayloadsResult(TurnkeyBaseModel): + signatures: Optional[List[v1SignRawPayloadResult]] = Field(default=None) + + +class v1SignTransactionIntent(TurnkeyBaseModel): + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + unsignedTransaction: str = Field( + description="Raw unsigned transaction to be signed by a particular Private Key." + ) + type: v1TransactionType + + +class v1SignTransactionIntentV2(TurnkeyBaseModel): + signWith: str = Field( + description="A Wallet account address, Private Key address, or Private Key identifier." + ) + unsignedTransaction: str = Field( + description="Raw unsigned transaction to be signed" + ) + type: v1TransactionType + + +class v1SignTransactionRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1SignTransactionIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1SignTransactionResult(TurnkeyBaseModel): + signedTransaction: str + + +class v1SignupUsage(TurnkeyBaseModel): + email: Optional[str] = Field(default=None) + phoneNumber: Optional[str] = Field(default=None) + apiKeys: Optional[List[v1ApiKeyParamsV2]] = Field(default=None) + authenticators: Optional[List[v1AuthenticatorParamsV2]] = Field(default=None) + oauthProviders: Optional[List[v1OauthProviderParams]] = Field(default=None) + + +class v1SimpleClientExtensionResults(TurnkeyBaseModel): + appid: Optional[bool] = Field(default=None) + appidExclude: Optional[bool] = Field(default=None) + credProps: Optional[v1CredPropsAuthenticationExtensionsClientOutputs] = Field( + default=None + ) + + +class v1SmartContractInterfaceReference(TurnkeyBaseModel): + smartContractInterfaceId: Optional[str] = Field(default=None) + smartContractAddress: Optional[str] = Field(default=None) + digest: Optional[str] = Field(default=None) + + +class v1SmartContractInterfaceType(str, Enum): + SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM = "SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM" + SMART_CONTRACT_INTERFACE_TYPE_SOLANA = "SMART_CONTRACT_INTERFACE_TYPE_SOLANA" + + +class v1SmsCustomizationParams(TurnkeyBaseModel): + template: Optional[str] = Field( + default=None, + description="Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}", + ) + + +class v1StampLoginIntent(TurnkeyBaseModel): + publicKey: str = Field( + description="Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request" + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Login API keys", + ) + + +class v1StampLoginRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1StampLoginIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1StampLoginResult(TurnkeyBaseModel): + session: str = Field( + description="Signed JWT containing an expiry, public key, session type, user id, and organization id" + ) + + +class v1TagType(str, Enum): + TAG_TYPE_USER = "TAG_TYPE_USER" + TAG_TYPE_PRIVATE_KEY = "TAG_TYPE_PRIVATE_KEY" + + +class v1TestRateLimitsRequest(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." + ) + isSetLimit: bool = Field( + description="Whether or not to set a limit on this request." + ) + limit: int = Field( + description="Rate limit to set for org, if is_set_limit is set to true." + ) + + +class v1TestRateLimitsResponse(TurnkeyBaseModel): + pass + + +class v1TokenUsage(TurnkeyBaseModel): + type: v1UsageType = Field(description="Type of token usage") + tokenId: str = Field(description="Unique identifier for the verification token") + signup: Optional[v1SignupUsage] = Field(default=None) + login: Optional[v1LoginUsage] = Field(default=None) + + +class v1TransactionType(str, Enum): + TRANSACTION_TYPE_ETHEREUM = "TRANSACTION_TYPE_ETHEREUM" + TRANSACTION_TYPE_SOLANA = "TRANSACTION_TYPE_SOLANA" + TRANSACTION_TYPE_TRON = "TRANSACTION_TYPE_TRON" + TRANSACTION_TYPE_BITCOIN = "TRANSACTION_TYPE_BITCOIN" + + +class v1UpdateAllowedOriginsIntent(TurnkeyBaseModel): + allowedOrigins: List[str] = Field( + description="Additional origins requests are allowed from besides Turnkey origins" + ) + + +class v1UpdateAllowedOriginsResult(TurnkeyBaseModel): + pass + + +class v1UpdateAuthProxyConfigIntent(TurnkeyBaseModel): + allowedOrigins: Optional[List[str]] = Field( + default=None, description="Updated list of allowed origins for CORS." + ) + allowedAuthMethods: Optional[List[str]] = Field( + default=None, + description="Updated list of allowed proxy authentication methods.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, description="Custom 'from' address for auth-related emails." + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Custom reply-to address for auth-related emails." + ) + emailAuthTemplateId: Optional[str] = Field( + default=None, description="Template ID for email-auth messages." + ) + otpTemplateId: Optional[str] = Field( + default=None, description="Template ID for OTP SMS messages." + ) + emailCustomizationParams: Optional[v1EmailCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomizationParams: Optional[v1SmsCustomizationParams] = Field( + default=None, description="Overrides for auth-related SMS content." + ) + walletKitSettings: Optional[v1WalletKitSettingsParams] = Field( + default=None, description="Overrides for react wallet kit related settings." + ) + otpExpirationSeconds: Optional[int] = Field( + default=None, description="OTP code lifetime in seconds." + ) + verificationTokenExpirationSeconds: Optional[int] = Field( + default=None, description="Verification-token lifetime in seconds." + ) + sessionExpirationSeconds: Optional[int] = Field( + default=None, description="Session lifetime in seconds." + ) + otpAlphanumeric: Optional[bool] = Field( + default=None, description="Enable alphanumeric OTP codes." + ) + otpLength: Optional[int] = Field( + default=None, description="Desired OTP code length (6โ€“9)." + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, description="Custom 'from' email sender for auth-related emails." + ) + verificationTokenRequiredForGetAccountPii: Optional[bool] = Field( + default=None, + description="Verification token required for get account with PII (email/phone number). Default false.", + ) + + +class v1UpdateAuthProxyConfigResult(TurnkeyBaseModel): + configId: Optional[str] = Field( + default=None, + description="Unique identifier for a given User. (representing the turnkey signer user id)", + ) + + +class v1UpdateFiatOnRampCredentialIntent(TurnkeyBaseModel): + fiatOnrampCredentialId: str = Field( + description="The ID of the fiat on-ramp credential to update" + ) + onrampProvider: v1FiatOnRampProvider = Field( + description="The fiat on-ramp provider" + ) + projectId: Optional[str] = Field( + default=None, + description="Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier.", + ) + publishableApiKey: str = Field( + description="Publishable API key for the on-ramp provider" + ) + encryptedSecretApiKey: str = Field( + description="Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key" + ) + encryptedPrivateApiKey: Optional[str] = Field( + default=None, + description="Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key.", + ) + + +class v1UpdateFiatOnRampCredentialRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateFiatOnRampCredentialIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateFiatOnRampCredentialResult(TurnkeyBaseModel): + fiatOnRampCredentialId: str = Field( + description="Unique identifier of the Fiat On-Ramp credential that was updated" + ) + + +class v1UpdateOauth2CredentialIntent(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="The ID of the OAuth 2.0 credential to update" + ) + provider: v1Oauth2Provider = Field(description="The OAuth 2.0 provider") + clientId: str = Field(description="The Client ID issued by the OAuth 2.0 provider") + encryptedClientSecret: str = Field( + description="The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + ) + + +class v1UpdateOauth2CredentialRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateOauth2CredentialIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateOauth2CredentialResult(TurnkeyBaseModel): + oauth2CredentialId: str = Field( + description="Unique identifier of the OAuth 2.0 credential that was updated" + ) + + +class v1UpdatePolicyIntent(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + policyName: Optional[str] = Field( + default=None, description="Human-readable name for a Policy." + ) + policyEffect: Optional[v1Effect] = Field( + default=None, + description="The instruction to DENY or ALLOW an activity (optional).", + ) + policyCondition: Optional[str] = Field( + default=None, + description="The condition expression that triggers the Effect (optional).", + ) + policyConsensus: Optional[str] = Field( + default=None, + description="The consensus expression that triggers the Effect (optional).", + ) + policyNotes: Optional[str] = Field( + default=None, description="Accompanying notes for a Policy (optional)." + ) + + +class v1UpdatePolicyIntentV2(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + policyName: Optional[str] = Field( + default=None, description="Human-readable name for a Policy." + ) + policyEffect: Optional[v1Effect] = Field( + default=None, + description="The instruction to DENY or ALLOW an activity (optional).", + ) + policyCondition: Optional[str] = Field( + default=None, + description="The condition expression that triggers the Effect (optional).", + ) + policyConsensus: Optional[str] = Field( + default=None, + description="The consensus expression that triggers the Effect (optional).", + ) + policyNotes: Optional[str] = Field( + default=None, description="Accompanying notes for a Policy (optional)." + ) + + +class v1UpdatePolicyRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdatePolicyIntentV2 + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdatePolicyResult(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class v1UpdatePolicyResultV2(TurnkeyBaseModel): + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class v1UpdatePrivateKeyTagIntent(TurnkeyBaseModel): + privateKeyTagId: str = Field( + description="Unique identifier for a given Private Key Tag." + ) + newPrivateKeyTagName: Optional[str] = Field( + default=None, + description="The new, human-readable name for the tag with the given ID.", + ) + addPrivateKeyIds: List[str] = Field( + description="A list of Private Keys IDs to add this tag to." + ) + removePrivateKeyIds: List[str] = Field( + description="A list of Private Key IDs to remove this tag from." + ) + + +class v1UpdatePrivateKeyTagRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdatePrivateKeyTagIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdatePrivateKeyTagResult(TurnkeyBaseModel): + privateKeyTagId: str = Field( + description="Unique identifier for a given Private Key Tag." + ) + + +class v1UpdateRootQuorumIntent(TurnkeyBaseModel): + threshold: int = Field( + description="The threshold of unique approvals to reach quorum." + ) + userIds: List[str] = Field( + description="The unique identifiers of users who comprise the quorum set." + ) + + +class v1UpdateRootQuorumRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateRootQuorumIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateRootQuorumResult(TurnkeyBaseModel): + pass + + +class v1UpdateUserEmailIntent(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + userEmail: str = Field( + description="The user's email address. Setting this to an empty string will remove the user's email." + ) + verificationToken: Optional[str] = Field( + default=None, + description="Signed JWT containing a unique id, expiry, verification type, contact", + ) + + +class v1UpdateUserEmailRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateUserEmailIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateUserEmailResult(TurnkeyBaseModel): + userId: str = Field( + description="Unique identifier of the User whose email was updated." + ) + + +class v1UpdateUserIntent(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + userName: Optional[str] = Field( + default=None, description="Human-readable name for a User." + ) + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + userTagIds: Optional[List[str]] = Field( + default=None, + description="An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body.", + ) + userPhoneNumber: Optional[str] = Field( + default=None, + description="The user's phone number in E.164 format e.g. +13214567890", + ) + + +class v1UpdateUserNameIntent(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + userName: str = Field(description="Human-readable name for a User.") + + +class v1UpdateUserNameRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateUserNameIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateUserNameResult(TurnkeyBaseModel): + userId: str = Field( + description="Unique identifier of the User whose name was updated." + ) + + +class v1UpdateUserPhoneNumberIntent(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + userPhoneNumber: str = Field( + description="The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number." + ) + verificationToken: Optional[str] = Field( + default=None, + description="Signed JWT containing a unique id, expiry, verification type, contact", + ) + + +class v1UpdateUserPhoneNumberRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateUserPhoneNumberIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateUserPhoneNumberResult(TurnkeyBaseModel): + userId: str = Field( + description="Unique identifier of the User whose phone number was updated." + ) + + +class v1UpdateUserRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateUserIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateUserResult(TurnkeyBaseModel): + userId: str = Field(description="A User ID.") + + +class v1UpdateUserTagIntent(TurnkeyBaseModel): + userTagId: str = Field(description="Unique identifier for a given User Tag.") + newUserTagName: Optional[str] = Field( + default=None, + description="The new, human-readable name for the tag with the given ID.", + ) + addUserIds: List[str] = Field(description="A list of User IDs to add this tag to.") + removeUserIds: List[str] = Field( + description="A list of User IDs to remove this tag from." + ) + + +class v1UpdateUserTagRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateUserTagIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateUserTagResult(TurnkeyBaseModel): + userTagId: str = Field(description="Unique identifier for a given User Tag.") + + +class v1UpdateWalletIntent(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a given Wallet.") + walletName: Optional[str] = Field( + default=None, description="Human-readable name for a Wallet." + ) + + +class v1UpdateWalletRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1UpdateWalletIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1UpdateWalletResult(TurnkeyBaseModel): + walletId: str = Field(description="A Wallet ID.") + + +class v1UpsertGasUsageConfigIntent(TurnkeyBaseModel): + orgWindowLimitUsd: str = Field( + description="Gas sponsorship USD limit for the billing organization window." + ) + subOrgWindowLimitUsd: str = Field( + description="Gas sponsorship USD limit for sub-organizations under the billing organization." + ) + windowDurationMinutes: str = Field( + description="Rolling sponsorship window duration, expressed in minutes." + ) + + +class v1UpsertGasUsageConfigResult(TurnkeyBaseModel): + gasUsageConfigId: str = Field( + description="Unique identifier for the gas usage configuration that was created or updated." + ) + + +class v1UsageType(str, Enum): + USAGE_TYPE_SIGNUP = "USAGE_TYPE_SIGNUP" + USAGE_TYPE_LOGIN = "USAGE_TYPE_LOGIN" + + +class v1User(TurnkeyBaseModel): + userId: str = Field(description="Unique identifier for a given User.") + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + userPhoneNumber: Optional[str] = Field( + default=None, + description="The user's phone number in E.164 format e.g. +13214567890", + ) + authenticators: List[v1Authenticator] = Field( + description="A list of Authenticator parameters." + ) + apiKeys: List[v1ApiKey] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + userTags: List[str] = Field(description="A list of User Tag IDs.") + oauthProviders: List[v1OauthProvider] = Field( + description="A list of Oauth Providers." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + + +class v1UserParams(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + accessType: v1AccessType = Field( + description="The User's permissible access method(s)." + ) + apiKeys: List[apiApiKeyParams] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParams] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + userTags: List[str] = Field( + description="A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + ) + + +class v1UserParamsV2(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + apiKeys: List[apiApiKeyParams] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + userTags: List[str] = Field( + description="A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + ) + + +class v1UserParamsV3(TurnkeyBaseModel): + userName: str = Field(description="Human-readable name for a User.") + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + userPhoneNumber: Optional[str] = Field( + default=None, + description="The user's phone number in E.164 format e.g. +13214567890", + ) + apiKeys: List[v1ApiKeyParamsV2] = Field( + description="A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + ) + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + ) + oauthProviders: List[v1OauthProviderParams] = Field( + description="A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + ) + userTags: List[str] = Field( + description="A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + ) + + +class v1VerifyOtpIntent(TurnkeyBaseModel): + otpId: str = Field( + description="ID representing the result of an init OTP activity." + ) + otpCode: str = Field(description="OTP sent out to a user's contact (email or SMS)") + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours)", + ) + publicKey: Optional[str] = Field( + default=None, + description="Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature", + ) + + +class v1VerifyOtpRequest(TurnkeyBaseModel): + type: str + timestampMs: str = Field( + description="Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + ) + organizationId: str = Field( + description="Unique identifier for a given Organization." + ) + parameters: v1VerifyOtpIntent + generateAppProofs: Optional[bool] = Field(default=None) + + +class v1VerifyOtpResult(TurnkeyBaseModel): + verificationToken: str = Field( + description="Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + ) + + +class v1Vote(TurnkeyBaseModel): + id: str = Field(description="Unique identifier for a given Vote object.") + userId: str = Field(description="Unique identifier for a given User.") + user: v1User = Field(description="Web and/or API user within your Organization.") + activityId: str = Field( + description="Unique identifier for a given Activity object." + ) + selection: str + message: str = Field(description="The raw message being signed within a Vote.") + publicKey: str = Field( + description="The public component of a cryptographic key pair used to sign messages and transactions." + ) + signature: str = Field(description="The signature applied to a particular vote.") + scheme: str = Field(description="Method used to produce a signature.") + createdAt: externaldatav1Timestamp + + +class v1Wallet(TurnkeyBaseModel): + walletId: str = Field(description="Unique identifier for a given Wallet.") + walletName: str = Field(description="Human-readable name for a Wallet.") + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + exported: bool = Field( + description="True when a given Wallet is exported, false otherwise." + ) + imported: bool = Field( + description="True when a given Wallet is imported, false otherwise." + ) + + +class v1WalletAccount(TurnkeyBaseModel): + walletAccountId: str = Field( + description="Unique identifier for a given Wallet Account." + ) + organizationId: str = Field(description="The Organization the Account belongs to.") + walletId: str = Field(description="The Wallet the Account was derived from.") + curve: v1Curve = Field( + description="Cryptographic curve used to generate the Account." + ) + pathFormat: v1PathFormat = Field( + description="Path format used to generate the Account." + ) + path: str = Field(description="Path used to generate the Account.") + addressFormat: v1AddressFormat = Field( + description="Address format used to generate the Account." + ) + address: str = Field( + description="Address generated using the Wallet seed and Account parameters." + ) + createdAt: externaldatav1Timestamp + updatedAt: externaldatav1Timestamp + publicKey: Optional[str] = Field( + default=None, + description="The public component of this wallet account's underlying cryptographic key pair.", + ) + walletDetails: Optional[v1Wallet] = Field( + default=None, + description="Wallet details for this account. This is only present when include_wallet_details=true.", + ) + + +class v1WalletAccountParams(TurnkeyBaseModel): + curve: v1Curve = Field( + description="Cryptographic curve used to generate a wallet Account." + ) + pathFormat: v1PathFormat = Field( + description="Path format used to generate a wallet Account." + ) + path: str = Field(description="Path used to generate a wallet Account.") + addressFormat: v1AddressFormat = Field( + description="Address format used to generate a wallet Acccount." + ) + + +class v1WalletKitSettingsParams(TurnkeyBaseModel): + enabledSocialProviders: Optional[List[str]] = Field( + default=None, + description="List of enabled social login providers (e.g., 'apple', 'google', 'facebook')", + ) + oauthClientIds: Optional[Dict[str, Any]] = Field( + default=None, + description="Mapping of social login providers to their Oauth client IDs.", + ) + oauthRedirectUrl: Optional[str] = Field( + default=None, + description="Oauth redirect URL to be used for social login flows.", + ) + + +class v1WalletParams(TurnkeyBaseModel): + walletName: str = Field(description="Human-readable name for a Wallet.") + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + ) + mnemonicLength: Optional[int] = Field( + default=None, + description="Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24.", + ) + + +class v1WalletResult(TurnkeyBaseModel): + walletId: str + addresses: List[str] = Field(description="A list of account addresses.") + + +class v1WebAuthnStamp(TurnkeyBaseModel): + credentialId: str = Field( + description="A base64 url encoded Unique identifier for a given credential." + ) + clientDataJson: str = Field( + description="A base64 encoded payload containing metadata about the signing context and the challenge." + ) + authenticatorData: str = Field( + description="A base64 encoded payload containing metadata about the authenticator." + ) + signature: str = Field( + description="The base64 url encoded signature bytes contained within the WebAuthn assertion response." + ) + + +# --- API Types from Swagger Paths --- + + +class GetActivityResponse(TurnkeyBaseModel): + activity: v1Activity = Field( + description="An action that can be taken within the Turnkey infrastructure." + ) + + +class GetActivityBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + activityId: str = Field( + description="Unique identifier for a given activity object." + ) + + +class GetActivityInput(TurnkeyBaseModel): + body: GetActivityBody + + +class GetApiKeyResponse(TurnkeyBaseModel): + apiKey: v1ApiKey = Field(description="An API key.") + + +class GetApiKeyBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + apiKeyId: str = Field(description="Unique identifier for a given API key.") + + +class GetApiKeyInput(TurnkeyBaseModel): + body: GetApiKeyBody + + +class GetApiKeysResponse(TurnkeyBaseModel): + apiKeys: List[v1ApiKey] = Field(description="A list of API keys.") + + +class GetApiKeysBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + userId: Optional[str] = Field( + default=None, description="Unique identifier for a given user." + ) + + +class GetApiKeysInput(TurnkeyBaseModel): + body: GetApiKeysBody + + +class GetAttestationDocumentResponse(TurnkeyBaseModel): + attestationDocument: str = Field( + description="Raw (CBOR-encoded) attestation document." + ) + + +class GetAttestationDocumentBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + enclaveType: str = Field( + description="The enclave type, one of: ump, notarizer, signer, evm-parser." + ) + + +class GetAttestationDocumentInput(TurnkeyBaseModel): + body: GetAttestationDocumentBody + + +class GetAuthenticatorResponse(TurnkeyBaseModel): + authenticator: v1Authenticator = Field(description="An authenticator.") + + +class GetAuthenticatorBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + authenticatorId: str = Field( + description="Unique identifier for a given authenticator." + ) + + +class GetAuthenticatorInput(TurnkeyBaseModel): + body: GetAuthenticatorBody + + +class GetAuthenticatorsResponse(TurnkeyBaseModel): + authenticators: List[v1Authenticator] = Field( + description="A list of authenticators." + ) + + +class GetAuthenticatorsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given user.") + + +class GetAuthenticatorsInput(TurnkeyBaseModel): + body: GetAuthenticatorsBody + + +class GetBootProofResponse(TurnkeyBaseModel): + bootProof: v1BootProof + + +class GetBootProofBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + ephemeralKey: str = Field(description="Hex encoded ephemeral public key.") + + +class GetBootProofInput(TurnkeyBaseModel): + body: GetBootProofBody + + +class GetGasUsageResponse(TurnkeyBaseModel): + windowDurationMinutes: int = Field( + description="The window duration (in minutes) for the organization or sub-organization." + ) + windowLimitUsd: str = Field( + description="The window limit (in USD) for the organization or sub-organization." + ) + usageUsd: str = Field( + description="The total gas usage (in USD) of all sponsored transactions processed over the last `window_duration_minutes`" + ) + + +class GetGasUsageBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetGasUsageInput(TurnkeyBaseModel): + body: GetGasUsageBody + + +class GetLatestBootProofResponse(TurnkeyBaseModel): + bootProof: v1BootProof + + +class GetLatestBootProofBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + appName: str = Field(description="Name of enclave app.") + + +class GetLatestBootProofInput(TurnkeyBaseModel): + body: GetLatestBootProofBody + + +class GetNoncesResponse(TurnkeyBaseModel): + nonce: Optional[str] = Field( + default=None, + description="The standard on-chain nonce for the address, if requested.", + ) + gasStationNonce: Optional[str] = Field( + default=None, + description="The gas station nonce for sponsored transactions, if requested.", + ) + + +class GetNoncesBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + address: str = Field(description="The Ethereum address to query nonces for.") + caip2: str = Field( + description="The network identifier in CAIP-2 format (e.g., 'eip155:1' for Ethereum mainnet)." + ) + nonce: Optional[bool] = Field( + default=None, description="Whether to fetch the standard on-chain nonce." + ) + gasStationNonce: Optional[bool] = Field( + default=None, + description="Whether to fetch the gas station nonce used for sponsored transactions.", + ) + + +class GetNoncesInput(TurnkeyBaseModel): + body: GetNoncesBody + + +class GetOauth2CredentialResponse(TurnkeyBaseModel): + oauth2Credential: v1Oauth2Credential + + +class GetOauth2CredentialBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + oauth2CredentialId: str = Field( + description="Unique identifier for a given OAuth 2.0 Credential." + ) + + +class GetOauth2CredentialInput(TurnkeyBaseModel): + body: GetOauth2CredentialBody + + +class GetOauthProvidersResponse(TurnkeyBaseModel): + oauthProviders: List[v1OauthProvider] = Field( + description="A list of Oauth providers." + ) + + +class GetOauthProvidersBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + userId: Optional[str] = Field( + default=None, description="Unique identifier for a given user." + ) + + +class GetOauthProvidersInput(TurnkeyBaseModel): + body: GetOauthProvidersBody + + +class GetOnRampTransactionStatusResponse(TurnkeyBaseModel): + transactionStatus: str = Field( + description="The status of the fiat on ramp transaction." + ) + + +class GetOnRampTransactionStatusBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + transactionId: str = Field( + description="The unique identifier for the fiat on ramp transaction." + ) + refresh: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the transaction status should be refreshed from the fiat on ramp provider. Default = false.", + ) + + +class GetOnRampTransactionStatusInput(TurnkeyBaseModel): + body: GetOnRampTransactionStatusBody + + +class GetOrganizationResponse(TurnkeyBaseModel): + organizationData: v1OrganizationData = Field( + description="Object representing the full current and deleted / disabled collection of users, policies, private keys, and invitations attributable to a particular organization." + ) + + +class GetOrganizationBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetOrganizationInput(TurnkeyBaseModel): + body: GetOrganizationBody + + +class GetOrganizationConfigsResponse(TurnkeyBaseModel): + configs: v1Config = Field( + description="Organization configs including quorum settings and organization features." + ) + + +class GetOrganizationConfigsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetOrganizationConfigsInput(TurnkeyBaseModel): + body: GetOrganizationConfigsBody + + +class GetPolicyResponse(TurnkeyBaseModel): + policy: v1Policy = Field( + description="Object that codifies rules defining the actions that are permissible within an organization." + ) + + +class GetPolicyBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + policyId: str = Field(description="Unique identifier for a given policy.") + + +class GetPolicyInput(TurnkeyBaseModel): + body: GetPolicyBody + + +class GetPolicyEvaluationsResponse(TurnkeyBaseModel): + policyEvaluations: List[externalactivityv1PolicyEvaluation] + + +class GetPolicyEvaluationsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + activityId: str = Field(description="Unique identifier for a given activity.") + + +class GetPolicyEvaluationsInput(TurnkeyBaseModel): + body: GetPolicyEvaluationsBody + + +class GetPrivateKeyResponse(TurnkeyBaseModel): + privateKey: v1PrivateKey = Field( + description="Cryptographic public/private key pair that can be used for cryptocurrency needs or more generalized encryption." + ) + + +class GetPrivateKeyBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + privateKeyId: str = Field(description="Unique identifier for a given private key.") + + +class GetPrivateKeyInput(TurnkeyBaseModel): + body: GetPrivateKeyBody + + +class GetSendTransactionStatusResponse(TurnkeyBaseModel): + txStatus: str = Field(description="The current status of the send transaction.") + eth: Optional[v1EthSendTransactionStatus] = Field( + default=None, description="Ethereum-specific transaction status." + ) + txError: Optional[str] = Field( + default=None, + description="The error encountered when broadcasting or confirming the transaction, if any.", + ) + + +class GetSendTransactionStatusBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + sendTransactionStatusId: str = Field( + description="The unique identifier of a send transaction request." + ) + + +class GetSendTransactionStatusInput(TurnkeyBaseModel): + body: GetSendTransactionStatusBody + + +class GetSmartContractInterfaceResponse(TurnkeyBaseModel): + smartContractInterface: externaldatav1SmartContractInterface = Field( + description="Object to be used in conjunction with policies to guard transaction signing." + ) + + +class GetSmartContractInterfaceBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + smartContractInterfaceId: str = Field( + description="Unique identifier for a given smart contract interface." + ) + + +class GetSmartContractInterfaceInput(TurnkeyBaseModel): + body: GetSmartContractInterfaceBody + + +class GetUserResponse(TurnkeyBaseModel): + user: v1User = Field(description="Web and/or API user within your organization.") + + +class GetUserBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given user.") + + +class GetUserInput(TurnkeyBaseModel): + body: GetUserBody + + +class GetWalletResponse(TurnkeyBaseModel): + wallet: v1Wallet = Field( + description="A collection of deterministically generated cryptographic public / private key pairs that share a common seed." + ) + + +class GetWalletBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + walletId: str = Field(description="Unique identifier for a given wallet.") + + +class GetWalletInput(TurnkeyBaseModel): + body: GetWalletBody + + +class GetWalletAccountResponse(TurnkeyBaseModel): + account: v1WalletAccount = Field(description="The resulting wallet account.") + + +class GetWalletAccountBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + walletId: str = Field(description="Unique identifier for a given wallet.") + address: Optional[str] = Field( + default=None, description="Address corresponding to a wallet account." + ) + path: Optional[str] = Field( + default=None, description="Path corresponding to a wallet account." + ) + + +class GetWalletAccountInput(TurnkeyBaseModel): + body: GetWalletAccountBody + + +class GetActivitiesResponse(TurnkeyBaseModel): + activities: List[v1Activity] = Field(description="A list of activities.") + + +class GetActivitiesBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + filterByStatus: Optional[List[v1ActivityStatus]] = Field( + default=None, + description="Array of activity statuses filtering which activities will be listed in the response.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + filterByType: Optional[List[v1ActivityType]] = Field( + default=None, + description="Array of activity types filtering which activities will be listed in the response.", + ) + + +class GetActivitiesInput(TurnkeyBaseModel): + body: GetActivitiesBody + + +class GetAppProofsResponse(TurnkeyBaseModel): + appProofs: List[v1AppProof] + + +class GetAppProofsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + activityId: str = Field(description="Unique identifier for a given activity.") + + +class GetAppProofsInput(TurnkeyBaseModel): + body: GetAppProofsBody + + +class ListFiatOnRampCredentialsResponse(TurnkeyBaseModel): + fiatOnRampCredentials: List[v1FiatOnRampCredential] + + +class ListFiatOnRampCredentialsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class ListFiatOnRampCredentialsInput(TurnkeyBaseModel): + body: ListFiatOnRampCredentialsBody + + +class ListOauth2CredentialsResponse(TurnkeyBaseModel): + oauth2Credentials: List[v1Oauth2Credential] + + +class ListOauth2CredentialsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class ListOauth2CredentialsInput(TurnkeyBaseModel): + body: ListOauth2CredentialsBody + + +class GetPoliciesResponse(TurnkeyBaseModel): + policies: List[v1Policy] = Field(description="A list of policies.") + + +class GetPoliciesBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetPoliciesInput(TurnkeyBaseModel): + body: GetPoliciesBody + + +class ListPrivateKeyTagsResponse(TurnkeyBaseModel): + privateKeyTags: List[datav1Tag] = Field(description="A list of private key tags.") + + +class ListPrivateKeyTagsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class ListPrivateKeyTagsInput(TurnkeyBaseModel): + body: ListPrivateKeyTagsBody + + +class GetPrivateKeysResponse(TurnkeyBaseModel): + privateKeys: List[v1PrivateKey] = Field(description="A list of private keys.") + + +class GetPrivateKeysBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetPrivateKeysInput(TurnkeyBaseModel): + body: GetPrivateKeysBody + + +class GetSmartContractInterfacesResponse(TurnkeyBaseModel): + smartContractInterfaces: List[externaldatav1SmartContractInterface] = Field( + description="A list of smart contract interfaces." + ) + + +class GetSmartContractInterfacesBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetSmartContractInterfacesInput(TurnkeyBaseModel): + body: GetSmartContractInterfacesBody + + +class GetSubOrgIdsResponse(TurnkeyBaseModel): + organizationIds: List[str] = Field( + description="List of unique identifiers for the matching sub-organizations." + ) + + +class GetSubOrgIdsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + filterType: Optional[str] = Field( + default=None, + description="Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY'", + ) + filterValue: Optional[str] = Field( + default=None, + description="The value of the filter to apply for the specified type. For example, a specific email or name string.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + + +class GetSubOrgIdsInput(TurnkeyBaseModel): + body: GetSubOrgIdsBody + + +class ListUserTagsResponse(TurnkeyBaseModel): + userTags: List[datav1Tag] = Field(description="A list of user tags.") + + +class ListUserTagsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class ListUserTagsInput(TurnkeyBaseModel): + body: ListUserTagsBody + + +class GetUsersResponse(TurnkeyBaseModel): + users: List[v1User] = Field(description="A list of users.") + + +class GetUsersBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetUsersInput(TurnkeyBaseModel): + body: GetUsersBody + + +class GetVerifiedSubOrgIdsResponse(TurnkeyBaseModel): + organizationIds: List[str] = Field( + description="List of unique identifiers for the matching sub-organizations." + ) + + +class GetVerifiedSubOrgIdsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + filterType: Optional[str] = Field( + default=None, + description="Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'.", + ) + filterValue: Optional[str] = Field( + default=None, + description="The value of the filter to apply for the specified type. For example, a specific email or phone number string.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + + +class GetVerifiedSubOrgIdsInput(TurnkeyBaseModel): + body: GetVerifiedSubOrgIdsBody + + +class GetWalletAccountsResponse(TurnkeyBaseModel): + accounts: List[v1WalletAccount] = Field( + description="A list of accounts generated from a wallet that share a common seed." + ) + + +class GetWalletAccountsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + walletId: Optional[str] = Field( + default=None, + description="Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned.", + ) + includeWalletDetails: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the wallet details should be included in the response. Default = false.", + ) + paginationOptions: Optional[v1Pagination] = Field( + default=None, description="Parameters used for cursor-based pagination." + ) + + +class GetWalletAccountsInput(TurnkeyBaseModel): + body: GetWalletAccountsBody + + +class GetWalletsResponse(TurnkeyBaseModel): + wallets: List[v1Wallet] = Field(description="A list of wallets.") + + +class GetWalletsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetWalletsInput(TurnkeyBaseModel): + body: GetWalletsBody + + +class GetWhoamiResponse(TurnkeyBaseModel): + organizationId: str = Field( + description="Unique identifier for a given organization." + ) + organizationName: str = Field( + description="Human-readable name for an organization." + ) + userId: str = Field(description="Unique identifier for a given user.") + username: str = Field(description="Human-readable name for a user.") + + +class GetWhoamiBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + + +class GetWhoamiInput(TurnkeyBaseModel): + body: GetWhoamiBody + + +class ApproveActivityResponse(TurnkeyBaseModel): + activity: v1Activity = Field( + description="An action that can be taken within the Turnkey infrastructure." + ) + + +class ApproveActivityBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + fingerprint: str = Field(description="An artifact verifying a User's action.") + + +class ApproveActivityInput(TurnkeyBaseModel): + body: ApproveActivityBody + + +class CreateApiKeysResponse(TurnkeyBaseModel): + activity: v1Activity + apiKeyIds: List[str] = Field(description="A list of API Key IDs.") + + +class CreateApiKeysBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + apiKeys: List[v1ApiKeyParamsV2] = Field(description="A list of API Keys.") + userId: str = Field(description="Unique identifier for a given User.") + + +class CreateApiKeysInput(TurnkeyBaseModel): + body: CreateApiKeysBody + + +class CreateApiOnlyUsersResponse(TurnkeyBaseModel): + activity: v1Activity + userIds: List[str] = Field(description="A list of API-only User IDs.") + + +class CreateApiOnlyUsersBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + apiOnlyUsers: List[v1ApiOnlyUserParams] = Field( + description="A list of API-only Users to create." + ) + + +class CreateApiOnlyUsersInput(TurnkeyBaseModel): + body: CreateApiOnlyUsersBody + + +class CreateAuthenticatorsResponse(TurnkeyBaseModel): + activity: v1Activity + authenticatorIds: List[str] = Field(description="A list of Authenticator IDs.") + + +class CreateAuthenticatorsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + authenticators: List[v1AuthenticatorParamsV2] = Field( + description="A list of Authenticators." + ) + userId: str = Field(description="Unique identifier for a given User.") + + +class CreateAuthenticatorsInput(TurnkeyBaseModel): + body: CreateAuthenticatorsBody + + +class CreateFiatOnRampCredentialResponse(TurnkeyBaseModel): + activity: v1Activity + fiatOnRampCredentialId: str = Field( + description="Unique identifier of the Fiat On-Ramp credential that was created" + ) + + +class CreateFiatOnRampCredentialBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + onrampProvider: v1FiatOnRampProvider = Field( + description="The fiat on-ramp provider" + ) + projectId: Optional[str] = Field( + default=None, + description="Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier", + ) + publishableApiKey: str = Field( + description="Publishable API key for the on-ramp provider" + ) + encryptedSecretApiKey: str = Field( + description="Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key" + ) + encryptedPrivateApiKey: Optional[str] = Field( + default=None, + description="Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key.", + ) + sandboxMode: Optional[bool] = Field( + default=None, description="If the on-ramp credential is a sandbox credential" + ) + + +class CreateFiatOnRampCredentialInput(TurnkeyBaseModel): + body: CreateFiatOnRampCredentialBody + + +class CreateInvitationsResponse(TurnkeyBaseModel): + activity: v1Activity + invitationIds: List[str] = Field(description="A list of Invitation IDs") + + +class CreateInvitationsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + invitations: List[v1InvitationParams] = Field(description="A list of Invitations.") + + +class CreateInvitationsInput(TurnkeyBaseModel): + body: CreateInvitationsBody + + +class CreateOauth2CredentialResponse(TurnkeyBaseModel): + activity: v1Activity + oauth2CredentialId: str = Field( + description="Unique identifier of the OAuth 2.0 credential that was created" + ) + + +class CreateOauth2CredentialBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + provider: v1Oauth2Provider = Field(description="The OAuth 2.0 provider") + clientId: str = Field(description="The Client ID issued by the OAuth 2.0 provider") + encryptedClientSecret: str = Field( + description="The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + ) + + +class CreateOauth2CredentialInput(TurnkeyBaseModel): + body: CreateOauth2CredentialBody + + +class CreateOauthProvidersResponse(TurnkeyBaseModel): + activity: v1Activity + providerIds: List[str] = Field( + description="A list of unique identifiers for Oauth Providers" + ) + + +class CreateOauthProvidersBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="The ID of the User to add an Oauth provider to") + oauthProviders: List[v1OauthProviderParams] = Field( + description="A list of Oauth providers." + ) + + +class CreateOauthProvidersInput(TurnkeyBaseModel): + body: CreateOauthProvidersBody + + +class CreatePoliciesResponse(TurnkeyBaseModel): + activity: v1Activity + policyIds: List[str] = Field( + description="A list of unique identifiers for the created policies." + ) + + +class CreatePoliciesBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + policies: List[v1CreatePolicyIntentV3] = Field( + description="An array of policy intents to be created." + ) + + +class CreatePoliciesInput(TurnkeyBaseModel): + body: CreatePoliciesBody + + +class CreatePolicyResponse(TurnkeyBaseModel): + activity: v1Activity + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class CreatePolicyBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + policyName: str = Field(description="Human-readable name for a Policy.") + effect: v1Effect = Field( + description="The instruction to DENY or ALLOW an activity." + ) + condition: Optional[str] = Field( + default=None, description="The condition expression that triggers the Effect" + ) + consensus: Optional[str] = Field( + default=None, description="The consensus expression that triggers the Effect" + ) + notes: str = Field(description="Notes for a Policy.") + + +class CreatePolicyInput(TurnkeyBaseModel): + body: CreatePolicyBody + + +class CreatePrivateKeyTagResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeyTagId: str = Field( + description="Unique identifier for a given Private Key Tag." + ) + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class CreatePrivateKeyTagBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + privateKeyTagName: str = Field( + description="Human-readable name for a Private Key Tag." + ) + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class CreatePrivateKeyTagInput(TurnkeyBaseModel): + body: CreatePrivateKeyTagBody + + +class CreatePrivateKeysResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeys: List[v1PrivateKeyResult] = Field( + description="A list of Private Key IDs and addresses." + ) + + +class CreatePrivateKeysBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + privateKeys: List[v1PrivateKeyParams] = Field(description="A list of Private Keys.") + + +class CreatePrivateKeysInput(TurnkeyBaseModel): + body: CreatePrivateKeysBody + + +class CreateReadOnlySessionResponse(TurnkeyBaseModel): + activity: v1Activity + organizationId: str = Field( + description="Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + ) + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + userId: str = Field(description="Unique identifier for a given User.") + username: str = Field(description="Human-readable name for a User.") + session: str = Field(description="String representing a read only session") + sessionExpiry: str = Field( + description="UTC timestamp in seconds representing the expiry time for the read only session." + ) + + +class CreateReadOnlySessionBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + + +class CreateReadOnlySessionInput(TurnkeyBaseModel): + body: CreateReadOnlySessionBody + + +class CreateReadWriteSessionResponse(TurnkeyBaseModel): + activity: v1Activity + organizationId: str = Field( + description="Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + ) + organizationName: str = Field( + description="Human-readable name for an Organization." + ) + userId: str = Field(description="Unique identifier for a given User.") + username: str = Field(description="Human-readable name for a User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + credentialBundle: str = Field(description="HPKE encrypted credential bundle") + + +class CreateReadWriteSessionBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + ) + userId: Optional[str] = Field( + default=None, description="Unique identifier for a given User." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Read Write Session - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated ReadWriteSession API keys", + ) + + +class CreateReadWriteSessionInput(TurnkeyBaseModel): + body: CreateReadWriteSessionBody + + +class CreateSmartContractInterfaceResponse(TurnkeyBaseModel): + activity: v1Activity + smartContractInterfaceId: str = Field( + description="The ID of the created Smart Contract Interface." + ) + + +class CreateSmartContractInterfaceBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + smartContractAddress: str = Field( + description="Corresponding contract address or program ID" + ) + smartContractInterface: str = Field( + description="ABI/IDL as a JSON string. Limited to 400kb" + ) + type: v1SmartContractInterfaceType + label: str = Field( + description="Human-readable name for a Smart Contract Interface." + ) + notes: Optional[str] = Field( + default=None, description="Notes for a Smart Contract Interface." + ) + + +class CreateSmartContractInterfaceInput(TurnkeyBaseModel): + body: CreateSmartContractInterfaceBody + + +class CreateSubOrganizationResponse(TurnkeyBaseModel): + activity: v1Activity + subOrganizationId: str + wallet: Optional[v1WalletResult] = Field(default=None) + rootUserIds: Optional[List[str]] = Field(default=None) + + +class CreateSubOrganizationBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + subOrganizationName: str = Field(description="Name for this sub-organization") + rootUsers: List[v1RootUserParamsV4] = Field( + description="Root users to create within this sub-organization" + ) + rootQuorumThreshold: int = Field( + description="The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + ) + wallet: Optional[v1WalletParams] = Field( + default=None, description="The wallet to create for the sub-organization" + ) + disableEmailRecovery: Optional[bool] = Field( + default=None, description="Disable email recovery for the sub-organization" + ) + disableEmailAuth: Optional[bool] = Field( + default=None, description="Disable email auth for the sub-organization" + ) + disableSmsAuth: Optional[bool] = Field( + default=None, description="Disable OTP SMS auth for the sub-organization" + ) + disableOtpEmailAuth: Optional[bool] = Field( + default=None, description="Disable OTP email auth for the sub-organization" + ) + verificationToken: Optional[str] = Field( + default=None, + description="Signed JWT containing a unique id, expiry, verification type, contact", + ) + clientSignature: Optional[v1ClientSignature] = Field( + default=None, + description="Optional signature proving authorization for this sub-organization creation. The signature is over the verification token ID and the root user parameters for the root user associated with the verification token. Only required if a public key was provided during the verification step.", + ) + + +class CreateSubOrganizationInput(TurnkeyBaseModel): + body: CreateSubOrganizationBody + + +class CreateUserTagResponse(TurnkeyBaseModel): + activity: v1Activity + userTagId: str = Field(description="Unique identifier for a given User Tag.") + userIds: List[str] = Field(description="A list of User IDs.") + + +class CreateUserTagBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userTagName: str = Field(description="Human-readable name for a User Tag.") + userIds: List[str] = Field(description="A list of User IDs.") + + +class CreateUserTagInput(TurnkeyBaseModel): + body: CreateUserTagBody + + +class CreateUsersResponse(TurnkeyBaseModel): + activity: v1Activity + userIds: List[str] = Field(description="A list of User IDs.") + + +class CreateUsersBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + users: List[v1UserParamsV3] = Field(description="A list of Users.") + + +class CreateUsersInput(TurnkeyBaseModel): + body: CreateUsersBody + + +class CreateWalletResponse(TurnkeyBaseModel): + activity: v1Activity + walletId: str = Field(description="Unique identifier for a Wallet.") + addresses: List[str] = Field(description="A list of account addresses.") + + +class CreateWalletBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + walletName: str = Field(description="Human-readable name for a Wallet.") + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + ) + mnemonicLength: Optional[int] = Field( + default=None, + description="Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24.", + ) + + +class CreateWalletInput(TurnkeyBaseModel): + body: CreateWalletBody + + +class CreateWalletAccountsResponse(TurnkeyBaseModel): + activity: v1Activity + addresses: List[str] = Field(description="A list of derived addresses.") + + +class CreateWalletAccountsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + walletId: str = Field(description="Unique identifier for a given Wallet.") + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts." + ) + persist: Optional[bool] = Field( + default=None, + description="Indicates if the wallet accounts should be persisted. This is helpful if you'd like to see the addresses of different derivation paths without actually creating the accounts. Defaults to true.", + ) + + +class CreateWalletAccountsInput(TurnkeyBaseModel): + body: CreateWalletAccountsBody + + +class DeleteApiKeysResponse(TurnkeyBaseModel): + activity: v1Activity + apiKeyIds: List[str] = Field(description="A list of API Key IDs.") + + +class DeleteApiKeysBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given User.") + apiKeyIds: List[str] = Field(description="A list of API Key IDs.") + + +class DeleteApiKeysInput(TurnkeyBaseModel): + body: DeleteApiKeysBody + + +class DeleteAuthenticatorsResponse(TurnkeyBaseModel): + activity: v1Activity + authenticatorIds: List[str] = Field( + description="Unique identifier for a given Authenticator." + ) + + +class DeleteAuthenticatorsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given User.") + authenticatorIds: List[str] = Field(description="A list of Authenticator IDs.") + + +class DeleteAuthenticatorsInput(TurnkeyBaseModel): + body: DeleteAuthenticatorsBody + + +class DeleteFiatOnRampCredentialResponse(TurnkeyBaseModel): + activity: v1Activity + fiatOnRampCredentialId: str = Field( + description="Unique identifier of the Fiat On-Ramp credential that was deleted" + ) + + +class DeleteFiatOnRampCredentialBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + fiatOnrampCredentialId: str = Field( + description="The ID of the fiat on-ramp credential to delete" + ) + + +class DeleteFiatOnRampCredentialInput(TurnkeyBaseModel): + body: DeleteFiatOnRampCredentialBody + + +class DeleteInvitationResponse(TurnkeyBaseModel): + activity: v1Activity + invitationId: str = Field(description="Unique identifier for a given Invitation.") + + +class DeleteInvitationBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + invitationId: str = Field( + description="Unique identifier for a given Invitation object." + ) + + +class DeleteInvitationInput(TurnkeyBaseModel): + body: DeleteInvitationBody + + +class DeleteOauth2CredentialResponse(TurnkeyBaseModel): + activity: v1Activity + oauth2CredentialId: str = Field( + description="Unique identifier of the OAuth 2.0 credential that was deleted" + ) + + +class DeleteOauth2CredentialBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + oauth2CredentialId: str = Field( + description="The ID of the OAuth 2.0 credential to delete" + ) + + +class DeleteOauth2CredentialInput(TurnkeyBaseModel): + body: DeleteOauth2CredentialBody + + +class DeleteOauthProvidersResponse(TurnkeyBaseModel): + activity: v1Activity + providerIds: List[str] = Field( + description="A list of unique identifiers for Oauth Providers" + ) + + +class DeleteOauthProvidersBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field( + description="The ID of the User to remove an Oauth provider from" + ) + providerIds: List[str] = Field( + description="Unique identifier for a given Provider." + ) + + +class DeleteOauthProvidersInput(TurnkeyBaseModel): + body: DeleteOauthProvidersBody + + +class DeletePoliciesResponse(TurnkeyBaseModel): + activity: v1Activity + policyIds: List[str] = Field( + description="A list of unique identifiers for the deleted policies." + ) + + +class DeletePoliciesBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + policyIds: List[str] = Field( + description="List of unique identifiers for policies within an organization" + ) + + +class DeletePoliciesInput(TurnkeyBaseModel): + body: DeletePoliciesBody + + +class DeletePolicyResponse(TurnkeyBaseModel): + activity: v1Activity + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class DeletePolicyBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class DeletePolicyInput(TurnkeyBaseModel): + body: DeletePolicyBody + + +class DeletePrivateKeyTagsResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeyTagIds: List[str] = Field(description="A list of Private Key Tag IDs.") + privateKeyIds: List[str] = Field(description="A list of Private Key IDs.") + + +class DeletePrivateKeyTagsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + privateKeyTagIds: List[str] = Field(description="A list of Private Key Tag IDs.") + + +class DeletePrivateKeyTagsInput(TurnkeyBaseModel): + body: DeletePrivateKeyTagsBody + + +class DeletePrivateKeysResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeyIds: List[str] = Field( + description="A list of private key unique identifiers that were removed" + ) + + +class DeletePrivateKeysBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + privateKeyIds: List[str] = Field( + description="List of unique identifiers for private keys within an organization" + ) + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored.", + ) + + +class DeletePrivateKeysInput(TurnkeyBaseModel): + body: DeletePrivateKeysBody + + +class DeleteSmartContractInterfaceResponse(TurnkeyBaseModel): + activity: v1Activity + smartContractInterfaceId: str = Field( + description="The ID of the deleted Smart Contract Interface." + ) + + +class DeleteSmartContractInterfaceBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + smartContractInterfaceId: str = Field( + description="The ID of a Smart Contract Interface intended for deletion." + ) + + +class DeleteSmartContractInterfaceInput(TurnkeyBaseModel): + body: DeleteSmartContractInterfaceBody + + +class DeleteSubOrganizationResponse(TurnkeyBaseModel): + activity: v1Activity + subOrganizationUuid: str = Field( + description="Unique identifier of the sub organization that was removed" + ) + + +class DeleteSubOrganizationBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false.", + ) + + +class DeleteSubOrganizationInput(TurnkeyBaseModel): + body: DeleteSubOrganizationBody + + +class DeleteUserTagsResponse(TurnkeyBaseModel): + activity: v1Activity + userTagIds: List[str] = Field(description="A list of User Tag IDs.") + userIds: List[str] = Field(description="A list of User IDs.") + + +class DeleteUserTagsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userTagIds: List[str] = Field(description="A list of User Tag IDs.") + + +class DeleteUserTagsInput(TurnkeyBaseModel): + body: DeleteUserTagsBody + + +class DeleteUsersResponse(TurnkeyBaseModel): + activity: v1Activity + userIds: List[str] = Field(description="A list of User IDs.") + + +class DeleteUsersBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userIds: List[str] = Field(description="A list of User IDs.") + + +class DeleteUsersInput(TurnkeyBaseModel): + body: DeleteUsersBody + + +class DeleteWalletAccountsResponse(TurnkeyBaseModel): + activity: v1Activity + walletAccountIds: List[str] = Field( + description="A list of wallet account unique identifiers that were removed" + ) + + +class DeleteWalletAccountsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + walletAccountIds: List[str] = Field( + description="List of unique identifiers for wallet accounts within an organization" + ) + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Optional parameter for deleting the wallet accounts, even if any have not been previously exported. If they have been exported, this field is ignored.", + ) + + +class DeleteWalletAccountsInput(TurnkeyBaseModel): + body: DeleteWalletAccountsBody + + +class DeleteWalletsResponse(TurnkeyBaseModel): + activity: v1Activity + walletIds: List[str] = Field( + description="A list of wallet unique identifiers that were removed" + ) + + +class DeleteWalletsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + walletIds: List[str] = Field( + description="List of unique identifiers for wallets within an organization" + ) + deleteWithoutExport: Optional[bool] = Field( + default=None, + description="Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored.", + ) + + +class DeleteWalletsInput(TurnkeyBaseModel): + body: DeleteWalletsBody + + +class EmailAuthResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field(description="Unique identifier for the authenticating User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + + +class EmailAuthBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + email: str = Field(description="Email of the authenticating user.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Email Auth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: v1EmailAuthCustomizationParams = Field( + description="Parameters for customizing emails. If not provided, the default email will be used. Note that app_name is required." + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Email Auth API keys", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class EmailAuthInput(TurnkeyBaseModel): + body: EmailAuthBody + + +class EthSendRawTransactionResponse(TurnkeyBaseModel): + activity: v1Activity + transactionHash: str = Field( + description="The transaction hash of the sent transaction" + ) + + +class EthSendRawTransactionBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + signedTransaction: str = Field( + description="The raw, signed transaction to be sent." + ) + caip2: str = Field( + description="CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet)." + ) + + +class EthSendRawTransactionInput(TurnkeyBaseModel): + body: EthSendRawTransactionBody + + +class EthSendTransactionResponse(TurnkeyBaseModel): + activity: v1Activity + sendTransactionStatusId: str = Field( + description="The send_transaction_status ID associated with the transaction submission for sponsored transactions" + ) + + +class EthSendTransactionBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + from_: str = Field( + alias="from", + description="A wallet or private key address to sign with. This does not support private key IDs.", + ) + sponsor: Optional[bool] = Field( + default=None, description="Whether to sponsor this transaction via Gas Station." + ) + caip2: str = Field( + description="CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet)." + ) + to: str = Field(description="Recipient address as a hex string with 0x prefix.") + value: Optional[str] = Field( + default=None, description="Amount of native asset to send in wei." + ) + data: Optional[str] = Field( + default=None, description="Hex-encoded call data for contract interactions." + ) + nonce: Optional[str] = Field( + default=None, + description="Transaction nonce, for EIP-1559 and Turnkey Gas Station authorizations.", + ) + gasLimit: Optional[str] = Field( + default=None, + description="Maximum amount of gas to use for this transaction, for EIP-1559 transactions.", + ) + maxFeePerGas: Optional[str] = Field( + default=None, + description="Maximum total fee per gas unit (base fee + priority fee) in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions.", + ) + maxPriorityFeePerGas: Optional[str] = Field( + default=None, + description="Maximum priority fee (tip) per gas unit in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions.", + ) + gasStationNonce: Optional[str] = Field( + default=None, + description="The gas station delegate contract nonce. Only used when sponsor=true. Include this if you want maximal security posture.", + ) + + +class EthSendTransactionInput(TurnkeyBaseModel): + body: EthSendTransactionBody + + +class ExportPrivateKeyResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + exportBundle: str = Field( + description="Export bundle containing a private key encrypted to the client's target public key." + ) + + +class ExportPrivateKeyBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + privateKeyId: str = Field(description="Unique identifier for a given Private Key.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the export bundle will be encrypted." + ) + + +class ExportPrivateKeyInput(TurnkeyBaseModel): + body: ExportPrivateKeyBody + + +class ExportWalletResponse(TurnkeyBaseModel): + activity: v1Activity + walletId: str = Field(description="Unique identifier for a given Wallet.") + exportBundle: str = Field( + description="Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key." + ) + + +class ExportWalletBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + walletId: str = Field(description="Unique identifier for a given Wallet.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the export bundle will be encrypted." + ) + language: Optional[v1MnemonicLanguage] = Field( + default=None, + description="The language of the mnemonic to export. Defaults to English.", + ) + + +class ExportWalletInput(TurnkeyBaseModel): + body: ExportWalletBody + + +class ExportWalletAccountResponse(TurnkeyBaseModel): + activity: v1Activity + address: str = Field(description="Address to identify Wallet Account.") + exportBundle: str = Field( + description="Export bundle containing a private key encrypted by the client's target public key." + ) + + +class ExportWalletAccountBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + address: str = Field(description="Address to identify Wallet Account.") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the export bundle will be encrypted." + ) + + +class ExportWalletAccountInput(TurnkeyBaseModel): + body: ExportWalletAccountBody + + +class ImportPrivateKeyResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeyId: str = Field(description="Unique identifier for a Private Key.") + addresses: List[immutableactivityv1Address] = Field( + description="A list of addresses." + ) + + +class ImportPrivateKeyBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="The ID of the User importing a Private Key.") + privateKeyName: str = Field(description="Human-readable name for a Private Key.") + encryptedBundle: str = Field( + description="Bundle containing a raw private key encrypted to the enclave's target public key." + ) + curve: v1Curve = Field( + description="Cryptographic Curve used to generate a given Private Key." + ) + addressFormats: List[v1AddressFormat] = Field( + description="Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + ) + + +class ImportPrivateKeyInput(TurnkeyBaseModel): + body: ImportPrivateKeyBody + + +class ImportWalletResponse(TurnkeyBaseModel): + activity: v1Activity + walletId: str = Field(description="Unique identifier for a Wallet.") + addresses: List[str] = Field(description="A list of account addresses.") + + +class ImportWalletBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="The ID of the User importing a Wallet.") + walletName: str = Field(description="Human-readable name for a Wallet.") + encryptedBundle: str = Field( + description="Bundle containing a wallet mnemonic encrypted to the enclave's target public key." + ) + accounts: List[v1WalletAccountParams] = Field( + description="A list of wallet Accounts." + ) + + +class ImportWalletInput(TurnkeyBaseModel): + body: ImportWalletBody + + +class InitFiatOnRampResponse(TurnkeyBaseModel): + activity: v1Activity + onRampUrl: str = Field(description="Unique URL for a given fiat on-ramp flow.") + onRampTransactionId: str = Field( + description="Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow." + ) + onRampUrlSignature: Optional[str] = Field( + default=None, + description="Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project.", + ) + + +class InitFiatOnRampBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + onrampProvider: v1FiatOnRampProvider = Field( + description="Enum to specifiy which on-ramp provider to use" + ) + walletAddress: str = Field( + description="Destination wallet address for the buy transaction." + ) + network: v1FiatOnRampBlockchainNetwork = Field( + description="Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork." + ) + cryptoCurrencyCode: v1FiatOnRampCryptoCurrency = Field( + description="Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset." + ) + fiatCurrencyCode: Optional[v1FiatOnRampCurrency] = Field( + default=None, + description="Code for the fiat currency to be used in the transaction, e.g., USD, EUR.", + ) + fiatCurrencyAmount: Optional[str] = Field( + default=None, + description="Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount.", + ) + paymentMethod: Optional[v1FiatOnRampPaymentMethod] = Field( + default=None, + description="Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider.", + ) + countryCode: Optional[str] = Field( + default=None, + description="ISO 3166-1 two-digit country code for Coinbase representing the purchasing userโ€™s country of residence, e.g., US, GB.", + ) + countrySubdivisionCode: Optional[str] = Field( + default=None, + description="ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing userโ€™s subdivision of residence within their country, e.g. NY. Required if country_code=US.", + ) + sandboxMode: Optional[bool] = Field( + default=None, + description="Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false.", + ) + urlForSignature: Optional[str] = Field( + default=None, + description="Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled.", + ) + + +class InitFiatOnRampInput(TurnkeyBaseModel): + body: InitFiatOnRampBody + + +class InitImportPrivateKeyResponse(TurnkeyBaseModel): + activity: v1Activity + importBundle: str = Field( + description="Import bundle containing a public key and signature to use for importing client data." + ) + + +class InitImportPrivateKeyBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="The ID of the User importing a Private Key.") + + +class InitImportPrivateKeyInput(TurnkeyBaseModel): + body: InitImportPrivateKeyBody + + +class InitImportWalletResponse(TurnkeyBaseModel): + activity: v1Activity + importBundle: str = Field( + description="Import bundle containing a public key and signature to use for importing client data." + ) + + +class InitImportWalletBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="The ID of the User importing a Wallet.") + + +class InitImportWalletInput(TurnkeyBaseModel): + body: InitImportWalletBody + + +class InitOtpResponse(TurnkeyBaseModel): + activity: v1Activity + otpId: str = Field(description="Unique identifier for an OTP authentication") + + +class InitOtpBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + otpType: str = Field( + description="Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + otpLength: Optional[int] = Field( + default=None, description="Optional length of the OTP code. Default = 9" + ) + appName: str = Field( + description="The name of the application. This field is required and will be used in email notifications if an email template is not provided." + ) + emailCustomization: Optional[v1EmailCustomizationParamsV2] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default SMS message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + alphanumeric: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class InitOtpInput(TurnkeyBaseModel): + body: InitOtpBody + + +class InitOtpAuthResponse(TurnkeyBaseModel): + activity: v1Activity + otpId: str = Field(description="Unique identifier for an OTP authentication") + + +class InitOtpAuthBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + otpType: str = Field( + description="Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + ) + contact: str = Field(description="Email or phone number to send the OTP code to") + otpLength: Optional[int] = Field( + default=None, description="Optional length of the OTP code. Default = 9" + ) + appName: str = Field( + description="The name of the application. This field is required and will be used in email notifications if an email template is not provided." + ) + emailCustomization: Optional[v1EmailCustomizationParamsV2] = Field( + default=None, + description="Optional parameters for customizing emails. If not provided, the default email will be used.", + ) + smsCustomization: Optional[v1SmsCustomizationParams] = Field( + default=None, + description="Optional parameters for customizing SMS message. If not provided, the default SMS message will be used.", + ) + userIdentifier: Optional[str] = Field( + default=None, + description="Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.", + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + alphanumeric: Optional[bool] = Field( + default=None, + description="Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class InitOtpAuthInput(TurnkeyBaseModel): + body: InitOtpAuthBody + + +class InitUserEmailRecoveryResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field(description="Unique identifier for the user being recovered.") + + +class InitUserEmailRecoveryBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + email: str = Field(description="Email of the user starting recovery") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the recovery bundle will be encrypted." + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used.", + ) + emailCustomization: v1EmailAuthCustomizationParams = Field( + description="Parameters for customizing emails. If not provided, the default email will be used. Note that `app_name` is required." + ) + sendFromEmailAddress: Optional[str] = Field( + default=None, + description="Optional custom email address from which to send the OTP email", + ) + sendFromEmailSenderName: Optional[str] = Field( + default=None, + description="Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'", + ) + replyToEmailAddress: Optional[str] = Field( + default=None, description="Optional custom email address to use as reply-to" + ) + + +class InitUserEmailRecoveryInput(TurnkeyBaseModel): + body: InitUserEmailRecoveryBody + + +class OauthResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field(description="Unique identifier for the authenticating User.") + apiKeyId: str = Field(description="Unique identifier for the created API key.") + credentialBundle: str = Field(description="HPKE encrypted credential bundle") + + +class OauthBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + oidcToken: str = Field(description="Base64 encoded OIDC token") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to Oauth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Oauth API keys", + ) + + +class OauthInput(TurnkeyBaseModel): + body: OauthBody + + +class Oauth2AuthenticateResponse(TurnkeyBaseModel): + activity: v1Activity + oidcToken: str = Field( + description="Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity" + ) + + +class Oauth2AuthenticateBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + oauth2CredentialId: str = Field( + description="The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow" + ) + authCode: str = Field( + description="The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow" + ) + redirectUri: str = Field( + description="The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider" + ) + codeVerifier: str = Field( + description="The code verifier used by OAuth 2.0 PKCE providers" + ) + nonce: Optional[str] = Field( + default=None, + description="An optional nonce used by the client to prevent replay/substitution of an ID token", + ) + bearerTokenTargetPublicKey: Optional[str] = Field( + default=None, + description="An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token", + ) + + +class Oauth2AuthenticateInput(TurnkeyBaseModel): + body: Oauth2AuthenticateBody + + +class OauthLoginResponse(TurnkeyBaseModel): + activity: v1Activity + session: str = Field( + description="Signed JWT containing an expiry, public key, session type, user id, and organization id" + ) + + +class OauthLoginBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + oidcToken: str = Field(description="Base64 encoded OIDC token") + publicKey: str = Field( + description="Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request" + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Login API keys", + ) + + +class OauthLoginInput(TurnkeyBaseModel): + body: OauthLoginBody + + +class OtpAuthResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field(description="Unique identifier for the authenticating User.") + apiKeyId: Optional[str] = Field( + default=None, description="Unique identifier for the created API key." + ) + credentialBundle: Optional[str] = Field( + default=None, description="HPKE encrypted credential bundle" + ) + + +class OtpAuthBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + otpId: str = Field( + description="ID representing the result of an init OTP activity." + ) + otpCode: str = Field(description="OTP sent out to a user's contact (email or SMS)") + targetPublicKey: str = Field( + description="Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted." + ) + apiKeyName: Optional[str] = Field( + default=None, + description="Optional human-readable name for an API Key. If none provided, default to OTP Auth - ", + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated OTP Auth API keys", + ) + + +class OtpAuthInput(TurnkeyBaseModel): + body: OtpAuthBody + + +class OtpLoginResponse(TurnkeyBaseModel): + activity: v1Activity + session: str = Field( + description="Signed JWT containing an expiry, public key, session type, user id, and organization id" + ) + + +class OtpLoginBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + verificationToken: str = Field( + description="Signed JWT containing a unique id, expiry, verification type, contact" + ) + publicKey: str = Field( + description="Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token" + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Login API keys", + ) + clientSignature: Optional[v1ClientSignature] = Field( + default=None, + description="Optional signature proving authorization for this login. The signature is over the verification token ID and the public key. Only required if a public key was provided during the verification step.", + ) + + +class OtpLoginInput(TurnkeyBaseModel): + body: OtpLoginBody + + +class RecoverUserResponse(TurnkeyBaseModel): + activity: v1Activity + authenticatorId: List[str] = Field(description="ID of the authenticator created.") + + +class RecoverUserBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + authenticator: v1AuthenticatorParamsV2 = Field( + description="The new authenticator to register." + ) + userId: str = Field( + description="Unique identifier for the user performing recovery." + ) + + +class RecoverUserInput(TurnkeyBaseModel): + body: RecoverUserBody + + +class RejectActivityResponse(TurnkeyBaseModel): + activity: v1Activity = Field( + description="An action that can be taken within the Turnkey infrastructure." + ) + + +class RejectActivityBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + fingerprint: str = Field(description="An artifact verifying a User's action.") + + +class RejectActivityInput(TurnkeyBaseModel): + body: RejectActivityBody + + +class RemoveOrganizationFeatureResponse(TurnkeyBaseModel): + activity: v1Activity + features: List[v1Feature] = Field( + description="Resulting list of organization features." + ) + + +class RemoveOrganizationFeatureBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + name: v1FeatureName = Field(description="Name of the feature to remove") + + +class RemoveOrganizationFeatureInput(TurnkeyBaseModel): + body: RemoveOrganizationFeatureBody + + +class SetOrganizationFeatureResponse(TurnkeyBaseModel): + activity: v1Activity + features: List[v1Feature] = Field( + description="Resulting list of organization features." + ) + + +class SetOrganizationFeatureBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + name: v1FeatureName = Field(description="Name of the feature to set") + value: str = Field( + description="Optional value for the feature. Will override existing values if feature is already set." + ) + + +class SetOrganizationFeatureInput(TurnkeyBaseModel): + body: SetOrganizationFeatureBody + + +class SignRawPayloadResponse(TurnkeyBaseModel): + activity: v1Activity + r: str = Field(description="Component of an ECSDA signature.") + s: str = Field(description="Component of an ECSDA signature.") + v: str = Field(description="Component of an ECSDA signature.") + + +class SignRawPayloadBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + signWith: str = Field( + description="A Wallet account address, Private Key address, or Private Key identifier." + ) + payload: str = Field(description="Raw unsigned payload to be signed.") + encoding: v1PayloadEncoding = Field( + description="Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + ) + hashFunction: v1HashFunction = Field( + description="Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + ) + + +class SignRawPayloadInput(TurnkeyBaseModel): + body: SignRawPayloadBody + + +class SignRawPayloadsResponse(TurnkeyBaseModel): + activity: v1Activity + signatures: Optional[List[v1SignRawPayloadResult]] = Field(default=None) + + +class SignRawPayloadsBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + signWith: str = Field( + description="A Wallet account address, Private Key address, or Private Key identifier." + ) + payloads: List[str] = Field( + description="An array of raw unsigned payloads to be signed." + ) + encoding: v1PayloadEncoding = Field( + description="Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + ) + hashFunction: v1HashFunction = Field( + description="Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + ) + + +class SignRawPayloadsInput(TurnkeyBaseModel): + body: SignRawPayloadsBody + + +class SignTransactionResponse(TurnkeyBaseModel): + activity: v1Activity + signedTransaction: str + + +class SignTransactionBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + signWith: str = Field( + description="A Wallet account address, Private Key address, or Private Key identifier." + ) + unsignedTransaction: str = Field( + description="Raw unsigned transaction to be signed" + ) + type: v1TransactionType + + +class SignTransactionInput(TurnkeyBaseModel): + body: SignTransactionBody + + +class StampLoginResponse(TurnkeyBaseModel): + activity: v1Activity + session: str = Field( + description="Signed JWT containing an expiry, public key, session type, user id, and organization id" + ) + + +class StampLoginBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + publicKey: str = Field( + description="Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request" + ) + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used.", + ) + invalidateExisting: Optional[bool] = Field( + default=None, + description="Invalidate all other previously generated Login API keys", + ) + + +class StampLoginInput(TurnkeyBaseModel): + body: StampLoginBody + + +class UpdateFiatOnRampCredentialResponse(TurnkeyBaseModel): + activity: v1Activity + fiatOnRampCredentialId: str = Field( + description="Unique identifier of the Fiat On-Ramp credential that was updated" + ) + + +class UpdateFiatOnRampCredentialBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + fiatOnrampCredentialId: str = Field( + description="The ID of the fiat on-ramp credential to update" + ) + onrampProvider: v1FiatOnRampProvider = Field( + description="The fiat on-ramp provider" + ) + projectId: Optional[str] = Field( + default=None, + description="Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier.", + ) + publishableApiKey: str = Field( + description="Publishable API key for the on-ramp provider" + ) + encryptedSecretApiKey: str = Field( + description="Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key" + ) + encryptedPrivateApiKey: Optional[str] = Field( + default=None, + description="Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key.", + ) + + +class UpdateFiatOnRampCredentialInput(TurnkeyBaseModel): + body: UpdateFiatOnRampCredentialBody + + +class UpdateOauth2CredentialResponse(TurnkeyBaseModel): + activity: v1Activity + oauth2CredentialId: str = Field( + description="Unique identifier of the OAuth 2.0 credential that was updated" + ) + + +class UpdateOauth2CredentialBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + oauth2CredentialId: str = Field( + description="The ID of the OAuth 2.0 credential to update" + ) + provider: v1Oauth2Provider = Field(description="The OAuth 2.0 provider") + clientId: str = Field(description="The Client ID issued by the OAuth 2.0 provider") + encryptedClientSecret: str = Field( + description="The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + ) + + +class UpdateOauth2CredentialInput(TurnkeyBaseModel): + body: UpdateOauth2CredentialBody + + +class UpdatePolicyResponse(TurnkeyBaseModel): + activity: v1Activity + policyId: str = Field(description="Unique identifier for a given Policy.") + + +class UpdatePolicyBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + policyId: str = Field(description="Unique identifier for a given Policy.") + policyName: Optional[str] = Field( + default=None, description="Human-readable name for a Policy." + ) + policyEffect: Optional[v1Effect] = Field( + default=None, + description="The instruction to DENY or ALLOW an activity (optional).", + ) + policyCondition: Optional[str] = Field( + default=None, + description="The condition expression that triggers the Effect (optional).", + ) + policyConsensus: Optional[str] = Field( + default=None, + description="The consensus expression that triggers the Effect (optional).", + ) + policyNotes: Optional[str] = Field( + default=None, description="Accompanying notes for a Policy (optional)." + ) + + +class UpdatePolicyInput(TurnkeyBaseModel): + body: UpdatePolicyBody + + +class UpdatePrivateKeyTagResponse(TurnkeyBaseModel): + activity: v1Activity + privateKeyTagId: str = Field( + description="Unique identifier for a given Private Key Tag." + ) + + +class UpdatePrivateKeyTagBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + privateKeyTagId: str = Field( + description="Unique identifier for a given Private Key Tag." + ) + newPrivateKeyTagName: Optional[str] = Field( + default=None, + description="The new, human-readable name for the tag with the given ID.", + ) + addPrivateKeyIds: List[str] = Field( + description="A list of Private Keys IDs to add this tag to." + ) + removePrivateKeyIds: List[str] = Field( + description="A list of Private Key IDs to remove this tag from." + ) + + +class UpdatePrivateKeyTagInput(TurnkeyBaseModel): + body: UpdatePrivateKeyTagBody + + +class UpdateRootQuorumResponse(TurnkeyBaseModel): + activity: v1Activity + + +class UpdateRootQuorumBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + threshold: int = Field( + description="The threshold of unique approvals to reach quorum." + ) + userIds: List[str] = Field( + description="The unique identifiers of users who comprise the quorum set." + ) + + +class UpdateRootQuorumInput(TurnkeyBaseModel): + body: UpdateRootQuorumBody + + +class UpdateUserResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field(description="A User ID.") + + +class UpdateUserBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given User.") + userName: Optional[str] = Field( + default=None, description="Human-readable name for a User." + ) + userEmail: Optional[str] = Field( + default=None, description="The user's email address." + ) + userTagIds: Optional[List[str]] = Field( + default=None, + description="An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body.", + ) + userPhoneNumber: Optional[str] = Field( + default=None, + description="The user's phone number in E.164 format e.g. +13214567890", + ) + + +class UpdateUserInput(TurnkeyBaseModel): + body: UpdateUserBody + + +class UpdateUserEmailResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field( + description="Unique identifier of the User whose email was updated." + ) + + +class UpdateUserEmailBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given User.") + userEmail: str = Field( + description="The user's email address. Setting this to an empty string will remove the user's email." + ) + verificationToken: Optional[str] = Field( + default=None, + description="Signed JWT containing a unique id, expiry, verification type, contact", + ) + + +class UpdateUserEmailInput(TurnkeyBaseModel): + body: UpdateUserEmailBody + + +class UpdateUserNameResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field( + description="Unique identifier of the User whose name was updated." + ) + + +class UpdateUserNameBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given User.") + userName: str = Field(description="Human-readable name for a User.") + + +class UpdateUserNameInput(TurnkeyBaseModel): + body: UpdateUserNameBody + + +class UpdateUserPhoneNumberResponse(TurnkeyBaseModel): + activity: v1Activity + userId: str = Field( + description="Unique identifier of the User whose phone number was updated." + ) + + +class UpdateUserPhoneNumberBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userId: str = Field(description="Unique identifier for a given User.") + userPhoneNumber: str = Field( + description="The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number." + ) + verificationToken: Optional[str] = Field( + default=None, + description="Signed JWT containing a unique id, expiry, verification type, contact", + ) + + +class UpdateUserPhoneNumberInput(TurnkeyBaseModel): + body: UpdateUserPhoneNumberBody + + +class UpdateUserTagResponse(TurnkeyBaseModel): + activity: v1Activity + userTagId: str = Field(description="Unique identifier for a given User Tag.") + + +class UpdateUserTagBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + userTagId: str = Field(description="Unique identifier for a given User Tag.") + newUserTagName: Optional[str] = Field( + default=None, + description="The new, human-readable name for the tag with the given ID.", + ) + addUserIds: List[str] = Field(description="A list of User IDs to add this tag to.") + removeUserIds: List[str] = Field( + description="A list of User IDs to remove this tag from." + ) + + +class UpdateUserTagInput(TurnkeyBaseModel): + body: UpdateUserTagBody + + +class UpdateWalletResponse(TurnkeyBaseModel): + activity: v1Activity + walletId: str = Field(description="A Wallet ID.") + + +class UpdateWalletBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + walletId: str = Field(description="Unique identifier for a given Wallet.") + walletName: Optional[str] = Field( + default=None, description="Human-readable name for a Wallet." + ) + + +class UpdateWalletInput(TurnkeyBaseModel): + body: UpdateWalletBody + + +class VerifyOtpResponse(TurnkeyBaseModel): + activity: v1Activity + verificationToken: str = Field( + description="Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + ) + + +class VerifyOtpBody(TurnkeyBaseModel): + timestampMs: Optional[str] = None + organizationId: Optional[str] = None + otpId: str = Field( + description="ID representing the result of an init OTP activity." + ) + otpCode: str = Field(description="OTP sent out to a user's contact (email or SMS)") + expirationSeconds: Optional[str] = Field( + default=None, + description="Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours)", + ) + publicKey: Optional[str] = Field( + default=None, + description="Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature", + ) + + +class VerifyOtpInput(TurnkeyBaseModel): + body: VerifyOtpBody + + +class NOOPCodegenAnchorResponse(TurnkeyBaseModel): + stamp: v1WebAuthnStamp + tokenUsage: Optional[v1TokenUsage] = Field(default=None) + + +class TestRateLimitsResponse(TurnkeyBaseModel): + pass + + +class TestRateLimitsBody(TurnkeyBaseModel): + organizationId: Optional[str] = None + isSetLimit: bool = Field( + description="Whether or not to set a limit on this request." + ) + limit: int = Field( + description="Rate limit to set for org, if is_set_limit is set to true." + ) + + +class TestRateLimitsInput(TurnkeyBaseModel): + body: TestRateLimitsBody diff --git a/packages/sdk-types/src/turnkey_sdk_types/types.py b/packages/sdk-types/src/turnkey_sdk_types/types.py new file mode 100644 index 0000000..ee92e2b --- /dev/null +++ b/packages/sdk-types/src/turnkey_sdk_types/types.py @@ -0,0 +1,24 @@ +"""Non-generated Turnkey SDK types.""" + +from dataclasses import dataclass +from enum import Enum + +from turnkey_api_key_stamper import TStamp + + +class RequestType(Enum): + """The type of Turnkey API request.""" + + QUERY = "query" + ACTIVITY = "activity" + ACTIVITY_DECISION = "activityDecision" + + +@dataclass +class SignedRequest: + """A signed request ready to be sent to the Turnkey API.""" + + url: str + body: str + stamp: TStamp + type: RequestType = RequestType.QUERY diff --git a/packages/sdk-types/tests/test_pydantic_aliases.py b/packages/sdk-types/tests/test_pydantic_aliases.py new file mode 100644 index 0000000..7b59938 --- /dev/null +++ b/packages/sdk-types/tests/test_pydantic_aliases.py @@ -0,0 +1,82 @@ +import json + +from turnkey_sdk_types import ( + EthSendTransactionBody, +) + + +def test_pydantic_aliases(): + """Test Pydantic field aliasing for Python keywords and special characters. + + Some API fields use Python keywords (like 'from') or special characters (like '@type') + which cannot be used as Python identifiers. We use Pydantic's Field(alias=...) to map + these to safe Python names (e.g., from_ -> "from", type -> "@type"). + + This test verifies that: + 1. Python code uses safe names (from_, type) + 2. JSON serialization uses original API names ("from", "@type") + 3. JSON parsing accepts original API names and maps to Python names + """ + print("๐Ÿ”ง Testing Pydantic Field Aliases on Generated Types") + print("=" * 50) + + # Test 1: EthSendTransactionBody with 'from' keyword field + print("\nโœ“ Test 1: EthSendTransactionBody 'from' keyword field") + + eth_tx = EthSendTransactionBody( + timestampMs="1234567890", + organizationId="test-org", + from_="0x1234567890123456789012345678901234567890", # Python name with underscore + caip2="eip155:1", + to="0xabcdefabcdefabcdefabcdefabcdefabcdefabcd", + ) + + json_dict = eth_tx.model_dump(by_alias=True, exclude_none=True) + json_str = json.dumps(json_dict, indent=2) + print(f" Python: from_='{eth_tx.from_}'") + print(f" JSON:\n{json_str}") + + assert "from" in json_dict, "Expected 'from' in JSON output" + assert "from_" not in json_dict, "Expected 'from_' to be aliased to 'from'" + assert json_dict["from"] == "0x1234567890123456789012345678901234567890" + print(" โœ… Field 'from_' correctly aliased to 'from' in JSON") + + # Test 2: Parse EthSendTransactionBody from JSON with 'from' keyword + print("\nโœ“ Test 2: Parse EthSendTransactionBody from JSON with 'from' keyword") + json_input = { + "timestampMs": "1234567890", + "organizationId": "test-org", + "from": "0x9999999999999999999999999999999999999999", + "caip2": "eip155:137", + "to": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", + } + parsed = EthSendTransactionBody.model_validate(json_input) + print(f" JSON: {json.dumps(json_input, indent=2)}") + print(f" Python: from_='{parsed.from_}', to='{parsed.to}'") + + assert parsed.from_ == "0x9999999999999999999999999999999999999999" + assert parsed.to == "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" + print(" โœ… JSON 'from' correctly parsed to Python 'from_' field") + + # Test 3: populate_by_name allows both names + print("\nโœ“ Test 3: ConfigDict(populate_by_name=True) allows both field names") + json_with_python_name = { + "timestampMs": "1234567890", + "organizationId": "test-org", + "from_": "0x7777777777777777777777777777777777777777", # Using Python name in JSON + "caip2": "eip155:1", + "to": "0x8888888888888888888888888888888888888888", + } + parsed2 = EthSendTransactionBody.model_validate(json_with_python_name) + print(f" JSON (Python name): {json.dumps(json_with_python_name, indent=2)}") + print(f" Python: from_='{parsed2.from_}'") + + assert parsed2.from_ == "0x7777777777777777777777777777777777777777" + print(" โœ… Both Python and JSON field names work for parsing") + + print("\n" + "=" * 50) + print("โœ… All Pydantic field alias tests passed!") + + +if __name__ == "__main__": + test_pydantic_aliases() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ce29e81 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "turnkey-oss" +version = "0.1.0" +description = "Turnkey Python SDK - monorepo workspace" +requires-python = ">=3.8" + +[project.optional-dependencies] +dev = [ + "mypy>=1.8.0", + "types-requests>=2.31.0", + "ruff>=0.1.0", + "pytest>=7.0.0", +] + +[tool.mypy] +python_version = "3.10" +warn_return_any = false +warn_unused_configs = true +disallow_untyped_defs = false +check_untyped_defs = false +strict_optional = true +no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = false +warn_no_return = true +follow_imports = "silent" +ignore_missing_imports = true + +# Exclude patterns +exclude = [ + "^venv/", + "^build/", + "^dist/", + "^\\.eggs/", +] diff --git a/schema/public_api.swagger.json b/schema/public_api.swagger.json new file mode 100644 index 0000000..eb60427 --- /dev/null +++ b/schema/public_api.swagger.json @@ -0,0 +1,13477 @@ +{ + "swagger": "2.0", + "info": { + "title": "API Reference", + "description": "Review our [API Introduction](../api-introduction) to get started.", + "version": "1.0", + "contact": {} + }, + "tags": [ + { + "name": "PublicApiService" + }, + { + "name": "Organizations", + "description": "An Organization is the highest level of hierarchy in Turnkey. It can contain many Users, Private Keys, and Policies managed by a Root Quorum. The Root Quorum consists of a set of Users with a consensus threshold. This consensus threshold must be reached by Quorum members in order for any actions to take place.\n\nSee [Root Quorum](../concepts/users/root-quorum) for more information" + }, + { + "name": "Invitations", + "description": "Invitations allow you to invite Users into your Organization via email. Alternatively, Users can be added directly without an Invitation if their ApiKey or Authenticator credentials are known ahead of time.\n\nSee [Users](./api#tag/Users) for more information" + }, + { + "name": "Policies", + "description": "Policies allow for deep customization of the security of your Organization. They can be used to grant permissions or restrict usage of Users and Private Keys. The Policy Engine analyzes all of your Policies on each request to determine whether an Activity is allowed.\n\nSee [Policy Overview](../managing-policies/overview) for more information" + }, + { + "name": "Wallets", + "description": "Wallets contain collections of deterministically generated cryptographic public / private key pairs that share a common seed. Turnkey securely holds the common seed, but only you can access it. In most cases, Wallets should be preferred over Private Keys since they can be represented by a mnemonic phrase, used across a variety of cryptographic curves, and can derive many addresses.\n\nDerived addresses can be used to create digital signatures using the corresponding underlying private key. See [Signing](./api#tag/Signing) for more information" + }, + { + "name": "Signing", + "description": "Signers allow you to create digital signatures. Signatures are used to validate the authenticity and integrity of a digital message. Turnkey makes it easy to produce signatures by allowing you to sign with an address. If Turnkey doesn't yet support an address format you need, you can generate and sign with the public key instead by using the address format `ADDRESS_FORMAT_COMPRESSED`." + }, + { + "name": "Private Keys", + "description": "Private Keys are cryptographic public / private key pairs that can be used for cryptocurrency needs or more generalized encryption. Turnkey securely holds all private key materials for you, but only you can access them.\n\nThe Private Key ID or any derived address can be used to create digital signatures. See [Signing](./api#tag/Signing) for more information" + }, + { + "name": "Private Key Tags", + "description": "Private Key Tags allow you to easily group and permission Private Keys through Policies." + }, + { + "name": "Users", + "description": "Users are responsible for any action taken within an Organization. They can have ApiKey or Auuthenticator credentials, allowing you to onboard teammates to the Organization, or create API-only Users to run as part of your infrastructure." + }, + { + "name": "User Tags", + "description": "User Key Tags allow you to easily group and permission Users through Policies." + }, + { + "name": "Authenticators", + "description": "Authenticators are WebAuthN hardware devices, such as a Macbook TouchID or Yubikey, that can be used to authenticate requests." + }, + { + "name": "API Keys", + "description": "API Keys are used to authenticate requests\n\nSee our [CLI](https://github.com/tkhq/tkcli) for instructions on generating API Keys" + }, + { + "name": "Activities", + "description": "Activities encapsulate all the possible actions that can be taken with Turnkey. Some examples include adding a new user, creating a private key, and signing a transaction.\n\nActivities that modify your Organization are processed asynchronously. To confirm processing is complete and retrieve the Activity results, these activities must be polled until that status has been updated to a finalized state: `COMPLETED` when the activity is successful or `FAILED` when the activity has failed" + }, + { + "name": "Consensus", + "description": "Policies can enforce consensus requirements for Activities. For example, adding a new user requires two admins to approve the request.\n\nActivities that have been proposed, but don't yet meet the Consesnsus requirements will have the status: `REQUIRES_CONSENSUS`. Activities in this state can be approved or rejected using the unique fingerprint generated when an Activity is created." + } + ], + "host": "api.turnkey.com", + "schemes": ["https"], + "consumes": ["application/json"], + "produces": ["application/json"], + "paths": { + "/public/v1/query/get_activity": { + "post": { + "summary": "Get activity", + "description": "Get details about an activity.", + "operationId": "PublicApiService_GetActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetActivityRequest" + } + } + ], + "tags": ["Activities"] + } + }, + "/public/v1/query/get_api_key": { + "post": { + "summary": "Get API key", + "description": "Get details about an API key.", + "operationId": "PublicApiService_GetApiKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetApiKeyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetApiKeyRequest" + } + } + ], + "tags": ["API keys"] + } + }, + "/public/v1/query/get_api_keys": { + "post": { + "summary": "Get API keys", + "description": "Get details about API keys for a user.", + "operationId": "PublicApiService_GetApiKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetApiKeysResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetApiKeysRequest" + } + } + ], + "tags": ["API keys"] + } + }, + "/public/v1/query/get_attestation": { + "post": { + "summary": "Attestation", + "description": "Get the attestation document corresponding to an enclave.", + "operationId": "PublicApiService_GetAttestationDocument", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAttestationDocumentResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAttestationDocumentRequest" + } + } + ], + "tags": ["Attestation"] + } + }, + "/public/v1/query/get_authenticator": { + "post": { + "summary": "Get authenticator", + "description": "Get details about an authenticator.", + "operationId": "PublicApiService_GetAuthenticator", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/query/get_authenticators": { + "post": { + "summary": "Get authenticators", + "description": "Get details about authenticators for a user.", + "operationId": "PublicApiService_GetAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/query/get_boot_proof": { + "post": { + "summary": "Get a specific boot proof", + "description": "Get the boot proof for a given ephemeral key.", + "operationId": "PublicApiService_GetBootProof", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1BootProofResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetBootProofRequest" + } + } + ], + "tags": ["Boot Proof"] + } + }, + "/public/v1/query/get_gas_usage": { + "post": { + "summary": "Get gas usage and limits.", + "description": "Get gas usage and gas limits for either the parent organization or a sub-organization.", + "operationId": "PublicApiService_GetGasUsage", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetGasUsageResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetGasUsageRequest" + } + } + ], + "tags": ["Broadcasting"] + } + }, + "/public/v1/query/get_latest_boot_proof": { + "post": { + "summary": "Get the latest boot proof for an app", + "description": "Get the latest boot proof for a given enclave app name.", + "operationId": "PublicApiService_GetLatestBootProof", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1BootProofResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetLatestBootProofRequest" + } + } + ], + "tags": ["Boot Proof"] + } + }, + "/public/v1/query/get_nonces": { + "post": { + "summary": "Get nonces for an address.", + "description": "Get nonce values for an address on a given network. Can fetch the standard on-chain nonce and/or the gas station nonce used for sponsored transactions.", + "operationId": "PublicApiService_GetNonces", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetNoncesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetNoncesRequest" + } + } + ], + "tags": ["Broadcasting"] + } + }, + "/public/v1/query/get_oauth2_credential": { + "post": { + "summary": "Get OAuth 2.0 credential", + "description": "Get details about an OAuth 2.0 credential.", + "operationId": "PublicApiService_GetOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOauth2CredentialResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOauth2CredentialRequest" + } + } + ], + "tags": ["PublicApiService"] + } + }, + "/public/v1/query/get_oauth_providers": { + "post": { + "summary": "Get Oauth providers", + "description": "Get details about Oauth providers for a user.", + "operationId": "PublicApiService_GetOauthProviders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOauthProvidersResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOauthProvidersRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/query/get_onramp_transaction_status": { + "post": { + "summary": "Get On Ramp transaction status", + "description": "Get the status of an on ramp transaction.", + "operationId": "PublicApiService_GetOnRampTransactionStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOnRampTransactionStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOnRampTransactionStatusRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/query/get_organization": { + "post": { + "summary": "Get organization", + "description": "Get details about an organization.", + "operationId": "PublicApiService_GetOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOrganizationResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/get_organization_configs": { + "post": { + "summary": "Get configs", + "description": "Get quorum settings and features for an organization.", + "operationId": "PublicApiService_GetOrganizationConfigs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetOrganizationConfigsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetOrganizationConfigsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/get_policy": { + "post": { + "summary": "Get policy", + "description": "Get details about a policy.", + "operationId": "PublicApiService_GetPolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPolicyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/get_policy_evaluations": { + "post": { + "summary": "Get policy evaluations", + "description": "Get the policy evaluations for an activity.", + "operationId": "PublicApiService_GetPolicyEvaluations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPolicyEvaluationsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPolicyEvaluationsRequest" + } + } + ], + "tags": ["Activities"] + } + }, + "/public/v1/query/get_private_key": { + "post": { + "summary": "Get private key", + "description": "Get details about a private key.", + "operationId": "PublicApiService_GetPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPrivateKeyResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/query/get_send_transaction_status": { + "post": { + "summary": "Get send transaction status", + "description": "Get the status of a send transaction request.", + "operationId": "PublicApiService_GetSendTransactionStatus", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSendTransactionStatusResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSendTransactionStatusRequest" + } + } + ], + "tags": ["Send Transactions"] + } + }, + "/public/v1/query/get_smart_contract_interface": { + "post": { + "summary": "Get smart contract interface", + "description": "Get details about a smart contract interface.", + "operationId": "PublicApiService_GetSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfaceResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/get_user": { + "post": { + "summary": "Get user", + "description": "Get details about a user.", + "operationId": "PublicApiService_GetUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetUserResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetUserRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/query/get_wallet": { + "post": { + "summary": "Get wallet", + "description": "Get details about a wallet.", + "operationId": "PublicApiService_GetWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/get_wallet_account": { + "post": { + "summary": "Get wallet account", + "description": "Get a single wallet account.", + "operationId": "PublicApiService_GetWalletAccount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletAccountResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletAccountRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/list_activities": { + "post": { + "summary": "List activities", + "description": "List all activities within an organization.", + "operationId": "PublicApiService_GetActivities", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetActivitiesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetActivitiesRequest" + } + } + ], + "tags": ["Activities"] + } + }, + "/public/v1/query/list_app_proofs": { + "post": { + "summary": "List App Proofs for an activity", + "description": "List the App Proofs for the given activity.", + "operationId": "PublicApiService_GetAppProofs", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetAppProofsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetAppProofsRequest" + } + } + ], + "tags": ["App Proof"] + } + }, + "/public/v1/query/list_fiat_on_ramp_credentials": { + "post": { + "summary": "List Fiat On Ramp Credentials", + "description": "List all fiat on ramp provider credentials within an organization.", + "operationId": "PublicApiService_ListFiatOnRampCredentials", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListFiatOnRampCredentialsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListFiatOnRampCredentialsRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/query/list_oauth2_credentials": { + "post": { + "summary": "List OAuth 2.0 Credentials", + "description": "List all OAuth 2.0 credentials within an organization.", + "operationId": "PublicApiService_ListOauth2Credentials", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListOauth2CredentialsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListOauth2CredentialsRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/query/list_policies": { + "post": { + "summary": "List policies", + "description": "List all policies within an organization.", + "operationId": "PublicApiService_GetPolicies", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPoliciesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPoliciesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/list_private_key_tags": { + "post": { + "summary": "List private key tags", + "description": "List all private key tags within an organization.", + "operationId": "PublicApiService_ListPrivateKeyTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListPrivateKeyTagsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListPrivateKeyTagsRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/query/list_private_keys": { + "post": { + "summary": "List private keys", + "description": "List all private keys within an organization.", + "operationId": "PublicApiService_GetPrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetPrivateKeysResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetPrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/query/list_smart_contract_interfaces": { + "post": { + "summary": "List smart contract interfaces", + "description": "List all smart contract interfaces within an organization.", + "operationId": "PublicApiService_GetSmartContractInterfaces", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfacesResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSmartContractInterfacesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/query/list_suborgs": { + "post": { + "summary": "Get sub-organizations", + "description": "Get all suborg IDs associated given a parent org ID and an optional filter.", + "operationId": "PublicApiService_GetSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/list_user_tags": { + "post": { + "summary": "List user tags", + "description": "List all user tags within an organization.", + "operationId": "PublicApiService_ListUserTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ListUserTagsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ListUserTagsRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/query/list_users": { + "post": { + "summary": "List users", + "description": "List all users within an organization.", + "operationId": "PublicApiService_GetUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetUsersResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/query/list_verified_suborgs": { + "post": { + "summary": "Get verified sub-organizations", + "description": "Get all email or phone verified suborg IDs associated given a parent org ID.", + "operationId": "PublicApiService_GetVerifiedSubOrgIds", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetVerifiedSubOrgIdsRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/query/list_wallet_accounts": { + "post": { + "summary": "List wallets accounts", + "description": "List all accounts within a wallet.", + "operationId": "PublicApiService_GetWalletAccounts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletAccountsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletAccountsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/list_wallets": { + "post": { + "summary": "List wallets", + "description": "List all wallets within an organization.", + "operationId": "PublicApiService_GetWallets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWalletsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWalletsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/query/whoami": { + "post": { + "summary": "Who am I?", + "description": "Get basic information about your current API or WebAuthN user and their organization. Affords sub-organization look ups via parent organization for WebAuthN or API key users.", + "operationId": "PublicApiService_GetWhoami", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1GetWhoamiResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1GetWhoamiRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/approve_activity": { + "post": { + "summary": "Approve activity", + "description": "Approve an activity.", + "operationId": "PublicApiService_ApproveActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ApproveActivityRequest" + } + } + ], + "tags": ["Consensus"] + } + }, + "/public/v1/submit/create_api_keys": { + "post": { + "summary": "Create API keys", + "description": "Add API keys to an existing user.", + "operationId": "PublicApiService_CreateApiKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateApiKeysRequest" + } + } + ], + "tags": ["API Keys"] + } + }, + "/public/v1/submit/create_api_only_users": { + "post": { + "summary": "Create API-only users", + "description": "Create API-only users in an existing organization.", + "operationId": "PublicApiService_CreateApiOnlyUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateApiOnlyUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/create_authenticators": { + "post": { + "summary": "Create authenticators", + "description": "Create authenticators to authenticate requests to Turnkey.", + "operationId": "PublicApiService_CreateAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/submit/create_fiat_on_ramp_credential": { + "post": { + "summary": "Create a Fiat On Ramp Credential", + "description": "Create a fiat on ramp provider credential", + "operationId": "PublicApiService_CreateFiatOnRampCredential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateFiatOnRampCredentialRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/submit/create_invitations": { + "post": { + "summary": "Create invitations", + "description": "Create invitations to join an existing organization.", + "operationId": "PublicApiService_CreateInvitations", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateInvitationsRequest" + } + } + ], + "tags": ["Invitations"] + } + }, + "/public/v1/submit/create_oauth2_credential": { + "post": { + "summary": "Create an OAuth 2.0 Credential", + "description": "Enable authentication for end users with an OAuth 2.0 provider", + "operationId": "PublicApiService_CreateOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/create_oauth_providers": { + "post": { + "summary": "Create Oauth providers", + "description": "Create Oauth providers for a specified user.", + "operationId": "PublicApiService_CreateOauthProviders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateOauthProvidersRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/create_policies": { + "post": { + "summary": "Create policies", + "description": "Create new policies.", + "operationId": "PublicApiService_CreatePolicies", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePoliciesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/create_policy": { + "post": { + "summary": "Create policy", + "description": "Create a new policy.", + "operationId": "PublicApiService_CreatePolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/create_private_key_tag": { + "post": { + "summary": "Create private key tag", + "description": "Create a private key tag and add it to private keys.", + "operationId": "PublicApiService_CreatePrivateKeyTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePrivateKeyTagRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/submit/create_private_keys": { + "post": { + "summary": "Create private keys", + "description": "Create new private keys.", + "operationId": "PublicApiService_CreatePrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreatePrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/create_read_only_session": { + "post": { + "summary": "Create read only session", + "description": "Create a read only session for a user (valid for 1 hour).", + "operationId": "PublicApiService_CreateReadOnlySession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateReadOnlySessionRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/create_read_write_session": { + "post": { + "summary": "Create read write session", + "description": "Create a read write session for a user.", + "operationId": "PublicApiService_CreateReadWriteSession", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateReadWriteSessionRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/create_smart_contract_interface": { + "post": { + "summary": "Create smart contract interface", + "description": "Create an ABI/IDL in JSON.", + "operationId": "PublicApiService_CreateSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/create_sub_organization": { + "post": { + "summary": "Create sub-organization", + "description": "Create a new sub-organization.", + "operationId": "PublicApiService_CreateSubOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateSubOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/submit/create_user_tag": { + "post": { + "summary": "Create user tag", + "description": "Create a user tag and add it to users.", + "operationId": "PublicApiService_CreateUserTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateUserTagRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/create_users": { + "post": { + "summary": "Create users", + "description": "Create users in an existing organization.", + "operationId": "PublicApiService_CreateUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/create_wallet": { + "post": { + "summary": "Create wallet", + "description": "Create a wallet and derive addresses.", + "operationId": "PublicApiService_CreateWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/create_wallet_accounts": { + "post": { + "summary": "Create wallet accounts", + "description": "Derive additional addresses using an existing wallet.", + "operationId": "PublicApiService_CreateWalletAccounts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1CreateWalletAccountsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/delete_api_keys": { + "post": { + "summary": "Delete API keys", + "description": "Remove api keys from a user.", + "operationId": "PublicApiService_DeleteApiKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteApiKeysRequest" + } + } + ], + "tags": ["API Keys"] + } + }, + "/public/v1/submit/delete_authenticators": { + "post": { + "summary": "Delete authenticators", + "description": "Remove authenticators from a user.", + "operationId": "PublicApiService_DeleteAuthenticators", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteAuthenticatorsRequest" + } + } + ], + "tags": ["Authenticators"] + } + }, + "/public/v1/submit/delete_fiat_on_ramp_credential": { + "post": { + "summary": "Delete a Fiat On Ramp Credential", + "description": "Delete a fiat on ramp provider credential", + "operationId": "PublicApiService_DeleteFiatOnRampCredential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteFiatOnRampCredentialRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/submit/delete_invitation": { + "post": { + "summary": "Delete invitation", + "description": "Delete an existing invitation.", + "operationId": "PublicApiService_DeleteInvitation", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteInvitationRequest" + } + } + ], + "tags": ["Invitations"] + } + }, + "/public/v1/submit/delete_oauth2_credential": { + "post": { + "summary": "Delete an OAuth 2.0 Credential", + "description": "Disable authentication for end users with an OAuth 2.0 provider", + "operationId": "PublicApiService_DeleteOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/delete_oauth_providers": { + "post": { + "summary": "Delete Oauth providers", + "description": "Remove Oauth providers for a specified user.", + "operationId": "PublicApiService_DeleteOauthProviders", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteOauthProvidersRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/delete_policies": { + "post": { + "summary": "Delete policies", + "description": "Delete existing policies.", + "operationId": "PublicApiService_DeletePolicies", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePoliciesRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/delete_policy": { + "post": { + "summary": "Delete policy", + "description": "Delete an existing policy.", + "operationId": "PublicApiService_DeletePolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/delete_private_key_tags": { + "post": { + "summary": "Delete private key tags", + "description": "Delete private key tags within an organization.", + "operationId": "PublicApiService_DeletePrivateKeyTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/submit/delete_private_keys": { + "post": { + "summary": "Delete private keys", + "description": "Delete private keys for an organization.", + "operationId": "PublicApiService_DeletePrivateKeys", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeletePrivateKeysRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/delete_smart_contract_interface": { + "post": { + "summary": "Delete smart contract interface", + "description": "Delete a smart contract interface.", + "operationId": "PublicApiService_DeleteSmartContractInterface", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/delete_sub_organization": { + "post": { + "summary": "Delete sub-organization", + "description": "Delete a sub-organization.", + "operationId": "PublicApiService_DeleteSubOrganization", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteSubOrganizationRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/submit/delete_user_tags": { + "post": { + "summary": "Delete user tags", + "description": "Delete user tags within an organization.", + "operationId": "PublicApiService_DeleteUserTags", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteUserTagsRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/delete_users": { + "post": { + "summary": "Delete users", + "description": "Delete users within an organization.", + "operationId": "PublicApiService_DeleteUsers", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteUsersRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/delete_wallet_accounts": { + "post": { + "summary": "Delete wallet accounts", + "description": "Delete wallet accounts for an organization.", + "operationId": "PublicApiService_DeleteWalletAccounts", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteWalletAccountsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/delete_wallets": { + "post": { + "summary": "Delete wallets", + "description": "Delete wallets for an organization.", + "operationId": "PublicApiService_DeleteWallets", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1DeleteWalletsRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/email_auth": { + "post": { + "summary": "Perform email auth", + "description": "Authenticate a user via email.", + "operationId": "PublicApiService_EmailAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1EmailAuthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/eth_send_raw_transaction": { + "post": { + "summary": "Submit a raw transaction for broadcasting.", + "description": "Submit a raw transaction (serialized and signed) for broadcasting to the network.", + "operationId": "PublicApiService_EthSendRawTransaction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1EthSendRawTransactionRequest" + } + } + ], + "tags": ["Broadcasting"] + } + }, + "/public/v1/submit/eth_send_transaction": { + "post": { + "summary": "Submit a transaction intent for broadcasting.", + "description": "Submit a transaction intent describing a transaction you would like to broadcast.", + "operationId": "PublicApiService_EthSendTransaction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1EthSendTransactionRequest" + } + } + ], + "tags": ["Broadcasting"] + } + }, + "/public/v1/submit/export_private_key": { + "post": { + "summary": "Export private key", + "description": "Export a private key.", + "operationId": "PublicApiService_ExportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/export_wallet": { + "post": { + "summary": "Export wallet", + "description": "Export a wallet.", + "operationId": "PublicApiService_ExportWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExportWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/export_wallet_account": { + "post": { + "summary": "Export wallet account", + "description": "Export a wallet account.", + "operationId": "PublicApiService_ExportWalletAccount", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ExportWalletAccountRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/import_private_key": { + "post": { + "summary": "Import private key", + "description": "Import a private key.", + "operationId": "PublicApiService_ImportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ImportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/import_wallet": { + "post": { + "summary": "Import wallet", + "description": "Import a wallet.", + "operationId": "PublicApiService_ImportWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1ImportWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/init_fiat_on_ramp": { + "post": { + "summary": "Init fiat on ramp", + "description": "Initiate a fiat on ramp flow.", + "operationId": "PublicApiService_InitFiatOnRamp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitFiatOnRampRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/submit/init_import_private_key": { + "post": { + "summary": "Init import private key", + "description": "Initialize a new private key import.", + "operationId": "PublicApiService_InitImportPrivateKey", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitImportPrivateKeyRequest" + } + } + ], + "tags": ["Private Keys"] + } + }, + "/public/v1/submit/init_import_wallet": { + "post": { + "summary": "Init import wallet", + "description": "Initialize a new wallet import.", + "operationId": "PublicApiService_InitImportWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitImportWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/init_otp": { + "post": { + "summary": "Init generic OTP", + "description": "Initiate a generic OTP activity.", + "operationId": "PublicApiService_InitOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitOtpRequest" + } + } + ], + "tags": ["User Verification"] + } + }, + "/public/v1/submit/init_otp_auth": { + "post": { + "summary": "Init OTP auth", + "description": "Initiate an OTP auth activity.", + "operationId": "PublicApiService_InitOtpAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitOtpAuthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/init_user_email_recovery": { + "post": { + "summary": "Init email recovery", + "description": "Initialize a new email recovery.", + "operationId": "PublicApiService_InitUserEmailRecovery", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1InitUserEmailRecoveryRequest" + } + } + ], + "tags": ["User Recovery"] + } + }, + "/public/v1/submit/oauth": { + "post": { + "summary": "Oauth", + "description": "Authenticate a user with an OIDC token (Oauth).", + "operationId": "PublicApiService_Oauth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OauthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/oauth2_authenticate": { + "post": { + "summary": "OAuth 2.0 authentication", + "description": "Authenticate a user with an OAuth 2.0 provider and receive an OIDC token to use with the LoginWithOAuth or CreateSubOrganization activities", + "operationId": "PublicApiService_Oauth2Authenticate", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1Oauth2AuthenticateRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/oauth_login": { + "post": { + "summary": "Login with Oauth", + "description": "Create an Oauth session for a user.", + "operationId": "PublicApiService_OauthLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OauthLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/otp_auth": { + "post": { + "summary": "OTP auth", + "description": "Authenticate a user with an OTP code sent via email or SMS.", + "operationId": "PublicApiService_OtpAuth", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OtpAuthRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/otp_login": { + "post": { + "summary": "Login with OTP", + "description": "Create an OTP session for a user.", + "operationId": "PublicApiService_OtpLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1OtpLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/recover_user": { + "post": { + "summary": "Recover a user", + "description": "Complete the process of recovering a user by adding an authenticator.", + "operationId": "PublicApiService_RecoverUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RecoverUserRequest" + } + } + ], + "tags": ["User Recovery"] + } + }, + "/public/v1/submit/reject_activity": { + "post": { + "summary": "Reject activity", + "description": "Reject an activity.", + "operationId": "PublicApiService_RejectActivity", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RejectActivityRequest" + } + } + ], + "tags": ["Consensus"] + } + }, + "/public/v1/submit/remove_organization_feature": { + "post": { + "summary": "Remove organization feature", + "description": "Remove an organization feature. This activity must be approved by the current root quorum.", + "operationId": "PublicApiService_RemoveOrganizationFeature", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureRequest" + } + } + ], + "tags": ["Features"] + } + }, + "/public/v1/submit/set_organization_feature": { + "post": { + "summary": "Set organization feature", + "description": "Set an organization feature. This activity must be approved by the current root quorum.", + "operationId": "PublicApiService_SetOrganizationFeature", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SetOrganizationFeatureRequest" + } + } + ], + "tags": ["Features"] + } + }, + "/public/v1/submit/sign_raw_payload": { + "post": { + "summary": "Sign raw payload", + "description": "Sign a raw payload.", + "operationId": "PublicApiService_SignRawPayload", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignRawPayloadRequest" + } + } + ], + "tags": ["Signing"] + } + }, + "/public/v1/submit/sign_raw_payloads": { + "post": { + "summary": "Sign raw payloads", + "description": "Sign multiple raw payloads with the same signing parameters.", + "operationId": "PublicApiService_SignRawPayloads", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignRawPayloadsRequest" + } + } + ], + "tags": ["Signing"] + } + }, + "/public/v1/submit/sign_transaction": { + "post": { + "summary": "Sign transaction", + "description": "Sign a transaction.", + "operationId": "PublicApiService_SignTransaction", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1SignTransactionRequest" + } + } + ], + "tags": ["Signing"] + } + }, + "/public/v1/submit/stamp_login": { + "post": { + "summary": "Login with a stamp", + "description": "Create a session for a user through stamping client side (API key, wallet client, or passkey client).", + "operationId": "PublicApiService_StampLogin", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1StampLoginRequest" + } + } + ], + "tags": ["Sessions"] + } + }, + "/public/v1/submit/update_fiat_on_ramp_credential": { + "post": { + "summary": "Update a Fiat On Ramp Credential", + "description": "Update a fiat on ramp provider credential", + "operationId": "PublicApiService_UpdateFiatOnRampCredential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateFiatOnRampCredentialRequest" + } + } + ], + "tags": ["On Ramp"] + } + }, + "/public/v1/submit/update_oauth2_credential": { + "post": { + "summary": "Update an OAuth 2.0 Credential", + "description": "Update an OAuth 2.0 provider credential", + "operationId": "PublicApiService_UpdateOauth2Credential", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateOauth2CredentialRequest" + } + } + ], + "tags": ["User Auth"] + } + }, + "/public/v1/submit/update_policy": { + "post": { + "summary": "Update policy", + "description": "Update an existing policy.", + "operationId": "PublicApiService_UpdatePolicy", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdatePolicyRequest" + } + } + ], + "tags": ["Policies"] + } + }, + "/public/v1/submit/update_private_key_tag": { + "post": { + "summary": "Update private key tag", + "description": "Update human-readable name or associated private keys. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "PublicApiService_UpdatePrivateKeyTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagRequest" + } + } + ], + "tags": ["Private Key Tags"] + } + }, + "/public/v1/submit/update_root_quorum": { + "post": { + "summary": "Update root quorum", + "description": "Set the threshold and members of the root quorum. This activity must be approved by the current root quorum.", + "operationId": "PublicApiService_UpdateRootQuorum", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateRootQuorumRequest" + } + } + ], + "tags": ["Organizations"] + } + }, + "/public/v1/submit/update_user": { + "post": { + "summary": "Update user", + "description": "Update a user in an existing organization.", + "operationId": "PublicApiService_UpdateUser", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_email": { + "post": { + "summary": "Update user's email", + "description": "Update a user's email in an existing organization.", + "operationId": "PublicApiService_UpdateUserEmail", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserEmailRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_name": { + "post": { + "summary": "Update user's name", + "description": "Update a user's name in an existing organization.", + "operationId": "PublicApiService_UpdateUserName", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserNameRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_phone_number": { + "post": { + "summary": "Update user's phone number", + "description": "Update a user's phone number in an existing organization.", + "operationId": "PublicApiService_UpdateUserPhoneNumber", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberRequest" + } + } + ], + "tags": ["Users"] + } + }, + "/public/v1/submit/update_user_tag": { + "post": { + "summary": "Update user tag", + "description": "Update human-readable name or associated users. Note that this activity is atomic: all of the updates will succeed at once, or all of them will fail.", + "operationId": "PublicApiService_UpdateUserTag", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateUserTagRequest" + } + } + ], + "tags": ["User Tags"] + } + }, + "/public/v1/submit/update_wallet": { + "post": { + "summary": "Update wallet", + "description": "Update a wallet for an organization.", + "operationId": "PublicApiService_UpdateWallet", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1UpdateWalletRequest" + } + } + ], + "tags": ["Wallets"] + } + }, + "/public/v1/submit/verify_otp": { + "post": { + "summary": "Verify generic OTP", + "description": "Verify a generic OTP.", + "operationId": "PublicApiService_VerifyOtp", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1ActivityResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1VerifyOtpRequest" + } + } + ], + "tags": ["User Verification"] + } + }, + "/tkhq/api/v1/noop-codegen-anchor": { + "post": { + "operationId": "PublicApiService_NOOPCodegenAnchor", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1NOOPCodegenAnchorResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": ["PublicApiService"] + } + }, + "/tkhq/api/v1/test_rate_limits": { + "post": { + "summary": "Test rate limit", + "description": "Set a rate local rate limit just on the current endpoint, for purposes of testing with Vivosuite.", + "operationId": "PublicApiService_TestRateLimits", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/v1TestRateLimitsResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/v1TestRateLimitsRequest" + } + } + ], + "tags": ["RateLimit"] + } + } + }, + "definitions": { + "apiApiKeyParams": { + "type": "object", + "properties": { + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "expirationSeconds": { + "type": "string", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": ["apiKeyName", "publicKey"] + }, + "billingActivateBillingTierIntent": { + "type": "object", + "properties": { + "productId": { + "type": "string", + "description": "The product that the customer wants to subscribe to." + } + }, + "required": ["productId"] + }, + "billingActivateBillingTierResult": { + "type": "object", + "properties": { + "productId": { + "type": "string", + "description": "The id of the product being subscribed to." + } + }, + "required": ["productId"] + }, + "billingDeletePaymentMethodIntent": { + "type": "object", + "properties": { + "paymentMethodId": { + "type": "string", + "description": "The payment method that the customer wants to remove." + } + }, + "required": ["paymentMethodId"] + }, + "billingDeletePaymentMethodResult": { + "type": "object", + "properties": { + "paymentMethodId": { + "type": "string", + "description": "The payment method that was removed." + } + }, + "required": ["paymentMethodId"] + }, + "billingSetPaymentMethodIntent": { + "type": "object", + "properties": { + "number": { + "type": "string", + "description": "The account number of the customer's credit card." + }, + "cvv": { + "type": "string", + "description": "The verification digits of the customer's credit card." + }, + "expiryMonth": { + "type": "string", + "description": "The month that the credit card expires." + }, + "expiryYear": { + "type": "string", + "description": "The year that the credit card expires." + }, + "cardHolderEmail": { + "type": "string", + "description": "The email that will receive invoices for the credit card." + }, + "cardHolderName": { + "type": "string", + "description": "The name associated with the credit card." + } + }, + "required": [ + "number", + "cvv", + "expiryMonth", + "expiryYear", + "cardHolderEmail", + "cardHolderName" + ] + }, + "billingSetPaymentMethodIntentV2": { + "type": "object", + "properties": { + "paymentMethodId": { + "type": "string", + "description": "The id of the payment method that was created clientside." + }, + "cardHolderEmail": { + "type": "string", + "description": "The email that will receive invoices for the credit card." + }, + "cardHolderName": { + "type": "string", + "description": "The name associated with the credit card." + } + }, + "required": ["paymentMethodId", "cardHolderEmail", "cardHolderName"] + }, + "billingSetPaymentMethodResult": { + "type": "object", + "properties": { + "lastFour": { + "type": "string", + "description": "The last four digits of the credit card added." + }, + "cardHolderName": { + "type": "string", + "description": "The name associated with the payment method." + }, + "cardHolderEmail": { + "type": "string", + "description": "The email address associated with the payment method." + } + }, + "required": ["lastFour", "cardHolderName", "cardHolderEmail"] + }, + "datav1Tag": { + "type": "object", + "properties": { + "tagId": { + "type": "string", + "description": "Unique identifier for a given Tag." + }, + "tagName": { + "type": "string", + "description": "Human-readable name for a Tag." + }, + "tagType": { + "$ref": "#/definitions/v1TagType" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": ["tagId", "tagName", "tagType", "createdAt", "updatedAt"] + }, + "externalactivityv1PolicyEvaluation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given policy evaluation." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given Activity." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for the Organization the Activity belongs to." + }, + "voteId": { + "type": "string", + "description": "Unique identifier for the Vote associated with this policy evaluation." + }, + "policyEvaluations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/immutablecommonv1PolicyEvaluation" + }, + "description": "Detailed evaluation result for each Policy that was run." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "id", + "activityId", + "organizationId", + "voteId", + "policyEvaluations", + "createdAt" + ] + }, + "externaldatav1Address": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/v1AddressFormat" + }, + "address": { + "type": "string" + } + } + }, + "externaldatav1Credential": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "type": { + "$ref": "#/definitions/v1CredentialType" + } + }, + "required": ["publicKey", "type"] + }, + "externaldatav1Quorum": { + "type": "object", + "properties": { + "threshold": { + "type": "integer", + "format": "int32", + "description": "Count of unique approvals required to meet quorum." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique identifiers of quorum set members." + } + }, + "required": ["threshold", "userIds"] + }, + "externaldatav1SignatureScheme": { + "type": "string", + "enum": ["SIGNATURE_SCHEME_EPHEMERAL_KEY_P256"] + }, + "externaldatav1SmartContractInterface": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "The Organization the Smart Contract Interface belongs to." + }, + "smartContractInterfaceId": { + "type": "string", + "description": "Unique identifier for a given Smart Contract Interface (ABI or IDL)." + }, + "smartContractAddress": { + "type": "string", + "description": "The address corresponding to the Smart Contract or Program." + }, + "smartContractInterface": { + "type": "string", + "description": "The JSON corresponding to the Smart Contract Interface (ABI or IDL)." + }, + "type": { + "type": "string", + "description": "The type corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "label": { + "type": "string", + "description": "The label corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "notes": { + "type": "string", + "description": "The notes corresponding to the Smart Contract Interface (either ETHEREUM or SOLANA)." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "organizationId", + "smartContractInterfaceId", + "smartContractAddress", + "smartContractInterface", + "type", + "label", + "notes", + "createdAt", + "updatedAt" + ] + }, + "externaldatav1Timestamp": { + "type": "object", + "properties": { + "seconds": { + "type": "string" + }, + "nanos": { + "type": "string" + } + }, + "required": ["seconds", "nanos"] + }, + "immutableactivityv1Address": { + "type": "object", + "properties": { + "format": { + "$ref": "#/definitions/v1AddressFormat" + }, + "address": { + "type": "string" + } + } + }, + "immutablecommonv1PolicyEvaluation": { + "type": "object", + "properties": { + "policyId": { + "type": "string" + }, + "outcome": { + "$ref": "#/definitions/v1Outcome" + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "@type": { + "type": "string" + } + }, + "additionalProperties": {} + }, + "rpcStatus": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/protobufAny" + } + } + } + }, + "v1AcceptInvitationIntent": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParams", + "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." + } + }, + "required": ["invitationId", "userId", "authenticator"] + }, + "v1AcceptInvitationIntentV2": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "WebAuthN hardware devices that can be used to log in to the Turnkey web app." + } + }, + "required": ["invitationId", "userId", "authenticator"] + }, + "v1AcceptInvitationResult": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["invitationId", "userId"] + }, + "v1AccessType": { + "type": "string", + "enum": ["ACCESS_TYPE_WEB", "ACCESS_TYPE_API", "ACCESS_TYPE_ALL"] + }, + "v1Activity": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given Activity object." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "status": { + "$ref": "#/definitions/v1ActivityStatus", + "description": "The current processing status of a specified Activity." + }, + "type": { + "$ref": "#/definitions/v1ActivityType", + "description": "Type of Activity, such as Add User, or Sign Transaction." + }, + "intent": { + "$ref": "#/definitions/v1Intent", + "description": "Intent object crafted by Turnkey based on the user request, used to assess the permissibility of an action." + }, + "result": { + "$ref": "#/definitions/v1Result", + "description": "Result of the intended action." + }, + "votes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Vote" + }, + "description": "A list of objects representing a particular User's approval or rejection of a Consensus request, including all relevant metadata." + }, + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AppProof" + }, + "description": "A list of App Proofs generated by enclaves during activity execution, providing verifiable attestations of performed operations." + }, + "fingerprint": { + "type": "string", + "description": "An artifact verifying a User's action." + }, + "canApprove": { + "type": "boolean" + }, + "canReject": { + "type": "boolean" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "failure": { + "$ref": "#/definitions/rpcStatus", + "description": "Failure reason of the intended action." + } + }, + "required": [ + "id", + "organizationId", + "status", + "type", + "intent", + "result", + "votes", + "fingerprint", + "canApprove", + "canReject", + "createdAt", + "updatedAt" + ] + }, + "v1ActivityResponse": { + "type": "object", + "properties": { + "activity": { + "$ref": "#/definitions/v1Activity", + "description": "An action that can be taken within the Turnkey infrastructure." + } + }, + "required": ["activity"] + }, + "v1ActivityStatus": { + "type": "string", + "enum": [ + "ACTIVITY_STATUS_CREATED", + "ACTIVITY_STATUS_PENDING", + "ACTIVITY_STATUS_COMPLETED", + "ACTIVITY_STATUS_FAILED", + "ACTIVITY_STATUS_CONSENSUS_NEEDED", + "ACTIVITY_STATUS_REJECTED" + ] + }, + "v1ActivityType": { + "type": "string", + "enum": [ + "ACTIVITY_TYPE_CREATE_API_KEYS", + "ACTIVITY_TYPE_CREATE_USERS", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD", + "ACTIVITY_TYPE_CREATE_INVITATIONS", + "ACTIVITY_TYPE_ACCEPT_INVITATION", + "ACTIVITY_TYPE_CREATE_POLICY", + "ACTIVITY_TYPE_DISABLE_PRIVATE_KEY", + "ACTIVITY_TYPE_DELETE_USERS", + "ACTIVITY_TYPE_DELETE_API_KEYS", + "ACTIVITY_TYPE_DELETE_INVITATION", + "ACTIVITY_TYPE_DELETE_ORGANIZATION", + "ACTIVITY_TYPE_DELETE_POLICY", + "ACTIVITY_TYPE_CREATE_USER_TAG", + "ACTIVITY_TYPE_DELETE_USER_TAGS", + "ACTIVITY_TYPE_CREATE_ORGANIZATION", + "ACTIVITY_TYPE_SIGN_TRANSACTION", + "ACTIVITY_TYPE_APPROVE_ACTIVITY", + "ACTIVITY_TYPE_REJECT_ACTIVITY", + "ACTIVITY_TYPE_DELETE_AUTHENTICATORS", + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG", + "ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS", + "ACTIVITY_TYPE_SET_PAYMENT_METHOD", + "ACTIVITY_TYPE_ACTIVATE_BILLING_TIER", + "ACTIVITY_TYPE_DELETE_PAYMENT_METHOD", + "ACTIVITY_TYPE_CREATE_POLICY_V2", + "ACTIVITY_TYPE_CREATE_POLICY_V3", + "ACTIVITY_TYPE_CREATE_API_ONLY_USERS", + "ACTIVITY_TYPE_UPDATE_ROOT_QUORUM", + "ACTIVITY_TYPE_UPDATE_USER_TAG", + "ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG", + "ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2", + "ACTIVITY_TYPE_CREATE_ORGANIZATION_V2", + "ACTIVITY_TYPE_CREATE_USERS_V2", + "ACTIVITY_TYPE_ACCEPT_INVITATION_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V2", + "ACTIVITY_TYPE_UPDATE_ALLOWED_ORIGINS", + "ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2", + "ACTIVITY_TYPE_UPDATE_USER", + "ACTIVITY_TYPE_UPDATE_POLICY", + "ACTIVITY_TYPE_SET_PAYMENT_METHOD_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V3", + "ACTIVITY_TYPE_CREATE_WALLET", + "ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS", + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY", + "ACTIVITY_TYPE_RECOVER_USER", + "ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE", + "ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2", + "ACTIVITY_TYPE_SIGN_TRANSACTION_V2", + "ACTIVITY_TYPE_EXPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_EXPORT_WALLET", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4", + "ACTIVITY_TYPE_EMAIL_AUTH", + "ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT", + "ACTIVITY_TYPE_INIT_IMPORT_WALLET", + "ACTIVITY_TYPE_IMPORT_WALLET", + "ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_IMPORT_PRIVATE_KEY", + "ACTIVITY_TYPE_CREATE_POLICIES", + "ACTIVITY_TYPE_SIGN_RAW_PAYLOADS", + "ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION", + "ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS", + "ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V5", + "ACTIVITY_TYPE_OAUTH", + "ACTIVITY_TYPE_CREATE_API_KEYS_V2", + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION", + "ACTIVITY_TYPE_EMAIL_AUTH_V2", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V6", + "ACTIVITY_TYPE_DELETE_PRIVATE_KEYS", + "ACTIVITY_TYPE_DELETE_WALLETS", + "ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2", + "ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION", + "ACTIVITY_TYPE_INIT_OTP_AUTH", + "ACTIVITY_TYPE_OTP_AUTH", + "ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7", + "ACTIVITY_TYPE_UPDATE_WALLET", + "ACTIVITY_TYPE_UPDATE_POLICY_V2", + "ACTIVITY_TYPE_CREATE_USERS_V3", + "ACTIVITY_TYPE_INIT_OTP_AUTH_V2", + "ACTIVITY_TYPE_INIT_OTP", + "ACTIVITY_TYPE_VERIFY_OTP", + "ACTIVITY_TYPE_OTP_LOGIN", + "ACTIVITY_TYPE_STAMP_LOGIN", + "ACTIVITY_TYPE_OAUTH_LOGIN", + "ACTIVITY_TYPE_UPDATE_USER_NAME", + "ACTIVITY_TYPE_UPDATE_USER_EMAIL", + "ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER", + "ACTIVITY_TYPE_INIT_FIAT_ON_RAMP", + "ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE", + "ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE", + "ACTIVITY_TYPE_ENABLE_AUTH_PROXY", + "ACTIVITY_TYPE_DISABLE_AUTH_PROXY", + "ACTIVITY_TYPE_UPDATE_AUTH_PROXY_CONFIG", + "ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL", + "ACTIVITY_TYPE_OAUTH2_AUTHENTICATE", + "ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS", + "ACTIVITY_TYPE_DELETE_POLICIES", + "ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION", + "ACTIVITY_TYPE_ETH_SEND_TRANSACTION", + "ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL", + "ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL", + "ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL", + "ACTIVITY_TYPE_EMAIL_AUTH_V3", + "ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2", + "ACTIVITY_TYPE_INIT_OTP_AUTH_V3", + "ACTIVITY_TYPE_INIT_OTP_V2", + "ACTIVITY_TYPE_UPSERT_GAS_USAGE_CONFIG" + ] + }, + "v1AddressFormat": { + "type": "string", + "enum": [ + "ADDRESS_FORMAT_UNCOMPRESSED", + "ADDRESS_FORMAT_COMPRESSED", + "ADDRESS_FORMAT_ETHEREUM", + "ADDRESS_FORMAT_SOLANA", + "ADDRESS_FORMAT_COSMOS", + "ADDRESS_FORMAT_TRON", + "ADDRESS_FORMAT_SUI", + "ADDRESS_FORMAT_APTOS", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_MAINNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_TESTNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2PKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2SH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2WSH", + "ADDRESS_FORMAT_BITCOIN_SIGNET_P2TR", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2PKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2SH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WPKH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2WSH", + "ADDRESS_FORMAT_BITCOIN_REGTEST_P2TR", + "ADDRESS_FORMAT_SEI", + "ADDRESS_FORMAT_XLM", + "ADDRESS_FORMAT_DOGE_MAINNET", + "ADDRESS_FORMAT_DOGE_TESTNET", + "ADDRESS_FORMAT_TON_V3R2", + "ADDRESS_FORMAT_TON_V4R2", + "ADDRESS_FORMAT_TON_V5R1", + "ADDRESS_FORMAT_XRP" + ] + }, + "v1ApiKey": { + "type": "object", + "properties": { + "credential": { + "$ref": "#/definitions/externaldatav1Credential", + "description": "A User credential that can be used to authenticate to Turnkey." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for a given API Key." + }, + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "expirationSeconds": { + "type": "string", + "format": "uint64", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": [ + "credential", + "apiKeyId", + "apiKeyName", + "createdAt", + "updatedAt" + ] + }, + "v1ApiKeyCurve": { + "type": "string", + "enum": [ + "API_KEY_CURVE_P256", + "API_KEY_CURVE_SECP256K1", + "API_KEY_CURVE_ED25519" + ] + }, + "v1ApiKeyParamsV2": { + "type": "object", + "properties": { + "apiKeyName": { + "type": "string", + "description": "Human-readable name for an API Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "curveType": { + "$ref": "#/definitions/v1ApiKeyCurve", + "description": "The curve type to be used for processing API key signatures." + }, + "expirationSeconds": { + "type": "string", + "description": "Optional window (in seconds) indicating how long the API Key should last." + } + }, + "required": ["apiKeyName", "publicKey", "curveType"] + }, + "v1ApiOnlyUserParams": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "The name of the new API-only User." + }, + "userEmail": { + "type": "string", + "description": "The email address for this API-only User (optional)." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags assigned to the new API-only User. This field, if not needed, should be an empty array in your request body." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "userTags", "apiKeys"] + }, + "v1AppProof": { + "type": "object", + "properties": { + "scheme": { + "$ref": "#/definitions/externaldatav1SignatureScheme", + "description": "Scheme of signing key." + }, + "publicKey": { + "type": "string", + "description": "Ephemeral public key." + }, + "proofPayload": { + "type": "string", + "description": "JSON serialized AppProofPayload." + }, + "signature": { + "type": "string", + "description": "Signature over hashed proof_payload." + } + }, + "required": ["scheme", "publicKey", "proofPayload", "signature"] + }, + "v1ApproveActivityIntent": { + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "An artifact verifying a User's action." + } + }, + "required": ["fingerprint"] + }, + "v1ApproveActivityRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_APPROVE_ACTIVITY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ApproveActivityIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1Attestation": { + "type": "object", + "properties": { + "credentialId": { + "type": "string", + "description": "The cbor encoded then base64 url encoded id of the credential." + }, + "clientDataJson": { + "type": "string", + "description": "A base64 url encoded payload containing metadata about the signing context and the challenge." + }, + "attestationObject": { + "type": "string", + "description": "A base64 url encoded payload containing authenticator data and any attestation the webauthn provider chooses." + }, + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + }, + "description": "The type of authenticator transports." + } + }, + "required": [ + "credentialId", + "clientDataJson", + "attestationObject", + "transports" + ] + }, + "v1Authenticator": { + "type": "object", + "properties": { + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + }, + "description": "Types of transports that may be used by an Authenticator (e.g., USB, NFC, BLE)." + }, + "attestationType": { + "type": "string" + }, + "aaguid": { + "type": "string", + "description": "Identifier indicating the type of the Security Key." + }, + "credentialId": { + "type": "string", + "description": "Unique identifier for a WebAuthn credential." + }, + "model": { + "type": "string", + "description": "The type of Authenticator device." + }, + "credential": { + "$ref": "#/definitions/externaldatav1Credential", + "description": "A User credential that can be used to authenticate to Turnkey." + }, + "authenticatorId": { + "type": "string", + "description": "Unique identifier for a given Authenticator." + }, + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "transports", + "attestationType", + "aaguid", + "credentialId", + "model", + "credential", + "authenticatorId", + "authenticatorName", + "createdAt", + "updatedAt" + ] + }, + "v1AuthenticatorAttestationResponse": { + "type": "object", + "properties": { + "clientDataJson": { + "type": "string" + }, + "attestationObject": { + "type": "string" + }, + "transports": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AuthenticatorTransport" + } + }, + "authenticatorAttachment": { + "type": "string", + "enum": ["cross-platform", "platform"], + "x-nullable": true + } + }, + "required": ["clientDataJson", "attestationObject"] + }, + "v1AuthenticatorParams": { + "type": "object", + "properties": { + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "attestation": { + "$ref": "#/definitions/v1PublicKeyCredentialWithAttestation" + }, + "challenge": { + "type": "string", + "description": "Challenge presented for authentication purposes." + } + }, + "required": ["authenticatorName", "userId", "attestation", "challenge"] + }, + "v1AuthenticatorParamsV2": { + "type": "object", + "properties": { + "authenticatorName": { + "type": "string", + "description": "Human-readable name for an Authenticator." + }, + "challenge": { + "type": "string", + "description": "Challenge presented for authentication purposes." + }, + "attestation": { + "$ref": "#/definitions/v1Attestation", + "description": "The attestation that proves custody of the authenticator and provides metadata about it." + } + }, + "required": ["authenticatorName", "challenge", "attestation"] + }, + "v1AuthenticatorTransport": { + "type": "string", + "enum": [ + "AUTHENTICATOR_TRANSPORT_BLE", + "AUTHENTICATOR_TRANSPORT_INTERNAL", + "AUTHENTICATOR_TRANSPORT_NFC", + "AUTHENTICATOR_TRANSPORT_USB", + "AUTHENTICATOR_TRANSPORT_HYBRID" + ] + }, + "v1BootProof": { + "type": "object", + "properties": { + "ephemeralPublicKeyHex": { + "type": "string", + "description": "The hex encoded Ephemeral Public Key." + }, + "awsAttestationDocB64": { + "type": "string", + "description": "The DER encoded COSE Sign1 struct Attestation doc." + }, + "qosManifestB64": { + "type": "string", + "description": "The borsch serialized base64 encoded Manifest." + }, + "qosManifestEnvelopeB64": { + "type": "string", + "description": "The borsch serialized base64 encoded Manifest Envelope." + }, + "deploymentLabel": { + "type": "string", + "description": "The label under which the enclave app was deployed." + }, + "enclaveApp": { + "type": "string", + "description": "Name of the enclave app" + }, + "owner": { + "type": "string", + "description": "Owner of the app i.e. 'tkhq'" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "ephemeralPublicKeyHex", + "awsAttestationDocB64", + "qosManifestB64", + "qosManifestEnvelopeB64", + "deploymentLabel", + "enclaveApp", + "owner", + "createdAt" + ] + }, + "v1BootProofResponse": { + "type": "object", + "properties": { + "bootProof": { + "$ref": "#/definitions/v1BootProof" + } + }, + "required": ["bootProof"] + }, + "v1ClientSignature": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to create the signature." + }, + "scheme": { + "$ref": "#/definitions/v1ClientSignatureScheme", + "description": "The signature scheme used to generate the client signature." + }, + "message": { + "type": "string", + "description": "The message that was signed." + }, + "signature": { + "type": "string", + "description": "The cryptographic signature over the message." + } + }, + "required": ["publicKey", "scheme", "message", "signature"] + }, + "v1ClientSignatureScheme": { + "type": "string", + "enum": ["CLIENT_SIGNATURE_SCHEME_API_P256"] + }, + "v1Config": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + } + }, + "quorum": { + "$ref": "#/definitions/externaldatav1Quorum" + } + } + }, + "v1CreateApiKeysIntent": { + "type": "object", + "properties": { + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Keys." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["apiKeys", "userId"] + }, + "v1CreateApiKeysIntentV2": { + "type": "object", + "properties": { + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Keys." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["apiKeys", "userId"] + }, + "v1CreateApiKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_API_KEYS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateApiKeysIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateApiKeysResult": { + "type": "object", + "properties": { + "apiKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API Key IDs." + } + }, + "required": ["apiKeyIds"] + }, + "v1CreateApiOnlyUsersIntent": { + "type": "object", + "properties": { + "apiOnlyUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiOnlyUserParams" + }, + "description": "A list of API-only Users to create." + } + }, + "required": ["apiOnlyUsers"] + }, + "v1CreateApiOnlyUsersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_API_ONLY_USERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateApiOnlyUsersIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateApiOnlyUsersResult": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API-only User IDs." + } + }, + "required": ["userIds"] + }, + "v1CreateAuthenticatorsIntent": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParams" + }, + "description": "A list of Authenticators." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["authenticators", "userId"] + }, + "v1CreateAuthenticatorsIntentV2": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticators." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + } + }, + "required": ["authenticators", "userId"] + }, + "v1CreateAuthenticatorsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_AUTHENTICATORS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateAuthenticatorsResult": { + "type": "object", + "properties": { + "authenticatorIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Authenticator IDs." + } + }, + "required": ["authenticatorIds"] + }, + "v1CreateFiatOnRampCredentialIntent": { + "type": "object", + "properties": { + "onrampProvider": { + "$ref": "#/definitions/v1FiatOnRampProvider", + "description": "The fiat on-ramp provider" + }, + "projectId": { + "type": "string", + "description": "Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier" + }, + "publishableApiKey": { + "type": "string", + "description": "Publishable API key for the on-ramp provider" + }, + "encryptedSecretApiKey": { + "type": "string", + "description": "Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key" + }, + "encryptedPrivateApiKey": { + "type": "string", + "description": "Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key." + }, + "sandboxMode": { + "type": "boolean", + "description": "If the on-ramp credential is a sandbox credential" + } + }, + "required": [ + "onrampProvider", + "publishableApiKey", + "encryptedSecretApiKey" + ] + }, + "v1CreateFiatOnRampCredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_FIAT_ON_RAMP_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateFiatOnRampCredentialIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateFiatOnRampCredentialResult": { + "type": "object", + "properties": { + "fiatOnRampCredentialId": { + "type": "string", + "description": "Unique identifier of the Fiat On-Ramp credential that was created" + } + }, + "required": ["fiatOnRampCredentialId"] + }, + "v1CreateInvitationsIntent": { + "type": "object", + "properties": { + "invitations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1InvitationParams" + }, + "description": "A list of Invitations." + } + }, + "required": ["invitations"] + }, + "v1CreateInvitationsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_INVITATIONS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateInvitationsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateInvitationsResult": { + "type": "object", + "properties": { + "invitationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Invitation IDs" + } + }, + "required": ["invitationIds"] + }, + "v1CreateOauth2CredentialIntent": { + "type": "object", + "properties": { + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The OAuth 2.0 provider" + }, + "clientId": { + "type": "string", + "description": "The Client ID issued by the OAuth 2.0 provider" + }, + "encryptedClientSecret": { + "type": "string", + "description": "The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + } + }, + "required": ["provider", "clientId", "encryptedClientSecret"] + }, + "v1CreateOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_OAUTH2_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateOauth2CredentialIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was created" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1CreateOauthProvidersIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User to add an Oauth provider to" + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers." + } + }, + "required": ["userId", "oauthProviders"] + }, + "v1CreateOauthProvidersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_OAUTH_PROVIDERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateOauthProvidersIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateOauthProvidersResult": { + "type": "object", + "properties": { + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for Oauth Providers" + } + }, + "required": ["providerIds"] + }, + "v1CreateOrganizationIntent": { + "type": "object", + "properties": { + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "rootEmail": { + "type": "string", + "description": "The root user's email address." + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParams", + "description": "The root user's Authenticator." + }, + "rootUserId": { + "type": "string", + "description": "Unique identifier for the root user object." + } + }, + "required": ["organizationName", "rootEmail", "rootAuthenticator"] + }, + "v1CreateOrganizationIntentV2": { + "type": "object", + "properties": { + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "rootEmail": { + "type": "string", + "description": "The root user's email address." + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "The root user's Authenticator." + }, + "rootUserId": { + "type": "string", + "description": "Unique identifier for the root user object." + } + }, + "required": ["organizationName", "rootEmail", "rootAuthenticator"] + }, + "v1CreateOrganizationResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1CreatePoliciesIntent": { + "type": "object", + "properties": { + "policies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CreatePolicyIntentV3" + }, + "description": "An array of policy intents to be created." + } + }, + "required": ["policies"] + }, + "v1CreatePoliciesRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_POLICIES"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePoliciesIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePoliciesResult": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for the created policies." + } + }, + "required": ["policyIds"] + }, + "v1CreatePolicyIntent": { + "type": "object", + "properties": { + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "selectors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Selector" + }, + "description": "A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW a particular activity following policy selector(s)." + }, + "notes": { + "type": "string" + } + }, + "required": ["policyName", "selectors", "effect"] + }, + "v1CreatePolicyIntentV2": { + "type": "object", + "properties": { + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "selectors": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SelectorV2" + }, + "description": "A list of simple functions each including a subject, target and boolean. See Policy Engine Language section for additional details." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "Whether to ALLOW or DENY requests that match the condition and consensus requirements." + }, + "notes": { + "type": "string" + } + }, + "required": ["policyName", "selectors", "effect"] + }, + "v1CreatePolicyIntentV3": { + "type": "object", + "properties": { + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW an activity." + }, + "condition": { + "type": "string", + "description": "The condition expression that triggers the Effect" + }, + "consensus": { + "type": "string", + "description": "The consensus expression that triggers the Effect" + }, + "notes": { + "type": "string", + "description": "Notes for a Policy." + } + }, + "required": ["policyName", "effect", "notes"] + }, + "v1CreatePolicyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_POLICY_V3"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePolicyIntentV3" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePolicyResult": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1CreatePrivateKeyTagIntent": { + "type": "object", + "properties": { + "privateKeyTagName": { + "type": "string", + "description": "Human-readable name for a Private Key Tag." + }, + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyTagName", "privateKeyIds"] + }, + "v1CreatePrivateKeyTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_PRIVATE_KEY_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePrivateKeyTagIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePrivateKeyTagResult": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + }, + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyTagId", "privateKeyIds"] + }, + "v1CreatePrivateKeysIntent": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyParams" + }, + "description": "A list of Private Keys." + } + }, + "required": ["privateKeys"] + }, + "v1CreatePrivateKeysIntentV2": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyParams" + }, + "description": "A list of Private Keys." + } + }, + "required": ["privateKeys"] + }, + "v1CreatePrivateKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_PRIVATE_KEYS_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreatePrivateKeysIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreatePrivateKeysResult": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyIds"] + }, + "v1CreatePrivateKeysResultV2": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyResult" + }, + "description": "A list of Private Key IDs and addresses." + } + }, + "required": ["privateKeys"] + }, + "v1CreateReadOnlySessionIntent": { + "type": "object" + }, + "v1CreateReadOnlySessionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_READ_ONLY_SESSION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateReadOnlySessionIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateReadOnlySessionResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "session": { + "type": "string", + "description": "String representing a read only session" + }, + "sessionExpiry": { + "type": "string", + "format": "uint64", + "description": "UTC timestamp in seconds representing the expiry time for the read only session." + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "session", + "sessionExpiry" + ] + }, + "v1CreateReadWriteSessionIntent": { + "type": "object", + "properties": { + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + }, + "email": { + "type": "string", + "description": "Email of the user to create a read write session for" + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + } + }, + "required": ["targetPublicKey", "email"] + }, + "v1CreateReadWriteSessionIntentV2": { + "type": "object", + "properties": { + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the read write session bundle (credentials) will be encrypted." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Read Write Session - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated ReadWriteSession API keys" + } + }, + "required": ["targetPublicKey"] + }, + "v1CreateReadWriteSessionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_READ_WRITE_SESSION_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateReadWriteSessionIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateReadWriteSessionResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "apiKeyId", + "credentialBundle" + ] + }, + "v1CreateReadWriteSessionResultV2": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization. If the request is being made by a user and their Sub-Organization ID is unknown, this can be the Parent Organization ID. However, using the Sub-Organization ID is preferred due to performance reasons." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an Organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "username": { + "type": "string", + "description": "Human-readable name for a User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": [ + "organizationId", + "organizationName", + "userId", + "username", + "apiKeyId", + "credentialBundle" + ] + }, + "v1CreateSmartContractInterfaceIntent": { + "type": "object", + "properties": { + "smartContractAddress": { + "type": "string", + "description": "Corresponding contract address or program ID" + }, + "smartContractInterface": { + "type": "string", + "description": "ABI/IDL as a JSON string. Limited to 400kb" + }, + "type": { + "$ref": "#/definitions/v1SmartContractInterfaceType" + }, + "label": { + "type": "string", + "description": "Human-readable name for a Smart Contract Interface." + }, + "notes": { + "type": "string", + "description": "Notes for a Smart Contract Interface." + } + }, + "required": [ + "smartContractAddress", + "smartContractInterface", + "type", + "label" + ] + }, + "v1CreateSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_SMART_CONTRACT_INTERFACE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateSmartContractInterfaceResult": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of the created Smart Contract Interface." + } + }, + "required": ["smartContractInterfaceId"] + }, + "v1CreateSubOrganizationIntent": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootAuthenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "Root User authenticator for this new sub-organization" + } + }, + "required": ["name", "rootAuthenticator"] + }, + "v1CreateSubOrganizationIntentV2": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParams" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV3": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParams" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyParams" + }, + "description": "A list of Private Keys." + } + }, + "required": [ + "subOrganizationName", + "rootUsers", + "rootQuorumThreshold", + "privateKeys" + ] + }, + "v1CreateSubOrganizationIntentV4": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParams" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV5": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParamsV2" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV6": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParamsV3" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationIntentV7": { + "type": "object", + "properties": { + "subOrganizationName": { + "type": "string", + "description": "Name for this sub-organization" + }, + "rootUsers": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1RootUserParamsV4" + }, + "description": "Root users to create within this sub-organization" + }, + "rootQuorumThreshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach root quorum. This value must be less than or equal to the number of root users" + }, + "wallet": { + "$ref": "#/definitions/v1WalletParams", + "description": "The wallet to create for the sub-organization" + }, + "disableEmailRecovery": { + "type": "boolean", + "description": "Disable email recovery for the sub-organization" + }, + "disableEmailAuth": { + "type": "boolean", + "description": "Disable email auth for the sub-organization" + }, + "disableSmsAuth": { + "type": "boolean", + "description": "Disable OTP SMS auth for the sub-organization" + }, + "disableOtpEmailAuth": { + "type": "boolean", + "description": "Disable OTP email auth for the sub-organization" + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + }, + "clientSignature": { + "$ref": "#/definitions/v1ClientSignature", + "description": "Optional signature proving authorization for this sub-organization creation. The signature is over the verification token ID and the root user parameters for the root user associated with the verification token. Only required if a public key was provided during the verification step." + } + }, + "required": ["subOrganizationName", "rootUsers", "rootQuorumThreshold"] + }, + "v1CreateSubOrganizationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V7"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV7" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateSubOrganizationResult": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV3": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKeyResult" + }, + "description": "A list of Private Key IDs and addresses." + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId", "privateKeys"] + }, + "v1CreateSubOrganizationResultV4": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV5": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV6": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateSubOrganizationResultV7": { + "type": "object", + "properties": { + "subOrganizationId": { + "type": "string" + }, + "wallet": { + "$ref": "#/definitions/v1WalletResult" + }, + "rootUserIds": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": ["subOrganizationId"] + }, + "v1CreateUserTagIntent": { + "type": "object", + "properties": { + "userTagName": { + "type": "string", + "description": "Human-readable name for a User Tag." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userTagName", "userIds"] + }, + "v1CreateUserTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_USER_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateUserTagIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateUserTagResult": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userTagId", "userIds"] + }, + "v1CreateUsersIntent": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserParams" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, + "v1CreateUsersIntentV2": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserParamsV2" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, + "v1CreateUsersIntentV3": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1UserParamsV3" + }, + "description": "A list of Users." + } + }, + "required": ["users"] + }, + "v1CreateUsersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_USERS_V3"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateUsersIntentV3" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateUsersResult": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userIds"] + }, + "v1CreateWalletAccountsIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts." + }, + "persist": { + "type": "boolean", + "description": "Indicates if the wallet accounts should be persisted. This is helpful if you'd like to see the addresses of different derivation paths without actually creating the accounts. Defaults to true." + } + }, + "required": ["walletId", "accounts"] + }, + "v1CreateWalletAccountsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_WALLET_ACCOUNTS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateWalletAccountsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateWalletAccountsResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of derived addresses." + } + }, + "required": ["addresses"] + }, + "v1CreateWalletIntent": { + "type": "object", + "properties": { + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + }, + "mnemonicLength": { + "type": "integer", + "format": "int32", + "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." + } + }, + "required": ["walletName", "accounts"] + }, + "v1CreateWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_CREATE_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1CreateWalletIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1CreateWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a Wallet." + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + }, + "v1CredPropsAuthenticationExtensionsClientOutputs": { + "type": "object", + "properties": { + "rk": { + "type": "boolean" + } + }, + "required": ["rk"] + }, + "v1CredentialType": { + "type": "string", + "enum": [ + "CREDENTIAL_TYPE_WEBAUTHN_AUTHENTICATOR", + "CREDENTIAL_TYPE_API_KEY_P256", + "CREDENTIAL_TYPE_RECOVER_USER_KEY_P256", + "CREDENTIAL_TYPE_API_KEY_SECP256K1", + "CREDENTIAL_TYPE_EMAIL_AUTH_KEY_P256", + "CREDENTIAL_TYPE_API_KEY_ED25519", + "CREDENTIAL_TYPE_OTP_AUTH_KEY_P256", + "CREDENTIAL_TYPE_READ_WRITE_SESSION_KEY_P256", + "CREDENTIAL_TYPE_OAUTH_KEY_P256", + "CREDENTIAL_TYPE_LOGIN" + ] + }, + "v1Curve": { + "type": "string", + "enum": ["CURVE_SECP256K1", "CURVE_ED25519"] + }, + "v1DeleteApiKeysIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "apiKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API Key IDs." + } + }, + "required": ["userId", "apiKeyIds"] + }, + "v1DeleteApiKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_API_KEYS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteApiKeysIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteApiKeysResult": { + "type": "object", + "properties": { + "apiKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of API Key IDs." + } + }, + "required": ["apiKeyIds"] + }, + "v1DeleteAuthenticatorsIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "authenticatorIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Authenticator IDs." + } + }, + "required": ["userId", "authenticatorIds"] + }, + "v1DeleteAuthenticatorsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_AUTHENTICATORS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteAuthenticatorsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteAuthenticatorsResult": { + "type": "object", + "properties": { + "authenticatorIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique identifier for a given Authenticator." + } + }, + "required": ["authenticatorIds"] + }, + "v1DeleteFiatOnRampCredentialIntent": { + "type": "object", + "properties": { + "fiatOnrampCredentialId": { + "type": "string", + "description": "The ID of the fiat on-ramp credential to delete" + } + }, + "required": ["fiatOnrampCredentialId"] + }, + "v1DeleteFiatOnRampCredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_FIAT_ON_RAMP_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteFiatOnRampCredentialIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteFiatOnRampCredentialResult": { + "type": "object", + "properties": { + "fiatOnRampCredentialId": { + "type": "string", + "description": "Unique identifier of the Fiat On-Ramp credential that was deleted" + } + }, + "required": ["fiatOnRampCredentialId"] + }, + "v1DeleteInvitationIntent": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + } + }, + "required": ["invitationId"] + }, + "v1DeleteInvitationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_INVITATION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteInvitationIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteInvitationResult": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation." + } + }, + "required": ["invitationId"] + }, + "v1DeleteOauth2CredentialIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The ID of the OAuth 2.0 credential to delete" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1DeleteOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_OAUTH2_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteOauth2CredentialIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was deleted" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1DeleteOauthProvidersIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User to remove an Oauth provider from" + }, + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Unique identifier for a given Provider." + } + }, + "required": ["userId", "providerIds"] + }, + "v1DeleteOauthProvidersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_OAUTH_PROVIDERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteOauthProvidersIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteOauthProvidersResult": { + "type": "object", + "properties": { + "providerIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for Oauth Providers" + } + }, + "required": ["providerIds"] + }, + "v1DeleteOrganizationIntent": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1DeleteOrganizationResult": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1DeletePoliciesIntent": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for policies within an organization" + } + }, + "required": ["policyIds"] + }, + "v1DeletePoliciesRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_POLICIES"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePoliciesIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePoliciesResult": { + "type": "object", + "properties": { + "policyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of unique identifiers for the deleted policies." + } + }, + "required": ["policyIds"] + }, + "v1DeletePolicyIntent": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1DeletePolicyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_POLICY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePolicyIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePolicyResult": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1DeletePrivateKeyTagsIntent": { + "type": "object", + "properties": { + "privateKeyTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs." + } + }, + "required": ["privateKeyTagIds"] + }, + "v1DeletePrivateKeyTagsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_PRIVATE_KEY_TAGS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePrivateKeyTagsResult": { + "type": "object", + "properties": { + "privateKeyTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs." + }, + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs." + } + }, + "required": ["privateKeyTagIds", "privateKeyIds"] + }, + "v1DeletePrivateKeysIntent": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for private keys within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the private keys, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["privateKeyIds"] + }, + "v1DeletePrivateKeysRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_PRIVATE_KEYS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeletePrivateKeysIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeletePrivateKeysResult": { + "type": "object", + "properties": { + "privateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of private key unique identifiers that were removed" + } + }, + "required": ["privateKeyIds"] + }, + "v1DeleteSmartContractInterfaceIntent": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of a Smart Contract Interface intended for deletion." + } + }, + "required": ["smartContractInterfaceId"] + }, + "v1DeleteSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SMART_CONTRACT_INTERFACE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteSmartContractInterfaceResult": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string", + "description": "The ID of the deleted Smart Contract Interface." + } + }, + "required": ["smartContractInterfaceId"] + }, + "v1DeleteSubOrganizationIntent": { + "type": "object", + "properties": { + "deleteWithoutExport": { + "type": "boolean", + "description": "Sub-organization deletion, by default, requires associated wallets and private keys to be exported for security reasons. Set this boolean to true to force sub-organization deletion even if some wallets or private keys within it have not been exported yet. Default: false." + } + } + }, + "v1DeleteSubOrganizationRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_SUB_ORGANIZATION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteSubOrganizationIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteSubOrganizationResult": { + "type": "object", + "properties": { + "subOrganizationUuid": { + "type": "string", + "description": "Unique identifier of the sub organization that was removed" + } + }, + "required": ["subOrganizationUuid"] + }, + "v1DeleteUserTagsIntent": { + "type": "object", + "properties": { + "userTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs." + } + }, + "required": ["userTagIds"] + }, + "v1DeleteUserTagsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_USER_TAGS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteUserTagsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteUserTagsResult": { + "type": "object", + "properties": { + "userTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userTagIds", "userIds"] + }, + "v1DeleteUsersIntent": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userIds"] + }, + "v1DeleteUsersRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_USERS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteUsersIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteUsersResult": { + "type": "object", + "properties": { + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs." + } + }, + "required": ["userIds"] + }, + "v1DeleteWalletAccountsIntent": { + "type": "object", + "properties": { + "walletAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for wallet accounts within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the wallet accounts, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["walletAccountIds"] + }, + "v1DeleteWalletAccountsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_WALLET_ACCOUNTS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteWalletAccountsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteWalletAccountsResult": { + "type": "object", + "properties": { + "walletAccountIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of wallet account unique identifiers that were removed" + } + }, + "required": ["walletAccountIds"] + }, + "v1DeleteWalletsIntent": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for wallets within an organization" + }, + "deleteWithoutExport": { + "type": "boolean", + "description": "Optional parameter for deleting the wallets, even if any have not been previously exported. If they have been exported, this field is ignored." + } + }, + "required": ["walletIds"] + }, + "v1DeleteWalletsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_DELETE_WALLETS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1DeleteWalletsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1DeleteWalletsResult": { + "type": "object", + "properties": { + "walletIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of wallet unique identifiers that were removed" + } + }, + "required": ["walletIds"] + }, + "v1DisableAuthProxyIntent": { + "type": "object" + }, + "v1DisableAuthProxyResult": { + "type": "object" + }, + "v1DisablePrivateKeyIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + } + }, + "required": ["privateKeyId"] + }, + "v1DisablePrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + } + }, + "required": ["privateKeyId"] + }, + "v1Effect": { + "type": "string", + "enum": ["EFFECT_ALLOW", "EFFECT_DENY"] + }, + "v1EmailAuthCustomizationParams": { + "type": "object", + "properties": { + "appName": { + "type": "string", + "description": "The name of the application. This field is required and will be used in email notifications if an email template is not provided." + }, + "logoUrl": { + "type": "string", + "description": "A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px." + }, + "magicLinkTemplate": { + "type": "string", + "description": "A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`." + }, + "templateVariables": { + "type": "string", + "description": "JSON object containing key/value pairs to be used with custom templates." + }, + "templateId": { + "type": "string", + "description": "Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template." + } + }, + "required": ["appName"] + }, + "v1EmailAuthIntent": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the authenticating user." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey"] + }, + "v1EmailAuthIntentV2": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the authenticating user." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey"] + }, + "v1EmailAuthIntentV3": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the authenticating user." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the email auth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Email Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailAuthCustomizationParams", + "description": "Parameters for customizing emails. If not provided, the default email will be used. Note that app_name is required." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Email Auth API keys" + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey", "emailCustomization"] + }, + "v1EmailAuthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EMAIL_AUTH_V3"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1EmailAuthIntentV3" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1EmailAuthResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the authenticating User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + } + }, + "required": ["userId", "apiKeyId"] + }, + "v1EmailCustomizationParams": { + "type": "object", + "properties": { + "appName": { + "type": "string", + "description": "The name of the application." + }, + "logoUrl": { + "type": "string", + "description": "A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px." + }, + "magicLinkTemplate": { + "type": "string", + "description": "A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`." + }, + "templateVariables": { + "type": "string", + "description": "JSON object containing key/value pairs to be used with custom templates." + }, + "templateId": { + "type": "string", + "description": "Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template." + } + } + }, + "v1EmailCustomizationParamsV2": { + "type": "object", + "properties": { + "logoUrl": { + "type": "string", + "description": "A URL pointing to a logo in PNG format. Note this logo will be resized to fit into 340px x 124px." + }, + "magicLinkTemplate": { + "type": "string", + "description": "A template for the URL to be used in a magic link button, e.g. `https://dapp.xyz/%s`. The auth bundle will be interpolated into the `%s`." + }, + "templateVariables": { + "type": "string", + "description": "JSON object containing key/value pairs to be used with custom templates." + }, + "templateId": { + "type": "string", + "description": "Unique identifier for a given Email Template. If not specified, the default is the most recent Email Template." + } + } + }, + "v1EnableAuthProxyIntent": { + "type": "object" + }, + "v1EnableAuthProxyResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "A User ID with permission to initiate authentication." + } + }, + "required": ["userId"] + }, + "v1EthSendRawTransactionIntent": { + "type": "object", + "properties": { + "signedTransaction": { + "type": "string", + "description": "The raw, signed transaction to be sent." + }, + "caip2": { + "type": "string", + "enum": [ + "eip155:1", + "eip155:11155111", + "eip155:8453", + "eip155:84532" + ], + "description": "CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet)." + } + }, + "required": ["signedTransaction", "caip2"] + }, + "v1EthSendRawTransactionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_ETH_SEND_RAW_TRANSACTION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1EthSendRawTransactionIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1EthSendRawTransactionResult": { + "type": "object", + "properties": { + "transactionHash": { + "type": "string", + "description": "The transaction hash of the sent transaction" + } + }, + "required": ["transactionHash"] + }, + "v1EthSendTransactionIntent": { + "type": "object", + "properties": { + "from": { + "type": "string", + "description": "A wallet or private key address to sign with. This does not support private key IDs." + }, + "sponsor": { + "type": "boolean", + "description": "Whether to sponsor this transaction via Gas Station." + }, + "caip2": { + "type": "string", + "enum": [ + "eip155:1", + "eip155:11155111", + "eip155:8453", + "eip155:84532", + "eip155:137", + "eip155:80002" + ], + "description": "CAIP-2 chain ID (e.g., 'eip155:1' for Ethereum mainnet)." + }, + "to": { + "type": "string", + "description": "Recipient address as a hex string with 0x prefix." + }, + "value": { + "type": "string", + "description": "Amount of native asset to send in wei." + }, + "data": { + "type": "string", + "description": "Hex-encoded call data for contract interactions." + }, + "nonce": { + "type": "string", + "description": "Transaction nonce, for EIP-1559 and Turnkey Gas Station authorizations." + }, + "gasLimit": { + "type": "string", + "description": "Maximum amount of gas to use for this transaction, for EIP-1559 transactions." + }, + "maxFeePerGas": { + "type": "string", + "description": "Maximum total fee per gas unit (base fee + priority fee) in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions." + }, + "maxPriorityFeePerGas": { + "type": "string", + "description": "Maximum priority fee (tip) per gas unit in wei. Required for non-sponsored (EIP-1559) transactions. Not used for sponsored transactions." + }, + "gasStationNonce": { + "type": "string", + "description": "The gas station delegate contract nonce. Only used when sponsor=true. Include this if you want maximal security posture." + } + }, + "required": ["from", "caip2", "to"] + }, + "v1EthSendTransactionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_ETH_SEND_TRANSACTION"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1EthSendTransactionIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1EthSendTransactionResult": { + "type": "object", + "properties": { + "sendTransactionStatusId": { + "type": "string", + "description": "The send_transaction_status ID associated with the transaction submission for sponsored transactions" + } + }, + "required": ["sendTransactionStatusId"] + }, + "v1EthSendTransactionStatus": { + "type": "object", + "properties": { + "txHash": { + "type": "string", + "description": "The Ethereum transaction hash, if available." + } + } + }, + "v1ExportPrivateKeyIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the export bundle will be encrypted." + } + }, + "required": ["privateKeyId", "targetPublicKey"] + }, + "v1ExportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EXPORT_PRIVATE_KEY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ExportPrivateKeyIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ExportPrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "exportBundle": { + "type": "string", + "description": "Export bundle containing a private key encrypted to the client's target public key." + } + }, + "required": ["privateKeyId", "exportBundle"] + }, + "v1ExportWalletAccountIntent": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address to identify Wallet Account." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the export bundle will be encrypted." + } + }, + "required": ["address", "targetPublicKey"] + }, + "v1ExportWalletAccountRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EXPORT_WALLET_ACCOUNT"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ExportWalletAccountIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ExportWalletAccountResult": { + "type": "object", + "properties": { + "address": { + "type": "string", + "description": "Address to identify Wallet Account." + }, + "exportBundle": { + "type": "string", + "description": "Export bundle containing a private key encrypted by the client's target public key." + } + }, + "required": ["address", "exportBundle"] + }, + "v1ExportWalletIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the export bundle will be encrypted." + }, + "language": { + "$ref": "#/definitions/v1MnemonicLanguage", + "description": "The language of the mnemonic to export. Defaults to English." + } + }, + "required": ["walletId", "targetPublicKey"] + }, + "v1ExportWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_EXPORT_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ExportWalletIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ExportWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "exportBundle": { + "type": "string", + "description": "Export bundle containing a wallet mnemonic + optional newline passphrase encrypted by the client's target public key." + } + }, + "required": ["walletId", "exportBundle"] + }, + "v1Feature": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/v1FeatureName" + }, + "value": { + "type": "string" + } + } + }, + "v1FeatureName": { + "type": "string", + "enum": [ + "FEATURE_NAME_ROOT_USER_EMAIL_RECOVERY", + "FEATURE_NAME_WEBAUTHN_ORIGINS", + "FEATURE_NAME_EMAIL_AUTH", + "FEATURE_NAME_EMAIL_RECOVERY", + "FEATURE_NAME_WEBHOOK", + "FEATURE_NAME_SMS_AUTH", + "FEATURE_NAME_OTP_EMAIL_AUTH", + "FEATURE_NAME_AUTH_PROXY" + ] + }, + "v1FiatOnRampBlockchainNetwork": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BITCOIN", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_ETHEREUM", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_SOLANA", + "FIAT_ON_RAMP_BLOCKCHAIN_NETWORK_BASE" + ] + }, + "v1FiatOnRampCredential": { + "type": "object", + "properties": { + "fiatOnrampCredentialId": { + "type": "string", + "description": "Unique identifier for a given Fiat On-Ramp Credential." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for an Organization." + }, + "onrampProvider": { + "$ref": "#/definitions/v1FiatOnRampProvider", + "description": "The fiat on-ramp provider." + }, + "projectId": { + "type": "string", + "description": "Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier." + }, + "publishableApiKey": { + "type": "string", + "description": "Publishable API key for the on-ramp provider." + }, + "encryptedSecretApiKey": { + "type": "string", + "description": "Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key." + }, + "encryptedPrivateApiKey": { + "type": "string", + "description": "Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key." + }, + "sandboxMode": { + "type": "boolean", + "description": "If the on-ramp credential is a sandbox credential." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "fiatOnrampCredentialId", + "organizationId", + "onrampProvider", + "publishableApiKey", + "encryptedSecretApiKey", + "createdAt", + "updatedAt" + ] + }, + "v1FiatOnRampCryptoCurrency": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_CRYPTO_CURRENCY_BTC", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_ETH", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_SOL", + "FIAT_ON_RAMP_CRYPTO_CURRENCY_USDC" + ] + }, + "v1FiatOnRampCurrency": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_CURRENCY_AUD", + "FIAT_ON_RAMP_CURRENCY_BGN", + "FIAT_ON_RAMP_CURRENCY_BRL", + "FIAT_ON_RAMP_CURRENCY_CAD", + "FIAT_ON_RAMP_CURRENCY_CHF", + "FIAT_ON_RAMP_CURRENCY_COP", + "FIAT_ON_RAMP_CURRENCY_CZK", + "FIAT_ON_RAMP_CURRENCY_DKK", + "FIAT_ON_RAMP_CURRENCY_DOP", + "FIAT_ON_RAMP_CURRENCY_EGP", + "FIAT_ON_RAMP_CURRENCY_EUR", + "FIAT_ON_RAMP_CURRENCY_GBP", + "FIAT_ON_RAMP_CURRENCY_HKD", + "FIAT_ON_RAMP_CURRENCY_IDR", + "FIAT_ON_RAMP_CURRENCY_ILS", + "FIAT_ON_RAMP_CURRENCY_JOD", + "FIAT_ON_RAMP_CURRENCY_KES", + "FIAT_ON_RAMP_CURRENCY_KWD", + "FIAT_ON_RAMP_CURRENCY_LKR", + "FIAT_ON_RAMP_CURRENCY_MXN", + "FIAT_ON_RAMP_CURRENCY_NGN", + "FIAT_ON_RAMP_CURRENCY_NOK", + "FIAT_ON_RAMP_CURRENCY_NZD", + "FIAT_ON_RAMP_CURRENCY_OMR", + "FIAT_ON_RAMP_CURRENCY_PEN", + "FIAT_ON_RAMP_CURRENCY_PLN", + "FIAT_ON_RAMP_CURRENCY_RON", + "FIAT_ON_RAMP_CURRENCY_SEK", + "FIAT_ON_RAMP_CURRENCY_THB", + "FIAT_ON_RAMP_CURRENCY_TRY", + "FIAT_ON_RAMP_CURRENCY_TWD", + "FIAT_ON_RAMP_CURRENCY_USD", + "FIAT_ON_RAMP_CURRENCY_VND", + "FIAT_ON_RAMP_CURRENCY_ZAR" + ] + }, + "v1FiatOnRampPaymentMethod": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_PAYMENT_METHOD_CREDIT_DEBIT_CARD", + "FIAT_ON_RAMP_PAYMENT_METHOD_APPLE_PAY", + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_BANK_TRANSFER", + "FIAT_ON_RAMP_PAYMENT_METHOD_GBP_OPEN_BANKING_PAYMENT", + "FIAT_ON_RAMP_PAYMENT_METHOD_GOOGLE_PAY", + "FIAT_ON_RAMP_PAYMENT_METHOD_SEPA_BANK_TRANSFER", + "FIAT_ON_RAMP_PAYMENT_METHOD_PIX_INSTANT_PAYMENT", + "FIAT_ON_RAMP_PAYMENT_METHOD_PAYPAL", + "FIAT_ON_RAMP_PAYMENT_METHOD_VENMO", + "FIAT_ON_RAMP_PAYMENT_METHOD_MOONPAY_BALANCE", + "FIAT_ON_RAMP_PAYMENT_METHOD_CRYPTO_ACCOUNT", + "FIAT_ON_RAMP_PAYMENT_METHOD_FIAT_WALLET", + "FIAT_ON_RAMP_PAYMENT_METHOD_ACH_BANK_ACCOUNT" + ] + }, + "v1FiatOnRampProvider": { + "type": "string", + "enum": [ + "FIAT_ON_RAMP_PROVIDER_COINBASE", + "FIAT_ON_RAMP_PROVIDER_MOONPAY" + ] + }, + "v1GetActivitiesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "filterByStatus": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ActivityStatus" + }, + "description": "Array of activity statuses filtering which activities will be listed in the response." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + }, + "filterByType": { + "type": "array", + "items": { + "$ref": "#/definitions/v1ActivityType" + }, + "description": "Array of activity types filtering which activities will be listed in the response." + } + }, + "required": ["organizationId"] + }, + "v1GetActivitiesResponse": { + "type": "object", + "properties": { + "activities": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Activity" + }, + "description": "A list of activities." + } + }, + "required": ["activities"] + }, + "v1GetActivityRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity object." + } + }, + "required": ["organizationId", "activityId"] + }, + "v1GetApiKeyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for a given API key." + } + }, + "required": ["organizationId", "apiKeyId"] + }, + "v1GetApiKeyResponse": { + "type": "object", + "properties": { + "apiKey": { + "$ref": "#/definitions/v1ApiKey", + "description": "An API key." + } + }, + "required": ["apiKey"] + }, + "v1GetApiKeysRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId"] + }, + "v1GetApiKeysResponse": { + "type": "object", + "properties": { + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKey" + }, + "description": "A list of API keys." + } + }, + "required": ["apiKeys"] + }, + "v1GetAppProofsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity." + } + }, + "required": ["organizationId", "activityId"] + }, + "v1GetAppProofsResponse": { + "type": "object", + "properties": { + "appProofs": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AppProof" + } + } + }, + "required": ["appProofs"] + }, + "v1GetAttestationDocumentRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "enclaveType": { + "type": "string", + "description": "The enclave type, one of: ump, notarizer, signer, evm-parser." + } + }, + "required": ["organizationId", "enclaveType"] + }, + "v1GetAttestationDocumentResponse": { + "type": "object", + "properties": { + "attestationDocument": { + "type": "string", + "format": "byte", + "description": "Raw (CBOR-encoded) attestation document." + } + }, + "required": ["attestationDocument"] + }, + "v1GetAuthenticatorRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "authenticatorId": { + "type": "string", + "description": "Unique identifier for a given authenticator." + } + }, + "required": ["organizationId", "authenticatorId"] + }, + "v1GetAuthenticatorResponse": { + "type": "object", + "properties": { + "authenticator": { + "$ref": "#/definitions/v1Authenticator", + "description": "An authenticator." + } + }, + "required": ["authenticator"] + }, + "v1GetAuthenticatorsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId", "userId"] + }, + "v1GetAuthenticatorsResponse": { + "type": "object", + "properties": { + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Authenticator" + }, + "description": "A list of authenticators." + } + }, + "required": ["authenticators"] + }, + "v1GetBootProofRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "ephemeralKey": { + "type": "string", + "description": "Hex encoded ephemeral public key." + } + }, + "required": ["organizationId", "ephemeralKey"] + }, + "v1GetGasUsageRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1GetGasUsageResponse": { + "type": "object", + "properties": { + "windowDurationMinutes": { + "type": "integer", + "format": "int32", + "description": "The window duration (in minutes) for the organization or sub-organization." + }, + "windowLimitUsd": { + "type": "string", + "description": "The window limit (in USD) for the organization or sub-organization." + }, + "usageUsd": { + "type": "string", + "description": "The total gas usage (in USD) of all sponsored transactions processed over the last `window_duration_minutes`" + } + }, + "required": ["windowDurationMinutes", "windowLimitUsd", "usageUsd"] + }, + "v1GetLatestBootProofRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "appName": { + "type": "string", + "description": "Name of enclave app." + } + }, + "required": ["organizationId", "appName"] + }, + "v1GetNoncesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "address": { + "type": "string", + "description": "The Ethereum address to query nonces for." + }, + "caip2": { + "type": "string", + "description": "The network identifier in CAIP-2 format (e.g., 'eip155:1' for Ethereum mainnet)." + }, + "nonce": { + "type": "boolean", + "description": "Whether to fetch the standard on-chain nonce." + }, + "gasStationNonce": { + "type": "boolean", + "description": "Whether to fetch the gas station nonce used for sponsored transactions." + } + }, + "required": ["organizationId", "address", "caip2"] + }, + "v1GetNoncesResponse": { + "type": "object", + "properties": { + "nonce": { + "type": "string", + "format": "uint64", + "description": "The standard on-chain nonce for the address, if requested." + }, + "gasStationNonce": { + "type": "string", + "format": "uint64", + "description": "The gas station nonce for sponsored transactions, if requested." + } + } + }, + "v1GetOauth2CredentialRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier for a given OAuth 2.0 Credential." + } + }, + "required": ["organizationId", "oauth2CredentialId"] + }, + "v1GetOauth2CredentialResponse": { + "type": "object", + "properties": { + "oauth2Credential": { + "$ref": "#/definitions/v1Oauth2Credential" + } + }, + "required": ["oauth2Credential"] + }, + "v1GetOauthProvidersRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId"] + }, + "v1GetOauthProvidersResponse": { + "type": "object", + "properties": { + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProvider" + }, + "description": "A list of Oauth providers." + } + }, + "required": ["oauthProviders"] + }, + "v1GetOnRampTransactionStatusRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "transactionId": { + "type": "string", + "description": "The unique identifier for the fiat on ramp transaction." + }, + "refresh": { + "type": "boolean", + "description": "Optional flag to specify if the transaction status should be refreshed from the fiat on ramp provider. Default = false." + } + }, + "required": ["organizationId", "transactionId"] + }, + "v1GetOnRampTransactionStatusResponse": { + "type": "object", + "properties": { + "transactionStatus": { + "type": "string", + "description": "The status of the fiat on ramp transaction." + } + }, + "required": ["transactionStatus"] + }, + "v1GetOrganizationConfigsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetOrganizationConfigsResponse": { + "type": "object", + "properties": { + "configs": { + "$ref": "#/definitions/v1Config", + "description": "Organization configs including quorum settings and organization features." + } + }, + "required": ["configs"] + }, + "v1GetOrganizationRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetOrganizationResponse": { + "type": "object", + "properties": { + "organizationData": { + "$ref": "#/definitions/v1OrganizationData", + "description": "Object representing the full current and deleted / disabled collection of users, policies, private keys, and invitations attributable to a particular organization." + } + }, + "required": ["organizationData"] + }, + "v1GetPoliciesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetPoliciesResponse": { + "type": "object", + "properties": { + "policies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Policy" + }, + "description": "A list of policies." + } + }, + "required": ["policies"] + }, + "v1GetPolicyEvaluationsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given activity." + } + }, + "required": ["organizationId", "activityId"] + }, + "v1GetPolicyEvaluationsResponse": { + "type": "object", + "properties": { + "policyEvaluations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/externalactivityv1PolicyEvaluation" + } + } + }, + "required": ["policyEvaluations"] + }, + "v1GetPolicyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "policyId": { + "type": "string", + "description": "Unique identifier for a given policy." + } + }, + "required": ["organizationId", "policyId"] + }, + "v1GetPolicyResponse": { + "type": "object", + "properties": { + "policy": { + "$ref": "#/definitions/v1Policy", + "description": "Object that codifies rules defining the actions that are permissible within an organization." + } + }, + "required": ["policy"] + }, + "v1GetPrivateKeyRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given private key." + } + }, + "required": ["organizationId", "privateKeyId"] + }, + "v1GetPrivateKeyResponse": { + "type": "object", + "properties": { + "privateKey": { + "$ref": "#/definitions/v1PrivateKey", + "description": "Cryptographic public/private key pair that can be used for cryptocurrency needs or more generalized encryption." + } + }, + "required": ["privateKey"] + }, + "v1GetPrivateKeysRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetPrivateKeysResponse": { + "type": "object", + "properties": { + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKey" + }, + "description": "A list of private keys." + } + }, + "required": ["privateKeys"] + }, + "v1GetSendTransactionStatusRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "sendTransactionStatusId": { + "type": "string", + "description": "The unique identifier of a send transaction request." + } + }, + "required": ["organizationId", "sendTransactionStatusId"] + }, + "v1GetSendTransactionStatusResponse": { + "type": "object", + "properties": { + "txStatus": { + "type": "string", + "description": "The current status of the send transaction." + }, + "eth": { + "$ref": "#/definitions/v1EthSendTransactionStatus", + "description": "Ethereum-specific transaction status." + }, + "txError": { + "type": "string", + "description": "The error encountered when broadcasting or confirming the transaction, if any." + } + }, + "required": ["txStatus"] + }, + "v1GetSmartContractInterfaceRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "smartContractInterfaceId": { + "type": "string", + "description": "Unique identifier for a given smart contract interface." + } + }, + "required": ["organizationId", "smartContractInterfaceId"] + }, + "v1GetSmartContractInterfaceResponse": { + "type": "object", + "properties": { + "smartContractInterface": { + "$ref": "#/definitions/externaldatav1SmartContractInterface", + "description": "Object to be used in conjunction with policies to guard transaction signing." + } + }, + "required": ["smartContractInterface"] + }, + "v1GetSmartContractInterfacesRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetSmartContractInterfacesResponse": { + "type": "object", + "properties": { + "smartContractInterfaces": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/externaldatav1SmartContractInterface" + }, + "description": "A list of smart contract interfaces." + } + }, + "required": ["smartContractInterfaces"] + }, + "v1GetSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'PHONE_NUMBER', 'OIDC_TOKEN', 'WALLET_ACCOUNT_ADDRESS' or 'PUBLIC_KEY'" + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or name string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, + "v1GetUserRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + } + }, + "required": ["organizationId", "userId"] + }, + "v1GetUserResponse": { + "type": "object", + "properties": { + "user": { + "$ref": "#/definitions/v1User", + "description": "Web and/or API user within your organization." + } + }, + "required": ["user"] + }, + "v1GetUsersRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetUsersResponse": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1User" + }, + "description": "A list of users." + } + }, + "required": ["users"] + }, + "v1GetVerifiedSubOrgIdsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for the parent organization. This is used to find sub-organizations within it." + }, + "filterType": { + "type": "string", + "description": "Specifies the type of filter to apply, i.e 'EMAIL', 'PHONE_NUMBER'." + }, + "filterValue": { + "type": "string", + "description": "The value of the filter to apply for the specified type. For example, a specific email or phone number string." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetVerifiedSubOrgIdsResponse": { + "type": "object", + "properties": { + "organizationIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of unique identifiers for the matching sub-organizations." + } + }, + "required": ["organizationIds"] + }, + "v1GetWalletAccountRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "walletId": { + "type": "string", + "description": "Unique identifier for a given wallet." + }, + "address": { + "type": "string", + "description": "Address corresponding to a wallet account." + }, + "path": { + "type": "string", + "description": "Path corresponding to a wallet account." + } + }, + "required": ["organizationId", "walletId"] + }, + "v1GetWalletAccountResponse": { + "type": "object", + "properties": { + "account": { + "$ref": "#/definitions/v1WalletAccount", + "description": "The resulting wallet account." + } + }, + "required": ["account"] + }, + "v1GetWalletAccountsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "walletId": { + "type": "string", + "description": "Unique identifier for a given wallet. If not provided, all accounts for the organization will be returned." + }, + "includeWalletDetails": { + "type": "boolean", + "description": "Optional flag to specify if the wallet details should be included in the response. Default = false." + }, + "paginationOptions": { + "$ref": "#/definitions/v1Pagination", + "description": "Parameters used for cursor-based pagination." + } + }, + "required": ["organizationId"] + }, + "v1GetWalletAccountsResponse": { + "type": "object", + "properties": { + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccount" + }, + "description": "A list of accounts generated from a wallet that share a common seed." + } + }, + "required": ["accounts"] + }, + "v1GetWalletRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "walletId": { + "type": "string", + "description": "Unique identifier for a given wallet." + } + }, + "required": ["organizationId", "walletId"] + }, + "v1GetWalletResponse": { + "type": "object", + "properties": { + "wallet": { + "$ref": "#/definitions/v1Wallet", + "description": "A collection of deterministically generated cryptographic public / private key pairs that share a common seed." + } + }, + "required": ["wallet"] + }, + "v1GetWalletsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1GetWalletsResponse": { + "type": "object", + "properties": { + "wallets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Wallet" + }, + "description": "A list of wallets." + } + }, + "required": ["wallets"] + }, + "v1GetWhoamiRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." + } + }, + "required": ["organizationId"] + }, + "v1GetWhoamiResponse": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + }, + "organizationName": { + "type": "string", + "description": "Human-readable name for an organization." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given user." + }, + "username": { + "type": "string", + "description": "Human-readable name for a user." + } + }, + "required": ["organizationId", "organizationName", "userId", "username"] + }, + "v1HashFunction": { + "type": "string", + "enum": [ + "HASH_FUNCTION_NO_OP", + "HASH_FUNCTION_SHA256", + "HASH_FUNCTION_KECCAK256", + "HASH_FUNCTION_NOT_APPLICABLE" + ] + }, + "v1ImportPrivateKeyIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Private Key." + }, + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "encryptedBundle": { + "type": "string", + "description": "Bundle containing a raw private key encrypted to the enclave's target public key." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "addressFormats": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AddressFormat" + }, + "description": "Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + } + }, + "required": [ + "userId", + "privateKeyName", + "encryptedBundle", + "curve", + "addressFormats" + ] + }, + "v1ImportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_IMPORT_PRIVATE_KEY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ImportPrivateKeyIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ImportPrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a Private Key." + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/immutableactivityv1Address" + }, + "description": "A list of addresses." + } + }, + "required": ["privateKeyId", "addresses"] + }, + "v1ImportWalletIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "encryptedBundle": { + "type": "string", + "description": "Bundle containing a wallet mnemonic encrypted to the enclave's target public key." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts." + } + }, + "required": ["userId", "walletName", "encryptedBundle", "accounts"] + }, + "v1ImportWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_IMPORT_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1ImportWalletIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1ImportWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a Wallet." + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + }, + "v1InitFiatOnRampIntent": { + "type": "object", + "properties": { + "onrampProvider": { + "$ref": "#/definitions/v1FiatOnRampProvider", + "description": "Enum to specifiy which on-ramp provider to use" + }, + "walletAddress": { + "type": "string", + "description": "Destination wallet address for the buy transaction." + }, + "network": { + "$ref": "#/definitions/v1FiatOnRampBlockchainNetwork", + "description": "Blockchain network to be used for the transaction, e.g., bitcoin, ethereum. Maps to MoonPay's network or Coinbase's defaultNetwork." + }, + "cryptoCurrencyCode": { + "$ref": "#/definitions/v1FiatOnRampCryptoCurrency", + "description": "Code for the cryptocurrency to be purchased, e.g., btc, eth. Maps to MoonPay's currencyCode or Coinbase's defaultAsset." + }, + "fiatCurrencyCode": { + "$ref": "#/definitions/v1FiatOnRampCurrency", + "description": "Code for the fiat currency to be used in the transaction, e.g., USD, EUR." + }, + "fiatCurrencyAmount": { + "type": "string", + "description": "Specifies a preset fiat amount for the transaction, e.g., '100'. Must be greater than '20'. If not provided, the user will be prompted to enter an amount." + }, + "paymentMethod": { + "$ref": "#/definitions/v1FiatOnRampPaymentMethod", + "description": "Pre-selected payment method, e.g., CREDIT_DEBIT_CARD, APPLE_PAY. Validated against the chosen provider." + }, + "countryCode": { + "type": "string", + "description": "ISO 3166-1 two-digit country code for Coinbase representing the purchasing userโ€™s country of residence, e.g., US, GB." + }, + "countrySubdivisionCode": { + "type": "string", + "description": "ISO 3166-2 two-digit country subdivision code for Coinbase representing the purchasing userโ€™s subdivision of residence within their country, e.g. NY. Required if country_code=US." + }, + "sandboxMode": { + "type": "boolean", + "description": "Optional flag to indicate whether to use the sandbox mode to simulate transactions for the on-ramp provider. Default is false." + }, + "urlForSignature": { + "type": "string", + "description": "Optional MoonPay Widget URL to sign when using MoonPay client SDKs with URL Signing enabled." + } + }, + "required": [ + "onrampProvider", + "walletAddress", + "network", + "cryptoCurrencyCode" + ] + }, + "v1InitFiatOnRampRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_FIAT_ON_RAMP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitFiatOnRampIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitFiatOnRampResult": { + "type": "object", + "properties": { + "onRampUrl": { + "type": "string", + "description": "Unique URL for a given fiat on-ramp flow." + }, + "onRampTransactionId": { + "type": "string", + "description": "Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow." + }, + "onRampUrlSignature": { + "type": "string", + "description": "Optional signature of the MoonPay Widget URL. The signature is generated if the Init Fiat On Ramp intent includes the urlForSignature field. The signature can be used to initialize the MoonPay SDKs when URL signing is enabled for your project." + } + }, + "required": ["onRampUrl", "onRampTransactionId"] + }, + "v1InitImportPrivateKeyIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Private Key." + } + }, + "required": ["userId"] + }, + "v1InitImportPrivateKeyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_IMPORT_PRIVATE_KEY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitImportPrivateKeyIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitImportPrivateKeyResult": { + "type": "object", + "properties": { + "importBundle": { + "type": "string", + "description": "Import bundle containing a public key and signature to use for importing client data." + } + }, + "required": ["importBundle"] + }, + "v1InitImportWalletIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "The ID of the User importing a Wallet." + } + }, + "required": ["userId"] + }, + "v1InitImportWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_IMPORT_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitImportWalletIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitImportWalletResult": { + "type": "object", + "properties": { + "importBundle": { + "type": "string", + "description": "Import bundle containing a public key and signature to use for importing client data." + } + }, + "required": ["importBundle"] + }, + "v1InitOtpAuthIntent": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpAuthIntentV2": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Enum to specifiy whether to send OTP via SMS or email" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default SMS message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpAuthIntentV3": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Optional length of the OTP code. Default = 9" + }, + "appName": { + "type": "string", + "description": "The name of the application. This field is required and will be used in email notifications if an email template is not provided." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParamsV2", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default SMS message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact", "appName"] + }, + "v1InitOtpAuthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_OTP_AUTH_V3"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitOtpAuthIntentV3" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitOtpAuthResult": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1InitOtpAuthResultV2": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1InitOtpIntent": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Optional length of the OTP code. Default = 9" + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default sms message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact"] + }, + "v1InitOtpIntentV2": { + "type": "object", + "properties": { + "otpType": { + "type": "string", + "description": "Whether to send OTP via SMS or email. Possible values: OTP_TYPE_SMS, OTP_TYPE_EMAIL" + }, + "contact": { + "type": "string", + "description": "Email or phone number to send the OTP code to" + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Optional length of the OTP code. Default = 9" + }, + "appName": { + "type": "string", + "description": "The name of the application. This field is required and will be used in email notifications if an email template is not provided." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParamsV2", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomization": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Optional parameters for customizing SMS message. If not provided, the default SMS message will be used." + }, + "userIdentifier": { + "type": "string", + "description": "Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "alphanumeric": { + "type": "boolean", + "description": "Optional flag to specify if the OTP code should be alphanumeric (Crockfordโ€™s Base32). Default = true" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the OTP is valid for. If not provided, a default of 5 minutes will be used. Maximum value is 600 seconds (10 minutes)" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["otpType", "contact", "appName"] + }, + "v1InitOtpRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_OTP_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitOtpIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitOtpResult": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "Unique identifier for an OTP authentication" + } + }, + "required": ["otpId"] + }, + "v1InitUserEmailRecoveryIntent": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the user starting recovery" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the recovery bundle will be encrypted." + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey"] + }, + "v1InitUserEmailRecoveryIntentV2": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email of the user starting recovery" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the recovery bundle will be encrypted." + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the recovery credential is valid for. If not provided, a default of 15 minutes will be used." + }, + "emailCustomization": { + "$ref": "#/definitions/v1EmailAuthCustomizationParams", + "description": "Parameters for customizing emails. If not provided, the default email will be used. Note that `app_name` is required." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Optional custom email address from which to send the OTP email" + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'" + }, + "replyToEmailAddress": { + "type": "string", + "description": "Optional custom email address to use as reply-to" + } + }, + "required": ["email", "targetPublicKey", "emailCustomization"] + }, + "v1InitUserEmailRecoveryRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_INIT_USER_EMAIL_RECOVERY_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1InitUserEmailRecoveryIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1InitUserEmailRecoveryResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the user being recovered." + } + }, + "required": ["userId"] + }, + "v1Intent": { + "type": "object", + "properties": { + "createOrganizationIntent": { + "$ref": "#/definitions/v1CreateOrganizationIntent" + }, + "createAuthenticatorsIntent": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntent" + }, + "createUsersIntent": { + "$ref": "#/definitions/v1CreateUsersIntent" + }, + "createPrivateKeysIntent": { + "$ref": "#/definitions/v1CreatePrivateKeysIntent" + }, + "signRawPayloadIntent": { + "$ref": "#/definitions/v1SignRawPayloadIntent" + }, + "createInvitationsIntent": { + "$ref": "#/definitions/v1CreateInvitationsIntent" + }, + "acceptInvitationIntent": { + "$ref": "#/definitions/v1AcceptInvitationIntent" + }, + "createPolicyIntent": { + "$ref": "#/definitions/v1CreatePolicyIntent" + }, + "disablePrivateKeyIntent": { + "$ref": "#/definitions/v1DisablePrivateKeyIntent" + }, + "deleteUsersIntent": { + "$ref": "#/definitions/v1DeleteUsersIntent" + }, + "deleteAuthenticatorsIntent": { + "$ref": "#/definitions/v1DeleteAuthenticatorsIntent" + }, + "deleteInvitationIntent": { + "$ref": "#/definitions/v1DeleteInvitationIntent" + }, + "deleteOrganizationIntent": { + "$ref": "#/definitions/v1DeleteOrganizationIntent" + }, + "deletePolicyIntent": { + "$ref": "#/definitions/v1DeletePolicyIntent" + }, + "createUserTagIntent": { + "$ref": "#/definitions/v1CreateUserTagIntent" + }, + "deleteUserTagsIntent": { + "$ref": "#/definitions/v1DeleteUserTagsIntent" + }, + "signTransactionIntent": { + "$ref": "#/definitions/v1SignTransactionIntent" + }, + "createApiKeysIntent": { + "$ref": "#/definitions/v1CreateApiKeysIntent" + }, + "deleteApiKeysIntent": { + "$ref": "#/definitions/v1DeleteApiKeysIntent" + }, + "approveActivityIntent": { + "$ref": "#/definitions/v1ApproveActivityIntent" + }, + "rejectActivityIntent": { + "$ref": "#/definitions/v1RejectActivityIntent" + }, + "createPrivateKeyTagIntent": { + "$ref": "#/definitions/v1CreatePrivateKeyTagIntent" + }, + "deletePrivateKeyTagsIntent": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsIntent" + }, + "createPolicyIntentV2": { + "$ref": "#/definitions/v1CreatePolicyIntentV2" + }, + "setPaymentMethodIntent": { + "$ref": "#/definitions/billingSetPaymentMethodIntent" + }, + "activateBillingTierIntent": { + "$ref": "#/definitions/billingActivateBillingTierIntent" + }, + "deletePaymentMethodIntent": { + "$ref": "#/definitions/billingDeletePaymentMethodIntent" + }, + "createPolicyIntentV3": { + "$ref": "#/definitions/v1CreatePolicyIntentV3" + }, + "createApiOnlyUsersIntent": { + "$ref": "#/definitions/v1CreateApiOnlyUsersIntent" + }, + "updateRootQuorumIntent": { + "$ref": "#/definitions/v1UpdateRootQuorumIntent" + }, + "updateUserTagIntent": { + "$ref": "#/definitions/v1UpdateUserTagIntent" + }, + "updatePrivateKeyTagIntent": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagIntent" + }, + "createAuthenticatorsIntentV2": { + "$ref": "#/definitions/v1CreateAuthenticatorsIntentV2" + }, + "acceptInvitationIntentV2": { + "$ref": "#/definitions/v1AcceptInvitationIntentV2" + }, + "createOrganizationIntentV2": { + "$ref": "#/definitions/v1CreateOrganizationIntentV2" + }, + "createUsersIntentV2": { + "$ref": "#/definitions/v1CreateUsersIntentV2" + }, + "createSubOrganizationIntent": { + "$ref": "#/definitions/v1CreateSubOrganizationIntent" + }, + "createSubOrganizationIntentV2": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV2" + }, + "updateAllowedOriginsIntent": { + "$ref": "#/definitions/v1UpdateAllowedOriginsIntent" + }, + "createPrivateKeysIntentV2": { + "$ref": "#/definitions/v1CreatePrivateKeysIntentV2" + }, + "updateUserIntent": { + "$ref": "#/definitions/v1UpdateUserIntent" + }, + "updatePolicyIntent": { + "$ref": "#/definitions/v1UpdatePolicyIntent" + }, + "setPaymentMethodIntentV2": { + "$ref": "#/definitions/billingSetPaymentMethodIntentV2" + }, + "createSubOrganizationIntentV3": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV3" + }, + "createWalletIntent": { + "$ref": "#/definitions/v1CreateWalletIntent" + }, + "createWalletAccountsIntent": { + "$ref": "#/definitions/v1CreateWalletAccountsIntent" + }, + "initUserEmailRecoveryIntent": { + "$ref": "#/definitions/v1InitUserEmailRecoveryIntent" + }, + "recoverUserIntent": { + "$ref": "#/definitions/v1RecoverUserIntent" + }, + "setOrganizationFeatureIntent": { + "$ref": "#/definitions/v1SetOrganizationFeatureIntent" + }, + "removeOrganizationFeatureIntent": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureIntent" + }, + "signRawPayloadIntentV2": { + "$ref": "#/definitions/v1SignRawPayloadIntentV2" + }, + "signTransactionIntentV2": { + "$ref": "#/definitions/v1SignTransactionIntentV2" + }, + "exportPrivateKeyIntent": { + "$ref": "#/definitions/v1ExportPrivateKeyIntent" + }, + "exportWalletIntent": { + "$ref": "#/definitions/v1ExportWalletIntent" + }, + "createSubOrganizationIntentV4": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV4" + }, + "emailAuthIntent": { + "$ref": "#/definitions/v1EmailAuthIntent" + }, + "exportWalletAccountIntent": { + "$ref": "#/definitions/v1ExportWalletAccountIntent" + }, + "initImportWalletIntent": { + "$ref": "#/definitions/v1InitImportWalletIntent" + }, + "importWalletIntent": { + "$ref": "#/definitions/v1ImportWalletIntent" + }, + "initImportPrivateKeyIntent": { + "$ref": "#/definitions/v1InitImportPrivateKeyIntent" + }, + "importPrivateKeyIntent": { + "$ref": "#/definitions/v1ImportPrivateKeyIntent" + }, + "createPoliciesIntent": { + "$ref": "#/definitions/v1CreatePoliciesIntent" + }, + "signRawPayloadsIntent": { + "$ref": "#/definitions/v1SignRawPayloadsIntent" + }, + "createReadOnlySessionIntent": { + "$ref": "#/definitions/v1CreateReadOnlySessionIntent" + }, + "createOauthProvidersIntent": { + "$ref": "#/definitions/v1CreateOauthProvidersIntent" + }, + "deleteOauthProvidersIntent": { + "$ref": "#/definitions/v1DeleteOauthProvidersIntent" + }, + "createSubOrganizationIntentV5": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV5" + }, + "oauthIntent": { + "$ref": "#/definitions/v1OauthIntent" + }, + "createApiKeysIntentV2": { + "$ref": "#/definitions/v1CreateApiKeysIntentV2" + }, + "createReadWriteSessionIntent": { + "$ref": "#/definitions/v1CreateReadWriteSessionIntent" + }, + "emailAuthIntentV2": { + "$ref": "#/definitions/v1EmailAuthIntentV2" + }, + "createSubOrganizationIntentV6": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV6" + }, + "deletePrivateKeysIntent": { + "$ref": "#/definitions/v1DeletePrivateKeysIntent" + }, + "deleteWalletsIntent": { + "$ref": "#/definitions/v1DeleteWalletsIntent" + }, + "createReadWriteSessionIntentV2": { + "$ref": "#/definitions/v1CreateReadWriteSessionIntentV2" + }, + "deleteSubOrganizationIntent": { + "$ref": "#/definitions/v1DeleteSubOrganizationIntent" + }, + "initOtpAuthIntent": { + "$ref": "#/definitions/v1InitOtpAuthIntent" + }, + "otpAuthIntent": { + "$ref": "#/definitions/v1OtpAuthIntent" + }, + "createSubOrganizationIntentV7": { + "$ref": "#/definitions/v1CreateSubOrganizationIntentV7" + }, + "updateWalletIntent": { + "$ref": "#/definitions/v1UpdateWalletIntent" + }, + "updatePolicyIntentV2": { + "$ref": "#/definitions/v1UpdatePolicyIntentV2" + }, + "createUsersIntentV3": { + "$ref": "#/definitions/v1CreateUsersIntentV3" + }, + "initOtpAuthIntentV2": { + "$ref": "#/definitions/v1InitOtpAuthIntentV2" + }, + "initOtpIntent": { + "$ref": "#/definitions/v1InitOtpIntent" + }, + "verifyOtpIntent": { + "$ref": "#/definitions/v1VerifyOtpIntent" + }, + "otpLoginIntent": { + "$ref": "#/definitions/v1OtpLoginIntent" + }, + "stampLoginIntent": { + "$ref": "#/definitions/v1StampLoginIntent" + }, + "oauthLoginIntent": { + "$ref": "#/definitions/v1OauthLoginIntent" + }, + "updateUserNameIntent": { + "$ref": "#/definitions/v1UpdateUserNameIntent" + }, + "updateUserEmailIntent": { + "$ref": "#/definitions/v1UpdateUserEmailIntent" + }, + "updateUserPhoneNumberIntent": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberIntent" + }, + "initFiatOnRampIntent": { + "$ref": "#/definitions/v1InitFiatOnRampIntent" + }, + "createSmartContractInterfaceIntent": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceIntent" + }, + "deleteSmartContractInterfaceIntent": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceIntent" + }, + "enableAuthProxyIntent": { + "$ref": "#/definitions/v1EnableAuthProxyIntent" + }, + "disableAuthProxyIntent": { + "$ref": "#/definitions/v1DisableAuthProxyIntent" + }, + "updateAuthProxyConfigIntent": { + "$ref": "#/definitions/v1UpdateAuthProxyConfigIntent" + }, + "createOauth2CredentialIntent": { + "$ref": "#/definitions/v1CreateOauth2CredentialIntent" + }, + "updateOauth2CredentialIntent": { + "$ref": "#/definitions/v1UpdateOauth2CredentialIntent" + }, + "deleteOauth2CredentialIntent": { + "$ref": "#/definitions/v1DeleteOauth2CredentialIntent" + }, + "oauth2AuthenticateIntent": { + "$ref": "#/definitions/v1Oauth2AuthenticateIntent" + }, + "deleteWalletAccountsIntent": { + "$ref": "#/definitions/v1DeleteWalletAccountsIntent" + }, + "deletePoliciesIntent": { + "$ref": "#/definitions/v1DeletePoliciesIntent" + }, + "ethSendRawTransactionIntent": { + "$ref": "#/definitions/v1EthSendRawTransactionIntent" + }, + "ethSendTransactionIntent": { + "$ref": "#/definitions/v1EthSendTransactionIntent" + }, + "createFiatOnRampCredentialIntent": { + "$ref": "#/definitions/v1CreateFiatOnRampCredentialIntent" + }, + "updateFiatOnRampCredentialIntent": { + "$ref": "#/definitions/v1UpdateFiatOnRampCredentialIntent" + }, + "deleteFiatOnRampCredentialIntent": { + "$ref": "#/definitions/v1DeleteFiatOnRampCredentialIntent" + }, + "emailAuthIntentV3": { + "$ref": "#/definitions/v1EmailAuthIntentV3" + }, + "initUserEmailRecoveryIntentV2": { + "$ref": "#/definitions/v1InitUserEmailRecoveryIntentV2" + }, + "initOtpIntentV2": { + "$ref": "#/definitions/v1InitOtpIntentV2" + }, + "initOtpAuthIntentV3": { + "$ref": "#/definitions/v1InitOtpAuthIntentV3" + }, + "upsertGasUsageConfigIntent": { + "$ref": "#/definitions/v1UpsertGasUsageConfigIntent" + } + } + }, + "v1Invitation": { + "type": "object", + "properties": { + "invitationId": { + "type": "string", + "description": "Unique identifier for a given Invitation object." + }, + "receiverUserName": { + "type": "string", + "description": "The name of the intended Invitation recipient." + }, + "receiverEmail": { + "type": "string", + "description": "The email address of the intended Invitation recipient." + }, + "receiverUserTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags assigned to the Invitation recipient." + }, + "accessType": { + "$ref": "#/definitions/v1AccessType", + "description": "The User's permissible access method(s)." + }, + "status": { + "$ref": "#/definitions/v1InvitationStatus", + "description": "The current processing status of a specified Invitation." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "senderUserId": { + "type": "string", + "description": "Unique identifier for the Sender of an Invitation." + } + }, + "required": [ + "invitationId", + "receiverUserName", + "receiverEmail", + "receiverUserTags", + "accessType", + "status", + "createdAt", + "updatedAt", + "senderUserId" + ] + }, + "v1InvitationParams": { + "type": "object", + "properties": { + "receiverUserName": { + "type": "string", + "description": "The name of the intended Invitation recipient." + }, + "receiverUserEmail": { + "type": "string", + "description": "The email address of the intended Invitation recipient." + }, + "receiverUserTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of tags assigned to the Invitation recipient. This field, if not needed, should be an empty array in your request body." + }, + "accessType": { + "$ref": "#/definitions/v1AccessType", + "description": "The User's permissible access method(s)." + }, + "senderUserId": { + "type": "string", + "description": "Unique identifier for the Sender of an Invitation." + } + }, + "required": [ + "receiverUserName", + "receiverUserEmail", + "receiverUserTags", + "accessType", + "senderUserId" + ] + }, + "v1InvitationStatus": { + "type": "string", + "enum": [ + "INVITATION_STATUS_CREATED", + "INVITATION_STATUS_ACCEPTED", + "INVITATION_STATUS_REVOKED" + ] + }, + "v1ListFiatOnRampCredentialsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1ListFiatOnRampCredentialsResponse": { + "type": "object", + "properties": { + "fiatOnRampCredentials": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1FiatOnRampCredential" + } + } + }, + "required": ["fiatOnRampCredentials"] + }, + "v1ListOauth2CredentialsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + } + }, + "required": ["organizationId"] + }, + "v1ListOauth2CredentialsResponse": { + "type": "object", + "properties": { + "oauth2Credentials": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Oauth2Credential" + } + } + }, + "required": ["oauth2Credentials"] + }, + "v1ListPrivateKeyTagsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1ListPrivateKeyTagsResponse": { + "type": "object", + "properties": { + "privateKeyTags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/datav1Tag" + }, + "description": "A list of private key tags." + } + }, + "required": ["privateKeyTags"] + }, + "v1ListUserTagsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization." + } + }, + "required": ["organizationId"] + }, + "v1ListUserTagsResponse": { + "type": "object", + "properties": { + "userTags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/datav1Tag" + }, + "description": "A list of user tags." + } + }, + "required": ["userTags"] + }, + "v1LoginUsage": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "Public key for authentication" + } + }, + "required": ["publicKey"] + }, + "v1MnemonicLanguage": { + "type": "string", + "enum": [ + "MNEMONIC_LANGUAGE_ENGLISH", + "MNEMONIC_LANGUAGE_SIMPLIFIED_CHINESE", + "MNEMONIC_LANGUAGE_TRADITIONAL_CHINESE", + "MNEMONIC_LANGUAGE_CZECH", + "MNEMONIC_LANGUAGE_FRENCH", + "MNEMONIC_LANGUAGE_ITALIAN", + "MNEMONIC_LANGUAGE_JAPANESE", + "MNEMONIC_LANGUAGE_KOREAN", + "MNEMONIC_LANGUAGE_SPANISH" + ] + }, + "v1NOOPCodegenAnchorResponse": { + "type": "object", + "properties": { + "stamp": { + "$ref": "#/definitions/v1WebAuthnStamp" + }, + "tokenUsage": { + "$ref": "#/definitions/v1TokenUsage" + } + }, + "required": ["stamp"] + }, + "v1Oauth2AuthenticateIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The OAuth 2.0 credential id whose client_id and client_secret will be used in the OAuth 2.0 flow" + }, + "authCode": { + "type": "string", + "description": "The auth_code provided by the OAuth 2.0 provider to the end user to be exchanged for a Bearer token in the OAuth 2.0 flow" + }, + "redirectUri": { + "type": "string", + "description": "The URI the user is redirected to after they have authenticated with the OAuth 2.0 provider" + }, + "codeVerifier": { + "type": "string", + "description": "The code verifier used by OAuth 2.0 PKCE providers" + }, + "nonce": { + "type": "string", + "description": "An optional nonce used by the client to prevent replay/substitution of an ID token" + }, + "bearerTokenTargetPublicKey": { + "type": "string", + "description": "An optional P256 public key to which, if provided, the bearer token will be encrypted and returned via the `encrypted_bearer_token` claim of the OIDC Token" + } + }, + "required": [ + "oauth2CredentialId", + "authCode", + "redirectUri", + "codeVerifier" + ] + }, + "v1Oauth2AuthenticateRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH2_AUTHENTICATE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1Oauth2AuthenticateIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1Oauth2AuthenticateResult": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token issued by Turnkey to be used with the LoginWithOAuth activity" + } + }, + "required": ["oidcToken"] + }, + "v1Oauth2Credential": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier for a given OAuth 2.0 Credential." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for an Organization." + }, + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The provider for a given OAuth 2.0 Credential." + }, + "clientId": { + "type": "string", + "description": "The client id for a given OAuth 2.0 Credential." + }, + "encryptedClientSecret": { + "type": "string", + "description": "The encrypted client secret for a given OAuth 2.0 Credential encrypted to the TLS Fetcher quorum key." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "oauth2CredentialId", + "organizationId", + "provider", + "clientId", + "encryptedClientSecret", + "createdAt", + "updatedAt" + ] + }, + "v1Oauth2Provider": { + "type": "string", + "enum": ["OAUTH2_PROVIDER_X", "OAUTH2_PROVIDER_DISCORD"] + }, + "v1OauthIntent": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to Oauth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Oauth API keys" + } + }, + "required": ["oidcToken", "targetPublicKey"] + }, + "v1OauthLoginIntent": { + "type": "object", + "properties": { + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the oidc token associated with this request" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["oidcToken", "publicKey"] + }, + "v1OauthLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OauthLoginIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OauthLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1OauthProvider": { + "type": "object", + "properties": { + "providerId": { + "type": "string", + "description": "Unique identifier for an OAuth Provider" + }, + "providerName": { + "type": "string", + "description": "Human-readable name to identify a Provider." + }, + "issuer": { + "type": "string", + "description": "The issuer of the token, typically a URL indicating the authentication server, e.g https://accounts.google.com" + }, + "audience": { + "type": "string", + "description": "Expected audience ('aud' attribute of the signed token) which represents the app ID" + }, + "subject": { + "type": "string", + "description": "Expected subject ('sub' attribute of the signed token) which represents the user ID" + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "providerId", + "providerName", + "issuer", + "audience", + "subject", + "createdAt", + "updatedAt" + ] + }, + "v1OauthProviderParams": { + "type": "object", + "properties": { + "providerName": { + "type": "string", + "description": "Human-readable name to identify a Provider." + }, + "oidcToken": { + "type": "string", + "description": "Base64 encoded OIDC token" + } + }, + "required": ["providerName", "oidcToken"] + }, + "v1OauthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OAUTH"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OauthIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OauthResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the authenticating User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": ["userId", "apiKeyId", "credentialBundle"] + }, + "v1Operator": { + "type": "string", + "enum": [ + "OPERATOR_EQUAL", + "OPERATOR_MORE_THAN", + "OPERATOR_MORE_THAN_OR_EQUAL", + "OPERATOR_LESS_THAN", + "OPERATOR_LESS_THAN_OR_EQUAL", + "OPERATOR_CONTAINS", + "OPERATOR_NOT_EQUAL", + "OPERATOR_IN", + "OPERATOR_NOT_IN", + "OPERATOR_CONTAINS_ONE", + "OPERATOR_CONTAINS_ALL" + ] + }, + "v1OrganizationData": { + "type": "object", + "properties": { + "organizationId": { + "type": "string" + }, + "name": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1User" + } + }, + "policies": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Policy" + } + }, + "privateKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1PrivateKey" + } + }, + "invitations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Invitation" + } + }, + "tags": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/datav1Tag" + } + }, + "rootQuorum": { + "$ref": "#/definitions/externaldatav1Quorum" + }, + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + } + }, + "wallets": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Wallet" + } + }, + "smartContractInterfaceReferences": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SmartContractInterfaceReference" + } + } + } + }, + "v1OtpAuthIntent": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "ID representing the result of an init OTP activity." + }, + "otpCode": { + "type": "string", + "description": "OTP sent out to a user's contact (email or SMS)" + }, + "targetPublicKey": { + "type": "string", + "description": "Client-side public key generated by the user, to which the OTP bundle (credentials) will be encrypted." + }, + "apiKeyName": { + "type": "string", + "description": "Optional human-readable name for an API Key. If none provided, default to OTP Auth - \u003cTimestamp\u003e" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the API key is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated OTP Auth API keys" + } + }, + "required": ["otpId", "otpCode", "targetPublicKey"] + }, + "v1OtpAuthRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OTP_AUTH"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OtpAuthIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OtpAuthResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for the authenticating User." + }, + "apiKeyId": { + "type": "string", + "description": "Unique identifier for the created API key." + }, + "credentialBundle": { + "type": "string", + "description": "HPKE encrypted credential bundle" + } + }, + "required": ["userId"] + }, + "v1OtpLoginIntent": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the validity of the verification token" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + }, + "clientSignature": { + "$ref": "#/definitions/v1ClientSignature", + "description": "Optional signature proving authorization for this login. The signature is over the verification token ID and the public key. Only required if a public key was provided during the verification step." + } + }, + "required": ["verificationToken", "publicKey"] + }, + "v1OtpLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_OTP_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1OtpLoginIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1OtpLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1Outcome": { + "type": "string", + "enum": [ + "OUTCOME_ALLOW", + "OUTCOME_DENY_EXPLICIT", + "OUTCOME_DENY_IMPLICIT", + "OUTCOME_REQUIRES_CONSENSUS", + "OUTCOME_REJECTED", + "OUTCOME_ERROR" + ] + }, + "v1Pagination": { + "type": "object", + "properties": { + "limit": { + "type": "string", + "description": "A limit of the number of object to be returned, between 1 and 100. Defaults to 10." + }, + "before": { + "type": "string", + "description": "A pagination cursor. This is an object ID that enables you to fetch all objects before this ID." + }, + "after": { + "type": "string", + "description": "A pagination cursor. This is an object ID that enables you to fetch all objects after this ID." + } + } + }, + "v1PathFormat": { + "type": "string", + "enum": ["PATH_FORMAT_BIP32"] + }, + "v1PayloadEncoding": { + "type": "string", + "enum": [ + "PAYLOAD_ENCODING_HEXADECIMAL", + "PAYLOAD_ENCODING_TEXT_UTF8", + "PAYLOAD_ENCODING_EIP712", + "PAYLOAD_ENCODING_EIP7702_AUTHORIZATION" + ] + }, + "v1Policy": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "effect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW a particular activity following policy selector(s)." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "notes": { + "type": "string", + "description": "Human-readable notes added by a User to describe a particular policy." + }, + "consensus": { + "type": "string", + "description": "A consensus expression that evalutes to true or false." + }, + "condition": { + "type": "string", + "description": "A condition expression that evalutes to true or false." + } + }, + "required": [ + "policyId", + "policyName", + "effect", + "createdAt", + "updatedAt", + "notes", + "consensus", + "condition" + ] + }, + "v1PrivateKey": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/externaldatav1Address" + }, + "description": "Derived cryptocurrency addresses for a given Private Key." + }, + "privateKeyTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "exported": { + "type": "boolean", + "description": "True when a given Private Key is exported, false otherwise." + }, + "imported": { + "type": "boolean", + "description": "True when a given Private Key is imported, false otherwise." + } + }, + "required": [ + "privateKeyId", + "publicKey", + "privateKeyName", + "curve", + "addresses", + "privateKeyTags", + "createdAt", + "updatedAt", + "exported", + "imported" + ] + }, + "v1PrivateKeyParams": { + "type": "object", + "properties": { + "privateKeyName": { + "type": "string", + "description": "Human-readable name for a Private Key." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic Curve used to generate a given Private Key." + }, + "privateKeyTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key Tag IDs. This field, if not needed, should be an empty array in your request body." + }, + "addressFormats": { + "type": "array", + "items": { + "$ref": "#/definitions/v1AddressFormat" + }, + "description": "Cryptocurrency-specific formats for a derived address (e.g., Ethereum)." + } + }, + "required": [ + "privateKeyName", + "curve", + "privateKeyTags", + "addressFormats" + ] + }, + "v1PrivateKeyResult": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/immutableactivityv1Address" + } + } + } + }, + "v1PublicKeyCredentialWithAttestation": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": ["public-key"] + }, + "rawId": { + "type": "string" + }, + "authenticatorAttachment": { + "type": "string", + "enum": ["cross-platform", "platform"], + "x-nullable": true + }, + "response": { + "$ref": "#/definitions/v1AuthenticatorAttestationResponse" + }, + "clientExtensionResults": { + "$ref": "#/definitions/v1SimpleClientExtensionResults" + } + }, + "required": ["id", "type", "rawId", "response", "clientExtensionResults"] + }, + "v1RecoverUserIntent": { + "type": "object", + "properties": { + "authenticator": { + "$ref": "#/definitions/v1AuthenticatorParamsV2", + "description": "The new authenticator to register." + }, + "userId": { + "type": "string", + "description": "Unique identifier for the user performing recovery." + } + }, + "required": ["authenticator", "userId"] + }, + "v1RecoverUserRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_RECOVER_USER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RecoverUserIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1RecoverUserResult": { + "type": "object", + "properties": { + "authenticatorId": { + "type": "array", + "items": { + "type": "string" + }, + "description": "ID of the authenticator created." + } + }, + "required": ["authenticatorId"] + }, + "v1RejectActivityIntent": { + "type": "object", + "properties": { + "fingerprint": { + "type": "string", + "description": "An artifact verifying a User's action." + } + }, + "required": ["fingerprint"] + }, + "v1RejectActivityRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_REJECT_ACTIVITY"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RejectActivityIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1RemoveOrganizationFeatureIntent": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/v1FeatureName", + "description": "Name of the feature to remove" + } + }, + "required": ["name"] + }, + "v1RemoveOrganizationFeatureRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_REMOVE_ORGANIZATION_FEATURE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1RemoveOrganizationFeatureResult": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + }, + "description": "Resulting list of organization features." + } + }, + "required": ["features"] + }, + "v1Result": { + "type": "object", + "properties": { + "createOrganizationResult": { + "$ref": "#/definitions/v1CreateOrganizationResult" + }, + "createAuthenticatorsResult": { + "$ref": "#/definitions/v1CreateAuthenticatorsResult" + }, + "createUsersResult": { + "$ref": "#/definitions/v1CreateUsersResult" + }, + "createPrivateKeysResult": { + "$ref": "#/definitions/v1CreatePrivateKeysResult" + }, + "createInvitationsResult": { + "$ref": "#/definitions/v1CreateInvitationsResult" + }, + "acceptInvitationResult": { + "$ref": "#/definitions/v1AcceptInvitationResult" + }, + "signRawPayloadResult": { + "$ref": "#/definitions/v1SignRawPayloadResult" + }, + "createPolicyResult": { + "$ref": "#/definitions/v1CreatePolicyResult" + }, + "disablePrivateKeyResult": { + "$ref": "#/definitions/v1DisablePrivateKeyResult" + }, + "deleteUsersResult": { + "$ref": "#/definitions/v1DeleteUsersResult" + }, + "deleteAuthenticatorsResult": { + "$ref": "#/definitions/v1DeleteAuthenticatorsResult" + }, + "deleteInvitationResult": { + "$ref": "#/definitions/v1DeleteInvitationResult" + }, + "deleteOrganizationResult": { + "$ref": "#/definitions/v1DeleteOrganizationResult" + }, + "deletePolicyResult": { + "$ref": "#/definitions/v1DeletePolicyResult" + }, + "createUserTagResult": { + "$ref": "#/definitions/v1CreateUserTagResult" + }, + "deleteUserTagsResult": { + "$ref": "#/definitions/v1DeleteUserTagsResult" + }, + "signTransactionResult": { + "$ref": "#/definitions/v1SignTransactionResult" + }, + "deleteApiKeysResult": { + "$ref": "#/definitions/v1DeleteApiKeysResult" + }, + "createApiKeysResult": { + "$ref": "#/definitions/v1CreateApiKeysResult" + }, + "createPrivateKeyTagResult": { + "$ref": "#/definitions/v1CreatePrivateKeyTagResult" + }, + "deletePrivateKeyTagsResult": { + "$ref": "#/definitions/v1DeletePrivateKeyTagsResult" + }, + "setPaymentMethodResult": { + "$ref": "#/definitions/billingSetPaymentMethodResult" + }, + "activateBillingTierResult": { + "$ref": "#/definitions/billingActivateBillingTierResult" + }, + "deletePaymentMethodResult": { + "$ref": "#/definitions/billingDeletePaymentMethodResult" + }, + "createApiOnlyUsersResult": { + "$ref": "#/definitions/v1CreateApiOnlyUsersResult" + }, + "updateRootQuorumResult": { + "$ref": "#/definitions/v1UpdateRootQuorumResult" + }, + "updateUserTagResult": { + "$ref": "#/definitions/v1UpdateUserTagResult" + }, + "updatePrivateKeyTagResult": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagResult" + }, + "createSubOrganizationResult": { + "$ref": "#/definitions/v1CreateSubOrganizationResult" + }, + "updateAllowedOriginsResult": { + "$ref": "#/definitions/v1UpdateAllowedOriginsResult" + }, + "createPrivateKeysResultV2": { + "$ref": "#/definitions/v1CreatePrivateKeysResultV2" + }, + "updateUserResult": { + "$ref": "#/definitions/v1UpdateUserResult" + }, + "updatePolicyResult": { + "$ref": "#/definitions/v1UpdatePolicyResult" + }, + "createSubOrganizationResultV3": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV3" + }, + "createWalletResult": { + "$ref": "#/definitions/v1CreateWalletResult" + }, + "createWalletAccountsResult": { + "$ref": "#/definitions/v1CreateWalletAccountsResult" + }, + "initUserEmailRecoveryResult": { + "$ref": "#/definitions/v1InitUserEmailRecoveryResult" + }, + "recoverUserResult": { + "$ref": "#/definitions/v1RecoverUserResult" + }, + "setOrganizationFeatureResult": { + "$ref": "#/definitions/v1SetOrganizationFeatureResult" + }, + "removeOrganizationFeatureResult": { + "$ref": "#/definitions/v1RemoveOrganizationFeatureResult" + }, + "exportPrivateKeyResult": { + "$ref": "#/definitions/v1ExportPrivateKeyResult" + }, + "exportWalletResult": { + "$ref": "#/definitions/v1ExportWalletResult" + }, + "createSubOrganizationResultV4": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV4" + }, + "emailAuthResult": { + "$ref": "#/definitions/v1EmailAuthResult" + }, + "exportWalletAccountResult": { + "$ref": "#/definitions/v1ExportWalletAccountResult" + }, + "initImportWalletResult": { + "$ref": "#/definitions/v1InitImportWalletResult" + }, + "importWalletResult": { + "$ref": "#/definitions/v1ImportWalletResult" + }, + "initImportPrivateKeyResult": { + "$ref": "#/definitions/v1InitImportPrivateKeyResult" + }, + "importPrivateKeyResult": { + "$ref": "#/definitions/v1ImportPrivateKeyResult" + }, + "createPoliciesResult": { + "$ref": "#/definitions/v1CreatePoliciesResult" + }, + "signRawPayloadsResult": { + "$ref": "#/definitions/v1SignRawPayloadsResult" + }, + "createReadOnlySessionResult": { + "$ref": "#/definitions/v1CreateReadOnlySessionResult" + }, + "createOauthProvidersResult": { + "$ref": "#/definitions/v1CreateOauthProvidersResult" + }, + "deleteOauthProvidersResult": { + "$ref": "#/definitions/v1DeleteOauthProvidersResult" + }, + "createSubOrganizationResultV5": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV5" + }, + "oauthResult": { + "$ref": "#/definitions/v1OauthResult" + }, + "createReadWriteSessionResult": { + "$ref": "#/definitions/v1CreateReadWriteSessionResult" + }, + "createSubOrganizationResultV6": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV6" + }, + "deletePrivateKeysResult": { + "$ref": "#/definitions/v1DeletePrivateKeysResult" + }, + "deleteWalletsResult": { + "$ref": "#/definitions/v1DeleteWalletsResult" + }, + "createReadWriteSessionResultV2": { + "$ref": "#/definitions/v1CreateReadWriteSessionResultV2" + }, + "deleteSubOrganizationResult": { + "$ref": "#/definitions/v1DeleteSubOrganizationResult" + }, + "initOtpAuthResult": { + "$ref": "#/definitions/v1InitOtpAuthResult" + }, + "otpAuthResult": { + "$ref": "#/definitions/v1OtpAuthResult" + }, + "createSubOrganizationResultV7": { + "$ref": "#/definitions/v1CreateSubOrganizationResultV7" + }, + "updateWalletResult": { + "$ref": "#/definitions/v1UpdateWalletResult" + }, + "updatePolicyResultV2": { + "$ref": "#/definitions/v1UpdatePolicyResultV2" + }, + "initOtpAuthResultV2": { + "$ref": "#/definitions/v1InitOtpAuthResultV2" + }, + "initOtpResult": { + "$ref": "#/definitions/v1InitOtpResult" + }, + "verifyOtpResult": { + "$ref": "#/definitions/v1VerifyOtpResult" + }, + "otpLoginResult": { + "$ref": "#/definitions/v1OtpLoginResult" + }, + "stampLoginResult": { + "$ref": "#/definitions/v1StampLoginResult" + }, + "oauthLoginResult": { + "$ref": "#/definitions/v1OauthLoginResult" + }, + "updateUserNameResult": { + "$ref": "#/definitions/v1UpdateUserNameResult" + }, + "updateUserEmailResult": { + "$ref": "#/definitions/v1UpdateUserEmailResult" + }, + "updateUserPhoneNumberResult": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberResult" + }, + "initFiatOnRampResult": { + "$ref": "#/definitions/v1InitFiatOnRampResult" + }, + "createSmartContractInterfaceResult": { + "$ref": "#/definitions/v1CreateSmartContractInterfaceResult" + }, + "deleteSmartContractInterfaceResult": { + "$ref": "#/definitions/v1DeleteSmartContractInterfaceResult" + }, + "enableAuthProxyResult": { + "$ref": "#/definitions/v1EnableAuthProxyResult" + }, + "disableAuthProxyResult": { + "$ref": "#/definitions/v1DisableAuthProxyResult" + }, + "updateAuthProxyConfigResult": { + "$ref": "#/definitions/v1UpdateAuthProxyConfigResult" + }, + "createOauth2CredentialResult": { + "$ref": "#/definitions/v1CreateOauth2CredentialResult" + }, + "updateOauth2CredentialResult": { + "$ref": "#/definitions/v1UpdateOauth2CredentialResult" + }, + "deleteOauth2CredentialResult": { + "$ref": "#/definitions/v1DeleteOauth2CredentialResult" + }, + "oauth2AuthenticateResult": { + "$ref": "#/definitions/v1Oauth2AuthenticateResult" + }, + "deleteWalletAccountsResult": { + "$ref": "#/definitions/v1DeleteWalletAccountsResult" + }, + "deletePoliciesResult": { + "$ref": "#/definitions/v1DeletePoliciesResult" + }, + "ethSendRawTransactionResult": { + "$ref": "#/definitions/v1EthSendRawTransactionResult" + }, + "createFiatOnRampCredentialResult": { + "$ref": "#/definitions/v1CreateFiatOnRampCredentialResult" + }, + "updateFiatOnRampCredentialResult": { + "$ref": "#/definitions/v1UpdateFiatOnRampCredentialResult" + }, + "deleteFiatOnRampCredentialResult": { + "$ref": "#/definitions/v1DeleteFiatOnRampCredentialResult" + }, + "ethSendTransactionResult": { + "$ref": "#/definitions/v1EthSendTransactionResult" + }, + "upsertGasUsageConfigResult": { + "$ref": "#/definitions/v1UpsertGasUsageConfigResult" + } + } + }, + "v1RootUserParams": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators"] + }, + "v1RootUserParamsV2": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] + }, + "v1RootUserParamsV3": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] + }, + "v1RootUserParamsV4": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "oauthProviders"] + }, + "v1Selector": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/v1Operator" + }, + "target": { + "type": "string" + } + } + }, + "v1SelectorV2": { + "type": "object", + "properties": { + "subject": { + "type": "string" + }, + "operator": { + "$ref": "#/definitions/v1Operator" + }, + "targets": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "v1SetOrganizationFeatureIntent": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/v1FeatureName", + "description": "Name of the feature to set" + }, + "value": { + "type": "string", + "description": "Optional value for the feature. Will override existing values if feature is already set." + } + }, + "required": ["name", "value"] + }, + "v1SetOrganizationFeatureRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SET_ORGANIZATION_FEATURE"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SetOrganizationFeatureIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SetOrganizationFeatureResult": { + "type": "object", + "properties": { + "features": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Feature" + }, + "description": "Resulting list of organization features." + } + }, + "required": ["features"] + }, + "v1SignRawPayloadIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "payload": { + "type": "string", + "description": "Raw unsigned payload to be signed." + }, + "encoding": { + "$ref": "#/definitions/v1PayloadEncoding", + "description": "Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + }, + "hashFunction": { + "$ref": "#/definitions/v1HashFunction", + "description": "Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + } + }, + "required": ["privateKeyId", "payload", "encoding", "hashFunction"] + }, + "v1SignRawPayloadIntentV2": { + "type": "object", + "properties": { + "signWith": { + "type": "string", + "description": "A Wallet account address, Private Key address, or Private Key identifier." + }, + "payload": { + "type": "string", + "description": "Raw unsigned payload to be signed." + }, + "encoding": { + "$ref": "#/definitions/v1PayloadEncoding", + "description": "Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + }, + "hashFunction": { + "$ref": "#/definitions/v1HashFunction", + "description": "Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + } + }, + "required": ["signWith", "payload", "encoding", "hashFunction"] + }, + "v1SignRawPayloadRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SIGN_RAW_PAYLOAD_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SignRawPayloadIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SignRawPayloadResult": { + "type": "object", + "properties": { + "r": { + "type": "string", + "description": "Component of an ECSDA signature." + }, + "s": { + "type": "string", + "description": "Component of an ECSDA signature." + }, + "v": { + "type": "string", + "description": "Component of an ECSDA signature." + } + }, + "required": ["r", "s", "v"] + }, + "v1SignRawPayloadsIntent": { + "type": "object", + "properties": { + "signWith": { + "type": "string", + "description": "A Wallet account address, Private Key address, or Private Key identifier." + }, + "payloads": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of raw unsigned payloads to be signed." + }, + "encoding": { + "$ref": "#/definitions/v1PayloadEncoding", + "description": "Encoding of the `payload` string. Turnkey uses this information to convert `payload` into bytes with the correct decoder (e.g. hex, utf8)." + }, + "hashFunction": { + "$ref": "#/definitions/v1HashFunction", + "description": "Hash function to apply to payload bytes before signing. This field must be set to HASH_FUNCTION_NOT_APPLICABLE for EdDSA/ed25519 signature requests; configurable payload hashing is not supported by RFC 8032." + } + }, + "required": ["signWith", "payloads", "encoding", "hashFunction"] + }, + "v1SignRawPayloadsRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SIGN_RAW_PAYLOADS"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SignRawPayloadsIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SignRawPayloadsResult": { + "type": "object", + "properties": { + "signatures": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1SignRawPayloadResult" + } + } + } + }, + "v1SignTransactionIntent": { + "type": "object", + "properties": { + "privateKeyId": { + "type": "string", + "description": "Unique identifier for a given Private Key." + }, + "unsignedTransaction": { + "type": "string", + "description": "Raw unsigned transaction to be signed by a particular Private Key." + }, + "type": { + "$ref": "#/definitions/v1TransactionType" + } + }, + "required": ["privateKeyId", "unsignedTransaction", "type"] + }, + "v1SignTransactionIntentV2": { + "type": "object", + "properties": { + "signWith": { + "type": "string", + "description": "A Wallet account address, Private Key address, or Private Key identifier." + }, + "unsignedTransaction": { + "type": "string", + "description": "Raw unsigned transaction to be signed" + }, + "type": { + "$ref": "#/definitions/v1TransactionType" + } + }, + "required": ["signWith", "unsignedTransaction", "type"] + }, + "v1SignTransactionRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_SIGN_TRANSACTION_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1SignTransactionIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1SignTransactionResult": { + "type": "object", + "properties": { + "signedTransaction": { + "type": "string" + } + }, + "required": ["signedTransaction"] + }, + "v1SignupUsage": { + "type": "object", + "properties": { + "email": { + "type": "string" + }, + "phoneNumber": { + "type": "string" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + } + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + } + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + } + } + } + }, + "v1SimpleClientExtensionResults": { + "type": "object", + "properties": { + "appid": { + "type": "boolean" + }, + "appidExclude": { + "type": "boolean" + }, + "credProps": { + "$ref": "#/definitions/v1CredPropsAuthenticationExtensionsClientOutputs" + } + } + }, + "v1SmartContractInterfaceReference": { + "type": "object", + "properties": { + "smartContractInterfaceId": { + "type": "string" + }, + "smartContractAddress": { + "type": "string" + }, + "digest": { + "type": "string" + } + } + }, + "v1SmartContractInterfaceType": { + "type": "string", + "enum": [ + "SMART_CONTRACT_INTERFACE_TYPE_ETHEREUM", + "SMART_CONTRACT_INTERFACE_TYPE_SOLANA" + ] + }, + "v1SmsCustomizationParams": { + "type": "object", + "properties": { + "template": { + "type": "string", + "description": "Template containing references to .OtpCode i.e Your OTP is {{.OtpCode}}" + } + } + }, + "v1StampLoginIntent": { + "type": "object", + "properties": { + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be conditionally added to org data based on the passkey stamp associated with this request" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the Session is valid for. If not provided, a default of 15 minutes will be used." + }, + "invalidateExisting": { + "type": "boolean", + "description": "Invalidate all other previously generated Login API keys" + } + }, + "required": ["publicKey"] + }, + "v1StampLoginRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_STAMP_LOGIN"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1StampLoginIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1StampLoginResult": { + "type": "object", + "properties": { + "session": { + "type": "string", + "description": "Signed JWT containing an expiry, public key, session type, user id, and organization id" + } + }, + "required": ["session"] + }, + "v1TagType": { + "type": "string", + "enum": ["TAG_TYPE_USER", "TAG_TYPE_PRIVATE_KEY"] + }, + "v1TestRateLimitsRequest": { + "type": "object", + "properties": { + "organizationId": { + "type": "string", + "description": "Unique identifier for a given organization. If the request is being made by a WebAuthN user and their sub-organization ID is unknown, this can be the parent organization ID; using the sub-organization ID when possible is preferred due to performance reasons." + }, + "isSetLimit": { + "type": "boolean", + "description": "Whether or not to set a limit on this request." + }, + "limit": { + "type": "integer", + "format": "int64", + "description": "Rate limit to set for org, if is_set_limit is set to true." + } + }, + "required": ["organizationId", "isSetLimit", "limit"] + }, + "v1TestRateLimitsResponse": { + "type": "object" + }, + "v1TokenUsage": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/v1UsageType", + "description": "Type of token usage" + }, + "tokenId": { + "type": "string", + "description": "Unique identifier for the verification token" + }, + "signup": { + "$ref": "#/definitions/v1SignupUsage" + }, + "login": { + "$ref": "#/definitions/v1LoginUsage" + } + }, + "required": ["type", "tokenId"] + }, + "v1TransactionType": { + "type": "string", + "enum": [ + "TRANSACTION_TYPE_ETHEREUM", + "TRANSACTION_TYPE_SOLANA", + "TRANSACTION_TYPE_TRON", + "TRANSACTION_TYPE_BITCOIN" + ] + }, + "v1UpdateAllowedOriginsIntent": { + "type": "object", + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Additional origins requests are allowed from besides Turnkey origins" + } + }, + "required": ["allowedOrigins"] + }, + "v1UpdateAllowedOriginsResult": { + "type": "object" + }, + "v1UpdateAuthProxyConfigIntent": { + "type": "object", + "properties": { + "allowedOrigins": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Updated list of allowed origins for CORS." + }, + "allowedAuthMethods": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Updated list of allowed proxy authentication methods." + }, + "sendFromEmailAddress": { + "type": "string", + "description": "Custom 'from' address for auth-related emails." + }, + "replyToEmailAddress": { + "type": "string", + "description": "Custom reply-to address for auth-related emails." + }, + "emailAuthTemplateId": { + "type": "string", + "description": "Template ID for email-auth messages." + }, + "otpTemplateId": { + "type": "string", + "description": "Template ID for OTP SMS messages." + }, + "emailCustomizationParams": { + "$ref": "#/definitions/v1EmailCustomizationParams", + "description": "Optional parameters for customizing emails. If not provided, the default email will be used." + }, + "smsCustomizationParams": { + "$ref": "#/definitions/v1SmsCustomizationParams", + "description": "Overrides for auth-related SMS content." + }, + "walletKitSettings": { + "$ref": "#/definitions/v1WalletKitSettingsParams", + "description": "Overrides for react wallet kit related settings." + }, + "otpExpirationSeconds": { + "type": "integer", + "format": "int32", + "description": "OTP code lifetime in seconds." + }, + "verificationTokenExpirationSeconds": { + "type": "integer", + "format": "int32", + "description": "Verification-token lifetime in seconds." + }, + "sessionExpirationSeconds": { + "type": "integer", + "format": "int32", + "description": "Session lifetime in seconds." + }, + "otpAlphanumeric": { + "type": "boolean", + "description": "Enable alphanumeric OTP codes." + }, + "otpLength": { + "type": "integer", + "format": "int32", + "description": "Desired OTP code length (6โ€“9)." + }, + "sendFromEmailSenderName": { + "type": "string", + "description": "Custom 'from' email sender for auth-related emails." + }, + "verificationTokenRequiredForGetAccountPii": { + "type": "boolean", + "description": "Verification token required for get account with PII (email/phone number). Default false." + } + } + }, + "v1UpdateAuthProxyConfigResult": { + "type": "object", + "properties": { + "configId": { + "type": "string", + "description": "Unique identifier for a given User. (representing the turnkey signer user id)" + } + } + }, + "v1UpdateFiatOnRampCredentialIntent": { + "type": "object", + "properties": { + "fiatOnrampCredentialId": { + "type": "string", + "description": "The ID of the fiat on-ramp credential to update" + }, + "onrampProvider": { + "$ref": "#/definitions/v1FiatOnRampProvider", + "description": "The fiat on-ramp provider" + }, + "projectId": { + "type": "string", + "description": "Project ID for the on-ramp provider. Some providers, like Coinbase, require this additional identifier." + }, + "publishableApiKey": { + "type": "string", + "description": "Publishable API key for the on-ramp provider" + }, + "encryptedSecretApiKey": { + "type": "string", + "description": "Secret API key for the on-ramp provider encrypted to our on-ramp encryption public key" + }, + "encryptedPrivateApiKey": { + "type": "string", + "description": "Private API key for the on-ramp provider encrypted to our on-ramp encryption public key. Some providers, like Coinbase, require this additional key." + } + }, + "required": [ + "fiatOnrampCredentialId", + "onrampProvider", + "publishableApiKey", + "encryptedSecretApiKey" + ] + }, + "v1UpdateFiatOnRampCredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_FIAT_ON_RAMP_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateFiatOnRampCredentialIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateFiatOnRampCredentialResult": { + "type": "object", + "properties": { + "fiatOnRampCredentialId": { + "type": "string", + "description": "Unique identifier of the Fiat On-Ramp credential that was updated" + } + }, + "required": ["fiatOnRampCredentialId"] + }, + "v1UpdateOauth2CredentialIntent": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "The ID of the OAuth 2.0 credential to update" + }, + "provider": { + "$ref": "#/definitions/v1Oauth2Provider", + "description": "The OAuth 2.0 provider" + }, + "clientId": { + "type": "string", + "description": "The Client ID issued by the OAuth 2.0 provider" + }, + "encryptedClientSecret": { + "type": "string", + "description": "The client secret issued by the OAuth 2.0 provider encrypted to the TLS Fetcher quorum key" + } + }, + "required": [ + "oauth2CredentialId", + "provider", + "clientId", + "encryptedClientSecret" + ] + }, + "v1UpdateOauth2CredentialRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_OAUTH2_CREDENTIAL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateOauth2CredentialIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateOauth2CredentialResult": { + "type": "object", + "properties": { + "oauth2CredentialId": { + "type": "string", + "description": "Unique identifier of the OAuth 2.0 credential that was updated" + } + }, + "required": ["oauth2CredentialId"] + }, + "v1UpdatePolicyIntent": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "policyEffect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW an activity (optional)." + }, + "policyCondition": { + "type": "string", + "description": "The condition expression that triggers the Effect (optional)." + }, + "policyConsensus": { + "type": "string", + "description": "The consensus expression that triggers the Effect (optional)." + }, + "policyNotes": { + "type": "string", + "description": "Accompanying notes for a Policy (optional)." + } + }, + "required": ["policyId"] + }, + "v1UpdatePolicyIntentV2": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + }, + "policyName": { + "type": "string", + "description": "Human-readable name for a Policy." + }, + "policyEffect": { + "$ref": "#/definitions/v1Effect", + "description": "The instruction to DENY or ALLOW an activity (optional)." + }, + "policyCondition": { + "type": "string", + "description": "The condition expression that triggers the Effect (optional)." + }, + "policyConsensus": { + "type": "string", + "description": "The consensus expression that triggers the Effect (optional)." + }, + "policyNotes": { + "type": "string", + "description": "Accompanying notes for a Policy (optional)." + } + }, + "required": ["policyId"] + }, + "v1UpdatePolicyRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_POLICY_V2"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdatePolicyIntentV2" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdatePolicyResult": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1UpdatePolicyResultV2": { + "type": "object", + "properties": { + "policyId": { + "type": "string", + "description": "Unique identifier for a given Policy." + } + }, + "required": ["policyId"] + }, + "v1UpdatePrivateKeyTagIntent": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + }, + "newPrivateKeyTagName": { + "type": "string", + "description": "The new, human-readable name for the tag with the given ID." + }, + "addPrivateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Keys IDs to add this tag to." + }, + "removePrivateKeyIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of Private Key IDs to remove this tag from." + } + }, + "required": ["privateKeyTagId", "addPrivateKeyIds", "removePrivateKeyIds"] + }, + "v1UpdatePrivateKeyTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_PRIVATE_KEY_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdatePrivateKeyTagIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdatePrivateKeyTagResult": { + "type": "object", + "properties": { + "privateKeyTagId": { + "type": "string", + "description": "Unique identifier for a given Private Key Tag." + } + }, + "required": ["privateKeyTagId"] + }, + "v1UpdateRootQuorumIntent": { + "type": "object", + "properties": { + "threshold": { + "type": "integer", + "format": "int32", + "description": "The threshold of unique approvals to reach quorum." + }, + "userIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The unique identifiers of users who comprise the quorum set." + } + }, + "required": ["threshold", "userIds"] + }, + "v1UpdateRootQuorumRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_ROOT_QUORUM"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateRootQuorumIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateRootQuorumResult": { + "type": "object" + }, + "v1UpdateUserEmailIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address. Setting this to an empty string will remove the user's email." + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["userId", "userEmail"] + }, + "v1UpdateUserEmailRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_EMAIL"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserEmailIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserEmailResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose email was updated." + } + }, + "required": ["userId"] + }, + "v1UpdateUserIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userTagIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An updated list of User Tags to apply to this User. This field, if not needed, should be an empty array in your request body." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + } + }, + "required": ["userId"] + }, + "v1UpdateUserNameIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + } + }, + "required": ["userId", "userName"] + }, + "v1UpdateUserNameRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_NAME"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserNameIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserNameResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose name was updated." + } + }, + "required": ["userId"] + }, + "v1UpdateUserPhoneNumberIntent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890. Setting this to an empty string will remove the user's phone number." + }, + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact" + } + }, + "required": ["userId", "userPhoneNumber"] + }, + "v1UpdateUserPhoneNumberRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_PHONE_NUMBER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserPhoneNumberIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserPhoneNumberResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier of the User whose phone number was updated." + } + }, + "required": ["userId"] + }, + "v1UpdateUserRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserResult": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "A User ID." + } + }, + "required": ["userId"] + }, + "v1UpdateUserTagIntent": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + }, + "newUserTagName": { + "type": "string", + "description": "The new, human-readable name for the tag with the given ID." + }, + "addUserIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs to add this tag to." + }, + "removeUserIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User IDs to remove this tag from." + } + }, + "required": ["userTagId", "addUserIds", "removeUserIds"] + }, + "v1UpdateUserTagRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_USER_TAG"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateUserTagIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateUserTagResult": { + "type": "object", + "properties": { + "userTagId": { + "type": "string", + "description": "Unique identifier for a given User Tag." + } + }, + "required": ["userTagId"] + }, + "v1UpdateWalletIntent": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + } + }, + "required": ["walletId"] + }, + "v1UpdateWalletRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_UPDATE_WALLET"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1UpdateWalletIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1UpdateWalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "A Wallet ID." + } + }, + "required": ["walletId"] + }, + "v1UpsertGasUsageConfigIntent": { + "type": "object", + "properties": { + "orgWindowLimitUsd": { + "type": "string", + "description": "Gas sponsorship USD limit for the billing organization window." + }, + "subOrgWindowLimitUsd": { + "type": "string", + "description": "Gas sponsorship USD limit for sub-organizations under the billing organization." + }, + "windowDurationMinutes": { + "type": "string", + "description": "Rolling sponsorship window duration, expressed in minutes." + } + }, + "required": [ + "orgWindowLimitUsd", + "subOrgWindowLimitUsd", + "windowDurationMinutes" + ] + }, + "v1UpsertGasUsageConfigResult": { + "type": "object", + "properties": { + "gasUsageConfigId": { + "type": "string", + "description": "Unique identifier for the gas usage configuration that was created or updated." + } + }, + "required": ["gasUsageConfigId"] + }, + "v1UsageType": { + "type": "string", + "enum": ["USAGE_TYPE_SIGNUP", "USAGE_TYPE_LOGIN"] + }, + "v1User": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1Authenticator" + }, + "description": "A list of Authenticator parameters." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKey" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProvider" + }, + "description": "A list of Oauth Providers." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "userId", + "userName", + "authenticators", + "apiKeys", + "userTags", + "oauthProviders", + "createdAt", + "updatedAt" + ] + }, + "v1UserParams": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "accessType": { + "$ref": "#/definitions/v1AccessType", + "description": "The User's permissible access method(s)." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParams" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": [ + "userName", + "accessType", + "apiKeys", + "authenticators", + "userTags" + ] + }, + "v1UserParamsV2": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiApiKeyParams" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": ["userName", "apiKeys", "authenticators", "userTags"] + }, + "v1UserParamsV3": { + "type": "object", + "properties": { + "userName": { + "type": "string", + "description": "Human-readable name for a User." + }, + "userEmail": { + "type": "string", + "description": "The user's email address." + }, + "userPhoneNumber": { + "type": "string", + "description": "The user's phone number in E.164 format e.g. +13214567890" + }, + "apiKeys": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1ApiKeyParamsV2" + }, + "description": "A list of API Key parameters. This field, if not needed, should be an empty array in your request body." + }, + "authenticators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1AuthenticatorParamsV2" + }, + "description": "A list of Authenticator parameters. This field, if not needed, should be an empty array in your request body." + }, + "oauthProviders": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1OauthProviderParams" + }, + "description": "A list of Oauth providers. This field, if not needed, should be an empty array in your request body." + }, + "userTags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of User Tag IDs. This field, if not needed, should be an empty array in your request body." + } + }, + "required": [ + "userName", + "apiKeys", + "authenticators", + "oauthProviders", + "userTags" + ] + }, + "v1VerifyOtpIntent": { + "type": "object", + "properties": { + "otpId": { + "type": "string", + "description": "ID representing the result of an init OTP activity." + }, + "otpCode": { + "type": "string", + "description": "OTP sent out to a user's contact (email or SMS)" + }, + "expirationSeconds": { + "type": "string", + "description": "Expiration window (in seconds) indicating how long the verification token is valid for. If not provided, a default of 1 hour will be used. Maximum value is 86400 seconds (24 hours)" + }, + "publicKey": { + "type": "string", + "description": "Client-side public key generated by the user, which will be added to the JWT response and verified in subsequent requests via a client proof signature" + } + }, + "required": ["otpId", "otpCode"] + }, + "v1VerifyOtpRequest": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": ["ACTIVITY_TYPE_VERIFY_OTP"] + }, + "timestampMs": { + "type": "string", + "description": "Timestamp (in milliseconds) of the request, used to verify liveness of user requests." + }, + "organizationId": { + "type": "string", + "description": "Unique identifier for a given Organization." + }, + "parameters": { + "$ref": "#/definitions/v1VerifyOtpIntent" + }, + "generateAppProofs": { + "type": "boolean" + } + }, + "required": ["type", "timestampMs", "organizationId", "parameters"] + }, + "v1VerifyOtpResult": { + "type": "object", + "properties": { + "verificationToken": { + "type": "string", + "description": "Signed JWT containing a unique id, expiry, verification type, contact. Verification status of a user is updated when the token is consumed (in OTP_LOGIN requests)" + } + }, + "required": ["verificationToken"] + }, + "v1Vote": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for a given Vote object." + }, + "userId": { + "type": "string", + "description": "Unique identifier for a given User." + }, + "user": { + "$ref": "#/definitions/v1User", + "description": "Web and/or API user within your Organization." + }, + "activityId": { + "type": "string", + "description": "Unique identifier for a given Activity object." + }, + "selection": { + "type": "string", + "enum": ["VOTE_SELECTION_APPROVED", "VOTE_SELECTION_REJECTED"] + }, + "message": { + "type": "string", + "description": "The raw message being signed within a Vote." + }, + "publicKey": { + "type": "string", + "description": "The public component of a cryptographic key pair used to sign messages and transactions." + }, + "signature": { + "type": "string", + "description": "The signature applied to a particular vote." + }, + "scheme": { + "type": "string", + "description": "Method used to produce a signature." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + } + }, + "required": [ + "id", + "userId", + "user", + "activityId", + "selection", + "message", + "publicKey", + "signature", + "scheme", + "createdAt" + ] + }, + "v1Wallet": { + "type": "object", + "properties": { + "walletId": { + "type": "string", + "description": "Unique identifier for a given Wallet." + }, + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "exported": { + "type": "boolean", + "description": "True when a given Wallet is exported, false otherwise." + }, + "imported": { + "type": "boolean", + "description": "True when a given Wallet is imported, false otherwise." + } + }, + "required": [ + "walletId", + "walletName", + "createdAt", + "updatedAt", + "exported", + "imported" + ] + }, + "v1WalletAccount": { + "type": "object", + "properties": { + "walletAccountId": { + "type": "string", + "description": "Unique identifier for a given Wallet Account." + }, + "organizationId": { + "type": "string", + "description": "The Organization the Account belongs to." + }, + "walletId": { + "type": "string", + "description": "The Wallet the Account was derived from." + }, + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic curve used to generate the Account." + }, + "pathFormat": { + "$ref": "#/definitions/v1PathFormat", + "description": "Path format used to generate the Account." + }, + "path": { + "type": "string", + "description": "Path used to generate the Account." + }, + "addressFormat": { + "$ref": "#/definitions/v1AddressFormat", + "description": "Address format used to generate the Account." + }, + "address": { + "type": "string", + "description": "Address generated using the Wallet seed and Account parameters." + }, + "createdAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "updatedAt": { + "$ref": "#/definitions/externaldatav1Timestamp" + }, + "publicKey": { + "type": "string", + "description": "The public component of this wallet account's underlying cryptographic key pair." + }, + "walletDetails": { + "$ref": "#/definitions/v1Wallet", + "description": "Wallet details for this account. This is only present when include_wallet_details=true." + } + }, + "required": [ + "walletAccountId", + "organizationId", + "walletId", + "curve", + "pathFormat", + "path", + "addressFormat", + "address", + "createdAt", + "updatedAt" + ] + }, + "v1WalletAccountParams": { + "type": "object", + "properties": { + "curve": { + "$ref": "#/definitions/v1Curve", + "description": "Cryptographic curve used to generate a wallet Account." + }, + "pathFormat": { + "$ref": "#/definitions/v1PathFormat", + "description": "Path format used to generate a wallet Account." + }, + "path": { + "type": "string", + "description": "Path used to generate a wallet Account." + }, + "addressFormat": { + "$ref": "#/definitions/v1AddressFormat", + "description": "Address format used to generate a wallet Acccount." + } + }, + "required": ["curve", "pathFormat", "path", "addressFormat"] + }, + "v1WalletKitSettingsParams": { + "type": "object", + "properties": { + "enabledSocialProviders": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of enabled social login providers (e.g., 'apple', 'google', 'facebook')", + "title": "Enabled Social Providers" + }, + "oauthClientIds": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Mapping of social login providers to their Oauth client IDs.", + "title": "Oauth Client IDs" + }, + "oauthRedirectUrl": { + "type": "string", + "description": "Oauth redirect URL to be used for social login flows.", + "title": "Oauth Redirect URL" + } + } + }, + "v1WalletParams": { + "type": "object", + "properties": { + "walletName": { + "type": "string", + "description": "Human-readable name for a Wallet." + }, + "accounts": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1WalletAccountParams" + }, + "description": "A list of wallet Accounts. This field, if not needed, should be an empty array in your request body." + }, + "mnemonicLength": { + "type": "integer", + "format": "int32", + "description": "Length of mnemonic to generate the Wallet seed. Defaults to 12. Accepted values: 12, 15, 18, 21, 24." + } + }, + "required": ["walletName", "accounts"] + }, + "v1WalletResult": { + "type": "object", + "properties": { + "walletId": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of account addresses." + } + }, + "required": ["walletId", "addresses"] + }, + "v1WebAuthnStamp": { + "type": "object", + "properties": { + "credentialId": { + "type": "string", + "description": "A base64 url encoded Unique identifier for a given credential." + }, + "clientDataJson": { + "type": "string", + "description": "A base64 encoded payload containing metadata about the signing context and the challenge." + }, + "authenticatorData": { + "type": "string", + "description": "A base64 encoded payload containing metadata about the authenticator." + }, + "signature": { + "type": "string", + "description": "The base64 url encoded signature bytes contained within the WebAuthn assertion response." + } + }, + "required": [ + "credentialId", + "clientDataJson", + "authenticatorData", + "signature" + ] + } + }, + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "X-Stamp", + "in": "header" + }, + "AuthenticatorAuth": { + "type": "apiKey", + "name": "X-Stamp-WebAuthn", + "in": "header" + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "AuthenticatorAuth": [] + } + ], + "x-tagGroups": [ + { + "name": "ORGANIZATIONS", + "tags": ["Organizations", "Invitations", "Policies", "Features"] + }, + { + "name": "WALLETS AND PRIVATE KEYS", + "tags": ["Wallets", "Signing", "Private Keys", "Private Key Tags"] + }, + { + "name": "USERS", + "tags": ["Users", "User Tags", "User Recovery", "User Auth"] + }, + { + "name": "CREDENTIALS", + "tags": ["Authenticators", "API Keys", "Sessions"] + }, + { + "name": "ACTIVITIES", + "tags": ["Activities", "Consensus"] + } + ] +} diff --git a/src/stamper.py b/src/stamper.py deleted file mode 100644 index 547bfe5..0000000 --- a/src/stamper.py +++ /dev/null @@ -1,40 +0,0 @@ -import json -from cryptography.hazmat.primitives import hashes -from cryptography.hazmat.primitives.asymmetric import ec -from base64 import urlsafe_b64encode -import requests - -ENDPOINT = "https://api.turnkey.com/public/v1/query/whoami" -API_PUBLIC_KEY="" -API_PRIVATE_KEY="" -ORG_ID = "" - -# Create payload -payload = { - "organizationId": ORG_ID -} -payload_str = json.dumps(payload) - -# Derive private key -private_key = ec.derive_private_key(int(API_PRIVATE_KEY, 16), ec.SECP256R1()) - -# Sign payload -signature = private_key.sign(payload_str.encode(), ec.ECDSA(hashes.SHA256())) - -# Create stamp -stamp = { - "publicKey": API_PUBLIC_KEY, - "scheme": "SIGNATURE_SCHEME_TK_API_P256", - "signature": signature.hex(), -} -encoded_stamp = urlsafe_b64encode(json.dumps(stamp).encode()).decode().rstrip("=") - -headers = { - 'Content-Type': 'application/json', - 'X-Stamp': encoded_stamp, -} - -# Make post request to turnkey API -resp = requests.post(ENDPOINT, headers=headers, data=payload_str) - -print(resp.status_code, resp.text) \ No newline at end of file