Unofficial client library for accessing CryptoCompare.com's market data
Take a look at their API docs for an overview and more information on the publicly available currency data.
Note: CryptoCompKit currently makes a limited subset of api endpoints available. More to be added.
All market end points are accesed through the CryptoCompKit class:
let cryptoCompKit = CryptoCompKit()
Once you have a CryptoCompKit()
object instance, you can call an end point:
cryptoCompKit.coinList { list, result in
switch result {
case .success(_):
updateUI(coins:list.coins)
case let .failure(error):
handle(error:error)
}
}
let from = ["BTC","ETH","LTC"]
let to = ["USD"]
cryptoCompKit.priceList(fSyms:from, tSyms:to) { list, result in
switch result {
case .success(_):
updateUI(prices:list.prices)
case .failure(_):
handle(error:error)
}
}
cryptoCompKit.histoMinutes(fSym:"USD", tSym:"BTC") { list, result in
switch result {
case .success(_):
updateUI(minutes:list.histos)
case .failure(_):
handle(error:error)
}
}
The easiest way to use CryptoCompKit is with CocoaPods
To integrate CryptoCompKit into your Xcode project using CocoaPods, specify it in your Podfile
:
platform :ios, '11.0'
target 'TargetName' do
pod 'CryptoCompKit'
end
Then, run the following command:
$ pod install
This is a pre-release version of CryptoCompKit and although it is stable and should be working in all the above cases, things will be added, changed and potentially break.
CryptoCompKit is released under the MIT license