Skip to content

Commit

Permalink
make usertype, toruskey and toruspublickey codable
Browse files Browse the repository at this point in the history
  • Loading branch information
metalurgical committed May 30, 2024
1 parent fcebd9d commit 6fd41a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Sources/TorusUtils/Interfaces/Common/UserType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public enum UserType: String, Equatable, Hashable {
public enum UserType: String, Codable, Equatable, Hashable {
case v1
case v2
}
10 changes: 5 additions & 5 deletions Sources/TorusUtils/Interfaces/TorusKey.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import BigInt
import Foundation

public class TorusKey {
public class FinalKeyData {
public class TorusKey: Codable {
public class FinalKeyData: Codable {
public let evmAddress: String
public let X: String
public let Y: String
Expand All @@ -16,7 +16,7 @@ public class TorusKey {
}
}

public class OAuthKeyData {
public class OAuthKeyData: Codable {
public let evmAddress: String
public let X: String
public let Y: String
Expand All @@ -30,7 +30,7 @@ public class TorusKey {
}
}

public class SessionData {
public class SessionData: Codable {
public let sessionTokenData: [SessionToken?]
public let sessionAuthKey: String

Expand All @@ -40,7 +40,7 @@ public class TorusKey {
}
}

public class NodesData {
public class NodesData: Codable {
public let nodeIndexes: [Int]

internal init(nodeIndexes: [Int]) {
Expand Down
10 changes: 5 additions & 5 deletions Sources/TorusUtils/Interfaces/TorusPublicKey.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import BigInt
import Foundation

public class TorusPublicKey {
public class OAuthKeyData {
public class TorusPublicKey: Codable {
public class OAuthKeyData: Codable {
public let evmAddress: String
public let X: String
public let Y: String
Expand All @@ -14,7 +14,7 @@ public class TorusPublicKey {
}
}

public class FinalKeyData {
public class FinalKeyData: Codable {
public let evmAddress: String
public let X: String
public let Y: String
Expand All @@ -26,7 +26,7 @@ public class TorusPublicKey {
}
}

public class Metadata {
public class Metadata: Codable {
public let pubNonce: PubNonce?
public let nonce: BigUInt?
public let typeOfUser: UserType
Expand All @@ -42,7 +42,7 @@ public class TorusPublicKey {
}
}

public class NodesData {
public class NodesData: Codable {
public let nodeIndexes: [Int]

internal init(nodeIndexes: [Int]) {
Expand Down

0 comments on commit 6fd41a3

Please sign in to comment.