Skip to content

Commit 94d2006

Browse files
author
Fernando Fernandes
committed
Add swift-crypto
1 parent 44f69e9 commit 94d2006

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

Package.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ let package = Package(
1313
targets: ["SwiftTrader"]
1414
)
1515
],
16-
dependencies: [],
16+
dependencies: [
17+
// [Server-side Support] SwiftCrypto is a Linux-compatible port of Apple's CryptoKit library.
18+
.package(url: "https://github.com/apple/swift-crypto.git", from: "2.0.0")
19+
],
1720
targets: [
1821
.target(
1922
name: "SwiftTrader",
20-
dependencies: []
23+
dependencies: [
24+
.product(name: "Crypto", package: "swift-crypto")
25+
]
2126
),
2227
.testTarget(
2328
name: "SwiftTraderTests",

Sources/SwiftTrader/Network/Kucoin/KucoinAPI+Signature.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@
55
// Created by Fernando Fernandes on 29.01.22.
66
//
77

8+
import Crypto
89
import Foundation
910

10-
#if canImport(CryptoKit)
11-
import CryptoKit
12-
#elseif canImport(Vapor)
13-
// [Server-side Support] Vapor includes SwiftCrypto, which is a Linux-compatible port of Apple's CryptoKit library.
14-
// https://docs.vapor.codes/4.0/crypto/
15-
import Vapor
16-
#endif
17-
1811
/// Holds logic to sign requests against Kucoin APIs.
1912
public extension KucoinAPI {
2013

0 commit comments

Comments
 (0)