exchangeApi.getExchangeList =>
return {
data: productList,
pagination: {
page: params._page,
limit: params._limit,
total: count,
},
};
returns
"rates": {
"btc": {
"name": "Bitcoin",
"unit": "BTC",
"value": 1.0,
"type": "crypto"
},
"vnd": {
"name": "Vietnamese đồng",
"unit": "₫",
"value": 826659742.555,
"type": "fiat"
},
...
}
mapping->
[
{ (1)
currencyCode: "vnd",
"name": "Vietnamese đồng",
"unit": "₫",
"value": 826659742.555,
"type": "fiat" (2)
},
...
]
grouping by currency "type"
(2)
->
{
'fiat': [ // recognized currency type
{
currencyCode: "vnd",
"name": "Vietnamese đồng",
"unit": "₫",
"value": 826659742.555,
"type": "fiat" (2)
},
],
'crypto': [
],
...
}
function [use]getExchangeRateInfo(currencyTerm) -> exchangeRate like (1)
search using `currencyCode`, `name`, `unit`