Skip to content

Commit

Permalink
[BinanceAuth] Code reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
backslash-f committed Jan 4, 2024
1 parent fa322e6 commit f8aaa95
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

import Foundation

public protocol BinanceAuthorizing {
var apiKey: String { get }
var apiSecret: String { get }
}

/// Holds data required to authenticate requests against Binance APIs.
public struct BinanceAuth {

Expand All @@ -24,7 +19,7 @@ public struct BinanceAuth {

public extension BinanceAuth {

struct Spot: BinanceAuthorizing {
struct Spot: BinanceAuthorizing, Codable {
public let apiKey: String
public let apiSecret: String

Expand All @@ -34,11 +29,3 @@ public extension BinanceAuth {
}
}
}

// MARK: - Equatable

extension BinanceAuth: Equatable {
public static func == (lhs: BinanceAuth, rhs: BinanceAuth) -> Bool {
lhs.spot.apiKey == rhs.spot.apiKey
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// BinanceAuthorizing.swift
//
//
// Created by Fernando Fernandes on 03.01.24.
//

import Foundation

public protocol BinanceAuthorizing: Codable {
var apiKey: String { get }
var apiSecret: String { get }
}

0 comments on commit f8aaa95

Please sign in to comment.