UNPKG

polygon.io

Version:

Isomorphic Javascript client for Polygon.io Stocks, Forex, and Crypto APIs

24 lines (20 loc) 568 B
// CF: https://polygon.io/docs/#!/Forex--Currencies/get_v1_last_quote_currencies_from_to import { get } from "../transport/request"; export interface ILastQuoteForex { ask: number; bid: number; exchange: number; timestamp: number; } export interface ILastQuoteForCurrencyPair { symbol: string; status: string; last: ILastQuoteForex; } export const lastQuoteForCurrencyPair = ( apiKey: string, apiBase: string, from: string, to: string ): Promise<ILastQuoteForCurrencyPair> => get(`/v1/last_quote/currencies/${from}/${to}`, apiKey, apiBase);