Skip to content

search/transactions incorrectly accepts "lovelace" as currency symbol #617

@linconvidal

Description

@linconvidal

Context

Yaci Store uses "lovelace" as the native currency unit internally, but the Rosetta API represents it as "symbol": "ADA" with "decimals": 6. The two terms are not handled consistently across endpoints (v2.1.1, preprod):

Endpoint "symbol": "ADA" "symbol": "lovelace"
/account/balance Works Error 4024
/account/coins Works Error 4024
/search/transactions Works Works
All responses "ADA" "ADA"

The /search/transactions endpoint accepts "lovelace" due to checks at TxRepositoryCustomBase.java#L48 and #L57 that were not present in the original TypeScript implementation. Our docs also only reference "ADA".

Steps to reproduce

  1. Start the application connected to any network (preprod used for testing)
  2. Send a search request with "lovelace" as currency symbol:
curl -s http://localhost:8082/search/transactions \
  -H 'Content-Type: application/json' \
  -d '{"network_identifier":{"blockchain":"cardano","network":"preprod"},
       "currency":{"symbol":"lovelace","decimals":6},
       "account_identifier":{"address":"addr_test1wz46ld96kucmcsmdsjnwf6p9p9mxjlq7z5gfwl405wtgj5se0d8tr"},
       "limit":1}'

Result: 200 OK with results (accepts "lovelace")

  1. Send an account balance request with the same symbol:
curl -s http://localhost:8082/account/balance \
  -H 'Content-Type: application/json' \
  -d '{"network_identifier":{"blockchain":"cardano","network":"preprod"},
       "account_identifier":{"address":"addr_test1wz46ld96kucmcsmdsjnwf6p9p9mxjlq7z5gfwl405wtgj5se0d8tr"},
       "currencies":[{"symbol":"lovelace","decimals":6}]}'

Result: Error 4024 "Invalid token name"

  1. Send an account coins request with the same symbol:
curl -s http://localhost:8082/account/coins \
  -H 'Content-Type: application/json' \
  -d '{"network_identifier":{"blockchain":"cardano","network":"preprod"},
       "account_identifier":{"address":"addr_test1wz46ld96kucmcsmdsjnwf6p9p9mxjlq7z5gfwl405wtgj5se0d8tr"},
       "include_mempool":false,
       "currencies":[{"symbol":"lovelace","decimals":6}]}'

Result: Error 4024 "Invalid token name"

Expected behavior

All endpoints should reject "lovelace" consistently.

In the Rosetta model, "symbol" names the currency and "decimals" describes the unit conversion. Our API returns "symbol": "ADA" with "decimals": 6, which already tells the client that values are in lovelace. Accepting "lovelace" as a symbol conflates the unit with the currency name. For comparison, Bitcoin Mesh uses "BTC" with decimals: 8, not "satoshi".

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Status
    Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions