External Endpoints
These handlers are deployed under the public API surface. They either expose market intelligence sourced from Horizon or broker read-only access to the PII table for authorized operators.
external/federation
Route:
GET /federation?q={value}&type={NAME|PLUS|ID}Purpose: Resolve BlockTransfer federation addresses into Stellar public keys (and optionally residency metadata).
Auth: None. Response varies by
type:NAME: Requires{investorAccount}*BLOCKTRANSFER.COM; returnsstellar_addressand resolvedaccount_id.PLUS: Accepts an internal account string; returnsPKand the account’s home country.ID: Not implemented; responds with HTTP 501.
Failure modes: 400 for malformed input, 404 when the account is missing, 500 on DynamoDB/Horizon errors.
external/getAssetInfo
Route:
GET /assets/{code}where{code}is either an asset code or numeric CIK.Purpose: If
{code}is alpha-numeric, summarizes outstanding supply for the issuer’s asset by summing unrestricted balances, claimable balances, and liquidity pools. If numeric, enumerates all asset codes assigned to that CIK usingstellar.toml.Dependencies: Horizon assets endpoint and
https://blocktransfer.com/.well-known/stellar.toml.Failure modes: 404 when the asset or issuer cannot be resolved.
external/getNumOutstanding
Route:
GET /assets/{code}/outstandingPurpose: Lightweight variant that returns the total outstanding supply as a string. Shares the same Horizon aggregation logic as
getAssetInfobut omits TOML lookups.Notes: Returns
0if the asset cannot be found on Horizon.
external/getLedgerBalances
Route:
GET /assets/{code}/balancesPurpose: Walks Horizon account and claimable balance collections, returning a JSON map keyed by account ID with
unrestrictedand optionalrestrictedbalances.Pagination: Iteratively follows Horizon’s
_links.nextURL until all pages have been loaded.Extension points: Placeholder for adding Soroban contract-held totals once those ledgers go live.
external/getPII
Route:
GET /pii/{PK}Auth: API Gateway
AWS_IAM(the Lambda expects IAM-signed requests).Purpose: Fetches a single investor profile from the
PIItable by primary key. Returns the DynamoDB item on success; emits404when absent.
external/getBatchPII
Route:
GET /pii?PKs=PK1,PK2,...Auth: API Gateway
AWS_IAM.Purpose: Batch-fetch up to 100 records from
PIIusing DynamoDB’sBatchGetItem.Behavior: Responds with the raw DynamoDB items when all keys are present; returns
404listing the missing PKs; raises400if the query string is absent; bubbles500for other failures.