From d8e30efc92e1770d5b46b007fbaba293d1bf467b Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Wed, 30 Sep 2026 13:26:47 -0400 Subject: [PATCH 1/2] chore(contract): sync flipcash2 protos to df1cb04e --- .../ContractInfo.swift | 4 +- ...count_v1_flipcash_account_service.pb.swift | 32 ++++--- .../messaging_v1_model.pb.swift | 2 +- .../profile_v1_model.pb.swift | 53 +++++++---- .../profile_v1_profile_service.grpc.swift | 92 +++++++++---------- .../profile_v1_profile_service.pb.swift | 24 ++--- flipcash2.lock | 4 +- .../account/v1/flipcash_account_service.proto | 8 +- proto/messaging/v1/model.proto | 2 +- proto/profile/v1/model.proto | 20 ++-- proto/profile/v1/profile_service.proto | 10 +- 11 files changed, 138 insertions(+), 113 deletions(-) diff --git a/Sources/Flipcash2ClientProtocol/ContractInfo.swift b/Sources/Flipcash2ClientProtocol/ContractInfo.swift index 41ecc7c..19356f9 100644 --- a/Sources/Flipcash2ClientProtocol/ContractInfo.swift +++ b/Sources/Flipcash2ClientProtocol/ContractInfo.swift @@ -1,8 +1,8 @@ // Generated by scripts/generate-swift.sh. Do not edit. public enum Flipcash2ContractInfo { - public static let version = "0.12.0-dev" - public static let protoCommit = "3d6de707e8b013435b802ea3c37ddf6fff21ba6d" + public static let version = "0.13.0-dev" + public static let protoCommit = "df1cb04e71fef7ce77a6a537e0a106fde6452a8f" public static var isLocal: Bool { protoCommit == localSentinel } diff --git a/Sources/Flipcash2ClientProtocol/account_v1_flipcash_account_service.pb.swift b/Sources/Flipcash2ClientProtocol/account_v1_flipcash_account_service.pb.swift index 0ad6675..0cf77b3 100644 --- a/Sources/Flipcash2ClientProtocol/account_v1_flipcash_account_service.pb.swift +++ b/Sources/Flipcash2ClientProtocol/account_v1_flipcash_account_service.pb.swift @@ -484,10 +484,12 @@ public struct Flipcash_Account_V1_UserFlags: @unchecked Sendable { set {_uniqueStorage()._requireCoinbaseEmailVerification = newValue} } - /// Tip presets for all currencies - public var tipPresets: [Flipcash_Account_V1_TipPresets] { - get {return _storage._tipPresets} - set {_uniqueStorage()._tipPresets = newValue} + /// Payment amount presets for all currencies. minimum is the least a payment + /// that opens a DM may be when the recipient has set no min_dm_chat_init_fee, + /// and the least such a fee may be; low, medium and high are one-tap amounts. + public var sendPresets: [Flipcash_Account_V1_SendPresets] { + get {return _storage._sendPresets} + set {_uniqueStorage()._sendPresets = newValue} } /// USDF amount, in quarks, that must be held across all currencies in order to set a username @@ -623,7 +625,7 @@ public struct Flipcash_Account_V1_UserFlags: @unchecked Sendable { fileprivate var _storage = _StorageClass.defaultInstance } -public struct Flipcash_Account_V1_TipPresets: Sendable { +public struct Flipcash_Account_V1_SendPresets: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. @@ -996,7 +998,7 @@ extension Flipcash_Account_V1_GetUnauthenticatedUserFlagsResponse.Result: SwiftP extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".UserFlags" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}is_registered_account\0\u{3}is_staff\0\u{3}requires_iap_for_registration\0\u{3}supported_on_ramp_providers\0\u{3}preferred_on_ramp_provider\0\u{3}min_build_number\0\u{3}bill_exchange_data_timeout\0\u{3}new_currency_purchase_amount\0\u{3}new_currency_fee_amount\0\u{3}withdrawal_fee_amount\0\u{3}preferred_on_ramp_usdc_liquidity_pool\0\u{3}enable_phone_number_send\0\u{3}minimum_holder_value\0\u{3}require_coinbase_email_verification\0\u{3}tip_presets\0\u{3}username_min_balance\0\u{3}message_edit_window\0\u{3}message_delete_window\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}is_registered_account\0\u{3}is_staff\0\u{3}requires_iap_for_registration\0\u{3}supported_on_ramp_providers\0\u{3}preferred_on_ramp_provider\0\u{3}min_build_number\0\u{3}bill_exchange_data_timeout\0\u{3}new_currency_purchase_amount\0\u{3}new_currency_fee_amount\0\u{3}withdrawal_fee_amount\0\u{3}preferred_on_ramp_usdc_liquidity_pool\0\u{3}enable_phone_number_send\0\u{3}minimum_holder_value\0\u{3}require_coinbase_email_verification\0\u{3}send_presets\0\u{3}username_min_balance\0\u{3}message_edit_window\0\u{3}message_delete_window\0") fileprivate class _StorageClass { var _isRegisteredAccount: Bool = false @@ -1013,7 +1015,7 @@ extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._M var _enablePhoneNumberSend: Bool = false var _minimumHolderValue: UInt64 = 0 var _requireCoinbaseEmailVerification: Bool = false - var _tipPresets: [Flipcash_Account_V1_TipPresets] = [] + var _sendPresets: [Flipcash_Account_V1_SendPresets] = [] var _usernameMinBalance: UInt64 = 0 var _messageEditWindow: SwiftProtobuf.Google_Protobuf_Duration? = nil var _messageDeleteWindow: SwiftProtobuf.Google_Protobuf_Duration? = nil @@ -1041,7 +1043,7 @@ extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._M _enablePhoneNumberSend = source._enablePhoneNumberSend _minimumHolderValue = source._minimumHolderValue _requireCoinbaseEmailVerification = source._requireCoinbaseEmailVerification - _tipPresets = source._tipPresets + _sendPresets = source._sendPresets _usernameMinBalance = source._usernameMinBalance _messageEditWindow = source._messageEditWindow _messageDeleteWindow = source._messageDeleteWindow @@ -1077,7 +1079,7 @@ extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._M case 12: try { try decoder.decodeSingularBoolField(value: &_storage._enablePhoneNumberSend) }() case 13: try { try decoder.decodeSingularUInt64Field(value: &_storage._minimumHolderValue) }() case 14: try { try decoder.decodeSingularBoolField(value: &_storage._requireCoinbaseEmailVerification) }() - case 15: try { try decoder.decodeRepeatedMessageField(value: &_storage._tipPresets) }() + case 15: try { try decoder.decodeRepeatedMessageField(value: &_storage._sendPresets) }() case 16: try { try decoder.decodeSingularUInt64Field(value: &_storage._usernameMinBalance) }() case 17: try { try decoder.decodeSingularMessageField(value: &_storage._messageEditWindow) }() case 18: try { try decoder.decodeSingularMessageField(value: &_storage._messageDeleteWindow) }() @@ -1135,8 +1137,8 @@ extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._M if _storage._requireCoinbaseEmailVerification != false { try visitor.visitSingularBoolField(value: _storage._requireCoinbaseEmailVerification, fieldNumber: 14) } - if !_storage._tipPresets.isEmpty { - try visitor.visitRepeatedMessageField(value: _storage._tipPresets, fieldNumber: 15) + if !_storage._sendPresets.isEmpty { + try visitor.visitRepeatedMessageField(value: _storage._sendPresets, fieldNumber: 15) } if _storage._usernameMinBalance != 0 { try visitor.visitSingularUInt64Field(value: _storage._usernameMinBalance, fieldNumber: 16) @@ -1170,7 +1172,7 @@ extension Flipcash_Account_V1_UserFlags: SwiftProtobuf.Message, SwiftProtobuf._M if _storage._enablePhoneNumberSend != rhs_storage._enablePhoneNumberSend {return false} if _storage._minimumHolderValue != rhs_storage._minimumHolderValue {return false} if _storage._requireCoinbaseEmailVerification != rhs_storage._requireCoinbaseEmailVerification {return false} - if _storage._tipPresets != rhs_storage._tipPresets {return false} + if _storage._sendPresets != rhs_storage._sendPresets {return false} if _storage._usernameMinBalance != rhs_storage._usernameMinBalance {return false} if _storage._messageEditWindow != rhs_storage._messageEditWindow {return false} if _storage._messageDeleteWindow != rhs_storage._messageDeleteWindow {return false} @@ -1191,8 +1193,8 @@ extension Flipcash_Account_V1_UserFlags.UsdcLiquidityPool: SwiftProtobuf._ProtoN public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0UNKNOWN_USDC_LIQUIDITY_POOL\0\u{1}FLIPCASH\0\u{1}COINBASE_STABLE_SWAPPER\0") } -extension Flipcash_Account_V1_TipPresets: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TipPresets" +extension Flipcash_Account_V1_SendPresets: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".SendPresets" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}region\0\u{1}minimum\0\u{1}low\0\u{1}medium\0\u{1}high\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -1234,7 +1236,7 @@ extension Flipcash_Account_V1_TipPresets: SwiftProtobuf.Message, SwiftProtobuf._ try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Account_V1_TipPresets, rhs: Flipcash_Account_V1_TipPresets) -> Bool { + public static func ==(lhs: Flipcash_Account_V1_SendPresets, rhs: Flipcash_Account_V1_SendPresets) -> Bool { if lhs._region != rhs._region {return false} if lhs.minimum != rhs.minimum {return false} if lhs.low != rhs.low {return false} diff --git a/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift index 6d77993..5a8a8b4 100644 --- a/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift +++ b/Sources/Flipcash2ClientProtocol/messaging_v1_model.pb.swift @@ -403,7 +403,7 @@ public struct Flipcash_Messaging_V1_CashContent: Sendable { public var unknownFields = SwiftProtobuf.UnknownStorage() - /// Verb for how the cash was sent. Clietns should always show SENT as a + /// Verb for how the cash was sent. Clients should always show SENT as a /// fallback. public enum Verb: SwiftProtobuf.Enum, Swift.CaseIterable { public typealias RawValue = Int diff --git a/Sources/Flipcash2ClientProtocol/profile_v1_model.pb.swift b/Sources/Flipcash2ClientProtocol/profile_v1_model.pb.swift index ab7d694..183917e 100644 --- a/Sources/Flipcash2ClientProtocol/profile_v1_model.pb.swift +++ b/Sources/Flipcash2ClientProtocol/profile_v1_model.pb.swift @@ -50,6 +50,14 @@ public struct Flipcash_Profile_V1_UserProfile: Sendable { /// Clears the value of `username`. Subsequent reads from it will return its default value. public mutating func clearUsername() {self._username = nil} + /// Whether the user's current username was assigned by the server, derived + /// from their display name, rather than chosen with SetUsername. Choosing a + /// different username with SetUsername clears it; setting the username + /// already held leaves it as it was. This is private and will only be + /// returned when the requesting user asks for their own profile; false + /// otherwise, and false when the user has no username. + public var isUsernameAutoAssigned: Bool = false + /// Social profiles are links to external social accounts public var socialProfiles: [Flipcash_Profile_V1_SocialProfile] = [] @@ -103,17 +111,17 @@ public struct Flipcash_Profile_V1_UserProfile: Sendable { /// Clears the value of `joinTs`. Subsequent reads from it will return its default value. public mutating func clearJoinTs() {self._joinTs = nil} - /// How the user has customized their Tip Card. Public, so it is returned for + /// How the user has customized their Flipcard. Public, so it is returned for /// any user, not just the caller. Always set — the server resolves defaults - /// for anything the user hasn't customized. Update it with UpdateTipCard. - public var tipCardCustomization: Flipcash_Profile_V1_TipCardCustomization { - get {return _tipCardCustomization ?? Flipcash_Profile_V1_TipCardCustomization()} - set {_tipCardCustomization = newValue} + /// for anything the user hasn't customized. Update it with UpdateFlipcard. + public var flipcardCustomization: Flipcash_Profile_V1_FlipcardCustomization { + get {return _flipcardCustomization ?? Flipcash_Profile_V1_FlipcardCustomization()} + set {_flipcardCustomization = newValue} } - /// Returns true if `tipCardCustomization` has been explicitly set. - public var hasTipCardCustomization: Bool {return self._tipCardCustomization != nil} - /// Clears the value of `tipCardCustomization`. Subsequent reads from it will return its default value. - public mutating func clearTipCardCustomization() {self._tipCardCustomization = nil} + /// Returns true if `flipcardCustomization` has been explicitly set. + public var hasFlipcardCustomization: Bool {return self._flipcardCustomization != nil} + /// Clears the value of `flipcardCustomization`. Subsequent reads from it will return its default value. + public mutating func clearFlipcardCustomization() {self._flipcardCustomization = nil} /// The minimum fee another user must pay to initialize a DM chat with this /// user. Public, so it is returned for any user, not just the caller. Unset @@ -138,7 +146,7 @@ public struct Flipcash_Profile_V1_UserProfile: Sendable { fileprivate var _emailAddress: Flipcash_Common_V1_EmailAddress? = nil fileprivate var _profilePicture: Flipcash_Blob_V1_Media? = nil fileprivate var _joinTs: SwiftProtobuf.Google_Protobuf_Timestamp? = nil - fileprivate var _tipCardCustomization: Flipcash_Profile_V1_TipCardCustomization? = nil + fileprivate var _flipcardCustomization: Flipcash_Profile_V1_FlipcardCustomization? = nil fileprivate var _minDmChatInitFee: Flipcash_Common_V1_FiatPaymentAmount? = nil } @@ -240,13 +248,13 @@ public struct Flipcash_Profile_V1_XProfile: Sendable { public init() {} } -/// Customization for a Tip Card -public struct Flipcash_Profile_V1_TipCardCustomization: Sendable { +/// Customization for a Flipcard +public struct Flipcash_Profile_V1_FlipcardCustomization: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The colour of the Tip Card. Always set — the server falls back to the + /// The colour of the Flipcard. Always set — the server falls back to the /// default colour when the user hasn't picked one. public var color: Flipcash_Common_V1_Color { get {return _color ?? Flipcash_Common_V1_Color()} @@ -270,7 +278,7 @@ fileprivate let _protobuf_package = "flipcash.profile.v1" extension Flipcash_Profile_V1_UserProfile: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { public static let protoMessageName: String = _protobuf_package + ".UserProfile" - public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}display_name\0\u{3}social_profiles\0\u{3}phone_number\0\u{3}email_address\0\u{3}profile_picture\0\u{3}join_ts\0\u{3}tip_card_customization\0\u{1}username\0\u{3}user_id\0\u{3}min_dm_chat_init_fee\0") + public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}display_name\0\u{3}social_profiles\0\u{3}phone_number\0\u{3}email_address\0\u{3}profile_picture\0\u{3}join_ts\0\u{3}flipcard_customization\0\u{1}username\0\u{3}user_id\0\u{3}min_dm_chat_init_fee\0\u{3}is_username_auto_assigned\0") public mutating func decodeMessage(decoder: inout D) throws { while let fieldNumber = try decoder.nextFieldNumber() { @@ -284,10 +292,11 @@ extension Flipcash_Profile_V1_UserProfile: SwiftProtobuf.Message, SwiftProtobuf. case 4: try { try decoder.decodeSingularMessageField(value: &self._emailAddress) }() case 5: try { try decoder.decodeSingularMessageField(value: &self._profilePicture) }() case 6: try { try decoder.decodeSingularMessageField(value: &self._joinTs) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._tipCardCustomization) }() + case 7: try { try decoder.decodeSingularMessageField(value: &self._flipcardCustomization) }() case 8: try { try decoder.decodeSingularMessageField(value: &self._username) }() case 9: try { try decoder.decodeSingularMessageField(value: &self._userID) }() case 10: try { try decoder.decodeSingularMessageField(value: &self._minDmChatInitFee) }() + case 11: try { try decoder.decodeSingularBoolField(value: &self.isUsernameAutoAssigned) }() default: break } } @@ -316,7 +325,7 @@ extension Flipcash_Profile_V1_UserProfile: SwiftProtobuf.Message, SwiftProtobuf. try { if let v = self._joinTs { try visitor.visitSingularMessageField(value: v, fieldNumber: 6) } }() - try { if let v = self._tipCardCustomization { + try { if let v = self._flipcardCustomization { try visitor.visitSingularMessageField(value: v, fieldNumber: 7) } }() try { if let v = self._username { @@ -328,6 +337,9 @@ extension Flipcash_Profile_V1_UserProfile: SwiftProtobuf.Message, SwiftProtobuf. try { if let v = self._minDmChatInitFee { try visitor.visitSingularMessageField(value: v, fieldNumber: 10) } }() + if self.isUsernameAutoAssigned != false { + try visitor.visitSingularBoolField(value: self.isUsernameAutoAssigned, fieldNumber: 11) + } try unknownFields.traverse(visitor: &visitor) } @@ -335,12 +347,13 @@ extension Flipcash_Profile_V1_UserProfile: SwiftProtobuf.Message, SwiftProtobuf. if lhs._userID != rhs._userID {return false} if lhs.displayName != rhs.displayName {return false} if lhs._username != rhs._username {return false} + if lhs.isUsernameAutoAssigned != rhs.isUsernameAutoAssigned {return false} if lhs.socialProfiles != rhs.socialProfiles {return false} if lhs._phoneNumber != rhs._phoneNumber {return false} if lhs._emailAddress != rhs._emailAddress {return false} if lhs._profilePicture != rhs._profilePicture {return false} if lhs._joinTs != rhs._joinTs {return false} - if lhs._tipCardCustomization != rhs._tipCardCustomization {return false} + if lhs._flipcardCustomization != rhs._flipcardCustomization {return false} if lhs._minDmChatInitFee != rhs._minDmChatInitFee {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true @@ -457,8 +470,8 @@ extension Flipcash_Profile_V1_XProfile.VerifiedType: SwiftProtobuf._ProtoNamePro public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NONE\0\u{1}BLUE\0\u{1}BUSINESS\0\u{1}GOVERNMENT\0") } -extension Flipcash_Profile_V1_TipCardCustomization: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".TipCardCustomization" +extension Flipcash_Profile_V1_FlipcardCustomization: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".FlipcardCustomization" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}color\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -484,7 +497,7 @@ extension Flipcash_Profile_V1_TipCardCustomization: SwiftProtobuf.Message, Swift try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Profile_V1_TipCardCustomization, rhs: Flipcash_Profile_V1_TipCardCustomization) -> Bool { + public static func ==(lhs: Flipcash_Profile_V1_FlipcardCustomization, rhs: Flipcash_Profile_V1_FlipcardCustomization) -> Bool { if lhs._color != rhs._color {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true diff --git a/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.grpc.swift b/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.grpc.swift index 949d59a..5ea7048 100644 --- a/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.grpc.swift +++ b/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.grpc.swift @@ -68,16 +68,16 @@ public enum Flipcash_Profile_V1_Profile { method: "SetProfilePicture" ) } - /// Namespace for "UpdateTipCard" metadata. - public enum UpdateTipCard { - /// Request type for "UpdateTipCard". - public typealias Input = Flipcash_Profile_V1_UpdateTipCardRequest - /// Response type for "UpdateTipCard". - public typealias Output = Flipcash_Profile_V1_UpdateTipCardResponse - /// Descriptor for "UpdateTipCard". + /// Namespace for "UpdateFlipcard" metadata. + public enum UpdateFlipcard { + /// Request type for "UpdateFlipcard". + public typealias Input = Flipcash_Profile_V1_UpdateFlipcardRequest + /// Response type for "UpdateFlipcard". + public typealias Output = Flipcash_Profile_V1_UpdateFlipcardResponse + /// Descriptor for "UpdateFlipcard". public static let descriptor = GRPCCore.MethodDescriptor( service: GRPCCore.ServiceDescriptor(fullyQualifiedService: "flipcash.profile.v1.Profile"), - method: "UpdateTipCard" + method: "UpdateFlipcard" ) } /// Namespace for "SetMinDmChatInitFee" metadata. @@ -122,7 +122,7 @@ public enum Flipcash_Profile_V1_Profile { SetDisplayName.descriptor, SetUsername.descriptor, SetProfilePicture.descriptor, - UpdateTipCard.descriptor, + UpdateFlipcard.descriptor, SetMinDmChatInitFee.descriptor, LinkSocialAccount.descriptor, UnlinkSocialAccount.descriptor @@ -236,28 +236,28 @@ extension Flipcash_Profile_V1_Profile { onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result ) async throws -> Result where Result: Sendable - /// Call the "UpdateTipCard" method. + /// Call the "UpdateFlipcard" method. /// /// > Source IDL Documentation: /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is + /// > UpdateFlipcard updates the caller's Flipcard customization. Every field is /// > optional; only the ones set in the request are changed. /// /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UpdateTipCardRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_UpdateTipCardRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_UpdateTipCardResponse` messages. + /// - request: A request containing a single `Flipcash_Profile_V1_UpdateFlipcardRequest` message. + /// - serializer: A serializer for `Flipcash_Profile_V1_UpdateFlipcardRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Profile_V1_UpdateFlipcardResponse` messages. /// - options: Options to apply to this RPC. /// - handleResponse: A closure which handles the response, the result of which is /// returned to the caller. Returning from the closure will cancel the RPC if it /// hasn't already finished. /// - Returns: The result of `handleResponse`. - func updateTipCard( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, + func updateFlipcard( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, options: GRPCCore.CallOptions, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result ) async throws -> Result where Result: Sendable /// Call the "SetMinDmChatInitFee" method. @@ -482,34 +482,34 @@ extension Flipcash_Profile_V1_Profile { ) } - /// Call the "UpdateTipCard" method. + /// Call the "UpdateFlipcard" method. /// /// > Source IDL Documentation: /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is + /// > UpdateFlipcard updates the caller's Flipcard customization. Every field is /// > optional; only the ones set in the request are changed. /// /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UpdateTipCardRequest` message. - /// - serializer: A serializer for `Flipcash_Profile_V1_UpdateTipCardRequest` messages. - /// - deserializer: A deserializer for `Flipcash_Profile_V1_UpdateTipCardResponse` messages. + /// - request: A request containing a single `Flipcash_Profile_V1_UpdateFlipcardRequest` message. + /// - serializer: A serializer for `Flipcash_Profile_V1_UpdateFlipcardRequest` messages. + /// - deserializer: A deserializer for `Flipcash_Profile_V1_UpdateFlipcardResponse` messages. /// - options: Options to apply to this RPC. /// - handleResponse: A closure which handles the response, the result of which is /// returned to the caller. Returning from the closure will cancel the RPC if it /// hasn't already finished. /// - Returns: The result of `handleResponse`. - public func updateTipCard( - request: GRPCCore.ClientRequest, - serializer: some GRPCCore.MessageSerializer, - deserializer: some GRPCCore.MessageDeserializer, + public func updateFlipcard( + request: GRPCCore.ClientRequest, + serializer: some GRPCCore.MessageSerializer, + deserializer: some GRPCCore.MessageDeserializer, options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in try response.message } ) async throws -> Result where Result: Sendable { try await self.client.unary( request: request, - descriptor: Flipcash_Profile_V1_Profile.Method.UpdateTipCard.descriptor, + descriptor: Flipcash_Profile_V1_Profile.Method.UpdateFlipcard.descriptor, serializer: serializer, deserializer: deserializer, options: options, @@ -740,31 +740,31 @@ extension Flipcash_Profile_V1_Profile.ClientProtocol { ) } - /// Call the "UpdateTipCard" method. + /// Call the "UpdateFlipcard" method. /// /// > Source IDL Documentation: /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is + /// > UpdateFlipcard updates the caller's Flipcard customization. Every field is /// > optional; only the ones set in the request are changed. /// /// - Parameters: - /// - request: A request containing a single `Flipcash_Profile_V1_UpdateTipCardRequest` message. + /// - request: A request containing a single `Flipcash_Profile_V1_UpdateFlipcardRequest` message. /// - options: Options to apply to this RPC. /// - handleResponse: A closure which handles the response, the result of which is /// returned to the caller. Returning from the closure will cancel the RPC if it /// hasn't already finished. /// - Returns: The result of `handleResponse`. - public func updateTipCard( - request: GRPCCore.ClientRequest, + public func updateFlipcard( + request: GRPCCore.ClientRequest, options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in try response.message } ) async throws -> Result where Result: Sendable { - try await self.updateTipCard( + try await self.updateFlipcard( request: request, - serializer: GRPCProtobuf.ProtobufSerializer(), - deserializer: GRPCProtobuf.ProtobufDeserializer(), + serializer: GRPCProtobuf.ProtobufSerializer(), + deserializer: GRPCProtobuf.ProtobufDeserializer(), options: options, onResponse: handleResponse ) @@ -993,11 +993,11 @@ extension Flipcash_Profile_V1_Profile.ClientProtocol { ) } - /// Call the "UpdateTipCard" method. + /// Call the "UpdateFlipcard" method. /// /// > Source IDL Documentation: /// > - /// > UpdateTipCard updates the caller's Tip Card customization. Every field is + /// > UpdateFlipcard updates the caller's Flipcard customization. Every field is /// > optional; only the ones set in the request are changed. /// /// - Parameters: @@ -1008,19 +1008,19 @@ extension Flipcash_Profile_V1_Profile.ClientProtocol { /// returned to the caller. Returning from the closure will cancel the RPC if it /// hasn't already finished. /// - Returns: The result of `handleResponse`. - public func updateTipCard( - _ message: Flipcash_Profile_V1_UpdateTipCardRequest, + public func updateFlipcard( + _ message: Flipcash_Profile_V1_UpdateFlipcardRequest, metadata: GRPCCore.Metadata = [:], options: GRPCCore.CallOptions = .defaults, - onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in + onResponse handleResponse: @Sendable @escaping (GRPCCore.ClientResponse) async throws -> Result = { response in try response.message } ) async throws -> Result where Result: Sendable { - let request = GRPCCore.ClientRequest( + let request = GRPCCore.ClientRequest( message: message, metadata: metadata ) - return try await self.updateTipCard( + return try await self.updateFlipcard( request: request, options: options, onResponse: handleResponse diff --git a/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.pb.swift b/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.pb.swift index 7160547..e82a498 100644 --- a/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.pb.swift +++ b/Sources/Flipcash2ClientProtocol/profile_v1_profile_service.pb.swift @@ -449,12 +449,12 @@ public struct Flipcash_Profile_V1_SetProfilePictureResponse: Sendable { fileprivate var _profilePicture: Flipcash_Blob_V1_Media? = nil } -public struct Flipcash_Profile_V1_UpdateTipCardRequest: Sendable { +public struct Flipcash_Profile_V1_UpdateFlipcardRequest: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - /// The new colour of the Tip Card. Left unchanged when unset. + /// The new colour of the Flipcard. Left unchanged when unset. public var color: Flipcash_Common_V1_Color { get {return _color ?? Flipcash_Common_V1_Color()} set {_color = newValue} @@ -481,12 +481,12 @@ public struct Flipcash_Profile_V1_UpdateTipCardRequest: Sendable { fileprivate var _auth: Flipcash_Common_V1_Auth? = nil } -public struct Flipcash_Profile_V1_UpdateTipCardResponse: Sendable { +public struct Flipcash_Profile_V1_UpdateFlipcardResponse: Sendable { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. - public var result: Flipcash_Profile_V1_UpdateTipCardResponse.Result = .ok + public var result: Flipcash_Profile_V1_UpdateFlipcardResponse.Result = .ok public var unknownFields = SwiftProtobuf.UnknownStorage() @@ -520,7 +520,7 @@ public struct Flipcash_Profile_V1_UpdateTipCardResponse: Sendable { } // The compiler won't synthesize support with the UNRECOGNIZED case. - public static let allCases: [Flipcash_Profile_V1_UpdateTipCardResponse.Result] = [ + public static let allCases: [Flipcash_Profile_V1_UpdateFlipcardResponse.Result] = [ .ok, .denied, .invalidColor, @@ -1192,8 +1192,8 @@ extension Flipcash_Profile_V1_SetProfilePictureResponse.Result: SwiftProtobuf._P public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}BLOB_NOT_FOUND\0\u{1}BLOB_NOT_READY\0\u{1}BLOB_REJECTED\0\u{1}INVALID_BLOB\0") } -extension Flipcash_Profile_V1_UpdateTipCardRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateTipCardRequest" +extension Flipcash_Profile_V1_UpdateFlipcardRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UpdateFlipcardRequest" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}color\0\u{2}\u{9}auth\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -1223,7 +1223,7 @@ extension Flipcash_Profile_V1_UpdateTipCardRequest: SwiftProtobuf.Message, Swift try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Profile_V1_UpdateTipCardRequest, rhs: Flipcash_Profile_V1_UpdateTipCardRequest) -> Bool { + public static func ==(lhs: Flipcash_Profile_V1_UpdateFlipcardRequest, rhs: Flipcash_Profile_V1_UpdateFlipcardRequest) -> Bool { if lhs._color != rhs._color {return false} if lhs._auth != rhs._auth {return false} if lhs.unknownFields != rhs.unknownFields {return false} @@ -1231,8 +1231,8 @@ extension Flipcash_Profile_V1_UpdateTipCardRequest: SwiftProtobuf.Message, Swift } } -extension Flipcash_Profile_V1_UpdateTipCardResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { - public static let protoMessageName: String = _protobuf_package + ".UpdateTipCardResponse" +extension Flipcash_Profile_V1_UpdateFlipcardResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + public static let protoMessageName: String = _protobuf_package + ".UpdateFlipcardResponse" public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}result\0") public mutating func decodeMessage(decoder: inout D) throws { @@ -1254,14 +1254,14 @@ extension Flipcash_Profile_V1_UpdateTipCardResponse: SwiftProtobuf.Message, Swif try unknownFields.traverse(visitor: &visitor) } - public static func ==(lhs: Flipcash_Profile_V1_UpdateTipCardResponse, rhs: Flipcash_Profile_V1_UpdateTipCardResponse) -> Bool { + public static func ==(lhs: Flipcash_Profile_V1_UpdateFlipcardResponse, rhs: Flipcash_Profile_V1_UpdateFlipcardResponse) -> Bool { if lhs.result != rhs.result {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } } -extension Flipcash_Profile_V1_UpdateTipCardResponse.Result: SwiftProtobuf._ProtoNameProviding { +extension Flipcash_Profile_V1_UpdateFlipcardResponse.Result: SwiftProtobuf._ProtoNameProviding { public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0OK\0\u{1}DENIED\0\u{1}INVALID_COLOR\0") } diff --git a/flipcash2.lock b/flipcash2.lock index ae55c39..3dd4a70 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: 3d6de707e8b013435b802ea3c37ddf6fff21ba6d -subject: Move towards a send to start chatting paradigm (#126) +commit: df1cb04e71fef7ce77a6a537e0a106fde6452a8f +subject: Add is_username_auto_assigned to UserProfile (#128) diff --git a/proto/account/v1/flipcash_account_service.proto b/proto/account/v1/flipcash_account_service.proto index 4576274..3b28f17 100644 --- a/proto/account/v1/flipcash_account_service.proto +++ b/proto/account/v1/flipcash_account_service.proto @@ -167,8 +167,10 @@ message UserFlags { // Whether email verification is required for Coinbase purchase flows bool require_coinbase_email_verification = 14; - // Tip presets for all currencies - repeated TipPresets tip_presets = 15; + // Payment amount presets for all currencies. minimum is the least a payment + // that opens a DM may be when the recipient has set no min_dm_chat_init_fee, + // and the least such a fee may be; low, medium and high are one-tap amounts. + repeated SendPresets send_presets = 15; // USDF amount, in quarks, that must be held across all currencies in order to set a username uint64 username_min_balance = 16; @@ -180,7 +182,7 @@ message UserFlags { google.protobuf.Duration message_delete_window = 18; } -message TipPresets { +message SendPresets { common.v1.Region region = 1 [(validate.rules).message.required = true]; double minimum = 2; diff --git a/proto/messaging/v1/model.proto b/proto/messaging/v1/model.proto index b6ed51a..63b7d39 100644 --- a/proto/messaging/v1/model.proto +++ b/proto/messaging/v1/model.proto @@ -204,7 +204,7 @@ message CashContent { // Reserved for receiver, which will is required for group chats reserved 3; - // Verb for how the cash was sent. Clietns should always show SENT as a + // Verb for how the cash was sent. Clients should always show SENT as a // fallback. enum Verb { SENT = 0; diff --git a/proto/profile/v1/model.proto b/proto/profile/v1/model.proto index 3274fc2..67c024e 100644 --- a/proto/profile/v1/model.proto +++ b/proto/profile/v1/model.proto @@ -26,6 +26,14 @@ message UserProfile { // not just the caller. Unset when the user hasn't claimed one yet. common.v1.Username username = 8; + // Whether the user's current username was assigned by the server, derived + // from their display name, rather than chosen with SetUsername. Choosing a + // different username with SetUsername clears it; setting the username + // already held leaves it as it was. This is private and will only be + // returned when the requesting user asks for their own profile; false + // otherwise, and false when the user has no username. + bool is_username_auto_assigned = 11; + // Social profiles are links to external social accounts repeated SocialProfile social_profiles = 2 [(validate.rules).repeated = { min_items: 0 @@ -55,10 +63,10 @@ message UserProfile { // Timestamp the user joined Flipcash google.protobuf.Timestamp join_ts = 6 [(validate.rules).timestamp.required = true]; - // How the user has customized their Tip Card. Public, so it is returned for + // How the user has customized their Flipcard. Public, so it is returned for // any user, not just the caller. Always set — the server resolves defaults - // for anything the user hasn't customized. Update it with UpdateTipCard. - TipCardCustomization tip_card_customization = 7 [(validate.rules).message.required = true]; + // for anything the user hasn't customized. Update it with UpdateFlipcard. + FlipcardCustomization flipcard_customization = 7 [(validate.rules).message.required = true]; // The minimum fee another user must pay to initialize a DM chat with this // user. Public, so it is returned for any user, not just the caller. Unset @@ -117,9 +125,9 @@ message XProfile { uint32 follower_count = 7; } -// Customization for a Tip Card -message TipCardCustomization { - // The colour of the Tip Card. Always set — the server falls back to the +// Customization for a Flipcard +message FlipcardCustomization { + // The colour of the Flipcard. Always set — the server falls back to the // default colour when the user hasn't picked one. common.v1.Color color = 1 [(validate.rules).message.required = true]; } diff --git a/proto/profile/v1/profile_service.proto b/proto/profile/v1/profile_service.proto index dd9eb4b..686d745 100644 --- a/proto/profile/v1/profile_service.proto +++ b/proto/profile/v1/profile_service.proto @@ -30,9 +30,9 @@ service Profile { // DISPLAY and THUMBNAIL renditions itself and returns the full set. rpc SetProfilePicture(SetProfilePictureRequest) returns (SetProfilePictureResponse); - // UpdateTipCard updates the caller's Tip Card customization. Every field is + // UpdateFlipcard updates the caller's Flipcard customization. Every field is // optional; only the ones set in the request are changed. - rpc UpdateTipCard(UpdateTipCardRequest) returns (UpdateTipCardResponse); + rpc UpdateFlipcard(UpdateFlipcardRequest) returns (UpdateFlipcardResponse); // SetMinDmChatInitFee sets the minimum fee another user must pay to // initialize a DM chat with the caller, replacing any fee already set. @@ -154,14 +154,14 @@ message SetProfilePictureResponse { blob.v1.Media profile_picture = 2; } -message UpdateTipCardRequest { - // The new colour of the Tip Card. Left unchanged when unset. +message UpdateFlipcardRequest { + // The new colour of the Flipcard. Left unchanged when unset. common.v1.Color color = 1; common.v1.Auth auth = 10 [(validate.rules).message.required = true]; } -message UpdateTipCardResponse { +message UpdateFlipcardResponse { Result result = 1; enum Result { OK = 0; From b73ebad76c9f27d3c9ec1a3fe5a88a4f02342a8a Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Wed, 30 Sep 2026 13:31:38 -0400 Subject: [PATCH 2/2] docs(changelog): add the 0.14.0 entry --- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea1f045..be0c9bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,56 @@ called out explicitly even when nothing else did. release notes, so a version with no entry here does not release. Write the entry in the same PR that syncs the contract, while the diff is still in front of you. +## 0.14.0 + +Synced to [`flipcash2-protobuf-api@df1cb04e`](https://github.com/code-payments/flipcash2-protobuf-api/commit/df1cb04e71fef7ce77a6a537e0a106fde6452a8f), +picking up [#127](https://github.com/code-payments/flipcash2-protobuf-api/pull/127) and +[#128](https://github.com/code-payments/flipcash2-protobuf-api/pull/128). `account.v1` and +`profile.v1` moved; `messaging.v1` changed only in a comment. + +One RPC is renamed, which changes its gRPC method path, so this release is not wire-compatible with a +server that still serves the old name. The other renames break source only. No field or enum number +changed. + +### Added + +- `profile.v1.UserProfile.is_username_auto_assigned` (field 11, `bool`): true when the server + assigned the current username from the display name, rather than the user choosing it with + `SetUsername`. Choosing a different username clears it. It is private: set only on the caller's + own profile, and false for anyone else's and when there is no username. + +### Changed + +Renamed, with numbers unchanged: + +| Before | After | Swift | Kotlin | +|---|---|---|---| +| `profile.v1.TipCardCustomization` | `FlipcardCustomization` | `Flipcash_Profile_V1_TipCardCustomization` → `…FlipcardCustomization` | `TipCardCustomization` → `FlipcardCustomization` | +| `UserProfile.tip_card_customization = 7` | `flipcard_customization = 7` | `tipCardCustomization` → `flipcardCustomization` | `getTipCardCustomization()` → `getFlipcardCustomization()` | +| `account.v1.TipPresets` | `SendPresets` | `Flipcash_Account_V1_TipPresets` → `…SendPresets` | `TipPresets` → `SendPresets` | +| `UserFlags.tip_presets = 15` | `send_presets = 15` | `tipPresets` → `sendPresets` | `getTipPresetsList()` → `getSendPresetsList()` | +| rpc `Profile.UpdateTipCard` | `UpdateFlipcard` | `updateTipCard` → `updateFlipcard` | `updateTipCard` → `updateFlipcard` | +| `UpdateTipCardRequest` / `UpdateTipCardResponse` | `UpdateFlipcardRequest` / `UpdateFlipcardResponse` | same rename | same rename | + +`SendPresets.minimum` is now documented as the least a payment that opens a DM may be when the +recipient has set no `min_dm_chat_init_fee`, and the least such a fee may be. `low`, `medium` and +`high` are one-tap amounts. The fields did not change. + +### Upgrading + +**`UpdateFlipcard` is a wire change.** gRPC calls a method by name, so the path moves from +`/flipcash.profile.v1.Profile/UpdateTipCard` to `/flipcash.profile.v1.Profile/UpdateFlipcard`. A +client on 0.14.0 fails against a server that only serves `UpdateTipCard`, and an older client fails +against a server that only serves `UpdateFlipcard`. The request and response shapes, and the +`Result` enum, are unchanged. + +**The other renames are compile errors, not wire changes.** Code that names any of the message or +field symbols above has to be updated before it builds. Proto JSON encodes field names, so anything +serializing `UserProfile` or `UserFlags` as JSON sees `flipcardCustomization` and `sendPresets`. + +**`is_username_auto_assigned` is free to ignore.** It defaults to false, so a client that does not +read it behaves as before. + ## 0.13.0 Synced to [`flipcash2-protobuf-api@3d6de707`](https://github.com/code-payments/flipcash2-protobuf-api/commit/3d6de707e8b013435b802ea3c37ddf6fff21ba6d),