ReferenceAPI ReferenceAssets
Get Asset Exchange Rates Assets
Get Asset Exchange Rates Assets.
Request
interface AssetsGetAssetExchangeRatesRequest {
action: 'get'
resource: string
details?: {
limit: number | undefined
offset: number | undefined
sort_by: 'updated_at' | 'currency' | undefined
sort: 'asc' | 'desc' | undefined
filters: {
quote_currencies: string[] | undefined
as_of: string | undefined
from_timestamp: string | undefined
to_timestamp: string | undefined
}
} | undefined
}Prop
Type
Response
interface AssetsGetAssetExchangeRatesResponse_success {
status: 'success'
error_code?: '-1' | '-2' | '-3' | '-4' | '-5' | '-6' | '-7' | '-8' | '-9' | '-10' | '-11' | '-12' | '-13' | undefined
message?: string | undefined
details: {
currency: string
rate: string
asset_id: string
coingecko_id: string
updated_at: string
} []
metadata: unknown
}Prop
Type
Example
import { resourceSchema } from '@blockstream/ecs-js-sdk'
import { broadcastRequest } from './broadcaster'
const response = await broadcastRequest<
typeof resourceSchema.shape.assets.shape.getAssetExchangeRates
>(
{
action: 'get',
resource: '/assets/{aid}/exchange-rates',
details: {
// TODO: fill in required fields
},
},
blockstream,
)