{"id":13695307,"url":"https://github.com/pollarm/MondoKit","last_synced_at":"2025-05-03T13:31:58.821Z","repository":{"id":62447986,"uuid":"50461134","full_name":"pollarm/MondoKit","owner":"pollarm","description":"A Swift framework for accessing the Mondo bank  API ","archived":false,"fork":false,"pushed_at":"2016-02-10T23:20:16.000Z","size":81,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-12T09:16:58.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pollarm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-26T21:39:22.000Z","updated_at":"2020-01-04T00:40:23.000Z","dependencies_parsed_at":"2022-11-01T23:17:46.316Z","dependency_job_id":null,"html_url":"https://github.com/pollarm/MondoKit","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollarm%2FMondoKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollarm%2FMondoKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollarm%2FMondoKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pollarm%2FMondoKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pollarm","download_url":"https://codeload.github.com/pollarm/MondoKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224364272,"owners_count":17299042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:00:20.945Z","updated_at":"2024-11-12T23:30:21.129Z","avatar_url":"https://github.com/pollarm.png","language":"Swift","readme":"# MondoKit\n\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/MondoKit.svg)](https://img.shields.io/cocoapods/v/MondoKit.svg)\n[![License](https://img.shields.io/cocoapods/l/MondoKit.svg?style=flat)](http://cocoapods.org/pods/MondoKit)\n[![Platform](https://img.shields.io/cocoapods/p/MondoKit.svg?style=flat)](http://cocoapods.org/pods/MondoKit)\n\nMondoKit is a Swift framework wrapping the Mondo API at https://getmondo.co.uk/docs/\n\n## Requirements\n\n- iOS 9.0+\n- Xcode 7.2+\n\n## Installation\n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nTo integrate MondoKit into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"pollarm/MondoKit\"\n```\n\nRun `carthage update --platform iOS --no-use-binaries` to build the framework and it's dependencies and drag the built `Alamofire.framework, KeychainAccess.framework, SwiftyJSONDecodable.framework, SwiftyJSON.framework and MondoKit.framework` into your Xcode project.\n\n### CocoaPods\n\n\u003e CocoaPods 0.39.0+ is required to build MondoKit.\n\nTo integrate MondoKit into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nplatform :ios, '9.0'\nuse_frameworks!\n\npod 'MondoKit'\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Getting started\n\n### Initialization\n\nInitialising the MondAPI is achieved as follows and should be done before you do anything else with the MondoAPI class, so probably in `applicationDidFinishLaunchingWithOptions`.\n\n```swift\nMondoAPI.instance.initialiseWithClientId(mondoClientId, clientSecret : mondoClientSecret)\n```\n\nOne option is to store your Mondo clientId and clientSecret in a property list file called MondoKeys.plist (don't forget to .gitignore this file).\nYou can then initialise the MondoAPI as follows:\n\n```swift\nguard let mondoKeysPath = NSBundle.mainBundle().pathForResource(\"MondoKeys\", ofType: \"plist\"),\n    mondoKeys = NSDictionary(contentsOfFile: mondoKeysPath),\n    mondoClientId = mondoKeys[\"clientId\"] as? String,\n    mondoClientSecret = mondoKeys[\"clientSecret\"] as? String else {\n\n        assertionFailure(\"MondoKeys.plist containing 'clientId' and 'clientSecret' required but not found in main bundle\")\n        return false\n    }\n\nMondoAPI.instance.initialiseWithClientId(mondoClientId, clientSecret : mondoClientSecret)\n```\n\n### Authentication\n\nMondoAPI provides a ViewController implemetation to manage 3-legged authorization with the API. It also stores authorization details (accessToken, expiresIn etc.) securely in the KeyChain in the event of a successful authorization so you don't need to login every time you run your app.\n\nTo check if MondoAPI is already authorized for a user:\n\n```swift\nif MondoAPI.instance.isAuthorized { ... proceed ... }\n```\n\nIf not then request an auth ViewController specifiying the callback closure to deal with the result and present it:\n\n```swift\nelse {\n    let oauthViewController = MondoAPI.instance.newAuthViewController() { (success, error) in\n        if success {\n            self.dismissViewControllerAnimated(true) {\n            // proceed now we're logged in\n        }\n        else {\n            // present error to user\n        }\n    }\n    presentViewController(oauthViewController, animated: true, completion: nil)\n}\n```\n\n### listAccounts\n\n```swift\nMondoAPI.instance.listAccounts() { (accounts, error) in ... }\n```\n\n### getBalanceForAccount\n\n```swift\nMondoAPI.instance.getBalanceForAccount(account) { (balance, error) in ... }\n```\n\n### listTransactions\n\n```swift\nMondoAPI.instance.listTransactionsForAccount(account) { (transactions, error) in ... }\n```\n\neg. using Optional `expand` parameter\n\n```swift\nMondoAPI.instance.listTransactionsForAccount(account, expand: \"merchant\") { (transactions, error) in ... }\n```\n\neg. using Optional `pagination` parameter\n\n```swift\nMondoAPI.instance.listTransactionsForAccount(account, pagination: MondoAPI.Pagination(limit: 50, since: .Date(NSDate()), before: NSDate())) { (transactions, error) in ... }\n```\n\n### getTransactionForId\n\n```swift\nMondoAPI.instance.getTransactionForId(id, expand: \"merchant\") { (transaction, error) in ... }\n```\n\n### annotateTransaction\n\n```swift\nMondoAPI.instance.annotateTransaction(transaction, withKey \"aKey\", value: \"aValue\") { (transaction, error) in ... }\n```\n\n### listFeedForAccount\n\n```swift\nMondoAPI.instance.listFeedForAccount(account) { (feedItems, error) in ... }\n```\n","funding_links":[],"categories":["Code \u0026 Client Libraries"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpollarm%2FMondoKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpollarm%2FMondoKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpollarm%2FMondoKit/lists"}