Home / Cardano Foundation / cardano-rosetta-java
Apr 02, 7-8 AM (0)
Apr 02, 8-9 AM (0)
Apr 02, 9-10 AM (2)
Apr 02, 10-11 AM (0)
Apr 02, 11-12 PM (0)
Apr 02, 12-1 PM (4)
Apr 02, 1-2 PM (0)
Apr 02, 2-3 PM (0)
Apr 02, 3-4 PM (0)
Apr 02, 4-5 PM (0)
Apr 02, 5-6 PM (0)
Apr 02, 6-7 PM (0)
Apr 02, 7-8 PM (0)
Apr 02, 8-9 PM (0)
Apr 02, 9-10 PM (0)
Apr 02, 10-11 PM (0)
Apr 02, 11-12 AM (0)
Apr 03, 12-1 AM (0)
Apr 03, 1-2 AM (0)
Apr 03, 2-3 AM (0)
Apr 03, 3-4 AM (0)
Apr 03, 4-5 AM (0)
Apr 03, 5-6 AM (0)
Apr 03, 6-7 AM (2)
Apr 03, 7-8 AM (0)
Apr 03, 8-9 AM (0)
Apr 03, 9-10 AM (0)
Apr 03, 10-11 AM (0)
Apr 03, 11-12 PM (0)
Apr 03, 12-1 PM (0)
Apr 03, 1-2 PM (0)
Apr 03, 2-3 PM (0)
Apr 03, 3-4 PM (0)
Apr 03, 4-5 PM (0)
Apr 03, 5-6 PM (0)
Apr 03, 6-7 PM (0)
Apr 03, 7-8 PM (0)
Apr 03, 8-9 PM (0)
Apr 03, 9-10 PM (0)
Apr 03, 10-11 PM (0)
Apr 03, 11-12 AM (0)
Apr 04, 12-1 AM (0)
Apr 04, 1-2 AM (0)
Apr 04, 2-3 AM (0)
Apr 04, 3-4 AM (0)
Apr 04, 4-5 AM (0)
Apr 04, 5-6 AM (0)
Apr 04, 6-7 AM (0)
Apr 04, 7-8 AM (0)
Apr 04, 8-9 AM (0)
Apr 04, 9-10 AM (0)
Apr 04, 10-11 AM (0)
Apr 04, 11-12 PM (0)
Apr 04, 12-1 PM (0)
Apr 04, 1-2 PM (0)
Apr 04, 2-3 PM (0)
Apr 04, 3-4 PM (0)
Apr 04, 4-5 PM (0)
Apr 04, 5-6 PM (0)
Apr 04, 6-7 PM (0)
Apr 04, 7-8 PM (0)
Apr 04, 8-9 PM (0)
Apr 04, 9-10 PM (0)
Apr 04, 10-11 PM (0)
Apr 04, 11-12 AM (0)
Apr 05, 12-1 AM (0)
Apr 05, 1-2 AM (0)
Apr 05, 2-3 AM (0)
Apr 05, 3-4 AM (0)
Apr 05, 4-5 AM (0)
Apr 05, 5-6 AM (0)
Apr 05, 6-7 AM (0)
Apr 05, 7-8 AM (0)
Apr 05, 8-9 AM (0)
Apr 05, 9-10 AM (0)
Apr 05, 10-11 AM (0)
Apr 05, 11-12 PM (0)
Apr 05, 12-1 PM (0)
Apr 05, 1-2 PM (0)
Apr 05, 2-3 PM (0)
Apr 05, 3-4 PM (0)
Apr 05, 4-5 PM (0)
Apr 05, 5-6 PM (0)
Apr 05, 6-7 PM (0)
Apr 05, 7-8 PM (0)
Apr 05, 8-9 PM (0)
Apr 05, 9-10 PM (0)
Apr 05, 10-11 PM (0)
Apr 05, 11-12 AM (0)
Apr 06, 12-1 AM (0)
Apr 06, 1-2 AM (0)
Apr 06, 2-3 AM (0)
Apr 06, 3-4 AM (0)
Apr 06, 4-5 AM (0)
Apr 06, 5-6 AM (0)
Apr 06, 6-7 AM (0)
Apr 06, 7-8 AM (0)
Apr 06, 8-9 AM (0)
Apr 06, 9-10 AM (0)
Apr 06, 10-11 AM (0)
Apr 06, 11-12 PM (0)
Apr 06, 12-1 PM (0)
Apr 06, 1-2 PM (0)
Apr 06, 2-3 PM (0)
Apr 06, 3-4 PM (0)
Apr 06, 4-5 PM (25)
Apr 06, 5-6 PM (3)
Apr 06, 6-7 PM (0)
Apr 06, 7-8 PM (0)
Apr 06, 8-9 PM (0)
Apr 06, 9-10 PM (0)
Apr 06, 10-11 PM (0)
Apr 06, 11-12 AM (0)
Apr 07, 12-1 AM (0)
Apr 07, 1-2 AM (0)
Apr 07, 2-3 AM (0)
Apr 07, 3-4 AM (0)
Apr 07, 4-5 AM (0)
Apr 07, 5-6 AM (0)
Apr 07, 6-7 AM (0)
Apr 07, 7-8 AM (0)
Apr 07, 8-9 AM (1)
Apr 07, 9-10 AM (3)
Apr 07, 10-11 AM (0)
Apr 07, 11-12 PM (0)
Apr 07, 12-1 PM (0)
Apr 07, 1-2 PM (0)
Apr 07, 2-3 PM (0)
Apr 07, 3-4 PM (0)
Apr 07, 4-5 PM (0)
Apr 07, 5-6 PM (0)
Apr 07, 6-7 PM (0)
Apr 07, 7-8 PM (0)
Apr 07, 8-9 PM (0)
Apr 07, 9-10 PM (0)
Apr 07, 10-11 PM (0)
Apr 07, 11-12 AM (0)
Apr 08, 12-1 AM (0)
Apr 08, 1-2 AM (0)
Apr 08, 2-3 AM (0)
Apr 08, 3-4 AM (0)
Apr 08, 4-5 AM (0)
Apr 08, 5-6 AM (0)
Apr 08, 6-7 AM (0)
Apr 08, 7-8 AM (0)
Apr 08, 8-9 AM (0)
Apr 08, 9-10 AM (0)
Apr 08, 10-11 AM (0)
Apr 08, 11-12 PM (0)
Apr 08, 12-1 PM (0)
Apr 08, 1-2 PM (1)
Apr 08, 2-3 PM (4)
Apr 08, 3-4 PM (0)
Apr 08, 4-5 PM (0)
Apr 08, 5-6 PM (0)
Apr 08, 6-7 PM (0)
Apr 08, 7-8 PM (0)
Apr 08, 8-9 PM (0)
Apr 08, 9-10 PM (0)
Apr 08, 10-11 PM (0)
Apr 08, 11-12 AM (0)
Apr 09, 12-1 AM (0)
Apr 09, 1-2 AM (0)
Apr 09, 2-3 AM (0)
Apr 09, 3-4 AM (0)
Apr 09, 4-5 AM (0)
Apr 09, 5-6 AM (0)
Apr 09, 6-7 AM (0)
Apr 09, 7-8 AM (0)
45 commits this week Apr 02, 2026 - Apr 09, 2026
test: add tests for TokenRegistryMapper and DataMapper
TokenRegistryMapper (14 tests):
- Full field mapping, null handling, all-null fields
- Logo format mapping: BASE64, URL, null format, null value
- End-to-end: CIP-26/CIP-68 logos through full mapping pipeline

DataMapper (7 tests):
- ADA amount creation with null symbol
- Native token amount with metadata
- Logo passthrough for both BASE64 and URL formats
- Null metadata graceful handling
- Version passthrough
- Value negation for spent/unspent

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
test: add extensive unit tests for TokenQueryService
23 tests covering:
- Single subject query: empty results, CIP-26 only, CIP-68 only,
  full override, partial override, null decimals default
- CIP-68 prefix conversion: non-fungible prefix skipped, plain asset
  name skipped, short subject skipped, correct 0014df10->000643b0
  conversion, bare prefix edge case
- Logo handling: disabled flag, CIP-26 BASE64 logo, CIP-68 URL logo,
  CIP-68 overrides CIP-26 logo, disabled suppresses CIP-68 logo,
  null logo graceful handling
- Batch queries: multiple subjects, missing subjects fallback,
  batch logo fetch, batch CIP-68 override, null logo filtering

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
refactor: use own JPA entities with TokenQueryService abstraction
Remove yaci-store-assets-ext dependency from API module. Instead, create
own JPA entities (TokenMetadataEntity, TokenLogoEntity, MetadataReferenceNftEntity)
mapping to the same tables, following the existing project pattern.

Introduce TokenQueryService with @Transactional(readOnly=true) that abstracts
CIP-26/CIP-68 query details and priority-based merge. TokenRegistryServiceImpl
is now a thin delegate that only handles asset extraction from Rosetta domain
objects and forwards metadata lookup to TokenQueryService.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
refactor: replace REST token registry with DB-based assets-ext StorageReaders
Replace the HTTP-based token metadata fetching (tokens.cardano.org REST API)
with direct database reads via yaci-store assets-ext CIP-26/CIP-68 StorageReaders.
The yaci-indexer now syncs token metadata into local DB tables, and the API module
reads from them directly — eliminating external REST dependency, caching layer,
and improving reliability.

Key changes:
- Add yaci-store-assets-ext extension to both api and yaci-indexer modules
- Create AssetsExtReadOnlyConfiguration for API (read-only, no processors/cron jobs)
- Rewrite TokenRegistryServiceImpl to use Cip26/Cip68 StorageReaders
- Delete HTTP gateway, domain models, Guava token cache and related tests
- Include pre-release jars in libs/ as file-based Maven repo (temporary)
- Keep TOKEN_REGISTRY_LOGO_FETCH toggle for logo enable/disable

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
feat: add liveness and readiness probes to all containers (#718)
* feat: add api probes

* feat: add yaci-indexer probes

* feat: unify index-applier to wait on yaci readiness, remove API dependency

* feat: add cardano node probes

* chore: update docs for consistency

* fix: remove the wait-for-indexer api initContainers

* chore: remove syncStatus from rediness probe of api

* chore: update docker compose

* fix: add schema readiness guard to prevent API crash on fresh database
fix: align policyId validation in search endpoint and introduce domain validators (#726)
* fix: align policyId validation in search endpoint with account endpoint

The search/transactions endpoint was missing policyId input validation
that the account endpoint already enforces. This aligns both endpoints
to use the same hex regex validation for policyId, and strengthens the
repository layer to also validate inputs before query construction.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: use JOOQ bind parameters in currency condition builders

Replace string concatenation into DSL.condition() SQL strings with
JOOQ's DSL.val() bind parameters. This makes the query construction
structurally safe — the database driver handles escaping via prepared
statement parameters, eliminating any possibility of unsanitized data
reaching SQL regardless of upstream validation.

PostgreSQL: uses jsonb_build_array(jsonb_build_object('key', ?)) to
build JSONB containment checks from bind parameters instead of
interpolating values into JSON literals.

H2: uses ? bind parameters in LIKE conditions instead of concatenating
values into the LIKE pattern string.

The requireHex() validation in BaseCurrencyConditionBuilder is retained
as a fast-fail check for better error messages, but is no longer the
sole protection against unsanitized input reaching queries.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: introduce PolicyIdValidator and TokenNameValidator classes

Consolidate scattered policyId/tokenName/hex validation into dedicated
validator classes under common.validation package. This replaces
duplicate regex patterns in AccountServiceImpl, CardanoAddressUtils,
ValidateParseUtil, and GovActionParamsUtil with single-source-of-truth
validators backed by HexUtils.isHexString().

- PolicyIdValidator: isValid(), requireValid(), isHexOnly(), requireHexOnly()
- TokenNameValidator: isValid()
- 35 unit tests for both validators
- All callers updated to delegate to validators

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: consolidate remaining hex validation calls through validators

Update SearchServiceImpl.validateCurrencySymbolIsHex and
AssetFingerprint.fromSubject to use PolicyIdValidator.isHexOnly()
instead of calling HexUtils.isHexString() directly. All hex validation
in the codebase now flows through the centralized validator classes.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: simplify validators to expose only isValid()

Validators now have a clean API - only isValid() per domain concept:
- PolicyIdValidator.isValid(): exactly 56 hex chars
- SymbolValidator.isValid(): non-empty hex string
- TokenNameValidator.isValid(): 0-64 hex chars or empty hex

Removed requireValid/requireHexOnly/requireValidHex from validators.
For raw hex checks (defense-in-depth at repository layer, AssetFingerprint),
use HexUtils.isHexString() directly.

All error types (INVALID_POLICY_ID 4023, INVALID_TOKEN_NAME 4024,
CURRENCY_SYMBOL_NOT_HEX 5059) are registered in RosettaErrorType and
returned by /network/options via ALL_ROSETTA_ERRORS.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: add validate() methods to validators and remove private wrappers

Extract validate-and-throw logic from SearchServiceImpl and AccountServiceImpl
into PolicyIdValidator, SymbolValidator, and TokenNameValidator, eliminating
duplicated private validation methods across service classes.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* refactor: replace custom requireHex/requireValidSymbol with shared validators

Remove defense-in-depth validation methods from BaseCurrencyConditionBuilder
and delegate to PolicyIdValidator.validate() and SymbolValidator.validate()
instead, keeping the template method pattern for DB-specific SQL generation.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* test: add input validation tests for currency, address, and coin identifier (#727)

Adds 4 test classes to test_error_handling.py with 17 parametrized cases:
- SearchCurrencyValidation: policyId and symbol rejection (requires PR #726)
- AccountCurrencyValidation: policyId and token name rejection
- AddressValidation: invalid bech32 on /account/balance and /account/coins
- CoinIdentifierValidation: malformed identifier without colon separator

* fix: handle malformed coin_identifier in search and align validator null semantics

Replace ArrayIndexOutOfBoundsException and NumberFormatException with proper
ApiException when coin_identifier lacks a colon separator or has a non-numeric
output index. Also align TokenNameValidator.validate() to accept null
consistently with PolicyIdValidator and SymbolValidator.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* test: enable coin_identifier validation test after fix

Remove @pytest.mark.skip now that ba4df5db5 handles malformed
coin_identifier properly. Verified against local build:
HTTP 400, code 5000, retriable false.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Mateusz Czeladka <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Co-authored-by: Lincon Vidal <[email protected]>
fix: handle malformed coin_identifier in search and align validator null semantics
Replace ArrayIndexOutOfBoundsException and NumberFormatException with proper
ApiException when coin_identifier lacks a colon separator or has a non-numeric
output index. Also align TokenNameValidator.validate() to accept null
consistently with PolicyIdValidator and SymbolValidator.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
refactor: consolidate remaining hex validation calls through validators
Update SearchServiceImpl.validateCurrencySymbolIsHex and
AssetFingerprint.fromSubject to use PolicyIdValidator.isHexOnly()
instead of calling HexUtils.isHexString() directly. All hex validation
in the codebase now flows through the centralized validator classes.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>