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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [[Unreleased]]

### Fixed
- Fix [error in the type filter](https://github.com/XRPLF/xrpl-py/issues/888) of the account_objects request.

## [[4.4.0]] - 2025-12-16

### Added
Expand Down
21 changes: 21 additions & 0 deletions tests/integration/reqs/test_account_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,24 @@ async def test_basic_functionality(self, client):
)
)
self.assertTrue(response.is_successful())

@test_async_and_sync(globals())
async def test_type_filter(self, client):
response = await client.request(
AccountObjects(
account=WALLET.address,
type="Escrow",
)
)
self.assertTrue(response.is_successful())
self.assertIsNotNone(response.result["account_objects"])

# test case-insensitive type filter
response = await client.request(
AccountObjects(
account=WALLET.address,
type="mPtOkeNisSuance",
)
)
self.assertTrue(response.is_successful())
self.assertIsNotNone(response.result["account_objects"])
4 changes: 2 additions & 2 deletions xrpl/models/requests/account_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Optional
from typing import Any, Optional, Union

from xrpl.models.requests.request import LookupByLedgerRequest, Request, RequestMethod
from xrpl.models.required import REQUIRED
Expand Down Expand Up @@ -65,7 +65,7 @@ class AccountObjects(Request, LookupByLedgerRequest):
"""

method: RequestMethod = field(default=RequestMethod.ACCOUNT_OBJECTS, init=False)
type: Optional[AccountObjectType] = None
type: Optional[Union[AccountObjectType, str]] = None
Copy link
Collaborator

@Patel-Raj11 Patel-Raj11 Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think same applies to LedgerEntryType based on XRPLF/rippled#5271. Can you check and update LedgerData request as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of just using a str there should probably be another enum for the actual ledger entry types

deletion_blockers_only: bool = False
limit: Optional[int] = None
# marker data shape is actually undefined in the spec, up to the
Expand Down