diff --git a/License.md b/License.md new file mode 100644 index 0000000..5eec43e --- /dev/null +++ b/License.md @@ -0,0 +1,11 @@ +Copyright (c) 2020 Torus Labs Private Limited (https://tor.us) + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/Package.swift b/Package.swift index 1ed653d..a214a07 100644 --- a/Package.swift +++ b/Package.swift @@ -11,15 +11,14 @@ let package = Package( products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( - name: "tkey-mpc-swift", - targets: ["tkey-mpc-swift"]), + name: "tkey", + targets: ["tkey"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), - .package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.0"), + .package(name: "TorusUtils", url: "https://github.com/torusresearch/torus-utils-swift" , from: "8.0.3"), // dev dependencies only - .package(name:"CryptoSwift", url: "https://github.com/krzyzanowskim/CryptoSwift.git",from: "1.5.1"), .package(name:"jwt-kit", url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"), ], targets: [ @@ -28,18 +27,18 @@ let package = Package( .binaryTarget(name: "libtkey", path: "Sources/libtkey/libtkey.xcframework" ), - .target(name: "tkey", + .target(name: "lib", dependencies: ["libtkey"], path: "Sources/libtkey" ), .target( - name: "tkey-mpc-swift", - dependencies: ["tkey", "TorusUtils"], + name: "tkey", + dependencies: ["lib", "TorusUtils"], path: "Sources/ThresholdKey" ), .testTarget( name: "tkey-pkgTests", - dependencies: ["tkey-mpc-swift", "CryptoSwift", .product(name: "JWTKit", package: "jwt-kit")], + dependencies: ["tkey", .product(name: "JWTKit", package: "jwt-kit")], path: "Tests/tkeypkgTests" ), ] diff --git a/Sources/ThresholdKey/Modules/TssModule.swift b/Sources/ThresholdKey/Modules/TssModule.swift index 0276c20..cf479e1 100644 --- a/Sources/ThresholdKey/Modules/TssModule.swift +++ b/Sources/ThresholdKey/Modules/TssModule.swift @@ -4,7 +4,6 @@ import Foundation #if canImport(tkey) import tkey #endif -import CommonSources import FetchNodeDetails import TorusUtils diff --git a/Sources/ThresholdKey/ServiceProvider.swift b/Sources/ThresholdKey/ServiceProvider.swift index dde8266..a930cc6 100644 --- a/Sources/ThresholdKey/ServiceProvider.swift +++ b/Sources/ThresholdKey/ServiceProvider.swift @@ -4,7 +4,6 @@ import TorusUtils import tkey #endif import FetchNodeDetails -import CommonSources public final class ServiceProvider { private(set) var pointer: OpaquePointer? diff --git a/Sources/ThresholdKey/ThresholdKey.swift b/Sources/ThresholdKey/ThresholdKey.swift index 020a7b7..6ccd640 100644 --- a/Sources/ThresholdKey/ThresholdKey.swift +++ b/Sources/ThresholdKey/ThresholdKey.swift @@ -2,7 +2,7 @@ import Foundation #if canImport(tkey) import tkey #endif -import CommonSources +import FetchNodeDetails import TorusUtils public class ThresholdKey { diff --git a/Tests/tkeypkgTests/IntegrationTests.swift b/Tests/tkeypkgTests/IntegrationTests.swift index 77915b4..f64d1dd 100644 --- a/Tests/tkeypkgTests/IntegrationTests.swift +++ b/Tests/tkeypkgTests/IntegrationTests.swift @@ -1,4 +1,3 @@ -import CommonSources import FetchNodeDetails import Foundation @testable import tkey_mpc_swift diff --git a/Tests/tkeypkgTests/tkey_base.swift b/Tests/tkeypkgTests/tkey_base.swift index 6d1ac89..acfbfec 100644 --- a/Tests/tkeypkgTests/tkey_base.swift +++ b/Tests/tkeypkgTests/tkey_base.swift @@ -13,7 +13,7 @@ import TorusUtils class tkey_baseTests: XCTestCase { - var torus = TorusUtils.init(clientId: "CLIENT ID") + var torus = TorusUtils.init(network: .sapphire(.SAPPHIRE_DEVNET), clientId: "CLIENT ID") override func setUp() async throws { let postbox_key = try! PrivateKey.generate() diff --git a/tkey-mpc-swift.podspec b/tkey-mpc-swift.podspec new file mode 100644 index 0000000..7ff78e9 --- /dev/null +++ b/tkey-mpc-swift.podspec @@ -0,0 +1,14 @@ +Pod::Spec.new do |spec| + spec.name = "tkey-mpc-swift" + spec.version = "3.0.0" + spec.platform = :ios, "14.0" + spec.summary = "SDK allows you to create threshold key setup natively with multiparty computation support" + spec.homepage = "https://web3auth.io/" + spec.license = { :type => 'BSD', :file => 'License.md' } + spec.swift_version = "5.3" + spec.author = { "Torus Labs" => "hello@tor.us" } + spec.module_name = "tkey" + spec.source = { :git => "https://github.com/tkey/tkey-mpc-swift.git", :tag => spec.version } + spec.vendored_framework = "Sources/libtkey/libtkey.xcframework" + spec.source_files = "Sources/**/*.{swift,c,h}" +end diff --git a/tkey-rust-ios.podspec b/tkey-rust-ios.podspec deleted file mode 100644 index e568963..0000000 --- a/tkey-rust-ios.podspec +++ /dev/null @@ -1,14 +0,0 @@ -Pod::Spec.new do |spec| - spec.name = "tkey-rust-ios" - spec.version = "0.0.3" - spec.platform = :ios, "14.0" - spec.summary = "SDK allows you to create threshold key setup natively" - spec.homepage = "https://github.com/torusresearch/tkey-rust-ios" - spec.license = { :type => 'BSD', :file => 'License.md' } - spec.swift_version = "5.3" - spec.author = { "Torus Labs" => "rathishubham017@gmail.com" } - spec.module_name = "tkey" - spec.source = { :git => "https://github.com/torusresearch/tkey-rust-ios.git", :tag => spec.version } - spec.vendored_framework = "Sources/libtkey/libtkey.xcframework" - spec.source_files = "Sources/ThresholdKey/**/*.{swift}","Sources/libtkey/include/tkey.h" -end