Sign inSign up

paidyinc/one-frame

By paidyinc

•Updated over 4 years ago

One-frame is a mock of a currency exchange rates service.

Image
1

2.1K

paidyinc/one-frame repository overview

⁠What is one-frame

One-frame is a mock of a currency exchange rates service. As such, it offers an http API to retrieve the exchange rate between any supported pair of currencies. Users have a limited quota of available requests. Please use the appropriate API for the take home exercise.

⁠Supported currencies and exchange rates

All exchange rates are randomly generated. The list of supported currencies can be found here⁠.

⁠Quota

One-frame service supports a maximum of 1000 requests per day on the GET /rates route only, other routes are not capped by a quota. For development purpose, you can restart the docker image to reset the quota.

⁠How to use this image

⁠pull the image

docker pull paidyinc/one-frame:latest

⁠run the service

docker run -p 8080:8080 paidyinc/one-frame

⁠How to use the one-frame service

⁠API

⁠GET /rates?pair={currency_pair_0}&pair={currency_pair_1}&...pair={currency_pair_n}

pair: Required query parameter that is the concatenation of two different currency codes, e.g. USDJPY. One or more pairs per request are allowed.

token: Header required for authentication. 10dc303535874aeccc86a8251e6992f5 is the only accepted value in the current implementation.

⁠Example:

request: curl -H "token: 10dc303535874aeccc86a8251e6992f5" 'localhost:8080/rates?pair=USDJPY'

response: [{"from":"USD","to":"JPY","bid":0.61,"ask":0.82,"price":0.71,"time_stamp":"2019-01-01T00:00:00.000"}]

GET /rates should only be used for the Forex take home exercise⁠

⁠GET /streaming/rates?pair={currency_pair_0}&pair={currency_pair_1}&...pair={currency_pair_n}

pair: Required query parameter that is the concatenation of two different currency codes, e.g. USDJPY. One or more pairs per request are allowed.

token: Header required for authentication. 10dc303535874aeccc86a8251e6992f5 is the only accepted value in the current implementation.

⁠Example:

request: curl --no-buffer -s -H "token: 10dc303535874aeccc86a8251e6992f5" 'localhost:8080/streaming/rates?pair=USDJPY'

response: [{"from":"USD","to":"JPY","bid":0.6118225421857174,"ask":0.8243869101616611,"price":0.71810472617368925,"time_stamp":"2022-01-11T07:47:40.734Z"}][{"from":"USD","to":"JPY","bid":0.8435259660697864,"ask":0.4175532166907524,"price":0.6305395913802694,"time_stamp":"2022-01-11T07:47:41.739Z"}][{"from":"USD","to":"JPY","bid":0.1350922166954046,"ask":0.13871074418376472,"price":0.13690148043958466,"time_stamp":"2022-01-11T07:47:42.74Z"}]

GET /streaming/rates should only be used for the Forex-UI take home exercise⁠

Tag summary

Content type

Image

Digest

Size

97.1 MB

Last updated

over 4 years ago

docker pull paidyinc/one-frame