https://github.com/imryan/savvy-ios
💱 Savvy Wallet cryptocurrency tools, formerly PayBear.
https://github.com/imryan/savvy-ios
cryptocurrency savvy-wallet
Last synced: about 1 month ago
JSON representation
💱 Savvy Wallet cryptocurrency tools, formerly PayBear.
- Host: GitHub
- URL: https://github.com/imryan/savvy-ios
- Owner: imryan
- License: mit
- Created: 2019-02-20T20:38:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-03T15:12:29.000Z (about 7 years ago)
- Last Synced: 2025-02-22T11:16:03.420Z (over 1 year ago)
- Topics: cryptocurrency, savvy-wallet
- Language: Swift
- Homepage: https://savvy.io
- Size: 169 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Savvy
[](https://travis-ci.org/imryan/Savvy)
[](https://cocoapods.org/pods/Savvy)
[](https://cocoapods.org/pods/Savvy)
[](https://cocoapods.org/pods/Savvy)
## ⚠️ IMPORTANT
* Savvy has been discontinued. This repo will no longer be active or function as expected.
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.


## Installation
Savvy is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'Savvy'
```
## Usage
#### Set Savvy API key
```swift
Savvy.shared.setToken("your-api-key")
```
#### Enable test network
```swift
Savvy.shared.shouldUseTestNet = true
```
#### Get current market prices
```swift
Savvy.shared.getCurrencies(completion: { (currencies, error) in
if let currencies = currencies, error == nil {
// Array of currency. Nice
}
})
```
#### Get market exchange rates for all cryptocurrencies
```swift
Savvy.shared.getMarketRates(fiat: "usd") { (rates, error) in
if let rates = rates, error == nil {
// ...
}
}
```
#### Get single market exchange rate for cryptocurrency
```swift
Savvy.shared.getSingleMarketRate(fiat: "usd", crypto: .btc) { (rate, error) in
if let rate = rate, error == nil {
// ...
}
}
```
#### Create payment request in given cryptocurrency
```swift
Savvy.shared.createPaymentRequest(crypto: .btc, callbackURL: "http://some.site/") { (request, error) in
if let request = request, error == nil {
// ...
}
}
```
#### Create payment request as QR code image
```swift
Savvy.shared.getPaymentRequestQR(crypto: .btc, amount: 1.0, address: "1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX", message: "Free money", size: nil) { (image) in
if let image = image {
// QR code image containing a payment request
}
}
```
## Requirements
* Alamofire
* Quick/Nimble (to run tests only)
## Author
Ryan Cohen, notryancohen@gmail.com
## License
Savvy is available under the MIT license. See the LICENSE file for more info.