Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand All @@ -44,7 +44,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/modern-treasury-python'
id: github-oidc
uses: actions/github-script@v6
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand All @@ -81,7 +81,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/modern-treasury-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'Modern-Treasury/modern-treasury-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Check release environment
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.63.0"
".": "1.64.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 168
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-b70193f02d90e71e996b5cf45038db80fe123344267e22207026f755e3198f56.yml
openapi_spec_hash: 289fdda5739de528fa149e924511e428
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury%2Fmodern-treasury-e4fb4d2325c0fbb78e23f4695b974e00d81dc4480789478dbdd0e077152cd623.yml
openapi_spec_hash: 218b6e6d70e344395adc2fc5ff4c8f66
config_hash: 196d1bf0caae233683efb6abc123941f
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 1.64.0 (2026-02-13)

Full Changelog: [v1.63.0...v1.64.0](https://github.com/Modern-Treasury/modern-treasury-python/compare/v1.63.0...v1.64.0)

### Features

* **api:** api update ([ab0c565](https://github.com/Modern-Treasury/modern-treasury-python/commit/ab0c565b4220c6c9236181b4e1699dfe3d542147))
* **api:** api update ([1894bde](https://github.com/Modern-Treasury/modern-treasury-python/commit/1894bdef23f2afc6d0e2e5b3e968838bce0c8130))
* **api:** api update ([a36277e](https://github.com/Modern-Treasury/modern-treasury-python/commit/a36277e15343038decd3bf610f9e1ae68235a86a))
* **api:** api update ([c92a9ce](https://github.com/Modern-Treasury/modern-treasury-python/commit/c92a9ce0dd768e53518a263241cdef81f1648a56))
* **api:** api update ([80ff1b5](https://github.com/Modern-Treasury/modern-treasury-python/commit/80ff1b53fec639b70236541e6f5b9a8e548e5846))
* **api:** api update ([a8c7d8d](https://github.com/Modern-Treasury/modern-treasury-python/commit/a8c7d8d62b7ab86c8cbd940b6a66905d218a2002))
* **api:** api update ([59421e9](https://github.com/Modern-Treasury/modern-treasury-python/commit/59421e99d18c022caeeae69b34b21c3ad4d44311))
* **client:** add custom JSON encoder for extended type support ([8e9e7dd](https://github.com/Modern-Treasury/modern-treasury-python/commit/8e9e7dd9ff628d218581f0ad3b3ab0d4521af898))


### Bug Fixes

* **docs:** fix mcp installation instructions for remote servers ([81262fe](https://github.com/Modern-Treasury/modern-treasury-python/commit/81262fe918cf0613b744fc25e49be04e34d578cc))


### Chores

* **ci:** upgrade `actions/github-script` ([b019b1f](https://github.com/Modern-Treasury/modern-treasury-python/commit/b019b1f45f89acebdfb3cd77e9485403c2671f8f))
* format all `api.md` files ([586eba0](https://github.com/Modern-Treasury/modern-treasury-python/commit/586eba00e21d0ff37997d7ef257a23a042f42a21))
* **internal:** bump dependencies ([f21a8b1](https://github.com/Modern-Treasury/modern-treasury-python/commit/f21a8b106ca2bd401fc9d5782574d11d700e6e4c))
* **internal:** codegen related update ([4471585](https://github.com/Modern-Treasury/modern-treasury-python/commit/447158528a5c121ed3040901e6cb7b1117210b46))
* **internal:** fix lint error on Python 3.14 ([f2a9d02](https://github.com/Modern-Treasury/modern-treasury-python/commit/f2a9d02bab75a30b9c614fe7c7369466ce2839d0))
* **internal:** update `actions/checkout` version ([7e8aa74](https://github.com/Modern-Treasury/modern-treasury-python/commit/7e8aa742c35f82615786e9f3d70597b08dc9ca1d))

## 1.63.0 (2026-01-13)

Full Changelog: [v1.62.0...v1.63.0](https://github.com/Modern-Treasury/modern-treasury-python/compare/v1.62.0...v1.63.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ https://user-images.githubusercontent.com/704302/216504942-09ed8dd7-7f44-40a6-a5

Use the Modern Treasury MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXX0)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%7D)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=modern-treasury-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIm1vZGVybi10cmVhc3VyeS1tY3AiXSwiZW52Ijp7Ik1PREVSTl9UUkVBU1VSWV9BUElfS0VZIjoiTXkgQVBJIEtleSIsIk1PREVSTl9UUkVBU1VSWV9PUkdBTklaQVRJT05fSUQiOiJteS1vcmdhbml6YXRpb24tSUQiLCJNT0RFUk5fVFJFQVNVUllfV0VCSE9PS19LRVkiOiJNeSBXZWJob29rIEtleSJ9fQ)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22modern-treasury-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22modern-treasury-mcp%22%5D%2C%22env%22%3A%7B%22MODERN_TREASURY_API_KEY%22%3A%22My%20API%20Key%22%2C%22MODERN_TREASURY_ORGANIZATION_ID%22%3A%22my-organization-ID%22%2C%22MODERN_TREASURY_WEBHOOK_KEY%22%3A%22My%20Webhook%20Key%22%7D%7D)

> Note: You may need to set environment variables in your MCP client.

Expand Down
1 change: 0 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ from modern_treasury.types import (
LedgerTransactionCreateRequest,
LegalEntityAddressCreateRequest,
LegalEntityAssociationInlineCreate,
LegalEntityComplianceDetail,
LegalEntityIndustryClassification,
TransactionDirection,
)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "modern-treasury"
version = "1.63.0"
version = "1.64.0"
description = "The official Python library for the Modern Treasury API"
dynamic = ["readme"]
license = "MIT"
Expand Down Expand Up @@ -69,7 +69,7 @@ format = { chain = [
# run formatting again to fix any inconsistencies when imports are stripped
"format:ruff",
]}
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
"format:docs" = "bash -c 'python scripts/utils/ruffen-docs.py README.md $(find . -type f -name api.md)'"
"format:ruff" = "ruff format"

"lint" = { chain = [
Expand Down
20 changes: 10 additions & 10 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.13.2
aiohttp==3.13.3
# via httpx-aiohttp
# via modern-treasury
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
anyio==4.12.0
anyio==4.12.1
# via httpx
# via modern-treasury
argcomplete==3.6.3
Expand All @@ -31,7 +31,7 @@ attrs==25.4.0
# via nox
backports-asyncio-runner==1.2.0
# via pytest-asyncio
certifi==2025.11.12
certifi==2026.1.4
# via httpcore
# via httpx
colorlog==6.10.1
Expand Down Expand Up @@ -61,15 +61,15 @@ httpx==0.28.1
# via httpx-aiohttp
# via modern-treasury
# via respx
httpx-aiohttp==0.1.9
httpx-aiohttp==0.1.12
# via modern-treasury
humanize==4.13.0
# via nox
idna==3.11
# via anyio
# via httpx
# via yarl
importlib-metadata==8.7.0
importlib-metadata==8.7.1
iniconfig==2.1.0
# via pytest
markdown-it-py==3.0.0
Expand All @@ -82,14 +82,14 @@ multidict==6.7.0
mypy==1.17.0
mypy-extensions==1.1.0
# via mypy
nodeenv==1.9.1
nodeenv==1.10.0
# via pyright
nox==2025.11.12
packaging==25.0
# via dependency-groups
# via nox
# via pytest
pathspec==0.12.1
pathspec==1.0.3
# via mypy
platformdirs==4.4.0
# via virtualenv
Expand All @@ -115,13 +115,13 @@ python-dateutil==2.9.0.post0
# via time-machine
respx==0.22.0
rich==14.2.0
ruff==0.14.7
ruff==0.14.13
six==1.17.0
# via python-dateutil
sniffio==1.3.1
# via modern-treasury
time-machine==2.19.0
tomli==2.3.0
tomli==2.4.0
# via dependency-groups
# via mypy
# via nox
Expand All @@ -141,7 +141,7 @@ typing-extensions==4.15.0
# via virtualenv
typing-inspection==0.4.2
# via pydantic
virtualenv==20.35.4
virtualenv==20.36.1
# via nox
yarl==1.22.0
# via aiohttp
Expand Down
8 changes: 4 additions & 4 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.13.2
aiohttp==3.13.3
# via httpx-aiohttp
# via modern-treasury
aiosignal==1.4.0
# via aiohttp
annotated-types==0.7.0
# via pydantic
anyio==4.12.0
anyio==4.12.1
# via httpx
# via modern-treasury
async-timeout==5.0.1
# via aiohttp
attrs==25.4.0
# via aiohttp
certifi==2025.11.12
certifi==2026.1.4
# via httpcore
# via httpx
distro==1.9.0
Expand All @@ -43,7 +43,7 @@ httpcore==1.0.9
httpx==0.28.1
# via httpx-aiohttp
# via modern-treasury
httpx-aiohttp==0.1.9
httpx-aiohttp==0.1.12
# via modern-treasury
idna==3.11
# via anyio
Expand Down
7 changes: 5 additions & 2 deletions src/modern_treasury/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
APIConnectionError,
APIResponseValidationError,
)
from ._utils._json import openapi_dumps
from ._legacy_response import LegacyAPIResponse

log: logging.Logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -556,8 +557,10 @@ def _build_request(
kwargs["content"] = options.content
elif isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
elif not files:
# Don't set content when JSON is sent as multipart/form-data,
# since httpx's content param overrides other body arguments
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
kwargs["files"] = files
else:
headers.pop("Content-Type", None)
Expand Down
6 changes: 3 additions & 3 deletions src/modern_treasury/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def model_dump(
exclude_defaults: bool = False,
warnings: bool = True,
mode: Literal["json", "python"] = "python",
by_alias: bool | None = None,
) -> dict[str, Any]:
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
return model.model_dump(
Expand All @@ -148,13 +149,12 @@ def model_dump(
exclude_defaults=exclude_defaults,
# warnings are not supported in Pydantic v1
warnings=True if PYDANTIC_V1 else warnings,
by_alias=by_alias,
)
return cast(
"dict[str, Any]",
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
exclude=exclude,
exclude_unset=exclude_unset,
exclude_defaults=exclude_defaults,
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
),
)

Expand Down
2 changes: 1 addition & 1 deletion src/modern_treasury/_utils/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def is_union(tp: Optional[Type[Any]]) -> bool:
else:
import types

return tp is Union or tp is types.UnionType
return tp is Union or tp is types.UnionType # type: ignore[comparison-overlap]


def is_typeddict(tp: Type[Any]) -> bool:
Expand Down
35 changes: 35 additions & 0 deletions src/modern_treasury/_utils/_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import json
from typing import Any
from datetime import datetime
from typing_extensions import override

import pydantic

from .._compat import model_dump


def openapi_dumps(obj: Any) -> bytes:
"""
Serialize an object to UTF-8 encoded JSON bytes.
Extends the standard json.dumps with support for additional types
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
"""
return json.dumps(
obj,
cls=_CustomEncoder,
# Uses the same defaults as httpx's JSON serialization
ensure_ascii=False,
separators=(",", ":"),
allow_nan=False,
).encode()


class _CustomEncoder(json.JSONEncoder):
@override
def default(self, o: Any) -> Any:
if isinstance(o, datetime):
return o.isoformat()
if isinstance(o, pydantic.BaseModel):
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
return super().default(o)
2 changes: 1 addition & 1 deletion src/modern_treasury/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "modern_treasury"
__version__ = "1.63.0" # x-release-please-version
__version__ = "1.64.0" # x-release-please-version
2 changes: 2 additions & 0 deletions src/modern_treasury/resources/account_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def create(
account_number_type: Literal[
"au_number",
"base_address",
"card_token",
"clabe",
"ethereum_address",
"hk_number",
Expand Down Expand Up @@ -280,6 +281,7 @@ async def create(
account_number_type: Literal[
"au_number",
"base_address",
"card_token",
"clabe",
"ethereum_address",
"hk_number",
Expand Down
Loading