# dfns/dfns-sdk-python architecture

> Architecture diagram of the GitHub repository dfns/dfns-sdk-python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dfns/dfns-sdk-python
- Repository: https://github.com/dfns/dfns-sdk-python

## Overview

Dfns Python SDK exposes typed clients for the Dfns API. The typical flow is application code configuring and constructing a client, selecting an API domain operation, and sending authenticated HTTP requests; user-action operations add a challenge-and-signing step. The regular client can sign with a configured key signer, while the delegated client exposes an external-signing workflow. Domain modules are grouped below; generated operation internals were not sampled, so no unverified per-operation transport calls are asserted.

Main entry points: [`dfns_sdk/delegated_client.py`](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/delegated_client.py) (Delegated client), [`dfns_sdk/client.py`](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/client.py) (Standard client), [`dfns_sdk/_internal/http_client.py`](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/_internal/http_client.py) (HTTP transport), [`dfns_sdk/types.py`](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/types.py) (Client configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client entrypoints"]
  node_standard_client["Standard client<br/>[client.py]"]
  node_delegated_client["Delegated client"]
  node_transport["HTTP transport<br/>[http_client.py]"]
  node_client_config["Client configuration<br/>[types.py]"]
end

subgraph group_security["Signing and auth"]
  node_key_signer["Key signer<br/>[auth.py]"]
  node_delegated_auth["Delegated action auth<br/>[base_auth_api.py]"]
end

subgraph group_wallet_ops["Wallet operations"]
  node_wallets["Wallets"]
  node_keys["Keys"]
  node_networks["Networks"]
  node_address_watches["Address watches"]
  node_staking["Staking"]
end

subgraph group_finance["Financial operations"]
  node_swaps["Swaps"]
  node_exchanges["Exchanges"]
  node_payins["Payins"]
  node_payouts["Payouts"]
  node_allocations["Allocations"]
  node_fee_sponsors["Fee sponsors"]
end

subgraph group_platform["Platform domains"]
  node_auth_domain["Authentication API"]
  node_agreements["Agreements"]
  node_permissions["Permissions"]
  node_policies["Policies"]
  node_webhooks["Webhooks"]
  node_signers["Signers"]
  node_vaults["Vaults"]
end

node_application(("Application"))

node_application -->|"configures and uses"| node_standard_client
node_application -->|"configures and uses"| node_delegated_client
node_standard_client -->|"accepts config"| node_client_config
node_delegated_client -->|"accepts config"| node_client_config
node_standard_client -->|"constructs"| node_transport
node_delegated_client -->|"constructs"| node_transport
node_standard_client -->|"initializes"| node_wallets
node_standard_client -->|"initializes"| node_keys
node_standard_client -->|"initializes"| node_networks
node_standard_client -->|"initializes"| node_address_watches
node_standard_client -->|"initializes"| node_staking
node_standard_client -->|"initializes"| node_swaps
node_standard_client -->|"initializes"| node_exchanges
node_standard_client -->|"initializes"| node_payins
node_standard_client -->|"initializes"| node_payouts
node_standard_client -->|"initializes"| node_allocations
node_standard_client -->|"initializes"| node_fee_sponsors
node_standard_client -->|"initializes"| node_auth_domain
node_standard_client -->|"initializes"| node_agreements
node_standard_client -->|"initializes"| node_permissions
node_standard_client -->|"initializes"| node_policies
node_standard_client -->|"initializes"| node_webhooks
node_standard_client -->|"initializes"| node_signers
node_standard_client -->|"initializes"| node_vaults
node_delegated_client -->|"initializes"| node_wallets
node_delegated_client -->|"initializes"| node_keys
node_delegated_client -->|"initializes"| node_networks
node_delegated_client -->|"initializes"| node_address_watches
node_delegated_client -->|"initializes"| node_staking
node_delegated_client -->|"initializes"| node_swaps
node_delegated_client -->|"initializes"| node_exchanges
node_delegated_client -->|"initializes"| node_payins
node_delegated_client -->|"initializes"| node_payouts
node_delegated_client -->|"initializes"| node_allocations
node_delegated_client -->|"initializes"| node_fee_sponsors
node_delegated_client -->|"initializes"| node_auth_domain
node_delegated_client -->|"initializes"| node_agreements
node_delegated_client -->|"initializes"| node_permissions
node_delegated_client -->|"initializes"| node_policies
node_delegated_client -->|"initializes"| node_webhooks
node_delegated_client -->|"initializes"| node_signers
node_delegated_client -->|"initializes"| node_vaults
node_transport -.->|"uses optionally"| node_key_signer
node_delegated_client -.->|"supports challenge flow"| node_delegated_auth

click node_standard_client "https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/client.py"
click node_delegated_client "https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/delegated_client.py"
click node_transport "https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/_internal/http_client.py"
click node_client_config "https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/types.py"
click node_key_signer "https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/auth.py"
click node_delegated_auth "https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/base_auth_api.py"
click node_wallets "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/wallets"
click node_keys "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/keys"
click node_networks "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/networks"
click node_address_watches "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/address_watches"
click node_staking "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/staking"
click node_swaps "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/swaps"
click node_exchanges "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/exchanges"
click node_payins "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/payins"
click node_payouts "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/payouts"
click node_allocations "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/allocations"
click node_fee_sponsors "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/fee_sponsors"
click node_auth_domain "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/auth"
click node_agreements "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/agreements"
click node_permissions "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/permissions"
click node_policies "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/policies"
click node_webhooks "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/webhooks"
click node_signers "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/signers"
click node_vaults "https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/vaults"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_standard_client,node_delegated_client,node_transport,node_client_config toneBlue
class node_key_signer,node_delegated_auth toneAmber
class node_wallets,node_keys,node_networks,node_address_watches,node_staking toneMint
class node_swaps,node_exchanges,node_payins,node_payouts,node_allocations,node_fee_sponsors toneRose
class node_auth_domain,node_agreements,node_permissions,node_policies,node_webhooks,node_signers,node_vaults,node_application toneIndigo
```

## Components

### Client entrypoints

- [Standard client](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/client.py): `dfns_sdk/client.py`
- [Delegated client](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/delegated_client.py): `dfns_sdk/delegated_client.py`
- [HTTP transport](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/_internal/http_client.py): `dfns_sdk/_internal/http_client.py`
- [Client configuration](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/types.py): `dfns_sdk/types.py`

### Signing and auth

- [Key signer](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/auth.py): `dfns_sdk/auth.py`
- [Delegated action auth](https://github.com/dfns/dfns-sdk-python/blob/main/dfns_sdk/base_auth_api.py): `dfns_sdk/base_auth_api.py`

### Wallet operations

- [Wallets](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/wallets): `dfns_sdk/generated/wallets`
- [Keys](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/keys): `dfns_sdk/generated/keys`
- [Networks](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/networks): `dfns_sdk/generated/networks`
- [Address watches](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/address_watches): `dfns_sdk/generated/address_watches`
- [Staking](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/staking): `dfns_sdk/generated/staking`

### Financial operations

- [Swaps](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/swaps): `dfns_sdk/generated/swaps`
- [Exchanges](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/exchanges): `dfns_sdk/generated/exchanges`
- [Payins](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/payins): `dfns_sdk/generated/payins`
- [Payouts](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/payouts): `dfns_sdk/generated/payouts`
- [Allocations](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/allocations): `dfns_sdk/generated/allocations`
- [Fee sponsors](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/fee_sponsors): `dfns_sdk/generated/fee_sponsors`

### Platform domains

- [Authentication API](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/auth): `dfns_sdk/generated/auth`
- [Agreements](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/agreements): `dfns_sdk/generated/agreements`
- [Permissions](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/permissions): `dfns_sdk/generated/permissions`
- [Policies](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/policies): `dfns_sdk/generated/policies`
- [Webhooks](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/webhooks): `dfns_sdk/generated/webhooks`
- [Signers](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/signers): `dfns_sdk/generated/signers`
- [Vaults](https://github.com/dfns/dfns-sdk-python/tree/main/dfns_sdk/generated/vaults): `dfns_sdk/generated/vaults`

### Other components

- **Application**

## Connections

- Application → Standard client: configures and uses (evidence: `README.md`)
- Application → Delegated client: configures and uses (evidence: `README.md`)
- Standard client → Client configuration: accepts config (evidence: `dfns_sdk/client.py`)
- Delegated client → Client configuration: accepts config (evidence: `dfns_sdk/delegated_client.py`)
- Standard client → HTTP transport: constructs (evidence: `dfns_sdk/client.py`)
- Delegated client → HTTP transport: constructs (evidence: `dfns_sdk/delegated_client.py`)
- Standard client → Wallets: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Keys: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Networks: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Address watches: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Staking: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Swaps: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Exchanges: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Payins: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Payouts: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Allocations: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Fee sponsors: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Authentication API: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Agreements: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Permissions: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Policies: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Webhooks: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Signers: initializes (evidence: `dfns_sdk/client.py`)
- Standard client → Vaults: initializes (evidence: `dfns_sdk/client.py`)
- Delegated client → Wallets: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Keys: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Networks: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Address watches: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Staking: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Swaps: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Exchanges: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Payins: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Payouts: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Allocations: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Fee sponsors: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Authentication API: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Agreements: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Permissions: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Policies: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Webhooks: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Signers: initializes (evidence: `dfns_sdk/delegated_client.py`)
- Delegated client → Vaults: initializes (evidence: `dfns_sdk/delegated_client.py`)
- HTTP transport → Key signer: uses optionally
- Delegated client → Delegated action auth: supports challenge flow
