MCPcopy Create free account
hub / github.com/BrasilAPI/BrasilAPI / getCurrency

Function getCurrency

services/cambio/moedas.js:3–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import axios from 'axios';
2
3export const getCurrency = async () => {
4 const resp = await axios.get(
5 'https://olinda.bcb.gov.br/olinda/servico/PTAX/versao/v1/odata/Moedas?$top=100&$format=json'
6 );
7
8 return new Map(
9 resp.data.value.map((currency) => [
10 currency.simbolo,
11 {
12 simbolo: currency.simbolo,
13 nome: currency.nomeFormatado,
14 tipo_moeda: currency.tipoMoeda,
15 },
16 ])
17 );
18};

Callers 2

getAllCurrenciesFunction · 0.90
ActionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected