Price one symbol, strictly
/ prices/ {asset_symbol}A browser reads it with the environment's publishable key alone (the gateway, preview).
Return the USD price of one symbol, as the AssetPrice itself.
This read is strict where the batch is forgiving, and the difference is deliberate.
The batch answers
nullfor anything it cannot price, because a screen full of balances must survive one dead asset. A caller asking about a SINGLE symbol wants the opposite: it wants to know which of two different things happened, so the two are answered apart.404resource_missingmeans the symbol is outside Stridge's asset registry. Nothing
here will ever price it, and a client should stop asking.
503price_unavailablemeans the symbol IS in the registry and Stridge cannot price it
right now. The upstream failed, and asking again later is reasonable.
Collapsing those into one answer would leave a client unable to tell a typo from an outage.
Path parameters
- asset_symbolstringrequired
The symbol to price. Normalised to upper case, so
btcandBTCreach the same asset.
Responses
The symbol and its price.
- objectstringrequired
The object's type, always
asset_price. - asset_symbolstringrequired
The asset's ticker, normalised to upper case. A price is per SYMBOL and not per chain: the same asset is worth the same wherever it is deployed, which is why this family is keyed differently from the network catalogue.
- usd_pricestring | nullrequired
The price in USD as an exact decimal string, never a JSON number, or
nullwhen Stridge cannot currently price the asset. A client renders the absence rather than a zero:0is a price, and showing one for an asset nobody could value would be a lie a person acts on.
Errors
The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.
- 400header_invalidInvalid header
- 400parameter_unknownUnknown parameter
- 401api_key_not_acceptedAPI key not accepted
- 401authentication_requiredAuthentication required
- 401publishable_key_not_acceptedPublishable key not accepted
- 401secret_key_in_browserSecret key exposed in a browser
- 401token_invalidInvalid or expired token
- 404resource_missingNo such object
- 409environment_provisioningEnvironment provisioning
- 409environment_resettingEnvironment resetting
- 429rate_limitedToo many requests
- 503price_unavailablePrice unavailable