diff --git a/Sources/Flipcash2ClientProtocol/ContractInfo.swift b/Sources/Flipcash2ClientProtocol/ContractInfo.swift index 5873174..519248f 100644 --- a/Sources/Flipcash2ClientProtocol/ContractInfo.swift +++ b/Sources/Flipcash2ClientProtocol/ContractInfo.swift @@ -2,7 +2,7 @@ public enum Flipcash2ContractInfo { public static let version = "0.18.0-dev" - public static let protoCommit = "9d44350b8d4d8eda9d63cff405238bd0e2920409" + public static let protoCommit = "9f67566fd0297a27ad2de7a98474634adf4d3a24" public static var isLocal: Bool { protoCommit == localSentinel } diff --git a/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift b/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift index 7ec54e0..29ca7a2 100644 --- a/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift +++ b/Sources/Flipcash2ClientProtocol/chat_v1_chat_service.pb.swift @@ -761,9 +761,21 @@ public struct Flipcash_Chat_V1_StartChatRequest: Sendable { /// Clears the value of `profilePicture`. Subsequent reads from it will return its default value. public mutating func clearProfilePicture() {self._profilePicture = nil} - /// Rules governing participation in the chat. Optional; if not set, the - /// chat has no participation requirements. Caller must satisfy the rules - /// in order for the chat to be started. + /// Rules governing participation in the chat. Caller must satisfy the + /// rules, speaker rules included, in order for the chat to be started + /// (RULES_NOT_SATISFIED otherwise). + /// + /// The server currently accepts only the following, and refuses + /// anything else as INVALID_RULES: + /// - Listener rules: exactly one MinimumBalanceRequirement, which is + /// required, and optionally one StaffRequirement. + /// - Speaker rules: optionally one MinimumBalanceRequirement. If set, + /// it must be in the same currency and the same mints as the + /// listener MinimumBalanceRequirement, and its amount must be larger + /// by at least the currency's minimum transfer value. + /// Every MinimumBalanceRequirement must be at least the currency's + /// minimum transfer value (one unit at its last decimal place, e.g. + /// 0.01 USD or 1 JPY), in a currency the server can value. public var rules: Flipcash_Chat_V1_Rules { get {return _rules ?? Flipcash_Chat_V1_Rules()} set {_rules = newValue} diff --git a/flipcash2.lock b/flipcash2.lock index 9dc3c84..70f88c5 100644 --- a/flipcash2.lock +++ b/flipcash2.lock @@ -1,4 +1,4 @@ # Pinned upstream contract. Regenerate with scripts/sync-protos.sh . upstream: code-payments/flipcash2-protobuf-api -commit: 9d44350b8d4d8eda9d63cff405238bd0e2920409 -subject: Add support for featured groups (#138) +commit: 9f67566fd0297a27ad2de7a98474634adf4d3a24 +subject: Update StartChat comments to enable minimum speaker balanace requirements for public groups (#139) diff --git a/proto/chat/v1/chat_service.proto b/proto/chat/v1/chat_service.proto index fffc873..275be7e 100644 --- a/proto/chat/v1/chat_service.proto +++ b/proto/chat/v1/chat_service.proto @@ -632,9 +632,21 @@ message StartChatRequest { // Optional. If set, it must be owned by the caller and READY. blob.v1.BlobId profile_picture = 2; - // Rules governing participation in the chat. Optional; if not set, the - // chat has no participation requirements. Caller must satisfy the rules - // in order for the chat to be started. + // Rules governing participation in the chat. Caller must satisfy the + // rules, speaker rules included, in order for the chat to be started + // (RULES_NOT_SATISFIED otherwise). + // + // The server currently accepts only the following, and refuses + // anything else as INVALID_RULES: + // - Listener rules: exactly one MinimumBalanceRequirement, which is + // required, and optionally one StaffRequirement. + // - Speaker rules: optionally one MinimumBalanceRequirement. If set, + // it must be in the same currency and the same mints as the + // listener MinimumBalanceRequirement, and its amount must be larger + // by at least the currency's minimum transfer value. + // Every MinimumBalanceRequirement must be at least the currency's + // minimum transfer value (one unit at its last decimal place, e.g. + // 0.01 USD or 1 JPY), in a currency the server can value. Rules rules = 3; // Description for the chat. Optional; empty sets none. Moderated like