Skip to content

Commit

Permalink
Merge pull request #1 from tkey/feat/update-dependency
Browse files Browse the repository at this point in the history
Update Package.swift
  • Loading branch information
ieow authored Jan 16, 2025
2 parents f087b89 + d9e9fb0 commit aae8ec2
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 201 deletions.
174 changes: 33 additions & 141 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,49 +1,22 @@
{
"originHash" : "ef24373c32403539c4021b1d1ae6252fb65a71efc57c0a13b800f36f7bfa2434",
"originHash" : "0cc9d474d62b1a30ad74243d9d26dfb2853a4d96cd0b1378787df7344200eaa6",
"pins" : [
{
"identity" : "anycodable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Flight-School/AnyCodable",
"state" : {
"revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05",
"version" : "0.6.7"
}
},
{
"identity" : "bigint",
"kind" : "remoteSourceControl",
"location" : "https://github.com/attaswift/BigInt.git",
"state" : {
"revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6",
"version" : "5.3.0"
"revision" : "114343a705df4725dfe7ab8a2a326b8883cfd79c",
"version" : "5.5.1"
}
},
{
"identity" : "curvelib.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tkey/curvelib.swift",
"state" : {
"revision" : "9f88bd5e56d1df443a908f7a7e81ae4f4d9170ea",
"version" : "1.0.1"
}
},
{
"identity" : "customauth-swift-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/customauth-swift-sdk",
"state" : {
"revision" : "60b48acb161fb4341c353c27bc6dd96af76887ff",
"version" : "10.0.1"
}
},
{
"identity" : "fetch-node-details-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/fetch-node-details-swift.git",
"state" : {
"revision" : "22bfadf7491d77a0bc1953af002cadbd61383e7d",
"version" : "6.0.2"
"revision" : "432bf1abe7ff505fc2ac9fcf697341ff5b2dc6d0",
"version" : "2.0.0"
}
},
{
Expand All @@ -60,80 +33,26 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/vapor/jwt-kit.git",
"state" : {
"revision" : "c2595b9ad7f512d7f334830b4df1fed6e917946a",
"version" : "4.13.4"
}
},
{
"identity" : "jwtdecode.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/auth0/JWTDecode.swift.git",
"state" : {
"revision" : "58af7278797871e460d79496621b3e5366b865b2",
"version" : "3.1.0"
}
},
{
"identity" : "keychain-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/evgenyneu/keychain-swift.git",
"state" : {
"revision" : "d108a1fa6189e661f91560548ef48651ed8d93b9",
"version" : "20.0.0"
}
},
{
"identity" : "mpc-core-kit-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tkey/mpc-core-kit-swift",
"state" : {
"branch" : "main",
"revision" : "183f205cb24ff8aa9c6c59bea905f365fe03d34e"
"revision" : "13e7513b3ba0afa13967daf77af2fb4ad087306c",
"version" : "4.13.5"
}
},
{
"identity" : "secp256k1.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/GigaBitcoin/secp256k1.swift.git",
"state" : {
"revision" : "9683e8e311c76d8114cd308b697dad2f9fc58fed",
"version" : "0.17.0"
}
},
{
"identity" : "session-manager-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Web3Auth/session-manager-swift.git",
"state" : {
"revision" : "20cc7bff065d7fe53164d17e7714a3f17d4cea2a",
"version" : "4.0.2"
}
},
{
"identity" : "single-factor-auth-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Web3Auth/single-factor-auth-swift",
"state" : {
"revision" : "73c5066d369c7d2aa1057c56a89b7f1dcdda3270",
"version" : "5.0.0"
}
},
{
"identity" : "socket.io-client-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/socketio/socket.io-client-swift",
"state" : {
"revision" : "175da8b5156f6b132436f0676cc84c2f6a766b6e",
"version" : "16.1.0"
"revision" : "57ce9af6db14e0114af631ace25231a9d0ccccbd",
"version" : "0.18.0"
}
},
{
"identity" : "starscream",
"identity" : "swift-asn1",
"kind" : "remoteSourceControl",
"location" : "https://github.com/daltoniam/Starscream",
"location" : "https://github.com/apple/swift-asn1.git",
"state" : {
"revision" : "ac6c0fc9da221873e01bd1a0d4818498a71eef33",
"version" : "4.0.6"
"revision" : "7faebca1ea4f9aaf0cda1cef7c43aecd2311ddf6",
"version" : "1.3.0"
}
},
{
Expand All @@ -150,116 +69,89 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "bc1c29221f6dfeb0ebbfbc98eb95cd3d4967868e",
"version" : "3.4.0"
"revision" : "ff0f781cf7c6a22d52957e50b104f5768b50c779",
"version" : "3.10.0"
}
},
{
"identity" : "swift-http-types",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-http-types",
"state" : {
"revision" : "9bee2fdb79cc740081abd8ebd80738063d632286",
"version" : "1.1.0"
"revision" : "ef18d829e8b92d731ad27bb81583edd2094d1ce3",
"version" : "1.3.1"
}
},
{
"identity" : "swift-log",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-log.git",
"state" : {
"revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5",
"version" : "1.5.4"
"revision" : "96a2f8a0fa41e9e09af4585e2724c4e825410b91",
"version" : "1.6.2"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "359c461e5561d22c6334828806cc25d759ca7aa6",
"version" : "2.65.0"
"revision" : "dca6594f65308c761a9c409e09fbf35f48d50d34",
"version" : "2.77.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63",
"version" : "1.22.0"
"revision" : "2e9746cfc57554f70b650b021b6ae4738abef3e6",
"version" : "1.24.1"
}
},
{
"identity" : "swift-nio-http2",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-http2.git",
"state" : {
"revision" : "c6afe04165c865faaa687b42c32ed76dfcc91076",
"version" : "1.31.0"
"revision" : "170f4ca06b6a9c57b811293cebcb96e81b661310",
"version" : "1.35.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl.git",
"state" : {
"revision" : "7c381eb6083542b124a6c18fae742f55001dc2b5",
"version" : "2.26.0"
"revision" : "c7e95421334b1068490b5d41314a50e70bab23d1",
"version" : "2.29.0"
}
},
{
"identity" : "swift-nio-transport-services",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-transport-services.git",
"state" : {
"revision" : "38ac8221dd20674682148d6451367f89c2652980",
"version" : "1.21.0"
"revision" : "bbd5e63cf949b7db0c9edaf7a21e141c52afe214",
"version" : "1.23.0"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "f9266c85189c2751589a50ea5aec72799797e471",
"version" : "1.3.0"
}
},
{
"identity" : "tkey-mpc-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tkey/tkey-mpc-swift",
"state" : {
"revision" : "8fe0cc8d5cc2ad5d38bf068bc29f6af7e3146d08",
"version" : "3.0.0"
}
},
{
"identity" : "torus-utils-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/torus-utils-swift.git",
"state" : {
"revision" : "ff85c3e96bfa29013309b487875c4d9383e4ac80",
"version" : "8.1.1"
}
},
{
"identity" : "tss-client-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/torusresearch/tss-client-swift.git",
"state" : {
"revision" : "3beedc78716d9681aaa1dbe110cdfd33090a8fff",
"version" : "4.0.2"
"revision" : "c8a44d836fe7913603e246acab7c528c2e780168",
"version" : "1.4.0"
}
},
{
Expand Down
5 changes: 1 addition & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/argentlabs/web3.swift", from:"1.6.0"),
.package(url: "https://github.com/tkey/curvelib.swift", exact: "1.0.1"),
// .package(url: "https://github.com/tkey/mpc-core-kit-swift", from: "1.0.0-alpha"),
.package(url: "https://github.com/tkey/curvelib.swift", exact: "2.0.0"),
.package(url: "https://github.com/vapor/jwt-kit.git", from: "4.0.0"),
.package(url: "https://github.com/tkey/mpc-core-kit-swift", branch: "main"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand All @@ -33,7 +31,6 @@ let package = Package(
.testTarget(
name: "MpcProviderSwiftTests",
dependencies: ["MpcProviderSwift",
.product(name: "mpc-core-kit-swift", package: "mpc-core-kit-swift"),
.product(name: "JWTKit", package: "jwt-kit")
]),
]
Expand Down
65 changes: 23 additions & 42 deletions Tests/MpcProviderSwiftTests/MpcProviderSwiftTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,46 +73,27 @@ final class MpcProviderSwiftTests: XCTestCase {
}
""".data(using: .utf8)!

func resetMPC(email: String, verifier: String, clientId: String) async throws {
var coreKitInstance = MpcCoreKit(web3AuthClientId: clientId, web3AuthNetwork: .SAPPHIRE_DEVNET, localStorage: MemoryStorage())

let data = try mockLogin2(email: email)
let token = data


let keyDetails = try await coreKitInstance.loginWithJwt(verifier: verifier, verifierId: email, idToken: token)
try await coreKitInstance.resetAccount()
}


func testMpcProviderSigning() async throws {

let email = "testiosEmail004"
let verifier = "torus-test-health"
let clientId = "torus-test-health"

// reset account for testing
try await resetMPC(email: email, verifier: verifier, clientId: clientId)


// setup mpc
let memoryStorage = MemoryStorage()
var coreKitInstance = MpcCoreKit( web3AuthClientId: clientId, web3AuthNetwork: .SAPPHIRE_DEVNET, localStorage: memoryStorage)

let data = try mockLogin2(email: email)
let token = data

let _ = try await coreKitInstance.loginWithJwt(verifier: verifier, verifierId: email, idToken: token)

//
let provider = MPCEthereumProvider(evmSigner: coreKitInstance )
let msg = "hello world"
let result = try provider.sign(message: msg)
print(result)

let decoder = JSONDecoder()
let typedData = try decoder.decode(TypedData.self, from: example1)
let typedDataResult = try provider.signMessage(message: typedData)
print(typedDataResult)
}
// func resetMPC(email: String, verifier: String, clientId: String) async throws {
//
//
//
// let keyDetails = try await coreKitInstance.loginWithJwt(verifier: verifier, verifierId: email, idToken: token)
// try await coreKitInstance.resetAccount()
// }
//
//
// func testMpcProviderSigning() async throws {
//
//
// //
// let provider = MPCEthereumProvider(evmSigner: signer )
// let msg = "hello world"
// let result = try provider.sign(message: msg)
// print(result)
//
// let decoder = JSONDecoder()
// let typedData = try decoder.decode(TypedData.self, from: example1)
// let typedDataResult = try provider.signMessage(message: typedData)
// print(typedDataResult)
// }
}
Loading

0 comments on commit aae8ec2

Please sign in to comment.