This package is used to provide a handy interfaces for handling internal currencies supported by the Paylike ecosystem
This library is a clone of the JS version
List of currencies supported by Paylike for transactions and accounts.
Read more:
These are the currencies you can use as a base for your account. Also known as account, settlement and funding currency.
SPM:
// dependencies:
.package(url: "[email protected]:paylike/swift-currencies.git", .upToNextMajor(from: "0.4.0")
// target:
.product(name: "PaylikeCurrencies", package: "swift-currencies")
Cocoapods: https://cocoapods.org/pods/PaylikeCurrencies
pod 'PaylikeCurrencies'
Within the Paylike ecosystem you should use the CurrencyCode
enum to refer to a currency.
let eur = PaylikeCurrencies.byCode(code: CurrencyCode.EUR);
// lookup by code
PaylikeCurrencies.byCode(code: CurrencyCode.AED);
// { code: 'AED', currency: 'United Arab Emirates dirham', numeric: '784' }
// lookup CurrencyCode
PaylikeCurrencies.getCurrencyCode("EUR");
// CurrencyCode.EUR
// get List<PaylikeCurrency>
PaylikeCurrencies.list();
// Convert between minor and major respecting the exponent
PaylikeCurrencies.toMinor(CurrencyCode.DKK, 100.00);
// 10000
PaylikeCurrencies.toMajor(CurrencyCode.DKK, 10000);
// 100.00
The library is able to regenerate CurrencyCode
and PaylikeCurrencyCollection
, by using the small Node.JS script provided in tools
directory.
To regenerate files run:
yarn && yarn start
link |
Stars: 1 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics