diff --git a/Sources/XMTPiOS/Client.swift b/Sources/XMTPiOS/Client.swift index 010602d2..8925e642 100644 --- a/Sources/XMTPiOS/Client.swift +++ b/Sources/XMTPiOS/Client.swift @@ -197,8 +197,8 @@ public final class Client { } public static func createV3(account: SigningKey, options: ClientOptions) async throws -> Client { - let accountAddress = account.isSmartContractWallet ? - "eip155:\(String(describing: account.chainId)):\(account.address.lowercased())" : + let accountAddress = account.chainId != nil ? + "eip155:\(String(describing: account.chainId!)):\(account.address.lowercased())" : account.address let inboxId = try await getOrCreateInboxId(options: options, address: accountAddress) @@ -210,9 +210,9 @@ public final class Client { ) } - public static func buildV3(address: String, chainId: Int64? = nil, options: ClientOptions) async throws -> Client { + public static func buildV3(address: String, chainId: UInt64? = nil, options: ClientOptions) async throws -> Client { let accountAddress = chainId != nil ? - "eip155:\(String(describing: chainId)):\(address.lowercased())" : + "eip155:\(String(describing: chainId!)):\(address.lowercased())" : address let inboxId = try await getOrCreateInboxId(options: options, address: accountAddress) diff --git a/Sources/XMTPiOS/SigningKey.swift b/Sources/XMTPiOS/SigningKey.swift index 5c720edf..c9b4971a 100644 --- a/Sources/XMTPiOS/SigningKey.swift +++ b/Sources/XMTPiOS/SigningKey.swift @@ -24,10 +24,10 @@ public protocol SigningKey { var isSmartContractWallet: Bool { get } /// The name of the chainId for example "1" - var chainId: Int64? { get } + var chainId: UInt64? { get } /// The blockNumber of the chain for example "1" - var blockNumber: Int64? { get } + var blockNumber: UInt64? { get } /// Sign the data and return a secp256k1 compact recoverable signature. func sign(_ data: Data) async throws -> Signature @@ -45,11 +45,11 @@ extension SigningKey { return false } - public var chainId: Int64? { + public var chainId: UInt64? { return nil } - public var blockNumber: Int64? { + public var blockNumber: UInt64? { return nil }