Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Poloniex Integration #60

Closed
wants to merge 18 commits into from
Closed

Poloniex Integration #60

wants to merge 18 commits into from

Conversation

wolffan
Copy link
Contributor

@wolffan wolffan commented Jul 18, 2017

Struct API
Takes secret and key from Poloniex.

Commands only fetchBalances

TODO:

  • refactor the params to add commands since they shouldn't run on init, but on every API request
  • Basic request methods
  • Data models
  • Xcode9 ready
  • filter errors like Poloniex Response: Optional("{\"error\":\"Invalid API key\\/secret pair.\"}")

This is quite ready :D

screen shot 2017-08-10 at 17 33 07

@wolffan wolffan changed the title Poloniex xc9 Poloniex Integration Jul 18, 2017
@wolffan wolffan self-assigned this Jul 19, 2017
@wolffan wolffan added this to Backlog in Poloniex Integration Jul 26, 2017
wolffan and others added 14 commits August 8, 2017 10:43
…ings work

Just added the both files to login into Poloniex plus the bridging header needed for the signing of the requests
…ings work

Just added the both files to login into Poloniex plus the bridging header needed for the signing of the requests
Added storing key/secret into keychain for poloniex
…s and work towards a shared hmac encryptation library
Create PoloniexAccount from internet
Parse PoloniexAccount into Balance Account for display
Create Number utils for number parsing
Filter incoming acounts to not show 0 value
Expanding the institution creator to support non accessToken based logins
Added test responses for Poloniex Trading API BalancesResponse and accounts
 account test and helper
Refactor Currency to be able to support N crypto currencies
Write tests for currency
Write tests for Account transformation methods
Write institution tests (not able to run)
@@ -211,12 +211,12 @@ struct CoinbaseApi {
for ca in coinbaseAccounts {
// Calculate the number of decimals
var decimals = 2
if let currency = Currency(rawValue: ca.currency) {
if let currency = Currency.rawValue(currency: ca.currency) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the chance in syntax here? Swift 4 thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created my own method for raw value.
Since we have two enums, one is nested and the other is an attributed type.
Just tried to be similar than what we had before :)

case btc = "BTC"
case ltc = "LTC"
case eth = "ETH"
static func rawValue(currency: String) -> Currency? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see now the API change... But why are we doing it this way?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically why the sub-enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the only way I could find to have one defined enum with set of fixed values, and one that is flexible and takes anything you feed it.
That took more research than what it seems so I'd be super happy if there is a more elegant solution :)

@wolffan
Copy link
Contributor Author

wolffan commented Aug 11, 2017

@einsteinx2 i'll kill this one and promote the one that has merges, but we could merge this one first?

@wolffan wolffan closed this Aug 16, 2017
@einsteinx2 einsteinx2 deleted the poloniex-xc9 branch January 9, 2018 20:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants