iOS client for the TradeOgre.com crypto-to-crypto trading platform

Related tags

Layout TradeOgre-iOS
Overview

TradeOgre iOS

Overview

TradeOgre iOS is an iOS client for the TrageOgre.com website and crypto-exchange platform. I was looking for their iOS client, noticed there wasn't an official one but saw that TradeOgre published their API specifications, so I figured "I'll build an iOS app!" After a month of development, the app is in the state you currently see it and is more-or-less ready for a 1.0 release. HOWEVER, two major hurdles prevent an "official" version:

  1. Apple refuses to publish the app in its current state because I do not have an "institutional development account appropriate for crypto-currency trading."
  2. @TradeOgre only has their Twitter handle for contact information and has not responded to my inquiries about getting their support to put this app on the Apple App Store.

Sadly, this means that if you want to use this TradeOgre app, you must clone this repository to your own computer, build the project yourself, and install on your own device, including signing up to and paying for an Apple Developer Program license (100 USD/year). Seeing as I've had no external support and am providing this for free, this software is provided "as is" and without warranty or garuantee of any kind (See LICENSE). If you would like to see more features or support more work on this project, feel free to ping me in an issue. Until I have support from TradeOgre, Apple, or the TradeOgre community, I am considering this project to be abandoned.

Technical Specifications

  • App Version: 1.0.0 (100000)
  • Minimum OS Version: iOS 13.0
  • Minimum Swift Version: Swift 5.1
  • UI Framework: Storyboards
  • Architecture: State-Endpoint, Combine
  • Remote Data Source(s): TradeOgre API v1

Building from Source

This project does not use any external dependencies, so simply selecting Product > Run (Cmd-r) should build and run the project on the target device.

Code Style

Standard Swift code style, utilizing Xcode's built-in "Ctrl-i" command for spacing and layout.

Detailed Architecture

TradeOgre on iOS can be used in two over-arching states: unauthenticated and authenticated. Upon first install, the app is in the unauthenticated state, allowing users to access only the public API endpoints that do not require an API key or other user authentication. Once the user has provided authentication tokens generated on the TradeOgre website, they can be provided to the app in the Settings interface to be stored securely in the iOS keychain. With these credentials, users will be able to access the API endpoints that require API keys, such as submitting trade orders, checking balances, and viewing trade history.

State-Endpoint Architecture

The TradeOgre iOS app architecture borrows from modern Functional Reactive Programming techniques while still utilizing mutation-based tech such as the UIKit framework and Storyboards. There are three major elements to understand about the app architecture at a high level:

  1. Shared, global app state exists at the application root and is passed down to child vew controllers using protocols as a type-narrowing mechanism. Only the root app state object is allowed to mutate its stored data.
  2. Each ViewController defines a State: containing the data that the ViewController depends upon, often presenting this state as streams of data that may change over time. The data contained in the State is immutable from the perspective of the ViewController.
  3. Each ViewController defines an Endpoint: the only way of communicating with the outside world, providing only functions as a means of informing the view controller's owner about events and requests for data or navigation changes.

This architecture effectively builds a dependency tree that narrows the scope of available state information, where each child ViewController defines their required State and Endpoint interfaces, that are then expanded upon by parent ViewControllers, and so on all the way up to the root of the application. The State and Endpoint are usually passed to child ViewControllers using StoryboardSegues and conditional casting. Since the app has both unauthenticated and authenticated behavior that share a lot of functionality, the Storyboard files are split into distinct files for each state, significantly simplifying UI management and Storyboard layout.

Implementation

Root

The AppState class contains all of the app-wide shared resources. When the LaunchViewController is constructed from the Main Storyboard file, an instance of AppState is created and used to store the on-going app-global shared state. Upon launch, the app presents the contents of the LaunchViewController and determines if the user has valid API tokens available. If API tokens are found, the root ViewController is replaced with the AuthenticatedRootTabBarController and the root AppState is passed along; if no tokens are found, then UnauthenticatedRootTabBarController is built and presented instead.

Unauthenticated

Loading from the Unauthenticated Storyboard, a simple Client.Unauthenticated is created for API access, not allowing any endpoints that require API keys. The user can browse markets and see market details, but cannot otherwise interact with the markets. They can also follow a short set of instructions to generate and submit their API keys. Once keys are submitted, the root ViewController is replaced with AuthenticatedRootTabBarController and the global AppState is handed over.

Authenticated

Once authenticated, the Authenticated Storyboard is loaded and a new Client.Authenticated state is built that maintains the user's API keys and exposes functions/methods for calling endpoints that require auth. This includes wallet balances, view and delete current market orders, craft and submit buy/sell actions, and log out to return to the Unauthenticated state. Since so much of the UI and behavior is the same for both app states, the Authenticated versions of the ViewControllers are subclasses of the Unauthenticated counterparts. This significantly increases code reuse and allows functionality to be hidden simply without having a mess in the Storyboard file.

Future Features

"Nice to Have" features for implementation in the future. These features are intended to be expansions on the current application that will impact a user's typical usage of the app (in contrast to Known Issues which is more focused on bugs and other "behind the scenes" issues).

  • Security View Controller for setting a PIN and enabling/disabling FaceID/TouchID.
  • Require a PIN and/or FaceID/TouchID for beginning or resuming an app session.
  • UI to surface API key auth failures and prompt the user to regenerate their keys.
  • Maybe add an "Update Frequency" setting to control how often API calls are made for auto-updating ViewControllers?
  • More nuanced iPad features.
  • Maybe more Settings...?

Known Issues

Bugs, crashes, tech debt, and other issues that are not "user visible" and should be addressed to improve basic app functionality.

  • Poor error model: Not enough propagation of errors downstream.
  • Poor error surfacing: When an error occurs, the user is not notified.
  • API Keys are not validated before moving to "authenticated" state.
  • No analytics.
  • No crash reporting.
  • Maybe need to access the Keychain for API keys every time? Keeping them in memory with the client may be considered "risky"? Seems extremely inefficient as I think the KeychainService stuff is an XPC call, so should be a MASSIVE perf penalty...

Tips and Android Version

If you would like to send a tip for this work, feel free to send some XMR to this address: 87pYWFvyhmrWdw2EFekpZaZJf4tm758maJAigzkPmd9tD8ou3VByDMuG1DpsFcmTBzZrafk38kLv71wX5sfpX2ri7Zbym1P

If you would like to support the development of an Android version of this app, please send a lot of XMR to this address: 89sA2PuDuYyDvrozNKynxaYDPdkvLUbfbbBQHUaa3dPMbYKkXLWqgGvFsubenscmfE95uv6G9nVha4yskG5h9bef8ptFJLu

For anyone who sends a tip, thank you very much!

License

This project is MIT licensed. For the full license, see LICENSE.

Contact

The original author and current maintainer for this project is Kyle Roucis (@kroucis)

Project Hosting

This project is hosted on GitHub as TradeOgre-iOS and is Open Source Software, subject to the License above.

You might also like...
Simple static table views for iOS in Swift.
Simple static table views for iOS in Swift.

Simple static table views for iOS in Swift. Static's goal is to separate model data from presentation. Rows and Sections are your “view models” for yo

An easy way to create and layout UI components for iOS (Swift version).
An easy way to create and layout UI components for iOS (Swift version).

Introduction Cupcake is a framework that allow you to easily create and layout UI components for iOS 8.0+. It use chaining syntax and provides some fr

An Impressive Auto Layout DSL for  iOS, tvOS & OSX. & It is written in pure swift.
An Impressive Auto Layout DSL for iOS, tvOS & OSX. & It is written in pure swift.

KVConstraintKit KVConstraintKit is a DSL to make easy & impressive Auto Layout constraints on iOS, tvOS & OSX with Swift Installation Using CocoaPods

The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.
The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. Objective-C and Swift compatible.

The ultimate API for iOS & OS X Auto Layout — impressively simple, immensely powerful. PureLayout extends UIView/NSView, NSArray, and NSLayoutConstrai

A Swift Autolayout DSL for iOS & OS X
A Swift Autolayout DSL for iOS & OS X

SnapKit is a DSL to make Auto Layout easy on both iOS and OS X. ⚠️ To use with Swift 4.x please ensure you are using = 4.0.0 ⚠️ ⚠️ To use with Swift

Тестовое задание (анкета) на вакансию iOS-разработчика
Тестовое задание (анкета) на вакансию iOS-разработчика

Blogman Задание 1 из 8 Пожалуйста, расскажите о своем опыте написания или использования собственных фреймворков. Какие плюсы в себе несли собственные

Repository for the dgca verifier iOS app.

EU Digital COVID Certificate Verifier App - iOS About • Development • Documentation • Support • Contribute • Contributors • Licensing About This repos

Application iOS de l'outil ViteMaDose

Vite Ma Dose pour iOS Présentation du projet Vite Ma Dose est un outil permettant de détecter les rendez-vous de vaccination. Cette application rapide

A declarative UIKit for improve layout productivity when developing an iOS application

TifoKit A declarative UIKit for improve layout productivity when developing an iOS application Requirements Min. iOS 11 Swift 5+ Installation Currentl

Owner
Kyle Roucis
Kyle Roucis
Olvid-ios - Olvid client application for iOS

Olvid Olvid is a private and secure end-to-end encrypted messenger. Contrary to

Olvid 42 Dec 6, 2022
A multi-user Mastodon client for iOS.

Tootbot A multi-user Mastodon client for iOS. Getting Started Tootbot must be built with Xcode 8.3 or later. The xcode-install gem can help with multi

Tootbot 27 Aug 9, 2022
Om👀iOS - 오늘은 무슨 iOS?!

오무렌 Omoolen, 콘택트 렌즈 사용자를 위한 맞춤 렌즈 추천 및 오프라인 픽업 예약 서비스 SOPT 28th APPJAM 프로젝트 기간: 2021.06.26 ~ 2021.07.17 소개 팀원 소개 김소연 김현규 임경진 Development Environment a

Team Omoolen 19 Dec 28, 2022
VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift)VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift)

VidyoPlatform Basic CustomLayouts Reference App for iOS (Swift) VidyoPlatform reference application highlighting how to integrate video chat into a na

Taras Melko 0 Nov 19, 2021
IOS-PokemonQuizApp - Assignment to make a responsive iOS app. App has to connect with an external API

iOS-PokemonQuizApp Assignment to make a responsive iOS app. App has to connect with an external API. The Project The idea of the project is to make a

BennyDB 0 Jan 9, 2022
Flixtor-iOS - iOS streaming app inspired by Netflix that allows you to watch any film and series

Flixtor-iOS iOS streaming app inspired by Netflix that allows you to watch any f

Kevin Liu 0 Jan 14, 2022
IOSAnimationSample-master - An iOS Animation playground to exercise different iOS Animations

iOS Animation Sample This app is an iOS Animation playground to exercise differe

Kushal Shingote 1 Feb 5, 2022
BrickKit is a delightful layout library for iOS and tvOS. It is written entirely in Swift!

BrickKit is a delightful layout library for iOS and tvOS. It is written entirely in Swift! Deprecated BrickKit is being phased out at Wayfair, and the

Wayfair Tech – Archive 608 Sep 15, 2022
LayoutKit is a fast view layout library for iOS, macOS, and tvOS.

?? UNMAINTAINED ?? This project is no longer used by LinkedIn and is currently unmaintained. LayoutKit is a fast view layout library for iOS, macOS, a

LinkedIn's Attic 3.2k Dec 27, 2022
Fast Swift Views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainable. [iOS/macOS/tvOS/CALayer]

Extremely Fast views layouting without auto layout. No magic, pure code, full control and blazing fast. Concise syntax, intuitive, readable & chainabl

layoutBox 2.1k Dec 22, 2022