Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/remove cocoa pods dependency #87

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions .bundle/config

This file was deleted.

68 changes: 68 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"pins" : [
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"state" : {
"revision" : "78424be314842833c04bc3bef5b72e85fff99204",
"version" : "5.6.4"
}
},
{
"identity" : "cwlcatchexception",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlCatchException.git",
"state" : {
"revision" : "35f9e770f54ce62dd8526470f14c6e137cef3eea",
"version" : "2.1.1"
}
},
{
"identity" : "cwlpreconditiontesting",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlPreconditionTesting.git",
"state" : {
"revision" : "c21f7bab5ca8eee0a9998bbd17ca1d0eb45d4688",
"version" : "2.1.0"
}
},
{
"identity" : "cwlutils",
"kind" : "remoteSourceControl",
"location" : "https://github.com/mattgallagher/CwlUtils.git",
"state" : {
"revision" : "0bfc4587d01cfc796b6c7e118fc631333dd8ab33",
"version" : "3.0.0"
}
},
{
"identity" : "moya",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Moya/Moya.git",
"state" : {
"revision" : "c263811c1f3dbf002be9bd83107f7cdc38992b26",
"version" : "15.0.3"
}
},
{
"identity" : "reactiveswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveCocoa/ReactiveSwift.git",
"state" : {
"revision" : "c43bae3dac73fdd3cb906bd5a1914686ca71ed3c",
"version" : "6.7.0"
}
},
{
"identity" : "rxswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift.git",
"state" : {
"revision" : "b4307ba0b6425c0ba4178e138799946c3da594f8",
"version" : "6.5.0"
}
}
],
"version" : 2
}
92 changes: 92 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// swift-tools-version: 5.6
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "WavesSDK",
platforms: [.macOS(.v10_15), .iOS(.v13)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
// .library(
// name: "Base58Encoder",
// targets: ["Base58Encoder"]),
// .library(
// name: "Blake2",
// targets: ["Blake2"]),
// .library(
// name: "Keccak",
// targets: ["Keccak"]),
// .library(
// name: "Curve25519",
// targets: ["Curve25519"]),
// .library(
// name: "WavesSDKCrypto",
// targets: ["WavesSDKCrypto"]),
.library(
name: "WavesSDK",
targets: ["WavesSDK"]),
],
dependencies: [
.package(url: "https://github.com/mattgallagher/CwlUtils.git", from: Version(3, 0, 0)),
.package(url: "https://github.com/ReactiveX/RxSwift.git", .upToNextMajor(from: "6.5.0")),
.package(url: "https://github.com/Moya/Moya.git", .upToNextMajor(from: "15.0.0"))
],
targets: [
///
/// Base 58 Encoder library
///
.target(
name: "Base58Encoder",
dependencies: []),
///
/// Blake 2 library
///
.target(
name: "Blake2",
dependencies: []),
///
/// Keccak library
///
.target(
name: "Keccak",
dependencies: []),
///
/// Curve 25519 library
///
.target(
name: "ed25519",
dependencies: []),
.target(
name: "Curve25519",
dependencies: ["ed25519"]),

///
/// WavesSDK Crypto library
///
.target(
name: "WavesSDKCrypto",
dependencies: ["Keccak",
"Curve25519",
"Blake2",
"Base58Encoder"]),
///
/// WavesSDK library
///
.target(
name: "WavesSDK",
dependencies: [
"WavesSDKCrypto",
"Moya",
"RxSwift",
"CwlUtils",
.product(name: "RxMoya", package: "Moya")
]),
.testTarget(
name: "WavesSDKCryptoTests",
dependencies: ["WavesSDKCrypto"]),
.testTarget(
name: "WavesSDKTests",
dependencies: ["WavesSDK"]),
]
)
38 changes: 0 additions & 38 deletions Podfile

This file was deleted.

42 changes: 0 additions & 42 deletions Podfile.lock

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <string.h>
#include <sys/types.h>

#include "base58.h"
#include "Base58Encoder.h"

bool (*b58_sha256_impl)(void *, const void *, size_t) = NULL;

Expand Down
3 changes: 3 additions & 0 deletions Sources/Base58Encoder/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module Base58Encoder {
header "Base58Encoder.h"
}
10 changes: 10 additions & 0 deletions Sources/Blake2/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Blake2 {
header "api.h"
header "blake2-impl.h"
header "blake2.h"
header "crypto_generichash_blake2b.h"
header "crypto_generichash.h"
header "export.h"
header "randombytes.h"
header "utils.h"
}
File renamed without changes.
5 changes: 5 additions & 0 deletions Sources/Curve25519/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Curve25519 {
header "Ed25519.h"
header "Randomness.h"
header "Curve25519.h"
}
4 changes: 4 additions & 0 deletions Sources/Keccak/include/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

module Keccak {
header "keccak.h"
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,37 @@ public extension NetworkError {
case let .createURLRequestFailed(error: error):
return NetworkError.error(by: error)
case let .downloadedFileMoveFailed(error: error, source: source, destination: destination):
(_, _) = (source, destination)
return NetworkError.error(by: error)
case .explicitlyCancelled:
return NetworkError.canceled
case let .invalidURL(url: url):
_ = url
return NetworkError.message(code: 9001)
case let .multipartEncodingFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9002)
case let .parameterEncodingFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9003)
case let .parameterEncoderFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9004)
case let .requestAdaptationFailed(error: error):
_ = error
return NetworkError.message(code: 9005)
case let .requestRetryFailed(retryError: retryError, originalError: originalError):
_ = retryError
_ = originalError
return NetworkError.message(code: 9006)
case let .responseValidationFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9007)
case let .responseSerializationFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9008)
case let .serverTrustEvaluationFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9009)
case .sessionDeinitialized:
return NetworkError.internetNotWorking
Expand All @@ -134,9 +145,8 @@ public extension NetworkError {
case let .sessionTaskFailed(error: error):
return NetworkError.error(by: error)
case let .urlRequestValidationFailed(reason: reason):
_ = reason
return NetworkError.message(code: 9010)
@unknown default:
return NetworkError.message(code: 9011)
}

case let urlError as NSError where urlError.domain == NSURLErrorDomain:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
public protocol DataServicesProtocol {

var aliasDataService: AliasDataServiceProtocol { get }
//var matcherDataService: MatcherDataServiceProtocol { get }
var assetsDataService: AssetsDataServiceProtocol { get }
var candlesDataService: CandlesDataServiceProtocol { get }
var pairsPriceDataService: PairsPriceDataServiceProtocol { get }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Foundation
import WavesSDKExtensions


public extension String {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ private struct Constants {

static let dataUrlMainnet: URL = URL(string: "https://api.wavesplatform.com")!
static let nodeUrlMainnet: URL = URL(string: "https://nodes.wavesnodes.com")!
static let matcherUrlMainnet: URL = URL(string: "https://matcher.wavesplatform.com")!
static let matcherUrlMainnet: URL = URL(string: "https://matcher.waves.exchange")!
static let schemeMainnet: UInt8 = "W".utf8.first ?? 0

static let dataUrlTestnet: URL = URL(string: "https://api.testnet.wavesplatform.com")!
static let dataUrlTestnet: URL = URL(string: "https://api-testnet.wavesplatform.com")!
static let nodeUrlTestnet: URL = URL(string: "https://nodes-testnet.wavesnodes.com")!
static let matcherUrlTestnet: URL = URL(string: "https://matcher-testnet.wavesnodes.com")!
static let matcherUrlTestnet: URL = URL(string: "https://matcher-testnet.waves.exchange")!
static let schemeTestnet: UInt8 = "T".utf8.first ?? 0
}

Expand Down Expand Up @@ -60,7 +60,7 @@ public struct WavesEnvironment {
public var matcherUrl: URL
public var dataUrl: URL

public init(server: Server, timestampServerDiff: Int64) {
public init(server: Server = .testNet, timestampServerDiff: Int64 = 0) {

self.server = server
self.timestampServerDiff = timestampServerDiff
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ private extension WavesKeeper {
response: replaySubject)

self.operations[request.id] = operation


print("🔹 Open URL:\(url)")
/*
UIApplication.shared.open(url, options: .init(), completionHandler: { [weak self] result in
if result == false {

Expand All @@ -106,6 +108,7 @@ private extension WavesKeeper {
self?.removeOperation(request.id)
}
})
*/

return replaySubject.asObserver()
}
Expand Down
Loading