From b16550484f4675450611381aa309504ae31ee4dd Mon Sep 17 00:00:00 2001 From: "dfnsco-dfns-sdk-sync[bot]" <275545256+dfnsco-dfns-sdk-sync[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 07:34:44 +0000 Subject: [PATCH] chore: sync generated SDK from monorepo v1.866.6-2 --- dfns_sdk/__init__.py | 10 +- dfns_sdk/_internal/__init__.py | 2 +- dfns_sdk/_internal/http_client.py | 131 +- dfns_sdk/auth.py | 10 +- dfns_sdk/base_auth_api.py | 9 +- dfns_sdk/client.py | 6 +- dfns_sdk/delegated_client.py | 6 +- dfns_sdk/generated/__init__.py | 24 +- dfns_sdk/generated/agreements/__init__.py | 2 +- dfns_sdk/generated/agreements/client.py | 20 +- .../generated/agreements/delegated_client.py | 41 +- dfns_sdk/generated/agreements/types.py | 5 +- dfns_sdk/generated/allocations/__init__.py | 2 +- dfns_sdk/generated/allocations/client.py | 49 +- .../generated/allocations/delegated_client.py | 85 +- dfns_sdk/generated/allocations/types.py | 73 +- dfns_sdk/generated/auth/__init__.py | 2 +- dfns_sdk/generated/auth/client.py | 817 +++--- dfns_sdk/generated/auth/delegated_client.py | 1072 ++++--- dfns_sdk/generated/auth/types.py | 311 +- dfns_sdk/generated/exchanges/__init__.py | 2 +- dfns_sdk/generated/exchanges/client.py | 103 +- .../generated/exchanges/delegated_client.py | 173 +- dfns_sdk/generated/exchanges/types.py | 34 +- dfns_sdk/generated/fee_sponsors/__init__.py | 2 +- dfns_sdk/generated/fee_sponsors/client.py | 59 +- .../fee_sponsors/delegated_client.py | 121 +- dfns_sdk/generated/fee_sponsors/types.py | 28 +- dfns_sdk/generated/keys/__init__.py | 2 +- dfns_sdk/generated/keys/client.py | 206 +- dfns_sdk/generated/keys/delegated_client.py | 228 +- dfns_sdk/generated/keys/types.py | 306 +- dfns_sdk/generated/networks/__init__.py | 2 +- dfns_sdk/generated/networks/client.py | 140 +- .../generated/networks/delegated_client.py | 178 +- dfns_sdk/generated/networks/types.py | 85 +- dfns_sdk/generated/payouts/__init__.py | 2 +- dfns_sdk/generated/payouts/client.py | 49 +- .../generated/payouts/delegated_client.py | 83 +- dfns_sdk/generated/payouts/types.py | 14 +- dfns_sdk/generated/permissions/__init__.py | 2 +- dfns_sdk/generated/permissions/client.py | 79 +- .../generated/permissions/delegated_client.py | 181 +- dfns_sdk/generated/permissions/types.py | 320 +- dfns_sdk/generated/policies/__init__.py | 2 +- dfns_sdk/generated/policies/client.py | 98 +- .../generated/policies/delegated_client.py | 142 +- dfns_sdk/generated/policies/types.py | 30 +- dfns_sdk/generated/signers/__init__.py | 2 +- dfns_sdk/generated/signers/client.py | 146 +- .../generated/signers/delegated_client.py | 392 +-- dfns_sdk/generated/signers/types.py | 53 +- dfns_sdk/generated/staking/__init__.py | 2 +- dfns_sdk/generated/staking/client.py | 58 +- .../generated/staking/delegated_client.py | 94 +- dfns_sdk/generated/staking/types.py | 25 +- dfns_sdk/generated/swaps/__init__.py | 2 +- dfns_sdk/generated/swaps/client.py | 39 +- dfns_sdk/generated/swaps/delegated_client.py | 59 +- dfns_sdk/generated/swaps/types.py | 44 +- dfns_sdk/generated/wallets/__init__.py | 2 +- dfns_sdk/generated/wallets/client.py | 587 ++-- .../generated/wallets/delegated_client.py | 555 ++-- dfns_sdk/generated/wallets/types.py | 2570 +---------------- dfns_sdk/generated/webhooks/__init__.py | 2 +- dfns_sdk/generated/webhooks/client.py | 104 +- .../generated/webhooks/delegated_client.py | 168 +- dfns_sdk/generated/webhooks/types.py | 291 +- dfns_sdk/types.py | 14 +- 69 files changed, 3237 insertions(+), 7320 deletions(-) diff --git a/dfns_sdk/__init__.py b/dfns_sdk/__init__.py index 703d18e..ecb7003 100644 --- a/dfns_sdk/__init__.py +++ b/dfns_sdk/__init__.py @@ -1,14 +1,14 @@ """Dfns Python SDK - Auto-generated from OpenAPI specification.""" -from .auth import KeySigner, Signer +from .client import DfnsClient +from .delegated_client import DfnsDelegatedClient +from .types import DfnsClientConfig, DfnsDelegatedClientConfig, DfnsError +from .auth import Signer, KeySigner from .base_auth_api import ( BaseAuthApi, - SignUserActionChallengeRequest, UserActionChallengeResponse, + SignUserActionChallengeRequest, ) -from .client import DfnsClient -from .delegated_client import DfnsDelegatedClient -from .types import DfnsClientConfig, DfnsDelegatedClientConfig, DfnsError __all__ = [ "DfnsClient", diff --git a/dfns_sdk/_internal/__init__.py b/dfns_sdk/_internal/__init__.py index 8bd09d7..4ac663c 100644 --- a/dfns_sdk/_internal/__init__.py +++ b/dfns_sdk/_internal/__init__.py @@ -1,5 +1,5 @@ """Internal modules.""" -from .http_client import AsyncHttpClient, HttpClient +from .http_client import HttpClient, AsyncHttpClient __all__ = ["HttpClient", "AsyncHttpClient"] diff --git a/dfns_sdk/_internal/http_client.py b/dfns_sdk/_internal/http_client.py index 878690d..8f1735d 100644 --- a/dfns_sdk/_internal/http_client.py +++ b/dfns_sdk/_internal/http_client.py @@ -1,15 +1,19 @@ """HTTP client for making API requests.""" -import hashlib import json -from collections.abc import Mapping -from typing import Any, cast +from typing import Any, Optional, TypeVar, TYPE_CHECKING from urllib.parse import urlencode import httpx from dfns_sdk.types import DfnsClientConfig, DfnsDelegatedClientConfig, DfnsError +if TYPE_CHECKING: + from dfns_sdk.auth import Signer + +T = TypeVar("T") + + class HttpClient: """HTTP client for Dfns API requests.""" @@ -21,7 +25,7 @@ def __init__(self, config: "DfnsClientConfig | DfnsDelegatedClientConfig"): timeout=30.0, ) - def _build_headers(self, user_action_token: str | None = None) -> dict[str, str]: + def _build_headers(self, user_action_token: Optional[str] = None) -> dict[str, str]: """Build request headers.""" headers = { "Content-Type": "application/json", @@ -37,8 +41,8 @@ def _build_headers(self, user_action_token: str | None = None) -> dict[str, str] def _build_url( self, path: str, - path_params: Mapping[str, Any] | None = None, - query_params: Mapping[str, Any] | None = None, + path_params: Optional[dict[str, Any]] = None, + query_params: Optional[dict[str, Any]] = None, ) -> str: """Build the full URL with path and query parameters.""" url = path @@ -69,7 +73,7 @@ def _handle_response(self, response: httpx.Response) -> Any: raise DfnsError( message=response.text or "Unknown error", status_code=response.status_code, - ) from None + ) if response.status_code == 204 or not response.content: return None @@ -80,7 +84,7 @@ def _get_user_action_token( self, method: str, path: str, - body: Any = None, + body: Optional[Any] = None, ) -> str: """ Get a user action token by creating and signing a challenge. @@ -96,8 +100,7 @@ def _get_user_action_token( Raises: DfnsError: If no signer is configured or signing fails. """ - signer = getattr(self.config, "signer", None) - if signer is None: + if not self.config.signer: raise DfnsError( message="Signer required for this operation. Configure a signer in DfnsClientConfig.", status_code=None, @@ -121,7 +124,7 @@ def _get_user_action_token( challenge = self._handle_response(challenge_response) # Step 2: Sign the challenge - assertion = signer.sign(challenge) + assertion = self.config.signer.sign(challenge) # Step 3: Submit signed challenge to get user action token signature_body = { @@ -137,52 +140,28 @@ def _get_user_action_token( ) result = self._handle_response(signature_response) - return cast(str, result["userAction"]) + return result["userAction"] def request( self, method: str, path: str, - path_params: Mapping[str, Any] | None = None, - query_params: Mapping[str, Any] | None = None, - body: Any = None, + path_params: Optional[dict[str, Any]] = None, + query_params: Optional[dict[str, Any]] = None, + body: Optional[Any] = None, requires_signature: bool = False, - file: bytes | None = None, ) -> Any: """Make an HTTP request to the API.""" url = self._build_url(path, path_params, query_params) - # Use the path with params substituted for signing - signing_path = path - if path_params: - for key, value in path_params.items(): - signing_path = signing_path.replace(f"{{{key}}}", str(value)) - - # Multipart upload: send the JSON body (plus the file checksum the API - # expects) as the "data" part and the bytes as the "file" part. The signed - # payload is the "data" object so it matches what is transmitted. - if file is not None: - data = dict(body) if body else {} - data["fileChecksum"] = hashlib.sha256(file).hexdigest() - user_action_token = None - if requires_signature: - user_action_token = self._get_user_action_token(method, signing_path, data) - # Let httpx set the multipart Content-Type (with boundary); the default - # JSON content type from _build_headers would otherwise mislabel the body. - headers = self._build_headers(user_action_token) - headers.pop("Content-Type", None) - response = self._client.request( - method=method, - url=url, - headers=headers, - data={"data": json.dumps(data, separators=(",", ":"))}, - files={"file": ("upload.bin", file)}, - ) - return self._handle_response(response) - # Get user action token if required user_action_token = None if requires_signature: + # Use the path with params substituted for signing + signing_path = path + if path_params: + for key, value in path_params.items(): + signing_path = signing_path.replace(f"{{{key}}}", str(value)) user_action_token = self._get_user_action_token(method, signing_path, body) headers = self._build_headers(user_action_token) @@ -200,9 +179,9 @@ def request_with_user_action( self, method: str, path: str, - path_params: Mapping[str, Any] | None = None, - query_params: Mapping[str, Any] | None = None, - body: Any = None, + path_params: Optional[dict[str, Any]] = None, + query_params: Optional[dict[str, Any]] = None, + body: Optional[Any] = None, user_action: str = "", ) -> Any: """ @@ -244,6 +223,7 @@ def __exit__(self, *args: Any) -> None: self.close() + class AsyncHttpClient: """Async HTTP client for Dfns API requests.""" @@ -254,7 +234,7 @@ def __init__(self, config: DfnsClientConfig): timeout=30.0, ) - def _build_headers(self, user_action_token: str | None = None) -> dict[str, str]: + def _build_headers(self, user_action_token: Optional[str] = None) -> dict[str, str]: """Build request headers.""" headers = { "Content-Type": "application/json", @@ -270,8 +250,8 @@ def _build_headers(self, user_action_token: str | None = None) -> dict[str, str] def _build_url( self, path: str, - path_params: Mapping[str, Any] | None = None, - query_params: Mapping[str, Any] | None = None, + path_params: Optional[dict[str, Any]] = None, + query_params: Optional[dict[str, Any]] = None, ) -> str: """Build the full URL with path and query parameters.""" url = path @@ -302,7 +282,7 @@ def _handle_response(self, response: httpx.Response) -> Any: raise DfnsError( message=response.text or "Unknown error", status_code=response.status_code, - ) from None + ) if response.status_code == 204 or not response.content: return None @@ -313,7 +293,7 @@ async def _get_user_action_token( self, method: str, path: str, - body: Any = None, + body: Optional[Any] = None, ) -> str: """ Get a user action token by creating and signing a challenge. @@ -329,8 +309,7 @@ async def _get_user_action_token( Raises: DfnsError: If no signer is configured or signing fails. """ - signer = getattr(self.config, "signer", None) - if signer is None: + if not self.config.signer: raise DfnsError( message="Signer required for this operation. Configure a signer in DfnsClientConfig.", status_code=None, @@ -354,7 +333,7 @@ async def _get_user_action_token( challenge = self._handle_response(challenge_response) # Step 2: Sign the challenge - assertion = signer.sign(challenge) + assertion = self.config.signer.sign(challenge) # Step 3: Submit signed challenge to get user action token signature_body = { @@ -370,52 +349,28 @@ async def _get_user_action_token( ) result = self._handle_response(signature_response) - return cast(str, result["userAction"]) + return result["userAction"] async def request( self, method: str, path: str, - path_params: Mapping[str, Any] | None = None, - query_params: Mapping[str, Any] | None = None, - body: Any = None, + path_params: Optional[dict[str, Any]] = None, + query_params: Optional[dict[str, Any]] = None, + body: Optional[Any] = None, requires_signature: bool = False, - file: bytes | None = None, ) -> Any: """Make an async HTTP request to the API.""" url = self._build_url(path, path_params, query_params) - # Use the path with params substituted for signing - signing_path = path - if path_params: - for key, value in path_params.items(): - signing_path = signing_path.replace(f"{{{key}}}", str(value)) - - # Multipart upload: send the JSON body (plus the file checksum the API - # expects) as the "data" part and the bytes as the "file" part. The signed - # payload is the "data" object so it matches what is transmitted. - if file is not None: - data = dict(body) if body else {} - data["fileChecksum"] = hashlib.sha256(file).hexdigest() - user_action_token = None - if requires_signature: - user_action_token = await self._get_user_action_token(method, signing_path, data) - # Let httpx set the multipart Content-Type (with boundary); the default - # JSON content type from _build_headers would otherwise mislabel the body. - headers = self._build_headers(user_action_token) - headers.pop("Content-Type", None) - response = await self._client.request( - method=method, - url=url, - headers=headers, - data={"data": json.dumps(data, separators=(",", ":"))}, - files={"file": ("upload.bin", file)}, - ) - return self._handle_response(response) - # Get user action token if required user_action_token = None if requires_signature: + # Use the path with params substituted for signing + signing_path = path + if path_params: + for key, value in path_params.items(): + signing_path = signing_path.replace(f"{{{key}}}", str(value)) user_action_token = await self._get_user_action_token(method, signing_path, body) headers = self._build_headers(user_action_token) diff --git a/dfns_sdk/auth.py b/dfns_sdk/auth.py index 9ab469d..b919876 100644 --- a/dfns_sdk/auth.py +++ b/dfns_sdk/auth.py @@ -1,11 +1,12 @@ """Authentication utilities for the Dfns SDK.""" import base64 +import hashlib import json -from typing import Any, Protocol, TypedDict +from typing import Any, Optional, Protocol, TypedDict from cryptography.hazmat.primitives import hashes, serialization -from cryptography.hazmat.primitives.asymmetric import ec, ed25519, padding, rsa +from cryptography.hazmat.primitives.asymmetric import ec, ed25519, padding class UserActionChallenge(TypedDict): @@ -127,11 +128,10 @@ def _sign_bytes(self, data: bytes) -> bytes: return self._private_key.sign(data) elif isinstance(self._private_key, ec.EllipticCurvePrivateKey): return self._private_key.sign(data, ec.ECDSA(hashes.SHA256())) - elif isinstance(self._private_key, rsa.RSAPrivateKey): + else: + # RSA return self._private_key.sign( data, padding.PKCS1v15(), hashes.SHA256(), ) - else: - raise ValueError(f"Unsupported private key type: {type(self._private_key).__name__}") diff --git a/dfns_sdk/base_auth_api.py b/dfns_sdk/base_auth_api.py index a9f22fe..827989f 100644 --- a/dfns_sdk/base_auth_api.py +++ b/dfns_sdk/base_auth_api.py @@ -1,6 +1,7 @@ """Base authentication API for delegated client operations.""" -from typing import Any, TypedDict, cast +import json +from typing import Any, TypedDict, Optional from ._internal import HttpClient @@ -92,7 +93,7 @@ def create_user_action_challenge( Returns: The challenge response containing the challenge to sign. """ - response = http_client.request( + return http_client.request( method="POST", path="/auth/action/init", body={ @@ -103,7 +104,6 @@ def create_user_action_challenge( }, requires_signature=False, ) - return cast(UserActionChallengeResponse, response) @staticmethod def sign_user_action_challenge( @@ -121,10 +121,9 @@ def sign_user_action_challenge( Returns: Dictionary containing the userAction token. """ - response = http_client.request( + return http_client.request( method="POST", path="/auth/action", body=signed_challenge, requires_signature=False, ) - return cast(dict[str, Any], response) diff --git a/dfns_sdk/client.py b/dfns_sdk/client.py index 3fbb3ff..6270063 100644 --- a/dfns_sdk/client.py +++ b/dfns_sdk/client.py @@ -1,7 +1,6 @@ """Main Dfns client.""" -from typing import Any - +from .types import DfnsClientConfig from ._internal import HttpClient from .generated.agreements import AgreementsClient from .generated.allocations import AllocationsClient @@ -18,7 +17,6 @@ from .generated.swaps import SwapsClient from .generated.wallets import WalletsClient from .generated.webhooks import WebhooksClient -from .types import DfnsClientConfig class DfnsClient: @@ -82,5 +80,5 @@ def close(self) -> None: def __enter__(self) -> "DfnsClient": return self - def __exit__(self, *args: Any) -> None: + def __exit__(self, *args) -> None: self.close() diff --git a/dfns_sdk/delegated_client.py b/dfns_sdk/delegated_client.py index 8ef51c5..57057cb 100644 --- a/dfns_sdk/delegated_client.py +++ b/dfns_sdk/delegated_client.py @@ -1,7 +1,6 @@ """Delegated Dfns client for external signing orchestration.""" -from typing import Any - +from .types import DfnsDelegatedClientConfig from ._internal import HttpClient from .generated.agreements import DelegatedAgreementsClient from .generated.allocations import DelegatedAllocationsClient @@ -18,7 +17,6 @@ from .generated.swaps import DelegatedSwapsClient from .generated.wallets import DelegatedWalletsClient from .generated.webhooks import DelegatedWebhooksClient -from .types import DfnsDelegatedClientConfig class DfnsDelegatedClient: @@ -98,5 +96,5 @@ def close(self) -> None: def __enter__(self) -> "DfnsDelegatedClient": return self - def __exit__(self, *args: Any) -> None: + def __exit__(self, *args) -> None: self.close() diff --git a/dfns_sdk/generated/__init__.py b/dfns_sdk/generated/__init__.py index 48db9a5..6e1a663 100644 --- a/dfns_sdk/generated/__init__.py +++ b/dfns_sdk/generated/__init__.py @@ -3,18 +3,18 @@ from .agreements import AgreementsClient, DelegatedAgreementsClient from .allocations import AllocationsClient, DelegatedAllocationsClient from .auth import AuthClient, DelegatedAuthClient -from .exchanges import DelegatedExchangesClient, ExchangesClient -from .fee_sponsors import DelegatedFeeSponsorsClient, FeeSponsorsClient -from .keys import DelegatedKeysClient, KeysClient -from .networks import DelegatedNetworksClient, NetworksClient -from .payouts import DelegatedPayoutsClient, PayoutsClient -from .permissions import DelegatedPermissionsClient, PermissionsClient -from .policies import DelegatedPoliciesClient, PoliciesClient -from .signers import DelegatedSignersClient, SignersClient -from .staking import DelegatedStakingClient, StakingClient -from .swaps import DelegatedSwapsClient, SwapsClient -from .wallets import DelegatedWalletsClient, WalletsClient -from .webhooks import DelegatedWebhooksClient, WebhooksClient +from .exchanges import ExchangesClient, DelegatedExchangesClient +from .fee_sponsors import FeeSponsorsClient, DelegatedFeeSponsorsClient +from .keys import KeysClient, DelegatedKeysClient +from .networks import NetworksClient, DelegatedNetworksClient +from .payouts import PayoutsClient, DelegatedPayoutsClient +from .permissions import PermissionsClient, DelegatedPermissionsClient +from .policies import PoliciesClient, DelegatedPoliciesClient +from .signers import SignersClient, DelegatedSignersClient +from .staking import StakingClient, DelegatedStakingClient +from .swaps import SwapsClient, DelegatedSwapsClient +from .wallets import WalletsClient, DelegatedWalletsClient +from .webhooks import WebhooksClient, DelegatedWebhooksClient __all__ = [ "AgreementsClient", diff --git a/dfns_sdk/generated/agreements/__init__.py b/dfns_sdk/generated/agreements/__init__.py index d307752..37f47a7 100644 --- a/dfns_sdk/generated/agreements/__init__.py +++ b/dfns_sdk/generated/agreements/__init__.py @@ -1,7 +1,7 @@ """Agreements domain module.""" -from . import types from .client import AgreementsClient from .delegated_client import DelegatedAgreementsClient +from . import types __all__ = ["AgreementsClient", "DelegatedAgreementsClient", "types"] diff --git a/dfns_sdk/generated/agreements/client.py b/dfns_sdk/generated/agreements/client.py index 4faf52b..1ffd52c 100644 --- a/dfns_sdk/generated/agreements/client.py +++ b/dfns_sdk/generated/agreements/client.py @@ -1,6 +1,6 @@ """Client for the agreements domain.""" -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,21 +12,19 @@ class AgreementsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def get_latest_unaccepted_agreement( - self, query: T.GetLatestUnacceptedAgreementQuery - ) -> T.GetLatestUnacceptedAgreementResponse: + def get_latest_unaccepted_agreement(self, query: T.GetLatestUnacceptedAgreementQuery) -> T.GetLatestUnacceptedAgreementResponse: """ Get Latest Unaccepted Agreement. Get the latest unaccepted agreement for a specific agreement type Args: - query: Query parameters. + query: Query parameters. Returns: T.GetLatestUnacceptedAgreementResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/agreements/latest-unaccepted", path_params={}, @@ -34,7 +32,6 @@ def get_latest_unaccepted_agreement( body=None, requires_signature=False, ) - return cast(T.GetLatestUnacceptedAgreementResponse, response) def record_agreement_acceptance(self, agreement_id: str) -> T.RecordAgreementAcceptanceResponse: """ @@ -43,12 +40,12 @@ def record_agreement_acceptance(self, agreement_id: str) -> T.RecordAgreementAcc Record the acceptance of a specific agreement by its ID Args: - agreement_id: ID of the agreement to accept. + agreement_id: ID of the agreement to accept. Returns: T.RecordAgreementAcceptanceResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/agreements/{agreementId}/accept", path_params={"agreementId": agreement_id}, @@ -56,4 +53,3 @@ def record_agreement_acceptance(self, agreement_id: str) -> T.RecordAgreementAcc body=None, requires_signature=True, ) - return cast(T.RecordAgreementAcceptanceResponse, response) diff --git a/dfns_sdk/generated/agreements/delegated_client.py b/dfns_sdk/generated/agreements/delegated_client.py index 623b293..b9dc2c0 100644 --- a/dfns_sdk/generated/agreements/delegated_client.py +++ b/dfns_sdk/generated/agreements/delegated_client.py @@ -1,9 +1,14 @@ """Delegated client for the agreements domain.""" -from typing import cast +import json +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -18,21 +23,19 @@ class DelegatedAgreementsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def get_latest_unaccepted_agreement( - self, query: T.GetLatestUnacceptedAgreementQuery - ) -> T.GetLatestUnacceptedAgreementResponse: + def get_latest_unaccepted_agreement(self, query: T.GetLatestUnacceptedAgreementQuery) -> T.GetLatestUnacceptedAgreementResponse: """ Get Latest Unaccepted Agreement. Get the latest unaccepted agreement for a specific agreement type Args: - query: Query parameters. + query: Query parameters. Returns: T.GetLatestUnacceptedAgreementResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/agreements/latest-unaccepted", path_params={}, @@ -40,7 +43,6 @@ def get_latest_unaccepted_agreement( body=None, requires_signature=False, ) - return cast(T.GetLatestUnacceptedAgreementResponse, response) def record_agreement_acceptance_init(self, agreement_id: str) -> UserActionChallengeResponse: """ @@ -49,11 +51,11 @@ def record_agreement_acceptance_init(self, agreement_id: str) -> UserActionChall Creates a user action challenge for external signing. Args: - agreement_id: ID of the agreement to accept. + agreement_id: ID of the agreement to accept. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/agreements/{agreementId}/accept" path = path.replace("{agreementId}", str(agreement_id)) payload = "" @@ -65,25 +67,25 @@ def record_agreement_acceptance_init(self, agreement_id: str) -> UserActionChall user_action_payload=payload, ) - def record_agreement_acceptance_complete( - self, agreement_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.RecordAgreementAcceptanceResponse: + def record_agreement_acceptance_complete(self, agreement_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.RecordAgreementAcceptanceResponse: """ Complete Record Agreement Acceptance. Submits the signed challenge and makes the API request. Args: - agreement_id: ID of the agreement to accept. - signed_challenge: The signed challenge from external signing. + agreement_id: ID of the agreement to accept. + signed_challenge: The signed challenge from external signing. Returns: T.RecordAgreementAcceptanceResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/agreements/{agreementId}/accept", path_params={"agreementId": agreement_id}, @@ -91,4 +93,3 @@ def record_agreement_acceptance_complete( body=None, user_action=user_action_token, ) - return cast(T.RecordAgreementAcceptanceResponse, response) diff --git a/dfns_sdk/generated/agreements/types.py b/dfns_sdk/generated/agreements/types.py index 792d335..62b5718 100644 --- a/dfns_sdk/generated/agreements/types.py +++ b/dfns_sdk/generated/agreements/types.py @@ -1,20 +1,17 @@ """Types for the agreements domain.""" -from typing import Any, Literal, TypedDict - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class GetLatestUnacceptedAgreementResponse(TypedDict, total=False): """getLatestUnacceptedAgreement response.""" latest_agreement: Any - class GetLatestUnacceptedAgreementQuery(TypedDict, total=False): """getLatestUnacceptedAgreement query parameters.""" agreement_type: Literal["PrivacyPolicy", "TermsAndConditions", "UniswapTermsOfService", "UniswapPrivacyPolicy"] - class RecordAgreementAcceptanceResponse(TypedDict, total=False): """recordAgreementAcceptance response.""" diff --git a/dfns_sdk/generated/allocations/__init__.py b/dfns_sdk/generated/allocations/__init__.py index 46509ef..81d0936 100644 --- a/dfns_sdk/generated/allocations/__init__.py +++ b/dfns_sdk/generated/allocations/__init__.py @@ -1,7 +1,7 @@ """Allocations domain module.""" -from . import types from .client import AllocationsClient from .delegated_client import DelegatedAllocationsClient +from . import types __all__ = ["AllocationsClient", "DelegatedAllocationsClient", "types"] diff --git a/dfns_sdk/generated/allocations/client.py b/dfns_sdk/generated/allocations/client.py index 5205a6e..82285b6 100644 --- a/dfns_sdk/generated/allocations/client.py +++ b/dfns_sdk/generated/allocations/client.py @@ -1,6 +1,6 @@ """Client for the allocations domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,17 +12,17 @@ class AllocationsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_allocations(self, query: T.ListAllocationsQuery | None = None) -> T.ListAllocationsResponse: + def list_allocations(self, query: Optional[T.ListAllocationsQuery] = None) -> T.ListAllocationsResponse: """ List Allocations. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListAllocationsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/allocations", path_params={}, @@ -30,7 +30,6 @@ def list_allocations(self, query: T.ListAllocationsQuery | None = None) -> T.Lis body=None, requires_signature=False, ) - return cast(T.ListAllocationsResponse, response) def create_allocation(self, body: dict[str, Any]) -> T.CreateAllocationResponse: """ @@ -39,12 +38,12 @@ def create_allocation(self, body: dict[str, Any]) -> T.CreateAllocationResponse: Create a new allocation. Args: - body: Request body. + body: Request body. Returns: T.CreateAllocationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/allocations", path_params={}, @@ -52,24 +51,21 @@ def create_allocation(self, body: dict[str, Any]) -> T.CreateAllocationResponse: body=body, requires_signature=True, ) - return cast(T.CreateAllocationResponse, response) - def list_allocation_actions( - self, allocation_id: str, query: T.ListAllocationActionsQuery | None = None - ) -> T.ListAllocationActionsResponse: + def list_allocation_actions(self, allocation_id: str, query: Optional[T.ListAllocationActionsQuery] = None) -> T.ListAllocationActionsResponse: """ List Allocation Actions. Retrieve the list of actions for a specific allocation. Args: - allocation_id: Unique identifier for the allocation investment. - query: Query parameters. + allocation_id: Unique identifier for the allocation investment. + query: Query parameters. Returns: T.ListAllocationActionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/allocations/{allocationId}/actions", path_params={"allocationId": allocation_id}, @@ -77,22 +73,21 @@ def list_allocation_actions( body=None, requires_signature=False, ) - return cast(T.ListAllocationActionsResponse, response) - def create_allocation_action(self, allocation_id: str, body: dict[str, Any]) -> T.CreateAllocationActionResponse: + def create_allocation_action(self, allocation_id: str, body: T.CreateAllocationActionRequest) -> T.CreateAllocationActionResponse: """ Create Allocation Action. Create a new action for an existing allocation. Args: - allocation_id: Unique identifier for the allocation investment. - body: Request body. + allocation_id: Unique identifier for the allocation investment. + body: Request body. Returns: T.CreateAllocationActionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/allocations/{allocationId}/actions", path_params={"allocationId": allocation_id}, @@ -100,7 +95,6 @@ def create_allocation_action(self, allocation_id: str, body: dict[str, Any]) -> body=body, requires_signature=True, ) - return cast(T.CreateAllocationActionResponse, response) def get_allocation(self, allocation_id: str) -> T.GetAllocationResponse: """ @@ -109,12 +103,12 @@ def get_allocation(self, allocation_id: str) -> T.GetAllocationResponse: Retrieve the details of a specific allocation. Args: - allocation_id: Unique identifier for the allocation investment. + allocation_id: Unique identifier for the allocation investment. Returns: T.GetAllocationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/allocations/{allocationId}", path_params={"allocationId": allocation_id}, @@ -122,4 +116,3 @@ def get_allocation(self, allocation_id: str) -> T.GetAllocationResponse: body=None, requires_signature=False, ) - return cast(T.GetAllocationResponse, response) diff --git a/dfns_sdk/generated/allocations/delegated_client.py b/dfns_sdk/generated/allocations/delegated_client.py index 2495216..76c813f 100644 --- a/dfns_sdk/generated/allocations/delegated_client.py +++ b/dfns_sdk/generated/allocations/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the allocations domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,17 +23,17 @@ class DelegatedAllocationsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_allocations(self, query: T.ListAllocationsQuery | None = None) -> T.ListAllocationsResponse: + def list_allocations(self, query: Optional[T.ListAllocationsQuery] = None) -> T.ListAllocationsResponse: """ List Allocations. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListAllocationsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/allocations", path_params={}, @@ -37,7 +41,6 @@ def list_allocations(self, query: T.ListAllocationsQuery | None = None) -> T.Lis body=None, requires_signature=False, ) - return cast(T.ListAllocationsResponse, response) def create_allocation_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -46,11 +49,11 @@ def create_allocation_init(self, body: dict[str, Any]) -> UserActionChallengeRes Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/allocations" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -61,25 +64,25 @@ def create_allocation_init(self, body: dict[str, Any]) -> UserActionChallengeRes user_action_payload=payload, ) - def create_allocation_complete( - self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateAllocationResponse: + def create_allocation_complete(self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreateAllocationResponse: """ Complete Create Allocation. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateAllocationResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/allocations", path_params={}, @@ -87,24 +90,21 @@ def create_allocation_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateAllocationResponse, response) - def list_allocation_actions( - self, allocation_id: str, query: T.ListAllocationActionsQuery | None = None - ) -> T.ListAllocationActionsResponse: + def list_allocation_actions(self, allocation_id: str, query: Optional[T.ListAllocationActionsQuery] = None) -> T.ListAllocationActionsResponse: """ List Allocation Actions. Retrieve the list of actions for a specific allocation. Args: - allocation_id: Unique identifier for the allocation investment. - query: Query parameters. + allocation_id: Unique identifier for the allocation investment. + query: Query parameters. Returns: T.ListAllocationActionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/allocations/{allocationId}/actions", path_params={"allocationId": allocation_id}, @@ -112,21 +112,20 @@ def list_allocation_actions( body=None, requires_signature=False, ) - return cast(T.ListAllocationActionsResponse, response) - def create_allocation_action_init(self, allocation_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: + def create_allocation_action_init(self, allocation_id: str, body: T.CreateAllocationActionRequest) -> UserActionChallengeResponse: """ Initialize Create Allocation Action. Creates a user action challenge for external signing. Args: - allocation_id: Unique identifier for the allocation investment. - body: Request body. + allocation_id: Unique identifier for the allocation investment. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/allocations/{allocationId}/actions" path = path.replace("{allocationId}", str(allocation_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -138,26 +137,26 @@ def create_allocation_action_init(self, allocation_id: str, body: dict[str, Any] user_action_payload=payload, ) - def create_allocation_action_complete( - self, allocation_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateAllocationActionResponse: + def create_allocation_action_complete(self, allocation_id: str, body: T.CreateAllocationActionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateAllocationActionResponse: """ Complete Create Allocation Action. Submits the signed challenge and makes the API request. Args: - allocation_id: Unique identifier for the allocation investment. - body: Request body. - signed_challenge: The signed challenge from external signing. + allocation_id: Unique identifier for the allocation investment. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateAllocationActionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/allocations/{allocationId}/actions", path_params={"allocationId": allocation_id}, @@ -165,7 +164,6 @@ def create_allocation_action_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateAllocationActionResponse, response) def get_allocation(self, allocation_id: str) -> T.GetAllocationResponse: """ @@ -174,12 +172,12 @@ def get_allocation(self, allocation_id: str) -> T.GetAllocationResponse: Retrieve the details of a specific allocation. Args: - allocation_id: Unique identifier for the allocation investment. + allocation_id: Unique identifier for the allocation investment. Returns: T.GetAllocationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/allocations/{allocationId}", path_params={"allocationId": allocation_id}, @@ -187,4 +185,3 @@ def get_allocation(self, allocation_id: str) -> T.GetAllocationResponse: body=None, requires_signature=False, ) - return cast(T.GetAllocationResponse, response) diff --git a/dfns_sdk/generated/allocations/types.py b/dfns_sdk/generated/allocations/types.py index 800dd15..10a92a4 100644 --- a/dfns_sdk/generated/allocations/types.py +++ b/dfns_sdk/generated/allocations/types.py @@ -1,96 +1,69 @@ """Types for the allocations domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListAllocationsResponse(TypedDict, total=False): """listAllocations response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListAllocationsQuery(TypedDict, total=False): """listAllocations query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateAllocationResponse(TypedDict, total=False): """createAllocation response.""" id: str wallet_id: str - protocol: Literal[ - "0fns", - "SkySusds", - "GauntletUsdcPrime", - "SteakhouseUsdt", - "GauntletUsdcPrimeBase", - "SteakhouseUsdcBase", - "SentoraPyusdMain", - ] - provider: NotRequired[Literal["M0", "Yield.xyz"]] - amount: dict[str, Any] - rewards: dict[str, Any] + protocol: Literal["0fns"] + amount: TypedDict + rewards: TypedDict date_created: str - actions: list[dict[str, Any]] - + actions: list[TypedDict] class ListAllocationActionsResponse(TypedDict, total=False): """listAllocationActions response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListAllocationActionsQuery(TypedDict, total=False): """listAllocationActions query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] +class CreateAllocationActionRequest(TypedDict, total=False): + """createAllocationAction request body.""" + + kind: Literal["Deposit", "Withdraw"] + external_id: NotRequired[str] + source_asset: TypedDict + target_asset: TypedDict + slippage_bps: int class CreateAllocationActionResponse(TypedDict, total=False): """createAllocationAction response.""" id: str wallet_id: str - protocol: Literal[ - "0fns", - "SkySusds", - "GauntletUsdcPrime", - "SteakhouseUsdt", - "GauntletUsdcPrimeBase", - "SteakhouseUsdcBase", - "SentoraPyusdMain", - ] - provider: NotRequired[Literal["M0", "Yield.xyz"]] - amount: dict[str, Any] - rewards: dict[str, Any] + protocol: Literal["0fns"] + amount: TypedDict + rewards: TypedDict date_created: str - actions: list[dict[str, Any]] - + actions: list[TypedDict] class GetAllocationResponse(TypedDict, total=False): """getAllocation response.""" id: str wallet_id: str - protocol: Literal[ - "0fns", - "SkySusds", - "GauntletUsdcPrime", - "SteakhouseUsdt", - "GauntletUsdcPrimeBase", - "SteakhouseUsdcBase", - "SentoraPyusdMain", - ] - provider: NotRequired[Literal["M0", "Yield.xyz"]] - amount: dict[str, Any] - rewards: dict[str, Any] + protocol: Literal["0fns"] + amount: TypedDict + rewards: TypedDict date_created: str - actions: list[dict[str, Any]] + actions: list[TypedDict] diff --git a/dfns_sdk/generated/auth/__init__.py b/dfns_sdk/generated/auth/__init__.py index e883991..f11eeea 100644 --- a/dfns_sdk/generated/auth/__init__.py +++ b/dfns_sdk/generated/auth/__init__.py @@ -1,7 +1,7 @@ """Auth domain module.""" -from . import types from .client import AuthClient from .delegated_client import DelegatedAuthClient +from . import types __all__ = ["AuthClient", "DelegatedAuthClient", "types"] diff --git a/dfns_sdk/generated/auth/client.py b/dfns_sdk/generated/auth/client.py index 214930b..500c2a7 100644 --- a/dfns_sdk/generated/auth/client.py +++ b/dfns_sdk/generated/auth/client.py @@ -1,8 +1,8 @@ """Client for the auth domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union +from warnings import deprecated -from typing_extensions import deprecated from ..._internal import HttpClient from . import types as T @@ -14,28 +14,26 @@ class AuthClient: def __init__(self, http_client: HttpClient): self._http = http_client - def create_user_action_signature( - self, body: T.CreateUserActionSignatureRequest - ) -> T.CreateUserActionSignatureResponse: + def create_user_action_signature(self, body: T.CreateUserActionSignatureRequest) -> T.CreateUserActionSignatureResponse: """ - Create User Action Signature. + Create User Action Signature. - Completes the user action signing process and provides a signing token that can be used to verify the user intended to perform the action. + Completes the user action signing process and provides a signing token that can be used to verify the user intended to perform the action. - This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). +This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). - The type of credentials used to sign the action is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: - * `Fido2`: User action is signed by a user's signing device using `WebAuthn`. - * `Key`: User action is signed by a user's, or token's, private key. - * `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Action Signature Challenge](https://docs.dfns.co/api-reference/auth/create-user-action-challenge) step. +The type of credentials used to sign the action is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: +* `Fido2`: User action is signed by a user's signing device using `WebAuthn`. +* `Key`: User action is signed by a user's, or token's, private key. +* `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Action Signature Challenge](https://docs.dfns.co/api-reference/auth/create-user-action-challenge) step. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateUserActionSignatureResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateUserActionSignatureResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/action", path_params={}, @@ -43,25 +41,22 @@ def create_user_action_signature( body=body, requires_signature=False, ) - return cast(T.CreateUserActionSignatureResponse, response) - def create_user_action_challenge( - self, body: T.CreateUserActionChallengeRequest - ) -> T.CreateUserActionChallengeResponse: + def create_user_action_challenge(self, body: T.CreateUserActionChallengeRequest) -> T.CreateUserActionChallengeResponse: """ - Create User Action Challenge. - - Starts a user action signing session, returning a challenge that will be used to verify the user's intent to perform an action. + Create User Action Challenge. - This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). + Starts a user action signing session, returning a challenge that will be used to verify the user's intent to perform an action. + + This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateUserActionChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateUserActionChallengeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/action/init", path_params={}, @@ -69,27 +64,26 @@ def create_user_action_challenge( body=body, requires_signature=False, ) - return cast(T.CreateUserActionChallengeResponse, response) def list_audit_logs(self, query: T.ListAuditLogsQuery) -> None: """ - List Audit Logs. + List Audit Logs. - Gets all signature events which have occurred in the over the timeframe. The time range is unbounded, but the export is capped at 100,000 rows. When the result is truncated, the `X-Dfns-Result-Truncated: true` response header is set and a trailing `# TRUNCATED ...` line is appended to the CSV; narrow the time range to retrieve all data. + Gets all signature events which have occurred in the over the timeframe. The time range is unbounded, but the export is capped at 100,000 rows. When the result is truncated, the `X-Dfns-Result-Truncated: true` response header is set and a trailing `# TRUNCATED ...` line is appended to the CSV; narrow the time range to retrieve all data. - StartTime and EndTime are URL-encoded UTC ISO timestamps: - `startTime=2025-08-29T02%3A46%3A40Z` - `endTime=2025-09-01T02%3A46%3A40Z` +StartTime and EndTime are URL-encoded UTC ISO timestamps: +`startTime=2025-08-29T02%3A46%3A40Z` +`endTime=2025-09-01T02%3A46%3A40Z` - An additional optional query parameter, `userId` can be specified to filter down events to a particular user. The API will return results found in CSV format. +An additional optional query parameter, `userId` can be specified to filter down events to a particular user. The API will return results found in CSV format. - Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) +Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) - Args: - query: Query parameters. - """ # noqa: E501 - self._http.request( + Args: + query: Query parameters. + """ + return self._http.request( method="GET", path="/auth/action/logs", path_params={}, @@ -100,19 +94,19 @@ def list_audit_logs(self, query: T.ListAuditLogsQuery) -> None: def get_audit_log(self, id: str) -> T.GetAuditLogResponse: """ - Get Audit Log. + Get Audit Log. - Gets detailed information for a particular audit log. Specifically, the API returns the action performed, as well as the `firstFactorCredential` in which you will find the signature information required to validate it. + Gets detailed information for a particular audit log. Specifically, the API returns the action performed, as well as the `firstFactorCredential` in which you will find the signature information required to validate it. - Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) +Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) - Args: - id: Log id you need information about. + Args: + id: Log id you need information about. - Returns: - T.GetAuditLogResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetAuditLogResponse: The API response. + """ + return self._http.request( method="GET", path="/auth/action/logs/{id}", path_params={"id": id}, @@ -120,21 +114,20 @@ def get_audit_log(self, id: str) -> T.GetAuditLogResponse: body=None, requires_signature=False, ) - return cast(T.GetAuditLogResponse, response) @deprecated("This endpoint is deprecated.") def list_applications(self) -> T.ListApplicationsResponse: """ - List Applications. + List Applications. - - Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). - + + Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). + - Returns: - T.ListApplicationsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ListApplicationsResponse: The API response. + """ + return self._http.request( method="GET", path="/auth/apps", path_params={}, @@ -142,24 +135,23 @@ def list_applications(self) -> T.ListApplicationsResponse: body=None, requires_signature=False, ) - return cast(T.ListApplicationsResponse, response) @deprecated("This endpoint is deprecated.") def get_application(self, app_id: str) -> T.GetApplicationResponse: """ - Get Application. + Get Application. - - Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). - + + Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). + - Args: - app_id: ID of the application (deprecated). + Args: + app_id: ID of the application (deprecated). - Returns: - T.GetApplicationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetApplicationResponse: The API response. + """ + return self._http.request( method="GET", path="/auth/apps/{appId}", path_params={"appId": app_id}, @@ -167,7 +159,6 @@ def get_application(self, app_id: str) -> T.GetApplicationResponse: body=None, requires_signature=False, ) - return cast(T.GetApplicationResponse, response) def list_credentials(self) -> T.ListCredentialsResponse: """ @@ -177,8 +168,8 @@ def list_credentials(self) -> T.ListCredentialsResponse: Returns: T.ListCredentialsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/credentials", path_params={}, @@ -186,23 +177,22 @@ def list_credentials(self) -> T.ListCredentialsResponse: body=None, requires_signature=False, ) - return cast(T.ListCredentialsResponse, response) def create_credential(self, body: dict[str, Any]) -> T.CreateCredentialResponse: """ - Create Credential. + Create Credential. - Part of the flow [Create Credential Regular flow](https://docs.dfns.co/api-reference/auth/credentials#regular-flow). + Part of the flow [Create Credential Regular flow](https://docs.dfns.co/api-reference/auth/credentials#regular-flow). - Adds a new credential to a user's account. See [Credential Kinds](https://docs.dfns.co/api-reference/auth/credentials#credential-kinds) for all supported credential types. +Adds a new credential to a user's account. See [Credential Kinds](https://docs.dfns.co/api-reference/auth/credentials#credential-kinds) for all supported credential types. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateCredentialResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateCredentialResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials", path_params={}, @@ -210,23 +200,22 @@ def create_credential(self, body: dict[str, Any]) -> T.CreateCredentialResponse: body=body, requires_signature=True, ) - return cast(T.CreateCredentialResponse, response) - def create_credential_challenge(self, body: T.CreateCredentialChallengeRequest) -> dict[str, Any]: + def create_credential_challenge(self, body: T.CreateCredentialChallengeRequest) -> TypedDict: """ - Create Credential Challenge. - - Part of the flow [Create Credential Regular flow](https://docs.dfns.co/api-reference/auth/credentials#regular-flow). + Create Credential Challenge. - Starts a create user credential session, returning a challenge that will be used to verify the user's identity. + Part of the flow [Create Credential Regular flow](https://docs.dfns.co/api-reference/auth/credentials#regular-flow). + + Starts a create user credential session, returning a challenge that will be used to verify the user's identity. - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/init", path_params={}, @@ -234,7 +223,6 @@ def create_credential_challenge(self, body: T.CreateCredentialChallengeRequest) body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def activate_credential(self, body: T.ActivateCredentialRequest) -> T.ActivateCredentialResponse: """ @@ -243,12 +231,12 @@ def activate_credential(self, body: T.ActivateCredentialRequest) -> T.ActivateCr Activates a credential that was previously deactivated. If the credential is already activated no action is taken. Args: - body: Request body. + body: Request body. Returns: T.ActivateCredentialResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/credentials/activate", path_params={}, @@ -256,7 +244,6 @@ def activate_credential(self, body: T.ActivateCredentialRequest) -> T.ActivateCr body=body, requires_signature=True, ) - return cast(T.ActivateCredentialResponse, response) def delete_credential(self, credential_uuid: str) -> T.DeleteCredentialResponse: """ @@ -265,12 +252,12 @@ def delete_credential(self, credential_uuid: str) -> T.DeleteCredentialResponse: Delete a specific credential. Args: - credential_uuid: Path parameter. + credential_uuid: Path parameter. Returns: T.DeleteCredentialResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/auth/credentials/{credentialUuid}", path_params={"credentialUuid": credential_uuid}, @@ -278,7 +265,6 @@ def delete_credential(self, credential_uuid: str) -> T.DeleteCredentialResponse: body=None, requires_signature=True, ) - return cast(T.DeleteCredentialResponse, response) def deactivate_credential(self, body: T.DeactivateCredentialRequest) -> T.DeactivateCredentialResponse: """ @@ -287,12 +273,12 @@ def deactivate_credential(self, body: T.DeactivateCredentialRequest) -> T.Deacti Deactivates a credential that was previously active. If the credential is already deactivated no action is taken. Args: - body: Request body. + body: Request body. Returns: T.DeactivateCredentialResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/credentials/deactivate", path_params={}, @@ -300,23 +286,22 @@ def deactivate_credential(self, body: T.DeactivateCredentialRequest) -> T.Deacti body=body, requires_signature=True, ) - return cast(T.DeactivateCredentialResponse, response) def create_credential_code(self, body: T.CreateCredentialCodeRequest) -> T.CreateCredentialCodeResponse: """ - Create Credential Code. + Create Credential Code. - Part of the [Create Credential With Code flow](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + Part of the [Create Credential With Code flow](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). - Creates a one-time-code that can then be used to create a new credential from a place you don't have access to one of your existing credential. +Creates a one-time-code that can then be used to create a new credential from a place you don't have access to one of your existing credential. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateCredentialCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateCredentialCodeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/code", path_params={}, @@ -324,23 +309,22 @@ def create_credential_code(self, body: T.CreateCredentialCodeRequest) -> T.Creat body=body, requires_signature=True, ) - return cast(T.CreateCredentialCodeResponse, response) - def create_credential_challenge_with_code(self, body: T.CreateCredentialChallengeWithCodeRequest) -> dict[str, Any]: + def create_credential_challenge_with_code(self, body: T.CreateCredentialChallengeWithCodeRequest) -> TypedDict: """ - Create Credential Challenge With Code. + Create Credential Challenge With Code. - Part of the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + Part of the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). - Creates a credential challenge using a one time code-time-code. This challenge must then be signed by the new credential, before finalizing the flow. +Creates a credential challenge using a one time code-time-code. This challenge must then be signed by the new credential, before finalizing the flow. - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/code/init", path_params={}, @@ -348,26 +332,25 @@ def create_credential_challenge_with_code(self, body: T.CreateCredentialChalleng body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def create_credential_with_code(self, body: dict[str, Any]) -> T.CreateCredentialWithCodeResponse: """ - Create Credential With Code. - - Finalizes the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + Create Credential With Code. - Adds a new credential to a user's account. This endpoint is similar to the [Create Credential](https://docs.dfns.co/api-reference/auth/create-credential) endpoint, except: - * it does not need the user to be authenticated - * it does not need user action signing - * it will only work with the challenge gotten from the [Create Credential Challenge With Code](https://docs.dfns.co/api-reference/auth/create-credential-challenge-with-code) endpoint + Finalizes the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + +Adds a new credential to a user's account. This endpoint is similar to the [Create Credential](https://docs.dfns.co/api-reference/auth/create-credential) endpoint, except: +* it does not need the user to be authenticated +* it does not need user action signing +* it will only work with the challenge gotten from the [Create Credential Challenge With Code](https://docs.dfns.co/api-reference/auth/create-credential-challenge-with-code) endpoint - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateCredentialWithCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateCredentialWithCodeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/code/verify", path_params={}, @@ -375,25 +358,24 @@ def create_credential_with_code(self, body: dict[str, Any]) -> T.CreateCredentia body=body, requires_signature=False, ) - return cast(T.CreateCredentialWithCodeResponse, response) def create_login_challenge(self, body: T.CreateLoginChallengeRequest) -> T.CreateLoginChallengeResponse: """ - Create Login Challenge. + Create Login Challenge. - Start a user login session, returning a challenge that will be used to verify the user's identity. + Start a user login session, returning a challenge that will be used to verify the user's identity. - If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. +If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. - If the user has at least one discoverable WebAuthn credential, `username` is optional (username-less flow). +If the user has at least one discoverable WebAuthn credential, `username` is optional (username-less flow). - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateLoginChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateLoginChallengeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/login/init", path_params={}, @@ -401,29 +383,28 @@ def create_login_challenge(self, body: T.CreateLoginChallengeRequest) -> T.Creat body=body, requires_signature=False, ) - return cast(T.CreateLoginChallengeResponse, response) def delegated_login(self, body: T.DelegatedLoginRequest) -> T.DelegatedLoginResponse: """ - Delegated Login. + Delegated Login. - - Only a [Service Account](https://docs.dfns.co/api-reference/auth/service-accounts) can use this endpoint. - + +Only a [Service Account](https://docs.dfns.co/api-reference/auth/service-accounts) can use this endpoint. + - Logs a user into an organization without the user's credentials. +Logs a user into an organization without the user's credentials. - If you want to use your own authentication system, while still using `Delegated Signing`, you can use this endpoint to authenticate a user without needing the user's credentials. +If you want to use your own authentication system, while still using `Delegated Signing`, you can use this endpoint to authenticate a user without needing the user's credentials. - The user authentication token can be used for read operations within the Dfns API, however, write operations will still require the user to sign the action. +The user authentication token can be used for read operations within the Dfns API, however, write operations will still require the user to sign the action. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.DelegatedLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.DelegatedLoginResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/login/delegated", path_params={}, @@ -431,26 +412,25 @@ def delegated_login(self, body: T.DelegatedLoginRequest) -> T.DelegatedLoginResp body=body, requires_signature=True, ) - return cast(T.DelegatedLoginResponse, response) - def complete_user_login(self, body: T.CompleteUserLoginRequest) -> dict[str, Any]: + def complete_user_login(self, body: T.CompleteUserLoginRequest) -> TypedDict: """ - Complete User Login. + Complete User Login. - Completes the login process and provides the authenticated user with their authentication token. + Completes the login process and provides the authenticated user with their authentication token. - The type of credentials used to login is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: - * `Fido2`: Login challenge is signed by a user's signing device using `WebAuthn`. - * `Key`: Login challenge is signed by a user's private key. - * `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Login Challenge](../registration/inituserregistration) step. +The type of credentials used to login is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: +* `Fido2`: Login challenge is signed by a user's signing device using `WebAuthn`. +* `Key`: Login challenge is signed by a user's private key. +* `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Login Challenge](../registration/inituserregistration) step. - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/auth/login", path_params={}, @@ -458,7 +438,6 @@ def complete_user_login(self, body: T.CompleteUserLoginRequest) -> dict[str, Any body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def logout(self, body: T.LogoutRequest) -> T.LogoutResponse: """ @@ -467,12 +446,12 @@ def logout(self, body: T.LogoutRequest) -> T.LogoutResponse: Completes the user logout process. Args: - body: Request body. + body: Request body. Returns: T.LogoutResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/logout", path_params={}, @@ -480,23 +459,22 @@ def logout(self, body: T.LogoutRequest) -> T.LogoutResponse: body=body, requires_signature=False, ) - return cast(T.LogoutResponse, response) def send_login_code(self, body: T.SendLoginCodeRequest) -> T.SendLoginCodeResponse: """ - Send Login Code. + Send Login Code. - Sends a temporary one time code to the user that can be used during login flow. + Sends a temporary one time code to the user that can be used during login flow. - If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. That's because the [Create Login Challenge](https://docs.dfns.co/api-reference/auth/create-login-challenge) is unauthenticated and returns the encrypted private key of the user. So we need a first step to verify the identity of the user to prevent anybody from fetching the encrypted private key and trying to brute force it offline. +If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. That's because the [Create Login Challenge](https://docs.dfns.co/api-reference/auth/create-login-challenge) is unauthenticated and returns the encrypted private key of the user. So we need a first step to verify the identity of the user to prevent anybody from fetching the encrypted private key and trying to brute force it offline. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.SendLoginCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.SendLoginCodeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/login/code", path_params={}, @@ -504,7 +482,6 @@ def send_login_code(self, body: T.SendLoginCodeRequest) -> T.SendLoginCodeRespon body=body, requires_signature=False, ) - return cast(T.SendLoginCodeResponse, response) def social_login(self, body: T.SocialLoginRequest) -> T.SocialLoginResponse: """ @@ -513,12 +490,12 @@ def social_login(self, body: T.SocialLoginRequest) -> T.SocialLoginResponse: Completes the login process and provides the authenticated user with their authentication token. Args: - body: Request body. + body: Request body. Returns: T.SocialLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/login/social", path_params={}, @@ -526,7 +503,6 @@ def social_login(self, body: T.SocialLoginRequest) -> T.SocialLoginResponse: body=body, requires_signature=False, ) - return cast(T.SocialLoginResponse, response) def complete_sso_login(self, body: T.CompleteSsoLoginRequest) -> T.CompleteSsoLoginResponse: """ @@ -535,12 +511,12 @@ def complete_sso_login(self, body: T.CompleteSsoLoginRequest) -> T.CompleteSsoLo Completes the login process and provides the authenticated user with their authentication token. Args: - body: Request body. + body: Request body. Returns: T.CompleteSsoLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/login/sso", path_params={}, @@ -548,7 +524,6 @@ def complete_sso_login(self, body: T.CompleteSsoLoginRequest) -> T.CompleteSsoLo body=body, requires_signature=False, ) - return cast(T.CompleteSsoLoginResponse, response) def initiate_sso_login(self, body: T.InitiateSsoLoginRequest) -> T.InitiateSsoLoginResponse: """ @@ -557,12 +532,12 @@ def initiate_sso_login(self, body: T.InitiateSsoLoginRequest) -> T.InitiateSsoLo Initialize the login process with SSO by returning the IdP URL to call. Args: - body: Request body. + body: Request body. Returns: T.InitiateSsoLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/login/sso/init", path_params={}, @@ -570,21 +545,20 @@ def initiate_sso_login(self, body: T.InitiateSsoLoginRequest) -> T.InitiateSsoLo body=body, requires_signature=False, ) - return cast(T.InitiateSsoLoginResponse, response) def exchange_access_token(self, body: T.ExchangeAccessTokenRequest) -> T.ExchangeAccessTokenResponse: """ Exchange Access Token. - Only for TenantUsers - Exchanges the current user access token, for an org-bound or tenant-bound token. The user must have access to the target org / tenant. The new access token expiration won't exceed the current token's one. + Exchanges the current user access token, for an org-bound or tenant-bound token. The user must have access to the target org / tenant. The new access token expiration won't exceed the current token's one. Args: - body: Request body. + body: Request body. Returns: T.ExchangeAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/tokens", path_params={}, @@ -592,7 +566,6 @@ def exchange_access_token(self, body: T.ExchangeAccessTokenRequest) -> T.Exchang body=body, requires_signature=False, ) - return cast(T.ExchangeAccessTokenResponse, response) def list_personal_access_tokens(self) -> T.ListPersonalAccessTokensResponse: """ @@ -602,8 +575,8 @@ def list_personal_access_tokens(self) -> T.ListPersonalAccessTokensResponse: Returns: T.ListPersonalAccessTokensResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/pats", path_params={}, @@ -611,23 +584,20 @@ def list_personal_access_tokens(self) -> T.ListPersonalAccessTokensResponse: body=None, requires_signature=False, ) - return cast(T.ListPersonalAccessTokensResponse, response) - def create_personal_access_token( - self, body: T.CreatePersonalAccessTokenRequest - ) -> T.CreatePersonalAccessTokenResponse: + def create_personal_access_token(self, body: T.CreatePersonalAccessTokenRequest) -> T.CreatePersonalAccessTokenResponse: """ Create Personal Access Token. Create a new Personal Access Token for the caller. Args: - body: Request body. + body: Request body. Returns: T.CreatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/pats", path_params={}, @@ -635,7 +605,6 @@ def create_personal_access_token( body=body, requires_signature=True, ) - return cast(T.CreatePersonalAccessTokenResponse, response) def get_personal_access_token(self, token_id: str) -> T.GetPersonalAccessTokenResponse: """ @@ -644,12 +613,12 @@ def get_personal_access_token(self, token_id: str) -> T.GetPersonalAccessTokenRe Retrieve a specific Personal Access Token. Args: - token_id: Token id. + token_id: Token id. Returns: T.GetPersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/pats/{tokenId}", path_params={"tokenId": token_id}, @@ -657,24 +626,21 @@ def get_personal_access_token(self, token_id: str) -> T.GetPersonalAccessTokenRe body=None, requires_signature=False, ) - return cast(T.GetPersonalAccessTokenResponse, response) - def update_personal_access_token( - self, token_id: str, body: T.UpdatePersonalAccessTokenRequest - ) -> T.UpdatePersonalAccessTokenResponse: + def update_personal_access_token(self, token_id: str, body: T.UpdatePersonalAccessTokenRequest) -> T.UpdatePersonalAccessTokenResponse: """ Update Personal Access Token. Update a specific Personal Access Token. Args: - token_id: Token id. - body: Request body. + token_id: Token id. + body: Request body. Returns: T.UpdatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/pats/{tokenId}", path_params={"tokenId": token_id}, @@ -682,7 +648,6 @@ def update_personal_access_token( body=body, requires_signature=True, ) - return cast(T.UpdatePersonalAccessTokenResponse, response) def delete_personal_access_token(self, token_id: str) -> T.DeletePersonalAccessTokenResponse: """ @@ -691,12 +656,12 @@ def delete_personal_access_token(self, token_id: str) -> T.DeletePersonalAccessT Delete a specific Personal Access Token. Args: - token_id: Token id. + token_id: Token id. Returns: T.DeletePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/auth/pats/{tokenId}", path_params={"tokenId": token_id}, @@ -704,7 +669,6 @@ def delete_personal_access_token(self, token_id: str) -> T.DeletePersonalAccessT body=None, requires_signature=True, ) - return cast(T.DeletePersonalAccessTokenResponse, response) def activate_personal_access_token(self, token_id: str) -> T.ActivatePersonalAccessTokenResponse: """ @@ -713,12 +677,12 @@ def activate_personal_access_token(self, token_id: str) -> T.ActivatePersonalAcc Activate a specific Personal Access Token. Args: - token_id: Token id. + token_id: Token id. Returns: T.ActivatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/pats/{tokenId}/activate", path_params={"tokenId": token_id}, @@ -726,7 +690,6 @@ def activate_personal_access_token(self, token_id: str) -> T.ActivatePersonalAcc body=None, requires_signature=True, ) - return cast(T.ActivatePersonalAccessTokenResponse, response) def deactivate_personal_access_token(self, token_id: str) -> T.DeactivatePersonalAccessTokenResponse: """ @@ -735,12 +698,12 @@ def deactivate_personal_access_token(self, token_id: str) -> T.DeactivatePersona Deactivates a credential that was previously active. If the credential is already deactivated no action is taken. Args: - token_id: Token id. + token_id: Token id. Returns: T.DeactivatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/pats/{tokenId}/deactivate", path_params={"tokenId": token_id}, @@ -748,29 +711,26 @@ def deactivate_personal_access_token(self, token_id: str) -> T.DeactivatePersona body=None, requires_signature=True, ) - return cast(T.DeactivatePersonalAccessTokenResponse, response) - def create_delegated_recovery_challenge( - self, body: T.CreateDelegatedRecoveryChallengeRequest - ) -> T.CreateDelegatedRecoveryChallengeResponse: + def create_delegated_recovery_challenge(self, body: T.CreateDelegatedRecoveryChallengeRequest) -> T.CreateDelegatedRecoveryChallengeResponse: """ - Create Delegated Recovery Challenge. + Create Delegated Recovery Challenge. - - Only a [Service Account](https://docs.dfns.co/api-reference/auth/service-accounts) can use this endpoint. - + +Only a [Service Account](https://docs.dfns.co/api-reference/auth/service-accounts) can use this endpoint. + - Starts a recovery session for an end user under your brand, without sending a Dfns recovery email. Call this after you have verified the user's identity with your own auth system. +Starts a recovery session for an end user under your brand, without sending a Dfns recovery email. Call this after you have verified the user's identity with your own auth system. - The response returns a recovery challenge. Pass it to your frontend so the user can decrypt their recovery credential and sign, then call [Recover User](https://docs.dfns.co/api-reference/auth/recover-user) to complete the recovery and register fresh credentials. +The response returns a recovery challenge. Pass it to your frontend so the user can decrypt their recovery credential and sign, then call [Recover User](https://docs.dfns.co/api-reference/auth/recover-user) to complete the recovery and register fresh credentials. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateDelegatedRecoveryChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateDelegatedRecoveryChallengeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/recover/user/delegated", path_params={}, @@ -778,29 +738,28 @@ def create_delegated_recovery_challenge( body=body, requires_signature=True, ) - return cast(T.CreateDelegatedRecoveryChallengeResponse, response) def recover_user(self, body: T.RecoverUserRequest) -> T.RecoverUserResponse: """ - Recover User. + Recover User. - Recovers a user, using a recovery credential. After successfully recovering the user, all of the user's previous credentials and personal access tokens will be invalidated. + Recovers a user, using a recovery credential. After successfully recovering the user, all of the user's previous credentials and personal access tokens will be invalidated. - This flow requires cryptographic validation of newly created credential(s) using a recovery credential. The `recovery.credentialAssertion.clientData` field's challenge must be the _base64url-encoded_ representation of the `newCredential` object. +This flow requires cryptographic validation of newly created credential(s) using a recovery credential. The `recovery.credentialAssertion.clientData` field's challenge must be the _base64url-encoded_ representation of the `newCredential` object. - The process is as follows: +The process is as follows: - 1. Construct the `newCredential` object, using the challenge obtained from either the [Create Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-recovery-challenge) or [Create Delegated Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-recovery-challenge) endpoints. - 2. Serialize the `newCredential` object to JSON and then base64url-encode the resulting JSON string. This _base64url-encoded_ string will serve as the challenge for the `recovery.credentialAssertion` object. - 3. Construct the `recovery.credentialAssertion` object, using the _base64url-encoded_ string generated in step 2 as its challenge. +1. Construct the `newCredential` object, using the challenge obtained from either the [Create Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-recovery-challenge) or [Create Delegated Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-recovery-challenge) endpoints. +2. Serialize the `newCredential` object to JSON and then base64url-encode the resulting JSON string. This _base64url-encoded_ string will serve as the challenge for the `recovery.credentialAssertion` object. +3. Construct the `recovery.credentialAssertion` object, using the _base64url-encoded_ string generated in step 2 as its challenge. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.RecoverUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.RecoverUserResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/recover/user", path_params={}, @@ -808,7 +767,6 @@ def recover_user(self, body: T.RecoverUserRequest) -> T.RecoverUserResponse: body=body, requires_signature=False, ) - return cast(T.RecoverUserResponse, response) def create_recovery_challenge(self, body: T.CreateRecoveryChallengeRequest) -> T.CreateRecoveryChallengeResponse: """ @@ -817,12 +775,12 @@ def create_recovery_challenge(self, body: T.CreateRecoveryChallengeRequest) -> T Starts a user recovery session, returning a challenge that will be used to verify the user's identity. Args: - body: Request body. + body: Request body. Returns: T.CreateRecoveryChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/recover/user/init", path_params={}, @@ -830,7 +788,6 @@ def create_recovery_challenge(self, body: T.CreateRecoveryChallengeRequest) -> T body=body, requires_signature=False, ) - return cast(T.CreateRecoveryChallengeResponse, response) def send_recovery_code_email(self, body: T.SendRecoveryCodeEmailRequest) -> T.SendRecoveryCodeEmailResponse: """ @@ -839,12 +796,12 @@ def send_recovery_code_email(self, body: T.SendRecoveryCodeEmailRequest) -> T.Se Send the user a recovery verification code. This code is used as a second factor to verify the user initiated the recovery request. Args: - body: Request body. + body: Request body. Returns: T.SendRecoveryCodeEmailResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/recover/user/code", path_params={}, @@ -852,35 +809,32 @@ def send_recovery_code_email(self, body: T.SendRecoveryCodeEmailRequest) -> T.Se body=body, requires_signature=False, ) - return cast(T.SendRecoveryCodeEmailResponse, response) - def create_delegated_registration_challenge( - self, body: T.CreateDelegatedRegistrationChallengeRequest - ) -> T.CreateDelegatedRegistrationChallengeResponse: + def create_delegated_registration_challenge(self, body: T.CreateDelegatedRegistrationChallengeRequest) -> T.CreateDelegatedRegistrationChallengeResponse: """ - Create Delegated Registration Challenge. + Create Delegated Registration Challenge. - - Only a [Service Account](https://docs.dfns.co/api-reference/auth/service-accounts) can use this endpoint. - + +Only a [Service Account](https://docs.dfns.co/api-reference/auth/service-accounts) can use this endpoint. + - Registers a new End User in your organization and returns a registration challenge, without sending a Dfns registration email. Use this when your application owns the authentication system and you want delegated signing under your brand. +Registers a new End User in your organization and returns a registration challenge, without sending a Dfns registration email. Use this when your application owns the authentication system and you want delegated signing under your brand. - The response includes: - 1. A new `EndUser` attached to your organization. - 2. A registration challenge plus a `temporaryAuthenticationToken` to authenticate the next call. +The response includes: +1. A new `EndUser` attached to your organization. +2. A registration challenge plus a `temporaryAuthenticationToken` to authenticate the next call. - Pass the challenge to your frontend so the user can create a passkey, then call [Complete User Registration](https://docs.dfns.co/api-reference/auth/complete-user-registration) or [Complete End User Registration with Wallets](https://docs.dfns.co/api-reference/auth/complete-end-user-registration-with-wallets) with that challenge signed. +Pass the challenge to your frontend so the user can create a passkey, then call [Complete User Registration](https://docs.dfns.co/api-reference/auth/complete-user-registration) or [Complete End User Registration with Wallets](https://docs.dfns.co/api-reference/auth/complete-end-user-registration-with-wallets) with that challenge signed. - Bundle a `recoveryCredential` in the completion call alongside the first passkey. All credentials in that call sign the same challenge returned here. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). +Bundle a `recoveryCredential` in the completion call alongside the first passkey. All credentials in that call sign the same challenge returned here. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateDelegatedRegistrationChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateDelegatedRegistrationChallengeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/registration/delegated", path_params={}, @@ -888,23 +842,20 @@ def create_delegated_registration_challenge( body=body, requires_signature=True, ) - return cast(T.CreateDelegatedRegistrationChallengeResponse, response) - def create_registration_challenge( - self, body: T.CreateRegistrationChallengeRequest - ) -> T.CreateRegistrationChallengeResponse: + def create_registration_challenge(self, body: T.CreateRegistrationChallengeRequest) -> T.CreateRegistrationChallengeResponse: """ Create Registration Challenge. Starts a user registration session. It returns a challenge that will need to be signed by a passkey and used to perform the step [Complete User Registration](/api-reference/auth/register) Args: - body: Request body. + body: Request body. Returns: T.CreateRegistrationChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/registration/init", path_params={}, @@ -912,23 +863,20 @@ def create_registration_challenge( body=body, requires_signature=False, ) - return cast(T.CreateRegistrationChallengeResponse, response) - def create_social_registration_challenge( - self, body: T.CreateSocialRegistrationChallengeRequest - ) -> T.CreateSocialRegistrationChallengeResponse: + def create_social_registration_challenge(self, body: T.CreateSocialRegistrationChallengeRequest) -> T.CreateSocialRegistrationChallengeResponse: """ Create Social Registration Challenge. Starts an end-user registration session by passing a JWT obtained by an IdP. It returns a challenge that will need to be signed by a passkey and used to perform [Complete End User Registration with Wallets](/api-reference/auth/register-end-user). Args: - body: Request body. + body: Request body. Returns: T.CreateSocialRegistrationChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/registration/social", path_params={}, @@ -936,31 +884,30 @@ def create_social_registration_challenge( body=body, requires_signature=False, ) - return cast(T.CreateSocialRegistrationChallengeResponse, response) def complete_user_registration(self, body: T.CompleteUserRegistrationRequest) -> T.CompleteUserRegistrationResponse: """ - Complete User Registration. + Complete User Registration. - Completes the user registration process and creates the user's initial credentials. + Completes the user registration process and creates the user's initial credentials. - All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Registration Challenge](https://docs.dfns.co/api-reference/auth/create-registration-challenge), [Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge), or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). +All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Registration Challenge](https://docs.dfns.co/api-reference/auth/create-registration-challenge), [Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge), or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). - Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). +Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). - The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: - * `Fido2`: User action is signed by a user's signing device using `WebAuthn`. - * `Key`: User action is signed by a user's, or token's, private key. - * `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. - * `RecoveryKey` : Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account not to sign an action or login. Once this credential is used all the other user's credentials are invalidated. +The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: +* `Fido2`: User action is signed by a user's signing device using `WebAuthn`. +* `Key`: User action is signed by a user's, or token's, private key. +* `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. +* `RecoveryKey` : Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account not to sign an action or login. Once this credential is used all the other user's credentials are invalidated. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CompleteUserRegistrationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CompleteUserRegistrationResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/registration", path_params={}, @@ -968,35 +915,32 @@ def complete_user_registration(self, body: T.CompleteUserRegistrationRequest) -> body=body, requires_signature=False, ) - return cast(T.CompleteUserRegistrationResponse, response) - def complete_end_user_registration_with_wallets( - self, body: T.CompleteEndUserRegistrationWithWalletsRequest - ) -> T.CompleteEndUserRegistrationWithWalletsResponse: + def complete_end_user_registration_with_wallets(self, body: T.CompleteEndUserRegistrationWithWalletsRequest) -> T.CompleteEndUserRegistrationWithWalletsResponse: """ - Complete End User Registration with Wallets. + Complete End User Registration with Wallets. - Completes the end user registration process and creates the user's initial credentials along with delegated wallets for the new end user. + Completes the end user registration process and creates the user's initial credentials along with delegated wallets for the new end user. - All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge) or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). +All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge) or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). - Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). +Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). - The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: - * `Fido2`: User action is signed by a user's signing device using `WebAuthn`. - * `Key`: User action is signed by a user's, or token's, private key. - * `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. - * `RecoveryKey`: Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account, not to sign an action or login. Once this credential is used, all the other user's credentials are invalidated. +The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: +* `Fido2`: User action is signed by a user's signing device using `WebAuthn`. +* `Key`: User action is signed by a user's, or token's, private key. +* `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. +* `RecoveryKey`: Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account, not to sign an action or login. Once this credential is used, all the other user's credentials are invalidated. - The number of delegated wallets created and the wallet types are determined by the `wallets` specifications. The end user is automatically assigned `ManagedDefaultEndUserAccess` managed permission that grants the end user full access to the wallets. +The number of delegated wallets created and the wallet types are determined by the `wallets` specifications. The end user is automatically assigned `ManagedDefaultEndUserAccess` managed permission that grants the end user full access to the wallets. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CompleteEndUserRegistrationWithWalletsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CompleteEndUserRegistrationWithWalletsResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/registration/enduser", path_params={}, @@ -1004,7 +948,6 @@ def complete_end_user_registration_with_wallets( body=body, requires_signature=False, ) - return cast(T.CompleteEndUserRegistrationWithWalletsResponse, response) def resend_registration_code(self, body: T.ResendRegistrationCodeRequest) -> T.ResendRegistrationCodeResponse: """ @@ -1013,12 +956,12 @@ def resend_registration_code(self, body: T.ResendRegistrationCodeRequest) -> T.R Sends the user a new registration code. The previous registration code will be marked invalid. If the user has already completed their registration no action will be taken. Args: - body: Request body. + body: Request body. Returns: T.ResendRegistrationCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/registration/code", path_params={}, @@ -1026,7 +969,6 @@ def resend_registration_code(self, body: T.ResendRegistrationCodeRequest) -> T.R body=body, requires_signature=False, ) - return cast(T.ResendRegistrationCodeResponse, response) def list_service_accounts(self) -> T.ListServiceAccountsResponse: """ @@ -1036,8 +978,8 @@ def list_service_accounts(self) -> T.ListServiceAccountsResponse: Returns: T.ListServiceAccountsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/service-accounts", path_params={}, @@ -1045,7 +987,6 @@ def list_service_accounts(self) -> T.ListServiceAccountsResponse: body=None, requires_signature=False, ) - return cast(T.ListServiceAccountsResponse, response) def create_service_account(self, body: T.CreateServiceAccountRequest) -> T.CreateServiceAccountResponse: """ @@ -1054,12 +995,12 @@ def create_service_account(self, body: T.CreateServiceAccountRequest) -> T.Creat Create a new Service Account for your organization. Args: - body: Request body. + body: Request body. Returns: T.CreateServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/service-accounts", path_params={}, @@ -1067,7 +1008,6 @@ def create_service_account(self, body: T.CreateServiceAccountRequest) -> T.Creat body=body, requires_signature=True, ) - return cast(T.CreateServiceAccountResponse, response) def get_service_account(self, service_account_id: str) -> T.GetServiceAccountResponse: """ @@ -1076,12 +1016,12 @@ def get_service_account(self, service_account_id: str) -> T.GetServiceAccountRes Get information about a specific Service Account. Args: - service_account_id: ID of the service account. + service_account_id: ID of the service account. Returns: T.GetServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/service-accounts/{serviceAccountId}", path_params={"serviceAccountId": service_account_id}, @@ -1089,24 +1029,21 @@ def get_service_account(self, service_account_id: str) -> T.GetServiceAccountRes body=None, requires_signature=False, ) - return cast(T.GetServiceAccountResponse, response) - def update_service_account( - self, service_account_id: str, body: T.UpdateServiceAccountRequest - ) -> T.UpdateServiceAccountResponse: + def update_service_account(self, service_account_id: str, body: T.UpdateServiceAccountRequest) -> T.UpdateServiceAccountResponse: """ Update Service Account. Update a specific Service Account. Args: - service_account_id: ID of the service account. - body: Request body. + service_account_id: ID of the service account. + body: Request body. Returns: T.UpdateServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/service-accounts/{serviceAccountId}", path_params={"serviceAccountId": service_account_id}, @@ -1114,24 +1051,21 @@ def update_service_account( body=body, requires_signature=True, ) - return cast(T.UpdateServiceAccountResponse, response) - def delete_service_account( - self, service_account_id: str, query: T.DeleteServiceAccountQuery | None = None - ) -> T.DeleteServiceAccountResponse: + def delete_service_account(self, service_account_id: str, query: Optional[T.DeleteServiceAccountQuery] = None) -> T.DeleteServiceAccountResponse: """ Delete Service Account. Delete a specific Service Account. Args: - service_account_id: ID of the service account. - query: Query parameters. + service_account_id: ID of the service account. + query: Query parameters. Returns: T.DeleteServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/auth/service-accounts/{serviceAccountId}", path_params={"serviceAccountId": service_account_id}, @@ -1139,7 +1073,6 @@ def delete_service_account( body=None, requires_signature=True, ) - return cast(T.DeleteServiceAccountResponse, response) def activate_service_account(self, service_account_id: str) -> T.ActivateServiceAccountResponse: """ @@ -1148,12 +1081,12 @@ def activate_service_account(self, service_account_id: str) -> T.ActivateService Activate a specific Service Account. Args: - service_account_id: ID of the service account. + service_account_id: ID of the service account. Returns: T.ActivateServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/service-accounts/{serviceAccountId}/activate", path_params={"serviceAccountId": service_account_id}, @@ -1161,24 +1094,21 @@ def activate_service_account(self, service_account_id: str) -> T.ActivateService body=None, requires_signature=True, ) - return cast(T.ActivateServiceAccountResponse, response) - def deactivate_service_account( - self, service_account_id: str, body: T.DeactivateServiceAccountRequest - ) -> T.DeactivateServiceAccountResponse: + def deactivate_service_account(self, service_account_id: str, body: T.DeactivateServiceAccountRequest) -> T.DeactivateServiceAccountResponse: """ Deactivate Service Account. Deactivate a specific Service Account. Args: - service_account_id: ID of the service account. - body: Request body. + service_account_id: ID of the service account. + body: Request body. Returns: T.DeactivateServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/service-accounts/{serviceAccountId}/deactivate", path_params={"serviceAccountId": service_account_id}, @@ -1186,7 +1116,6 @@ def deactivate_service_account( body=body, requires_signature=True, ) - return cast(T.DeactivateServiceAccountResponse, response) def activate_user(self, user_id: str) -> T.ActivateUserResponse: """ @@ -1195,12 +1124,12 @@ def activate_user(self, user_id: str) -> T.ActivateUserResponse: Activate a specific User. Args: - user_id: User id. + user_id: User id. Returns: T.ActivateUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/users/{userId}/activate", path_params={"userId": user_id}, @@ -1208,7 +1137,6 @@ def activate_user(self, user_id: str) -> T.ActivateUserResponse: body=None, requires_signature=True, ) - return cast(T.ActivateUserResponse, response) def deactivate_user(self, user_id: str) -> T.DeactivateUserResponse: """ @@ -1217,12 +1145,12 @@ def deactivate_user(self, user_id: str) -> T.DeactivateUserResponse: Deactivate a specific User. Args: - user_id: User id. + user_id: User id. Returns: T.DeactivateUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/users/{userId}/deactivate", path_params={"userId": user_id}, @@ -1230,7 +1158,6 @@ def deactivate_user(self, user_id: str) -> T.DeactivateUserResponse: body=None, requires_signature=True, ) - return cast(T.DeactivateUserResponse, response) def get_user(self, user_id: str) -> T.GetUserResponse: """ @@ -1239,12 +1166,12 @@ def get_user(self, user_id: str) -> T.GetUserResponse: Retrieve information about a specific User. Args: - user_id: User id. + user_id: User id. Returns: T.GetUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/users/{userId}", path_params={"userId": user_id}, @@ -1252,7 +1179,6 @@ def get_user(self, user_id: str) -> T.GetUserResponse: body=None, requires_signature=False, ) - return cast(T.GetUserResponse, response) def update_user(self, user_id: str, body: T.UpdateUserRequest) -> T.UpdateUserResponse: """ @@ -1261,13 +1187,13 @@ def update_user(self, user_id: str, body: T.UpdateUserRequest) -> T.UpdateUserRe Update a specific User. Args: - user_id: User id. - body: Request body. + user_id: User id. + body: Request body. Returns: T.UpdateUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/users/{userId}", path_params={"userId": user_id}, @@ -1275,7 +1201,6 @@ def update_user(self, user_id: str, body: T.UpdateUserRequest) -> T.UpdateUserRe body=body, requires_signature=True, ) - return cast(T.UpdateUserResponse, response) def delete_user(self, user_id: str) -> T.DeleteUserResponse: """ @@ -1284,12 +1209,12 @@ def delete_user(self, user_id: str) -> T.DeleteUserResponse: Delete a specific User. Args: - user_id: User id. + user_id: User id. Returns: T.DeleteUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/auth/users/{userId}", path_params={"userId": user_id}, @@ -1297,21 +1222,20 @@ def delete_user(self, user_id: str) -> T.DeleteUserResponse: body=None, requires_signature=True, ) - return cast(T.DeleteUserResponse, response) - def list_users(self, query: T.ListUsersQuery | None = None) -> T.ListUsersResponse: + def list_users(self, query: Optional[T.ListUsersQuery] = None) -> T.ListUsersResponse: """ List Users. List all Users in your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListUsersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/users", path_params={}, @@ -1319,25 +1243,24 @@ def list_users(self, query: T.ListUsersQuery | None = None) -> T.ListUsersRespon body=None, requires_signature=False, ) - return cast(T.ListUsersResponse, response) def create_user(self, body: T.CreateUserRequest) -> T.CreateUserResponse: """ - Create User. - - Invite a new user in the caller's org. This will create the user and send a registration email to the created User's email, with a registration code, and pointing him to complete his registration on Dfns Dashboard. The user is created without any permissions. + Create User. - If you want the created User to not know about about Dfns, and don't want him to - receive the registration email from Dfns, you should rather use the Delegated Registration - endpoint. + Invite a new user in the caller's org. This will create the user and send a registration email to the created User's email, with a registration code, and pointing him to complete his registration on Dfns Dashboard. The user is created without any permissions. + + If you want the created User to not know about about Dfns, and don't want him to + receive the registration email from Dfns, you should rather use the Delegated Registration + endpoint. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateUserResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/users", path_params={}, @@ -1345,21 +1268,20 @@ def create_user(self, body: T.CreateUserRequest) -> T.CreateUserResponse: body=body, requires_signature=True, ) - return cast(T.CreateUserResponse, response) - def invite_tenant_user(self, body: T.InviteTenantUserRequest) -> T.InviteTenantUserResponse: + def invite_account_user(self, body: T.InviteAccountUserRequest) -> T.InviteAccountUserResponse: """ - Invite Tenant User. + Invite Account User. - Invite an existing Tenant User in the caller's org. The invited Tenant User starts without any permissions within the org. + Invite an existing Account User in the caller's org. The invited Account User starts without any permissions within the org. Args: - body: Request body. + body: Request body. Returns: - T.InviteTenantUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + T.InviteAccountUserResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/users/invite", path_params={}, @@ -1367,4 +1289,3 @@ def invite_tenant_user(self, body: T.InviteTenantUserRequest) -> T.InviteTenantU body=body, requires_signature=True, ) - return cast(T.InviteTenantUserResponse, response) diff --git a/dfns_sdk/generated/auth/delegated_client.py b/dfns_sdk/generated/auth/delegated_client.py index e9767f5..e32b64d 100644 --- a/dfns_sdk/generated/auth/delegated_client.py +++ b/dfns_sdk/generated/auth/delegated_client.py @@ -1,12 +1,16 @@ """Delegated client for the auth domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union +from warnings import deprecated -from typing_extensions import deprecated from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -21,28 +25,26 @@ class DelegatedAuthClient: def __init__(self, http_client: HttpClient): self._http = http_client - def create_user_action_signature( - self, body: T.CreateUserActionSignatureRequest - ) -> T.CreateUserActionSignatureResponse: + def create_user_action_signature(self, body: T.CreateUserActionSignatureRequest) -> T.CreateUserActionSignatureResponse: """ - Create User Action Signature. + Create User Action Signature. - Completes the user action signing process and provides a signing token that can be used to verify the user intended to perform the action. + Completes the user action signing process and provides a signing token that can be used to verify the user intended to perform the action. - This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). +This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). - The type of credentials used to sign the action is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: - * `Fido2`: User action is signed by a user's signing device using `WebAuthn`. - * `Key`: User action is signed by a user's, or token's, private key. - * `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Action Signature Challenge](https://docs.dfns.co/api-reference/auth/create-user-action-challenge) step. +The type of credentials used to sign the action is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: +* `Fido2`: User action is signed by a user's signing device using `WebAuthn`. +* `Key`: User action is signed by a user's, or token's, private key. +* `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Action Signature Challenge](https://docs.dfns.co/api-reference/auth/create-user-action-challenge) step. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateUserActionSignatureResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateUserActionSignatureResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/action", path_params={}, @@ -50,25 +52,22 @@ def create_user_action_signature( body=body, requires_signature=False, ) - return cast(T.CreateUserActionSignatureResponse, response) - def create_user_action_challenge( - self, body: T.CreateUserActionChallengeRequest - ) -> T.CreateUserActionChallengeResponse: + def create_user_action_challenge(self, body: T.CreateUserActionChallengeRequest) -> T.CreateUserActionChallengeResponse: """ - Create User Action Challenge. + Create User Action Challenge. - Starts a user action signing session, returning a challenge that will be used to verify the user's intent to perform an action. + Starts a user action signing session, returning a challenge that will be used to verify the user's intent to perform an action. + + This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). - This is the first step of the [User Action Signing flow](http://docs.dfns.co/api-reference/auth/signing-flows). - - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateUserActionChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateUserActionChallengeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/action/init", path_params={}, @@ -76,27 +75,26 @@ def create_user_action_challenge( body=body, requires_signature=False, ) - return cast(T.CreateUserActionChallengeResponse, response) def list_audit_logs(self, query: T.ListAuditLogsQuery) -> None: """ - List Audit Logs. + List Audit Logs. - Gets all signature events which have occurred in the over the timeframe. The time range is unbounded, but the export is capped at 100,000 rows. When the result is truncated, the `X-Dfns-Result-Truncated: true` response header is set and a trailing `# TRUNCATED ...` line is appended to the CSV; narrow the time range to retrieve all data. + Gets all signature events which have occurred in the over the timeframe. The time range is unbounded, but the export is capped at 100,000 rows. When the result is truncated, the `X-Dfns-Result-Truncated: true` response header is set and a trailing `# TRUNCATED ...` line is appended to the CSV; narrow the time range to retrieve all data. - StartTime and EndTime are URL-encoded UTC ISO timestamps: - `startTime=2025-08-29T02%3A46%3A40Z` - `endTime=2025-09-01T02%3A46%3A40Z` +StartTime and EndTime are URL-encoded UTC ISO timestamps: +`startTime=2025-08-29T02%3A46%3A40Z` +`endTime=2025-09-01T02%3A46%3A40Z` - An additional optional query parameter, `userId` can be specified to filter down events to a particular user. The API will return results found in CSV format. +An additional optional query parameter, `userId` can be specified to filter down events to a particular user. The API will return results found in CSV format. - Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) +Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) - Args: - query: Query parameters. - """ # noqa: E501 - self._http.request( + Args: + query: Query parameters. + """ + return self._http.request( method="GET", path="/auth/action/logs", path_params={}, @@ -107,19 +105,19 @@ def list_audit_logs(self, query: T.ListAuditLogsQuery) -> None: def get_audit_log(self, id: str) -> T.GetAuditLogResponse: """ - Get Audit Log. + Get Audit Log. - Gets detailed information for a particular audit log. Specifically, the API returns the action performed, as well as the `firstFactorCredential` in which you will find the signature information required to validate it. + Gets detailed information for a particular audit log. Specifically, the API returns the action performed, as well as the `firstFactorCredential` in which you will find the signature information required to validate it. - Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) +Dfns maintains a script which can be used for audit log signature validation: [WebAuthn Signature Verifier](https://github.com/dfns/example-scripts/tree/m/python/utils) - Args: - id: Log id you need information about. + Args: + id: Log id you need information about. - Returns: - T.GetAuditLogResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetAuditLogResponse: The API response. + """ + return self._http.request( method="GET", path="/auth/action/logs/{id}", path_params={"id": id}, @@ -127,21 +125,20 @@ def get_audit_log(self, id: str) -> T.GetAuditLogResponse: body=None, requires_signature=False, ) - return cast(T.GetAuditLogResponse, response) @deprecated("This endpoint is deprecated.") def list_applications(self) -> T.ListApplicationsResponse: """ - List Applications. + List Applications. - - Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). - + + Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). + - Returns: - T.ListApplicationsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ListApplicationsResponse: The API response. + """ + return self._http.request( method="GET", path="/auth/apps", path_params={}, @@ -149,24 +146,23 @@ def list_applications(self) -> T.ListApplicationsResponse: body=None, requires_signature=False, ) - return cast(T.ListApplicationsResponse, response) @deprecated("This endpoint is deprecated.") def get_application(self, app_id: str) -> T.GetApplicationResponse: """ - Get Application. + Get Application. - - Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). - + + Applications are deprecated and will be removed in a future release. See details [here](https://docs.dfns.co/developers/guides/applications-deprecation). + - Args: - app_id: ID of the application (deprecated). + Args: + app_id: ID of the application (deprecated). - Returns: - T.GetApplicationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetApplicationResponse: The API response. + """ + return self._http.request( method="GET", path="/auth/apps/{appId}", path_params={"appId": app_id}, @@ -174,7 +170,6 @@ def get_application(self, app_id: str) -> T.GetApplicationResponse: body=None, requires_signature=False, ) - return cast(T.GetApplicationResponse, response) def list_credentials(self) -> T.ListCredentialsResponse: """ @@ -184,8 +179,8 @@ def list_credentials(self) -> T.ListCredentialsResponse: Returns: T.ListCredentialsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/credentials", path_params={}, @@ -193,7 +188,6 @@ def list_credentials(self) -> T.ListCredentialsResponse: body=None, requires_signature=False, ) - return cast(T.ListCredentialsResponse, response) def create_credential_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -202,11 +196,11 @@ def create_credential_init(self, body: dict[str, Any]) -> UserActionChallengeRes Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/credentials" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -217,25 +211,25 @@ def create_credential_init(self, body: dict[str, Any]) -> UserActionChallengeRes user_action_payload=payload, ) - def create_credential_complete( - self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateCredentialResponse: + def create_credential_complete(self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreateCredentialResponse: """ Complete Create Credential. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateCredentialResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/credentials", path_params={}, @@ -243,23 +237,22 @@ def create_credential_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateCredentialResponse, response) - def create_credential_challenge(self, body: T.CreateCredentialChallengeRequest) -> dict[str, Any]: + def create_credential_challenge(self, body: T.CreateCredentialChallengeRequest) -> TypedDict: """ - Create Credential Challenge. - - Part of the flow [Create Credential Regular flow](https://docs.dfns.co/api-reference/auth/credentials#regular-flow). + Create Credential Challenge. - Starts a create user credential session, returning a challenge that will be used to verify the user's identity. + Part of the flow [Create Credential Regular flow](https://docs.dfns.co/api-reference/auth/credentials#regular-flow). + + Starts a create user credential session, returning a challenge that will be used to verify the user's identity. - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/init", path_params={}, @@ -267,7 +260,6 @@ def create_credential_challenge(self, body: T.CreateCredentialChallengeRequest) body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def activate_credential_init(self, body: T.ActivateCredentialRequest) -> UserActionChallengeResponse: """ @@ -276,11 +268,11 @@ def activate_credential_init(self, body: T.ActivateCredentialRequest) -> UserAct Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/credentials/activate" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -291,25 +283,25 @@ def activate_credential_init(self, body: T.ActivateCredentialRequest) -> UserAct user_action_payload=payload, ) - def activate_credential_complete( - self, body: T.ActivateCredentialRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.ActivateCredentialResponse: + def activate_credential_complete(self, body: T.ActivateCredentialRequest, signed_challenge: SignUserActionChallengeRequest) -> T.ActivateCredentialResponse: """ Complete Activate Credential. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.ActivateCredentialResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/credentials/activate", path_params={}, @@ -317,7 +309,6 @@ def activate_credential_complete( body=body, user_action=user_action_token, ) - return cast(T.ActivateCredentialResponse, response) def delete_credential_init(self, credential_uuid: str) -> UserActionChallengeResponse: """ @@ -326,11 +317,11 @@ def delete_credential_init(self, credential_uuid: str) -> UserActionChallengeRes Creates a user action challenge for external signing. Args: - credential_uuid: Path parameter. + credential_uuid: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/credentials/{credentialUuid}" path = path.replace("{credentialUuid}", str(credential_uuid)) payload = "" @@ -342,25 +333,25 @@ def delete_credential_init(self, credential_uuid: str) -> UserActionChallengeRes user_action_payload=payload, ) - def delete_credential_complete( - self, credential_uuid: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeleteCredentialResponse: + def delete_credential_complete(self, credential_uuid: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeleteCredentialResponse: """ Complete Delete Credential. Submits the signed challenge and makes the API request. Args: - credential_uuid: Path parameter. - signed_challenge: The signed challenge from external signing. + credential_uuid: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteCredentialResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/auth/credentials/{credentialUuid}", path_params={"credentialUuid": credential_uuid}, @@ -368,7 +359,6 @@ def delete_credential_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteCredentialResponse, response) def deactivate_credential_init(self, body: T.DeactivateCredentialRequest) -> UserActionChallengeResponse: """ @@ -377,11 +367,11 @@ def deactivate_credential_init(self, body: T.DeactivateCredentialRequest) -> Use Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/credentials/deactivate" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -392,25 +382,25 @@ def deactivate_credential_init(self, body: T.DeactivateCredentialRequest) -> Use user_action_payload=payload, ) - def deactivate_credential_complete( - self, body: T.DeactivateCredentialRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeactivateCredentialResponse: + def deactivate_credential_complete(self, body: T.DeactivateCredentialRequest, signed_challenge: SignUserActionChallengeRequest) -> T.DeactivateCredentialResponse: """ Complete Deactivate Credential. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.DeactivateCredentialResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/credentials/deactivate", path_params={}, @@ -418,7 +408,6 @@ def deactivate_credential_complete( body=body, user_action=user_action_token, ) - return cast(T.DeactivateCredentialResponse, response) def create_credential_code_init(self, body: T.CreateCredentialCodeRequest) -> UserActionChallengeResponse: """ @@ -427,11 +416,11 @@ def create_credential_code_init(self, body: T.CreateCredentialCodeRequest) -> Us Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/credentials/code" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -442,25 +431,25 @@ def create_credential_code_init(self, body: T.CreateCredentialCodeRequest) -> Us user_action_payload=payload, ) - def create_credential_code_complete( - self, body: T.CreateCredentialCodeRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateCredentialCodeResponse: + def create_credential_code_complete(self, body: T.CreateCredentialCodeRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateCredentialCodeResponse: """ Complete Create Credential Code. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateCredentialCodeResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/credentials/code", path_params={}, @@ -468,23 +457,22 @@ def create_credential_code_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateCredentialCodeResponse, response) - def create_credential_challenge_with_code(self, body: T.CreateCredentialChallengeWithCodeRequest) -> dict[str, Any]: + def create_credential_challenge_with_code(self, body: T.CreateCredentialChallengeWithCodeRequest) -> TypedDict: """ - Create Credential Challenge With Code. + Create Credential Challenge With Code. - Part of the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + Part of the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). - Creates a credential challenge using a one time code-time-code. This challenge must then be signed by the new credential, before finalizing the flow. +Creates a credential challenge using a one time code-time-code. This challenge must then be signed by the new credential, before finalizing the flow. - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/code/init", path_params={}, @@ -492,26 +480,25 @@ def create_credential_challenge_with_code(self, body: T.CreateCredentialChalleng body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def create_credential_with_code(self, body: dict[str, Any]) -> T.CreateCredentialWithCodeResponse: """ - Create Credential With Code. - - Finalizes the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + Create Credential With Code. - Adds a new credential to a user's account. This endpoint is similar to the [Create Credential](https://docs.dfns.co/api-reference/auth/create-credential) endpoint, except: - * it does not need the user to be authenticated - * it does not need user action signing - * it will only work with the challenge gotten from the [Create Credential Challenge With Code](https://docs.dfns.co/api-reference/auth/create-credential-challenge-with-code) endpoint + Finalizes the flow [Create Credential With Code](https://docs.dfns.co/api-reference/auth/credentials#create-credential-with-code-flow). + +Adds a new credential to a user's account. This endpoint is similar to the [Create Credential](https://docs.dfns.co/api-reference/auth/create-credential) endpoint, except: +* it does not need the user to be authenticated +* it does not need user action signing +* it will only work with the challenge gotten from the [Create Credential Challenge With Code](https://docs.dfns.co/api-reference/auth/create-credential-challenge-with-code) endpoint - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateCredentialWithCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateCredentialWithCodeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/credentials/code/verify", path_params={}, @@ -519,25 +506,24 @@ def create_credential_with_code(self, body: dict[str, Any]) -> T.CreateCredentia body=body, requires_signature=False, ) - return cast(T.CreateCredentialWithCodeResponse, response) def create_login_challenge(self, body: T.CreateLoginChallengeRequest) -> T.CreateLoginChallengeResponse: """ - Create Login Challenge. + Create Login Challenge. - Start a user login session, returning a challenge that will be used to verify the user's identity. + Start a user login session, returning a challenge that will be used to verify the user's identity. - If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. +If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. - If the user has at least one discoverable WebAuthn credential, `username` is optional (username-less flow). +If the user has at least one discoverable WebAuthn credential, `username` is optional (username-less flow). - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CreateLoginChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateLoginChallengeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/login/init", path_params={}, @@ -545,7 +531,6 @@ def create_login_challenge(self, body: T.CreateLoginChallengeRequest) -> T.Creat body=body, requires_signature=False, ) - return cast(T.CreateLoginChallengeResponse, response) def delegated_login_init(self, body: T.DelegatedLoginRequest) -> UserActionChallengeResponse: """ @@ -554,11 +539,11 @@ def delegated_login_init(self, body: T.DelegatedLoginRequest) -> UserActionChall Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/login/delegated" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -569,25 +554,25 @@ def delegated_login_init(self, body: T.DelegatedLoginRequest) -> UserActionChall user_action_payload=payload, ) - def delegated_login_complete( - self, body: T.DelegatedLoginRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.DelegatedLoginResponse: + def delegated_login_complete(self, body: T.DelegatedLoginRequest, signed_challenge: SignUserActionChallengeRequest) -> T.DelegatedLoginResponse: """ Complete Delegated Login. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.DelegatedLoginResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/login/delegated", path_params={}, @@ -595,26 +580,25 @@ def delegated_login_complete( body=body, user_action=user_action_token, ) - return cast(T.DelegatedLoginResponse, response) - def complete_user_login(self, body: T.CompleteUserLoginRequest) -> dict[str, Any]: + def complete_user_login(self, body: T.CompleteUserLoginRequest) -> TypedDict: """ - Complete User Login. + Complete User Login. - Completes the login process and provides the authenticated user with their authentication token. + Completes the login process and provides the authenticated user with their authentication token. - The type of credentials used to login is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: - * `Fido2`: Login challenge is signed by a user's signing device using `WebAuthn`. - * `Key`: Login challenge is signed by a user's private key. - * `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Login Challenge](../registration/inituserregistration) step. +The type of credentials used to login is determined by the `kind` field in the nested objects (`firstFactor` and `secondFactor`). Supported credential kinds are: +* `Fido2`: Login challenge is signed by a user's signing device using `WebAuthn`. +* `Key`: Login challenge is signed by a user's private key. +* `PasswordProtectedKey`: Login challenge is signed by the decrypted user's private key that was sent during [Create User Login Challenge](../registration/inituserregistration) step. - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/auth/login", path_params={}, @@ -622,7 +606,6 @@ def complete_user_login(self, body: T.CompleteUserLoginRequest) -> dict[str, Any body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def logout(self, body: T.LogoutRequest) -> T.LogoutResponse: """ @@ -631,12 +614,12 @@ def logout(self, body: T.LogoutRequest) -> T.LogoutResponse: Completes the user logout process. Args: - body: Request body. + body: Request body. Returns: T.LogoutResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/logout", path_params={}, @@ -644,23 +627,22 @@ def logout(self, body: T.LogoutRequest) -> T.LogoutResponse: body=body, requires_signature=False, ) - return cast(T.LogoutResponse, response) def send_login_code(self, body: T.SendLoginCodeRequest) -> T.SendLoginCodeResponse: """ - Send Login Code. + Send Login Code. - Sends a temporary one time code to the user that can be used during login flow. + Sends a temporary one time code to the user that can be used during login flow. - If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. That's because the [Create Login Challenge](https://docs.dfns.co/api-reference/auth/create-login-challenge) is unauthenticated and returns the encrypted private key of the user. So we need a first step to verify the identity of the user to prevent anybody from fetching the encrypted private key and trying to brute force it offline. +If the user has a credential of kind `PasswordProtectedKey` a temporary one time code needs to be passed in the `loginCode` field. That's because the [Create Login Challenge](https://docs.dfns.co/api-reference/auth/create-login-challenge) is unauthenticated and returns the encrypted private key of the user. So we need a first step to verify the identity of the user to prevent anybody from fetching the encrypted private key and trying to brute force it offline. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.SendLoginCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.SendLoginCodeResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/login/code", path_params={}, @@ -668,7 +650,6 @@ def send_login_code(self, body: T.SendLoginCodeRequest) -> T.SendLoginCodeRespon body=body, requires_signature=False, ) - return cast(T.SendLoginCodeResponse, response) def social_login(self, body: T.SocialLoginRequest) -> T.SocialLoginResponse: """ @@ -677,12 +658,12 @@ def social_login(self, body: T.SocialLoginRequest) -> T.SocialLoginResponse: Completes the login process and provides the authenticated user with their authentication token. Args: - body: Request body. + body: Request body. Returns: T.SocialLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/login/social", path_params={}, @@ -690,7 +671,6 @@ def social_login(self, body: T.SocialLoginRequest) -> T.SocialLoginResponse: body=body, requires_signature=False, ) - return cast(T.SocialLoginResponse, response) def complete_sso_login(self, body: T.CompleteSsoLoginRequest) -> T.CompleteSsoLoginResponse: """ @@ -699,12 +679,12 @@ def complete_sso_login(self, body: T.CompleteSsoLoginRequest) -> T.CompleteSsoLo Completes the login process and provides the authenticated user with their authentication token. Args: - body: Request body. + body: Request body. Returns: T.CompleteSsoLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/login/sso", path_params={}, @@ -712,7 +692,6 @@ def complete_sso_login(self, body: T.CompleteSsoLoginRequest) -> T.CompleteSsoLo body=body, requires_signature=False, ) - return cast(T.CompleteSsoLoginResponse, response) def initiate_sso_login(self, body: T.InitiateSsoLoginRequest) -> T.InitiateSsoLoginResponse: """ @@ -721,12 +700,12 @@ def initiate_sso_login(self, body: T.InitiateSsoLoginRequest) -> T.InitiateSsoLo Initialize the login process with SSO by returning the IdP URL to call. Args: - body: Request body. + body: Request body. Returns: T.InitiateSsoLoginResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/login/sso/init", path_params={}, @@ -734,21 +713,20 @@ def initiate_sso_login(self, body: T.InitiateSsoLoginRequest) -> T.InitiateSsoLo body=body, requires_signature=False, ) - return cast(T.InitiateSsoLoginResponse, response) def exchange_access_token(self, body: T.ExchangeAccessTokenRequest) -> T.ExchangeAccessTokenResponse: """ Exchange Access Token. - Only for TenantUsers - Exchanges the current user access token, for an org-bound or tenant-bound token. The user must have access to the target org / tenant. The new access token expiration won't exceed the current token's one. + Exchanges the current user access token, for an org-bound or tenant-bound token. The user must have access to the target org / tenant. The new access token expiration won't exceed the current token's one. Args: - body: Request body. + body: Request body. Returns: T.ExchangeAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/tokens", path_params={}, @@ -756,7 +734,6 @@ def exchange_access_token(self, body: T.ExchangeAccessTokenRequest) -> T.Exchang body=body, requires_signature=False, ) - return cast(T.ExchangeAccessTokenResponse, response) def list_personal_access_tokens(self) -> T.ListPersonalAccessTokensResponse: """ @@ -766,8 +743,8 @@ def list_personal_access_tokens(self) -> T.ListPersonalAccessTokensResponse: Returns: T.ListPersonalAccessTokensResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/pats", path_params={}, @@ -775,22 +752,19 @@ def list_personal_access_tokens(self) -> T.ListPersonalAccessTokensResponse: body=None, requires_signature=False, ) - return cast(T.ListPersonalAccessTokensResponse, response) - def create_personal_access_token_init( - self, body: T.CreatePersonalAccessTokenRequest - ) -> UserActionChallengeResponse: + def create_personal_access_token_init(self, body: T.CreatePersonalAccessTokenRequest) -> UserActionChallengeResponse: """ Initialize Create Personal Access Token. Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/pats" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -801,25 +775,25 @@ def create_personal_access_token_init( user_action_payload=payload, ) - def create_personal_access_token_complete( - self, body: T.CreatePersonalAccessTokenRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreatePersonalAccessTokenResponse: + def create_personal_access_token_complete(self, body: T.CreatePersonalAccessTokenRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreatePersonalAccessTokenResponse: """ Complete Create Personal Access Token. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/pats", path_params={}, @@ -827,7 +801,6 @@ def create_personal_access_token_complete( body=body, user_action=user_action_token, ) - return cast(T.CreatePersonalAccessTokenResponse, response) def get_personal_access_token(self, token_id: str) -> T.GetPersonalAccessTokenResponse: """ @@ -836,12 +809,12 @@ def get_personal_access_token(self, token_id: str) -> T.GetPersonalAccessTokenRe Retrieve a specific Personal Access Token. Args: - token_id: Token id. + token_id: Token id. Returns: T.GetPersonalAccessTokenResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/pats/{tokenId}", path_params={"tokenId": token_id}, @@ -849,23 +822,20 @@ def get_personal_access_token(self, token_id: str) -> T.GetPersonalAccessTokenRe body=None, requires_signature=False, ) - return cast(T.GetPersonalAccessTokenResponse, response) - def update_personal_access_token_init( - self, token_id: str, body: T.UpdatePersonalAccessTokenRequest - ) -> UserActionChallengeResponse: + def update_personal_access_token_init(self, token_id: str, body: T.UpdatePersonalAccessTokenRequest) -> UserActionChallengeResponse: """ Initialize Update Personal Access Token. Creates a user action challenge for external signing. Args: - token_id: Token id. - body: Request body. + token_id: Token id. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/pats/{tokenId}" path = path.replace("{tokenId}", str(token_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -877,26 +847,26 @@ def update_personal_access_token_init( user_action_payload=payload, ) - def update_personal_access_token_complete( - self, token_id: str, body: T.UpdatePersonalAccessTokenRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UpdatePersonalAccessTokenResponse: + def update_personal_access_token_complete(self, token_id: str, body: T.UpdatePersonalAccessTokenRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdatePersonalAccessTokenResponse: """ Complete Update Personal Access Token. Submits the signed challenge and makes the API request. Args: - token_id: Token id. - body: Request body. - signed_challenge: The signed challenge from external signing. + token_id: Token id. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/pats/{tokenId}", path_params={"tokenId": token_id}, @@ -904,7 +874,6 @@ def update_personal_access_token_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdatePersonalAccessTokenResponse, response) def delete_personal_access_token_init(self, token_id: str) -> UserActionChallengeResponse: """ @@ -913,11 +882,11 @@ def delete_personal_access_token_init(self, token_id: str) -> UserActionChalleng Creates a user action challenge for external signing. Args: - token_id: Token id. + token_id: Token id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/pats/{tokenId}" path = path.replace("{tokenId}", str(token_id)) payload = "" @@ -929,25 +898,25 @@ def delete_personal_access_token_init(self, token_id: str) -> UserActionChalleng user_action_payload=payload, ) - def delete_personal_access_token_complete( - self, token_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeletePersonalAccessTokenResponse: + def delete_personal_access_token_complete(self, token_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeletePersonalAccessTokenResponse: """ Complete Delete Personal Access Token. Submits the signed challenge and makes the API request. Args: - token_id: Token id. - signed_challenge: The signed challenge from external signing. + token_id: Token id. + signed_challenge: The signed challenge from external signing. Returns: T.DeletePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/auth/pats/{tokenId}", path_params={"tokenId": token_id}, @@ -955,7 +924,6 @@ def delete_personal_access_token_complete( body=None, user_action=user_action_token, ) - return cast(T.DeletePersonalAccessTokenResponse, response) def activate_personal_access_token_init(self, token_id: str) -> UserActionChallengeResponse: """ @@ -964,11 +932,11 @@ def activate_personal_access_token_init(self, token_id: str) -> UserActionChalle Creates a user action challenge for external signing. Args: - token_id: Token id. + token_id: Token id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/pats/{tokenId}/activate" path = path.replace("{tokenId}", str(token_id)) payload = "" @@ -980,25 +948,25 @@ def activate_personal_access_token_init(self, token_id: str) -> UserActionChalle user_action_payload=payload, ) - def activate_personal_access_token_complete( - self, token_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.ActivatePersonalAccessTokenResponse: + def activate_personal_access_token_complete(self, token_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.ActivatePersonalAccessTokenResponse: """ Complete Activate Personal Access Token. Submits the signed challenge and makes the API request. Args: - token_id: Token id. - signed_challenge: The signed challenge from external signing. + token_id: Token id. + signed_challenge: The signed challenge from external signing. Returns: T.ActivatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/pats/{tokenId}/activate", path_params={"tokenId": token_id}, @@ -1006,7 +974,6 @@ def activate_personal_access_token_complete( body=None, user_action=user_action_token, ) - return cast(T.ActivatePersonalAccessTokenResponse, response) def deactivate_personal_access_token_init(self, token_id: str) -> UserActionChallengeResponse: """ @@ -1015,11 +982,11 @@ def deactivate_personal_access_token_init(self, token_id: str) -> UserActionChal Creates a user action challenge for external signing. Args: - token_id: Token id. + token_id: Token id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/pats/{tokenId}/deactivate" path = path.replace("{tokenId}", str(token_id)) payload = "" @@ -1031,25 +998,25 @@ def deactivate_personal_access_token_init(self, token_id: str) -> UserActionChal user_action_payload=payload, ) - def deactivate_personal_access_token_complete( - self, token_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeactivatePersonalAccessTokenResponse: + def deactivate_personal_access_token_complete(self, token_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeactivatePersonalAccessTokenResponse: """ Complete Deactivate Personal Access Token. Submits the signed challenge and makes the API request. Args: - token_id: Token id. - signed_challenge: The signed challenge from external signing. + token_id: Token id. + signed_challenge: The signed challenge from external signing. Returns: T.DeactivatePersonalAccessTokenResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/pats/{tokenId}/deactivate", path_params={"tokenId": token_id}, @@ -1057,22 +1024,19 @@ def deactivate_personal_access_token_complete( body=None, user_action=user_action_token, ) - return cast(T.DeactivatePersonalAccessTokenResponse, response) - def create_delegated_recovery_challenge_init( - self, body: T.CreateDelegatedRecoveryChallengeRequest - ) -> UserActionChallengeResponse: + def create_delegated_recovery_challenge_init(self, body: T.CreateDelegatedRecoveryChallengeRequest) -> UserActionChallengeResponse: """ Initialize Create Delegated Recovery Challenge. Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/recover/user/delegated" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1083,25 +1047,25 @@ def create_delegated_recovery_challenge_init( user_action_payload=payload, ) - def create_delegated_recovery_challenge_complete( - self, body: T.CreateDelegatedRecoveryChallengeRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateDelegatedRecoveryChallengeResponse: + def create_delegated_recovery_challenge_complete(self, body: T.CreateDelegatedRecoveryChallengeRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateDelegatedRecoveryChallengeResponse: """ Complete Create Delegated Recovery Challenge. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateDelegatedRecoveryChallengeResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/recover/user/delegated", path_params={}, @@ -1109,29 +1073,28 @@ def create_delegated_recovery_challenge_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateDelegatedRecoveryChallengeResponse, response) def recover_user(self, body: T.RecoverUserRequest) -> T.RecoverUserResponse: """ - Recover User. + Recover User. - Recovers a user, using a recovery credential. After successfully recovering the user, all of the user's previous credentials and personal access tokens will be invalidated. + Recovers a user, using a recovery credential. After successfully recovering the user, all of the user's previous credentials and personal access tokens will be invalidated. - This flow requires cryptographic validation of newly created credential(s) using a recovery credential. The `recovery.credentialAssertion.clientData` field's challenge must be the _base64url-encoded_ representation of the `newCredential` object. +This flow requires cryptographic validation of newly created credential(s) using a recovery credential. The `recovery.credentialAssertion.clientData` field's challenge must be the _base64url-encoded_ representation of the `newCredential` object. - The process is as follows: +The process is as follows: - 1. Construct the `newCredential` object, using the challenge obtained from either the [Create Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-recovery-challenge) or [Create Delegated Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-recovery-challenge) endpoints. - 2. Serialize the `newCredential` object to JSON and then base64url-encode the resulting JSON string. This _base64url-encoded_ string will serve as the challenge for the `recovery.credentialAssertion` object. - 3. Construct the `recovery.credentialAssertion` object, using the _base64url-encoded_ string generated in step 2 as its challenge. +1. Construct the `newCredential` object, using the challenge obtained from either the [Create Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-recovery-challenge) or [Create Delegated Recovery Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-recovery-challenge) endpoints. +2. Serialize the `newCredential` object to JSON and then base64url-encode the resulting JSON string. This _base64url-encoded_ string will serve as the challenge for the `recovery.credentialAssertion` object. +3. Construct the `recovery.credentialAssertion` object, using the _base64url-encoded_ string generated in step 2 as its challenge. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.RecoverUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.RecoverUserResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/recover/user", path_params={}, @@ -1139,7 +1102,6 @@ def recover_user(self, body: T.RecoverUserRequest) -> T.RecoverUserResponse: body=body, requires_signature=False, ) - return cast(T.RecoverUserResponse, response) def create_recovery_challenge(self, body: T.CreateRecoveryChallengeRequest) -> T.CreateRecoveryChallengeResponse: """ @@ -1148,12 +1110,12 @@ def create_recovery_challenge(self, body: T.CreateRecoveryChallengeRequest) -> T Starts a user recovery session, returning a challenge that will be used to verify the user's identity. Args: - body: Request body. + body: Request body. Returns: T.CreateRecoveryChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/recover/user/init", path_params={}, @@ -1161,7 +1123,6 @@ def create_recovery_challenge(self, body: T.CreateRecoveryChallengeRequest) -> T body=body, requires_signature=False, ) - return cast(T.CreateRecoveryChallengeResponse, response) def send_recovery_code_email(self, body: T.SendRecoveryCodeEmailRequest) -> T.SendRecoveryCodeEmailResponse: """ @@ -1170,12 +1131,12 @@ def send_recovery_code_email(self, body: T.SendRecoveryCodeEmailRequest) -> T.Se Send the user a recovery verification code. This code is used as a second factor to verify the user initiated the recovery request. Args: - body: Request body. + body: Request body. Returns: T.SendRecoveryCodeEmailResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/recover/user/code", path_params={}, @@ -1183,22 +1144,19 @@ def send_recovery_code_email(self, body: T.SendRecoveryCodeEmailRequest) -> T.Se body=body, requires_signature=False, ) - return cast(T.SendRecoveryCodeEmailResponse, response) - def create_delegated_registration_challenge_init( - self, body: T.CreateDelegatedRegistrationChallengeRequest - ) -> UserActionChallengeResponse: + def create_delegated_registration_challenge_init(self, body: T.CreateDelegatedRegistrationChallengeRequest) -> UserActionChallengeResponse: """ Initialize Create Delegated Registration Challenge. Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/registration/delegated" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1209,25 +1167,25 @@ def create_delegated_registration_challenge_init( user_action_payload=payload, ) - def create_delegated_registration_challenge_complete( - self, body: T.CreateDelegatedRegistrationChallengeRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateDelegatedRegistrationChallengeResponse: + def create_delegated_registration_challenge_complete(self, body: T.CreateDelegatedRegistrationChallengeRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateDelegatedRegistrationChallengeResponse: """ Complete Create Delegated Registration Challenge. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateDelegatedRegistrationChallengeResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/registration/delegated", path_params={}, @@ -1235,23 +1193,20 @@ def create_delegated_registration_challenge_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateDelegatedRegistrationChallengeResponse, response) - def create_registration_challenge( - self, body: T.CreateRegistrationChallengeRequest - ) -> T.CreateRegistrationChallengeResponse: + def create_registration_challenge(self, body: T.CreateRegistrationChallengeRequest) -> T.CreateRegistrationChallengeResponse: """ Create Registration Challenge. Starts a user registration session. It returns a challenge that will need to be signed by a passkey and used to perform the step [Complete User Registration](/api-reference/auth/register) Args: - body: Request body. + body: Request body. Returns: T.CreateRegistrationChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/registration/init", path_params={}, @@ -1259,23 +1214,20 @@ def create_registration_challenge( body=body, requires_signature=False, ) - return cast(T.CreateRegistrationChallengeResponse, response) - def create_social_registration_challenge( - self, body: T.CreateSocialRegistrationChallengeRequest - ) -> T.CreateSocialRegistrationChallengeResponse: + def create_social_registration_challenge(self, body: T.CreateSocialRegistrationChallengeRequest) -> T.CreateSocialRegistrationChallengeResponse: """ Create Social Registration Challenge. Starts an end-user registration session by passing a JWT obtained by an IdP. It returns a challenge that will need to be signed by a passkey and used to perform [Complete End User Registration with Wallets](/api-reference/auth/register-end-user). Args: - body: Request body. + body: Request body. Returns: T.CreateSocialRegistrationChallengeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/auth/registration/social", path_params={}, @@ -1283,31 +1235,30 @@ def create_social_registration_challenge( body=body, requires_signature=False, ) - return cast(T.CreateSocialRegistrationChallengeResponse, response) def complete_user_registration(self, body: T.CompleteUserRegistrationRequest) -> T.CompleteUserRegistrationResponse: """ - Complete User Registration. + Complete User Registration. - Completes the user registration process and creates the user's initial credentials. + Completes the user registration process and creates the user's initial credentials. - All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Registration Challenge](https://docs.dfns.co/api-reference/auth/create-registration-challenge), [Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge), or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). +All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Registration Challenge](https://docs.dfns.co/api-reference/auth/create-registration-challenge), [Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge), or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). - Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). +Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). - The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: - * `Fido2`: User action is signed by a user's signing device using `WebAuthn`. - * `Key`: User action is signed by a user's, or token's, private key. - * `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. - * `RecoveryKey` : Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account not to sign an action or login. Once this credential is used all the other user's credentials are invalidated. +The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: +* `Fido2`: User action is signed by a user's signing device using `WebAuthn`. +* `Key`: User action is signed by a user's, or token's, private key. +* `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. +* `RecoveryKey` : Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account not to sign an action or login. Once this credential is used all the other user's credentials are invalidated. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CompleteUserRegistrationResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CompleteUserRegistrationResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/registration", path_params={}, @@ -1315,35 +1266,32 @@ def complete_user_registration(self, body: T.CompleteUserRegistrationRequest) -> body=body, requires_signature=False, ) - return cast(T.CompleteUserRegistrationResponse, response) - def complete_end_user_registration_with_wallets( - self, body: T.CompleteEndUserRegistrationWithWalletsRequest - ) -> T.CompleteEndUserRegistrationWithWalletsResponse: + def complete_end_user_registration_with_wallets(self, body: T.CompleteEndUserRegistrationWithWalletsRequest) -> T.CompleteEndUserRegistrationWithWalletsResponse: """ - Complete End User Registration with Wallets. + Complete End User Registration with Wallets. - Completes the end user registration process and creates the user's initial credentials along with delegated wallets for the new end user. + Completes the end user registration process and creates the user's initial credentials along with delegated wallets for the new end user. - All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge) or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). +All credentials submitted in this call (`firstFactorCredential`, `secondFactorCredential`, `recoveryCredential`) sign the same challenge returned by the registration init endpoint ([Create Delegated Registration Challenge](https://docs.dfns.co/api-reference/auth/create-delegated-registration-challenge) or [Create Social Registration Challenge](https://docs.dfns.co/api-reference/auth/create-social-registration-challenge)). - Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). +Always include a `recoveryCredential` for end users. Without one, a user who loses their device cannot recover access and you must initiate a delegated recovery manually. See [Implement end-user recovery](https://docs.dfns.co/guides/developers/end-user-recovery). - The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: - * `Fido2`: User action is signed by a user's signing device using `WebAuthn`. - * `Key`: User action is signed by a user's, or token's, private key. - * `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. - * `RecoveryKey`: Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account, not to sign an action or login. Once this credential is used, all the other user's credentials are invalidated. +The type of credentials being registered is determined by the `credentialKind` field in the nested objects (`firstFactorCredential` , `secondFactorCredential` and `recoveryCredential`). Supported credential kinds are: +* `Fido2`: User action is signed by a user's signing device using `WebAuthn`. +* `Key`: User action is signed by a user's, or token's, private key. +* `PasswordProtectedKey`: User action is signed by a user's, or token's, private key. The encrypted version of the private key is stored by Dfns and returns during the signing flow for the user to decrypt it. +* `RecoveryKey`: Similar to `PasswordProtectedKey`, but this credential can only be used to recover an account, not to sign an action or login. Once this credential is used, all the other user's credentials are invalidated. - The number of delegated wallets created and the wallet types are determined by the `wallets` specifications. The end user is automatically assigned `ManagedDefaultEndUserAccess` managed permission that grants the end user full access to the wallets. +The number of delegated wallets created and the wallet types are determined by the `wallets` specifications. The end user is automatically assigned `ManagedDefaultEndUserAccess` managed permission that grants the end user full access to the wallets. - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.CompleteEndUserRegistrationWithWalletsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CompleteEndUserRegistrationWithWalletsResponse: The API response. + """ + return self._http.request( method="POST", path="/auth/registration/enduser", path_params={}, @@ -1351,7 +1299,6 @@ def complete_end_user_registration_with_wallets( body=body, requires_signature=False, ) - return cast(T.CompleteEndUserRegistrationWithWalletsResponse, response) def resend_registration_code(self, body: T.ResendRegistrationCodeRequest) -> T.ResendRegistrationCodeResponse: """ @@ -1360,12 +1307,12 @@ def resend_registration_code(self, body: T.ResendRegistrationCodeRequest) -> T.R Sends the user a new registration code. The previous registration code will be marked invalid. If the user has already completed their registration no action will be taken. Args: - body: Request body. + body: Request body. Returns: T.ResendRegistrationCodeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/auth/registration/code", path_params={}, @@ -1373,7 +1320,6 @@ def resend_registration_code(self, body: T.ResendRegistrationCodeRequest) -> T.R body=body, requires_signature=False, ) - return cast(T.ResendRegistrationCodeResponse, response) def list_service_accounts(self) -> T.ListServiceAccountsResponse: """ @@ -1383,8 +1329,8 @@ def list_service_accounts(self) -> T.ListServiceAccountsResponse: Returns: T.ListServiceAccountsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/service-accounts", path_params={}, @@ -1392,7 +1338,6 @@ def list_service_accounts(self) -> T.ListServiceAccountsResponse: body=None, requires_signature=False, ) - return cast(T.ListServiceAccountsResponse, response) def create_service_account_init(self, body: T.CreateServiceAccountRequest) -> UserActionChallengeResponse: """ @@ -1401,11 +1346,11 @@ def create_service_account_init(self, body: T.CreateServiceAccountRequest) -> Us Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/service-accounts" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1416,25 +1361,25 @@ def create_service_account_init(self, body: T.CreateServiceAccountRequest) -> Us user_action_payload=payload, ) - def create_service_account_complete( - self, body: T.CreateServiceAccountRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateServiceAccountResponse: + def create_service_account_complete(self, body: T.CreateServiceAccountRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateServiceAccountResponse: """ Complete Create Service Account. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateServiceAccountResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/service-accounts", path_params={}, @@ -1442,7 +1387,6 @@ def create_service_account_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateServiceAccountResponse, response) def get_service_account(self, service_account_id: str) -> T.GetServiceAccountResponse: """ @@ -1451,12 +1395,12 @@ def get_service_account(self, service_account_id: str) -> T.GetServiceAccountRes Get information about a specific Service Account. Args: - service_account_id: ID of the service account. + service_account_id: ID of the service account. Returns: T.GetServiceAccountResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/service-accounts/{serviceAccountId}", path_params={"serviceAccountId": service_account_id}, @@ -1464,23 +1408,20 @@ def get_service_account(self, service_account_id: str) -> T.GetServiceAccountRes body=None, requires_signature=False, ) - return cast(T.GetServiceAccountResponse, response) - def update_service_account_init( - self, service_account_id: str, body: T.UpdateServiceAccountRequest - ) -> UserActionChallengeResponse: + def update_service_account_init(self, service_account_id: str, body: T.UpdateServiceAccountRequest) -> UserActionChallengeResponse: """ Initialize Update Service Account. Creates a user action challenge for external signing. Args: - service_account_id: ID of the service account. - body: Request body. + service_account_id: ID of the service account. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/service-accounts/{serviceAccountId}" path = path.replace("{serviceAccountId}", str(service_account_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1492,29 +1433,26 @@ def update_service_account_init( user_action_payload=payload, ) - def update_service_account_complete( - self, - service_account_id: str, - body: T.UpdateServiceAccountRequest, - signed_challenge: SignUserActionChallengeRequest, - ) -> T.UpdateServiceAccountResponse: + def update_service_account_complete(self, service_account_id: str, body: T.UpdateServiceAccountRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdateServiceAccountResponse: """ Complete Update Service Account. Submits the signed challenge and makes the API request. Args: - service_account_id: ID of the service account. - body: Request body. - signed_challenge: The signed challenge from external signing. + service_account_id: ID of the service account. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdateServiceAccountResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/service-accounts/{serviceAccountId}", path_params={"serviceAccountId": service_account_id}, @@ -1522,23 +1460,20 @@ def update_service_account_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdateServiceAccountResponse, response) - def delete_service_account_init( - self, service_account_id: str, query: T.DeleteServiceAccountQuery | None = None - ) -> UserActionChallengeResponse: + def delete_service_account_init(self, service_account_id: str, query: Optional[T.DeleteServiceAccountQuery] = None) -> UserActionChallengeResponse: """ Initialize Delete Service Account. Creates a user action challenge for external signing. Args: - service_account_id: ID of the service account. - query: Query parameters. + service_account_id: ID of the service account. + query: Query parameters. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/service-accounts/{serviceAccountId}" path = path.replace("{serviceAccountId}", str(service_account_id)) payload = "" @@ -1550,29 +1485,26 @@ def delete_service_account_init( user_action_payload=payload, ) - def delete_service_account_complete( - self, - service_account_id: str, - signed_challenge: SignUserActionChallengeRequest, - query: T.DeleteServiceAccountQuery | None = None, - ) -> T.DeleteServiceAccountResponse: + def delete_service_account_complete(self, service_account_id: str, signed_challenge: SignUserActionChallengeRequest, query: Optional[T.DeleteServiceAccountQuery] = None) -> T.DeleteServiceAccountResponse: """ Complete Delete Service Account. Submits the signed challenge and makes the API request. Args: - service_account_id: ID of the service account. - signed_challenge: The signed challenge from external signing. - query: Query parameters. + service_account_id: ID of the service account. + signed_challenge: The signed challenge from external signing. + query: Query parameters. Returns: T.DeleteServiceAccountResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/auth/service-accounts/{serviceAccountId}", path_params={"serviceAccountId": service_account_id}, @@ -1580,7 +1512,6 @@ def delete_service_account_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteServiceAccountResponse, response) def activate_service_account_init(self, service_account_id: str) -> UserActionChallengeResponse: """ @@ -1589,11 +1520,11 @@ def activate_service_account_init(self, service_account_id: str) -> UserActionCh Creates a user action challenge for external signing. Args: - service_account_id: ID of the service account. + service_account_id: ID of the service account. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/service-accounts/{serviceAccountId}/activate" path = path.replace("{serviceAccountId}", str(service_account_id)) payload = "" @@ -1605,25 +1536,25 @@ def activate_service_account_init(self, service_account_id: str) -> UserActionCh user_action_payload=payload, ) - def activate_service_account_complete( - self, service_account_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.ActivateServiceAccountResponse: + def activate_service_account_complete(self, service_account_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.ActivateServiceAccountResponse: """ Complete Activate Service Account. Submits the signed challenge and makes the API request. Args: - service_account_id: ID of the service account. - signed_challenge: The signed challenge from external signing. + service_account_id: ID of the service account. + signed_challenge: The signed challenge from external signing. Returns: T.ActivateServiceAccountResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/service-accounts/{serviceAccountId}/activate", path_params={"serviceAccountId": service_account_id}, @@ -1631,23 +1562,20 @@ def activate_service_account_complete( body=None, user_action=user_action_token, ) - return cast(T.ActivateServiceAccountResponse, response) - def deactivate_service_account_init( - self, service_account_id: str, body: T.DeactivateServiceAccountRequest - ) -> UserActionChallengeResponse: + def deactivate_service_account_init(self, service_account_id: str, body: T.DeactivateServiceAccountRequest) -> UserActionChallengeResponse: """ Initialize Deactivate Service Account. Creates a user action challenge for external signing. Args: - service_account_id: ID of the service account. - body: Request body. + service_account_id: ID of the service account. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/service-accounts/{serviceAccountId}/deactivate" path = path.replace("{serviceAccountId}", str(service_account_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1659,29 +1587,26 @@ def deactivate_service_account_init( user_action_payload=payload, ) - def deactivate_service_account_complete( - self, - service_account_id: str, - body: T.DeactivateServiceAccountRequest, - signed_challenge: SignUserActionChallengeRequest, - ) -> T.DeactivateServiceAccountResponse: + def deactivate_service_account_complete(self, service_account_id: str, body: T.DeactivateServiceAccountRequest, signed_challenge: SignUserActionChallengeRequest) -> T.DeactivateServiceAccountResponse: """ Complete Deactivate Service Account. Submits the signed challenge and makes the API request. Args: - service_account_id: ID of the service account. - body: Request body. - signed_challenge: The signed challenge from external signing. + service_account_id: ID of the service account. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.DeactivateServiceAccountResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/service-accounts/{serviceAccountId}/deactivate", path_params={"serviceAccountId": service_account_id}, @@ -1689,7 +1614,6 @@ def deactivate_service_account_complete( body=body, user_action=user_action_token, ) - return cast(T.DeactivateServiceAccountResponse, response) def activate_user_init(self, user_id: str) -> UserActionChallengeResponse: """ @@ -1698,11 +1622,11 @@ def activate_user_init(self, user_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - user_id: User id. + user_id: User id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/users/{userId}/activate" path = path.replace("{userId}", str(user_id)) payload = "" @@ -1714,25 +1638,25 @@ def activate_user_init(self, user_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def activate_user_complete( - self, user_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.ActivateUserResponse: + def activate_user_complete(self, user_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.ActivateUserResponse: """ Complete Activate User. Submits the signed challenge and makes the API request. Args: - user_id: User id. - signed_challenge: The signed challenge from external signing. + user_id: User id. + signed_challenge: The signed challenge from external signing. Returns: T.ActivateUserResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/users/{userId}/activate", path_params={"userId": user_id}, @@ -1740,7 +1664,6 @@ def activate_user_complete( body=None, user_action=user_action_token, ) - return cast(T.ActivateUserResponse, response) def deactivate_user_init(self, user_id: str) -> UserActionChallengeResponse: """ @@ -1749,11 +1672,11 @@ def deactivate_user_init(self, user_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - user_id: User id. + user_id: User id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/users/{userId}/deactivate" path = path.replace("{userId}", str(user_id)) payload = "" @@ -1765,25 +1688,25 @@ def deactivate_user_init(self, user_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def deactivate_user_complete( - self, user_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeactivateUserResponse: + def deactivate_user_complete(self, user_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeactivateUserResponse: """ Complete Deactivate User. Submits the signed challenge and makes the API request. Args: - user_id: User id. - signed_challenge: The signed challenge from external signing. + user_id: User id. + signed_challenge: The signed challenge from external signing. Returns: T.DeactivateUserResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/users/{userId}/deactivate", path_params={"userId": user_id}, @@ -1791,7 +1714,6 @@ def deactivate_user_complete( body=None, user_action=user_action_token, ) - return cast(T.DeactivateUserResponse, response) def get_user(self, user_id: str) -> T.GetUserResponse: """ @@ -1800,12 +1722,12 @@ def get_user(self, user_id: str) -> T.GetUserResponse: Retrieve information about a specific User. Args: - user_id: User id. + user_id: User id. Returns: T.GetUserResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/users/{userId}", path_params={"userId": user_id}, @@ -1813,7 +1735,6 @@ def get_user(self, user_id: str) -> T.GetUserResponse: body=None, requires_signature=False, ) - return cast(T.GetUserResponse, response) def update_user_init(self, user_id: str, body: T.UpdateUserRequest) -> UserActionChallengeResponse: """ @@ -1822,12 +1743,12 @@ def update_user_init(self, user_id: str, body: T.UpdateUserRequest) -> UserActio Creates a user action challenge for external signing. Args: - user_id: User id. - body: Request body. + user_id: User id. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/users/{userId}" path = path.replace("{userId}", str(user_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1839,26 +1760,26 @@ def update_user_init(self, user_id: str, body: T.UpdateUserRequest) -> UserActio user_action_payload=payload, ) - def update_user_complete( - self, user_id: str, body: T.UpdateUserRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UpdateUserResponse: + def update_user_complete(self, user_id: str, body: T.UpdateUserRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdateUserResponse: """ Complete Update User. Submits the signed challenge and makes the API request. Args: - user_id: User id. - body: Request body. - signed_challenge: The signed challenge from external signing. + user_id: User id. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdateUserResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/auth/users/{userId}", path_params={"userId": user_id}, @@ -1866,7 +1787,6 @@ def update_user_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdateUserResponse, response) def delete_user_init(self, user_id: str) -> UserActionChallengeResponse: """ @@ -1875,11 +1795,11 @@ def delete_user_init(self, user_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - user_id: User id. + user_id: User id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/users/{userId}" path = path.replace("{userId}", str(user_id)) payload = "" @@ -1891,25 +1811,25 @@ def delete_user_init(self, user_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def delete_user_complete( - self, user_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeleteUserResponse: + def delete_user_complete(self, user_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeleteUserResponse: """ Complete Delete User. Submits the signed challenge and makes the API request. Args: - user_id: User id. - signed_challenge: The signed challenge from external signing. + user_id: User id. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteUserResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/auth/users/{userId}", path_params={"userId": user_id}, @@ -1917,21 +1837,20 @@ def delete_user_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteUserResponse, response) - def list_users(self, query: T.ListUsersQuery | None = None) -> T.ListUsersResponse: + def list_users(self, query: Optional[T.ListUsersQuery] = None) -> T.ListUsersResponse: """ List Users. List all Users in your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListUsersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/auth/users", path_params={}, @@ -1939,7 +1858,6 @@ def list_users(self, query: T.ListUsersQuery | None = None) -> T.ListUsersRespon body=None, requires_signature=False, ) - return cast(T.ListUsersResponse, response) def create_user_init(self, body: T.CreateUserRequest) -> UserActionChallengeResponse: """ @@ -1948,11 +1866,11 @@ def create_user_init(self, body: T.CreateUserRequest) -> UserActionChallengeResp Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/users" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -1963,25 +1881,25 @@ def create_user_init(self, body: T.CreateUserRequest) -> UserActionChallengeResp user_action_payload=payload, ) - def create_user_complete( - self, body: T.CreateUserRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateUserResponse: + def create_user_complete(self, body: T.CreateUserRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateUserResponse: """ Complete Create User. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateUserResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/users", path_params={}, @@ -1989,20 +1907,19 @@ def create_user_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateUserResponse, response) - def invite_tenant_user_init(self, body: T.InviteTenantUserRequest) -> UserActionChallengeResponse: + def invite_account_user_init(self, body: T.InviteAccountUserRequest) -> UserActionChallengeResponse: """ - Initialize Invite Tenant User. + Initialize Invite Account User. Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/auth/users/invite" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -2013,25 +1930,25 @@ def invite_tenant_user_init(self, body: T.InviteTenantUserRequest) -> UserAction user_action_payload=payload, ) - def invite_tenant_user_complete( - self, body: T.InviteTenantUserRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.InviteTenantUserResponse: + def invite_account_user_complete(self, body: T.InviteAccountUserRequest, signed_challenge: SignUserActionChallengeRequest) -> T.InviteAccountUserResponse: """ - Complete Invite Tenant User. + Complete Invite Account User. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: - T.InviteTenantUserResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + T.InviteAccountUserResponse: The API response. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/auth/users/invite", path_params={}, @@ -2039,4 +1956,3 @@ def invite_tenant_user_complete( body=body, user_action=user_action_token, ) - return cast(T.InviteTenantUserResponse, response) diff --git a/dfns_sdk/generated/auth/types.py b/dfns_sdk/generated/auth/types.py index c6113f0..4f5432a 100644 --- a/dfns_sdk/generated/auth/types.py +++ b/dfns_sdk/generated/auth/types.py @@ -1,24 +1,19 @@ """Types for the auth domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class CreateUserActionSignatureRequest(TypedDict, total=False): """createUserActionSignature request body.""" challenge_identifier: str - first_factor: dict[str, Any] - second_factor: NotRequired[dict[str, Any]] - + first_factor: TypedDict + second_factor: NotRequired[TypedDict] class CreateUserActionSignatureResponse(TypedDict, total=False): """createUserActionSignature response.""" user_action: str - class CreateUserActionChallengeRequest(TypedDict, total=False): """createUserActionChallenge request body.""" @@ -27,20 +22,18 @@ class CreateUserActionChallengeRequest(TypedDict, total=False): user_action_http_path: str user_action_payload: str - class CreateUserActionChallengeResponse(TypedDict, total=False): """createUserActionChallenge response.""" challenge: str challenge_identifier: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: list[dict[str, Any]] + rp: NotRequired[TypedDict] + supported_credential_kinds: list[TypedDict] user_verification: Literal["required", "preferred", "discouraged"] attestation: Literal["none", "indirect", "direct", "enterprise"] - allow_credentials: dict[str, Any] + allow_credentials: TypedDict external_authentication_url: str - class ListAuditLogsQuery(TypedDict, total=False): """listAuditLogs query parameters.""" @@ -48,7 +41,6 @@ class ListAuditLogsQuery(TypedDict, total=False): end_time: str user_id: NotRequired[str] - class GetAuditLogResponse(TypedDict, total=False): """getAuditLog response.""" @@ -58,14 +50,12 @@ class GetAuditLogResponse(TypedDict, total=False): user_id: Any username: Any date_performed: str - first_factor_credential: dict[str, Any] - + first_factor_credential: TypedDict class ListApplicationsResponse(TypedDict, total=False): """listApplications response.""" - items: list[dict[str, Any]] - + items: list[TypedDict] class GetApplicationResponse(TypedDict, total=False): """getApplication response.""" @@ -77,15 +67,13 @@ class GetApplicationResponse(TypedDict, total=False): name: str is_active: bool expected_origin: NotRequired[str] - permission_assignments: list[dict[str, Any]] - access_tokens: list[dict[str, Any]] - + permission_assignments: list[TypedDict] + access_tokens: list[TypedDict] class ListCredentialsResponse(TypedDict, total=False): """listCredentials response.""" - items: list[dict[str, Any]] - + items: list[TypedDict] class CreateCredentialResponse(TypedDict, total=False): """createCredential response.""" @@ -100,48 +88,40 @@ class CreateCredentialResponse(TypedDict, total=False): relying_party_id: str origin: str - class CreateCredentialChallengeRequest(TypedDict, total=False): """createCredentialChallenge request body.""" kind: Literal["Fido2", "Key", "RecoveryKey", "PasswordProtectedKey"] - class ActivateCredentialRequest(TypedDict, total=False): """activateCredential request body.""" credential_uuid: str - class ActivateCredentialResponse(TypedDict, total=False): """activateCredential response.""" message: str - class DeleteCredentialResponse(TypedDict, total=False): """deleteCredential response.""" pass - class DeactivateCredentialRequest(TypedDict, total=False): """deactivateCredential request body.""" credential_uuid: str - class DeactivateCredentialResponse(TypedDict, total=False): """deactivateCredential response.""" message: str - class CreateCredentialCodeRequest(TypedDict, total=False): """createCredentialCode request body.""" - expiration: str | int - + expiration: Union[str, int] class CreateCredentialCodeResponse(TypedDict, total=False): """createCredentialCode response.""" @@ -149,14 +129,12 @@ class CreateCredentialCodeResponse(TypedDict, total=False): code: str expiration: str - class CreateCredentialChallengeWithCodeRequest(TypedDict, total=False): """createCredentialChallengeWithCode request body.""" credential_kind: Literal["Fido2", "Key", "Password", "Totp", "RecoveryKey", "PasswordProtectedKey"] code: str - class CreateCredentialWithCodeResponse(TypedDict, total=False): """createCredentialWithCode response.""" @@ -170,75 +148,65 @@ class CreateCredentialWithCodeResponse(TypedDict, total=False): relying_party_id: str origin: str - class CreateLoginChallengeRequest(TypedDict, total=False): """createLoginChallenge request body.""" username: NotRequired[str] org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] login_code: NotRequired[str] - class CreateLoginChallengeResponse(TypedDict, total=False): """createLoginChallenge response.""" challenge: str challenge_identifier: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: list[dict[str, Any]] + rp: NotRequired[TypedDict] + supported_credential_kinds: list[TypedDict] user_verification: Literal["required", "preferred", "discouraged"] attestation: Literal["none", "indirect", "direct", "enterprise"] - allow_credentials: dict[str, Any] + allow_credentials: TypedDict external_authentication_url: str - class DelegatedLoginRequest(TypedDict, total=False): """delegatedLogin request body.""" username: str - class DelegatedLoginResponse(TypedDict, total=False): """delegatedLogin response.""" token: str - class CompleteUserLoginRequest(TypedDict, total=False): """completeUserLogin request body.""" challenge_identifier: str - first_factor: dict[str, Any] - second_factor: NotRequired[dict[str, Any]] - + first_factor: TypedDict + second_factor: NotRequired[TypedDict] class LogoutRequest(TypedDict, total=False): """logout request body.""" all_sessions: NotRequired[bool] - class LogoutResponse(TypedDict, total=False): """logout response.""" message: str - class SendLoginCodeRequest(TypedDict, total=False): """sendLoginCode request body.""" username: str org_id: NotRequired[str] - tenant_id: NotRequired[str] - + account_id: NotRequired[str] class SendLoginCodeResponse(TypedDict, total=False): """sendLoginCode response.""" message: str - class SocialLoginRequest(TypedDict, total=False): """socialLogin request body.""" @@ -246,26 +214,22 @@ class SocialLoginRequest(TypedDict, total=False): social_login_provider_kind: Literal["Oidc"] id_token: str - class SocialLoginResponse(TypedDict, total=False): """socialLogin response.""" token: str - class CompleteSsoLoginRequest(TypedDict, total=False): """completeSsoLogin request body.""" code: str state: str - class CompleteSsoLoginResponse(TypedDict, total=False): """completeSsoLogin response.""" token: str - class InitiateSsoLoginRequest(TypedDict, total=False): """initiateSsoLogin request body.""" @@ -273,30 +237,25 @@ class InitiateSsoLoginRequest(TypedDict, total=False): client_id: str redirect_uri: str - class InitiateSsoLoginResponse(TypedDict, total=False): """initiateSsoLogin response.""" sso_redirect_url: str - class ExchangeAccessTokenRequest(TypedDict, total=False): """exchangeAccessToken request body.""" target: str - class ExchangeAccessTokenResponse(TypedDict, total=False): """exchangeAccessToken response.""" token: str - class ListPersonalAccessTokensResponse(TypedDict, total=False): """listPersonalAccessTokens response.""" - items: list[dict[str, Any]] - + items: list[TypedDict] class CreatePersonalAccessTokenRequest(TypedDict, total=False): """createPersonalAccessToken request body.""" @@ -308,7 +267,6 @@ class CreatePersonalAccessTokenRequest(TypedDict, total=False): days_valid: NotRequired[int] seconds_valid: NotRequired[int] - class CreatePersonalAccessTokenResponse(TypedDict, total=False): """createPersonalAccessToken response.""" @@ -323,8 +281,7 @@ class CreatePersonalAccessTokenResponse(TypedDict, total=False): org_id: str public_key: str token_id: str - permission_assignments: list[dict[str, Any]] - + permission_assignments: list[TypedDict] class GetPersonalAccessTokenResponse(TypedDict, total=False): """getPersonalAccessToken response.""" @@ -338,18 +295,16 @@ class GetPersonalAccessTokenResponse(TypedDict, total=False): linked_app_id: str name: str org_id: str - permission_assignments: list[dict[str, Any]] + permission_assignments: list[TypedDict] public_key: str token_id: str - class UpdatePersonalAccessTokenRequest(TypedDict, total=False): """updatePersonalAccessToken request body.""" name: NotRequired[str] external_id: NotRequired[str] - class UpdatePersonalAccessTokenResponse(TypedDict, total=False): """updatePersonalAccessToken response.""" @@ -362,11 +317,10 @@ class UpdatePersonalAccessTokenResponse(TypedDict, total=False): linked_app_id: str name: str org_id: str - permission_assignments: list[dict[str, Any]] + permission_assignments: list[TypedDict] public_key: str token_id: str - class DeletePersonalAccessTokenResponse(TypedDict, total=False): """deletePersonalAccessToken response.""" @@ -379,11 +333,10 @@ class DeletePersonalAccessTokenResponse(TypedDict, total=False): linked_app_id: str name: str org_id: str - permission_assignments: list[dict[str, Any]] + permission_assignments: list[TypedDict] public_key: str token_id: str - class ActivatePersonalAccessTokenResponse(TypedDict, total=False): """activatePersonalAccessToken response.""" @@ -396,11 +349,10 @@ class ActivatePersonalAccessTokenResponse(TypedDict, total=False): linked_app_id: str name: str org_id: str - permission_assignments: list[dict[str, Any]] + permission_assignments: list[TypedDict] public_key: str token_id: str - class DeactivatePersonalAccessTokenResponse(TypedDict, total=False): """deactivatePersonalAccessToken response.""" @@ -413,47 +365,42 @@ class DeactivatePersonalAccessTokenResponse(TypedDict, total=False): linked_app_id: str name: str org_id: str - permission_assignments: list[dict[str, Any]] + permission_assignments: list[TypedDict] public_key: str token_id: str - class CreateDelegatedRecoveryChallengeRequest(TypedDict, total=False): """createDelegatedRecoveryChallenge request body.""" username: str credential_id: str - class CreateDelegatedRecoveryChallengeResponse(TypedDict, total=False): """createDelegatedRecoveryChallenge response.""" - user: dict[str, Any] + user: TypedDict temporary_authentication_token: str challenge: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: dict[str, Any] - authenticator_selection: dict[str, Any] + rp: NotRequired[TypedDict] + supported_credential_kinds: TypedDict + authenticator_selection: TypedDict attestation: Literal["none", "indirect", "direct", "enterprise"] - pub_key_cred_params: list[dict[str, Any]] - exclude_credentials: list[dict[str, Any]] + pub_key_cred_params: list[TypedDict] + exclude_credentials: list[TypedDict] otp_url: str - allowed_recovery_credentials: list[dict[str, Any]] - + allowed_recovery_credentials: list[TypedDict] class RecoverUserRequest(TypedDict, total=False): """recoverUser request body.""" - recovery: dict[str, Any] - new_credentials: dict[str, Any] - + recovery: TypedDict + new_credentials: TypedDict class RecoverUserResponse(TypedDict, total=False): """recoverUser response.""" - credential: dict[str, Any] - user: dict[str, Any] - + credential: TypedDict + user: TypedDict class CreateRecoveryChallengeRequest(TypedDict, total=False): """createRecoveryChallenge request body.""" @@ -461,40 +408,36 @@ class CreateRecoveryChallengeRequest(TypedDict, total=False): username: str verification_code: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] credential_id: str - class CreateRecoveryChallengeResponse(TypedDict, total=False): """createRecoveryChallenge response.""" - user: dict[str, Any] + user: TypedDict temporary_authentication_token: str challenge: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: dict[str, Any] - authenticator_selection: dict[str, Any] + rp: NotRequired[TypedDict] + supported_credential_kinds: TypedDict + authenticator_selection: TypedDict attestation: Literal["none", "indirect", "direct", "enterprise"] - pub_key_cred_params: list[dict[str, Any]] - exclude_credentials: list[dict[str, Any]] + pub_key_cred_params: list[TypedDict] + exclude_credentials: list[TypedDict] otp_url: str - allowed_recovery_credentials: list[dict[str, Any]] - + allowed_recovery_credentials: list[TypedDict] class SendRecoveryCodeEmailRequest(TypedDict, total=False): """sendRecoveryCodeEmail request body.""" username: str org_id: NotRequired[str] - tenant_id: NotRequired[str] - + account_id: NotRequired[str] class SendRecoveryCodeEmailResponse(TypedDict, total=False): """sendRecoveryCodeEmail response.""" message: str - class CreateDelegatedRegistrationChallengeRequest(TypedDict, total=False): """createDelegatedRegistrationChallenge request body.""" @@ -502,46 +445,42 @@ class CreateDelegatedRegistrationChallengeRequest(TypedDict, total=False): kind: Literal["EndUser"] external_id: NotRequired[str] - class CreateDelegatedRegistrationChallengeResponse(TypedDict, total=False): """createDelegatedRegistrationChallenge response.""" - user: dict[str, Any] + user: TypedDict temporary_authentication_token: str challenge: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: dict[str, Any] - authenticator_selection: dict[str, Any] + rp: NotRequired[TypedDict] + supported_credential_kinds: TypedDict + authenticator_selection: TypedDict attestation: Literal["none", "indirect", "direct", "enterprise"] - pub_key_cred_params: list[dict[str, Any]] - exclude_credentials: list[dict[str, Any]] + pub_key_cred_params: list[TypedDict] + exclude_credentials: list[TypedDict] otp_url: str - class CreateRegistrationChallengeRequest(TypedDict, total=False): """createRegistrationChallenge request body.""" org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] username: str registration_code: str - class CreateRegistrationChallengeResponse(TypedDict, total=False): """createRegistrationChallenge response.""" - user: dict[str, Any] + user: TypedDict temporary_authentication_token: str challenge: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: dict[str, Any] - authenticator_selection: dict[str, Any] + rp: NotRequired[TypedDict] + supported_credential_kinds: TypedDict + authenticator_selection: TypedDict attestation: Literal["none", "indirect", "direct", "enterprise"] - pub_key_cred_params: list[dict[str, Any]] - exclude_credentials: list[dict[str, Any]] + pub_key_cred_params: list[TypedDict] + exclude_credentials: list[TypedDict] otp_url: str - class CreateSocialRegistrationChallengeRequest(TypedDict, total=False): """createSocialRegistrationChallenge request body.""" @@ -549,74 +488,65 @@ class CreateSocialRegistrationChallengeRequest(TypedDict, total=False): social_login_provider_kind: Literal["Oidc"] id_token: str - class CreateSocialRegistrationChallengeResponse(TypedDict, total=False): """createSocialRegistrationChallenge response.""" - user: dict[str, Any] + user: TypedDict temporary_authentication_token: str challenge: str - rp: NotRequired[dict[str, Any]] - supported_credential_kinds: dict[str, Any] - authenticator_selection: dict[str, Any] + rp: NotRequired[TypedDict] + supported_credential_kinds: TypedDict + authenticator_selection: TypedDict attestation: Literal["none", "indirect", "direct", "enterprise"] - pub_key_cred_params: list[dict[str, Any]] - exclude_credentials: list[dict[str, Any]] + pub_key_cred_params: list[TypedDict] + exclude_credentials: list[TypedDict] otp_url: str - class CompleteUserRegistrationRequest(TypedDict, total=False): """completeUserRegistration request body.""" - first_factor_credential: dict[str, Any] - second_factor_credential: NotRequired[dict[str, Any]] - recovery_credential: NotRequired[dict[str, Any]] - + first_factor_credential: TypedDict + second_factor_credential: NotRequired[TypedDict] + recovery_credential: NotRequired[TypedDict] class CompleteUserRegistrationResponse(TypedDict, total=False): """completeUserRegistration response.""" - credential: dict[str, Any] - user: dict[str, Any] - + credential: TypedDict + user: TypedDict class CompleteEndUserRegistrationWithWalletsRequest(TypedDict, total=False): """completeEndUserRegistrationWithWallets request body.""" - first_factor_credential: dict[str, Any] - second_factor_credential: NotRequired[dict[str, Any]] - recovery_credential: NotRequired[dict[str, Any]] - wallets: list[dict[str, Any]] - + first_factor_credential: TypedDict + second_factor_credential: NotRequired[TypedDict] + recovery_credential: NotRequired[TypedDict] + wallets: list[TypedDict] class CompleteEndUserRegistrationWithWalletsResponse(TypedDict, total=False): """completeEndUserRegistrationWithWallets response.""" - credential: dict[str, Any] - user: dict[str, Any] - authentication: dict[str, Any] - wallets: list[dict[str, Any]] - + credential: TypedDict + user: TypedDict + authentication: TypedDict + wallets: list[TypedDict] class ResendRegistrationCodeRequest(TypedDict, total=False): """resendRegistrationCode request body.""" username: str org_id: NotRequired[str] - tenant_id: NotRequired[str] - + account_id: NotRequired[str] class ResendRegistrationCodeResponse(TypedDict, total=False): """resendRegistrationCode response.""" message: str - class ListServiceAccountsResponse(TypedDict, total=False): """listServiceAccounts response.""" - items: list[dict[str, Any]] - + items: list[TypedDict] class CreateServiceAccountRequest(TypedDict, total=False): """createServiceAccount request body.""" @@ -627,20 +557,17 @@ class CreateServiceAccountRequest(TypedDict, total=False): external_id: NotRequired[str] days_valid: NotRequired[int] - class CreateServiceAccountResponse(TypedDict, total=False): """createServiceAccount response.""" - user_info: dict[str, Any] - access_tokens: list[dict[str, Any]] - + user_info: TypedDict + access_tokens: list[TypedDict] class GetServiceAccountResponse(TypedDict, total=False): """getServiceAccount response.""" - user_info: dict[str, Any] - access_tokens: list[dict[str, Any]] - + user_info: TypedDict + access_tokens: list[TypedDict] class UpdateServiceAccountRequest(TypedDict, total=False): """updateServiceAccount request body.""" @@ -648,46 +575,39 @@ class UpdateServiceAccountRequest(TypedDict, total=False): name: NotRequired[str] external_id: NotRequired[str] - class UpdateServiceAccountResponse(TypedDict, total=False): """updateServiceAccount response.""" - user_info: dict[str, Any] - access_tokens: list[dict[str, Any]] - + user_info: TypedDict + access_tokens: list[TypedDict] class DeleteServiceAccountResponse(TypedDict, total=False): """deleteServiceAccount response.""" - user_info: dict[str, Any] - access_tokens: list[dict[str, Any]] - + user_info: TypedDict + access_tokens: list[TypedDict] class DeleteServiceAccountQuery(TypedDict, total=False): """deleteServiceAccount query parameters.""" force: NotRequired[Any] - class ActivateServiceAccountResponse(TypedDict, total=False): """activateServiceAccount response.""" - user_info: dict[str, Any] - access_tokens: list[dict[str, Any]] - + user_info: TypedDict + access_tokens: list[TypedDict] class DeactivateServiceAccountRequest(TypedDict, total=False): """deactivateServiceAccount request body.""" force: NotRequired[bool] - class DeactivateServiceAccountResponse(TypedDict, total=False): """deactivateServiceAccount response.""" - user_info: dict[str, Any] - access_tokens: list[dict[str, Any]] - + user_info: TypedDict + access_tokens: list[TypedDict] class ActivateUserResponse(TypedDict, total=False): """activateUser response.""" @@ -698,14 +618,13 @@ class ActivateUserResponse(TypedDict, total=False): kind: Literal["CustomerEmployee", "EndUser"] credential_uuid: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] permissions: NotRequired[list[str]] is_active: bool is_service_account: bool is_registered: bool is_s_s_o_required: bool - permission_assignments: list[dict[str, Any]] - + permission_assignments: list[TypedDict] class DeactivateUserResponse(TypedDict, total=False): """deactivateUser response.""" @@ -716,14 +635,13 @@ class DeactivateUserResponse(TypedDict, total=False): kind: Literal["CustomerEmployee", "EndUser"] credential_uuid: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] permissions: NotRequired[list[str]] is_active: bool is_service_account: bool is_registered: bool is_s_s_o_required: bool - permission_assignments: list[dict[str, Any]] - + permission_assignments: list[TypedDict] class GetUserResponse(TypedDict, total=False): """getUser response.""" @@ -734,21 +652,19 @@ class GetUserResponse(TypedDict, total=False): kind: Literal["CustomerEmployee", "EndUser"] credential_uuid: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] permissions: NotRequired[list[str]] is_active: bool is_service_account: bool is_registered: bool is_s_s_o_required: bool - permission_assignments: list[dict[str, Any]] - + permission_assignments: list[TypedDict] class UpdateUserRequest(TypedDict, total=False): """updateUser request body.""" is_s_s_o_required: bool - class UpdateUserResponse(TypedDict, total=False): """updateUser response.""" @@ -758,14 +674,13 @@ class UpdateUserResponse(TypedDict, total=False): kind: Literal["CustomerEmployee", "EndUser"] credential_uuid: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] permissions: NotRequired[list[str]] is_active: bool is_service_account: bool is_registered: bool is_s_s_o_required: bool - permission_assignments: list[dict[str, Any]] - + permission_assignments: list[TypedDict] class DeleteUserResponse(TypedDict, total=False): """deleteUser response.""" @@ -776,22 +691,20 @@ class DeleteUserResponse(TypedDict, total=False): kind: Literal["CustomerEmployee", "EndUser"] credential_uuid: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] permissions: NotRequired[list[str]] is_active: bool is_service_account: bool is_registered: bool is_s_s_o_required: bool - permission_assignments: list[dict[str, Any]] - + permission_assignments: list[TypedDict] class ListUsersResponse(TypedDict, total=False): """listUsers response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListUsersQuery(TypedDict, total=False): """listUsers query parameters.""" @@ -799,7 +712,6 @@ class ListUsersQuery(TypedDict, total=False): pagination_token: NotRequired[str] kind: NotRequired[Literal["CustomerEmployee", "EndUser"]] - class CreateUserRequest(TypedDict, total=False): """createUser request body.""" @@ -809,7 +721,6 @@ class CreateUserRequest(TypedDict, total=False): external_id: NotRequired[str] is_s_s_o_required: NotRequired[bool] - class CreateUserResponse(TypedDict, total=False): """createUser response.""" @@ -819,23 +730,21 @@ class CreateUserResponse(TypedDict, total=False): kind: Literal["CustomerEmployee", "EndUser"] credential_uuid: str org_id: NotRequired[str] - tenant_id: NotRequired[str] + account_id: NotRequired[str] permissions: NotRequired[list[str]] is_active: bool is_service_account: bool is_registered: bool is_s_s_o_required: bool - permission_assignments: list[dict[str, Any]] + permission_assignments: list[TypedDict] - -class InviteTenantUserRequest(TypedDict, total=False): - """inviteTenantUser request body.""" +class InviteAccountUserRequest(TypedDict, total=False): + """inviteAccountUser request body.""" email: str - kind: Literal["TenantUser"] - + kind: Literal["AccountUser"] -class InviteTenantUserResponse(TypedDict, total=False): - """inviteTenantUser response.""" +class InviteAccountUserResponse(TypedDict, total=False): + """inviteAccountUser response.""" pass diff --git a/dfns_sdk/generated/exchanges/__init__.py b/dfns_sdk/generated/exchanges/__init__.py index e730321..24a1edb 100644 --- a/dfns_sdk/generated/exchanges/__init__.py +++ b/dfns_sdk/generated/exchanges/__init__.py @@ -1,7 +1,7 @@ """Exchanges domain module.""" -from . import types from .client import ExchangesClient from .delegated_client import DelegatedExchangesClient +from . import types __all__ = ["ExchangesClient", "DelegatedExchangesClient", "types"] diff --git a/dfns_sdk/generated/exchanges/client.py b/dfns_sdk/generated/exchanges/client.py index 39d18d0..d5b7f25 100644 --- a/dfns_sdk/generated/exchanges/client.py +++ b/dfns_sdk/generated/exchanges/client.py @@ -1,6 +1,6 @@ """Client for the exchanges domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -19,12 +19,12 @@ def get_exchange(self, exchange_id: str) -> T.GetExchangeResponse: Retrieve the details of a specific exchange integration configuration. Args: - exchange_id: Path parameter. + exchange_id: Path parameter. Returns: T.GetExchangeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}", path_params={"exchangeId": exchange_id}, @@ -32,7 +32,6 @@ def get_exchange(self, exchange_id: str) -> T.GetExchangeResponse: body=None, requires_signature=False, ) - return cast(T.GetExchangeResponse, response) def delete_exchange(self, exchange_id: str) -> T.DeleteExchangeResponse: """ @@ -41,12 +40,12 @@ def delete_exchange(self, exchange_id: str) -> T.DeleteExchangeResponse: Delete the exchange configuration from your organization. Args: - exchange_id: Path parameter. + exchange_id: Path parameter. Returns: T.DeleteExchangeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/exchanges/{exchangeId}", path_params={"exchangeId": exchange_id}, @@ -54,21 +53,20 @@ def delete_exchange(self, exchange_id: str) -> T.DeleteExchangeResponse: body=None, requires_signature=True, ) - return cast(T.DeleteExchangeResponse, response) - def list_exchanges(self, query: T.ListExchangesQuery | None = None) -> T.ListExchangesResponse: + def list_exchanges(self, query: Optional[T.ListExchangesQuery] = None) -> T.ListExchangesResponse: """ List Exchanges. List all configured exchange integrations. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListExchangesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges", path_params={}, @@ -76,7 +74,6 @@ def list_exchanges(self, query: T.ListExchangesQuery | None = None) -> T.ListExc body=None, requires_signature=False, ) - return cast(T.ListExchangesResponse, response) def create_exchange(self, body: T.CreateExchangeRequest) -> T.CreateExchangeResponse: """ @@ -85,12 +82,12 @@ def create_exchange(self, body: T.CreateExchangeRequest) -> T.CreateExchangeResp Link your organization with a cryptocurrency exchange. Args: - body: Request body. + body: Request body. Returns: T.CreateExchangeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/exchanges", path_params={}, @@ -98,22 +95,21 @@ def create_exchange(self, body: T.CreateExchangeRequest) -> T.CreateExchangeResp body=body, requires_signature=True, ) - return cast(T.CreateExchangeResponse, response) - def list_accounts(self, exchange_id: str, query: T.ListAccountsQuery | None = None) -> T.ListAccountsResponse: + def list_accounts(self, exchange_id: str, query: Optional[T.ListAccountsQuery] = None) -> T.ListAccountsResponse: """ List Accounts. Get a list of accounts for a specific exchange. Args: - exchange_id: Path parameter. - query: Query parameters. + exchange_id: Path parameter. + query: Query parameters. Returns: T.ListAccountsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}/accounts", path_params={"exchangeId": exchange_id}, @@ -121,25 +117,22 @@ def list_accounts(self, exchange_id: str, query: T.ListAccountsQuery | None = No body=None, requires_signature=False, ) - return cast(T.ListAccountsResponse, response) - def list_account_assets( - self, exchange_id: str, account_id: str, query: T.ListAccountAssetsQuery | None = None - ) -> T.ListAccountAssetsResponse: + def list_account_assets(self, exchange_id: str, account_id: str, query: Optional[T.ListAccountAssetsQuery] = None) -> T.ListAccountAssetsResponse: """ List Account Assets. Retrieve the list of assets for a specific account on a specific exchange. Args: - exchange_id: Path parameter. - account_id: Path parameter. - query: Query parameters. + exchange_id: Path parameter. + account_id: Path parameter. + query: Query parameters. Returns: T.ListAccountAssetsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}/accounts/{accountId}/assets", path_params={"exchangeId": exchange_id, "accountId": account_id}, @@ -147,21 +140,20 @@ def list_account_assets( body=None, requires_signature=False, ) - return cast(T.ListAccountAssetsResponse, response) - def list_asset_withdrawal_networks(self, exchange_id: str, account_id: str, asset: str) -> list[dict[str, Any]]: + def list_asset_withdrawal_networks(self, exchange_id: str, account_id: str, asset: str) -> list[TypedDict]: """ List Asset Withdrawal Networks. Args: - exchange_id: Path parameter. - account_id: Path parameter. - asset: Path parameter. + exchange_id: Path parameter. + account_id: Path parameter. + asset: Path parameter. Returns: - list[dict[str, Any]]: The API response. - """ # noqa: E501 - response = self._http.request( + list[TypedDict]: The API response. + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}/accounts/{accountId}/assets/{asset}/withdrawal-networks", path_params={"exchangeId": exchange_id, "accountId": account_id, "asset": asset}, @@ -169,25 +161,22 @@ def list_asset_withdrawal_networks(self, exchange_id: str, account_id: str, asse body=None, requires_signature=False, ) - return cast(list[dict[str, Any]], response) - def create_exchange_deposit( - self, exchange_id: str, account_id: str, body: dict[str, Any] - ) -> T.CreateExchangeDepositResponse: + def create_exchange_deposit(self, exchange_id: str, account_id: str, body: dict[str, Any]) -> T.CreateExchangeDepositResponse: """ Create Exchange Deposit. Creates a new exchange deposit transaction. Args: - exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` - account_id: Unique identifier for the account like "spot" - body: Request body. + exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` + account_id: Unique identifier for the account like "spot" + body: Request body. Returns: T.CreateExchangeDepositResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/exchanges/{exchangeId}/accounts/{accountId}/deposits", path_params={"exchangeId": exchange_id, "accountId": account_id}, @@ -195,25 +184,22 @@ def create_exchange_deposit( body=body, requires_signature=True, ) - return cast(T.CreateExchangeDepositResponse, response) - def create_exchange_withdrawal( - self, exchange_id: str, account_id: str, body: dict[str, Any] - ) -> T.CreateExchangeWithdrawalResponse: + def create_exchange_withdrawal(self, exchange_id: str, account_id: str, body: dict[str, Any]) -> T.CreateExchangeWithdrawalResponse: """ Create Exchange Withdrawal. Creates a new exchange withdrawal transaction. Args: - exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` - account_id: Unique identifier for the account like "spot" - body: Request body. + exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` + account_id: Unique identifier for the account like "spot" + body: Request body. Returns: T.CreateExchangeWithdrawalResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/exchanges/{exchangeId}/accounts/{accountId}/withdrawals", path_params={"exchangeId": exchange_id, "accountId": account_id}, @@ -221,4 +207,3 @@ def create_exchange_withdrawal( body=body, requires_signature=True, ) - return cast(T.CreateExchangeWithdrawalResponse, response) diff --git a/dfns_sdk/generated/exchanges/delegated_client.py b/dfns_sdk/generated/exchanges/delegated_client.py index ca1a18c..7164d17 100644 --- a/dfns_sdk/generated/exchanges/delegated_client.py +++ b/dfns_sdk/generated/exchanges/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the exchanges domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -26,12 +30,12 @@ def get_exchange(self, exchange_id: str) -> T.GetExchangeResponse: Retrieve the details of a specific exchange integration configuration. Args: - exchange_id: Path parameter. + exchange_id: Path parameter. Returns: T.GetExchangeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}", path_params={"exchangeId": exchange_id}, @@ -39,7 +43,6 @@ def get_exchange(self, exchange_id: str) -> T.GetExchangeResponse: body=None, requires_signature=False, ) - return cast(T.GetExchangeResponse, response) def delete_exchange_init(self, exchange_id: str) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def delete_exchange_init(self, exchange_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - exchange_id: Path parameter. + exchange_id: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/exchanges/{exchangeId}" path = path.replace("{exchangeId}", str(exchange_id)) payload = "" @@ -64,25 +67,25 @@ def delete_exchange_init(self, exchange_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def delete_exchange_complete( - self, exchange_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeleteExchangeResponse: + def delete_exchange_complete(self, exchange_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeleteExchangeResponse: """ Complete Delete Exchange. Submits the signed challenge and makes the API request. Args: - exchange_id: Path parameter. - signed_challenge: The signed challenge from external signing. + exchange_id: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteExchangeResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/exchanges/{exchangeId}", path_params={"exchangeId": exchange_id}, @@ -90,21 +93,20 @@ def delete_exchange_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteExchangeResponse, response) - def list_exchanges(self, query: T.ListExchangesQuery | None = None) -> T.ListExchangesResponse: + def list_exchanges(self, query: Optional[T.ListExchangesQuery] = None) -> T.ListExchangesResponse: """ List Exchanges. List all configured exchange integrations. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListExchangesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges", path_params={}, @@ -112,7 +114,6 @@ def list_exchanges(self, query: T.ListExchangesQuery | None = None) -> T.ListExc body=None, requires_signature=False, ) - return cast(T.ListExchangesResponse, response) def create_exchange_init(self, body: T.CreateExchangeRequest) -> UserActionChallengeResponse: """ @@ -121,11 +122,11 @@ def create_exchange_init(self, body: T.CreateExchangeRequest) -> UserActionChall Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/exchanges" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -136,25 +137,25 @@ def create_exchange_init(self, body: T.CreateExchangeRequest) -> UserActionChall user_action_payload=payload, ) - def create_exchange_complete( - self, body: T.CreateExchangeRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateExchangeResponse: + def create_exchange_complete(self, body: T.CreateExchangeRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateExchangeResponse: """ Complete Create Exchange. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateExchangeResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/exchanges", path_params={}, @@ -162,22 +163,21 @@ def create_exchange_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateExchangeResponse, response) - def list_accounts(self, exchange_id: str, query: T.ListAccountsQuery | None = None) -> T.ListAccountsResponse: + def list_accounts(self, exchange_id: str, query: Optional[T.ListAccountsQuery] = None) -> T.ListAccountsResponse: """ List Accounts. Get a list of accounts for a specific exchange. Args: - exchange_id: Path parameter. - query: Query parameters. + exchange_id: Path parameter. + query: Query parameters. Returns: T.ListAccountsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}/accounts", path_params={"exchangeId": exchange_id}, @@ -185,25 +185,22 @@ def list_accounts(self, exchange_id: str, query: T.ListAccountsQuery | None = No body=None, requires_signature=False, ) - return cast(T.ListAccountsResponse, response) - def list_account_assets( - self, exchange_id: str, account_id: str, query: T.ListAccountAssetsQuery | None = None - ) -> T.ListAccountAssetsResponse: + def list_account_assets(self, exchange_id: str, account_id: str, query: Optional[T.ListAccountAssetsQuery] = None) -> T.ListAccountAssetsResponse: """ List Account Assets. Retrieve the list of assets for a specific account on a specific exchange. Args: - exchange_id: Path parameter. - account_id: Path parameter. - query: Query parameters. + exchange_id: Path parameter. + account_id: Path parameter. + query: Query parameters. Returns: T.ListAccountAssetsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}/accounts/{accountId}/assets", path_params={"exchangeId": exchange_id, "accountId": account_id}, @@ -211,21 +208,20 @@ def list_account_assets( body=None, requires_signature=False, ) - return cast(T.ListAccountAssetsResponse, response) - def list_asset_withdrawal_networks(self, exchange_id: str, account_id: str, asset: str) -> list[dict[str, Any]]: + def list_asset_withdrawal_networks(self, exchange_id: str, account_id: str, asset: str) -> list[TypedDict]: """ List Asset Withdrawal Networks. Args: - exchange_id: Path parameter. - account_id: Path parameter. - asset: Path parameter. + exchange_id: Path parameter. + account_id: Path parameter. + asset: Path parameter. Returns: - list[dict[str, Any]]: The API response. - """ # noqa: E501 - response = self._http.request( + list[TypedDict]: The API response. + """ + return self._http.request( method="GET", path="/exchanges/{exchangeId}/accounts/{accountId}/assets/{asset}/withdrawal-networks", path_params={"exchangeId": exchange_id, "accountId": account_id, "asset": asset}, @@ -233,24 +229,21 @@ def list_asset_withdrawal_networks(self, exchange_id: str, account_id: str, asse body=None, requires_signature=False, ) - return cast(list[dict[str, Any]], response) - def create_exchange_deposit_init( - self, exchange_id: str, account_id: str, body: dict[str, Any] - ) -> UserActionChallengeResponse: + def create_exchange_deposit_init(self, exchange_id: str, account_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ Initialize Create Exchange Deposit. Creates a user action challenge for external signing. Args: - exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` - account_id: Unique identifier for the account like "spot" - body: Request body. + exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` + account_id: Unique identifier for the account like "spot" + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/exchanges/{exchangeId}/accounts/{accountId}/deposits" path = path.replace("{exchangeId}", str(exchange_id)) path = path.replace("{accountId}", str(account_id)) @@ -263,27 +256,27 @@ def create_exchange_deposit_init( user_action_payload=payload, ) - def create_exchange_deposit_complete( - self, exchange_id: str, account_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateExchangeDepositResponse: + def create_exchange_deposit_complete(self, exchange_id: str, account_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreateExchangeDepositResponse: """ Complete Create Exchange Deposit. Submits the signed challenge and makes the API request. Args: - exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` - account_id: Unique identifier for the account like "spot" - body: Request body. - signed_challenge: The signed challenge from external signing. + exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` + account_id: Unique identifier for the account like "spot" + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateExchangeDepositResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/exchanges/{exchangeId}/accounts/{accountId}/deposits", path_params={"exchangeId": exchange_id, "accountId": account_id}, @@ -291,24 +284,21 @@ def create_exchange_deposit_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateExchangeDepositResponse, response) - def create_exchange_withdrawal_init( - self, exchange_id: str, account_id: str, body: dict[str, Any] - ) -> UserActionChallengeResponse: + def create_exchange_withdrawal_init(self, exchange_id: str, account_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ Initialize Create Exchange Withdrawal. Creates a user action challenge for external signing. Args: - exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` - account_id: Unique identifier for the account like "spot" - body: Request body. + exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` + account_id: Unique identifier for the account like "spot" + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/exchanges/{exchangeId}/accounts/{accountId}/withdrawals" path = path.replace("{exchangeId}", str(exchange_id)) path = path.replace("{accountId}", str(account_id)) @@ -321,27 +311,27 @@ def create_exchange_withdrawal_init( user_action_payload=payload, ) - def create_exchange_withdrawal_complete( - self, exchange_id: str, account_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateExchangeWithdrawalResponse: + def create_exchange_withdrawal_complete(self, exchange_id: str, account_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreateExchangeWithdrawalResponse: """ Complete Create Exchange Withdrawal. Submits the signed challenge and makes the API request. Args: - exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` - account_id: Unique identifier for the account like "spot" - body: Request body. - signed_challenge: The signed challenge from external signing. + exchange_id: The exchange id obtained from the Create Exchange endpoint. Ex: `ex-1f04s-lqc9q-xxxxxxxxxxxxxxxx` + account_id: Unique identifier for the account like "spot" + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateExchangeWithdrawalResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/exchanges/{exchangeId}/accounts/{accountId}/withdrawals", path_params={"exchangeId": exchange_id, "accountId": account_id}, @@ -349,4 +339,3 @@ def create_exchange_withdrawal_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateExchangeWithdrawalResponse, response) diff --git a/dfns_sdk/generated/exchanges/types.py b/dfns_sdk/generated/exchanges/types.py index afd3d1a..ff8e4eb 100644 --- a/dfns_sdk/generated/exchanges/types.py +++ b/dfns_sdk/generated/exchanges/types.py @@ -1,9 +1,6 @@ """Types for the exchanges domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class GetExchangeResponse(TypedDict, total=False): """getExchange response.""" @@ -13,35 +10,30 @@ class GetExchangeResponse(TypedDict, total=False): kind: Literal["Binance", "Kraken", "CoinbaseApp", "CoinbasePrime"] date_created: str - class DeleteExchangeResponse(TypedDict, total=False): """deleteExchange response.""" deleted: Literal[True] - class ListExchangesResponse(TypedDict, total=False): """listExchanges response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListExchangesQuery(TypedDict, total=False): """listExchanges query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateExchangeRequest(TypedDict, total=False): """createExchange request body.""" name: NotRequired[str] kind: Literal["Binance", "Kraken", "CoinbaseApp", "CoinbasePrime"] - read_configuration: dict[str, Any] - write_configuration: dict[str, Any] - + read_configuration: TypedDict + write_configuration: TypedDict class CreateExchangeResponse(TypedDict, total=False): """createExchange response.""" @@ -51,35 +43,30 @@ class CreateExchangeResponse(TypedDict, total=False): kind: Literal["Binance", "Kraken", "CoinbaseApp", "CoinbasePrime"] date_created: str - class ListAccountsResponse(TypedDict, total=False): """listAccounts response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListAccountsQuery(TypedDict, total=False): """listAccounts query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class ListAccountAssetsResponse(TypedDict, total=False): """listAccountAssets response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListAccountAssetsQuery(TypedDict, total=False): """listAccountAssets query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateExchangeDepositResponse(TypedDict, total=False): """createExchangeDeposit response.""" @@ -90,11 +77,10 @@ class CreateExchangeDepositResponse(TypedDict, total=False): exchange_reference: NotRequired[str] kind: Literal["Withdrawal", "Deposit"] wallet_id: str - requester: dict[str, Any] - request_body: dict[str, Any] + requester: TypedDict + request_body: TypedDict date_created: str - class CreateExchangeWithdrawalResponse(TypedDict, total=False): """createExchangeWithdrawal response.""" @@ -105,6 +91,6 @@ class CreateExchangeWithdrawalResponse(TypedDict, total=False): exchange_reference: NotRequired[str] kind: Literal["Withdrawal", "Deposit"] wallet_id: str - requester: dict[str, Any] - request_body: dict[str, Any] + requester: TypedDict + request_body: TypedDict date_created: str diff --git a/dfns_sdk/generated/fee_sponsors/__init__.py b/dfns_sdk/generated/fee_sponsors/__init__.py index 85883c2..65e19bd 100644 --- a/dfns_sdk/generated/fee_sponsors/__init__.py +++ b/dfns_sdk/generated/fee_sponsors/__init__.py @@ -1,7 +1,7 @@ """FeeSponsors domain module.""" -from . import types from .client import FeeSponsorsClient from .delegated_client import DelegatedFeeSponsorsClient +from . import types __all__ = ["FeeSponsorsClient", "DelegatedFeeSponsorsClient", "types"] diff --git a/dfns_sdk/generated/fee_sponsors/client.py b/dfns_sdk/generated/fee_sponsors/client.py index 77f910c..77435f4 100644 --- a/dfns_sdk/generated/fee_sponsors/client.py +++ b/dfns_sdk/generated/fee_sponsors/client.py @@ -1,6 +1,6 @@ """Client for the fee_sponsors domain.""" -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class FeeSponsorsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_fee_sponsors(self, query: T.ListFeeSponsorsQuery | None = None) -> T.ListFeeSponsorsResponse: + def list_fee_sponsors(self, query: Optional[T.ListFeeSponsorsQuery] = None) -> T.ListFeeSponsorsResponse: """ List Fee Sponsors. Retrieves all Fee Sponsors configured in your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListFeeSponsorsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/fee-sponsors", path_params={}, @@ -32,7 +32,6 @@ def list_fee_sponsors(self, query: T.ListFeeSponsorsQuery | None = None) -> T.Li body=None, requires_signature=False, ) - return cast(T.ListFeeSponsorsResponse, response) def create_fee_sponsor(self, body: T.CreateFeeSponsorRequest) -> T.CreateFeeSponsorResponse: """ @@ -41,12 +40,12 @@ def create_fee_sponsor(self, body: T.CreateFeeSponsorRequest) -> T.CreateFeeSpon Creates a new `FeeSponsor` associated with a sponsor wallet. Returns a new fee sponsor entity with the `id` to be used when making a transfer. Args: - body: Request body. + body: Request body. Returns: T.CreateFeeSponsorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/fee-sponsors", path_params={}, @@ -54,7 +53,6 @@ def create_fee_sponsor(self, body: T.CreateFeeSponsorRequest) -> T.CreateFeeSpon body=body, requires_signature=True, ) - return cast(T.CreateFeeSponsorResponse, response) def get_fee_sponsor(self, fee_sponsor_id: str) -> T.GetFeeSponsorResponse: """ @@ -63,12 +61,12 @@ def get_fee_sponsor(self, fee_sponsor_id: str) -> T.GetFeeSponsorResponse: Retrieve a Fee Sponsor information by ID. Args: - fee_sponsor_id: Which Fee Sponsor you wish to retrieve. + fee_sponsor_id: Which Fee Sponsor you wish to retrieve. Returns: T.GetFeeSponsorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/fee-sponsors/{feeSponsorId}", path_params={"feeSponsorId": fee_sponsor_id}, @@ -76,7 +74,6 @@ def get_fee_sponsor(self, fee_sponsor_id: str) -> T.GetFeeSponsorResponse: body=None, requires_signature=False, ) - return cast(T.GetFeeSponsorResponse, response) def delete_fee_sponsor(self, fee_sponsor_id: str) -> T.DeleteFeeSponsorResponse: """ @@ -85,12 +82,12 @@ def delete_fee_sponsor(self, fee_sponsor_id: str) -> T.DeleteFeeSponsorResponse: Delete a Fee Sponsor. This action is irreversible. The fee sponsor won't be able to be used anymore when making a transfer. Args: - fee_sponsor_id: Which Fee Sponsor you wish to delete. + fee_sponsor_id: Which Fee Sponsor you wish to delete. Returns: T.DeleteFeeSponsorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/fee-sponsors/{feeSponsorId}", path_params={"feeSponsorId": fee_sponsor_id}, @@ -98,7 +95,6 @@ def delete_fee_sponsor(self, fee_sponsor_id: str) -> T.DeleteFeeSponsorResponse: body=None, requires_signature=True, ) - return cast(T.DeleteFeeSponsorResponse, response) def deactivate_fee_sponsor(self, fee_sponsor_id: str) -> T.DeactivateFeeSponsorResponse: """ @@ -107,12 +103,12 @@ def deactivate_fee_sponsor(self, fee_sponsor_id: str) -> T.DeactivateFeeSponsorR Deactivate a Fee Sponsor: The fee sponsor won't be able to be used anymore when making a transfer. Args: - fee_sponsor_id: Which Fee Sponsor you wish to deactivate. + fee_sponsor_id: Which Fee Sponsor you wish to deactivate. Returns: T.DeactivateFeeSponsorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/fee-sponsors/{feeSponsorId}/deactivate", path_params={"feeSponsorId": fee_sponsor_id}, @@ -120,7 +116,6 @@ def deactivate_fee_sponsor(self, fee_sponsor_id: str) -> T.DeactivateFeeSponsorR body=None, requires_signature=True, ) - return cast(T.DeactivateFeeSponsorResponse, response) def activate_fee_sponsor(self, fee_sponsor_id: str) -> T.ActivateFeeSponsorResponse: """ @@ -129,12 +124,12 @@ def activate_fee_sponsor(self, fee_sponsor_id: str) -> T.ActivateFeeSponsorRespo Activate a Fee Sponsor: The fee sponsor can be used when making a transfer. Args: - fee_sponsor_id: Which Fee Sponsor you wish to activate. + fee_sponsor_id: Which Fee Sponsor you wish to activate. Returns: T.ActivateFeeSponsorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/fee-sponsors/{feeSponsorId}/activate", path_params={"feeSponsorId": fee_sponsor_id}, @@ -142,24 +137,21 @@ def activate_fee_sponsor(self, fee_sponsor_id: str) -> T.ActivateFeeSponsorRespo body=None, requires_signature=True, ) - return cast(T.ActivateFeeSponsorResponse, response) - def list_sponsored_fees( - self, fee_sponsor_id: str, query: T.ListSponsoredFeesQuery | None = None - ) -> T.ListSponsoredFeesResponse: + def list_sponsored_fees(self, fee_sponsor_id: str, query: Optional[T.ListSponsoredFeesQuery] = None) -> T.ListSponsoredFeesResponse: """ List Sponsored Fees. Retrieves all fees paid by the specific Fee Sponsor. Args: - fee_sponsor_id: Fee Sponsor to retrieve the fees from. - query: Query parameters. + fee_sponsor_id: Fee Sponsor to retrieve the fees from. + query: Query parameters. Returns: T.ListSponsoredFeesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/fee-sponsors/{feeSponsorId}/fees", path_params={"feeSponsorId": fee_sponsor_id}, @@ -167,4 +159,3 @@ def list_sponsored_fees( body=None, requires_signature=False, ) - return cast(T.ListSponsoredFeesResponse, response) diff --git a/dfns_sdk/generated/fee_sponsors/delegated_client.py b/dfns_sdk/generated/fee_sponsors/delegated_client.py index f4ae08f..07c1a4a 100644 --- a/dfns_sdk/generated/fee_sponsors/delegated_client.py +++ b/dfns_sdk/generated/fee_sponsors/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the fee_sponsors domain.""" import json -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedFeeSponsorsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_fee_sponsors(self, query: T.ListFeeSponsorsQuery | None = None) -> T.ListFeeSponsorsResponse: + def list_fee_sponsors(self, query: Optional[T.ListFeeSponsorsQuery] = None) -> T.ListFeeSponsorsResponse: """ List Fee Sponsors. Retrieves all Fee Sponsors configured in your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListFeeSponsorsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/fee-sponsors", path_params={}, @@ -39,7 +43,6 @@ def list_fee_sponsors(self, query: T.ListFeeSponsorsQuery | None = None) -> T.Li body=None, requires_signature=False, ) - return cast(T.ListFeeSponsorsResponse, response) def create_fee_sponsor_init(self, body: T.CreateFeeSponsorRequest) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def create_fee_sponsor_init(self, body: T.CreateFeeSponsorRequest) -> UserAction Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/fee-sponsors" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -63,25 +66,25 @@ def create_fee_sponsor_init(self, body: T.CreateFeeSponsorRequest) -> UserAction user_action_payload=payload, ) - def create_fee_sponsor_complete( - self, body: T.CreateFeeSponsorRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateFeeSponsorResponse: + def create_fee_sponsor_complete(self, body: T.CreateFeeSponsorRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateFeeSponsorResponse: """ Complete Create Fee Sponsor. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateFeeSponsorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/fee-sponsors", path_params={}, @@ -89,7 +92,6 @@ def create_fee_sponsor_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateFeeSponsorResponse, response) def get_fee_sponsor(self, fee_sponsor_id: str) -> T.GetFeeSponsorResponse: """ @@ -98,12 +100,12 @@ def get_fee_sponsor(self, fee_sponsor_id: str) -> T.GetFeeSponsorResponse: Retrieve a Fee Sponsor information by ID. Args: - fee_sponsor_id: Which Fee Sponsor you wish to retrieve. + fee_sponsor_id: Which Fee Sponsor you wish to retrieve. Returns: T.GetFeeSponsorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/fee-sponsors/{feeSponsorId}", path_params={"feeSponsorId": fee_sponsor_id}, @@ -111,7 +113,6 @@ def get_fee_sponsor(self, fee_sponsor_id: str) -> T.GetFeeSponsorResponse: body=None, requires_signature=False, ) - return cast(T.GetFeeSponsorResponse, response) def delete_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeResponse: """ @@ -120,11 +121,11 @@ def delete_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeRes Creates a user action challenge for external signing. Args: - fee_sponsor_id: Which Fee Sponsor you wish to delete. + fee_sponsor_id: Which Fee Sponsor you wish to delete. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/fee-sponsors/{feeSponsorId}" path = path.replace("{feeSponsorId}", str(fee_sponsor_id)) payload = "" @@ -136,25 +137,25 @@ def delete_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeRes user_action_payload=payload, ) - def delete_fee_sponsor_complete( - self, fee_sponsor_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeleteFeeSponsorResponse: + def delete_fee_sponsor_complete(self, fee_sponsor_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeleteFeeSponsorResponse: """ Complete Delete Fee Sponsor. Submits the signed challenge and makes the API request. Args: - fee_sponsor_id: Which Fee Sponsor you wish to delete. - signed_challenge: The signed challenge from external signing. + fee_sponsor_id: Which Fee Sponsor you wish to delete. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteFeeSponsorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/fee-sponsors/{feeSponsorId}", path_params={"feeSponsorId": fee_sponsor_id}, @@ -162,7 +163,6 @@ def delete_fee_sponsor_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteFeeSponsorResponse, response) def deactivate_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeResponse: """ @@ -171,11 +171,11 @@ def deactivate_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChalleng Creates a user action challenge for external signing. Args: - fee_sponsor_id: Which Fee Sponsor you wish to deactivate. + fee_sponsor_id: Which Fee Sponsor you wish to deactivate. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/fee-sponsors/{feeSponsorId}/deactivate" path = path.replace("{feeSponsorId}", str(fee_sponsor_id)) payload = "" @@ -187,25 +187,25 @@ def deactivate_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChalleng user_action_payload=payload, ) - def deactivate_fee_sponsor_complete( - self, fee_sponsor_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeactivateFeeSponsorResponse: + def deactivate_fee_sponsor_complete(self, fee_sponsor_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeactivateFeeSponsorResponse: """ Complete Deactivate Fee Sponsor. Submits the signed challenge and makes the API request. Args: - fee_sponsor_id: Which Fee Sponsor you wish to deactivate. - signed_challenge: The signed challenge from external signing. + fee_sponsor_id: Which Fee Sponsor you wish to deactivate. + signed_challenge: The signed challenge from external signing. Returns: T.DeactivateFeeSponsorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/fee-sponsors/{feeSponsorId}/deactivate", path_params={"feeSponsorId": fee_sponsor_id}, @@ -213,7 +213,6 @@ def deactivate_fee_sponsor_complete( body=None, user_action=user_action_token, ) - return cast(T.DeactivateFeeSponsorResponse, response) def activate_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeResponse: """ @@ -222,11 +221,11 @@ def activate_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeR Creates a user action challenge for external signing. Args: - fee_sponsor_id: Which Fee Sponsor you wish to activate. + fee_sponsor_id: Which Fee Sponsor you wish to activate. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/fee-sponsors/{feeSponsorId}/activate" path = path.replace("{feeSponsorId}", str(fee_sponsor_id)) payload = "" @@ -238,25 +237,25 @@ def activate_fee_sponsor_init(self, fee_sponsor_id: str) -> UserActionChallengeR user_action_payload=payload, ) - def activate_fee_sponsor_complete( - self, fee_sponsor_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.ActivateFeeSponsorResponse: + def activate_fee_sponsor_complete(self, fee_sponsor_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.ActivateFeeSponsorResponse: """ Complete Activate Fee Sponsor. Submits the signed challenge and makes the API request. Args: - fee_sponsor_id: Which Fee Sponsor you wish to activate. - signed_challenge: The signed challenge from external signing. + fee_sponsor_id: Which Fee Sponsor you wish to activate. + signed_challenge: The signed challenge from external signing. Returns: T.ActivateFeeSponsorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/fee-sponsors/{feeSponsorId}/activate", path_params={"feeSponsorId": fee_sponsor_id}, @@ -264,24 +263,21 @@ def activate_fee_sponsor_complete( body=None, user_action=user_action_token, ) - return cast(T.ActivateFeeSponsorResponse, response) - def list_sponsored_fees( - self, fee_sponsor_id: str, query: T.ListSponsoredFeesQuery | None = None - ) -> T.ListSponsoredFeesResponse: + def list_sponsored_fees(self, fee_sponsor_id: str, query: Optional[T.ListSponsoredFeesQuery] = None) -> T.ListSponsoredFeesResponse: """ List Sponsored Fees. Retrieves all fees paid by the specific Fee Sponsor. Args: - fee_sponsor_id: Fee Sponsor to retrieve the fees from. - query: Query parameters. + fee_sponsor_id: Fee Sponsor to retrieve the fees from. + query: Query parameters. Returns: T.ListSponsoredFeesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/fee-sponsors/{feeSponsorId}/fees", path_params={"feeSponsorId": fee_sponsor_id}, @@ -289,4 +285,3 @@ def list_sponsored_fees( body=None, requires_signature=False, ) - return cast(T.ListSponsoredFeesResponse, response) diff --git a/dfns_sdk/generated/fee_sponsors/types.py b/dfns_sdk/generated/fee_sponsors/types.py index 8d702cc..3687b82 100644 --- a/dfns_sdk/generated/fee_sponsors/types.py +++ b/dfns_sdk/generated/fee_sponsors/types.py @@ -1,24 +1,19 @@ """Types for the fee_sponsors domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListFeeSponsorsResponse(TypedDict, total=False): """listFeeSponsors response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListFeeSponsorsQuery(TypedDict, total=False): """listFeeSponsors query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateFeeSponsorRequest(TypedDict, total=False): """createFeeSponsor request body.""" @@ -26,74 +21,67 @@ class CreateFeeSponsorRequest(TypedDict, total=False): wallet_id: str allow_end_user: NotRequired[bool] - class CreateFeeSponsorResponse(TypedDict, total=False): """createFeeSponsor response.""" id: str name: NotRequired[str] wallet_id: str - network: dict[str, Any] + network: TypedDict status: Literal["Active", "Deactivated", "Archived"] date_created: str allow_end_user: NotRequired[bool] - class GetFeeSponsorResponse(TypedDict, total=False): """getFeeSponsor response.""" id: str name: NotRequired[str] wallet_id: str - network: dict[str, Any] + network: TypedDict status: Literal["Active", "Deactivated", "Archived"] date_created: str allow_end_user: NotRequired[bool] - class DeleteFeeSponsorResponse(TypedDict, total=False): """deleteFeeSponsor response.""" id: str name: NotRequired[str] wallet_id: str - network: dict[str, Any] + network: TypedDict status: Literal["Active", "Deactivated", "Archived"] date_created: str allow_end_user: NotRequired[bool] - class DeactivateFeeSponsorResponse(TypedDict, total=False): """deactivateFeeSponsor response.""" id: str name: NotRequired[str] wallet_id: str - network: dict[str, Any] + network: TypedDict status: Literal["Active", "Deactivated", "Archived"] date_created: str allow_end_user: NotRequired[bool] - class ActivateFeeSponsorResponse(TypedDict, total=False): """activateFeeSponsor response.""" id: str name: NotRequired[str] wallet_id: str - network: dict[str, Any] + network: TypedDict status: Literal["Active", "Deactivated", "Archived"] date_created: str allow_end_user: NotRequired[bool] - class ListSponsoredFeesResponse(TypedDict, total=False): """listSponsoredFees response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListSponsoredFeesQuery(TypedDict, total=False): """listSponsoredFees query parameters.""" diff --git a/dfns_sdk/generated/keys/__init__.py b/dfns_sdk/generated/keys/__init__.py index 226ca01..6a8f153 100644 --- a/dfns_sdk/generated/keys/__init__.py +++ b/dfns_sdk/generated/keys/__init__.py @@ -1,7 +1,7 @@ """Keys domain module.""" -from . import types from .client import KeysClient from .delegated_client import DelegatedKeysClient +from . import types __all__ = ["KeysClient", "DelegatedKeysClient", "types"] diff --git a/dfns_sdk/generated/keys/client.py b/dfns_sdk/generated/keys/client.py index a9977ae..1948481 100644 --- a/dfns_sdk/generated/keys/client.py +++ b/dfns_sdk/generated/keys/client.py @@ -1,6 +1,6 @@ """Client for the keys domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class KeysClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_keys(self, query: T.ListKeysQuery | None = None) -> T.ListKeysResponse: + def list_keys(self, query: Optional[T.ListKeysQuery] = None) -> T.ListKeysResponse: """ List Keys. Retrieve all keys registered for your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListKeysResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys", path_params={}, @@ -32,7 +32,6 @@ def list_keys(self, query: T.ListKeysQuery | None = None) -> T.ListKeysResponse: body=None, requires_signature=False, ) - return cast(T.ListKeysResponse, response) def create_key(self, body: T.CreateKeyRequest) -> T.CreateKeyResponse: """ @@ -41,12 +40,12 @@ def create_key(self, body: T.CreateKeyRequest) -> T.CreateKeyResponse: Creates a key for the given scheme and curve. Returns the new key entity. Args: - body: Request body. + body: Request body. Returns: T.CreateKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/keys", path_params={}, @@ -54,34 +53,33 @@ def create_key(self, body: T.CreateKeyRequest) -> T.CreateKeyResponse: body=body, requires_signature=True, ) - return cast(T.CreateKeyResponse, response) def delegate_key(self, key_id: str, body: T.DelegateKeyRequest) -> T.DelegateKeyResponse: """ - Delegate Key. + Delegate Key. - - Only keys created with "`delayDelegation: true`" can then be delegated to an end-user. It means you need to know ahead of time that you're creating a wallet meant to be delegated to an end-user later. This is a safety to prevent, for example, a treasury wallet from being unintentionally delegated to an end-user. - + +Only keys created with "`delayDelegation: true`" can then be delegated to an end-user. It means you need to know ahead of time that you're creating a wallet meant to be delegated to an end-user later. This is a safety to prevent, for example, a treasury wallet from being unintentionally delegated to an end-user. + - - When a key is delegated to an end user, all wallets using this key as the signing key are also automatically delegated to the same end user. Key and wallet ownerships are guaranteed to be always consistent. - + +When a key is delegated to an end user, all wallets using this key as the signing key are also automatically delegated to the same end user. Key and wallet ownerships are guaranteed to be always consistent. + - - This operation is irreversible. The key ownership will be transferred to the end-user - + +This operation is irreversible. The key ownership will be transferred to the end-user + - In most cases, when you want to implement [Wallet Delegation](https://docs.dfns.co/developers/guides/wallet-delegation), simply create the wallet by directly delegating it to an end user, in which case it will the non-custodial from the start. There are some rare cases, however, where the key or wallet must be created before the user has accessed to the system. To accommodate this, we've added the ability to create a key or wallet in delay delegation mode, and then later delegate it (i.e.: transfer ownership of it) to an end user via this endpoint. +In most cases, when you want to implement [Wallet Delegation](https://docs.dfns.co/developers/guides/wallet-delegation), simply create the wallet by directly delegating it to an end user, in which case it will the non-custodial from the start. There are some rare cases, however, where the key or wallet must be created before the user has accessed to the system. To accommodate this, we've added the ability to create a key or wallet in delay delegation mode, and then later delegate it (i.e.: transfer ownership of it) to an end user via this endpoint. - Args: - key_id: Path parameter. - body: Request body. + Args: + key_id: Path parameter. + body: Request body. - Returns: - T.DelegateKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.DelegateKeyResponse: The API response. + """ + return self._http.request( method="POST", path="/keys/{keyId}/delegate", path_params={"keyId": key_id}, @@ -89,7 +87,6 @@ def delegate_key(self, key_id: str, body: T.DelegateKeyRequest) -> T.DelegateKey body=body, requires_signature=True, ) - return cast(T.DelegateKeyResponse, response) def get_key(self, key_id: str) -> T.GetKeyResponse: """ @@ -98,12 +95,12 @@ def get_key(self, key_id: str) -> T.GetKeyResponse: Retrieves a key information by its ID. Args: - key_id: The key to retrieve. + key_id: The key to retrieve. Returns: T.GetKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys/{keyId}", path_params={"keyId": key_id}, @@ -111,7 +108,6 @@ def get_key(self, key_id: str) -> T.GetKeyResponse: body=None, requires_signature=False, ) - return cast(T.GetKeyResponse, response) def update_key(self, key_id: str, body: T.UpdateKeyRequest) -> T.UpdateKeyResponse: """ @@ -120,13 +116,13 @@ def update_key(self, key_id: str, body: T.UpdateKeyRequest) -> T.UpdateKeyRespon Updates the name of an existing key. Args: - key_id: Path parameter. - body: Request body. + key_id: Path parameter. + body: Request body. Returns: T.UpdateKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/keys/{keyId}", path_params={"keyId": key_id}, @@ -134,7 +130,6 @@ def update_key(self, key_id: str, body: T.UpdateKeyRequest) -> T.UpdateKeyRespon body=body, requires_signature=True, ) - return cast(T.UpdateKeyResponse, response) def delete_key(self, key_id: str) -> T.DeleteKeyResponse: """ @@ -143,12 +138,12 @@ def delete_key(self, key_id: str) -> T.DeleteKeyResponse: Deletes the key and all wallets using this key. Once deleted, keys (and wallets) are not usable anymore, and won't count in your overall organisation wallet count. Args: - key_id: Path parameter. + key_id: Path parameter. Returns: T.DeleteKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/keys/{keyId}", path_params={"keyId": key_id}, @@ -156,28 +151,27 @@ def delete_key(self, key_id: str) -> T.DeleteKeyResponse: body=None, requires_signature=True, ) - return cast(T.DeleteKeyResponse, response) def derive_key(self, key_id: str, body: T.DeriveKeyRequest) -> T.DeriveKeyResponse: """ - Derive Key. + Derive Key. - Dfns decentralized key management network supports threshold Diffie-Hellman protocol based on [GLOW20 paper](https://eprint.iacr.org/2020/096). You can use the DH protocol to derive output from a domain separation tag and a seed value. The derivation process is deterministic, i.e. the same Diffie-Hellman key and seed will lead to the same derived output. To ensure reproducibility, we use hash to curve [RFC9380](https://www.rfc-editor.org/rfc/rfc9380.html) and standard ciphersuite `secp256k1_XMD:SHA-256_SSWU_RO_`. + Dfns decentralized key management network supports threshold Diffie-Hellman protocol based on [GLOW20 paper](https://eprint.iacr.org/2020/096). You can use the DH protocol to derive output from a domain separation tag and a seed value. The derivation process is deterministic, i.e. the same Diffie-Hellman key and seed will lead to the same derived output. To ensure reproducibility, we use hash to curve [RFC9380](https://www.rfc-editor.org/rfc/rfc9380.html) and standard ciphersuite `secp256k1_XMD:SHA-256_SSWU_RO_`. - - The seed doesn’t need to be secret. Without access to the DH key, it is not possible to do the derivation, even if the seed is known. Moreover, if both seed and derived output are known, it’s also not possible to do the derivation for another seed without having access to the DH key. - + +The seed doesn’t need to be secret. Without access to the DH key, it is not possible to do the derivation, even if the seed is known. Moreover, if both seed and derived output are known, it’s also not possible to do the derivation for another seed without having access to the DH key. + - This endpoint only supports Diffie-Hellman keys. Regular threshold signature keys, like `ECDSA` or `EdDSA`, will not work. You can create a Diffie-Hellman key with the [Create Key](https://docs.dfns.co/api-reference/keys/create-key) endpoint using `scheme=DH` and `curve=secp256k1`. +This endpoint only supports Diffie-Hellman keys. Regular threshold signature keys, like `ECDSA` or `EdDSA`, will not work. You can create a Diffie-Hellman key with the [Create Key](https://docs.dfns.co/api-reference/keys/create-key) endpoint using `scheme=DH` and `curve=secp256k1`. - Args: - key_id: Path parameter. - body: Request body. + Args: + key_id: Path parameter. + body: Request body. - Returns: - T.DeriveKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.DeriveKeyResponse: The API response. + """ + return self._http.request( method="POST", path="/keys/{keyId}/derive", path_params={"keyId": key_id}, @@ -185,28 +179,27 @@ def derive_key(self, key_id: str, body: T.DeriveKeyRequest) -> T.DeriveKeyRespon body=body, requires_signature=True, ) - return cast(T.DeriveKeyResponse, response) def export_key(self, key_id: str, body: T.ExportKeyRequest) -> T.ExportKeyResponse: """ - Export Key. + Export Key. - Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. Our goal is to eliminate all single points of failure (SPOFs) associated with blockchain private keys. + Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. Our goal is to eliminate all single points of failure (SPOFs) associated with blockchain private keys. - In certain circumstances, however, customers require Dfns to export a private key. In this case, Dfns exposes the following endpoint which can be used in conjunction with our [export SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/sdk/export-wallet). +In certain circumstances, however, customers require Dfns to export a private key. In this case, Dfns exposes the following endpoint which can be used in conjunction with our [export SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/sdk/export-wallet). - - Dfns can not guarantee the security of exported keys as we have no way to control blockchain transactions once the single point of failure has been reconstituted. For this reason, this feature is restricted to customers who have signed a contractual addendum limiting our liability for exported keys. Additionally, by default exported keys can no longer be used to sign within the Dfns platform. Please contact your sales representative for more information. - + +Dfns can not guarantee the security of exported keys as we have no way to control blockchain transactions once the single point of failure has been reconstituted. For this reason, this feature is restricted to customers who have signed a contractual addendum limiting our liability for exported keys. Additionally, by default exported keys can no longer be used to sign within the Dfns platform. Please contact your sales representative for more information. + - Args: - key_id: Path parameter. - body: Request body. + Args: + key_id: Path parameter. + body: Request body. - Returns: - T.ExportKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ExportKeyResponse: The API response. + """ + return self._http.request( method="POST", path="/keys/{keyId}/export", path_params={"keyId": key_id}, @@ -214,22 +207,21 @@ def export_key(self, key_id: str, body: T.ExportKeyRequest) -> T.ExportKeyRespon body=body, requires_signature=True, ) - return cast(T.ExportKeyResponse, response) - def list_signatures(self, key_id: str, query: T.ListSignaturesQuery | None = None) -> T.ListSignaturesResponse: + def list_signatures(self, key_id: str, query: Optional[T.ListSignaturesQuery] = None) -> T.ListSignaturesResponse: """ List Signatures. List all signature requests for a key. Args: - key_id: The key to list signatures for. - query: Query parameters. + key_id: The key to list signatures for. + query: Query parameters. Returns: T.ListSignaturesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys/{keyId}/signatures", path_params={"keyId": key_id}, @@ -237,28 +229,27 @@ def list_signatures(self, key_id: str, query: T.ListSignaturesQuery | None = Non body=None, requires_signature=False, ) - return cast(T.ListSignaturesResponse, response) def generate_signature(self, key_id: str, body: dict[str, Any]) -> T.GenerateSignatureResponse: """ - Generate Signature. + Generate Signature. - Request to generate a signature with the key. **This process does not broadcast anything on-chain**, this is just an off-chain signature request. + Request to generate a signature with the key. **This process does not broadcast anything on-chain**, this is just an off-chain signature request. - Dfns is compatible with any blockchain that uses a supported [key format](https://docs.dfns.co/networks/supported-key-formats). If Dfns doesn't officially integrate with a blockchain, you can use hash signing to generate the signatures to interact with the chain. +Dfns is compatible with any blockchain that uses a supported [key format](https://docs.dfns.co/networks/supported-key-formats). If Dfns doesn't officially integrate with a blockchain, you can use hash signing to generate the signatures to interact with the chain. - - If you were using the deprecated `POST /wallets/{walletId}/signatures` endpoint, then you should now use this one. See the [deprecation notice](https://docs.dfns.co/developers/guides/keys-and-multichain-migration-guide) to get more information about how to change your code. TL,DR: from a wallet you can obtain the key as `wallet.signingKey.id`. - + +If you were using the deprecated `POST /wallets/{walletId}/signatures` endpoint, then you should now use this one. See the [deprecation notice](https://docs.dfns.co/developers/guides/keys-and-multichain-migration-guide) to get more information about how to change your code. TL,DR: from a wallet you can obtain the key as `wallet.signingKey.id`. + - Args: - key_id: The key to sign with. - body: Request body. + Args: + key_id: The key to sign with. + body: Request body. - Returns: - T.GenerateSignatureResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GenerateSignatureResponse: The API response. + """ + return self._http.request( method="POST", path="/keys/{keyId}/signatures", path_params={"keyId": key_id}, @@ -266,7 +257,6 @@ def generate_signature(self, key_id: str, body: dict[str, Any]) -> T.GenerateSig body=body, requires_signature=True, ) - return cast(T.GenerateSignatureResponse, response) def get_signature(self, key_id: str, signature_id: str) -> T.GetSignatureResponse: """ @@ -275,13 +265,13 @@ def get_signature(self, key_id: str, signature_id: str) -> T.GetSignatureRespons Retrieve a signature request details. Args: - key_id: The key that was used for signing. - signature_id: The signature request to retrieve. + key_id: The key that was used for signing. + signature_id: The signature request to retrieve. Returns: T.GetSignatureResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys/{keyId}/signatures/{signatureId}", path_params={"keyId": key_id, "signatureId": signature_id}, @@ -289,29 +279,28 @@ def get_signature(self, key_id: str, signature_id: str) -> T.GetSignatureRespons body=None, requires_signature=False, ) - return cast(T.GetSignatureResponse, response) def import_key(self, body: T.ImportKeyRequest) -> T.ImportKeyResponse: """ - Import Key. + Import Key. - Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. This happens by default when you create a [key](https://docs.dfns.co/api-reference/keys/create-key) or [wallet](https://docs.dfns.co/api-reference/wallets/create-wallet). + Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. This happens by default when you create a [key](https://docs.dfns.co/api-reference/keys/create-key) or [wallet](https://docs.dfns.co/api-reference/wallets/create-wallet). - In some circumstances, however, you may need to import an existing private key into Dfns infrastructure, instead of creating a brand new wallet with Dfns and transfer funds to it. As an example, you might want to keep an existing wallet if its address is tied to a smart contract which you don't want to re-deploy. +In some circumstances, however, you may need to import an existing private key into Dfns infrastructure, instead of creating a brand new wallet with Dfns and transfer funds to it. As an example, you might want to keep an existing wallet if its address is tied to a smart contract which you don't want to re-deploy. - In such a case, Dfns exposes this key import API endpoint, which can be used in conjunction with our [import SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/sdk/import-wallet). Note this is intended to be used only to migrate wallets when first onboarding onto the Dfns platform. +In such a case, Dfns exposes this key import API endpoint, which can be used in conjunction with our [import SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/sdk/import-wallet). Note this is intended to be used only to migrate wallets when first onboarding onto the Dfns platform. - - Dfns can not guarantee the security of imported wallets, as we have no way to control who had access to the private key prior to import. For this reason, this feature is restricted to Enterprise customers who have signed a contractual addendum limiting our liability for imported keys. Please contact your sales representative for more information. - + +Dfns can not guarantee the security of imported wallets, as we have no way to control who had access to the private key prior to import. For this reason, this feature is restricted to Enterprise customers who have signed a contractual addendum limiting our liability for imported keys. Please contact your sales representative for more information. + - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.ImportKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ImportKeyResponse: The API response. + """ + return self._http.request( method="POST", path="/keys/import", path_params={}, @@ -319,4 +308,3 @@ def import_key(self, body: T.ImportKeyRequest) -> T.ImportKeyResponse: body=body, requires_signature=True, ) - return cast(T.ImportKeyResponse, response) diff --git a/dfns_sdk/generated/keys/delegated_client.py b/dfns_sdk/generated/keys/delegated_client.py index 0afdc74..58406a3 100644 --- a/dfns_sdk/generated/keys/delegated_client.py +++ b/dfns_sdk/generated/keys/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the keys domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedKeysClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_keys(self, query: T.ListKeysQuery | None = None) -> T.ListKeysResponse: + def list_keys(self, query: Optional[T.ListKeysQuery] = None) -> T.ListKeysResponse: """ List Keys. Retrieve all keys registered for your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListKeysResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys", path_params={}, @@ -39,7 +43,6 @@ def list_keys(self, query: T.ListKeysQuery | None = None) -> T.ListKeysResponse: body=None, requires_signature=False, ) - return cast(T.ListKeysResponse, response) def create_key_init(self, body: T.CreateKeyRequest) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def create_key_init(self, body: T.CreateKeyRequest) -> UserActionChallengeRespon Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -63,25 +66,25 @@ def create_key_init(self, body: T.CreateKeyRequest) -> UserActionChallengeRespon user_action_payload=payload, ) - def create_key_complete( - self, body: T.CreateKeyRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateKeyResponse: + def create_key_complete(self, body: T.CreateKeyRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateKeyResponse: """ Complete Create Key. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/keys", path_params={}, @@ -89,7 +92,6 @@ def create_key_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateKeyResponse, response) def delegate_key_init(self, key_id: str, body: T.DelegateKeyRequest) -> UserActionChallengeResponse: """ @@ -98,12 +100,12 @@ def delegate_key_init(self, key_id: str, body: T.DelegateKeyRequest) -> UserActi Creates a user action challenge for external signing. Args: - key_id: Path parameter. - body: Request body. + key_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/{keyId}/delegate" path = path.replace("{keyId}", str(key_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -115,26 +117,26 @@ def delegate_key_init(self, key_id: str, body: T.DelegateKeyRequest) -> UserActi user_action_payload=payload, ) - def delegate_key_complete( - self, key_id: str, body: T.DelegateKeyRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.DelegateKeyResponse: + def delegate_key_complete(self, key_id: str, body: T.DelegateKeyRequest, signed_challenge: SignUserActionChallengeRequest) -> T.DelegateKeyResponse: """ Complete Delegate Key. Submits the signed challenge and makes the API request. Args: - key_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + key_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.DelegateKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/keys/{keyId}/delegate", path_params={"keyId": key_id}, @@ -142,7 +144,6 @@ def delegate_key_complete( body=body, user_action=user_action_token, ) - return cast(T.DelegateKeyResponse, response) def get_key(self, key_id: str) -> T.GetKeyResponse: """ @@ -151,12 +152,12 @@ def get_key(self, key_id: str) -> T.GetKeyResponse: Retrieves a key information by its ID. Args: - key_id: The key to retrieve. + key_id: The key to retrieve. Returns: T.GetKeyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys/{keyId}", path_params={"keyId": key_id}, @@ -164,7 +165,6 @@ def get_key(self, key_id: str) -> T.GetKeyResponse: body=None, requires_signature=False, ) - return cast(T.GetKeyResponse, response) def update_key_init(self, key_id: str, body: T.UpdateKeyRequest) -> UserActionChallengeResponse: """ @@ -173,12 +173,12 @@ def update_key_init(self, key_id: str, body: T.UpdateKeyRequest) -> UserActionCh Creates a user action challenge for external signing. Args: - key_id: Path parameter. - body: Request body. + key_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/{keyId}" path = path.replace("{keyId}", str(key_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -190,26 +190,26 @@ def update_key_init(self, key_id: str, body: T.UpdateKeyRequest) -> UserActionCh user_action_payload=payload, ) - def update_key_complete( - self, key_id: str, body: T.UpdateKeyRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UpdateKeyResponse: + def update_key_complete(self, key_id: str, body: T.UpdateKeyRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdateKeyResponse: """ Complete Update Key. Submits the signed challenge and makes the API request. Args: - key_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + key_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdateKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/keys/{keyId}", path_params={"keyId": key_id}, @@ -217,7 +217,6 @@ def update_key_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdateKeyResponse, response) def delete_key_init(self, key_id: str) -> UserActionChallengeResponse: """ @@ -226,11 +225,11 @@ def delete_key_init(self, key_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - key_id: Path parameter. + key_id: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/{keyId}" path = path.replace("{keyId}", str(key_id)) payload = "" @@ -249,16 +248,18 @@ def delete_key_complete(self, key_id: str, signed_challenge: SignUserActionChall Submits the signed challenge and makes the API request. Args: - key_id: Path parameter. - signed_challenge: The signed challenge from external signing. + key_id: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/keys/{keyId}", path_params={"keyId": key_id}, @@ -266,7 +267,6 @@ def delete_key_complete(self, key_id: str, signed_challenge: SignUserActionChall body=None, user_action=user_action_token, ) - return cast(T.DeleteKeyResponse, response) def derive_key_init(self, key_id: str, body: T.DeriveKeyRequest) -> UserActionChallengeResponse: """ @@ -275,12 +275,12 @@ def derive_key_init(self, key_id: str, body: T.DeriveKeyRequest) -> UserActionCh Creates a user action challenge for external signing. Args: - key_id: Path parameter. - body: Request body. + key_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/{keyId}/derive" path = path.replace("{keyId}", str(key_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -292,26 +292,26 @@ def derive_key_init(self, key_id: str, body: T.DeriveKeyRequest) -> UserActionCh user_action_payload=payload, ) - def derive_key_complete( - self, key_id: str, body: T.DeriveKeyRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeriveKeyResponse: + def derive_key_complete(self, key_id: str, body: T.DeriveKeyRequest, signed_challenge: SignUserActionChallengeRequest) -> T.DeriveKeyResponse: """ Complete Derive Key. Submits the signed challenge and makes the API request. Args: - key_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + key_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.DeriveKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/keys/{keyId}/derive", path_params={"keyId": key_id}, @@ -319,7 +319,6 @@ def derive_key_complete( body=body, user_action=user_action_token, ) - return cast(T.DeriveKeyResponse, response) def export_key_init(self, key_id: str, body: T.ExportKeyRequest) -> UserActionChallengeResponse: """ @@ -328,12 +327,12 @@ def export_key_init(self, key_id: str, body: T.ExportKeyRequest) -> UserActionCh Creates a user action challenge for external signing. Args: - key_id: Path parameter. - body: Request body. + key_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/{keyId}/export" path = path.replace("{keyId}", str(key_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -345,26 +344,26 @@ def export_key_init(self, key_id: str, body: T.ExportKeyRequest) -> UserActionCh user_action_payload=payload, ) - def export_key_complete( - self, key_id: str, body: T.ExportKeyRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.ExportKeyResponse: + def export_key_complete(self, key_id: str, body: T.ExportKeyRequest, signed_challenge: SignUserActionChallengeRequest) -> T.ExportKeyResponse: """ Complete Export Key. Submits the signed challenge and makes the API request. Args: - key_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + key_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.ExportKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/keys/{keyId}/export", path_params={"keyId": key_id}, @@ -372,22 +371,21 @@ def export_key_complete( body=body, user_action=user_action_token, ) - return cast(T.ExportKeyResponse, response) - def list_signatures(self, key_id: str, query: T.ListSignaturesQuery | None = None) -> T.ListSignaturesResponse: + def list_signatures(self, key_id: str, query: Optional[T.ListSignaturesQuery] = None) -> T.ListSignaturesResponse: """ List Signatures. List all signature requests for a key. Args: - key_id: The key to list signatures for. - query: Query parameters. + key_id: The key to list signatures for. + query: Query parameters. Returns: T.ListSignaturesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys/{keyId}/signatures", path_params={"keyId": key_id}, @@ -395,7 +393,6 @@ def list_signatures(self, key_id: str, query: T.ListSignaturesQuery | None = Non body=None, requires_signature=False, ) - return cast(T.ListSignaturesResponse, response) def generate_signature_init(self, key_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -404,12 +401,12 @@ def generate_signature_init(self, key_id: str, body: dict[str, Any]) -> UserActi Creates a user action challenge for external signing. Args: - key_id: The key to sign with. - body: Request body. + key_id: The key to sign with. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/{keyId}/signatures" path = path.replace("{keyId}", str(key_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -421,26 +418,26 @@ def generate_signature_init(self, key_id: str, body: dict[str, Any]) -> UserActi user_action_payload=payload, ) - def generate_signature_complete( - self, key_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.GenerateSignatureResponse: + def generate_signature_complete(self, key_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.GenerateSignatureResponse: """ Complete Generate Signature. Submits the signed challenge and makes the API request. Args: - key_id: The key to sign with. - body: Request body. - signed_challenge: The signed challenge from external signing. + key_id: The key to sign with. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.GenerateSignatureResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/keys/{keyId}/signatures", path_params={"keyId": key_id}, @@ -448,7 +445,6 @@ def generate_signature_complete( body=body, user_action=user_action_token, ) - return cast(T.GenerateSignatureResponse, response) def get_signature(self, key_id: str, signature_id: str) -> T.GetSignatureResponse: """ @@ -457,13 +453,13 @@ def get_signature(self, key_id: str, signature_id: str) -> T.GetSignatureRespons Retrieve a signature request details. Args: - key_id: The key that was used for signing. - signature_id: The signature request to retrieve. + key_id: The key that was used for signing. + signature_id: The signature request to retrieve. Returns: T.GetSignatureResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/keys/{keyId}/signatures/{signatureId}", path_params={"keyId": key_id, "signatureId": signature_id}, @@ -471,7 +467,6 @@ def get_signature(self, key_id: str, signature_id: str) -> T.GetSignatureRespons body=None, requires_signature=False, ) - return cast(T.GetSignatureResponse, response) def import_key_init(self, body: T.ImportKeyRequest) -> UserActionChallengeResponse: """ @@ -480,11 +475,11 @@ def import_key_init(self, body: T.ImportKeyRequest) -> UserActionChallengeRespon Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/keys/import" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -495,25 +490,25 @@ def import_key_init(self, body: T.ImportKeyRequest) -> UserActionChallengeRespon user_action_payload=payload, ) - def import_key_complete( - self, body: T.ImportKeyRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.ImportKeyResponse: + def import_key_complete(self, body: T.ImportKeyRequest, signed_challenge: SignUserActionChallengeRequest) -> T.ImportKeyResponse: """ Complete Import Key. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.ImportKeyResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/keys/import", path_params={}, @@ -521,4 +516,3 @@ def import_key_complete( body=body, user_action=user_action_token, ) - return cast(T.ImportKeyResponse, response) diff --git a/dfns_sdk/generated/keys/types.py b/dfns_sdk/generated/keys/types.py index e6b5e1d..718e89d 100644 --- a/dfns_sdk/generated/keys/types.py +++ b/dfns_sdk/generated/keys/types.py @@ -1,17 +1,13 @@ """Types for the keys domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListKeysResponse(TypedDict, total=False): """listKeys response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListKeysQuery(TypedDict, total=False): """listKeys query parameters.""" @@ -19,7 +15,6 @@ class ListKeysQuery(TypedDict, total=False): pagination_token: NotRequired[str] owner: NotRequired[str] - class CreateKeyRequest(TypedDict, total=False): """createKey request body.""" @@ -27,12 +22,11 @@ class CreateKeyRequest(TypedDict, total=False): curve: Literal["ed25519", "secp256k1", "stark"] name: NotRequired[str] master_key: NotRequired[bool] - derive_from: NotRequired[dict[str, Any]] + derive_from: NotRequired[TypedDict] store_id: NotRequired[str] delegate_to: NotRequired[str] delay_delegation: NotRequired[bool] - class CreateKeyResponse(TypedDict, total=False): """createKey response.""" @@ -41,7 +35,7 @@ class CreateKeyResponse(TypedDict, total=False): curve: Literal["ed25519", "secp256k1", "stark"] public_key: str master_key: NotRequired[bool] - derived_from: NotRequired[dict[str, Any]] + derived_from: NotRequired[TypedDict] name: NotRequired[str] status: Literal["Active", "Archived"] custodial: bool @@ -51,20 +45,17 @@ class CreateKeyResponse(TypedDict, total=False): date_exported: NotRequired[str] date_deleted: NotRequired[str] - class DelegateKeyRequest(TypedDict, total=False): """delegateKey request body.""" delegate_to: str - class DelegateKeyResponse(TypedDict, total=False): """delegateKey response.""" key_id: str status: Literal["Delegated"] - class GetKeyResponse(TypedDict, total=False): """getKey response.""" @@ -73,7 +64,7 @@ class GetKeyResponse(TypedDict, total=False): curve: Literal["ed25519", "secp256k1", "stark"] public_key: str master_key: NotRequired[bool] - derived_from: NotRequired[dict[str, Any]] + derived_from: NotRequired[TypedDict] name: NotRequired[str] status: Literal["Active", "Archived"] custodial: bool @@ -82,16 +73,14 @@ class GetKeyResponse(TypedDict, total=False): exported: NotRequired[bool] date_exported: NotRequired[str] date_deleted: NotRequired[str] - wallets: list[dict[str, Any]] - store: dict[str, Any] - + wallets: list[TypedDict] + store: TypedDict class UpdateKeyRequest(TypedDict, total=False): """updateKey request body.""" name: Any - class UpdateKeyResponse(TypedDict, total=False): """updateKey response.""" @@ -100,7 +89,7 @@ class UpdateKeyResponse(TypedDict, total=False): curve: Literal["ed25519", "secp256k1", "stark"] public_key: str master_key: NotRequired[bool] - derived_from: NotRequired[dict[str, Any]] + derived_from: NotRequired[TypedDict] name: NotRequired[str] status: Literal["Active", "Archived"] custodial: bool @@ -110,7 +99,6 @@ class UpdateKeyResponse(TypedDict, total=False): date_exported: NotRequired[str] date_deleted: NotRequired[str] - class DeleteKeyResponse(TypedDict, total=False): """deleteKey response.""" @@ -119,7 +107,7 @@ class DeleteKeyResponse(TypedDict, total=False): curve: Literal["ed25519", "secp256k1", "stark"] public_key: str master_key: NotRequired[bool] - derived_from: NotRequired[dict[str, Any]] + derived_from: NotRequired[TypedDict] name: NotRequired[str] status: Literal["Active", "Archived"] custodial: bool @@ -129,181 +117,58 @@ class DeleteKeyResponse(TypedDict, total=False): date_exported: NotRequired[str] date_deleted: NotRequired[str] - class DeriveKeyRequest(TypedDict, total=False): """deriveKey request body.""" domain: str seed: str - class DeriveKeyResponse(TypedDict, total=False): """deriveKey response.""" output: str - class ExportKeyRequest(TypedDict, total=False): """exportKey request body.""" encryption_key: str - supported_schemes: list[dict[str, Any]] - + supported_schemes: list[TypedDict] class ExportKeyResponse(TypedDict, total=False): """exportKey response.""" public_key: str - protocol: Literal["CGGMP24", "FROST", "FROST_BITCOIN", "GLOW20_DH", "KU23"] | Literal["CGGMP21"] + protocol: Union[Literal["CGGMP24", "FROST", "FROST_BITCOIN", "GLOW20_DH", "KU23"], Literal["CGGMP21"]] curve: Literal["ed25519", "secp256k1", "stark"] min_signers: float - encrypted_key_shares: list[dict[str, Any]] - + encrypted_key_shares: list[TypedDict] class ListSignaturesResponse(TypedDict, total=False): """listSignatures response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] key_id: str - class ListSignaturesQuery(TypedDict, total=False): """listSignatures query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class GenerateSignatureResponse(TypedDict, total=False): """generateSignature response.""" id: str key_id: str - requester: dict[str, Any] - request_body: dict[str, Any] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Signed", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] - signature: NotRequired[dict[str, Any]] - signatures: NotRequired[list[dict[str, Any]]] + signature: NotRequired[TypedDict] + signatures: NotRequired[list[TypedDict]] signed_data: NotRequired[str] - network: NotRequired[ - Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - ] + network: NotRequired[Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"]] tx_hash: NotRequired[str] fee: NotRequired[str] approval_id: NotRequired[str] @@ -314,136 +179,19 @@ class GenerateSignatureResponse(TypedDict, total=False): external_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class GetSignatureResponse(TypedDict, total=False): """getSignature response.""" id: str key_id: str - requester: dict[str, Any] - request_body: dict[str, Any] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Signed", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] - signature: NotRequired[dict[str, Any]] - signatures: NotRequired[list[dict[str, Any]]] + signature: NotRequired[TypedDict] + signatures: NotRequired[list[TypedDict]] signed_data: NotRequired[str] - network: NotRequired[ - Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - ] + network: NotRequired[Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"]] tx_hash: NotRequired[str] fee: NotRequired[str] approval_id: NotRequired[str] @@ -454,18 +202,16 @@ class GetSignatureResponse(TypedDict, total=False): external_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class ImportKeyRequest(TypedDict, total=False): """importKey request body.""" name: NotRequired[str] curve: Literal["ed25519", "secp256k1", "stark"] - protocol: Literal["CGGMP24", "FROST", "FROST_BITCOIN", "GLOW20_DH", "KU23"] | Literal["CGGMP21"] + protocol: Union[Literal["CGGMP24", "FROST", "FROST_BITCOIN", "GLOW20_DH", "KU23"], Literal["CGGMP21"]] min_signers: int - encrypted_key_shares: list[dict[str, Any]] + encrypted_key_shares: list[TypedDict] master_key: NotRequired[bool] - class ImportKeyResponse(TypedDict, total=False): """importKey response.""" @@ -474,7 +220,7 @@ class ImportKeyResponse(TypedDict, total=False): curve: Literal["ed25519", "secp256k1", "stark"] public_key: str master_key: NotRequired[bool] - derived_from: NotRequired[dict[str, Any]] + derived_from: NotRequired[TypedDict] name: NotRequired[str] status: Literal["Active", "Archived"] custodial: bool diff --git a/dfns_sdk/generated/networks/__init__.py b/dfns_sdk/generated/networks/__init__.py index b9a8c72..dd95668 100644 --- a/dfns_sdk/generated/networks/__init__.py +++ b/dfns_sdk/generated/networks/__init__.py @@ -1,7 +1,7 @@ """Networks domain module.""" -from . import types from .client import NetworksClient from .delegated_client import DelegatedNetworksClient +from . import types __all__ = ["NetworksClient", "DelegatedNetworksClient", "types"] diff --git a/dfns_sdk/generated/networks/client.py b/dfns_sdk/generated/networks/client.py index 760e1f2..992b960 100644 --- a/dfns_sdk/generated/networks/client.py +++ b/dfns_sdk/generated/networks/client.py @@ -1,6 +1,6 @@ """Client for the networks domain.""" -from typing import Any, Literal, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class NetworksClient: def __init__(self, http_client: HttpClient): self._http = http_client - def estimate_fees(self, query: T.EstimateFeesQuery) -> dict[str, Any]: + def estimate_fees(self, query: T.EstimateFeesQuery) -> TypedDict: """ Estimate Fees. Gets real-time fee details for a given network, allowing users to make decisions based on their preferences for transaction speed/priority. Three levels of priority will be displayed: `slow`, `standard`, `fast`. Args: - query: Query parameters. + query: Query parameters. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="GET", path="/networks/fees", path_params={}, @@ -32,26 +32,25 @@ def estimate_fees(self, query: T.EstimateFeesQuery) -> dict[str, Any]: body=None, requires_signature=False, ) - return cast(dict[str, Any], response) def call_function(self, network: str, body: T.CallFunctionRequest) -> dict[str, Any]: """ - Call Function. + Call Function. - Call a read-only function on a smart contract. In Solidity, these are functions with the state mutability set to `view`. + Call a read-only function on a smart contract. In Solidity, these are functions with the state mutability set to `view`. - - Currently only works on EVM compatible chains. - + + Currently only works on EVM compatible chains. + - Args: - network: Network name formatted in kebab case - body: Request body. + Args: + network: Network name formatted in kebab case + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + dict[str, Any]: The API response. + """ + return self._http.request( method="POST", path="/networks/{network}/call-function", path_params={"network": network}, @@ -59,24 +58,21 @@ def call_function(self, network: str, body: T.CallFunctionRequest) -> dict[str, body=body, requires_signature=False, ) - return cast(dict[str, Any], response) - def get_canton_validator( - self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str - ) -> T.GetCantonValidatorResponse: + def get_canton_validator(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str) -> T.GetCantonValidatorResponse: """ Get Canton Validator. Return a configured Canton Validator in your organization. Args: - network: Path parameter. - validator_id: Path parameter. + network: Path parameter. + validator_id: Path parameter. Returns: T.GetCantonValidatorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/networks/{network}/validators/{validatorId}", path_params={"network": network, "validatorId": validator_id}, @@ -84,30 +80,24 @@ def get_canton_validator( body=None, requires_signature=False, ) - return cast(T.GetCantonValidatorResponse, response) - - def update_canton_validator( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - validator_id: str, - body: T.UpdateCantonValidatorRequest, - ) -> T.UpdateCantonValidatorResponse: - """ - Update Canton Validator. - Update an existing Canton Validator configuration. + def update_canton_validator(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str, body: T.UpdateCantonValidatorRequest) -> T.UpdateCantonValidatorResponse: + """ + Update Canton Validator. - Read details about the process [here](https://docs.dfns.co/networks/canton-validators). + Update an existing Canton Validator configuration. + + Read details about the process [here](https://docs.dfns.co/networks/canton-validators). - Args: - network: Path parameter. - validator_id: Path parameter. - body: Request body. + Args: + network: Path parameter. + validator_id: Path parameter. + body: Request body. - Returns: - T.UpdateCantonValidatorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.UpdateCantonValidatorResponse: The API response. + """ + return self._http.request( method="PUT", path="/networks/{network}/validators/{validatorId}", path_params={"network": network, "validatorId": validator_id}, @@ -115,24 +105,21 @@ def update_canton_validator( body=body, requires_signature=True, ) - return cast(T.UpdateCantonValidatorResponse, response) - def delete_canton_validator( - self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str - ) -> T.DeleteCantonValidatorResponse: + def delete_canton_validator(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str) -> T.DeleteCantonValidatorResponse: """ Delete Canton Validator. Delete a specific Canton Validator configuration. Args: - network: Path parameter. - validator_id: Path parameter. + network: Path parameter. + validator_id: Path parameter. Returns: T.DeleteCantonValidatorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/networks/{network}/validators/{validatorId}", path_params={"network": network, "validatorId": validator_id}, @@ -140,26 +127,21 @@ def delete_canton_validator( body=None, requires_signature=True, ) - return cast(T.DeleteCantonValidatorResponse, response) - def list_canton_validators( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - query: T.ListCantonValidatorsQuery | None = None, - ) -> T.ListCantonValidatorsResponse: + def list_canton_validators(self, network: Literal["canton", "canton-devnet", "canton-testnet"], query: Optional[T.ListCantonValidatorsQuery] = None) -> T.ListCantonValidatorsResponse: """ List Canton Validators. Retrieve the list of configured Canton Validators in your organization. Args: - network: Path parameter. - query: Query parameters. + network: Path parameter. + query: Query parameters. Returns: T.ListCantonValidatorsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/networks/{network}/validators", path_params={"network": network}, @@ -167,28 +149,25 @@ def list_canton_validators( body=None, requires_signature=False, ) - return cast(T.ListCantonValidatorsResponse, response) - def create_canton_validator( - self, network: Literal["canton", "canton-devnet", "canton-testnet"], body: dict[str, Any] - ) -> T.CreateCantonValidatorResponse: + def create_canton_validator(self, network: Literal["canton", "canton-devnet", "canton-testnet"], body: dict[str, Any]) -> T.CreateCantonValidatorResponse: """ - Create Canton Validator. + Create Canton Validator. - Link a Canton Validator to your organization. This is required in order to create wallets or interact with the Canton network. + Link a Canton Validator to your organization. This is required in order to create wallets or interact with the Canton network. - The `Shared` option allows you to use a shared validator hosted by Dfns and get started in seconds, while the `Custom` option allows you to connect your own validator and ledger nodes using OAuth2 authentication. + The `Shared` option allows you to use a shared validator hosted by Dfns and get started in seconds, while the `Custom` option allows you to connect your own validator and ledger nodes using OAuth2 authentication. - Read details about the process [here](https://docs.dfns.co/networks/canton-validators). + Read details about the process [here](https://docs.dfns.co/networks/canton-validators). - Args: - network: Path parameter. - body: Request body. + Args: + network: Path parameter. + body: Request body. - Returns: - T.CreateCantonValidatorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CreateCantonValidatorResponse: The API response. + """ + return self._http.request( method="POST", path="/networks/{network}/validators", path_params={"network": network}, @@ -196,4 +175,3 @@ def create_canton_validator( body=body, requires_signature=True, ) - return cast(T.CreateCantonValidatorResponse, response) diff --git a/dfns_sdk/generated/networks/delegated_client.py b/dfns_sdk/generated/networks/delegated_client.py index 9db1ebb..913efdf 100644 --- a/dfns_sdk/generated/networks/delegated_client.py +++ b/dfns_sdk/generated/networks/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the networks domain.""" import json -from typing import Any, Literal, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedNetworksClient: def __init__(self, http_client: HttpClient): self._http = http_client - def estimate_fees(self, query: T.EstimateFeesQuery) -> dict[str, Any]: + def estimate_fees(self, query: T.EstimateFeesQuery) -> TypedDict: """ Estimate Fees. Gets real-time fee details for a given network, allowing users to make decisions based on their preferences for transaction speed/priority. Three levels of priority will be displayed: `slow`, `standard`, `fast`. Args: - query: Query parameters. + query: Query parameters. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="GET", path="/networks/fees", path_params={}, @@ -39,26 +43,25 @@ def estimate_fees(self, query: T.EstimateFeesQuery) -> dict[str, Any]: body=None, requires_signature=False, ) - return cast(dict[str, Any], response) def call_function(self, network: str, body: T.CallFunctionRequest) -> dict[str, Any]: """ - Call Function. + Call Function. - Call a read-only function on a smart contract. In Solidity, these are functions with the state mutability set to `view`. + Call a read-only function on a smart contract. In Solidity, these are functions with the state mutability set to `view`. - - Currently only works on EVM compatible chains. - + + Currently only works on EVM compatible chains. + - Args: - network: Network name formatted in kebab case - body: Request body. + Args: + network: Network name formatted in kebab case + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + dict[str, Any]: The API response. + """ + return self._http.request( method="POST", path="/networks/{network}/call-function", path_params={"network": network}, @@ -66,24 +69,21 @@ def call_function(self, network: str, body: T.CallFunctionRequest) -> dict[str, body=body, requires_signature=False, ) - return cast(dict[str, Any], response) - def get_canton_validator( - self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str - ) -> T.GetCantonValidatorResponse: + def get_canton_validator(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str) -> T.GetCantonValidatorResponse: """ Get Canton Validator. Return a configured Canton Validator in your organization. Args: - network: Path parameter. - validator_id: Path parameter. + network: Path parameter. + validator_id: Path parameter. Returns: T.GetCantonValidatorResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/networks/{network}/validators/{validatorId}", path_params={"network": network, "validatorId": validator_id}, @@ -91,27 +91,21 @@ def get_canton_validator( body=None, requires_signature=False, ) - return cast(T.GetCantonValidatorResponse, response) - - def update_canton_validator_init( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - validator_id: str, - body: T.UpdateCantonValidatorRequest, - ) -> UserActionChallengeResponse: + + def update_canton_validator_init(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str, body: T.UpdateCantonValidatorRequest) -> UserActionChallengeResponse: """ Initialize Update Canton Validator. Creates a user action challenge for external signing. Args: - network: Path parameter. - validator_id: Path parameter. - body: Request body. + network: Path parameter. + validator_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/networks/{network}/validators/{validatorId}" path = path.replace("{network}", str(network)) path = path.replace("{validatorId}", str(validator_id)) @@ -124,31 +118,27 @@ def update_canton_validator_init( user_action_payload=payload, ) - def update_canton_validator_complete( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - validator_id: str, - body: T.UpdateCantonValidatorRequest, - signed_challenge: SignUserActionChallengeRequest, - ) -> T.UpdateCantonValidatorResponse: + def update_canton_validator_complete(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str, body: T.UpdateCantonValidatorRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdateCantonValidatorResponse: """ Complete Update Canton Validator. Submits the signed challenge and makes the API request. Args: - network: Path parameter. - validator_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + network: Path parameter. + validator_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdateCantonValidatorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/networks/{network}/validators/{validatorId}", path_params={"network": network, "validatorId": validator_id}, @@ -156,23 +146,20 @@ def update_canton_validator_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdateCantonValidatorResponse, response) - def delete_canton_validator_init( - self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str - ) -> UserActionChallengeResponse: + def delete_canton_validator_init(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str) -> UserActionChallengeResponse: """ Initialize Delete Canton Validator. Creates a user action challenge for external signing. Args: - network: Path parameter. - validator_id: Path parameter. + network: Path parameter. + validator_id: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/networks/{network}/validators/{validatorId}" path = path.replace("{network}", str(network)) path = path.replace("{validatorId}", str(validator_id)) @@ -185,29 +172,26 @@ def delete_canton_validator_init( user_action_payload=payload, ) - def delete_canton_validator_complete( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - validator_id: str, - signed_challenge: SignUserActionChallengeRequest, - ) -> T.DeleteCantonValidatorResponse: + def delete_canton_validator_complete(self, network: Literal["canton", "canton-devnet", "canton-testnet"], validator_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeleteCantonValidatorResponse: """ Complete Delete Canton Validator. Submits the signed challenge and makes the API request. Args: - network: Path parameter. - validator_id: Path parameter. - signed_challenge: The signed challenge from external signing. + network: Path parameter. + validator_id: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteCantonValidatorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/networks/{network}/validators/{validatorId}", path_params={"network": network, "validatorId": validator_id}, @@ -215,26 +199,21 @@ def delete_canton_validator_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteCantonValidatorResponse, response) - def list_canton_validators( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - query: T.ListCantonValidatorsQuery | None = None, - ) -> T.ListCantonValidatorsResponse: + def list_canton_validators(self, network: Literal["canton", "canton-devnet", "canton-testnet"], query: Optional[T.ListCantonValidatorsQuery] = None) -> T.ListCantonValidatorsResponse: """ List Canton Validators. Retrieve the list of configured Canton Validators in your organization. Args: - network: Path parameter. - query: Query parameters. + network: Path parameter. + query: Query parameters. Returns: T.ListCantonValidatorsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/networks/{network}/validators", path_params={"network": network}, @@ -242,23 +221,20 @@ def list_canton_validators( body=None, requires_signature=False, ) - return cast(T.ListCantonValidatorsResponse, response) - def create_canton_validator_init( - self, network: Literal["canton", "canton-devnet", "canton-testnet"], body: dict[str, Any] - ) -> UserActionChallengeResponse: + def create_canton_validator_init(self, network: Literal["canton", "canton-devnet", "canton-testnet"], body: dict[str, Any]) -> UserActionChallengeResponse: """ Initialize Create Canton Validator. Creates a user action challenge for external signing. Args: - network: Path parameter. - body: Request body. + network: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/networks/{network}/validators" path = path.replace("{network}", str(network)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -270,29 +246,26 @@ def create_canton_validator_init( user_action_payload=payload, ) - def create_canton_validator_complete( - self, - network: Literal["canton", "canton-devnet", "canton-testnet"], - body: dict[str, Any], - signed_challenge: SignUserActionChallengeRequest, - ) -> T.CreateCantonValidatorResponse: + def create_canton_validator_complete(self, network: Literal["canton", "canton-devnet", "canton-testnet"], body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreateCantonValidatorResponse: """ Complete Create Canton Validator. Submits the signed challenge and makes the API request. Args: - network: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + network: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateCantonValidatorResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/networks/{network}/validators", path_params={"network": network}, @@ -300,4 +273,3 @@ def create_canton_validator_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateCantonValidatorResponse, response) diff --git a/dfns_sdk/generated/networks/types.py b/dfns_sdk/generated/networks/types.py index a3530db..1944b0c 100644 --- a/dfns_sdk/generated/networks/types.py +++ b/dfns_sdk/generated/networks/types.py @@ -1,83 +1,18 @@ """Types for the networks domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class EstimateFeesQuery(TypedDict, total=False): """estimateFees query parameters.""" - network: Literal[ - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "Litecoin", - "LitecoinTestnet", - "Dogecoin", - "DogecoinTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "Base", - "BaseSepolia", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Berachain", - "BerachainBepolia", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Ink", - "InkSepolia", - "Optimism", - "OptimismSepolia", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Polygon", - "PolygonAmoy", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "Sonic", - "SonicTestnet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "Solana", - "SolanaDevnet", - ] - + network: Literal["Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "Base", "BaseSepolia", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Berachain", "BerachainBepolia", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Ink", "InkSepolia", "Optimism", "OptimismSepolia", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Polygon", "PolygonAmoy", "Race", "RaceSepolia", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "Solana", "SolanaDevnet"] class CallFunctionRequest(TypedDict, total=False): """callFunction request body.""" contract: str - abi: dict[str, Any] - calldata: NotRequired[dict[str, Any]] - + abi: TypedDict + calldata: NotRequired[TypedDict] class GetCantonValidatorResponse(TypedDict, total=False): """getCantonValidator response.""" @@ -90,14 +25,12 @@ class GetCantonValidatorResponse(TypedDict, total=False): date_created: str party_hint: str - class UpdateCantonValidatorRequest(TypedDict, total=False): """updateCantonValidator request body.""" name: NotRequired[str] - validator: NotRequired[dict[str, Any]] - ledger: NotRequired[dict[str, Any]] - + validator: NotRequired[TypedDict] + ledger: NotRequired[TypedDict] class UpdateCantonValidatorResponse(TypedDict, total=False): """updateCantonValidator response.""" @@ -110,7 +43,6 @@ class UpdateCantonValidatorResponse(TypedDict, total=False): date_created: str party_hint: str - class DeleteCantonValidatorResponse(TypedDict, total=False): """deleteCantonValidator response.""" @@ -122,21 +54,18 @@ class DeleteCantonValidatorResponse(TypedDict, total=False): date_created: str party_hint: str - class ListCantonValidatorsResponse(TypedDict, total=False): """listCantonValidators response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListCantonValidatorsQuery(TypedDict, total=False): """listCantonValidators query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateCantonValidatorResponse(TypedDict, total=False): """createCantonValidator response.""" diff --git a/dfns_sdk/generated/payouts/__init__.py b/dfns_sdk/generated/payouts/__init__.py index 3d26b2d..c28855c 100644 --- a/dfns_sdk/generated/payouts/__init__.py +++ b/dfns_sdk/generated/payouts/__init__.py @@ -1,7 +1,7 @@ """Payouts domain module.""" -from . import types from .client import PayoutsClient from .delegated_client import DelegatedPayoutsClient +from . import types __all__ = ["PayoutsClient", "DelegatedPayoutsClient", "types"] diff --git a/dfns_sdk/generated/payouts/client.py b/dfns_sdk/generated/payouts/client.py index 65fa3f1..6490585 100644 --- a/dfns_sdk/generated/payouts/client.py +++ b/dfns_sdk/generated/payouts/client.py @@ -1,6 +1,6 @@ """Client for the payouts domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class PayoutsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_payouts(self, query: T.ListPayoutsQuery | None = None) -> T.ListPayoutsResponse: + def list_payouts(self, query: Optional[T.ListPayoutsQuery] = None) -> T.ListPayoutsResponse: """ List Payouts. List payouts with optional filtering and pagination. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListPayoutsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/payouts", path_params={}, @@ -32,21 +32,20 @@ def list_payouts(self, query: T.ListPayoutsQuery | None = None) -> T.ListPayouts body=None, requires_signature=False, ) - return cast(T.ListPayoutsResponse, response) - def create_payout(self, body: dict[str, Any]) -> dict[str, Any]: + def create_payout(self, body: dict[str, Any]) -> TypedDict: """ Create Payout. Create a new payout to convert crypto assets to fiat currency. Args: - body: Request body. + body: Request body. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/payouts", path_params={}, @@ -54,7 +53,6 @@ def create_payout(self, body: dict[str, Any]) -> dict[str, Any]: body=body, requires_signature=True, ) - return cast(dict[str, Any], response) def request_payout_quote(self, body: dict[str, Any]) -> T.RequestPayoutQuoteResponse: """ @@ -63,12 +61,12 @@ def request_payout_quote(self, body: dict[str, Any]) -> T.RequestPayoutQuoteResp Request a quote from a given provider for a payout. Returns estimated fiat amount and fees. Args: - body: Request body. + body: Request body. Returns: T.RequestPayoutQuoteResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/payouts/quote", path_params={}, @@ -76,21 +74,20 @@ def request_payout_quote(self, body: dict[str, Any]) -> T.RequestPayoutQuoteResp body=body, requires_signature=False, ) - return cast(T.RequestPayoutQuoteResponse, response) - def get_payout_status(self, payout_id: str) -> dict[str, Any]: + def get_payout_status(self, payout_id: str) -> TypedDict: """ Get Payout Status. Retrieve the current status of a payout by its ID. Args: - payout_id: Payout id. + payout_id: Payout id. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="GET", path="/payouts/{payoutId}", path_params={"payoutId": payout_id}, @@ -98,7 +95,6 @@ def get_payout_status(self, payout_id: str) -> dict[str, Any]: body=None, requires_signature=False, ) - return cast(dict[str, Any], response) def create_payout_action(self, payout_id: str, body: dict[str, Any]) -> T.CreatePayoutActionResponse: """ @@ -107,13 +103,13 @@ def create_payout_action(self, payout_id: str, body: dict[str, Any]) -> T.Create Perform an action on a payout, such as confirming or canceling. Args: - payout_id: Payout id. - body: Request body. + payout_id: Payout id. + body: Request body. Returns: T.CreatePayoutActionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/payouts/{payoutId}/action", path_params={"payoutId": payout_id}, @@ -121,4 +117,3 @@ def create_payout_action(self, payout_id: str, body: dict[str, Any]) -> T.Create body=body, requires_signature=True, ) - return cast(T.CreatePayoutActionResponse, response) diff --git a/dfns_sdk/generated/payouts/delegated_client.py b/dfns_sdk/generated/payouts/delegated_client.py index d22a6e1..e89f363 100644 --- a/dfns_sdk/generated/payouts/delegated_client.py +++ b/dfns_sdk/generated/payouts/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the payouts domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedPayoutsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_payouts(self, query: T.ListPayoutsQuery | None = None) -> T.ListPayoutsResponse: + def list_payouts(self, query: Optional[T.ListPayoutsQuery] = None) -> T.ListPayoutsResponse: """ List Payouts. List payouts with optional filtering and pagination. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListPayoutsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/payouts", path_params={}, @@ -39,7 +43,6 @@ def list_payouts(self, query: T.ListPayoutsQuery | None = None) -> T.ListPayouts body=None, requires_signature=False, ) - return cast(T.ListPayoutsResponse, response) def create_payout_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def create_payout_init(self, body: dict[str, Any]) -> UserActionChallengeRespons Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/payouts" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -63,25 +66,25 @@ def create_payout_init(self, body: dict[str, Any]) -> UserActionChallengeRespons user_action_payload=payload, ) - def create_payout_complete( - self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> dict[str, Any]: + def create_payout_complete(self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> TypedDict: """ Complete Create Payout. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + TypedDict: The API response. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/payouts", path_params={}, @@ -89,7 +92,6 @@ def create_payout_complete( body=body, user_action=user_action_token, ) - return cast(dict[str, Any], response) def request_payout_quote(self, body: dict[str, Any]) -> T.RequestPayoutQuoteResponse: """ @@ -98,12 +100,12 @@ def request_payout_quote(self, body: dict[str, Any]) -> T.RequestPayoutQuoteResp Request a quote from a given provider for a payout. Returns estimated fiat amount and fees. Args: - body: Request body. + body: Request body. Returns: T.RequestPayoutQuoteResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/payouts/quote", path_params={}, @@ -111,21 +113,20 @@ def request_payout_quote(self, body: dict[str, Any]) -> T.RequestPayoutQuoteResp body=body, requires_signature=False, ) - return cast(T.RequestPayoutQuoteResponse, response) - def get_payout_status(self, payout_id: str) -> dict[str, Any]: + def get_payout_status(self, payout_id: str) -> TypedDict: """ Get Payout Status. Retrieve the current status of a payout by its ID. Args: - payout_id: Payout id. + payout_id: Payout id. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="GET", path="/payouts/{payoutId}", path_params={"payoutId": payout_id}, @@ -133,7 +134,6 @@ def get_payout_status(self, payout_id: str) -> dict[str, Any]: body=None, requires_signature=False, ) - return cast(dict[str, Any], response) def create_payout_action_init(self, payout_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -142,12 +142,12 @@ def create_payout_action_init(self, payout_id: str, body: dict[str, Any]) -> Use Creates a user action challenge for external signing. Args: - payout_id: Payout id. - body: Request body. + payout_id: Payout id. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/payouts/{payoutId}/action" path = path.replace("{payoutId}", str(payout_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -159,26 +159,26 @@ def create_payout_action_init(self, payout_id: str, body: dict[str, Any]) -> Use user_action_payload=payload, ) - def create_payout_action_complete( - self, payout_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreatePayoutActionResponse: + def create_payout_action_complete(self, payout_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreatePayoutActionResponse: """ Complete Create Payout Action. Submits the signed challenge and makes the API request. Args: - payout_id: Payout id. - body: Request body. - signed_challenge: The signed challenge from external signing. + payout_id: Payout id. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreatePayoutActionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/payouts/{payoutId}/action", path_params={"payoutId": payout_id}, @@ -186,4 +186,3 @@ def create_payout_action_complete( body=body, user_action=user_action_token, ) - return cast(T.CreatePayoutActionResponse, response) diff --git a/dfns_sdk/generated/payouts/types.py b/dfns_sdk/generated/payouts/types.py index 9970ada..98cf2e0 100644 --- a/dfns_sdk/generated/payouts/types.py +++ b/dfns_sdk/generated/payouts/types.py @@ -1,17 +1,13 @@ """Types for the payouts domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListPayoutsResponse(TypedDict, total=False): """listPayouts response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListPayoutsQuery(TypedDict, total=False): """listPayouts query parameters.""" @@ -20,15 +16,13 @@ class ListPayoutsQuery(TypedDict, total=False): wallet_id: NotRequired[str] status: NotRequired[list[Literal["Processing", "Completed", "Failed", "Rejected", "Expired", "Canceled"]]] - class RequestPayoutQuoteResponse(TypedDict, total=False): """requestPayoutQuote response.""" provider: Literal["Borderless"] - asset: dict[str, Any] + asset: TypedDict timestamp: str - quotes: list[dict[str, Any]] - + quotes: list[TypedDict] class CreatePayoutActionResponse(TypedDict, total=False): """createPayoutAction response.""" diff --git a/dfns_sdk/generated/permissions/__init__.py b/dfns_sdk/generated/permissions/__init__.py index 5444c23..b4c3aa3 100644 --- a/dfns_sdk/generated/permissions/__init__.py +++ b/dfns_sdk/generated/permissions/__init__.py @@ -1,7 +1,7 @@ """Permissions domain module.""" -from . import types from .client import PermissionsClient from .delegated_client import DelegatedPermissionsClient +from . import types __all__ = ["PermissionsClient", "DelegatedPermissionsClient", "types"] diff --git a/dfns_sdk/generated/permissions/client.py b/dfns_sdk/generated/permissions/client.py index 166c8e2..dbf1d20 100644 --- a/dfns_sdk/generated/permissions/client.py +++ b/dfns_sdk/generated/permissions/client.py @@ -1,6 +1,6 @@ """Client for the permissions domain.""" -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -19,13 +19,13 @@ def archive_permission(self, permission_id: str, body: T.ArchivePermissionReques Archives or unarchives a permission (role). Archived permissions are effectively soft-deleted. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. Returns: T.ArchivePermissionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/permissions/{permissionId}/archive", path_params={"permissionId": permission_id}, @@ -33,24 +33,21 @@ def archive_permission(self, permission_id: str, body: T.ArchivePermissionReques body=body, requires_signature=True, ) - return cast(T.ArchivePermissionResponse, response) - def list_permission_assignments( - self, permission_id: str, query: T.ListPermissionAssignmentsQuery | None = None - ) -> T.ListPermissionAssignmentsResponse: + def list_permission_assignments(self, permission_id: str, query: Optional[T.ListPermissionAssignmentsQuery] = None) -> T.ListPermissionAssignmentsResponse: """ List Permission Assignments. Lists all permission (role) assignments for a given permission. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - query: Query parameters. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + query: Query parameters. Returns: T.ListPermissionAssignmentsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/permissions/{permissionId}/assignments", path_params={"permissionId": permission_id}, @@ -58,7 +55,6 @@ def list_permission_assignments( body=None, requires_signature=False, ) - return cast(T.ListPermissionAssignmentsResponse, response) def assign_permission(self, permission_id: str, body: T.AssignPermissionRequest) -> T.AssignPermissionResponse: """ @@ -67,13 +63,13 @@ def assign_permission(self, permission_id: str, body: T.AssignPermissionRequest) Assigns a permission (role) to an identity (user, PAT or service account), granting it access to the operations defined in the permission. Returns the assignment on success (200), or a pending change request if approval is required (202). Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. Returns: T.AssignPermissionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/permissions/{permissionId}/assignments", path_params={"permissionId": permission_id}, @@ -81,21 +77,20 @@ def assign_permission(self, permission_id: str, body: T.AssignPermissionRequest) body=body, requires_signature=True, ) - return cast(T.AssignPermissionResponse, response) - def list_permissions(self, query: T.ListPermissionsQuery | None = None) -> T.ListPermissionsResponse: + def list_permissions(self, query: Optional[T.ListPermissionsQuery] = None) -> T.ListPermissionsResponse: """ List Permissions. Lists all permissions (roles) in the organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListPermissionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/permissions", path_params={}, @@ -103,7 +98,6 @@ def list_permissions(self, query: T.ListPermissionsQuery | None = None) -> T.Lis body=None, requires_signature=False, ) - return cast(T.ListPermissionsResponse, response) def create_permission(self, body: T.CreatePermissionRequest) -> T.CreatePermissionResponse: """ @@ -112,12 +106,12 @@ def create_permission(self, body: T.CreatePermissionRequest) -> T.CreatePermissi Creates a new permission (also referred to as "role" in the dashboard) that grants access to the specified API operations. Args: - body: Request body. + body: Request body. Returns: T.CreatePermissionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/permissions", path_params={}, @@ -125,22 +119,19 @@ def create_permission(self, body: T.CreatePermissionRequest) -> T.CreatePermissi body=body, requires_signature=True, ) - return cast(T.CreatePermissionResponse, response) - def revoke_permission( - self, permission_id: str, assignment_id: str, query: T.RevokePermissionQuery | None = None - ) -> None: + def revoke_permission(self, permission_id: str, assignment_id: str, query: Optional[T.RevokePermissionQuery] = None) -> None: """ Revoke Permission. Revokes a permission (role) assignment, removing the identity's access to the operations granted by the permission. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - assignment_id: ID of the permission assignment. - query: Query parameters. - """ # noqa: E501 - self._http.request( + permission_id: ID of the permission (also referred to as "role" in the dashboard). + assignment_id: ID of the permission assignment. + query: Query parameters. + """ + return self._http.request( method="DELETE", path="/permissions/{permissionId}/assignments/{assignmentId}", path_params={"permissionId": permission_id, "assignmentId": assignment_id}, @@ -156,12 +147,12 @@ def get_permission(self, permission_id: str) -> T.GetPermissionResponse: Retrieves a permission (role) by ID, including any pending change request. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). + permission_id: ID of the permission (also referred to as "role" in the dashboard). Returns: T.GetPermissionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/permissions/{permissionId}", path_params={"permissionId": permission_id}, @@ -169,7 +160,6 @@ def get_permission(self, permission_id: str) -> T.GetPermissionResponse: body=None, requires_signature=False, ) - return cast(T.GetPermissionResponse, response) def update_permission(self, permission_id: str, body: T.UpdatePermissionRequest) -> T.UpdatePermissionResponse: """ @@ -178,13 +168,13 @@ def update_permission(self, permission_id: str, body: T.UpdatePermissionRequest) Updates the name or operations of an existing permission (role). Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. Returns: T.UpdatePermissionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/permissions/{permissionId}", path_params={"permissionId": permission_id}, @@ -192,4 +182,3 @@ def update_permission(self, permission_id: str, body: T.UpdatePermissionRequest) body=body, requires_signature=True, ) - return cast(T.UpdatePermissionResponse, response) diff --git a/dfns_sdk/generated/permissions/delegated_client.py b/dfns_sdk/generated/permissions/delegated_client.py index 48d51c9..7a66f5d 100644 --- a/dfns_sdk/generated/permissions/delegated_client.py +++ b/dfns_sdk/generated/permissions/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the permissions domain.""" import json -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,21 +23,19 @@ class DelegatedPermissionsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def archive_permission_init( - self, permission_id: str, body: T.ArchivePermissionRequest - ) -> UserActionChallengeResponse: + def archive_permission_init(self, permission_id: str, body: T.ArchivePermissionRequest) -> UserActionChallengeResponse: """ Initialize Archive Permission. Creates a user action challenge for external signing. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/permissions/{permissionId}/archive" path = path.replace("{permissionId}", str(permission_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -45,26 +47,26 @@ def archive_permission_init( user_action_payload=payload, ) - def archive_permission_complete( - self, permission_id: str, body: T.ArchivePermissionRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.ArchivePermissionResponse: + def archive_permission_complete(self, permission_id: str, body: T.ArchivePermissionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.ArchivePermissionResponse: """ Complete Archive Permission. Submits the signed challenge and makes the API request. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. - signed_challenge: The signed challenge from external signing. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.ArchivePermissionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/permissions/{permissionId}/archive", path_params={"permissionId": permission_id}, @@ -72,24 +74,21 @@ def archive_permission_complete( body=body, user_action=user_action_token, ) - return cast(T.ArchivePermissionResponse, response) - def list_permission_assignments( - self, permission_id: str, query: T.ListPermissionAssignmentsQuery | None = None - ) -> T.ListPermissionAssignmentsResponse: + def list_permission_assignments(self, permission_id: str, query: Optional[T.ListPermissionAssignmentsQuery] = None) -> T.ListPermissionAssignmentsResponse: """ List Permission Assignments. Lists all permission (role) assignments for a given permission. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - query: Query parameters. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + query: Query parameters. Returns: T.ListPermissionAssignmentsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/permissions/{permissionId}/assignments", path_params={"permissionId": permission_id}, @@ -97,23 +96,20 @@ def list_permission_assignments( body=None, requires_signature=False, ) - return cast(T.ListPermissionAssignmentsResponse, response) - def assign_permission_init( - self, permission_id: str, body: T.AssignPermissionRequest - ) -> UserActionChallengeResponse: + def assign_permission_init(self, permission_id: str, body: T.AssignPermissionRequest) -> UserActionChallengeResponse: """ Initialize Assign Permission. Creates a user action challenge for external signing. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/permissions/{permissionId}/assignments" path = path.replace("{permissionId}", str(permission_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -125,26 +121,26 @@ def assign_permission_init( user_action_payload=payload, ) - def assign_permission_complete( - self, permission_id: str, body: T.AssignPermissionRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.AssignPermissionResponse: + def assign_permission_complete(self, permission_id: str, body: T.AssignPermissionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.AssignPermissionResponse: """ Complete Assign Permission. Submits the signed challenge and makes the API request. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. - signed_challenge: The signed challenge from external signing. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.AssignPermissionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/permissions/{permissionId}/assignments", path_params={"permissionId": permission_id}, @@ -152,21 +148,20 @@ def assign_permission_complete( body=body, user_action=user_action_token, ) - return cast(T.AssignPermissionResponse, response) - def list_permissions(self, query: T.ListPermissionsQuery | None = None) -> T.ListPermissionsResponse: + def list_permissions(self, query: Optional[T.ListPermissionsQuery] = None) -> T.ListPermissionsResponse: """ List Permissions. Lists all permissions (roles) in the organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListPermissionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/permissions", path_params={}, @@ -174,7 +169,6 @@ def list_permissions(self, query: T.ListPermissionsQuery | None = None) -> T.Lis body=None, requires_signature=False, ) - return cast(T.ListPermissionsResponse, response) def create_permission_init(self, body: T.CreatePermissionRequest) -> UserActionChallengeResponse: """ @@ -183,11 +177,11 @@ def create_permission_init(self, body: T.CreatePermissionRequest) -> UserActionC Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/permissions" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -198,25 +192,25 @@ def create_permission_init(self, body: T.CreatePermissionRequest) -> UserActionC user_action_payload=payload, ) - def create_permission_complete( - self, body: T.CreatePermissionRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreatePermissionResponse: + def create_permission_complete(self, body: T.CreatePermissionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreatePermissionResponse: """ Complete Create Permission. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreatePermissionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/permissions", path_params={}, @@ -224,24 +218,21 @@ def create_permission_complete( body=body, user_action=user_action_token, ) - return cast(T.CreatePermissionResponse, response) - def revoke_permission_init( - self, permission_id: str, assignment_id: str, query: T.RevokePermissionQuery | None = None - ) -> UserActionChallengeResponse: + def revoke_permission_init(self, permission_id: str, assignment_id: str, query: Optional[T.RevokePermissionQuery] = None) -> UserActionChallengeResponse: """ Initialize Revoke Permission. Creates a user action challenge for external signing. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - assignment_id: ID of the permission assignment. - query: Query parameters. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + assignment_id: ID of the permission assignment. + query: Query parameters. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/permissions/{permissionId}/assignments/{assignmentId}" path = path.replace("{permissionId}", str(permission_id)) path = path.replace("{assignmentId}", str(assignment_id)) @@ -254,28 +245,24 @@ def revoke_permission_init( user_action_payload=payload, ) - def revoke_permission_complete( - self, - permission_id: str, - assignment_id: str, - signed_challenge: SignUserActionChallengeRequest, - query: T.RevokePermissionQuery | None = None, - ) -> None: + def revoke_permission_complete(self, permission_id: str, assignment_id: str, signed_challenge: SignUserActionChallengeRequest, query: Optional[T.RevokePermissionQuery] = None) -> None: """ Complete Revoke Permission. Submits the signed challenge and makes the API request. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - assignment_id: ID of the permission assignment. - signed_challenge: The signed challenge from external signing. - query: Query parameters. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + permission_id: ID of the permission (also referred to as "role" in the dashboard). + assignment_id: ID of the permission assignment. + signed_challenge: The signed challenge from external signing. + query: Query parameters. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/permissions/{permissionId}/assignments/{assignmentId}", path_params={"permissionId": permission_id, "assignmentId": assignment_id}, @@ -291,12 +278,12 @@ def get_permission(self, permission_id: str) -> T.GetPermissionResponse: Retrieves a permission (role) by ID, including any pending change request. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). + permission_id: ID of the permission (also referred to as "role" in the dashboard). Returns: T.GetPermissionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/permissions/{permissionId}", path_params={"permissionId": permission_id}, @@ -304,23 +291,20 @@ def get_permission(self, permission_id: str) -> T.GetPermissionResponse: body=None, requires_signature=False, ) - return cast(T.GetPermissionResponse, response) - def update_permission_init( - self, permission_id: str, body: T.UpdatePermissionRequest - ) -> UserActionChallengeResponse: + def update_permission_init(self, permission_id: str, body: T.UpdatePermissionRequest) -> UserActionChallengeResponse: """ Initialize Update Permission. Creates a user action challenge for external signing. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/permissions/{permissionId}" path = path.replace("{permissionId}", str(permission_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -332,26 +316,26 @@ def update_permission_init( user_action_payload=payload, ) - def update_permission_complete( - self, permission_id: str, body: T.UpdatePermissionRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UpdatePermissionResponse: + def update_permission_complete(self, permission_id: str, body: T.UpdatePermissionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdatePermissionResponse: """ Complete Update Permission. Submits the signed challenge and makes the API request. Args: - permission_id: ID of the permission (also referred to as "role" in the dashboard). - body: Request body. - signed_challenge: The signed challenge from external signing. + permission_id: ID of the permission (also referred to as "role" in the dashboard). + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdatePermissionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/permissions/{permissionId}", path_params={"permissionId": permission_id}, @@ -359,4 +343,3 @@ def update_permission_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdatePermissionResponse, response) diff --git a/dfns_sdk/generated/permissions/types.py b/dfns_sdk/generated/permissions/types.py index cfc089e..e4d56c6 100644 --- a/dfns_sdk/generated/permissions/types.py +++ b/dfns_sdk/generated/permissions/types.py @@ -1,16 +1,12 @@ """Types for the permissions domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ArchivePermissionRequest(TypedDict, total=False): """archivePermission request body.""" is_archived: bool - class ArchivePermissionResponse(TypedDict, total=False): """archivePermission response.""" @@ -23,27 +19,23 @@ class ArchivePermissionResponse(TypedDict, total=False): date_created: str date_updated: str - class ListPermissionAssignmentsResponse(TypedDict, total=False): """listPermissionAssignments response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListPermissionAssignmentsQuery(TypedDict, total=False): """listPermissionAssignments query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class AssignPermissionRequest(TypedDict, total=False): """assignPermission request body.""" identity_id: str - class AssignPermissionResponse(TypedDict, total=False): """assignPermission response.""" @@ -54,172 +46,23 @@ class AssignPermissionResponse(TypedDict, total=False): date_created: str date_updated: str - class ListPermissionsResponse(TypedDict, total=False): """listPermissions response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListPermissionsQuery(TypedDict, total=False): """listPermissions query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreatePermissionRequest(TypedDict, total=False): """createPermission request body.""" name: str - operations: list[ - Literal[ - "Registry:Addresses:Create", - "Registry:Addresses:Delete", - "Registry:Addresses:Read", - "Registry:Addresses:Update", - "Registry:ContractSchemas:Create", - "Registry:ContractSchemas:Delete", - "Registry:ContractSchemas:Read", - "Auth:Logs:Read", - "Auth:Users:Create", - "Auth:Users:Read", - "Auth:Users:Update", - "Auth:Users:Activate", - "Auth:Users:Deactivate", - "Auth:Users:Delete", - "Auth:ServiceAccounts:Create", - "Auth:ServiceAccounts:Read", - "Auth:ServiceAccounts:Update", - "Auth:ServiceAccounts:Deactivate", - "Auth:ServiceAccounts:Activate", - "Auth:ServiceAccounts:Delete", - "Auth:Pats:Create", - "Auth:Register:Delegated", - "Auth:Login:Delegated", - "Auth:Recover:Delegated", - "Agreements:Acceptance:Create", - "Agreements:Acceptance:Read", - "Events:Read", - "Exchanges:Create", - "Exchanges:Read", - "Exchanges:Delete", - "Exchanges:Deposits:Create", - "Exchanges:Withdrawals:Create", - "FeeSponsors:Create", - "FeeSponsors:Read", - "FeeSponsors:Update", - "FeeSponsors:Delete", - "FeeSponsors:Use", - "Orgs:Read", - "Orgs:Update", - "Orgs:Settings:Read", - "Orgs:Settings:Update", - "Permissions:Archive", - "Permissions:Create", - "Permissions:Read", - "Permissions:Update", - "Permissions:Assign", - "Permissions:Revoke", - "Permissions:Assignments:Read", - "Policies:Archive", - "Policies:Create", - "Policies:Read", - "Policies:Update", - "Policies:Approvals:Read", - "Policies:Approvals:Approve", - "Signers:ListSigners", - "Stakes:Create", - "Stakes:Read", - "Stakes:Update", - "Swaps:Create", - "Swaps:Read", - "Payouts:Create", - "Payouts:Read", - "Payouts:Write", - "Allocations:Create", - "Allocations:Update", - "Allocations:Read", - "Keys:Create", - "Keys:Delete", - "Keys:Read", - "Keys:Update", - "Keys:Reuse", - "Keys:Delegate", - "Keys:Import", - "Keys:Export", - "Keys:Derive", - "Keys:ChildKeys:Create", - "Keys:Signatures:Create", - "Keys:Signatures:Read", - "KeyStores:Read", - "KeyStores:Fleets:Create", - "KeyStores:Fleets:Clone", - "KeyStores:Fleets:AddMacUser", - "KeyStores:ProofOfControl:Create", - "KeyStores:OnchainSignatures:Create", - "Networks:CantonValidators:Create", - "Networks:CantonValidators:Read", - "Networks:CantonValidators:Update", - "Networks:CantonValidators:Delete", - "Wallets:Create", - "Wallets:Read", - "Wallets:Update", - "Wallets:Tags:Add", - "Wallets:Tags:Delete", - "Wallets:Transactions:Create", - "Wallets:Transactions:Read", - "Wallets:Transactions:Abort", - "Wallets:Transfers:Create", - "Wallets:Transfers:Read", - "Wallets:Transfers:Abort", - "Wallets:Offers:Read", - "Wallets:Offers:Settle", - "Vaults:Create", - "Vaults:Read", - "Vaults:Update", - "Vaults:Tags:Add", - "Vaults:Tags:Delete", - "Vaults:Addresses:Create", - "Webhooks:Create", - "Webhooks:Read", - "Webhooks:Update", - "Webhooks:Delete", - "Webhooks:Ping", - "Webhooks:Events:Read", - "Billing:Read", - "Billing:Write", - "Analytics:Read", - ] - | Literal[ - "Alias:Create", - "Alias:Delete", - "Alias:Read", - "Alias:Update", - "Wallets:GenerateSignature", - "Wallets:BroadcastTransaction", - "Auth:Action:Sign", - "Auth:Apps:Read", - "Auth:Apps:Create", - "Auth:Apps:Update", - "Auth:Creds:Create", - "Auth:Creds:Read", - "Auth:Creds:Update", - "Auth:Creds:Code:Create", - "Auth:Types:Application", - "Auth:Types:Employee", - "Auth:Types:EndUser", - "Auth:Types:Pat", - "Auth:Types:ServiceAccount", - "Internal:Auth:Types:Staff", - "Auth:Users:Delegate", - "PermissionAssignments:Create", - "PermissionAssignments:Read", - "PermissionAssignments:Revoke", - ] - ] - + operations: list[Union[Literal["Registry:Addresses:Create", "Registry:Addresses:Delete", "Registry:Addresses:Read", "Registry:Addresses:Update", "Registry:ContractSchemas:Create", "Registry:ContractSchemas:Delete", "Registry:ContractSchemas:Read", "Auth:Logs:Read", "Auth:Users:Create", "Auth:Users:Read", "Auth:Users:Update", "Auth:Users:Activate", "Auth:Users:Deactivate", "Auth:Users:Delete", "Auth:ServiceAccounts:Create", "Auth:ServiceAccounts:Read", "Auth:ServiceAccounts:Update", "Auth:ServiceAccounts:Deactivate", "Auth:ServiceAccounts:Activate", "Auth:ServiceAccounts:Delete", "Auth:Pats:Create", "Auth:Register:Delegated", "Auth:Login:Delegated", "Auth:Recover:Delegated", "Agreements:Acceptance:Create", "Agreements:Acceptance:Read", "Events:Read", "Exchanges:Create", "Exchanges:Read", "Exchanges:Delete", "Exchanges:Deposits:Create", "Exchanges:Withdrawals:Create", "FeeSponsors:Create", "FeeSponsors:Read", "FeeSponsors:Update", "FeeSponsors:Delete", "FeeSponsors:Use", "Orgs:Read", "Orgs:Update", "Orgs:Settings:Read", "Orgs:Settings:Update", "Permissions:Archive", "Permissions:Create", "Permissions:Read", "Permissions:Update", "Permissions:Assign", "Permissions:Revoke", "Permissions:Assignments:Read", "Policies:Archive", "Policies:Create", "Policies:Read", "Policies:Update", "Policies:Approvals:Read", "Policies:Approvals:Approve", "Signers:ListSigners", "Stakes:Create", "Stakes:Read", "Stakes:Update", "Swaps:Create", "Swaps:Read", "Payouts:Create", "Payouts:Read", "Payouts:Write", "Allocations:Create", "Allocations:Update", "Allocations:Read", "Keys:Create", "Keys:Delete", "Keys:Read", "Keys:Update", "Keys:Reuse", "Keys:Delegate", "Keys:Import", "Keys:Export", "Keys:Derive", "Keys:ChildKeys:Create", "Keys:Signatures:Create", "Keys:Signatures:Read", "KeyStores:Read", "KeyStores:Fleets:Create", "KeyStores:Fleets:Clone", "KeyStores:ProofOfControl:Create", "KeyStores:OnchainSignatures:Create", "Networks:CantonValidators:Create", "Networks:CantonValidators:Read", "Networks:CantonValidators:Update", "Networks:CantonValidators:Delete", "Wallets:Create", "Wallets:Read", "Wallets:Update", "Wallets:Tags:Add", "Wallets:Tags:Delete", "Wallets:Transactions:Create", "Wallets:Transactions:Read", "Wallets:Transactions:Abort", "Wallets:Transfers:Create", "Wallets:Transfers:Read", "Wallets:Transfers:Abort", "Wallets:Offers:Read", "Wallets:Offers:Settle", "Vaults:Create", "Vaults:Read", "Vaults:Update", "Vaults:Tags:Add", "Vaults:Tags:Delete", "Webhooks:Create", "Webhooks:Read", "Webhooks:Update", "Webhooks:Delete", "Webhooks:Ping", "Webhooks:Events:Read", "Billing:Read", "Billing:Write", "Analytics:Read"], Literal["Alias:Create", "Alias:Delete", "Alias:Read", "Alias:Update", "Wallets:GenerateSignature", "Wallets:BroadcastTransaction", "Auth:Action:Sign", "Auth:Apps:Read", "Auth:Apps:Create", "Auth:Apps:Update", "Auth:Creds:Create", "Auth:Creds:Read", "Auth:Creds:Update", "Auth:Creds:Code:Create", "Auth:Types:Application", "Auth:Types:Employee", "Auth:Types:EndUser", "Auth:Types:Pat", "Auth:Types:ServiceAccount", "Internal:Auth:Types:Staff", "Auth:Users:Delegate", "PermissionAssignments:Create", "PermissionAssignments:Read", "PermissionAssignments:Revoke"]]] class CreatePermissionResponse(TypedDict, total=False): """createPermission response.""" @@ -233,13 +76,11 @@ class CreatePermissionResponse(TypedDict, total=False): date_created: str date_updated: str - class RevokePermissionQuery(TypedDict, total=False): """revokePermission query parameters.""" force: NotRequired[bool] - class GetPermissionResponse(TypedDict, total=False): """getPermission response.""" @@ -251,162 +92,13 @@ class GetPermissionResponse(TypedDict, total=False): is_archived: bool date_created: str date_updated: str - pending_change_request: NotRequired[dict[str, Any]] - + pending_change_request: NotRequired[TypedDict] class UpdatePermissionRequest(TypedDict, total=False): """updatePermission request body.""" name: NotRequired[str] - operations: NotRequired[ - list[ - Literal[ - "Registry:Addresses:Create", - "Registry:Addresses:Delete", - "Registry:Addresses:Read", - "Registry:Addresses:Update", - "Registry:ContractSchemas:Create", - "Registry:ContractSchemas:Delete", - "Registry:ContractSchemas:Read", - "Auth:Logs:Read", - "Auth:Users:Create", - "Auth:Users:Read", - "Auth:Users:Update", - "Auth:Users:Activate", - "Auth:Users:Deactivate", - "Auth:Users:Delete", - "Auth:ServiceAccounts:Create", - "Auth:ServiceAccounts:Read", - "Auth:ServiceAccounts:Update", - "Auth:ServiceAccounts:Deactivate", - "Auth:ServiceAccounts:Activate", - "Auth:ServiceAccounts:Delete", - "Auth:Pats:Create", - "Auth:Register:Delegated", - "Auth:Login:Delegated", - "Auth:Recover:Delegated", - "Agreements:Acceptance:Create", - "Agreements:Acceptance:Read", - "Events:Read", - "Exchanges:Create", - "Exchanges:Read", - "Exchanges:Delete", - "Exchanges:Deposits:Create", - "Exchanges:Withdrawals:Create", - "FeeSponsors:Create", - "FeeSponsors:Read", - "FeeSponsors:Update", - "FeeSponsors:Delete", - "FeeSponsors:Use", - "Orgs:Read", - "Orgs:Update", - "Orgs:Settings:Read", - "Orgs:Settings:Update", - "Permissions:Archive", - "Permissions:Create", - "Permissions:Read", - "Permissions:Update", - "Permissions:Assign", - "Permissions:Revoke", - "Permissions:Assignments:Read", - "Policies:Archive", - "Policies:Create", - "Policies:Read", - "Policies:Update", - "Policies:Approvals:Read", - "Policies:Approvals:Approve", - "Signers:ListSigners", - "Stakes:Create", - "Stakes:Read", - "Stakes:Update", - "Swaps:Create", - "Swaps:Read", - "Payouts:Create", - "Payouts:Read", - "Payouts:Write", - "Allocations:Create", - "Allocations:Update", - "Allocations:Read", - "Keys:Create", - "Keys:Delete", - "Keys:Read", - "Keys:Update", - "Keys:Reuse", - "Keys:Delegate", - "Keys:Import", - "Keys:Export", - "Keys:Derive", - "Keys:ChildKeys:Create", - "Keys:Signatures:Create", - "Keys:Signatures:Read", - "KeyStores:Read", - "KeyStores:Fleets:Create", - "KeyStores:Fleets:Clone", - "KeyStores:Fleets:AddMacUser", - "KeyStores:ProofOfControl:Create", - "KeyStores:OnchainSignatures:Create", - "Networks:CantonValidators:Create", - "Networks:CantonValidators:Read", - "Networks:CantonValidators:Update", - "Networks:CantonValidators:Delete", - "Wallets:Create", - "Wallets:Read", - "Wallets:Update", - "Wallets:Tags:Add", - "Wallets:Tags:Delete", - "Wallets:Transactions:Create", - "Wallets:Transactions:Read", - "Wallets:Transactions:Abort", - "Wallets:Transfers:Create", - "Wallets:Transfers:Read", - "Wallets:Transfers:Abort", - "Wallets:Offers:Read", - "Wallets:Offers:Settle", - "Vaults:Create", - "Vaults:Read", - "Vaults:Update", - "Vaults:Tags:Add", - "Vaults:Tags:Delete", - "Vaults:Addresses:Create", - "Webhooks:Create", - "Webhooks:Read", - "Webhooks:Update", - "Webhooks:Delete", - "Webhooks:Ping", - "Webhooks:Events:Read", - "Billing:Read", - "Billing:Write", - "Analytics:Read", - ] - | Literal[ - "Alias:Create", - "Alias:Delete", - "Alias:Read", - "Alias:Update", - "Wallets:GenerateSignature", - "Wallets:BroadcastTransaction", - "Auth:Action:Sign", - "Auth:Apps:Read", - "Auth:Apps:Create", - "Auth:Apps:Update", - "Auth:Creds:Create", - "Auth:Creds:Read", - "Auth:Creds:Update", - "Auth:Creds:Code:Create", - "Auth:Types:Application", - "Auth:Types:Employee", - "Auth:Types:EndUser", - "Auth:Types:Pat", - "Auth:Types:ServiceAccount", - "Internal:Auth:Types:Staff", - "Auth:Users:Delegate", - "PermissionAssignments:Create", - "PermissionAssignments:Read", - "PermissionAssignments:Revoke", - ] - ] - ] - + operations: NotRequired[list[Union[Literal["Registry:Addresses:Create", "Registry:Addresses:Delete", "Registry:Addresses:Read", "Registry:Addresses:Update", "Registry:ContractSchemas:Create", "Registry:ContractSchemas:Delete", "Registry:ContractSchemas:Read", "Auth:Logs:Read", "Auth:Users:Create", "Auth:Users:Read", "Auth:Users:Update", "Auth:Users:Activate", "Auth:Users:Deactivate", "Auth:Users:Delete", "Auth:ServiceAccounts:Create", "Auth:ServiceAccounts:Read", "Auth:ServiceAccounts:Update", "Auth:ServiceAccounts:Deactivate", "Auth:ServiceAccounts:Activate", "Auth:ServiceAccounts:Delete", "Auth:Pats:Create", "Auth:Register:Delegated", "Auth:Login:Delegated", "Auth:Recover:Delegated", "Agreements:Acceptance:Create", "Agreements:Acceptance:Read", "Events:Read", "Exchanges:Create", "Exchanges:Read", "Exchanges:Delete", "Exchanges:Deposits:Create", "Exchanges:Withdrawals:Create", "FeeSponsors:Create", "FeeSponsors:Read", "FeeSponsors:Update", "FeeSponsors:Delete", "FeeSponsors:Use", "Orgs:Read", "Orgs:Update", "Orgs:Settings:Read", "Orgs:Settings:Update", "Permissions:Archive", "Permissions:Create", "Permissions:Read", "Permissions:Update", "Permissions:Assign", "Permissions:Revoke", "Permissions:Assignments:Read", "Policies:Archive", "Policies:Create", "Policies:Read", "Policies:Update", "Policies:Approvals:Read", "Policies:Approvals:Approve", "Signers:ListSigners", "Stakes:Create", "Stakes:Read", "Stakes:Update", "Swaps:Create", "Swaps:Read", "Payouts:Create", "Payouts:Read", "Payouts:Write", "Allocations:Create", "Allocations:Update", "Allocations:Read", "Keys:Create", "Keys:Delete", "Keys:Read", "Keys:Update", "Keys:Reuse", "Keys:Delegate", "Keys:Import", "Keys:Export", "Keys:Derive", "Keys:ChildKeys:Create", "Keys:Signatures:Create", "Keys:Signatures:Read", "KeyStores:Read", "KeyStores:Fleets:Create", "KeyStores:Fleets:Clone", "KeyStores:ProofOfControl:Create", "KeyStores:OnchainSignatures:Create", "Networks:CantonValidators:Create", "Networks:CantonValidators:Read", "Networks:CantonValidators:Update", "Networks:CantonValidators:Delete", "Wallets:Create", "Wallets:Read", "Wallets:Update", "Wallets:Tags:Add", "Wallets:Tags:Delete", "Wallets:Transactions:Create", "Wallets:Transactions:Read", "Wallets:Transactions:Abort", "Wallets:Transfers:Create", "Wallets:Transfers:Read", "Wallets:Transfers:Abort", "Wallets:Offers:Read", "Wallets:Offers:Settle", "Vaults:Create", "Vaults:Read", "Vaults:Update", "Vaults:Tags:Add", "Vaults:Tags:Delete", "Webhooks:Create", "Webhooks:Read", "Webhooks:Update", "Webhooks:Delete", "Webhooks:Ping", "Webhooks:Events:Read", "Billing:Read", "Billing:Write", "Analytics:Read"], Literal["Alias:Create", "Alias:Delete", "Alias:Read", "Alias:Update", "Wallets:GenerateSignature", "Wallets:BroadcastTransaction", "Auth:Action:Sign", "Auth:Apps:Read", "Auth:Apps:Create", "Auth:Apps:Update", "Auth:Creds:Create", "Auth:Creds:Read", "Auth:Creds:Update", "Auth:Creds:Code:Create", "Auth:Types:Application", "Auth:Types:Employee", "Auth:Types:EndUser", "Auth:Types:Pat", "Auth:Types:ServiceAccount", "Internal:Auth:Types:Staff", "Auth:Users:Delegate", "PermissionAssignments:Create", "PermissionAssignments:Read", "PermissionAssignments:Revoke"]]]] class UpdatePermissionResponse(TypedDict, total=False): """updatePermission response.""" diff --git a/dfns_sdk/generated/policies/__init__.py b/dfns_sdk/generated/policies/__init__.py index cf04d0c..ec37729 100644 --- a/dfns_sdk/generated/policies/__init__.py +++ b/dfns_sdk/generated/policies/__init__.py @@ -1,7 +1,7 @@ """Policies domain module.""" -from . import types from .client import PoliciesClient from .delegated_client import DelegatedPoliciesClient +from . import types __all__ = ["PoliciesClient", "DelegatedPoliciesClient", "types"] diff --git a/dfns_sdk/generated/policies/client.py b/dfns_sdk/generated/policies/client.py index bd0a687..625ab0f 100644 --- a/dfns_sdk/generated/policies/client.py +++ b/dfns_sdk/generated/policies/client.py @@ -1,6 +1,6 @@ """Client for the policies domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -19,12 +19,12 @@ def get_policy(self, policy_id: str) -> T.GetPolicyResponse: Retrieve information about a specific policy. Args: - policy_id: Path parameter. + policy_id: Path parameter. Returns: T.GetPolicyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policies/{policyId}", path_params={"policyId": policy_id}, @@ -32,22 +32,21 @@ def get_policy(self, policy_id: str) -> T.GetPolicyResponse: body=None, requires_signature=False, ) - return cast(T.GetPolicyResponse, response) - def update_policy(self, policy_id: str, body: dict[str, Any]) -> dict[str, Any]: + def update_policy(self, policy_id: str, body: dict[str, Any]) -> TypedDict: """ Update Policy. Update an existing policy. Args: - policy_id: Path parameter. - body: Request body. + policy_id: Path parameter. + body: Request body. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="PUT", path="/v2/policies/{policyId}", path_params={"policyId": policy_id}, @@ -55,21 +54,20 @@ def update_policy(self, policy_id: str, body: dict[str, Any]) -> dict[str, Any]: body=body, requires_signature=True, ) - return cast(dict[str, Any], response) - def delete_policy(self, policy_id: str) -> dict[str, Any]: + def delete_policy(self, policy_id: str) -> TypedDict: """ Delete Policy. Delete an existing policy. Args: - policy_id: Path parameter. + policy_id: Path parameter. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + TypedDict: The API response. + """ + return self._http.request( method="DELETE", path="/v2/policies/{policyId}", path_params={"policyId": policy_id}, @@ -77,24 +75,21 @@ def delete_policy(self, policy_id: str) -> dict[str, Any]: body=None, requires_signature=True, ) - return cast(dict[str, Any], response) - def create_approval_decision( - self, approval_id: str, body: T.CreateApprovalDecisionRequest - ) -> T.CreateApprovalDecisionResponse: + def create_approval_decision(self, approval_id: str, body: T.CreateApprovalDecisionRequest) -> T.CreateApprovalDecisionResponse: """ Create Approval Decision. Approve or Reject an Approval request. Args: - approval_id: Path parameter. - body: Request body. + approval_id: Path parameter. + body: Request body. Returns: T.CreateApprovalDecisionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/v2/policy-approvals/{approvalId}/decisions", path_params={"approvalId": approval_id}, @@ -102,21 +97,20 @@ def create_approval_decision( body=body, requires_signature=True, ) - return cast(T.CreateApprovalDecisionResponse, response) - def list_policies(self, query: T.ListPoliciesQuery | None = None) -> T.ListPoliciesResponse: + def list_policies(self, query: Optional[T.ListPoliciesQuery] = None) -> T.ListPoliciesResponse: """ List Policies. Retrieve the list of policies on your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListPoliciesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policies", path_params={}, @@ -124,25 +118,24 @@ def list_policies(self, query: T.ListPoliciesQuery | None = None) -> T.ListPolic body=None, requires_signature=False, ) - return cast(T.ListPoliciesResponse, response) - def create_policy(self, body: dict[str, Any]) -> dict[str, Any]: + def create_policy(self, body: dict[str, Any]) -> TypedDict: """ - Create Policy. - - Setup a new Policy for your organization. + Create Policy. - Every policy requires a rule to be specified. Upon policy evaluation, the configuration specified in the rule will be used to determine whether the policy should trigger or not for a given activity. + Setup a new Policy for your organization. + + Every policy requires a rule to be specified. Upon policy evaluation, the configuration specified in the rule will be used to determine whether the policy should trigger or not for a given activity. + + By exposing controls on permissions and policies, Dfns enables the specification of an admin quorum to approve sensitive actions which could change system governance. Note Dfns does not expose a separate "admin quorum" concept like some of our competitors - we simply enable this use case as another configuration of the policy engine itself. This was chosen to promote flexibility as not every customer will have the same requirements around creating and managing admin quorums. - By exposing controls on permissions and policies, Dfns enables the specification of an admin quorum to approve sensitive actions which could change system governance. Note Dfns does not expose a separate "admin quorum" concept like some of our competitors - we simply enable this use case as another configuration of the policy engine itself. This was chosen to promote flexibility as not every customer will have the same requirements around creating and managing admin quorums. - - Args: - body: Request body. + Args: + body: Request body. - Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + TypedDict: The API response. + """ + return self._http.request( method="POST", path="/v2/policies", path_params={}, @@ -150,7 +143,6 @@ def create_policy(self, body: dict[str, Any]) -> dict[str, Any]: body=body, requires_signature=True, ) - return cast(dict[str, Any], response) def get_approval(self, approval_id: str) -> T.GetApprovalResponse: """ @@ -159,12 +151,12 @@ def get_approval(self, approval_id: str) -> T.GetApprovalResponse: Retrieve information about a specific approval request. Args: - approval_id: Path parameter. + approval_id: Path parameter. Returns: T.GetApprovalResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policy-approvals/{approvalId}", path_params={"approvalId": approval_id}, @@ -172,21 +164,20 @@ def get_approval(self, approval_id: str) -> T.GetApprovalResponse: body=None, requires_signature=False, ) - return cast(T.GetApprovalResponse, response) - def list_approvals(self, query: T.ListApprovalsQuery | None = None) -> T.ListApprovalsResponse: + def list_approvals(self, query: Optional[T.ListApprovalsQuery] = None) -> T.ListApprovalsResponse: """ List Approvals. Retrieve the list of pending approval requests. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListApprovalsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policy-approvals", path_params={}, @@ -194,4 +185,3 @@ def list_approvals(self, query: T.ListApprovalsQuery | None = None) -> T.ListApp body=None, requires_signature=False, ) - return cast(T.ListApprovalsResponse, response) diff --git a/dfns_sdk/generated/policies/delegated_client.py b/dfns_sdk/generated/policies/delegated_client.py index 06b4786..12ab121 100644 --- a/dfns_sdk/generated/policies/delegated_client.py +++ b/dfns_sdk/generated/policies/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the policies domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -26,12 +30,12 @@ def get_policy(self, policy_id: str) -> T.GetPolicyResponse: Retrieve information about a specific policy. Args: - policy_id: Path parameter. + policy_id: Path parameter. Returns: T.GetPolicyResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policies/{policyId}", path_params={"policyId": policy_id}, @@ -39,7 +43,6 @@ def get_policy(self, policy_id: str) -> T.GetPolicyResponse: body=None, requires_signature=False, ) - return cast(T.GetPolicyResponse, response) def update_policy_init(self, policy_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -48,12 +51,12 @@ def update_policy_init(self, policy_id: str, body: dict[str, Any]) -> UserAction Creates a user action challenge for external signing. Args: - policy_id: Path parameter. - body: Request body. + policy_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/v2/policies/{policyId}" path = path.replace("{policyId}", str(policy_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -65,26 +68,26 @@ def update_policy_init(self, policy_id: str, body: dict[str, Any]) -> UserAction user_action_payload=payload, ) - def update_policy_complete( - self, policy_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> dict[str, Any]: + def update_policy_complete(self, policy_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> TypedDict: """ Complete Update Policy. Submits the signed challenge and makes the API request. Args: - policy_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + policy_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + TypedDict: The API response. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/v2/policies/{policyId}", path_params={"policyId": policy_id}, @@ -92,7 +95,6 @@ def update_policy_complete( body=body, user_action=user_action_token, ) - return cast(dict[str, Any], response) def delete_policy_init(self, policy_id: str) -> UserActionChallengeResponse: """ @@ -101,11 +103,11 @@ def delete_policy_init(self, policy_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - policy_id: Path parameter. + policy_id: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/v2/policies/{policyId}" path = path.replace("{policyId}", str(policy_id)) payload = "" @@ -117,25 +119,25 @@ def delete_policy_init(self, policy_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def delete_policy_complete( - self, policy_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> dict[str, Any]: + def delete_policy_complete(self, policy_id: str, signed_challenge: SignUserActionChallengeRequest) -> TypedDict: """ Complete Delete Policy. Submits the signed challenge and makes the API request. Args: - policy_id: Path parameter. - signed_challenge: The signed challenge from external signing. + policy_id: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + TypedDict: The API response. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/v2/policies/{policyId}", path_params={"policyId": policy_id}, @@ -143,23 +145,20 @@ def delete_policy_complete( body=None, user_action=user_action_token, ) - return cast(dict[str, Any], response) - def create_approval_decision_init( - self, approval_id: str, body: T.CreateApprovalDecisionRequest - ) -> UserActionChallengeResponse: + def create_approval_decision_init(self, approval_id: str, body: T.CreateApprovalDecisionRequest) -> UserActionChallengeResponse: """ Initialize Create Approval Decision. Creates a user action challenge for external signing. Args: - approval_id: Path parameter. - body: Request body. + approval_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/v2/policy-approvals/{approvalId}/decisions" path = path.replace("{approvalId}", str(approval_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -171,26 +170,26 @@ def create_approval_decision_init( user_action_payload=payload, ) - def create_approval_decision_complete( - self, approval_id: str, body: T.CreateApprovalDecisionRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateApprovalDecisionResponse: + def create_approval_decision_complete(self, approval_id: str, body: T.CreateApprovalDecisionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateApprovalDecisionResponse: """ Complete Create Approval Decision. Submits the signed challenge and makes the API request. Args: - approval_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + approval_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateApprovalDecisionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/v2/policy-approvals/{approvalId}/decisions", path_params={"approvalId": approval_id}, @@ -198,21 +197,20 @@ def create_approval_decision_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateApprovalDecisionResponse, response) - def list_policies(self, query: T.ListPoliciesQuery | None = None) -> T.ListPoliciesResponse: + def list_policies(self, query: Optional[T.ListPoliciesQuery] = None) -> T.ListPoliciesResponse: """ List Policies. Retrieve the list of policies on your organization. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListPoliciesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policies", path_params={}, @@ -220,7 +218,6 @@ def list_policies(self, query: T.ListPoliciesQuery | None = None) -> T.ListPolic body=None, requires_signature=False, ) - return cast(T.ListPoliciesResponse, response) def create_policy_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -229,11 +226,11 @@ def create_policy_init(self, body: dict[str, Any]) -> UserActionChallengeRespons Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/v2/policies" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -244,25 +241,25 @@ def create_policy_init(self, body: dict[str, Any]) -> UserActionChallengeRespons user_action_payload=payload, ) - def create_policy_complete( - self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> dict[str, Any]: + def create_policy_complete(self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> TypedDict: """ Complete Create Policy. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: - dict[str, Any]: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + TypedDict: The API response. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/v2/policies", path_params={}, @@ -270,7 +267,6 @@ def create_policy_complete( body=body, user_action=user_action_token, ) - return cast(dict[str, Any], response) def get_approval(self, approval_id: str) -> T.GetApprovalResponse: """ @@ -279,12 +275,12 @@ def get_approval(self, approval_id: str) -> T.GetApprovalResponse: Retrieve information about a specific approval request. Args: - approval_id: Path parameter. + approval_id: Path parameter. Returns: T.GetApprovalResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policy-approvals/{approvalId}", path_params={"approvalId": approval_id}, @@ -292,21 +288,20 @@ def get_approval(self, approval_id: str) -> T.GetApprovalResponse: body=None, requires_signature=False, ) - return cast(T.GetApprovalResponse, response) - def list_approvals(self, query: T.ListApprovalsQuery | None = None) -> T.ListApprovalsResponse: + def list_approvals(self, query: Optional[T.ListApprovalsQuery] = None) -> T.ListApprovalsResponse: """ List Approvals. Retrieve the list of pending approval requests. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListApprovalsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/v2/policy-approvals", path_params={}, @@ -314,4 +309,3 @@ def list_approvals(self, query: T.ListApprovalsQuery | None = None) -> T.ListApp body=None, requires_signature=False, ) - return cast(T.ListApprovalsResponse, response) diff --git a/dfns_sdk/generated/policies/types.py b/dfns_sdk/generated/policies/types.py index 60d9e41..e976229 100644 --- a/dfns_sdk/generated/policies/types.py +++ b/dfns_sdk/generated/policies/types.py @@ -1,15 +1,11 @@ """Types for the policies domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class GetPolicyResponse(TypedDict, total=False): """getPolicy response.""" - pending_change_request: NotRequired[dict[str, Any]] - + pending_change_request: NotRequired[TypedDict] class CreateApprovalDecisionRequest(TypedDict, total=False): """createApprovalDecision request body.""" @@ -17,29 +13,26 @@ class CreateApprovalDecisionRequest(TypedDict, total=False): value: Literal["Approved", "Denied"] reason: NotRequired[str] - class CreateApprovalDecisionResponse(TypedDict, total=False): """createApprovalDecision response.""" id: str initiator_id: str - activity: dict[str, Any] + activity: TypedDict status: Literal["Pending", "Approved", "Denied", "Expired"] expiration_date: NotRequired[str] date_created: NotRequired[str] date_updated: str date_resolved: NotRequired[str] - policy_evaluations: list[dict[str, Any]] - decisions: list[dict[str, Any]] - + policy_evaluations: list[TypedDict] + decisions: list[TypedDict] class ListPoliciesResponse(TypedDict, total=False): """listPolicies response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListPoliciesQuery(TypedDict, total=False): """listPolicies query parameters.""" @@ -47,29 +40,26 @@ class ListPoliciesQuery(TypedDict, total=False): pagination_token: NotRequired[str] status: NotRequired[Literal["Active", "Archived"]] - class GetApprovalResponse(TypedDict, total=False): """getApproval response.""" id: str initiator_id: str - activity: dict[str, Any] + activity: TypedDict status: Literal["Pending", "Approved", "Denied", "Expired"] expiration_date: NotRequired[str] date_created: NotRequired[str] date_updated: str date_resolved: NotRequired[str] - policy_evaluations: list[dict[str, Any]] - decisions: list[dict[str, Any]] - + policy_evaluations: list[TypedDict] + decisions: list[TypedDict] class ListApprovalsResponse(TypedDict, total=False): """listApprovals response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListApprovalsQuery(TypedDict, total=False): """listApprovals query parameters.""" diff --git a/dfns_sdk/generated/signers/__init__.py b/dfns_sdk/generated/signers/__init__.py index 160dbde..6e392a3 100644 --- a/dfns_sdk/generated/signers/__init__.py +++ b/dfns_sdk/generated/signers/__init__.py @@ -1,7 +1,7 @@ """Signers domain module.""" -from . import types from .client import SignersClient from .delegated_client import DelegatedSignersClient +from . import types __all__ = ["SignersClient", "DelegatedSignersClient", "types"] diff --git a/dfns_sdk/generated/signers/client.py b/dfns_sdk/generated/signers/client.py index cb469c9..4fa7e22 100644 --- a/dfns_sdk/generated/signers/client.py +++ b/dfns_sdk/generated/signers/client.py @@ -1,6 +1,6 @@ """Client for the signers domain.""" -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,32 +12,15 @@ class SignersClient: def __init__(self, http_client: HttpClient): self._http = http_client - def create_add_mac_user_input(self, store_id: str, body: T.CreateAddMacUserInputRequest) -> None: - """ - Create Add Mac User Input. - - Args: - store_id: Path parameter. - body: Request body. - """ # noqa: E501 - self._http.request( - method="POST", - path="/key-stores/{storeId}/add-mac-user/input", - path_params={"storeId": store_id}, - query_params=None, - body=body, - requires_signature=True, - ) - def create_clone_input(self, store_id: str, body: T.CreateCloneInputRequest) -> None: """ Create Clone Input. Args: - store_id: Path parameter. - body: Request body. - """ # noqa: E501 - self._http.request( + store_id: Path parameter. + body: Request body. + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/clone/input", path_params={"storeId": store_id}, @@ -51,10 +34,10 @@ def create_genesis_input(self, store_id: str, body: T.CreateGenesisInputRequest) Create Genesis Input. Args: - store_id: Path parameter. - body: Request body. - """ # noqa: E501 - self._http.request( + store_id: Path parameter. + body: Request body. + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/genesis/input", path_params={"storeId": store_id}, @@ -68,10 +51,10 @@ def create_onchain_sign_input(self, store_id: str, body: T.CreateOnchainSignInpu Create Onchain Sign Input. Args: - store_id: Path parameter. - body: Request body. - """ # noqa: E501 - self._http.request( + store_id: Path parameter. + body: Request body. + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/onchain-sign/input", path_params={"storeId": store_id}, @@ -85,10 +68,10 @@ def create_proof_of_control_input(self, store_id: str, body: T.CreateProofOfCont Create Proof Of Control Input. Args: - store_id: Path parameter. - body: Request body. - """ # noqa: E501 - self._http.request( + store_id: Path parameter. + body: Request body. + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/proof-of-control/input", path_params={"storeId": store_id}, @@ -103,8 +86,8 @@ def list_key_stores(self) -> T.ListKeyStoresResponse: Returns: T.ListKeyStoresResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/key-stores", path_params={}, @@ -112,7 +95,6 @@ def list_key_stores(self) -> T.ListKeyStoresResponse: body=None, requires_signature=False, ) - return cast(T.ListKeyStoresResponse, response) def list_signers(self) -> T.ListSignersResponse: """ @@ -120,8 +102,8 @@ def list_signers(self) -> T.ListSignersResponse: Returns: T.ListSignersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/signers", path_params={}, @@ -129,129 +111,83 @@ def list_signers(self) -> T.ListSignersResponse: body=None, requires_signature=False, ) - return cast(T.ListSignersResponse, response) - def submit_add_mac_user_output( - self, store_id: str, body: T.SubmitAddMacUserOutputRequest, file: bytes - ) -> T.SubmitAddMacUserOutputResponse: - """ - Submit Add Mac User Output. - - Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. - - Returns: - T.SubmitAddMacUserOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( - method="POST", - path="/key-stores/{storeId}/add-mac-user/output", - path_params={"storeId": store_id}, - query_params=None, - body=body, - file=file, - requires_signature=True, - ) - return cast(T.SubmitAddMacUserOutputResponse, response) - - def submit_clone_output( - self, store_id: str, body: T.SubmitCloneOutputRequest, file: bytes - ) -> T.SubmitCloneOutputResponse: + def submit_clone_output(self, store_id: str, body: T.SubmitCloneOutputRequest) -> T.SubmitCloneOutputResponse: """ Submit Clone Output. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. Returns: T.SubmitCloneOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/clone/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, requires_signature=True, ) - return cast(T.SubmitCloneOutputResponse, response) - def submit_genesis_output( - self, store_id: str, body: T.SubmitGenesisOutputRequest, file: bytes - ) -> T.SubmitGenesisOutputResponse: + def submit_genesis_output(self, store_id: str, body: T.SubmitGenesisOutputRequest) -> T.SubmitGenesisOutputResponse: """ Submit Genesis Output. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. Returns: T.SubmitGenesisOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/genesis/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, requires_signature=True, ) - return cast(T.SubmitGenesisOutputResponse, response) - def submit_onchain_sign_output( - self, store_id: str, body: T.SubmitOnchainSignOutputRequest, file: bytes - ) -> T.SubmitOnchainSignOutputResponse: + def submit_onchain_sign_output(self, store_id: str, body: T.SubmitOnchainSignOutputRequest) -> T.SubmitOnchainSignOutputResponse: """ Submit Onchain Sign Output. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. Returns: T.SubmitOnchainSignOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/onchain-sign/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, requires_signature=True, ) - return cast(T.SubmitOnchainSignOutputResponse, response) - def submit_proof_of_control_output( - self, store_id: str, body: T.SubmitProofOfControlOutputRequest, file: bytes - ) -> T.SubmitProofOfControlOutputResponse: + def submit_proof_of_control_output(self, store_id: str, body: T.SubmitProofOfControlOutputRequest) -> T.SubmitProofOfControlOutputResponse: """ Submit Proof Of Control Output. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. Returns: T.SubmitProofOfControlOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/key-stores/{storeId}/proof-of-control/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, requires_signature=True, ) - return cast(T.SubmitProofOfControlOutputResponse, response) diff --git a/dfns_sdk/generated/signers/delegated_client.py b/dfns_sdk/generated/signers/delegated_client.py index dfd0b0a..ddf8a90 100644 --- a/dfns_sdk/generated/signers/delegated_client.py +++ b/dfns_sdk/generated/signers/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the signers domain.""" import json -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,57 +23,6 @@ class DelegatedSignersClient: def __init__(self, http_client: HttpClient): self._http = http_client - def create_add_mac_user_input_init( - self, store_id: str, body: T.CreateAddMacUserInputRequest - ) -> UserActionChallengeResponse: - """ - Initialize Create Add Mac User Input. - - Creates a user action challenge for external signing. - - Args: - store_id: Path parameter. - body: Request body. - - Returns: - UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 - path = "/key-stores/{storeId}/add-mac-user/input" - path = path.replace("{storeId}", str(store_id)) - payload = json.dumps(body, separators=(",", ":")) if body else "" - - return BaseAuthApi.create_user_action_challenge( - self._http, - user_action_http_method="POST", - user_action_http_path=path, - user_action_payload=payload, - ) - - def create_add_mac_user_input_complete( - self, store_id: str, body: T.CreateAddMacUserInputRequest, signed_challenge: SignUserActionChallengeRequest - ) -> None: - """ - Complete Create Add Mac User Input. - - Submits the signed challenge and makes the API request. - - Args: - store_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) - user_action_token = user_action_result["userAction"] - - self._http.request_with_user_action( - method="POST", - path="/key-stores/{storeId}/add-mac-user/input", - path_params={"storeId": store_id}, - query_params=None, - body=body, - user_action=user_action_token, - ) - def create_clone_input_init(self, store_id: str, body: T.CreateCloneInputRequest) -> UserActionChallengeResponse: """ Initialize Create Clone Input. @@ -77,12 +30,12 @@ def create_clone_input_init(self, store_id: str, body: T.CreateCloneInputRequest Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. + store_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/key-stores/{storeId}/clone/input" path = path.replace("{storeId}", str(store_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -94,23 +47,23 @@ def create_clone_input_init(self, store_id: str, body: T.CreateCloneInputRequest user_action_payload=payload, ) - def create_clone_input_complete( - self, store_id: str, body: T.CreateCloneInputRequest, signed_challenge: SignUserActionChallengeRequest - ) -> None: + def create_clone_input_complete(self, store_id: str, body: T.CreateCloneInputRequest, signed_challenge: SignUserActionChallengeRequest) -> None: """ Complete Create Clone Input. Submits the signed challenge and makes the API request. Args: - store_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/clone/input", path_params={"storeId": store_id}, @@ -119,21 +72,19 @@ def create_clone_input_complete( user_action=user_action_token, ) - def create_genesis_input_init( - self, store_id: str, body: T.CreateGenesisInputRequest - ) -> UserActionChallengeResponse: + def create_genesis_input_init(self, store_id: str, body: T.CreateGenesisInputRequest) -> UserActionChallengeResponse: """ Initialize Create Genesis Input. Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. + store_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/key-stores/{storeId}/genesis/input" path = path.replace("{storeId}", str(store_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -145,23 +96,23 @@ def create_genesis_input_init( user_action_payload=payload, ) - def create_genesis_input_complete( - self, store_id: str, body: T.CreateGenesisInputRequest, signed_challenge: SignUserActionChallengeRequest - ) -> None: + def create_genesis_input_complete(self, store_id: str, body: T.CreateGenesisInputRequest, signed_challenge: SignUserActionChallengeRequest) -> None: """ Complete Create Genesis Input. Submits the signed challenge and makes the API request. Args: - store_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/genesis/input", path_params={"storeId": store_id}, @@ -170,21 +121,19 @@ def create_genesis_input_complete( user_action=user_action_token, ) - def create_onchain_sign_input_init( - self, store_id: str, body: T.CreateOnchainSignInputRequest - ) -> UserActionChallengeResponse: + def create_onchain_sign_input_init(self, store_id: str, body: T.CreateOnchainSignInputRequest) -> UserActionChallengeResponse: """ Initialize Create Onchain Sign Input. Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. + store_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/key-stores/{storeId}/onchain-sign/input" path = path.replace("{storeId}", str(store_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -196,23 +145,23 @@ def create_onchain_sign_input_init( user_action_payload=payload, ) - def create_onchain_sign_input_complete( - self, store_id: str, body: T.CreateOnchainSignInputRequest, signed_challenge: SignUserActionChallengeRequest - ) -> None: + def create_onchain_sign_input_complete(self, store_id: str, body: T.CreateOnchainSignInputRequest, signed_challenge: SignUserActionChallengeRequest) -> None: """ Complete Create Onchain Sign Input. Submits the signed challenge and makes the API request. Args: - store_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/onchain-sign/input", path_params={"storeId": store_id}, @@ -221,21 +170,19 @@ def create_onchain_sign_input_complete( user_action=user_action_token, ) - def create_proof_of_control_input_init( - self, store_id: str, body: T.CreateProofOfControlInputRequest - ) -> UserActionChallengeResponse: + def create_proof_of_control_input_init(self, store_id: str, body: T.CreateProofOfControlInputRequest) -> UserActionChallengeResponse: """ Initialize Create Proof Of Control Input. Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. + store_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/key-stores/{storeId}/proof-of-control/input" path = path.replace("{storeId}", str(store_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -247,23 +194,23 @@ def create_proof_of_control_input_init( user_action_payload=payload, ) - def create_proof_of_control_input_complete( - self, store_id: str, body: T.CreateProofOfControlInputRequest, signed_challenge: SignUserActionChallengeRequest - ) -> None: + def create_proof_of_control_input_complete(self, store_id: str, body: T.CreateProofOfControlInputRequest, signed_challenge: SignUserActionChallengeRequest) -> None: """ Complete Create Proof Of Control Input. Submits the signed challenge and makes the API request. Args: - store_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/proof-of-control/input", path_params={"storeId": store_id}, @@ -278,8 +225,8 @@ def list_key_stores(self) -> T.ListKeyStoresResponse: Returns: T.ListKeyStoresResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/key-stores", path_params={}, @@ -287,7 +234,6 @@ def list_key_stores(self) -> T.ListKeyStoresResponse: body=None, requires_signature=False, ) - return cast(T.ListKeyStoresResponse, response) def list_signers(self) -> T.ListSignersResponse: """ @@ -295,8 +241,8 @@ def list_signers(self) -> T.ListSignersResponse: Returns: T.ListSignersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/signers", path_params={}, @@ -304,129 +250,211 @@ def list_signers(self) -> T.ListSignersResponse: body=None, requires_signature=False, ) - return cast(T.ListSignersResponse, response) - def submit_add_mac_user_output( - self, store_id: str, body: T.SubmitAddMacUserOutputRequest, file: bytes - ) -> T.SubmitAddMacUserOutputResponse: + def submit_clone_output_init(self, store_id: str, body: T.SubmitCloneOutputRequest) -> UserActionChallengeResponse: """ - Submit Add Mac User Output. + Initialize Submit Clone Output. + + Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. Returns: - T.SubmitAddMacUserOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( - method="POST", - path="/key-stores/{storeId}/add-mac-user/output", - path_params={"storeId": store_id}, - query_params=None, - body=body, - file=file, - requires_signature=True, + UserActionChallengeResponse: The challenge to sign externally. + """ + path = "/key-stores/{storeId}/clone/output" + path = path.replace("{storeId}", str(store_id)) + payload = json.dumps(body, separators=(",", ":")) if body else "" + + return BaseAuthApi.create_user_action_challenge( + self._http, + user_action_http_method="POST", + user_action_http_path=path, + user_action_payload=payload, ) - return cast(T.SubmitAddMacUserOutputResponse, response) - def submit_clone_output( - self, store_id: str, body: T.SubmitCloneOutputRequest, file: bytes - ) -> T.SubmitCloneOutputResponse: + def submit_clone_output_complete(self, store_id: str, body: T.SubmitCloneOutputRequest, signed_challenge: SignUserActionChallengeRequest) -> T.SubmitCloneOutputResponse: """ - Submit Clone Output. + Complete Submit Clone Output. + + Submits the signed challenge and makes the API request. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.SubmitCloneOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) + user_action_token = user_action_result["userAction"] + + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/clone/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, - requires_signature=True, + user_action=user_action_token, ) - return cast(T.SubmitCloneOutputResponse, response) - def submit_genesis_output( - self, store_id: str, body: T.SubmitGenesisOutputRequest, file: bytes - ) -> T.SubmitGenesisOutputResponse: + def submit_genesis_output_init(self, store_id: str, body: T.SubmitGenesisOutputRequest) -> UserActionChallengeResponse: """ - Submit Genesis Output. + Initialize Submit Genesis Output. + + Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. + + Returns: + UserActionChallengeResponse: The challenge to sign externally. + """ + path = "/key-stores/{storeId}/genesis/output" + path = path.replace("{storeId}", str(store_id)) + payload = json.dumps(body, separators=(",", ":")) if body else "" + + return BaseAuthApi.create_user_action_challenge( + self._http, + user_action_http_method="POST", + user_action_http_path=path, + user_action_payload=payload, + ) + + def submit_genesis_output_complete(self, store_id: str, body: T.SubmitGenesisOutputRequest, signed_challenge: SignUserActionChallengeRequest) -> T.SubmitGenesisOutputResponse: + """ + Complete Submit Genesis Output. + + Submits the signed challenge and makes the API request. + + Args: + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.SubmitGenesisOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) + user_action_token = user_action_result["userAction"] + + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/genesis/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, - requires_signature=True, + user_action=user_action_token, ) - return cast(T.SubmitGenesisOutputResponse, response) - def submit_onchain_sign_output( - self, store_id: str, body: T.SubmitOnchainSignOutputRequest, file: bytes - ) -> T.SubmitOnchainSignOutputResponse: + def submit_onchain_sign_output_init(self, store_id: str, body: T.SubmitOnchainSignOutputRequest) -> UserActionChallengeResponse: """ - Submit Onchain Sign Output. + Initialize Submit Onchain Sign Output. + + Creates a user action challenge for external signing. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. + + Returns: + UserActionChallengeResponse: The challenge to sign externally. + """ + path = "/key-stores/{storeId}/onchain-sign/output" + path = path.replace("{storeId}", str(store_id)) + payload = json.dumps(body, separators=(",", ":")) if body else "" + + return BaseAuthApi.create_user_action_challenge( + self._http, + user_action_http_method="POST", + user_action_http_path=path, + user_action_payload=payload, + ) + + def submit_onchain_sign_output_complete(self, store_id: str, body: T.SubmitOnchainSignOutputRequest, signed_challenge: SignUserActionChallengeRequest) -> T.SubmitOnchainSignOutputResponse: + """ + Complete Submit Onchain Sign Output. + + Submits the signed challenge and makes the API request. + + Args: + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.SubmitOnchainSignOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) + user_action_token = user_action_result["userAction"] + + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/onchain-sign/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, - requires_signature=True, + user_action=user_action_token, + ) + + def submit_proof_of_control_output_init(self, store_id: str, body: T.SubmitProofOfControlOutputRequest) -> UserActionChallengeResponse: + """ + Initialize Submit Proof Of Control Output. + + Creates a user action challenge for external signing. + + Args: + store_id: Path parameter. + body: Request body. + + Returns: + UserActionChallengeResponse: The challenge to sign externally. + """ + path = "/key-stores/{storeId}/proof-of-control/output" + path = path.replace("{storeId}", str(store_id)) + payload = json.dumps(body, separators=(",", ":")) if body else "" + + return BaseAuthApi.create_user_action_challenge( + self._http, + user_action_http_method="POST", + user_action_http_path=path, + user_action_payload=payload, ) - return cast(T.SubmitOnchainSignOutputResponse, response) - def submit_proof_of_control_output( - self, store_id: str, body: T.SubmitProofOfControlOutputRequest, file: bytes - ) -> T.SubmitProofOfControlOutputResponse: + def submit_proof_of_control_output_complete(self, store_id: str, body: T.SubmitProofOfControlOutputRequest, signed_challenge: SignUserActionChallengeRequest) -> T.SubmitProofOfControlOutputResponse: """ - Submit Proof Of Control Output. + Complete Submit Proof Of Control Output. + + Submits the signed challenge and makes the API request. Args: - store_id: Path parameter. - body: Request body. - file: The file bytes to upload. + store_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.SubmitProofOfControlOutputResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) + user_action_token = user_action_result["userAction"] + + return self._http.request_with_user_action( method="POST", path="/key-stores/{storeId}/proof-of-control/output", path_params={"storeId": store_id}, query_params=None, body=body, - file=file, - requires_signature=True, + user_action=user_action_token, ) - return cast(T.SubmitProofOfControlOutputResponse, response) diff --git a/dfns_sdk/generated/signers/types.py b/dfns_sdk/generated/signers/types.py index f74aff6..ef6db10 100644 --- a/dfns_sdk/generated/signers/types.py +++ b/dfns_sdk/generated/signers/types.py @@ -1,17 +1,6 @@ """Types for the signers domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - - -class CreateAddMacUserInputRequest(TypedDict, total=False): - """createAddMacUserInput request body.""" - - kind: Literal["AddMacUser"] - mac_target_serial: str - hsm_target_serial: str - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class CreateCloneInputRequest(TypedDict, total=False): """createCloneInput request body.""" @@ -19,8 +8,6 @@ class CreateCloneInputRequest(TypedDict, total=False): kind: Literal["Clone"] hsm_source_serial: str hsm_target_serial: str - mac_target_serial: NotRequired[str] - class CreateGenesisInputRequest(TypedDict, total=False): """createGenesisInput request body.""" @@ -30,92 +17,66 @@ class CreateGenesisInputRequest(TypedDict, total=False): num_secp256k1: int num_ed25519: int hsm_genesis_serial: str - mac_genesis_serial: NotRequired[str] hsm_genesis_firmware_version: NotRequired[Literal["2.2", "2.4"]] - class CreateOnchainSignInputRequest(TypedDict, total=False): """createOnchainSignInput request body.""" pass - class CreateProofOfControlInputRequest(TypedDict, total=False): """createProofOfControlInput request body.""" wallet_ids: list[str] - class ListKeyStoresResponse(TypedDict, total=False): """listKeyStores response.""" - items: list[dict[str, Any]] - + items: list[TypedDict] class ListSignersResponse(TypedDict, total=False): """listSigners response.""" - clusters: list[dict[str, Any]] - - -class SubmitAddMacUserOutputRequest(TypedDict, total=False): - """submitAddMacUserOutput request body.""" - - file_checksum: str - output_json: dict[str, Any] - - -class SubmitAddMacUserOutputResponse(TypedDict, total=False): - """submitAddMacUserOutput response.""" - - message: str - + clusters: list[TypedDict] class SubmitCloneOutputRequest(TypedDict, total=False): """submitCloneOutput request body.""" file_checksum: str - output_json: dict[str, Any] - + output_json: TypedDict class SubmitCloneOutputResponse(TypedDict, total=False): """submitCloneOutput response.""" message: str - class SubmitGenesisOutputRequest(TypedDict, total=False): """submitGenesisOutput request body.""" file_checksum: str - output_json: dict[str, Any] - + output_json: TypedDict class SubmitGenesisOutputResponse(TypedDict, total=False): """submitGenesisOutput response.""" message: str - class SubmitOnchainSignOutputRequest(TypedDict, total=False): """submitOnchainSignOutput request body.""" file_checksum: str - output_json: dict[str, Any] - + output_json: TypedDict class SubmitOnchainSignOutputResponse(TypedDict, total=False): """submitOnchainSignOutput response.""" status: Literal["success", "partial"] - class SubmitProofOfControlOutputRequest(TypedDict, total=False): """submitProofOfControlOutput request body.""" file_checksum: str - output_json: dict[str, Any] - + output_json: TypedDict class SubmitProofOfControlOutputResponse(TypedDict, total=False): """submitProofOfControlOutput response.""" diff --git a/dfns_sdk/generated/staking/__init__.py b/dfns_sdk/generated/staking/__init__.py index b212bae..d0c64f1 100644 --- a/dfns_sdk/generated/staking/__init__.py +++ b/dfns_sdk/generated/staking/__init__.py @@ -1,7 +1,7 @@ """Staking domain module.""" -from . import types from .client import StakingClient from .delegated_client import DelegatedStakingClient +from . import types __all__ = ["StakingClient", "DelegatedStakingClient", "types"] diff --git a/dfns_sdk/generated/staking/client.py b/dfns_sdk/generated/staking/client.py index bb986d0..aa932fe 100644 --- a/dfns_sdk/generated/staking/client.py +++ b/dfns_sdk/generated/staking/client.py @@ -1,6 +1,6 @@ """Client for the staking domain.""" -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class StakingClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_stakes(self, query: T.ListStakesQuery | None = None) -> T.ListStakesResponse: + def list_stakes(self, query: Optional[T.ListStakesQuery] = None) -> T.ListStakesResponse: """ List Stakes. Retrieve the list of stakes. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListStakesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes", path_params={}, @@ -32,7 +32,6 @@ def list_stakes(self, query: T.ListStakesQuery | None = None) -> T.ListStakesRes body=None, requires_signature=False, ) - return cast(T.ListStakesResponse, response) def create_stake(self, body: T.CreateStakeRequest) -> T.CreateStakeResponse: """ @@ -41,12 +40,12 @@ def create_stake(self, body: T.CreateStakeRequest) -> T.CreateStakeResponse: Create a new stake. Args: - body: Request body. + body: Request body. Returns: T.CreateStakeResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/staking/stakes", path_params={}, @@ -54,24 +53,21 @@ def create_stake(self, body: T.CreateStakeRequest) -> T.CreateStakeResponse: body=body, requires_signature=True, ) - return cast(T.CreateStakeResponse, response) - def list_stake_actions( - self, stake_id: str, query: T.ListStakeActionsQuery | None = None - ) -> T.ListStakeActionsResponse: + def list_stake_actions(self, stake_id: str, query: Optional[T.ListStakeActionsQuery] = None) -> T.ListStakeActionsResponse: """ List Stake Actions. Retrieve the list of actions for a specific stake. Args: - stake_id: Path parameter. - query: Query parameters. + stake_id: Path parameter. + query: Query parameters. Returns: T.ListStakeActionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes/{stakeId}/actions", path_params={"stakeId": stake_id}, @@ -79,7 +75,6 @@ def list_stake_actions( body=None, requires_signature=False, ) - return cast(T.ListStakeActionsResponse, response) def create_stake_action(self, stake_id: str, body: T.CreateStakeActionRequest) -> T.CreateStakeActionResponse: """ @@ -88,13 +83,13 @@ def create_stake_action(self, stake_id: str, body: T.CreateStakeActionRequest) - Create a new action for an existing stake. Args: - stake_id: Path parameter. - body: Request body. + stake_id: Path parameter. + body: Request body. Returns: T.CreateStakeActionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/staking/stakes/{stakeId}/actions", path_params={"stakeId": stake_id}, @@ -102,22 +97,21 @@ def create_stake_action(self, stake_id: str, body: T.CreateStakeActionRequest) - body=body, requires_signature=True, ) - return cast(T.CreateStakeActionResponse, response) - def get_stakes(self, stake_id: str, query: T.GetStakesQuery | None = None) -> T.GetStakesResponse: + def get_stakes(self, stake_id: str, query: Optional[T.GetStakesQuery] = None) -> T.GetStakesResponse: """ Get Stakes. Retrieve the details of a specific stake. Args: - stake_id: Path parameter. - query: Query parameters. + stake_id: Path parameter. + query: Query parameters. Returns: T.GetStakesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes/{stakeId}", path_params={"stakeId": stake_id}, @@ -125,7 +119,6 @@ def get_stakes(self, stake_id: str, query: T.GetStakesQuery | None = None) -> T. body=None, requires_signature=False, ) - return cast(T.GetStakesResponse, response) def get_stake_rewards(self, stake_id: str) -> T.GetStakeRewardsResponse: """ @@ -134,12 +127,12 @@ def get_stake_rewards(self, stake_id: str) -> T.GetStakeRewardsResponse: Retrieves the rewards linked to a specific stake. Args: - stake_id: Path parameter. + stake_id: Path parameter. Returns: T.GetStakeRewardsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes/{stakeId}/rewards", path_params={"stakeId": stake_id}, @@ -147,4 +140,3 @@ def get_stake_rewards(self, stake_id: str) -> T.GetStakeRewardsResponse: body=None, requires_signature=False, ) - return cast(T.GetStakeRewardsResponse, response) diff --git a/dfns_sdk/generated/staking/delegated_client.py b/dfns_sdk/generated/staking/delegated_client.py index 96ffb1b..1d953e6 100644 --- a/dfns_sdk/generated/staking/delegated_client.py +++ b/dfns_sdk/generated/staking/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the staking domain.""" import json -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedStakingClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_stakes(self, query: T.ListStakesQuery | None = None) -> T.ListStakesResponse: + def list_stakes(self, query: Optional[T.ListStakesQuery] = None) -> T.ListStakesResponse: """ List Stakes. Retrieve the list of stakes. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListStakesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes", path_params={}, @@ -39,7 +43,6 @@ def list_stakes(self, query: T.ListStakesQuery | None = None) -> T.ListStakesRes body=None, requires_signature=False, ) - return cast(T.ListStakesResponse, response) def create_stake_init(self, body: T.CreateStakeRequest) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def create_stake_init(self, body: T.CreateStakeRequest) -> UserActionChallengeRe Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/staking/stakes" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -63,25 +66,25 @@ def create_stake_init(self, body: T.CreateStakeRequest) -> UserActionChallengeRe user_action_payload=payload, ) - def create_stake_complete( - self, body: T.CreateStakeRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateStakeResponse: + def create_stake_complete(self, body: T.CreateStakeRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateStakeResponse: """ Complete Create Stake. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateStakeResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/staking/stakes", path_params={}, @@ -89,24 +92,21 @@ def create_stake_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateStakeResponse, response) - def list_stake_actions( - self, stake_id: str, query: T.ListStakeActionsQuery | None = None - ) -> T.ListStakeActionsResponse: + def list_stake_actions(self, stake_id: str, query: Optional[T.ListStakeActionsQuery] = None) -> T.ListStakeActionsResponse: """ List Stake Actions. Retrieve the list of actions for a specific stake. Args: - stake_id: Path parameter. - query: Query parameters. + stake_id: Path parameter. + query: Query parameters. Returns: T.ListStakeActionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes/{stakeId}/actions", path_params={"stakeId": stake_id}, @@ -114,7 +114,6 @@ def list_stake_actions( body=None, requires_signature=False, ) - return cast(T.ListStakeActionsResponse, response) def create_stake_action_init(self, stake_id: str, body: T.CreateStakeActionRequest) -> UserActionChallengeResponse: """ @@ -123,12 +122,12 @@ def create_stake_action_init(self, stake_id: str, body: T.CreateStakeActionReque Creates a user action challenge for external signing. Args: - stake_id: Path parameter. - body: Request body. + stake_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/staking/stakes/{stakeId}/actions" path = path.replace("{stakeId}", str(stake_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -140,26 +139,26 @@ def create_stake_action_init(self, stake_id: str, body: T.CreateStakeActionReque user_action_payload=payload, ) - def create_stake_action_complete( - self, stake_id: str, body: T.CreateStakeActionRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateStakeActionResponse: + def create_stake_action_complete(self, stake_id: str, body: T.CreateStakeActionRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateStakeActionResponse: """ Complete Create Stake Action. Submits the signed challenge and makes the API request. Args: - stake_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + stake_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateStakeActionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/staking/stakes/{stakeId}/actions", path_params={"stakeId": stake_id}, @@ -167,22 +166,21 @@ def create_stake_action_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateStakeActionResponse, response) - def get_stakes(self, stake_id: str, query: T.GetStakesQuery | None = None) -> T.GetStakesResponse: + def get_stakes(self, stake_id: str, query: Optional[T.GetStakesQuery] = None) -> T.GetStakesResponse: """ Get Stakes. Retrieve the details of a specific stake. Args: - stake_id: Path parameter. - query: Query parameters. + stake_id: Path parameter. + query: Query parameters. Returns: T.GetStakesResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes/{stakeId}", path_params={"stakeId": stake_id}, @@ -190,7 +188,6 @@ def get_stakes(self, stake_id: str, query: T.GetStakesQuery | None = None) -> T. body=None, requires_signature=False, ) - return cast(T.GetStakesResponse, response) def get_stake_rewards(self, stake_id: str) -> T.GetStakeRewardsResponse: """ @@ -199,12 +196,12 @@ def get_stake_rewards(self, stake_id: str) -> T.GetStakeRewardsResponse: Retrieves the rewards linked to a specific stake. Args: - stake_id: Path parameter. + stake_id: Path parameter. Returns: T.GetStakeRewardsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/staking/stakes/{stakeId}/rewards", path_params={"stakeId": stake_id}, @@ -212,4 +209,3 @@ def get_stake_rewards(self, stake_id: str) -> T.GetStakeRewardsResponse: body=None, requires_signature=False, ) - return cast(T.GetStakeRewardsResponse, response) diff --git a/dfns_sdk/generated/staking/types.py b/dfns_sdk/generated/staking/types.py index 4862fd8..fc99d93 100644 --- a/dfns_sdk/generated/staking/types.py +++ b/dfns_sdk/generated/staking/types.py @@ -1,67 +1,55 @@ """Types for the staking domain.""" -from typing import Any, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListStakesResponse(TypedDict, total=False): """listStakes response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListStakesQuery(TypedDict, total=False): """listStakes query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateStakeRequest(TypedDict, total=False): """createStake request body.""" external_id: NotRequired[str] - class CreateStakeResponse(TypedDict, total=False): """createStake response.""" - actions: list[dict[str, Any]] - + actions: list[TypedDict] class ListStakeActionsResponse(TypedDict, total=False): """listStakeActions response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListStakeActionsQuery(TypedDict, total=False): """listStakeActions query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateStakeActionRequest(TypedDict, total=False): """createStakeAction request body.""" external_id: NotRequired[str] - class CreateStakeActionResponse(TypedDict, total=False): """createStakeAction response.""" - actions: list[dict[str, Any]] - + actions: list[TypedDict] class GetStakesResponse(TypedDict, total=False): """getStakes response.""" - actions: list[dict[str, Any]] - + actions: list[TypedDict] class GetStakesQuery(TypedDict, total=False): """getStakes query parameters.""" @@ -69,7 +57,6 @@ class GetStakesQuery(TypedDict, total=False): limit: NotRequired[int] pagination_token: NotRequired[str] - class GetStakeRewardsResponse(TypedDict, total=False): """getStakeRewards response.""" diff --git a/dfns_sdk/generated/swaps/__init__.py b/dfns_sdk/generated/swaps/__init__.py index 045021c..250eab9 100644 --- a/dfns_sdk/generated/swaps/__init__.py +++ b/dfns_sdk/generated/swaps/__init__.py @@ -1,7 +1,7 @@ """Swaps domain module.""" -from . import types from .client import SwapsClient from .delegated_client import DelegatedSwapsClient +from . import types __all__ = ["SwapsClient", "DelegatedSwapsClient", "types"] diff --git a/dfns_sdk/generated/swaps/client.py b/dfns_sdk/generated/swaps/client.py index 97f7a1e..f257109 100644 --- a/dfns_sdk/generated/swaps/client.py +++ b/dfns_sdk/generated/swaps/client.py @@ -1,6 +1,6 @@ """Client for the swaps domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class SwapsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_swaps(self, query: T.ListSwapsQuery | None = None) -> T.ListSwapsResponse: + def list_swaps(self, query: Optional[T.ListSwapsQuery] = None) -> T.ListSwapsResponse: """ List Swaps. List all swaps with pagination Args: - query: Query parameters. + query: Query parameters. Returns: T.ListSwapsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/swaps", path_params={}, @@ -32,7 +32,6 @@ def list_swaps(self, query: T.ListSwapsQuery | None = None) -> T.ListSwapsRespon body=None, requires_signature=False, ) - return cast(T.ListSwapsResponse, response) def create_swap(self, body: dict[str, Any]) -> T.CreateSwapResponse: """ @@ -41,12 +40,12 @@ def create_swap(self, body: dict[str, Any]) -> T.CreateSwapResponse: Create a new swap based on an existing quote. This is the second step of the [Swap flow](https://docs.dfns.co/api-reference/swaps#flow-overview). Args: - body: Request body. + body: Request body. Returns: T.CreateSwapResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/swaps", path_params={}, @@ -54,7 +53,6 @@ def create_swap(self, body: dict[str, Any]) -> T.CreateSwapResponse: body=body, requires_signature=True, ) - return cast(T.CreateSwapResponse, response) def request_swap_quote(self, body: dict[str, Any]) -> T.RequestSwapQuoteResponse: """ @@ -63,12 +61,12 @@ def request_swap_quote(self, body: dict[str, Any]) -> T.RequestSwapQuoteResponse Request a quote from a given provider for swapping assets. This is the first step of the [Swap flow](https://docs.dfns.co/api-reference/swaps#flow-overview). Args: - body: Request body. + body: Request body. Returns: T.RequestSwapQuoteResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/swaps/quotes", path_params={}, @@ -76,7 +74,6 @@ def request_swap_quote(self, body: dict[str, Any]) -> T.RequestSwapQuoteResponse body=body, requires_signature=False, ) - return cast(T.RequestSwapQuoteResponse, response) def get_swap(self, swap_id: str) -> T.GetSwapResponse: """ @@ -85,12 +82,12 @@ def get_swap(self, swap_id: str) -> T.GetSwapResponse: Get details of a specific swap by its ID Args: - swap_id: Id of the swap for which we want to get details. + swap_id: Id of the swap for which we want to get details. Returns: T.GetSwapResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/swaps/{swapId}", path_params={"swapId": swap_id}, @@ -98,7 +95,6 @@ def get_swap(self, swap_id: str) -> T.GetSwapResponse: body=None, requires_signature=False, ) - return cast(T.GetSwapResponse, response) def get_swap_quote(self, quote_id: str) -> T.GetSwapQuoteResponse: """ @@ -107,12 +103,12 @@ def get_swap_quote(self, quote_id: str) -> T.GetSwapQuoteResponse: Get details of a specific swap quote by its ID Args: - quote_id: The ID of the Swap Quote. + quote_id: The ID of the Swap Quote. Returns: T.GetSwapQuoteResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/swaps/quotes/{quoteId}", path_params={"quoteId": quote_id}, @@ -120,4 +116,3 @@ def get_swap_quote(self, quote_id: str) -> T.GetSwapQuoteResponse: body=None, requires_signature=False, ) - return cast(T.GetSwapQuoteResponse, response) diff --git a/dfns_sdk/generated/swaps/delegated_client.py b/dfns_sdk/generated/swaps/delegated_client.py index ac4e907..a1f71e1 100644 --- a/dfns_sdk/generated/swaps/delegated_client.py +++ b/dfns_sdk/generated/swaps/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the swaps domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedSwapsClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_swaps(self, query: T.ListSwapsQuery | None = None) -> T.ListSwapsResponse: + def list_swaps(self, query: Optional[T.ListSwapsQuery] = None) -> T.ListSwapsResponse: """ List Swaps. List all swaps with pagination Args: - query: Query parameters. + query: Query parameters. Returns: T.ListSwapsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/swaps", path_params={}, @@ -39,7 +43,6 @@ def list_swaps(self, query: T.ListSwapsQuery | None = None) -> T.ListSwapsRespon body=None, requires_signature=False, ) - return cast(T.ListSwapsResponse, response) def create_swap_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def create_swap_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/swaps" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -63,25 +66,25 @@ def create_swap_init(self, body: dict[str, Any]) -> UserActionChallengeResponse: user_action_payload=payload, ) - def create_swap_complete( - self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateSwapResponse: + def create_swap_complete(self, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.CreateSwapResponse: """ Complete Create Swap. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateSwapResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/swaps", path_params={}, @@ -89,7 +92,6 @@ def create_swap_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateSwapResponse, response) def request_swap_quote(self, body: dict[str, Any]) -> T.RequestSwapQuoteResponse: """ @@ -98,12 +100,12 @@ def request_swap_quote(self, body: dict[str, Any]) -> T.RequestSwapQuoteResponse Request a quote from a given provider for swapping assets. This is the first step of the [Swap flow](https://docs.dfns.co/api-reference/swaps#flow-overview). Args: - body: Request body. + body: Request body. Returns: T.RequestSwapQuoteResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/swaps/quotes", path_params={}, @@ -111,7 +113,6 @@ def request_swap_quote(self, body: dict[str, Any]) -> T.RequestSwapQuoteResponse body=body, requires_signature=False, ) - return cast(T.RequestSwapQuoteResponse, response) def get_swap(self, swap_id: str) -> T.GetSwapResponse: """ @@ -120,12 +121,12 @@ def get_swap(self, swap_id: str) -> T.GetSwapResponse: Get details of a specific swap by its ID Args: - swap_id: Id of the swap for which we want to get details. + swap_id: Id of the swap for which we want to get details. Returns: T.GetSwapResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/swaps/{swapId}", path_params={"swapId": swap_id}, @@ -133,7 +134,6 @@ def get_swap(self, swap_id: str) -> T.GetSwapResponse: body=None, requires_signature=False, ) - return cast(T.GetSwapResponse, response) def get_swap_quote(self, quote_id: str) -> T.GetSwapQuoteResponse: """ @@ -142,12 +142,12 @@ def get_swap_quote(self, quote_id: str) -> T.GetSwapQuoteResponse: Get details of a specific swap quote by its ID Args: - quote_id: The ID of the Swap Quote. + quote_id: The ID of the Swap Quote. Returns: T.GetSwapQuoteResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/swaps/quotes/{quoteId}", path_params={"quoteId": quote_id}, @@ -155,4 +155,3 @@ def get_swap_quote(self, quote_id: str) -> T.GetSwapQuoteResponse: body=None, requires_signature=False, ) - return cast(T.GetSwapQuoteResponse, response) diff --git a/dfns_sdk/generated/swaps/types.py b/dfns_sdk/generated/swaps/types.py index 33d83dd..dbe5df5 100644 --- a/dfns_sdk/generated/swaps/types.py +++ b/dfns_sdk/generated/swaps/types.py @@ -1,24 +1,19 @@ """Types for the swaps domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListSwapsResponse(TypedDict, total=False): """listSwaps response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListSwapsQuery(TypedDict, total=False): """listSwaps query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateSwapResponse(TypedDict, total=False): """createSwap response.""" @@ -29,16 +24,15 @@ class CreateSwapResponse(TypedDict, total=False): target_wallet_id: str status: Literal["PendingPolicyApproval", "InProgress", "Completed", "Failed", "Rejected"] provider: Literal["UniswapX", "UniswapClassic", "CircleCctp"] - quoted_source_asset: dict[str, Any] - quoted_target_asset: dict[str, Any] + quoted_source_asset: TypedDict + quoted_target_asset: TypedDict slippage_bps: float date_created: str - request_body: dict[str, Any] - requester: dict[str, Any] + request_body: TypedDict + requester: TypedDict failure_reason: NotRequired[str] protocol_status: NotRequired[str] - class RequestSwapQuoteResponse(TypedDict, total=False): """requestSwapQuote response.""" @@ -46,14 +40,13 @@ class RequestSwapQuoteResponse(TypedDict, total=False): wallet_id: str target_wallet_id: NotRequired[str] provider: Literal["UniswapX", "UniswapClassic", "CircleCctp"] - source_asset: dict[str, Any] - target_asset: dict[str, Any] + source_asset: TypedDict + target_asset: TypedDict slippage_bps: int fee: NotRequired[str] date_created: str - request_body: dict[str, Any] - requester: dict[str, Any] - + request_body: TypedDict + requester: TypedDict class GetSwapResponse(TypedDict, total=False): """getSwap response.""" @@ -65,16 +58,15 @@ class GetSwapResponse(TypedDict, total=False): target_wallet_id: str status: Literal["PendingPolicyApproval", "InProgress", "Completed", "Failed", "Rejected"] provider: Literal["UniswapX", "UniswapClassic", "CircleCctp"] - quoted_source_asset: dict[str, Any] - quoted_target_asset: dict[str, Any] + quoted_source_asset: TypedDict + quoted_target_asset: TypedDict slippage_bps: float date_created: str - request_body: dict[str, Any] - requester: dict[str, Any] + request_body: TypedDict + requester: TypedDict failure_reason: NotRequired[str] protocol_status: NotRequired[str] - class GetSwapQuoteResponse(TypedDict, total=False): """getSwapQuote response.""" @@ -82,10 +74,10 @@ class GetSwapQuoteResponse(TypedDict, total=False): wallet_id: str target_wallet_id: NotRequired[str] provider: Literal["UniswapX", "UniswapClassic", "CircleCctp"] - source_asset: dict[str, Any] - target_asset: dict[str, Any] + source_asset: TypedDict + target_asset: TypedDict slippage_bps: int fee: NotRequired[str] date_created: str - request_body: dict[str, Any] - requester: dict[str, Any] + request_body: TypedDict + requester: TypedDict diff --git a/dfns_sdk/generated/wallets/__init__.py b/dfns_sdk/generated/wallets/__init__.py index 5c81c56..a63f86b 100644 --- a/dfns_sdk/generated/wallets/__init__.py +++ b/dfns_sdk/generated/wallets/__init__.py @@ -1,7 +1,7 @@ """Wallets domain module.""" -from . import types from .client import WalletsClient from .delegated_client import DelegatedWalletsClient +from . import types __all__ = ["WalletsClient", "DelegatedWalletsClient", "types"] diff --git a/dfns_sdk/generated/wallets/client.py b/dfns_sdk/generated/wallets/client.py index 8345a3d..3cb1bb3 100644 --- a/dfns_sdk/generated/wallets/client.py +++ b/dfns_sdk/generated/wallets/client.py @@ -1,6 +1,6 @@ """Client for the wallets domain.""" -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -14,22 +14,22 @@ def __init__(self, http_client: HttpClient): def abort_transaction(self, wallet_id: str, transaction_id: str) -> T.AbortTransactionResponse: """ - Abort Transaction. + Abort Transaction. - Aborts a transaction that is currently in 'Executing' status and has not yet been signed. Sets the transaction status to 'Failed' and removes it from the retry queue. + Aborts a transaction that is currently in 'Executing' status and has not yet been signed. Sets the transaction status to 'Failed' and removes it from the retry queue. - This is useful when a transaction is stuck in the execution pipeline (e.g., during construct or sign phase) and you want to abort it without waiting for it to fail on its own. + This is useful when a transaction is stuck in the execution pipeline (e.g., during construct or sign phase) and you want to abort it without waiting for it to fail on its own. - Unlike cancel, which creates a replacement on-chain transaction, abort simply marks the transaction as failed without any blockchain interaction. + Unlike cancel, which creates a replacement on-chain transaction, abort simply marks the transaction as failed without any blockchain interaction. - Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + Args: + wallet_id: Wallet id. + transaction_id: Transaction id. - Returns: - T.AbortTransactionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.AbortTransactionResponse: The API response. + """ + return self._http.request( method="PUT", path="/wallets/{walletId}/transactions/{transactionId}/abort", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -37,26 +37,25 @@ def abort_transaction(self, wallet_id: str, transaction_id: str) -> T.AbortTrans body=None, requires_signature=True, ) - return cast(T.AbortTransactionResponse, response) def abort_transfer(self, wallet_id: str, transfer_id: str) -> T.AbortTransferResponse: """ - Abort Transfer. + Abort Transfer. - Aborts a transfer that is currently in 'Executing' status and has not yet been signed. Sets the transfer status to 'Failed' and removes it from the retry queue. + Aborts a transfer that is currently in 'Executing' status and has not yet been signed. Sets the transfer status to 'Failed' and removes it from the retry queue. - This is useful when a transfer is stuck in the execution pipeline (e.g., during construct or sign phase) and you want to abort it without waiting for it to fail on its own. + This is useful when a transfer is stuck in the execution pipeline (e.g., during construct or sign phase) and you want to abort it without waiting for it to fail on its own. - Unlike cancel, which creates a replacement on-chain transaction, abort simply marks the transfer as failed without any blockchain interaction. + Unlike cancel, which creates a replacement on-chain transaction, abort simply marks the transfer as failed without any blockchain interaction. - Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + Args: + wallet_id: Wallet id. + transfer_id: Transfer id. - Returns: - T.AbortTransferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.AbortTransferResponse: The API response. + """ + return self._http.request( method="PUT", path="/wallets/{walletId}/transfers/{transferId}/abort", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -64,29 +63,28 @@ def abort_transfer(self, wallet_id: str, transfer_id: str) -> T.AbortTransferRes body=None, requires_signature=True, ) - return cast(T.AbortTransferResponse, response) def activate_wallet(self, wallet_id: str, body: dict[str, Any]) -> T.ActivateWalletResponse: """ - Activate Wallet. + Activate Wallet. - Activates a wallet by deploying the account contract on-chain, making it ready for transactions. + Activates a wallet by deploying the account contract on-chain, making it ready for transactions. - This operation is required for wallets on networks where you need to explicitly activate your account on-chain - before it can be used for transactions. + This operation is required for wallets on networks where you need to explicitly activate your account on-chain + before it can be used for transactions. - - **Starknet**: Deploys the account contract using the wallet's public key to initialize the account on the blockchain. No additional parameters required. - - **Concordium**: Deploys the account using credential deployment information and cryptographic randomness returned by the IDApp. - - **Canton**: Registers the wallet on a validator. You must specify the `validatorId` to activate the wallet. Before activation, the wallet cannot be used and its address will not have a prefix. + - **Starknet**: Deploys the account contract using the wallet's public key to initialize the account on the blockchain. No additional parameters required. + - **Concordium**: Deploys the account using credential deployment information and cryptographic randomness returned by the IDApp. + - **Canton**: Registers the wallet on a validator. You must specify the `validatorId` to activate the wallet. Before activation, the wallet cannot be used and its address will not have a prefix. - Args: - wallet_id: Wallet id. - body: Request body. + Args: + wallet_id: Wallet id. + body: Request body. - Returns: - T.ActivateWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ActivateWalletResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/activate", path_params={"walletId": wallet_id}, @@ -94,24 +92,21 @@ def activate_wallet(self, wallet_id: str, body: dict[str, Any]) -> T.ActivateWal body=body, requires_signature=True, ) - return cast(T.ActivateWalletResponse, response) - def list_transactions( - self, wallet_id: str, query: T.ListTransactionsQuery | None = None - ) -> T.ListTransactionsResponse: + def list_transactions(self, wallet_id: str, query: Optional[T.ListTransactionsQuery] = None) -> T.ListTransactionsResponse: """ List Transactions. Retrieves a list of transactions requests for the specified wallet. Args: - wallet_id: Wallet id. - query: Query parameters. + wallet_id: Wallet id. + query: Query parameters. Returns: T.ListTransactionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transactions", path_params={"walletId": wallet_id}, @@ -119,38 +114,35 @@ def list_transactions( body=None, requires_signature=False, ) - return cast(T.ListTransactionsResponse, response) - def sign_and_broadcast_transaction( - self, wallet_id: str, body: dict[str, Any] - ) -> T.SignAndBroadcastTransactionResponse: + def sign_and_broadcast_transaction(self, wallet_id: str, body: dict[str, Any]) -> T.SignAndBroadcastTransactionResponse: """ - Sign and Broadcast Transaction. + Sign and Broadcast Transaction. - Sign & Broadcast transaction enables communication with any arbitrary smart contract of the target blockchain. You can construct a transaction that performs a complex task and this endpoint will sign the transaction, add the signature and broadcast it to chain. It can be used to call smart contract functions like mint tokens and even deploy new smart contracts. + Sign & Broadcast transaction enables communication with any arbitrary smart contract of the target blockchain. You can construct a transaction that performs a complex task and this endpoint will sign the transaction, add the signature and broadcast it to chain. It can be used to call smart contract functions like mint tokens and even deploy new smart contracts. - | Status | Definition | - |-------------|-------------------------------------------------------------------------------------------------------------------------------------------------| - | Pending | The request is pending approval due to a policy applied to the wallet. | - | Executing | The request is approved and is in the process of being executed. note this status is only set for a short time between pending and broadcasted. | - | Broadcasted | The transaction has been successfully written to the mempool. | - | Confirmed | The transaction has been confirmed on-chain by our indexing pipeline. | - | Failed | Indicates either a system failure to complete the request or the transaction failed on chain. | - | Rejected | The request has been rejected by a policy approval action. | +| Status | Definition | +|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------| +| Pending | The request is pending approval due to a policy applied to the wallet. | +| Executing | The request is approved and is in the process of being executed. note this status is only set for a short time between pending and broadcasted. | +| Broadcasted | The transaction has been successfully written to the mempool. | +| Confirmed | The transaction has been confirmed on-chain by our indexing pipeline. | +| Failed | Indicates either a system failure to complete the request or the transaction failed on chain. | +| Rejected | The request has been rejected by a policy approval action. | - - for reading from a "view" function on EVM chains, please use [Read Contract](https://docs.dfns.co/api-reference/networks/read-contract) endpoint. - + + for reading from a "view" function on EVM chains, please use [Read Contract](https://docs.dfns.co/api-reference/networks/read-contract) endpoint. + - Args: - wallet_id: Wallet id. - body: Request body. + Args: + wallet_id: Wallet id. + body: Request body. - Returns: - T.SignAndBroadcastTransactionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.SignAndBroadcastTransactionResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/transactions", path_params={"walletId": wallet_id}, @@ -158,36 +150,35 @@ def sign_and_broadcast_transaction( body=body, requires_signature=True, ) - return cast(T.SignAndBroadcastTransactionResponse, response) def cancel_transaction(self, wallet_id: str, transaction_id: str) -> T.CancelTransactionResponse: """ - Cancel Transaction. - - Cancels an EVM transaction by creating a replacement transaction with the same nonce. The new transaction sends 0 value to the same address, effectively nullifying the original transaction. - - This endpoint works for: - - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) - - Transactions that are in 'Broadcasted' status (pending inclusion in a block) - - Transactions that are in 'Failed' status, but failed off-chain (before being broadcasted to the network) - - The cancellation works by: - 1. Extracting the nonce from the original transaction's signed data - 2. Creating a new transaction to the same wallet address with 0 amount - 3. Using the same nonce to either: - - Replace the original transaction in the mempool (if it was broadcasted) - - Consume the nonce that was reserved but not used (if the transaction failed off-chain) - - Note: For transactions that were broadcasted on-chain, success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. + Cancel Transaction. + + Cancels an EVM transaction by creating a replacement transaction with the same nonce. The new transaction sends 0 value to the same address, effectively nullifying the original transaction. + + This endpoint works for: + - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) + - Transactions that are in 'Broadcasted' status (pending inclusion in a block) + - Transactions that are in 'Failed' status, but failed off-chain (before being broadcasted to the network) + + The cancellation works by: + 1. Extracting the nonce from the original transaction's signed data + 2. Creating a new transaction to the same wallet address with 0 amount + 3. Using the same nonce to either: + - Replace the original transaction in the mempool (if it was broadcasted) + - Consume the nonce that was reserved but not used (if the transaction failed off-chain) + + Note: For transactions that were broadcasted on-chain, success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. - Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + Args: + wallet_id: Wallet id. + transaction_id: Transaction id. - Returns: - T.CancelTransactionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CancelTransactionResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/transactions/{transactionId}/cancel", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -195,36 +186,35 @@ def cancel_transaction(self, wallet_id: str, transaction_id: str) -> T.CancelTra body=None, requires_signature=True, ) - return cast(T.CancelTransactionResponse, response) def cancel_transfer(self, wallet_id: str, transfer_id: str) -> T.CancelTransferResponse: """ - Cancel Transfer. - - Cancels an EVM transfer by creating a replacement transaction with the same nonce. The new transaction sends 0 value to the same address, effectively nullifying the original transfer. - - This endpoint works for: - - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) - - Transfers that are in 'Broadcasted' status (pending inclusion in a block) - - Transfers that are in 'Failed' status, but failed off-chain (before being broadcasted to the network) + Cancel Transfer. + + Cancels an EVM transfer by creating a replacement transaction with the same nonce. The new transaction sends 0 value to the same address, effectively nullifying the original transfer. + + This endpoint works for: + - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) + - Transfers that are in 'Broadcasted' status (pending inclusion in a block) + - Transfers that are in 'Failed' status, but failed off-chain (before being broadcasted to the network) + + The cancellation works by: + 1. Extracting the nonce from the original transfer's signed data + 2. Creating a new transaction to the same wallet address with 0 amount + 3. Using the same nonce to either: + - Replace the original transaction in the mempool (if it was broadcasted) + - Consume the nonce that was reserved but not used (if the transfer failed off-chain) + + Note: For transfers that were broadcasted on-chain, success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. - The cancellation works by: - 1. Extracting the nonce from the original transfer's signed data - 2. Creating a new transaction to the same wallet address with 0 amount - 3. Using the same nonce to either: - - Replace the original transaction in the mempool (if it was broadcasted) - - Consume the nonce that was reserved but not used (if the transfer failed off-chain) - - Note: For transfers that were broadcasted on-chain, success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. - - Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + Args: + wallet_id: Wallet id. + transfer_id: Transfer id. - Returns: - T.CancelTransferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.CancelTransferResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/transfers/{transferId}/cancel", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -232,24 +222,21 @@ def cancel_transfer(self, wallet_id: str, transfer_id: str) -> T.CancelTransferR body=None, requires_signature=True, ) - return cast(T.CancelTransferResponse, response) - def proxy_a_request_to_the_canton_ledger_api( - self, wallet_id: str, body: T.ProxyARequestToTheCantonLedgerApiRequest - ) -> dict[str, Any]: + def proxy_a_request_to_the_canton_ledger_api(self, wallet_id: str, body: T.ProxyARequestToTheCantonLedgerApiRequest) -> dict[str, Any]: """ Proxy a request to the Canton Ledger API. Proxies a request to the Canton Ledger API associated with this wallet, using the validator's OAuth2 credentials. Restricted to a curated allow-list of read-style resources. Used to satisfy the Canton WalletConnect `canton_ledgerApi` method. Args: - wallet_id: Wallet id. - body: Request body. + wallet_id: Wallet id. + body: Request body. Returns: dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/wallets/{walletId}/canton/ledger-api", path_params={"walletId": wallet_id}, @@ -257,34 +244,33 @@ def proxy_a_request_to_the_canton_ledger_api( body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def speed_up_transaction(self, wallet_id: str, transaction_id: str) -> T.SpeedUpTransactionResponse: """ - Speed Up Transaction. - - Speeds up a transaction by creating a replacement transaction with the same parameters but higher gas fees. - - This endpoint only works for: - - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) - - Transactions that are in 'Broadcasted' status (already submitted to blockchain, but not confirmed yet) + Speed Up Transaction. + + Speeds up a transaction by creating a replacement transaction with the same parameters but higher gas fees. + + This endpoint only works for: + - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) + - Transactions that are in 'Broadcasted' status (already submitted to blockchain, but not confirmed yet) + + The speed-up works by: + 1. Extracting the parameters from the original broadcasted transaction + 2. Creating a new transaction with the same nonce, recipient, value, and data + 3. Using higher gas fees (maximum between 10% bump or Fast network fees) + 4. Replacing the original transaction in the mempool + + Note: Success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. - The speed-up works by: - 1. Extracting the parameters from the original broadcasted transaction - 2. Creating a new transaction with the same nonce, recipient, value, and data - 3. Using higher gas fees (maximum between 10% bump or Fast network fees) - 4. Replacing the original transaction in the mempool - - Note: Success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. - - Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + Args: + wallet_id: Wallet id. + transaction_id: Transaction id. - Returns: - T.SpeedUpTransactionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.SpeedUpTransactionResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/transactions/{transactionId}/speed-up", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -292,34 +278,33 @@ def speed_up_transaction(self, wallet_id: str, transaction_id: str) -> T.SpeedUp body=None, requires_signature=True, ) - return cast(T.SpeedUpTransactionResponse, response) def speed_up_transfer(self, wallet_id: str, transfer_id: str) -> T.SpeedUpTransferResponse: """ - Speed Up Transfer. - - Speeds up a transfer by creating a replacement transaction with the same parameters but higher gas fees. - - This endpoint only works for: - - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) - - Transfers that are in 'Broadcasted' status (already submitted to blockchain, but not confirmed yet) - - The speed-up works by: - 1. Extracting the parameters from the original broadcasted transfer - 2. Creating a new transaction with the same nonce, recipient, value, and data - 3. Using higher gas fees (maximum between 10% bump or Fast network fees) - 4. Replacing the original transaction in the mempool - - Note: Success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. + Speed Up Transfer. + + Speeds up a transfer by creating a replacement transaction with the same parameters but higher gas fees. + + This endpoint only works for: + - EVM-compatible networks (Ethereum, Polygon, BSC, etc.) + - Transfers that are in 'Broadcasted' status (already submitted to blockchain, but not confirmed yet) + + The speed-up works by: + 1. Extracting the parameters from the original broadcasted transfer + 2. Creating a new transaction with the same nonce, recipient, value, and data + 3. Using higher gas fees (maximum between 10% bump or Fast network fees) + 4. Replacing the original transaction in the mempool + + Note: Success is not guaranteed as it depends on network conditions and whether the original transaction has already been mined. - Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + Args: + wallet_id: Wallet id. + transfer_id: Transfer id. - Returns: - T.SpeedUpTransferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.SpeedUpTransferResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/transfers/{transferId}/speed-up", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -327,21 +312,20 @@ def speed_up_transfer(self, wallet_id: str, transfer_id: str) -> T.SpeedUpTransf body=None, requires_signature=True, ) - return cast(T.SpeedUpTransferResponse, response) - def list_wallets(self, query: T.ListWalletsQuery | None = None) -> T.ListWalletsResponse: + def list_wallets(self, query: Optional[T.ListWalletsQuery] = None) -> T.ListWalletsResponse: """ List Wallets. Retrieves the list of Wallets in your organization. You can filter the results by owner (either by owner id or owner username). Pagination is supported via limit and paginationToken parameters. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListWalletsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets", path_params={}, @@ -349,7 +333,6 @@ def list_wallets(self, query: T.ListWalletsQuery | None = None) -> T.ListWallets body=None, requires_signature=False, ) - return cast(T.ListWalletsResponse, response) def create_wallet(self, body: T.CreateWalletRequest) -> T.CreateWalletResponse: """ @@ -358,12 +341,12 @@ def create_wallet(self, body: T.CreateWalletRequest) -> T.CreateWalletResponse: Creates a new Wallet associated with the given chain (such as Bitcoin or Ethereum ). Returns a new wallet entity. Args: - body: Request body. + body: Request body. Returns: T.CreateWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/wallets", path_params={}, @@ -371,7 +354,6 @@ def create_wallet(self, body: T.CreateWalletRequest) -> T.CreateWalletResponse: body=body, requires_signature=True, ) - return cast(T.CreateWalletResponse, response) def get_transaction(self, wallet_id: str, transaction_id: str) -> T.GetTransactionResponse: """ @@ -380,13 +362,13 @@ def get_transaction(self, wallet_id: str, transaction_id: str) -> T.GetTransacti Retrieve information about a specific transaction. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + wallet_id: Wallet id. + transaction_id: Transaction id. Returns: T.GetTransactionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transactions/{transactionId}", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -394,7 +376,6 @@ def get_transaction(self, wallet_id: str, transaction_id: str) -> T.GetTransacti body=None, requires_signature=False, ) - return cast(T.GetTransactionResponse, response) def get_transfer(self, wallet_id: str, transfer_id: str) -> T.GetTransferResponse: """ @@ -403,13 +384,13 @@ def get_transfer(self, wallet_id: str, transfer_id: str) -> T.GetTransferRespons Retrieves a Wallet Transfer Request by its ID. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + wallet_id: Wallet id. + transfer_id: Transfer id. Returns: T.GetTransferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transfers/{transferId}", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -417,7 +398,6 @@ def get_transfer(self, wallet_id: str, transfer_id: str) -> T.GetTransferRespons body=None, requires_signature=False, ) - return cast(T.GetTransferResponse, response) def get_wallet(self, wallet_id: str) -> T.GetWalletResponse: """ @@ -426,12 +406,12 @@ def get_wallet(self, wallet_id: str) -> T.GetWalletResponse: Retrieves a Wallet information by its ID. Args: - wallet_id: The wallet to retrieve. + wallet_id: The wallet to retrieve. Returns: T.GetWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}", path_params={"walletId": wallet_id}, @@ -439,7 +419,6 @@ def get_wallet(self, wallet_id: str) -> T.GetWalletResponse: body=None, requires_signature=False, ) - return cast(T.GetWalletResponse, response) def update_wallet(self, wallet_id: str, body: T.UpdateWalletRequest) -> T.UpdateWalletResponse: """ @@ -448,13 +427,13 @@ def update_wallet(self, wallet_id: str, body: T.UpdateWalletRequest) -> T.Update Updates the name of an existing wallet. Args: - wallet_id: Path parameter. - body: Request body. + wallet_id: Path parameter. + body: Request body. Returns: T.UpdateWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/wallets/{walletId}", path_params={"walletId": wallet_id}, @@ -462,24 +441,21 @@ def update_wallet(self, wallet_id: str, body: T.UpdateWalletRequest) -> T.Update body=body, requires_signature=True, ) - return cast(T.UpdateWalletResponse, response) - def get_wallet_assets( - self, wallet_id: str, query: T.GetWalletAssetsQuery | None = None - ) -> T.GetWalletAssetsResponse: + def get_wallet_assets(self, wallet_id: str, query: Optional[T.GetWalletAssetsQuery] = None) -> T.GetWalletAssetsResponse: """ Get Wallet Assets. Retrieves a list of assets owned by the specified wallet. Return values vary by chain as shown below. Args: - wallet_id: Path parameter. - query: Query parameters. + wallet_id: Path parameter. + query: Query parameters. Returns: T.GetWalletAssetsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/assets", path_params={"walletId": wallet_id}, @@ -487,31 +463,28 @@ def get_wallet_assets( body=None, requires_signature=False, ) - return cast(T.GetWalletAssetsResponse, response) - def get_wallet_history( - self, wallet_id: str, query: T.GetWalletHistoryQuery | None = None - ) -> T.GetWalletHistoryResponse: + def get_wallet_history(self, wallet_id: str, query: Optional[T.GetWalletHistoryQuery] = None) -> T.GetWalletHistoryResponse: """ - Get Wallet History. + Get Wallet History. - Retrieves a list of historical on chain activities for the specified wallet. + Retrieves a list of historical on chain activities for the specified wallet. - The list reflects the indexed on-chain activity: it includes confirmed transactions only. +The list reflects the indexed on-chain activity: it includes confirmed transactions only. - If you need to list your on-going or failed transactions please use the related endpoints ( - [List Transfers](https://docs.dfns.co/api-reference/wallets/list-transfers) or - [List Transactions](https://docs.dfns.co/api-reference/wallets/list-transactions) - depending on the API you are using). +If you need to list your on-going or failed transactions please use the related endpoints ( +[List Transfers](https://docs.dfns.co/api-reference/wallets/list-transfers) or +[List Transactions](https://docs.dfns.co/api-reference/wallets/list-transactions) +depending on the API you are using). - Args: - wallet_id: Wallet you want to get the history from. - query: Query parameters. + Args: + wallet_id: Wallet you want to get the history from. + query: Query parameters. - Returns: - T.GetWalletHistoryResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetWalletHistoryResponse: The API response. + """ + return self._http.request( method="GET", path="/wallets/{walletId}/history", path_params={"walletId": wallet_id}, @@ -519,7 +492,6 @@ def get_wallet_history( body=None, requires_signature=False, ) - return cast(T.GetWalletHistoryResponse, response) def get_wallet_nfts(self, wallet_id: str) -> T.GetWalletNftsResponse: """ @@ -528,12 +500,12 @@ def get_wallet_nfts(self, wallet_id: str) -> T.GetWalletNftsResponse: Retrieves a list of NFTs owned by the specified Wallet. Args: - wallet_id: Path parameter. + wallet_id: Path parameter. Returns: T.GetWalletNftsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/nfts", path_params={"walletId": wallet_id}, @@ -541,33 +513,32 @@ def get_wallet_nfts(self, wallet_id: str) -> T.GetWalletNftsResponse: body=None, requires_signature=False, ) - return cast(T.GetWalletNftsResponse, response) def import_wallet(self, body: T.ImportWalletRequest) -> T.ImportWalletResponse: """ - Import Wallet. + Import Wallet. - - This endpoint is not enabled by default. [Contact Dfns](https://support.dfns.co) to have it activated. - + +This endpoint is not enabled by default. [Contact Dfns](https://support.dfns.co) to have it activated. + - Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. This happens by default when you [create a wallet](https://docs.dfns.co/api-reference/wallets/create-wallet). +Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. This happens by default when you [create a wallet](https://docs.dfns.co/api-reference/wallets/create-wallet). - In some circumstances, however, you may need to import an existing wallet (an existing private key) into Dfns infrastructure, instead of creating a brand new wallet with Dfns and transfer funds to it. As an example, you might want to keep an existing wallet if its address is tied to a smart contract which you don't want to re-deploy. +In some circumstances, however, you may need to import an existing wallet (an existing private key) into Dfns infrastructure, instead of creating a brand new wallet with Dfns and transfer funds to it. As an example, you might want to keep an existing wallet if its address is tied to a smart contract which you don't want to re-deploy. - In such a case, Dfns exposes this wallet import API endpoint, which can be used in conjunction with our [import SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/sdk/import-wallet). Note this is intended to be used only to migrate wallets when first onboarding onto the Dfns platform. +In such a case, Dfns exposes this wallet import API endpoint, which can be used in conjunction with our [import SDK](https://github.com/dfns/dfns-sdk-ts/tree/m/examples/sdk/import-wallet). Note this is intended to be used only to migrate wallets when first onboarding onto the Dfns platform. - - Dfns can not guarantee the security of imported wallets, as we have no way to control who had access to the private key prior to import. For this reason, this feature is restricted to Enterprise customers who have signed a contractual addendum limiting our liability for imported keys. Please contact your sales representative for more information. - + +Dfns can not guarantee the security of imported wallets, as we have no way to control who had access to the private key prior to import. For this reason, this feature is restricted to Enterprise customers who have signed a contractual addendum limiting our liability for imported keys. Please contact your sales representative for more information. + - Args: - body: Request body. + Args: + body: Request body. - Returns: - T.ImportWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ImportWalletResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/import", path_params={}, @@ -575,22 +546,21 @@ def import_wallet(self, body: T.ImportWalletRequest) -> T.ImportWalletResponse: body=body, requires_signature=True, ) - return cast(T.ImportWalletResponse, response) - def list_transfers(self, wallet_id: str, query: T.ListTransfersQuery | None = None) -> T.ListTransfersResponse: + def list_transfers(self, wallet_id: str, query: Optional[T.ListTransfersQuery] = None) -> T.ListTransfersResponse: """ List Transfers. Retrieves a list of transfer requests for the specified wallet. Args: - wallet_id: Wallet id. - query: Query parameters. + wallet_id: Wallet id. + query: Query parameters. Returns: T.ListTransfersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transfers", path_params={"walletId": wallet_id}, @@ -598,34 +568,33 @@ def list_transfers(self, wallet_id: str, query: T.ListTransfersQuery | None = No body=None, requires_signature=False, ) - return cast(T.ListTransfersResponse, response) def transfer_asset(self, wallet_id: str, body: dict[str, Any]) -> T.TransferAssetResponse: """ - Transfer Asset. + Transfer Asset. - Transfer an asset out of the specified wallet to a destination address. - For all fungible token transfers, the transfer amount must be specified in the minimum denomination of that token. - For example, use the amount in Satoshi for a Bitcoin transfer, or the amount in Wei for an Ethereum transfer etc. + Transfer an asset out of the specified wallet to a destination address. +For all fungible token transfers, the transfer amount must be specified in the minimum denomination of that token. +For example, use the amount in Satoshi for a Bitcoin transfer, or the amount in Wei for an Ethereum transfer etc. - See the different options in the Body description below. You can also select your kind of transfers in the payload examples in the different languages. +See the different options in the Body description below. You can also select your kind of transfers in the payload examples in the different languages. - - Binance chains users can use ERC transfers for BEP tokens and Native transfers for BNB. - + +Binance chains users can use ERC transfers for BEP tokens and Native transfers for BNB. + - - Some blockchains may require additional steps before the transfer can be completed, such as creating a destination account (e.g., Stellar). Please refer to the specific blockchain documentation for any prerequisites or additional requirements. - + +Some blockchains may require additional steps before the transfer can be completed, such as creating a destination account (e.g., Stellar). Please refer to the specific blockchain documentation for any prerequisites or additional requirements. + - Args: - wallet_id: The source wallet id (`wa-...`). - body: Request body. + Args: + wallet_id: The source wallet id (`wa-...`). + body: Request body. - Returns: - T.TransferAssetResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.TransferAssetResponse: The API response. + """ + return self._http.request( method="POST", path="/wallets/{walletId}/transfers", path_params={"walletId": wallet_id}, @@ -633,7 +602,6 @@ def transfer_asset(self, wallet_id: str, body: dict[str, Any]) -> T.TransferAsse body=body, requires_signature=True, ) - return cast(T.TransferAssetResponse, response) def tag_wallet(self, wallet_id: str, body: T.TagWalletRequest) -> T.TagWalletResponse: """ @@ -642,13 +610,13 @@ def tag_wallet(self, wallet_id: str, body: T.TagWalletRequest) -> T.TagWalletRes Add a [Tag](https://docs.dfns.co/api-reference/wallets/tags) to a wallet. Args: - wallet_id: Path parameter. - body: Request body. + wallet_id: Path parameter. + body: Request body. Returns: T.TagWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/wallets/{walletId}/tags", path_params={"walletId": wallet_id}, @@ -656,7 +624,6 @@ def tag_wallet(self, wallet_id: str, body: T.TagWalletRequest) -> T.TagWalletRes body=body, requires_signature=True, ) - return cast(T.TagWalletResponse, response) def untag_wallet(self, wallet_id: str, body: T.UntagWalletRequest) -> T.UntagWalletResponse: """ @@ -665,13 +632,13 @@ def untag_wallet(self, wallet_id: str, body: T.UntagWalletRequest) -> T.UntagWal Removes the specified tags from a wallet. Args: - wallet_id: Path parameter. - body: Request body. + wallet_id: Path parameter. + body: Request body. Returns: T.UntagWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/wallets/{walletId}/tags", path_params={"walletId": wallet_id}, @@ -679,7 +646,6 @@ def untag_wallet(self, wallet_id: str, body: T.UntagWalletRequest) -> T.UntagWal body=body, requires_signature=True, ) - return cast(T.UntagWalletResponse, response) def get_offer(self, wallet_id: str, offer_id: str) -> T.GetOfferResponse: """ @@ -688,13 +654,13 @@ def get_offer(self, wallet_id: str, offer_id: str) -> T.GetOfferResponse: Retrieve information about a specific offer received on your wallet. Args: - wallet_id: Wallet id. - offer_id: Offer id. + wallet_id: Wallet id. + offer_id: Offer id. Returns: T.GetOfferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/offers/{offerId}", path_params={"walletId": wallet_id, "offerId": offer_id}, @@ -702,22 +668,21 @@ def get_offer(self, wallet_id: str, offer_id: str) -> T.GetOfferResponse: body=None, requires_signature=False, ) - return cast(T.GetOfferResponse, response) - def list_offers(self, wallet_id: str, query: T.ListOffersQuery | None = None) -> T.ListOffersResponse: + def list_offers(self, wallet_id: str, query: Optional[T.ListOffersQuery] = None) -> T.ListOffersResponse: """ List Offers. List all offers received on a specific wallet. Args: - wallet_id: Wallet id. - query: Query parameters. + wallet_id: Wallet id. + query: Query parameters. Returns: T.ListOffersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/offers", path_params={"walletId": wallet_id}, @@ -725,7 +690,6 @@ def list_offers(self, wallet_id: str, query: T.ListOffersQuery | None = None) -> body=None, requires_signature=False, ) - return cast(T.ListOffersResponse, response) def accept_offer(self, wallet_id: str, offer_id: str) -> T.AcceptOfferResponse: """ @@ -734,13 +698,13 @@ def accept_offer(self, wallet_id: str, offer_id: str) -> T.AcceptOfferResponse: Accept an offer received on your wallet. Args: - wallet_id: Wallet id. - offer_id: Offer id. + wallet_id: Wallet id. + offer_id: Offer id. Returns: T.AcceptOfferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/wallets/{walletId}/offers/{offerId}/accept", path_params={"walletId": wallet_id, "offerId": offer_id}, @@ -748,7 +712,6 @@ def accept_offer(self, wallet_id: str, offer_id: str) -> T.AcceptOfferResponse: body=None, requires_signature=True, ) - return cast(T.AcceptOfferResponse, response) def reject_offer(self, wallet_id: str, offer_id: str) -> T.RejectOfferResponse: """ @@ -757,13 +720,13 @@ def reject_offer(self, wallet_id: str, offer_id: str) -> T.RejectOfferResponse: Reject an offer received on your wallet. Args: - wallet_id: Wallet id. - offer_id: Offer id. + wallet_id: Wallet id. + offer_id: Offer id. Returns: T.RejectOfferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/wallets/{walletId}/offers/{offerId}/reject", path_params={"walletId": wallet_id, "offerId": offer_id}, @@ -771,21 +734,20 @@ def reject_offer(self, wallet_id: str, offer_id: str) -> T.RejectOfferResponse: body=None, requires_signature=True, ) - return cast(T.RejectOfferResponse, response) - def list_org_wallet_history(self, query: T.ListOrgWalletHistoryQuery) -> dict[str, Any] | str: + def list_org_wallet_history(self, query: T.ListOrgWalletHistoryQuery) -> Union[TypedDict, str]: """ List Org Wallet History. Retrieve the transaction history across all wallets within a specified timeframe. The time range is unbounded, but the CSV export is capped at 100,000 rows. Args: - query: Query parameters. + query: Query parameters. Returns: - dict[str, Any] | str: The API response. - """ # noqa: E501 - response = self._http.request( + Union[TypedDict, str]: The API response. + """ + return self._http.request( method="GET", path="/wallets/all/history", path_params={}, @@ -793,4 +755,3 @@ def list_org_wallet_history(self, query: T.ListOrgWalletHistoryQuery) -> dict[st body=None, requires_signature=False, ) - return cast(dict[str, Any] | str, response) diff --git a/dfns_sdk/generated/wallets/delegated_client.py b/dfns_sdk/generated/wallets/delegated_client.py index b429f1e..eb5aa60 100644 --- a/dfns_sdk/generated/wallets/delegated_client.py +++ b/dfns_sdk/generated/wallets/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the wallets domain.""" import json -from typing import Any, cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -26,12 +30,12 @@ def abort_transaction_init(self, wallet_id: str, transaction_id: str) -> UserAct Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + wallet_id: Wallet id. + transaction_id: Transaction id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transactions/{transactionId}/abort" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{transactionId}", str(transaction_id)) @@ -44,26 +48,26 @@ def abort_transaction_init(self, wallet_id: str, transaction_id: str) -> UserAct user_action_payload=payload, ) - def abort_transaction_complete( - self, wallet_id: str, transaction_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.AbortTransactionResponse: + def abort_transaction_complete(self, wallet_id: str, transaction_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.AbortTransactionResponse: """ Complete Abort Transaction. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + transaction_id: Transaction id. + signed_challenge: The signed challenge from external signing. Returns: T.AbortTransactionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/wallets/{walletId}/transactions/{transactionId}/abort", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -71,7 +75,6 @@ def abort_transaction_complete( body=None, user_action=user_action_token, ) - return cast(T.AbortTransactionResponse, response) def abort_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionChallengeResponse: """ @@ -80,12 +83,12 @@ def abort_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionCha Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + wallet_id: Wallet id. + transfer_id: Transfer id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transfers/{transferId}/abort" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{transferId}", str(transfer_id)) @@ -98,26 +101,26 @@ def abort_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionCha user_action_payload=payload, ) - def abort_transfer_complete( - self, wallet_id: str, transfer_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.AbortTransferResponse: + def abort_transfer_complete(self, wallet_id: str, transfer_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.AbortTransferResponse: """ Complete Abort Transfer. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + transfer_id: Transfer id. + signed_challenge: The signed challenge from external signing. Returns: T.AbortTransferResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/wallets/{walletId}/transfers/{transferId}/abort", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -125,7 +128,6 @@ def abort_transfer_complete( body=None, user_action=user_action_token, ) - return cast(T.AbortTransferResponse, response) def activate_wallet_init(self, wallet_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -134,12 +136,12 @@ def activate_wallet_init(self, wallet_id: str, body: dict[str, Any]) -> UserActi Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - body: Request body. + wallet_id: Wallet id. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/activate" path = path.replace("{walletId}", str(wallet_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -151,26 +153,26 @@ def activate_wallet_init(self, wallet_id: str, body: dict[str, Any]) -> UserActi user_action_payload=payload, ) - def activate_wallet_complete( - self, wallet_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.ActivateWalletResponse: + def activate_wallet_complete(self, wallet_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.ActivateWalletResponse: """ Complete Activate Wallet. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - body: Request body. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.ActivateWalletResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/activate", path_params={"walletId": wallet_id}, @@ -178,24 +180,21 @@ def activate_wallet_complete( body=body, user_action=user_action_token, ) - return cast(T.ActivateWalletResponse, response) - def list_transactions( - self, wallet_id: str, query: T.ListTransactionsQuery | None = None - ) -> T.ListTransactionsResponse: + def list_transactions(self, wallet_id: str, query: Optional[T.ListTransactionsQuery] = None) -> T.ListTransactionsResponse: """ List Transactions. Retrieves a list of transactions requests for the specified wallet. Args: - wallet_id: Wallet id. - query: Query parameters. + wallet_id: Wallet id. + query: Query parameters. Returns: T.ListTransactionsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transactions", path_params={"walletId": wallet_id}, @@ -203,7 +202,6 @@ def list_transactions( body=None, requires_signature=False, ) - return cast(T.ListTransactionsResponse, response) def sign_and_broadcast_transaction_init(self, wallet_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -212,12 +210,12 @@ def sign_and_broadcast_transaction_init(self, wallet_id: str, body: dict[str, An Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - body: Request body. + wallet_id: Wallet id. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transactions" path = path.replace("{walletId}", str(wallet_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -229,26 +227,26 @@ def sign_and_broadcast_transaction_init(self, wallet_id: str, body: dict[str, An user_action_payload=payload, ) - def sign_and_broadcast_transaction_complete( - self, wallet_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.SignAndBroadcastTransactionResponse: + def sign_and_broadcast_transaction_complete(self, wallet_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.SignAndBroadcastTransactionResponse: """ Complete Sign and Broadcast Transaction. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - body: Request body. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.SignAndBroadcastTransactionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/transactions", path_params={"walletId": wallet_id}, @@ -256,7 +254,6 @@ def sign_and_broadcast_transaction_complete( body=body, user_action=user_action_token, ) - return cast(T.SignAndBroadcastTransactionResponse, response) def cancel_transaction_init(self, wallet_id: str, transaction_id: str) -> UserActionChallengeResponse: """ @@ -265,12 +262,12 @@ def cancel_transaction_init(self, wallet_id: str, transaction_id: str) -> UserAc Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + wallet_id: Wallet id. + transaction_id: Transaction id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transactions/{transactionId}/cancel" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{transactionId}", str(transaction_id)) @@ -283,26 +280,26 @@ def cancel_transaction_init(self, wallet_id: str, transaction_id: str) -> UserAc user_action_payload=payload, ) - def cancel_transaction_complete( - self, wallet_id: str, transaction_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.CancelTransactionResponse: + def cancel_transaction_complete(self, wallet_id: str, transaction_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.CancelTransactionResponse: """ Complete Cancel Transaction. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + transaction_id: Transaction id. + signed_challenge: The signed challenge from external signing. Returns: T.CancelTransactionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/transactions/{transactionId}/cancel", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -310,7 +307,6 @@ def cancel_transaction_complete( body=None, user_action=user_action_token, ) - return cast(T.CancelTransactionResponse, response) def cancel_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionChallengeResponse: """ @@ -319,12 +315,12 @@ def cancel_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionCh Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + wallet_id: Wallet id. + transfer_id: Transfer id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transfers/{transferId}/cancel" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{transferId}", str(transfer_id)) @@ -337,26 +333,26 @@ def cancel_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionCh user_action_payload=payload, ) - def cancel_transfer_complete( - self, wallet_id: str, transfer_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.CancelTransferResponse: + def cancel_transfer_complete(self, wallet_id: str, transfer_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.CancelTransferResponse: """ Complete Cancel Transfer. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + transfer_id: Transfer id. + signed_challenge: The signed challenge from external signing. Returns: T.CancelTransferResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/transfers/{transferId}/cancel", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -364,24 +360,21 @@ def cancel_transfer_complete( body=None, user_action=user_action_token, ) - return cast(T.CancelTransferResponse, response) - def proxy_a_request_to_the_canton_ledger_api( - self, wallet_id: str, body: T.ProxyARequestToTheCantonLedgerApiRequest - ) -> dict[str, Any]: + def proxy_a_request_to_the_canton_ledger_api(self, wallet_id: str, body: T.ProxyARequestToTheCantonLedgerApiRequest) -> dict[str, Any]: """ Proxy a request to the Canton Ledger API. Proxies a request to the Canton Ledger API associated with this wallet, using the validator's OAuth2 credentials. Restricted to a curated allow-list of read-style resources. Used to satisfy the Canton WalletConnect `canton_ledgerApi` method. Args: - wallet_id: Wallet id. - body: Request body. + wallet_id: Wallet id. + body: Request body. Returns: dict[str, Any]: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/wallets/{walletId}/canton/ledger-api", path_params={"walletId": wallet_id}, @@ -389,7 +382,6 @@ def proxy_a_request_to_the_canton_ledger_api( body=body, requires_signature=False, ) - return cast(dict[str, Any], response) def speed_up_transaction_init(self, wallet_id: str, transaction_id: str) -> UserActionChallengeResponse: """ @@ -398,12 +390,12 @@ def speed_up_transaction_init(self, wallet_id: str, transaction_id: str) -> User Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + wallet_id: Wallet id. + transaction_id: Transaction id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transactions/{transactionId}/speed-up" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{transactionId}", str(transaction_id)) @@ -416,26 +408,26 @@ def speed_up_transaction_init(self, wallet_id: str, transaction_id: str) -> User user_action_payload=payload, ) - def speed_up_transaction_complete( - self, wallet_id: str, transaction_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.SpeedUpTransactionResponse: + def speed_up_transaction_complete(self, wallet_id: str, transaction_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.SpeedUpTransactionResponse: """ Complete Speed Up Transaction. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + transaction_id: Transaction id. + signed_challenge: The signed challenge from external signing. Returns: T.SpeedUpTransactionResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/transactions/{transactionId}/speed-up", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -443,7 +435,6 @@ def speed_up_transaction_complete( body=None, user_action=user_action_token, ) - return cast(T.SpeedUpTransactionResponse, response) def speed_up_transfer_init(self, wallet_id: str, transfer_id: str) -> UserActionChallengeResponse: """ @@ -452,12 +443,12 @@ def speed_up_transfer_init(self, wallet_id: str, transfer_id: str) -> UserAction Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + wallet_id: Wallet id. + transfer_id: Transfer id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transfers/{transferId}/speed-up" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{transferId}", str(transfer_id)) @@ -470,26 +461,26 @@ def speed_up_transfer_init(self, wallet_id: str, transfer_id: str) -> UserAction user_action_payload=payload, ) - def speed_up_transfer_complete( - self, wallet_id: str, transfer_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.SpeedUpTransferResponse: + def speed_up_transfer_complete(self, wallet_id: str, transfer_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.SpeedUpTransferResponse: """ Complete Speed Up Transfer. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + transfer_id: Transfer id. + signed_challenge: The signed challenge from external signing. Returns: T.SpeedUpTransferResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/transfers/{transferId}/speed-up", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -497,21 +488,20 @@ def speed_up_transfer_complete( body=None, user_action=user_action_token, ) - return cast(T.SpeedUpTransferResponse, response) - def list_wallets(self, query: T.ListWalletsQuery | None = None) -> T.ListWalletsResponse: + def list_wallets(self, query: Optional[T.ListWalletsQuery] = None) -> T.ListWalletsResponse: """ List Wallets. Retrieves the list of Wallets in your organization. You can filter the results by owner (either by owner id or owner username). Pagination is supported via limit and paginationToken parameters. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListWalletsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets", path_params={}, @@ -519,7 +509,6 @@ def list_wallets(self, query: T.ListWalletsQuery | None = None) -> T.ListWallets body=None, requires_signature=False, ) - return cast(T.ListWalletsResponse, response) def create_wallet_init(self, body: T.CreateWalletRequest) -> UserActionChallengeResponse: """ @@ -528,11 +517,11 @@ def create_wallet_init(self, body: T.CreateWalletRequest) -> UserActionChallenge Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -543,25 +532,25 @@ def create_wallet_init(self, body: T.CreateWalletRequest) -> UserActionChallenge user_action_payload=payload, ) - def create_wallet_complete( - self, body: T.CreateWalletRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateWalletResponse: + def create_wallet_complete(self, body: T.CreateWalletRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateWalletResponse: """ Complete Create Wallet. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateWalletResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets", path_params={}, @@ -569,7 +558,6 @@ def create_wallet_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateWalletResponse, response) def get_transaction(self, wallet_id: str, transaction_id: str) -> T.GetTransactionResponse: """ @@ -578,13 +566,13 @@ def get_transaction(self, wallet_id: str, transaction_id: str) -> T.GetTransacti Retrieve information about a specific transaction. Args: - wallet_id: Wallet id. - transaction_id: Transaction id. + wallet_id: Wallet id. + transaction_id: Transaction id. Returns: T.GetTransactionResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transactions/{transactionId}", path_params={"walletId": wallet_id, "transactionId": transaction_id}, @@ -592,7 +580,6 @@ def get_transaction(self, wallet_id: str, transaction_id: str) -> T.GetTransacti body=None, requires_signature=False, ) - return cast(T.GetTransactionResponse, response) def get_transfer(self, wallet_id: str, transfer_id: str) -> T.GetTransferResponse: """ @@ -601,13 +588,13 @@ def get_transfer(self, wallet_id: str, transfer_id: str) -> T.GetTransferRespons Retrieves a Wallet Transfer Request by its ID. Args: - wallet_id: Wallet id. - transfer_id: Transfer id. + wallet_id: Wallet id. + transfer_id: Transfer id. Returns: T.GetTransferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transfers/{transferId}", path_params={"walletId": wallet_id, "transferId": transfer_id}, @@ -615,7 +602,6 @@ def get_transfer(self, wallet_id: str, transfer_id: str) -> T.GetTransferRespons body=None, requires_signature=False, ) - return cast(T.GetTransferResponse, response) def get_wallet(self, wallet_id: str) -> T.GetWalletResponse: """ @@ -624,12 +610,12 @@ def get_wallet(self, wallet_id: str) -> T.GetWalletResponse: Retrieves a Wallet information by its ID. Args: - wallet_id: The wallet to retrieve. + wallet_id: The wallet to retrieve. Returns: T.GetWalletResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}", path_params={"walletId": wallet_id}, @@ -637,7 +623,6 @@ def get_wallet(self, wallet_id: str) -> T.GetWalletResponse: body=None, requires_signature=False, ) - return cast(T.GetWalletResponse, response) def update_wallet_init(self, wallet_id: str, body: T.UpdateWalletRequest) -> UserActionChallengeResponse: """ @@ -646,12 +631,12 @@ def update_wallet_init(self, wallet_id: str, body: T.UpdateWalletRequest) -> Use Creates a user action challenge for external signing. Args: - wallet_id: Path parameter. - body: Request body. + wallet_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}" path = path.replace("{walletId}", str(wallet_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -663,26 +648,26 @@ def update_wallet_init(self, wallet_id: str, body: T.UpdateWalletRequest) -> Use user_action_payload=payload, ) - def update_wallet_complete( - self, wallet_id: str, body: T.UpdateWalletRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UpdateWalletResponse: + def update_wallet_complete(self, wallet_id: str, body: T.UpdateWalletRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdateWalletResponse: """ Complete Update Wallet. Submits the signed challenge and makes the API request. Args: - wallet_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + wallet_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdateWalletResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/wallets/{walletId}", path_params={"walletId": wallet_id}, @@ -690,24 +675,21 @@ def update_wallet_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdateWalletResponse, response) - def get_wallet_assets( - self, wallet_id: str, query: T.GetWalletAssetsQuery | None = None - ) -> T.GetWalletAssetsResponse: + def get_wallet_assets(self, wallet_id: str, query: Optional[T.GetWalletAssetsQuery] = None) -> T.GetWalletAssetsResponse: """ Get Wallet Assets. Retrieves a list of assets owned by the specified wallet. Return values vary by chain as shown below. Args: - wallet_id: Path parameter. - query: Query parameters. + wallet_id: Path parameter. + query: Query parameters. Returns: T.GetWalletAssetsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/assets", path_params={"walletId": wallet_id}, @@ -715,31 +697,28 @@ def get_wallet_assets( body=None, requires_signature=False, ) - return cast(T.GetWalletAssetsResponse, response) - def get_wallet_history( - self, wallet_id: str, query: T.GetWalletHistoryQuery | None = None - ) -> T.GetWalletHistoryResponse: + def get_wallet_history(self, wallet_id: str, query: Optional[T.GetWalletHistoryQuery] = None) -> T.GetWalletHistoryResponse: """ - Get Wallet History. + Get Wallet History. - Retrieves a list of historical on chain activities for the specified wallet. + Retrieves a list of historical on chain activities for the specified wallet. - The list reflects the indexed on-chain activity: it includes confirmed transactions only. +The list reflects the indexed on-chain activity: it includes confirmed transactions only. - If you need to list your on-going or failed transactions please use the related endpoints ( - [List Transfers](https://docs.dfns.co/api-reference/wallets/list-transfers) or - [List Transactions](https://docs.dfns.co/api-reference/wallets/list-transactions) - depending on the API you are using). +If you need to list your on-going or failed transactions please use the related endpoints ( +[List Transfers](https://docs.dfns.co/api-reference/wallets/list-transfers) or +[List Transactions](https://docs.dfns.co/api-reference/wallets/list-transactions) +depending on the API you are using). - Args: - wallet_id: Wallet you want to get the history from. - query: Query parameters. + Args: + wallet_id: Wallet you want to get the history from. + query: Query parameters. - Returns: - T.GetWalletHistoryResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetWalletHistoryResponse: The API response. + """ + return self._http.request( method="GET", path="/wallets/{walletId}/history", path_params={"walletId": wallet_id}, @@ -747,7 +726,6 @@ def get_wallet_history( body=None, requires_signature=False, ) - return cast(T.GetWalletHistoryResponse, response) def get_wallet_nfts(self, wallet_id: str) -> T.GetWalletNftsResponse: """ @@ -756,12 +734,12 @@ def get_wallet_nfts(self, wallet_id: str) -> T.GetWalletNftsResponse: Retrieves a list of NFTs owned by the specified Wallet. Args: - wallet_id: Path parameter. + wallet_id: Path parameter. Returns: T.GetWalletNftsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/nfts", path_params={"walletId": wallet_id}, @@ -769,7 +747,6 @@ def get_wallet_nfts(self, wallet_id: str) -> T.GetWalletNftsResponse: body=None, requires_signature=False, ) - return cast(T.GetWalletNftsResponse, response) def import_wallet_init(self, body: T.ImportWalletRequest) -> UserActionChallengeResponse: """ @@ -778,11 +755,11 @@ def import_wallet_init(self, body: T.ImportWalletRequest) -> UserActionChallenge Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/import" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -793,25 +770,25 @@ def import_wallet_init(self, body: T.ImportWalletRequest) -> UserActionChallenge user_action_payload=payload, ) - def import_wallet_complete( - self, body: T.ImportWalletRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.ImportWalletResponse: + def import_wallet_complete(self, body: T.ImportWalletRequest, signed_challenge: SignUserActionChallengeRequest) -> T.ImportWalletResponse: """ Complete Import Wallet. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.ImportWalletResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/import", path_params={}, @@ -819,22 +796,21 @@ def import_wallet_complete( body=body, user_action=user_action_token, ) - return cast(T.ImportWalletResponse, response) - def list_transfers(self, wallet_id: str, query: T.ListTransfersQuery | None = None) -> T.ListTransfersResponse: + def list_transfers(self, wallet_id: str, query: Optional[T.ListTransfersQuery] = None) -> T.ListTransfersResponse: """ List Transfers. Retrieves a list of transfer requests for the specified wallet. Args: - wallet_id: Wallet id. - query: Query parameters. + wallet_id: Wallet id. + query: Query parameters. Returns: T.ListTransfersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/transfers", path_params={"walletId": wallet_id}, @@ -842,7 +818,6 @@ def list_transfers(self, wallet_id: str, query: T.ListTransfersQuery | None = No body=None, requires_signature=False, ) - return cast(T.ListTransfersResponse, response) def transfer_asset_init(self, wallet_id: str, body: dict[str, Any]) -> UserActionChallengeResponse: """ @@ -851,12 +826,12 @@ def transfer_asset_init(self, wallet_id: str, body: dict[str, Any]) -> UserActio Creates a user action challenge for external signing. Args: - wallet_id: The source wallet id (`wa-...`). - body: Request body. + wallet_id: The source wallet id (`wa-...`). + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/transfers" path = path.replace("{walletId}", str(wallet_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -868,26 +843,26 @@ def transfer_asset_init(self, wallet_id: str, body: dict[str, Any]) -> UserActio user_action_payload=payload, ) - def transfer_asset_complete( - self, wallet_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest - ) -> T.TransferAssetResponse: + def transfer_asset_complete(self, wallet_id: str, body: dict[str, Any], signed_challenge: SignUserActionChallengeRequest) -> T.TransferAssetResponse: """ Complete Transfer Asset. Submits the signed challenge and makes the API request. Args: - wallet_id: The source wallet id (`wa-...`). - body: Request body. - signed_challenge: The signed challenge from external signing. + wallet_id: The source wallet id (`wa-...`). + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.TransferAssetResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/wallets/{walletId}/transfers", path_params={"walletId": wallet_id}, @@ -895,7 +870,6 @@ def transfer_asset_complete( body=body, user_action=user_action_token, ) - return cast(T.TransferAssetResponse, response) def tag_wallet_init(self, wallet_id: str, body: T.TagWalletRequest) -> UserActionChallengeResponse: """ @@ -904,12 +878,12 @@ def tag_wallet_init(self, wallet_id: str, body: T.TagWalletRequest) -> UserActio Creates a user action challenge for external signing. Args: - wallet_id: Path parameter. - body: Request body. + wallet_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/tags" path = path.replace("{walletId}", str(wallet_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -921,26 +895,26 @@ def tag_wallet_init(self, wallet_id: str, body: T.TagWalletRequest) -> UserActio user_action_payload=payload, ) - def tag_wallet_complete( - self, wallet_id: str, body: T.TagWalletRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.TagWalletResponse: + def tag_wallet_complete(self, wallet_id: str, body: T.TagWalletRequest, signed_challenge: SignUserActionChallengeRequest) -> T.TagWalletResponse: """ Complete Tag Wallet. Submits the signed challenge and makes the API request. Args: - wallet_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + wallet_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.TagWalletResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/wallets/{walletId}/tags", path_params={"walletId": wallet_id}, @@ -948,7 +922,6 @@ def tag_wallet_complete( body=body, user_action=user_action_token, ) - return cast(T.TagWalletResponse, response) def untag_wallet_init(self, wallet_id: str, body: T.UntagWalletRequest) -> UserActionChallengeResponse: """ @@ -957,12 +930,12 @@ def untag_wallet_init(self, wallet_id: str, body: T.UntagWalletRequest) -> UserA Creates a user action challenge for external signing. Args: - wallet_id: Path parameter. - body: Request body. + wallet_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/tags" path = path.replace("{walletId}", str(wallet_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -974,26 +947,26 @@ def untag_wallet_init(self, wallet_id: str, body: T.UntagWalletRequest) -> UserA user_action_payload=payload, ) - def untag_wallet_complete( - self, wallet_id: str, body: T.UntagWalletRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UntagWalletResponse: + def untag_wallet_complete(self, wallet_id: str, body: T.UntagWalletRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UntagWalletResponse: """ Complete Untag Wallet. Submits the signed challenge and makes the API request. Args: - wallet_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + wallet_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UntagWalletResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/wallets/{walletId}/tags", path_params={"walletId": wallet_id}, @@ -1001,7 +974,6 @@ def untag_wallet_complete( body=body, user_action=user_action_token, ) - return cast(T.UntagWalletResponse, response) def get_offer(self, wallet_id: str, offer_id: str) -> T.GetOfferResponse: """ @@ -1010,13 +982,13 @@ def get_offer(self, wallet_id: str, offer_id: str) -> T.GetOfferResponse: Retrieve information about a specific offer received on your wallet. Args: - wallet_id: Wallet id. - offer_id: Offer id. + wallet_id: Wallet id. + offer_id: Offer id. Returns: T.GetOfferResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/offers/{offerId}", path_params={"walletId": wallet_id, "offerId": offer_id}, @@ -1024,22 +996,21 @@ def get_offer(self, wallet_id: str, offer_id: str) -> T.GetOfferResponse: body=None, requires_signature=False, ) - return cast(T.GetOfferResponse, response) - def list_offers(self, wallet_id: str, query: T.ListOffersQuery | None = None) -> T.ListOffersResponse: + def list_offers(self, wallet_id: str, query: Optional[T.ListOffersQuery] = None) -> T.ListOffersResponse: """ List Offers. List all offers received on a specific wallet. Args: - wallet_id: Wallet id. - query: Query parameters. + wallet_id: Wallet id. + query: Query parameters. Returns: T.ListOffersResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/wallets/{walletId}/offers", path_params={"walletId": wallet_id}, @@ -1047,7 +1018,6 @@ def list_offers(self, wallet_id: str, query: T.ListOffersQuery | None = None) -> body=None, requires_signature=False, ) - return cast(T.ListOffersResponse, response) def accept_offer_init(self, wallet_id: str, offer_id: str) -> UserActionChallengeResponse: """ @@ -1056,12 +1026,12 @@ def accept_offer_init(self, wallet_id: str, offer_id: str) -> UserActionChalleng Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - offer_id: Offer id. + wallet_id: Wallet id. + offer_id: Offer id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/offers/{offerId}/accept" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{offerId}", str(offer_id)) @@ -1074,26 +1044,26 @@ def accept_offer_init(self, wallet_id: str, offer_id: str) -> UserActionChalleng user_action_payload=payload, ) - def accept_offer_complete( - self, wallet_id: str, offer_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.AcceptOfferResponse: + def accept_offer_complete(self, wallet_id: str, offer_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.AcceptOfferResponse: """ Complete Accept Offer. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - offer_id: Offer id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + offer_id: Offer id. + signed_challenge: The signed challenge from external signing. Returns: T.AcceptOfferResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/wallets/{walletId}/offers/{offerId}/accept", path_params={"walletId": wallet_id, "offerId": offer_id}, @@ -1101,7 +1071,6 @@ def accept_offer_complete( body=None, user_action=user_action_token, ) - return cast(T.AcceptOfferResponse, response) def reject_offer_init(self, wallet_id: str, offer_id: str) -> UserActionChallengeResponse: """ @@ -1110,12 +1079,12 @@ def reject_offer_init(self, wallet_id: str, offer_id: str) -> UserActionChalleng Creates a user action challenge for external signing. Args: - wallet_id: Wallet id. - offer_id: Offer id. + wallet_id: Wallet id. + offer_id: Offer id. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/wallets/{walletId}/offers/{offerId}/reject" path = path.replace("{walletId}", str(wallet_id)) path = path.replace("{offerId}", str(offer_id)) @@ -1128,26 +1097,26 @@ def reject_offer_init(self, wallet_id: str, offer_id: str) -> UserActionChalleng user_action_payload=payload, ) - def reject_offer_complete( - self, wallet_id: str, offer_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.RejectOfferResponse: + def reject_offer_complete(self, wallet_id: str, offer_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.RejectOfferResponse: """ Complete Reject Offer. Submits the signed challenge and makes the API request. Args: - wallet_id: Wallet id. - offer_id: Offer id. - signed_challenge: The signed challenge from external signing. + wallet_id: Wallet id. + offer_id: Offer id. + signed_challenge: The signed challenge from external signing. Returns: T.RejectOfferResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/wallets/{walletId}/offers/{offerId}/reject", path_params={"walletId": wallet_id, "offerId": offer_id}, @@ -1155,21 +1124,20 @@ def reject_offer_complete( body=None, user_action=user_action_token, ) - return cast(T.RejectOfferResponse, response) - def list_org_wallet_history(self, query: T.ListOrgWalletHistoryQuery) -> dict[str, Any] | str: + def list_org_wallet_history(self, query: T.ListOrgWalletHistoryQuery) -> Union[TypedDict, str]: """ List Org Wallet History. Retrieve the transaction history across all wallets within a specified timeframe. The time range is unbounded, but the CSV export is capped at 100,000 rows. Args: - query: Query parameters. + query: Query parameters. Returns: - dict[str, Any] | str: The API response. - """ # noqa: E501 - response = self._http.request( + Union[TypedDict, str]: The API response. + """ + return self._http.request( method="GET", path="/wallets/all/history", path_params={}, @@ -1177,4 +1145,3 @@ def list_org_wallet_history(self, query: T.ListOrgWalletHistoryQuery) -> dict[st body=None, requires_signature=False, ) - return cast(dict[str, Any] | str, response) diff --git a/dfns_sdk/generated/wallets/types.py b/dfns_sdk/generated/wallets/types.py index dbed6ca..cdb5427 100644 --- a/dfns_sdk/generated/wallets/types.py +++ b/dfns_sdk/generated/wallets/types.py @@ -1,132 +1,15 @@ """Types for the wallets domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class AbortTransactionResponse(TypedDict, total=False): """abortTransaction response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -140,16 +23,15 @@ class AbortTransactionResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class AbortTransferResponse(TypedDict, total=False): """abortTransfer response.""" id: str wallet_id: str - network: dict[str, Any] - requester: dict[str, Any] - request_body: dict[str, Any] - metadata: dict[str, Any] + network: TypedDict + requester: TypedDict + request_body: TypedDict + metadata: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -164,129 +46,14 @@ class AbortTransferResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class ActivateWalletResponse(TypedDict, total=False): """activateWallet response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -300,144 +67,27 @@ class ActivateWalletResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class ListTransactionsResponse(TypedDict, total=False): """listTransactions response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] wallet_id: str - class ListTransactionsQuery(TypedDict, total=False): """listTransactions query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class SignAndBroadcastTransactionResponse(TypedDict, total=False): """signAndBroadcastTransaction response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -451,129 +101,14 @@ class SignAndBroadcastTransactionResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class CancelTransactionResponse(TypedDict, total=False): """cancelTransaction response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -587,129 +122,14 @@ class CancelTransactionResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class CancelTransferResponse(TypedDict, total=False): """cancelTransfer response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -723,7 +143,6 @@ class CancelTransferResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class ProxyARequestToTheCantonLedgerApiRequest(TypedDict, total=False): """proxyARequestToTheCantonLedgerApi request body.""" @@ -731,129 +150,14 @@ class ProxyARequestToTheCantonLedgerApiRequest(TypedDict, total=False): resource: str body: NotRequired[dict[str, Any]] - class SpeedUpTransactionResponse(TypedDict, total=False): """speedUpTransaction response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -867,129 +171,14 @@ class SpeedUpTransactionResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class SpeedUpTransferResponse(TypedDict, total=False): """speedUpTransfer response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -1003,14 +192,12 @@ class SpeedUpTransferResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class ListWalletsResponse(TypedDict, total=False): """listWallets response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListWalletsQuery(TypedDict, total=False): """listWallets query parameters.""" @@ -1020,254 +207,24 @@ class ListWalletsQuery(TypedDict, total=False): owner_id: NotRequired[str] owner_username: NotRequired[str] - class CreateWalletRequest(TypedDict, total=False): """createWallet request body.""" - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] name: NotRequired[str] - signing_key: NotRequired[dict[str, Any]] + signing_key: NotRequired[TypedDict] delegate_to: NotRequired[str] delay_delegation: NotRequired[bool] external_id: NotRequired[str] tags: NotRequired[list[str]] - class CreateWalletResponse(TypedDict, total=False): """createWallet response.""" id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] address: NotRequired[str] - signing_key: dict[str, Any] + signing_key: TypedDict status: Literal["Active", "Inactive", "Archived"] date_created: str date_deleted: NotRequired[str] @@ -1277,129 +234,14 @@ class CreateWalletResponse(TypedDict, total=False): tags: list[str] validator_id: NotRequired[str] - class GetTransactionResponse(TypedDict, total=False): """getTransaction response.""" id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - requester: dict[str, Any] - request_body: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + requester: TypedDict + request_body: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -1413,16 +255,15 @@ class GetTransactionResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class GetTransferResponse(TypedDict, total=False): """getTransfer response.""" id: str wallet_id: str - network: dict[str, Any] - requester: dict[str, Any] - request_body: dict[str, Any] - metadata: dict[str, Any] + network: TypedDict + requester: TypedDict + request_body: TypedDict + metadata: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -1437,128 +278,13 @@ class GetTransferResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class GetWalletResponse(TypedDict, total=False): """getWallet response.""" id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] address: NotRequired[str] - signing_key: dict[str, Any] + signing_key: TypedDict status: Literal["Active", "Inactive", "Archived"] date_created: str date_deleted: NotRequired[str] @@ -1568,135 +294,19 @@ class GetWalletResponse(TypedDict, total=False): tags: list[str] validator_id: NotRequired[str] - class UpdateWalletRequest(TypedDict, total=False): """updateWallet request body.""" name: NotRequired[Any] external_id: NotRequired[Any] - class UpdateWalletResponse(TypedDict, total=False): """updateWallet response.""" id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] address: NotRequired[str] - signing_key: dict[str, Any] + signing_key: TypedDict status: Literal["Active", "Inactive", "Archived"] date_created: str date_deleted: NotRequired[str] @@ -1706,258 +316,26 @@ class UpdateWalletResponse(TypedDict, total=False): tags: list[str] validator_id: NotRequired[str] - class GetWalletAssetsResponse(TypedDict, total=False): """getWalletAssets response.""" wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - assets: list[dict[str, Any]] - net_worth: NotRequired[dict[str, Any]] - + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + assets: list[TypedDict] + net_worth: NotRequired[TypedDict] class GetWalletAssetsQuery(TypedDict, total=False): """getWalletAssets query parameters.""" net_worth: NotRequired[Literal["true"]] - class GetWalletHistoryResponse(TypedDict, total=False): """getWalletHistory response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] class GetWalletHistoryQuery(TypedDict, total=False): """getWalletHistory query parameters.""" @@ -1965,410 +343,34 @@ class GetWalletHistoryQuery(TypedDict, total=False): limit: NotRequired[int] pagination_token: NotRequired[str] direction: NotRequired[Literal["In", "Out"]] - kind: NotRequired[ - Literal[ - "NativeTransfer", - "Aip21Transfer", - "AsaTransfer", - "AssetTransfer", - "Cip56Transfer", - "Cis2Transfer", - "Cis7Transfer", - "CoinTransfer", - "Erc20Transfer", - "Erc721Transfer", - "Erc7984Transfer", - "HederaErc20Transfer", - "HederaErc721Transfer", - "Hip17Transfer", - "HtsTransfer", - "IouTransfer", - "LockedCoinTransfer", - "Sep41Transfer", - "Snip2Transfer", - "Snip3Transfer", - "SplTransfer", - "Spl2022Transfer", - "Tep74Transfer", - "Trc10Transfer", - "Trc20Transfer", - "Trc721Transfer", - "UtxoTransfer", - "Xls33Transfer", - ] - ] + kind: NotRequired[Literal["NativeTransfer", "Aip21Transfer", "AsaTransfer", "AssetTransfer", "Cip56Transfer", "Cis2Transfer", "Cis7Transfer", "CoinTransfer", "Erc20Transfer", "Erc721Transfer", "Erc7984Transfer", "HederaErc20Transfer", "HederaErc721Transfer", "Hip17Transfer", "HtsTransfer", "IouTransfer", "LockedCoinTransfer", "Sep41Transfer", "Snip2Transfer", "Snip3Transfer", "SplTransfer", "Spl2022Transfer", "Tep74Transfer", "Trc10Transfer", "Trc20Transfer", "Trc721Transfer", "UtxoTransfer", "Xls33Transfer"]] contract: NotRequired[str] - class GetWalletNftsResponse(TypedDict, total=False): """getWalletNfts response.""" wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - nfts: list[dict[str, Any]] - + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + nfts: list[TypedDict] class ImportWalletRequest(TypedDict, total=False): """importWallet request body.""" name: NotRequired[str] curve: Literal["ed25519", "secp256k1", "stark"] - protocol: Literal["CGGMP24", "FROST", "FROST_BITCOIN", "GLOW20_DH", "KU23"] | Literal["CGGMP21"] + protocol: Union[Literal["CGGMP24", "FROST", "FROST_BITCOIN", "GLOW20_DH", "KU23"], Literal["CGGMP21"]] min_signers: int - encrypted_key_shares: list[dict[str, Any]] - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] + encrypted_key_shares: list[TypedDict] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] external_id: NotRequired[str] - class ImportWalletResponse(TypedDict, total=False): """importWallet response.""" id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] address: NotRequired[str] - signing_key: dict[str, Any] + signing_key: TypedDict status: Literal["Active", "Inactive", "Archived"] date_created: str date_deleted: NotRequired[str] @@ -2378,31 +380,28 @@ class ImportWalletResponse(TypedDict, total=False): tags: list[str] validator_id: NotRequired[str] - class ListTransfersResponse(TypedDict, total=False): """listTransfers response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] wallet_id: str - class ListTransfersQuery(TypedDict, total=False): """listTransfers query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class TransferAssetResponse(TypedDict, total=False): """transferAsset response.""" id: str wallet_id: str - network: dict[str, Any] - requester: dict[str, Any] - request_body: dict[str, Any] - metadata: dict[str, Any] + network: TypedDict + requester: TypedDict + request_body: TypedDict + metadata: TypedDict status: Literal["Pending", "Executing", "Broadcasted", "Confirmed", "Failed", "Rejected"] reason: NotRequired[str] tx_hash: NotRequired[str] @@ -2417,179 +416,35 @@ class TransferAssetResponse(TypedDict, total=False): replacement_id: NotRequired[str] details: NotRequired[dict[str, dict[str, Any]]] - class TagWalletRequest(TypedDict, total=False): """tagWallet request body.""" tags: list[str] - class TagWalletResponse(TypedDict, total=False): """tagWallet response.""" pass - class UntagWalletRequest(TypedDict, total=False): """untagWallet request body.""" tags: list[str] - class UntagWalletResponse(TypedDict, total=False): """untagWallet response.""" pass - class GetOfferResponse(TypedDict, total=False): """getOffer response.""" id: str org_id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - kind: Literal[ - "Native", - "Aip21", - "Asa", - "Coin", - "Cip56", - "Erc20", - "Erc721", - "Erc7984", - "Asset", - "Hip17", - "Hts", - "Sep41", - "Spl", - "Spl2022", - "Snip2", - "Snip3", - "Tep74", - "Trc10", - "Trc20", - "Trc721", - "Cis7", - "Cis2", - "Iou", - "Xls33", - ] - metadata: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + kind: Literal["Native", "Aip21", "Asa", "Coin", "Cip56", "Erc20", "Erc721", "Erc7984", "Asset", "Hip17", "Hts", "Sep41", "Spl", "Spl2022", "Snip2", "Snip3", "Tep74", "Trc10", "Trc20", "Trc721", "Cis7", "Cis2", "Iou", "Xls33"] + metadata: TypedDict tx_hash: str status: Literal["Pending", "Accepted", "Rejected", "Withdrawn", "Expired"] from_: str @@ -2601,169 +456,27 @@ class GetOfferResponse(TypedDict, total=False): settlement_transaction_id: NotRequired[str] date_settled: NotRequired[str] - class ListOffersResponse(TypedDict, total=False): """listOffers response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListOffersQuery(TypedDict, total=False): """listOffers query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class AcceptOfferResponse(TypedDict, total=False): """acceptOffer response.""" id: str org_id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - kind: Literal[ - "Native", - "Aip21", - "Asa", - "Coin", - "Cip56", - "Erc20", - "Erc721", - "Erc7984", - "Asset", - "Hip17", - "Hts", - "Sep41", - "Spl", - "Spl2022", - "Snip2", - "Snip3", - "Tep74", - "Trc10", - "Trc20", - "Trc721", - "Cis7", - "Cis2", - "Iou", - "Xls33", - ] - metadata: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + kind: Literal["Native", "Aip21", "Asa", "Coin", "Cip56", "Erc20", "Erc721", "Erc7984", "Asset", "Hip17", "Hts", "Sep41", "Spl", "Spl2022", "Snip2", "Snip3", "Tep74", "Trc10", "Trc20", "Trc721", "Cis7", "Cis2", "Iou", "Xls33"] + metadata: TypedDict tx_hash: str status: Literal["Pending", "Accepted", "Rejected", "Withdrawn", "Expired"] from_: str @@ -2775,155 +488,15 @@ class AcceptOfferResponse(TypedDict, total=False): settlement_transaction_id: NotRequired[str] date_settled: NotRequired[str] - class RejectOfferResponse(TypedDict, total=False): """rejectOffer response.""" id: str org_id: str wallet_id: str - network: Literal[ - "Algorand", - "AlgorandTestnet", - "Aptos", - "AptosTestnet", - "ArbitrumOne", - "ArbitrumSepolia", - "ArcTestnet", - "AvalancheC", - "AvalancheCFuji", - "BabylonGenesis", - "BabylonTestnet5", - "Base", - "BaseSepolia", - "Berachain", - "BerachainBepolia", - "Bitcoin", - "BitcoinSignet", - "BitcoinTestnet4", - "BitcoinCash", - "Bob", - "BobSepolia", - "Bsc", - "BscTestnet", - "Canton", - "CantonTestnet", - "Cardano", - "CardanoPreprod", - "Concordium", - "ConcordiumTestnet", - "Celo", - "CeloAlfajores", - "Codex", - "CodexSepolia", - "CosmosHub4", - "CosmosIcsTestnet", - "Dogecoin", - "DogecoinTestnet", - "Ethereum", - "EthereumClassic", - "EthereumClassicMordor", - "EthereumSepolia", - "EthereumHoodi", - "FlareC", - "FlareCCoston2", - "FlowEvm", - "FlowEvmTestnet", - "Hedera", - "HederaTestnet", - "Ink", - "InkSepolia", - "InternetComputer", - "Ion", - "IonTestnet", - "Iota", - "IotaTestnet", - "Kusama", - "KusamaAssetHub", - "Litecoin", - "LitecoinTestnet", - "Movement", - "MovementTestnet", - "Near", - "NearTestnet", - "Optimism", - "OptimismSepolia", - "Origyn", - "Plasma", - "PlasmaTestnet", - "Plume", - "PlumeSepolia", - "Paseo", - "PaseoAssetHub", - "Polkadot", - "PolkadotAssetHub", - "Polygon", - "PolygonAmoy", - "Polymesh", - "PolymeshTestnet", - "Race", - "RaceSepolia", - "Robinhood", - "RobinhoodSepolia", - "SeiAtlantic2", - "SeiPacific1", - "Solana", - "SolanaDevnet", - "Sonic", - "SonicTestnet", - "Starknet", - "StarknetSepolia", - "Stellar", - "StellarTestnet", - "Sui", - "SuiTestnet", - "Tezos", - "TezosGhostnet", - "TezosShadownet", - "Tempo", - "TempoModerato", - "Tsc", - "TscTestnet1", - "Ton", - "TonTestnet", - "Tron", - "TronNile", - "Westend", - "WestendAssetHub", - "Xdc", - "XdcApothem", - "XLayer", - "XLayerSepolia", - "XrpLedger", - "XrpLedgerTestnet", - ] - kind: Literal[ - "Native", - "Aip21", - "Asa", - "Coin", - "Cip56", - "Erc20", - "Erc721", - "Erc7984", - "Asset", - "Hip17", - "Hts", - "Sep41", - "Spl", - "Spl2022", - "Snip2", - "Snip3", - "Tep74", - "Trc10", - "Trc20", - "Trc721", - "Cis7", - "Cis2", - "Iou", - "Xls33", - ] - metadata: dict[str, Any] + network: Literal["Algorand", "AlgorandTestnet", "Aptos", "AptosTestnet", "ArbitrumOne", "ArbitrumSepolia", "ArcTestnet", "AvalancheC", "AvalancheCFuji", "BabylonGenesis", "BabylonTestnet5", "Base", "BaseSepolia", "Berachain", "BerachainBepolia", "Bitcoin", "BitcoinSignet", "BitcoinTestnet3", "BitcoinTestnet4", "BitcoinCash", "Bob", "BobSepolia", "Bsc", "BscTestnet", "Canton", "CantonTestnet", "Cardano", "CardanoPreprod", "Concordium", "ConcordiumTestnet", "Celo", "CeloAlfajores", "Codex", "CodexSepolia", "CosmosHub4", "CosmosIcsTestnet", "Dogecoin", "DogecoinTestnet", "Ethereum", "EthereumClassic", "EthereumClassicMordor", "EthereumSepolia", "EthereumHolesky", "EthereumHoodi", "FantomOpera", "FantomTestnet", "FlareC", "FlareCCoston2", "FlowEvm", "FlowEvmTestnet", "Hedera", "HederaTestnet", "Ink", "InkSepolia", "InternetComputer", "Ion", "IonTestnet", "Iota", "IotaTestnet", "Kaspa", "Kusama", "KusamaAssetHub", "Litecoin", "LitecoinTestnet", "Movement", "MovementTestnet", "Near", "NearTestnet", "Optimism", "OptimismSepolia", "Origyn", "Plasma", "PlasmaTestnet", "Plume", "PlumeSepolia", "Paseo", "PaseoAssetHub", "Polkadot", "PolkadotAssetHub", "Polygon", "PolygonAmoy", "Polymesh", "PolymeshTestnet", "Race", "RaceSepolia", "SeiAtlantic2", "SeiPacific1", "Solana", "SolanaDevnet", "Starknet", "StarknetSepolia", "Stellar", "StellarTestnet", "Sui", "SuiTestnet", "Tezos", "TezosGhostnet", "TezosShadownet", "Tempo", "TempoModerato", "Tsc", "TscTestnet1", "Ton", "TonTestnet", "Tron", "TronNile", "Westend", "WestendAssetHub", "Xdc", "XdcApothem", "XLayer", "XLayerSepolia", "XrpLedger", "XrpLedgerTestnet"] + kind: Literal["Native", "Aip21", "Asa", "Coin", "Cip56", "Erc20", "Erc721", "Erc7984", "Asset", "Hip17", "Hts", "Sep41", "Spl", "Spl2022", "Snip2", "Snip3", "Tep74", "Trc10", "Trc20", "Trc721", "Cis7", "Cis2", "Iou", "Xls33"] + metadata: TypedDict tx_hash: str status: Literal["Pending", "Accepted", "Rejected", "Withdrawn", "Expired"] from_: str @@ -2935,7 +508,6 @@ class RejectOfferResponse(TypedDict, total=False): settlement_transaction_id: NotRequired[str] date_settled: NotRequired[str] - class ListOrgWalletHistoryQuery(TypedDict, total=False): """listOrgWalletHistory query parameters.""" diff --git a/dfns_sdk/generated/webhooks/__init__.py b/dfns_sdk/generated/webhooks/__init__.py index ed66cbe..27a62b9 100644 --- a/dfns_sdk/generated/webhooks/__init__.py +++ b/dfns_sdk/generated/webhooks/__init__.py @@ -1,7 +1,7 @@ """Webhooks domain module.""" -from . import types from .client import WebhooksClient from .delegated_client import DelegatedWebhooksClient +from . import types __all__ = ["WebhooksClient", "DelegatedWebhooksClient", "types"] diff --git a/dfns_sdk/generated/webhooks/client.py b/dfns_sdk/generated/webhooks/client.py index f3d421b..62b1186 100644 --- a/dfns_sdk/generated/webhooks/client.py +++ b/dfns_sdk/generated/webhooks/client.py @@ -1,6 +1,6 @@ """Client for the webhooks domain.""" -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient from . import types as T @@ -12,19 +12,19 @@ class WebhooksClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_webhooks(self, query: T.ListWebhooksQuery | None = None) -> T.ListWebhooksResponse: + def list_webhooks(self, query: Optional[T.ListWebhooksQuery] = None) -> T.ListWebhooksResponse: """ List Webhooks. List all webhooks for the authenticated user's organization. The results are paginated. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListWebhooksResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/webhooks", path_params={}, @@ -32,7 +32,6 @@ def list_webhooks(self, query: T.ListWebhooksQuery | None = None) -> T.ListWebho body=None, requires_signature=False, ) - return cast(T.ListWebhooksResponse, response) def create_webhook(self, body: T.CreateWebhookRequest) -> T.CreateWebhookResponse: """ @@ -41,12 +40,12 @@ def create_webhook(self, body: T.CreateWebhookRequest) -> T.CreateWebhookRespons Register a new webhook. Args: - body: Request body. + body: Request body. Returns: T.CreateWebhookResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/webhooks", path_params={}, @@ -54,7 +53,6 @@ def create_webhook(self, body: T.CreateWebhookRequest) -> T.CreateWebhookRespons body=body, requires_signature=True, ) - return cast(T.CreateWebhookResponse, response) def get_webhook(self, webhook_id: str) -> T.GetWebhookResponse: """ @@ -63,12 +61,12 @@ def get_webhook(self, webhook_id: str) -> T.GetWebhookResponse: Retrieve information about a specific webhook. Args: - webhook_id: Path parameter. + webhook_id: Path parameter. Returns: T.GetWebhookResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/webhooks/{webhookId}", path_params={"webhookId": webhook_id}, @@ -76,7 +74,6 @@ def get_webhook(self, webhook_id: str) -> T.GetWebhookResponse: body=None, requires_signature=False, ) - return cast(T.GetWebhookResponse, response) def update_webhook(self, webhook_id: str, body: T.UpdateWebhookRequest) -> T.UpdateWebhookResponse: """ @@ -85,13 +82,13 @@ def update_webhook(self, webhook_id: str, body: T.UpdateWebhookRequest) -> T.Upd Update the definition of an existing webhook. Args: - webhook_id: Path parameter. - body: Request body. + webhook_id: Path parameter. + body: Request body. Returns: T.UpdateWebhookResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="PUT", path="/webhooks/{webhookId}", path_params={"webhookId": webhook_id}, @@ -99,7 +96,6 @@ def update_webhook(self, webhook_id: str, body: T.UpdateWebhookRequest) -> T.Upd body=body, requires_signature=True, ) - return cast(T.UpdateWebhookResponse, response) def delete_webhook(self, webhook_id: str) -> T.DeleteWebhookResponse: """ @@ -108,12 +104,12 @@ def delete_webhook(self, webhook_id: str) -> T.DeleteWebhookResponse: Deletes an existing webhook registration. Args: - webhook_id: Path parameter. + webhook_id: Path parameter. Returns: T.DeleteWebhookResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="DELETE", path="/webhooks/{webhookId}", path_params={"webhookId": webhook_id}, @@ -121,7 +117,6 @@ def delete_webhook(self, webhook_id: str) -> T.DeleteWebhookResponse: body=None, requires_signature=True, ) - return cast(T.DeleteWebhookResponse, response) def ping_webhook(self, webhook_id: str) -> T.PingWebhookResponse: """ @@ -130,12 +125,12 @@ def ping_webhook(self, webhook_id: str) -> T.PingWebhookResponse: This endpoint is meant for webhook setup and troubleshooting. Calling the endpoint will trigger a fake test event that will be pushed to the webhook URL. The fake event will not be saved and not appear in further requests to Webhook Events. Args: - webhook_id: Path parameter. + webhook_id: Path parameter. Returns: T.PingWebhookResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="POST", path="/webhooks/{webhookId}/ping", path_params={"webhookId": webhook_id}, @@ -143,26 +138,25 @@ def ping_webhook(self, webhook_id: str) -> T.PingWebhookResponse: body=None, requires_signature=True, ) - return cast(T.PingWebhookResponse, response) def get_webhook_event(self, webhook_id: str, webhook_event_id: str) -> T.GetWebhookEventResponse: """ - Get Webhook Event. - - Retrieve a specific webhook event details by its ID. + Get Webhook Event. - - We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. - + Retrieve a specific webhook event details by its ID. + + +We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. + - Args: - webhook_id: Path parameter. - webhook_event_id: Path parameter. + Args: + webhook_id: Path parameter. + webhook_event_id: Path parameter. - Returns: - T.GetWebhookEventResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetWebhookEventResponse: The API response. + """ + return self._http.request( method="GET", path="/webhooks/{webhookId}/events/{webhookEventId}", path_params={"webhookId": webhook_id, "webhookEventId": webhook_event_id}, @@ -170,29 +164,26 @@ def get_webhook_event(self, webhook_id: str, webhook_event_id: str) -> T.GetWebh body=None, requires_signature=False, ) - return cast(T.GetWebhookEventResponse, response) - def list_webhook_events( - self, webhook_id: str, query: T.ListWebhookEventsQuery | None = None - ) -> T.ListWebhookEventsResponse: + def list_webhook_events(self, webhook_id: str, query: Optional[T.ListWebhookEventsQuery] = None) -> T.ListWebhookEventsResponse: """ - List Webhook Events. + List Webhook Events. - Lists all events for a given webhook. + Lists all events for a given webhook. - - We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. - + +We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. + - Args: - webhook_id: Path parameter. - query: Query parameters. + Args: + webhook_id: Path parameter. + query: Query parameters. - Returns: - T.ListWebhookEventsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ListWebhookEventsResponse: The API response. + """ + return self._http.request( method="GET", path="/webhooks/{webhookId}/events", path_params={"webhookId": webhook_id}, @@ -200,4 +191,3 @@ def list_webhook_events( body=None, requires_signature=False, ) - return cast(T.ListWebhookEventsResponse, response) diff --git a/dfns_sdk/generated/webhooks/delegated_client.py b/dfns_sdk/generated/webhooks/delegated_client.py index da2bc12..0bd1900 100644 --- a/dfns_sdk/generated/webhooks/delegated_client.py +++ b/dfns_sdk/generated/webhooks/delegated_client.py @@ -1,10 +1,14 @@ """Delegated client for the webhooks domain.""" import json -from typing import cast +from typing import Any, Literal, Optional, TypedDict, Union from ..._internal import HttpClient -from ...base_auth_api import BaseAuthApi, SignUserActionChallengeRequest, UserActionChallengeResponse +from ...base_auth_api import ( + BaseAuthApi, + SignUserActionChallengeRequest, + UserActionChallengeResponse, +) from . import types as T @@ -19,19 +23,19 @@ class DelegatedWebhooksClient: def __init__(self, http_client: HttpClient): self._http = http_client - def list_webhooks(self, query: T.ListWebhooksQuery | None = None) -> T.ListWebhooksResponse: + def list_webhooks(self, query: Optional[T.ListWebhooksQuery] = None) -> T.ListWebhooksResponse: """ List Webhooks. List all webhooks for the authenticated user's organization. The results are paginated. Args: - query: Query parameters. + query: Query parameters. Returns: T.ListWebhooksResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/webhooks", path_params={}, @@ -39,7 +43,6 @@ def list_webhooks(self, query: T.ListWebhooksQuery | None = None) -> T.ListWebho body=None, requires_signature=False, ) - return cast(T.ListWebhooksResponse, response) def create_webhook_init(self, body: T.CreateWebhookRequest) -> UserActionChallengeResponse: """ @@ -48,11 +51,11 @@ def create_webhook_init(self, body: T.CreateWebhookRequest) -> UserActionChallen Creates a user action challenge for external signing. Args: - body: Request body. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/webhooks" payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -63,25 +66,25 @@ def create_webhook_init(self, body: T.CreateWebhookRequest) -> UserActionChallen user_action_payload=payload, ) - def create_webhook_complete( - self, body: T.CreateWebhookRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.CreateWebhookResponse: + def create_webhook_complete(self, body: T.CreateWebhookRequest, signed_challenge: SignUserActionChallengeRequest) -> T.CreateWebhookResponse: """ Complete Create Webhook. Submits the signed challenge and makes the API request. Args: - body: Request body. - signed_challenge: The signed challenge from external signing. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.CreateWebhookResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/webhooks", path_params={}, @@ -89,7 +92,6 @@ def create_webhook_complete( body=body, user_action=user_action_token, ) - return cast(T.CreateWebhookResponse, response) def get_webhook(self, webhook_id: str) -> T.GetWebhookResponse: """ @@ -98,12 +100,12 @@ def get_webhook(self, webhook_id: str) -> T.GetWebhookResponse: Retrieve information about a specific webhook. Args: - webhook_id: Path parameter. + webhook_id: Path parameter. Returns: T.GetWebhookResponse: The API response. - """ # noqa: E501 - response = self._http.request( + """ + return self._http.request( method="GET", path="/webhooks/{webhookId}", path_params={"webhookId": webhook_id}, @@ -111,7 +113,6 @@ def get_webhook(self, webhook_id: str) -> T.GetWebhookResponse: body=None, requires_signature=False, ) - return cast(T.GetWebhookResponse, response) def update_webhook_init(self, webhook_id: str, body: T.UpdateWebhookRequest) -> UserActionChallengeResponse: """ @@ -120,12 +121,12 @@ def update_webhook_init(self, webhook_id: str, body: T.UpdateWebhookRequest) -> Creates a user action challenge for external signing. Args: - webhook_id: Path parameter. - body: Request body. + webhook_id: Path parameter. + body: Request body. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/webhooks/{webhookId}" path = path.replace("{webhookId}", str(webhook_id)) payload = json.dumps(body, separators=(",", ":")) if body else "" @@ -137,26 +138,26 @@ def update_webhook_init(self, webhook_id: str, body: T.UpdateWebhookRequest) -> user_action_payload=payload, ) - def update_webhook_complete( - self, webhook_id: str, body: T.UpdateWebhookRequest, signed_challenge: SignUserActionChallengeRequest - ) -> T.UpdateWebhookResponse: + def update_webhook_complete(self, webhook_id: str, body: T.UpdateWebhookRequest, signed_challenge: SignUserActionChallengeRequest) -> T.UpdateWebhookResponse: """ Complete Update Webhook. Submits the signed challenge and makes the API request. Args: - webhook_id: Path parameter. - body: Request body. - signed_challenge: The signed challenge from external signing. + webhook_id: Path parameter. + body: Request body. + signed_challenge: The signed challenge from external signing. Returns: T.UpdateWebhookResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="PUT", path="/webhooks/{webhookId}", path_params={"webhookId": webhook_id}, @@ -164,7 +165,6 @@ def update_webhook_complete( body=body, user_action=user_action_token, ) - return cast(T.UpdateWebhookResponse, response) def delete_webhook_init(self, webhook_id: str) -> UserActionChallengeResponse: """ @@ -173,11 +173,11 @@ def delete_webhook_init(self, webhook_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - webhook_id: Path parameter. + webhook_id: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/webhooks/{webhookId}" path = path.replace("{webhookId}", str(webhook_id)) payload = "" @@ -189,25 +189,25 @@ def delete_webhook_init(self, webhook_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def delete_webhook_complete( - self, webhook_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.DeleteWebhookResponse: + def delete_webhook_complete(self, webhook_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.DeleteWebhookResponse: """ Complete Delete Webhook. Submits the signed challenge and makes the API request. Args: - webhook_id: Path parameter. - signed_challenge: The signed challenge from external signing. + webhook_id: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: T.DeleteWebhookResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="DELETE", path="/webhooks/{webhookId}", path_params={"webhookId": webhook_id}, @@ -215,7 +215,6 @@ def delete_webhook_complete( body=None, user_action=user_action_token, ) - return cast(T.DeleteWebhookResponse, response) def ping_webhook_init(self, webhook_id: str) -> UserActionChallengeResponse: """ @@ -224,11 +223,11 @@ def ping_webhook_init(self, webhook_id: str) -> UserActionChallengeResponse: Creates a user action challenge for external signing. Args: - webhook_id: Path parameter. + webhook_id: Path parameter. Returns: UserActionChallengeResponse: The challenge to sign externally. - """ # noqa: E501 + """ path = "/webhooks/{webhookId}/ping" path = path.replace("{webhookId}", str(webhook_id)) payload = "" @@ -240,25 +239,25 @@ def ping_webhook_init(self, webhook_id: str) -> UserActionChallengeResponse: user_action_payload=payload, ) - def ping_webhook_complete( - self, webhook_id: str, signed_challenge: SignUserActionChallengeRequest - ) -> T.PingWebhookResponse: + def ping_webhook_complete(self, webhook_id: str, signed_challenge: SignUserActionChallengeRequest) -> T.PingWebhookResponse: """ Complete Ping Webhook. Submits the signed challenge and makes the API request. Args: - webhook_id: Path parameter. - signed_challenge: The signed challenge from external signing. + webhook_id: Path parameter. + signed_challenge: The signed challenge from external signing. Returns: T.PingWebhookResponse: The API response. - """ # noqa: E501 - user_action_result = BaseAuthApi.sign_user_action_challenge(self._http, signed_challenge) + """ + user_action_result = BaseAuthApi.sign_user_action_challenge( + self._http, signed_challenge + ) user_action_token = user_action_result["userAction"] - response = self._http.request_with_user_action( + return self._http.request_with_user_action( method="POST", path="/webhooks/{webhookId}/ping", path_params={"webhookId": webhook_id}, @@ -266,26 +265,25 @@ def ping_webhook_complete( body=None, user_action=user_action_token, ) - return cast(T.PingWebhookResponse, response) def get_webhook_event(self, webhook_id: str, webhook_event_id: str) -> T.GetWebhookEventResponse: """ - Get Webhook Event. + Get Webhook Event. - Retrieve a specific webhook event details by its ID. + Retrieve a specific webhook event details by its ID. + + +We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. + - - We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. - - - Args: - webhook_id: Path parameter. - webhook_event_id: Path parameter. + Args: + webhook_id: Path parameter. + webhook_event_id: Path parameter. - Returns: - T.GetWebhookEventResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.GetWebhookEventResponse: The API response. + """ + return self._http.request( method="GET", path="/webhooks/{webhookId}/events/{webhookEventId}", path_params={"webhookId": webhook_id, "webhookEventId": webhook_event_id}, @@ -293,29 +291,26 @@ def get_webhook_event(self, webhook_id: str, webhook_event_id: str) -> T.GetWebh body=None, requires_signature=False, ) - return cast(T.GetWebhookEventResponse, response) - def list_webhook_events( - self, webhook_id: str, query: T.ListWebhookEventsQuery | None = None - ) -> T.ListWebhookEventsResponse: + def list_webhook_events(self, webhook_id: str, query: Optional[T.ListWebhookEventsQuery] = None) -> T.ListWebhookEventsResponse: """ - List Webhook Events. + List Webhook Events. - Lists all events for a given webhook. + Lists all events for a given webhook. - - We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. - + +We only keep a trace of those Webhook Events in our system for a **retention period of 31 days**. Past that, they are discarded, so you cannot see them using [List Webhook Events](https://docs.dfns.co/api-reference/webhooks/list-webhook-events) or [Get Webhook Event](https://docs.dfns.co/api-reference/webhooks/get-webhook-event) endpoints. + - Args: - webhook_id: Path parameter. - query: Query parameters. + Args: + webhook_id: Path parameter. + query: Query parameters. - Returns: - T.ListWebhookEventsResponse: The API response. - """ # noqa: E501 - response = self._http.request( + Returns: + T.ListWebhookEventsResponse: The API response. + """ + return self._http.request( method="GET", path="/webhooks/{webhookId}/events", path_params={"webhookId": webhook_id}, @@ -323,4 +318,3 @@ def list_webhook_events( body=None, requires_signature=False, ) - return cast(T.ListWebhookEventsResponse, response) diff --git a/dfns_sdk/generated/webhooks/types.py b/dfns_sdk/generated/webhooks/types.py index b627aa7..a299915 100644 --- a/dfns_sdk/generated/webhooks/types.py +++ b/dfns_sdk/generated/webhooks/types.py @@ -1,372 +1,101 @@ """Types for the webhooks domain.""" -from typing import Any, Literal, TypedDict - -from typing_extensions import NotRequired - +from typing import Any, Literal, NotRequired, Optional, TypedDict, Union class ListWebhooksResponse(TypedDict, total=False): """listWebhooks response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListWebhooksQuery(TypedDict, total=False): """listWebhooks query parameters.""" limit: NotRequired[int] pagination_token: NotRequired[str] - class CreateWebhookRequest(TypedDict, total=False): """createWebhook request body.""" url: str status: NotRequired[Literal["Enabled", "Disabled"]] description: NotRequired[str] - events: list[ - Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] - | Literal["*"] - ] - + events: list[Union[Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"], Literal["*"]]] class CreateWebhookResponse(TypedDict, total=False): """createWebhook response.""" id: str url: str - events: list[ - Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] - | Literal["*"] - ] + events: list[Union[Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"], Literal["*"]]] status: Literal["Enabled", "Disabled"] description: NotRequired[str] date_created: str date_updated: str secret: str - class GetWebhookResponse(TypedDict, total=False): """getWebhook response.""" id: str url: str - events: list[ - Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] - | Literal["*"] - ] + events: list[Union[Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"], Literal["*"]]] status: Literal["Enabled", "Disabled"] description: NotRequired[str] date_created: str date_updated: str - class UpdateWebhookRequest(TypedDict, total=False): """updateWebhook request body.""" url: NotRequired[str] description: NotRequired[str] - events: NotRequired[ - list[ - Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] - | Literal["*"] - ] - ] + events: NotRequired[list[Union[Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"], Literal["*"]]]] status: NotRequired[Literal["Enabled", "Disabled"]] - class UpdateWebhookResponse(TypedDict, total=False): """updateWebhook response.""" id: str url: str - events: list[ - Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] - | Literal["*"] - ] + events: list[Union[Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"], Literal["*"]]] status: Literal["Enabled", "Disabled"] description: NotRequired[str] date_created: str date_updated: str - class DeleteWebhookResponse(TypedDict, total=False): """deleteWebhook response.""" deleted: Literal[True] - class PingWebhookResponse(TypedDict, total=False): """pingWebhook response.""" status: str error: NotRequired[str] - class GetWebhookEventResponse(TypedDict, total=False): """getWebhookEvent response.""" id: str date: str - kind: Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] + kind: Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"] data: dict[str, dict[str, Any]] status: str error: NotRequired[str] timestamp_sent: int - class ListWebhookEventsResponse(TypedDict, total=False): """listWebhookEvents response.""" - items: list[dict[str, Any]] + items: list[TypedDict] next_page_token: NotRequired[str] - class ListWebhookEventsQuery(TypedDict, total=False): """listWebhookEvents query parameters.""" - kind: NotRequired[ - Literal[ - "policy.triggered", - "policy.approval.pending", - "policy.approval.resolved", - "key.created", - "key.deleted", - "key.delegated", - "key.exported", - "wallet.blockchainevent.detected", - "wallet.blockchain_event.transfer.included", - "wallet.created", - "wallet.activated", - "wallet.delegated", - "wallet.exported", - "wallet.signature.failed", - "wallet.signature.rejected", - "wallet.signature.requested", - "wallet.signature.signed", - "wallet.transaction.broadcasted", - "wallet.transaction.confirmed", - "wallet.transaction.failed", - "wallet.transaction.rejected", - "wallet.transaction.requested", - "wallet.transfer.broadcasted", - "wallet.transfer.confirmed", - "wallet.transfer.failed", - "wallet.transfer.rejected", - "wallet.transfer.requested", - "wallet.offer.received", - "wallet.offer.accepted", - "wallet.offer.rejected", - "wallet.offer.withdrawn", - "wallet.tags.modified", - "payout.action.required", - ] - ] + kind: NotRequired[Literal["policy.triggered", "policy.approval.pending", "policy.approval.resolved", "key.created", "key.deleted", "key.delegated", "key.exported", "wallet.blockchainevent.detected", "wallet.created", "wallet.activated", "wallet.delegated", "wallet.exported", "wallet.signature.failed", "wallet.signature.rejected", "wallet.signature.requested", "wallet.signature.signed", "wallet.transaction.broadcasted", "wallet.transaction.confirmed", "wallet.transaction.failed", "wallet.transaction.rejected", "wallet.transaction.requested", "wallet.transfer.broadcasted", "wallet.transfer.confirmed", "wallet.transfer.failed", "wallet.transfer.rejected", "wallet.transfer.requested", "wallet.offer.received", "wallet.offer.accepted", "wallet.offer.rejected", "wallet.offer.withdrawn", "wallet.tags.modified", "payout.action.required"]] delivery_failed: NotRequired[Literal["true", "false"]] limit: NotRequired[int] pagination_token: NotRequired[str] diff --git a/dfns_sdk/types.py b/dfns_sdk/types.py index a545f2d..4bc9109 100644 --- a/dfns_sdk/types.py +++ b/dfns_sdk/types.py @@ -1,10 +1,7 @@ """Base types for the Dfns SDK.""" from dataclasses import dataclass, field -from typing import TYPE_CHECKING, Any - -if TYPE_CHECKING: - from .auth import Signer +from typing import Any, Callable, Awaitable, Optional @dataclass @@ -17,7 +14,7 @@ class DfnsClientConfig: base_url: str = "https://api.dfns.io" """Base URL for the Dfns API.""" - signer: "Signer | None" = None + signer: Optional["Signer"] = None """Signer for user action requests.""" headers: dict[str, str] = field(default_factory=dict) @@ -49,9 +46,9 @@ class DfnsError(Exception): def __init__( self, message: str, - status_code: int | None = None, - error_code: str | None = None, - details: dict[str, Any] | None = None, + status_code: Optional[int] = None, + error_code: Optional[str] = None, + details: Optional[dict[str, Any]] = None, ): super().__init__(message) self.message = message @@ -69,3 +66,4 @@ def __str__(self) -> str: def __repr__(self) -> str: return f"DfnsError({self.message!r}, status_code={self.status_code}, error_code={self.error_code!r})" +