Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/newapplesho/currencylayer-api-smalltalk
Pharo Smalltalk wrapper for currencylayer API
https://github.com/newapplesho/currencylayer-api-smalltalk
currency-api pharo smalltalk
Last synced: 6 days ago
JSON representation
Pharo Smalltalk wrapper for currencylayer API
- Host: GitHub
- URL: https://github.com/newapplesho/currencylayer-api-smalltalk
- Owner: newapplesho
- License: apache-2.0
- Created: 2016-05-01T07:40:31.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-08T09:45:54.000Z (about 7 years ago)
- Last Synced: 2024-10-31T07:05:05.910Z (about 2 months ago)
- Topics: currency-api, pharo, smalltalk
- Language: Smalltalk
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# currencylayer-api-smalltalk [![Build Status](https://travis-ci.org/newapplesho/currencylayer-api-smalltalk.svg?branch=master)](https://travis-ci.org/newapplesho/currencylayer-api-smalltalk)
Pharo Smalltalk wrapper for [currencylayer API](https://currencylayer.com).
## Supported Smalltalk Versions
[Pharo Smalltalk](http://pharo.org/) 4.0, 5.0, 6.0, 6.1## Installation
```smalltalk
Metacello new
baseline: 'Currencylayer';
repository: 'github://newapplesho/currencylayer-api-smalltalk:v0.1/pharo-repository';
load.
```## Set up
```smalltalk
CurrencylayerSettings default accessKey:'Your API Access Key'.
```HTTPS Encryption
```smalltalk
"Subscription: Free"
CurrencylayerSettings default useSSL: false."Subscription: Basic, Pro, Enterprise"
CurrencylayerSettings default useSSL: true.
```## Usage
You can read official documentation [here](https://currencylayer.com/documentation).### Real-time Rates
```smalltalk
currencylayer := Currencylayer new.
currencylayer live:#('AUD' 'EUR' 'GBP' 'PLN').
```### Source Currency Switching
```smalltalk
currencylayer := Currencylayer new.
currencylayer sourceCurrency: 'JPY'.
```### Currency Conversion Endpoint
```smalltalk
currencylayer := Currencylayer new.
currencylayer convert: 100 from: 'JPY' to: 'USD'. "print it"
```Example response
```json
{
"privacy": "https:\/\/currencylayer.com\/privacy",
"success": true,
"info": {
"timestamp": 1462096813,
"quote": 0.009402
},
"query": {
"to": "USD",
"from": "JPY",
"amount": 100
},
"terms": "https:\/\/currencylayer.com\/terms",
"result": 0.9402
}
```