diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings index 15fe03a547f2c9d8b8c19fc7b3e8f43681a1a6e4..abf4d8981a3a5fba3a919da91f3d5fcc55f31dfa 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h index a87e7b1adf40a466e486637f98f905fb706e6485..525c5d58f7977f0c8be4a79a023d321675f37b10 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Headers/Bindings.objc.h @@ -31,7 +31,6 @@ @class BindingsGroupChat; @class BindingsGroupReport; @class BindingsGroupSendReport; -@class BindingsIdList; @class BindingsMessage; @class BindingsNodeRegistrationReport; @class BindingsProgress; @@ -267,7 +266,13 @@ storage. To enable backups again, call InitializeBackup. NewCmixFromBackup. Example BackupReport: -{"RestoredContacts":["0AeVYBe87SV45A2UI4AtIe6H4AIyZSLPBPrT6eTBLycD"],"Params":""} + { + "RestoredContacts": [ + "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID", + "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + ], + "Params": "" + } */ @interface BindingsBackupReport : NSObject <goSeqRefInterface> { } @@ -275,7 +280,7 @@ Example BackupReport: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field BackupReport.RestoredContacts with unsupported type: gitlab.com/elixxir/client/bindings.IdList +// skipped field BackupReport.RestoredContacts with unsupported type: []*gitlab.com/xx_network/primitives/id.ID /** * The backup parameters found within the backup file @@ -301,6 +306,7 @@ Example JSON: // skipped field BroadcastMessage.BroadcastReport with unsupported type: gitlab.com/elixxir/client/bindings.BroadcastReport @property (nonatomic) NSData* _Nullable payload; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -317,9 +323,11 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -@property (nonatomic) long roundID; +// skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList + // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -332,12 +340,21 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; /** - * Broadcast sends a given payload over the broadcast channel using symmetric broadcast. + * Broadcast sends a given payload over the broadcast channel using symmetric +broadcast. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcast:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; /** - * BroadcastAsymmetric sends a given payload over the broadcast channel using asymmetric broadcast. -This mode of encryption requires a private key. + * BroadcastAsymmetric sends a given payload over the broadcast channel using +asymmetric broadcast. This mode of encryption requires a private key. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcastAsymmetric:(NSData* _Nullable)payload pk:(NSData* _Nullable)pk error:(NSError* _Nullable* _Nullable)error; /** @@ -348,9 +365,10 @@ This mode of encryption requires a private key. * Listen registers a BroadcastListener for a given method. This allows users to handle incoming broadcast messages. -Params: +Parameters: - l - BroadcastListener object - - method - int corresponding to broadcast.Method constant, 0 for symmetric or 1 for asymmetric + - method - int corresponding to broadcast.Method constant, 0 for symmetric + or 1 for asymmetric */ - (BOOL)listen:(id<BindingsBroadcastListener> _Nullable)l method:(long)method error:(NSError* _Nullable* _Nullable)error; /** @@ -527,7 +545,12 @@ most likely be in an unrecoverable state and need to be trashed. */ - (BOOL)stopNetworkFollower:(NSError* _Nullable* _Nullable)error; /** - * WaitForMessageDelivery allows the caller to get notified if the rounds a + * WaitForNetwork will block until either the network is healthy or the passed +timeout is reached. It will return true if the network is healthy. + */ +- (BOOL)waitForNetwork:(long)timeoutMS; +/** + * WaitForRoundResult allows the caller to get notified if the rounds a message was sent in successfully completed. Under the hood, this uses an API that uses the internal round data, network historical round lookup, and waiting on network events to determine what has (or will) occur. @@ -537,13 +560,11 @@ The callbacks will return at timeoutMS if no state update occurs. This function takes the marshaled send report to ensure a memory leak does not occur as a result of both sides of the bindings holding a reference to the same pointer. + +roundList is a JSON marshalled RoundsList or any JSON marshalled send report +that inherits a RoundsList object. */ -- (BOOL)waitForMessageDelivery:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; -/** - * WaitForNetwork will block until either the network is healthy or the passed -timeout is reached. It will return true if the network is healthy. - */ -- (BOOL)waitForNetwork:(long)timeoutMS; +- (BOOL)waitForRoundResult:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; @end /** @@ -575,7 +596,11 @@ from the partner.Manager. - (BOOL)registerListener:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * SendE2E is a wrapper for sending specifically to the Connection's -partner.Manager. Returns a marshalled E2ESendReport. +partner.Manager. + +Returns: + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)mt payload:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; @end @@ -694,11 +719,11 @@ payload. */ - (long)firstPartitionSize; /** - * GetAllPartnerIDs returns a marshalled list of all partner IDs that the user -has an E2E relationship with. + * GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E +relationship with. Returns: - - []byte - the marshalled bytes of the IdList object. + - []byte - the marshalled bytes of []*id.ID. */ - (NSData* _Nullable)getAllPartnerIDs:(NSError* _Nullable* _Nullable)error; /** @@ -853,7 +878,8 @@ Parameters: - e2eParams - the marshalled bytes of the e2e.Params object. Returns: - - []byte - the marshalled bytes of the E2ESendReport object. + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)messageType recipientId:(NSData* _Nullable)recipientId payload:(NSData* _Nullable)payload e2eParams:(NSData* _Nullable)e2eParams error:(NSError* _Nullable* _Nullable)error; /** @@ -1130,10 +1156,10 @@ Returns: */ - (BindingsGroup* _Nullable)getGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** - * GetGroups returns an IdList containing a list of group IDs that the user is a member of. + * GetGroups returns a list of group IDs that the user is a member of. Returns: - - []byte - a JSON marshalled IdList representing all group ID's. + - []byte - a JSON marshalled []*id.ID representing all group ID's. */ - (NSData* _Nullable)getGroups:(NSError* _Nullable* _Nullable)error; /** @@ -1143,7 +1169,7 @@ with the same trackedGroupId. Parameters: - trackedGroupId - the ID to retrieve the Group object within the backend's - tracking system. This is received by GroupRequest.Callback. + tracking system. This is received by GroupRequest.Callback. */ - (BOOL)joinGroup:(long)trackedGroupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1154,8 +1180,25 @@ Parameters: This can be pulled from a marshalled GroupReport. */ - (BOOL)leaveGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; -// skipped method GroupChat.MakeGroup with unsupported parameter or return types +/** + * MakeGroup creates a new Group and sends a group request to all members in the +group. + +Parameters: + - membershipBytes - the JSON marshalled list of []*id.ID; it contains the + IDs of members the user wants to add to the group. + - message - the initial message sent to all members in the group. This is an + optional parameter and may be nil. + - tag - the name of the group decided by the creator. This is an optional + parameter and may be nil. If nil the group will be assigned the default + name. +Returns: + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. + */ +- (NSData* _Nullable)makeGroup:(NSData* _Nullable)membershipBytes message:(NSData* _Nullable)message name:(NSData* _Nullable)name error:(NSError* _Nullable* _Nullable)error; /** * NumGroups returns the number of groups the user is a part of. */ @@ -1168,7 +1211,9 @@ Parameters: This can be found in the report returned by GroupChat.MakeGroup. Returns: - - []byte - a JSON-marshalled GroupReport. + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. */ - (NSData* _Nullable)resendRequest:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1181,7 +1226,9 @@ Parameters: - tag - the tag associated with the message. This tag may be empty. Returns: - - []byte - a JSON marshalled GroupSendReport. + - []byte - the JSON marshalled bytes of the GroupSendReport object, which + can be passed into WaitForRoundResult to see if the group message send + succeeded. */ - (NSData* _Nullable)send:(NSData* _Nullable)groupId message:(NSData* _Nullable)message tag:(NSString* _Nullable)tag error:(NSError* _Nullable* _Nullable)error; @end @@ -1198,9 +1245,10 @@ status of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; @property (nonatomic) NSData* _Nullable id_; -// skipped field GroupReport.Rounds with unsupported type: []int +// skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) long status; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1213,23 +1261,11 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field GroupSendReport.RoundID with unsupported type: uint64 +// skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; -@end - -/** - * IdList is a wrapper for a list of marshalled id.ID objects. - */ -@interface BindingsIdList : NSObject <goSeqRefInterface> { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field IdList.Ids with unsupported type: [][]byte - +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1393,7 +1429,7 @@ Example marshalled roundList object: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field RoundsList.Rounds with unsupported type: []int +// skipped field RoundsList.Rounds with unsupported type: []uint64 /** * Marshal JSON marshals the RoundsList. @@ -1802,14 +1838,15 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsLookupUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdLookupCallback> _Nullable cb, NSData* _Nullable lookupId, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); /** * NewBroadcastChannel creates a bindings-layer broadcast channel & starts listening for new messages -Params +Parameters: - cmixId - internal ID of cmix - channelDefinition - JSON marshalled ChannelDef object */ @@ -1942,7 +1979,8 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); @@ -1976,7 +2014,8 @@ Parameters: - responseCB - the callback that will be called when a response is received Returns: - - []byte - JSON marshalled SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); @@ -2053,8 +2092,12 @@ FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, @end /** - * BroadcastListener is the public function type bindings can use to listen for broadcast messages. -It accepts the result of calling json.Marshal on a BroadcastMessage object. + * BroadcastListener is the public function type bindings can use to listen for +broadcast messages. + +Parameters: + - []byte - the JSON marshalled bytes of the BroadcastMessage object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ @interface BindingsBroadcastListener : NSObject <goSeqRefInterface, BindingsBroadcastListener> { } @@ -2267,7 +2310,9 @@ Parameters: received. Parameters: - - callbackReport - JSON marshalled SingleUseCallbackReport + - callbackReport - the JSON marshalled bytes of the SingleUseCallbackReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseCallback : NSObject <goSeqRefInterface, BindingsSingleUseCallback> { } @@ -2282,7 +2327,9 @@ Parameters: clients into TransmitSingleUse. Parameters: - - callbackReport - JSON marshalled SingleUseResponseReport + - callbackReport - the JSON marshalled bytes of the SingleUseResponseReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseResponse : NSObject <goSeqRefInterface, BindingsSingleUseResponse> { } diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings index 15fe03a547f2c9d8b8c19fc7b3e8f43681a1a6e4..abf4d8981a3a5fba3a919da91f3d5fcc55f31dfa 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h index a87e7b1adf40a466e486637f98f905fb706e6485..525c5d58f7977f0c8be4a79a023d321675f37b10 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -31,7 +31,6 @@ @class BindingsGroupChat; @class BindingsGroupReport; @class BindingsGroupSendReport; -@class BindingsIdList; @class BindingsMessage; @class BindingsNodeRegistrationReport; @class BindingsProgress; @@ -267,7 +266,13 @@ storage. To enable backups again, call InitializeBackup. NewCmixFromBackup. Example BackupReport: -{"RestoredContacts":["0AeVYBe87SV45A2UI4AtIe6H4AIyZSLPBPrT6eTBLycD"],"Params":""} + { + "RestoredContacts": [ + "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID", + "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + ], + "Params": "" + } */ @interface BindingsBackupReport : NSObject <goSeqRefInterface> { } @@ -275,7 +280,7 @@ Example BackupReport: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field BackupReport.RestoredContacts with unsupported type: gitlab.com/elixxir/client/bindings.IdList +// skipped field BackupReport.RestoredContacts with unsupported type: []*gitlab.com/xx_network/primitives/id.ID /** * The backup parameters found within the backup file @@ -301,6 +306,7 @@ Example JSON: // skipped field BroadcastMessage.BroadcastReport with unsupported type: gitlab.com/elixxir/client/bindings.BroadcastReport @property (nonatomic) NSData* _Nullable payload; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -317,9 +323,11 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -@property (nonatomic) long roundID; +// skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList + // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -332,12 +340,21 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; /** - * Broadcast sends a given payload over the broadcast channel using symmetric broadcast. + * Broadcast sends a given payload over the broadcast channel using symmetric +broadcast. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcast:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; /** - * BroadcastAsymmetric sends a given payload over the broadcast channel using asymmetric broadcast. -This mode of encryption requires a private key. + * BroadcastAsymmetric sends a given payload over the broadcast channel using +asymmetric broadcast. This mode of encryption requires a private key. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcastAsymmetric:(NSData* _Nullable)payload pk:(NSData* _Nullable)pk error:(NSError* _Nullable* _Nullable)error; /** @@ -348,9 +365,10 @@ This mode of encryption requires a private key. * Listen registers a BroadcastListener for a given method. This allows users to handle incoming broadcast messages. -Params: +Parameters: - l - BroadcastListener object - - method - int corresponding to broadcast.Method constant, 0 for symmetric or 1 for asymmetric + - method - int corresponding to broadcast.Method constant, 0 for symmetric + or 1 for asymmetric */ - (BOOL)listen:(id<BindingsBroadcastListener> _Nullable)l method:(long)method error:(NSError* _Nullable* _Nullable)error; /** @@ -527,7 +545,12 @@ most likely be in an unrecoverable state and need to be trashed. */ - (BOOL)stopNetworkFollower:(NSError* _Nullable* _Nullable)error; /** - * WaitForMessageDelivery allows the caller to get notified if the rounds a + * WaitForNetwork will block until either the network is healthy or the passed +timeout is reached. It will return true if the network is healthy. + */ +- (BOOL)waitForNetwork:(long)timeoutMS; +/** + * WaitForRoundResult allows the caller to get notified if the rounds a message was sent in successfully completed. Under the hood, this uses an API that uses the internal round data, network historical round lookup, and waiting on network events to determine what has (or will) occur. @@ -537,13 +560,11 @@ The callbacks will return at timeoutMS if no state update occurs. This function takes the marshaled send report to ensure a memory leak does not occur as a result of both sides of the bindings holding a reference to the same pointer. + +roundList is a JSON marshalled RoundsList or any JSON marshalled send report +that inherits a RoundsList object. */ -- (BOOL)waitForMessageDelivery:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; -/** - * WaitForNetwork will block until either the network is healthy or the passed -timeout is reached. It will return true if the network is healthy. - */ -- (BOOL)waitForNetwork:(long)timeoutMS; +- (BOOL)waitForRoundResult:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; @end /** @@ -575,7 +596,11 @@ from the partner.Manager. - (BOOL)registerListener:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * SendE2E is a wrapper for sending specifically to the Connection's -partner.Manager. Returns a marshalled E2ESendReport. +partner.Manager. + +Returns: + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)mt payload:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; @end @@ -694,11 +719,11 @@ payload. */ - (long)firstPartitionSize; /** - * GetAllPartnerIDs returns a marshalled list of all partner IDs that the user -has an E2E relationship with. + * GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E +relationship with. Returns: - - []byte - the marshalled bytes of the IdList object. + - []byte - the marshalled bytes of []*id.ID. */ - (NSData* _Nullable)getAllPartnerIDs:(NSError* _Nullable* _Nullable)error; /** @@ -853,7 +878,8 @@ Parameters: - e2eParams - the marshalled bytes of the e2e.Params object. Returns: - - []byte - the marshalled bytes of the E2ESendReport object. + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)messageType recipientId:(NSData* _Nullable)recipientId payload:(NSData* _Nullable)payload e2eParams:(NSData* _Nullable)e2eParams error:(NSError* _Nullable* _Nullable)error; /** @@ -1130,10 +1156,10 @@ Returns: */ - (BindingsGroup* _Nullable)getGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** - * GetGroups returns an IdList containing a list of group IDs that the user is a member of. + * GetGroups returns a list of group IDs that the user is a member of. Returns: - - []byte - a JSON marshalled IdList representing all group ID's. + - []byte - a JSON marshalled []*id.ID representing all group ID's. */ - (NSData* _Nullable)getGroups:(NSError* _Nullable* _Nullable)error; /** @@ -1143,7 +1169,7 @@ with the same trackedGroupId. Parameters: - trackedGroupId - the ID to retrieve the Group object within the backend's - tracking system. This is received by GroupRequest.Callback. + tracking system. This is received by GroupRequest.Callback. */ - (BOOL)joinGroup:(long)trackedGroupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1154,8 +1180,25 @@ Parameters: This can be pulled from a marshalled GroupReport. */ - (BOOL)leaveGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; -// skipped method GroupChat.MakeGroup with unsupported parameter or return types +/** + * MakeGroup creates a new Group and sends a group request to all members in the +group. + +Parameters: + - membershipBytes - the JSON marshalled list of []*id.ID; it contains the + IDs of members the user wants to add to the group. + - message - the initial message sent to all members in the group. This is an + optional parameter and may be nil. + - tag - the name of the group decided by the creator. This is an optional + parameter and may be nil. If nil the group will be assigned the default + name. +Returns: + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. + */ +- (NSData* _Nullable)makeGroup:(NSData* _Nullable)membershipBytes message:(NSData* _Nullable)message name:(NSData* _Nullable)name error:(NSError* _Nullable* _Nullable)error; /** * NumGroups returns the number of groups the user is a part of. */ @@ -1168,7 +1211,9 @@ Parameters: This can be found in the report returned by GroupChat.MakeGroup. Returns: - - []byte - a JSON-marshalled GroupReport. + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. */ - (NSData* _Nullable)resendRequest:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1181,7 +1226,9 @@ Parameters: - tag - the tag associated with the message. This tag may be empty. Returns: - - []byte - a JSON marshalled GroupSendReport. + - []byte - the JSON marshalled bytes of the GroupSendReport object, which + can be passed into WaitForRoundResult to see if the group message send + succeeded. */ - (NSData* _Nullable)send:(NSData* _Nullable)groupId message:(NSData* _Nullable)message tag:(NSString* _Nullable)tag error:(NSError* _Nullable* _Nullable)error; @end @@ -1198,9 +1245,10 @@ status of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; @property (nonatomic) NSData* _Nullable id_; -// skipped field GroupReport.Rounds with unsupported type: []int +// skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) long status; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1213,23 +1261,11 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field GroupSendReport.RoundID with unsupported type: uint64 +// skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; -@end - -/** - * IdList is a wrapper for a list of marshalled id.ID objects. - */ -@interface BindingsIdList : NSObject <goSeqRefInterface> { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field IdList.Ids with unsupported type: [][]byte - +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1393,7 +1429,7 @@ Example marshalled roundList object: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field RoundsList.Rounds with unsupported type: []int +// skipped field RoundsList.Rounds with unsupported type: []uint64 /** * Marshal JSON marshals the RoundsList. @@ -1802,14 +1838,15 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsLookupUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdLookupCallback> _Nullable cb, NSData* _Nullable lookupId, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); /** * NewBroadcastChannel creates a bindings-layer broadcast channel & starts listening for new messages -Params +Parameters: - cmixId - internal ID of cmix - channelDefinition - JSON marshalled ChannelDef object */ @@ -1942,7 +1979,8 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); @@ -1976,7 +2014,8 @@ Parameters: - responseCB - the callback that will be called when a response is received Returns: - - []byte - JSON marshalled SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); @@ -2053,8 +2092,12 @@ FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, @end /** - * BroadcastListener is the public function type bindings can use to listen for broadcast messages. -It accepts the result of calling json.Marshal on a BroadcastMessage object. + * BroadcastListener is the public function type bindings can use to listen for +broadcast messages. + +Parameters: + - []byte - the JSON marshalled bytes of the BroadcastMessage object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ @interface BindingsBroadcastListener : NSObject <goSeqRefInterface, BindingsBroadcastListener> { } @@ -2267,7 +2310,9 @@ Parameters: received. Parameters: - - callbackReport - JSON marshalled SingleUseCallbackReport + - callbackReport - the JSON marshalled bytes of the SingleUseCallbackReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseCallback : NSObject <goSeqRefInterface, BindingsSingleUseCallback> { } @@ -2282,7 +2327,9 @@ Parameters: clients into TransmitSingleUse. Parameters: - - callbackReport - JSON marshalled SingleUseResponseReport + - callbackReport - the JSON marshalled bytes of the SingleUseResponseReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseResponse : NSObject <goSeqRefInterface, BindingsSingleUseResponse> { } diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings index 15fe03a547f2c9d8b8c19fc7b3e8f43681a1a6e4..abf4d8981a3a5fba3a919da91f3d5fcc55f31dfa 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h index a87e7b1adf40a466e486637f98f905fb706e6485..525c5d58f7977f0c8be4a79a023d321675f37b10 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64/Bindings.framework/Versions/Current/Headers/Bindings.objc.h @@ -31,7 +31,6 @@ @class BindingsGroupChat; @class BindingsGroupReport; @class BindingsGroupSendReport; -@class BindingsIdList; @class BindingsMessage; @class BindingsNodeRegistrationReport; @class BindingsProgress; @@ -267,7 +266,13 @@ storage. To enable backups again, call InitializeBackup. NewCmixFromBackup. Example BackupReport: -{"RestoredContacts":["0AeVYBe87SV45A2UI4AtIe6H4AIyZSLPBPrT6eTBLycD"],"Params":""} + { + "RestoredContacts": [ + "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID", + "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + ], + "Params": "" + } */ @interface BindingsBackupReport : NSObject <goSeqRefInterface> { } @@ -275,7 +280,7 @@ Example BackupReport: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field BackupReport.RestoredContacts with unsupported type: gitlab.com/elixxir/client/bindings.IdList +// skipped field BackupReport.RestoredContacts with unsupported type: []*gitlab.com/xx_network/primitives/id.ID /** * The backup parameters found within the backup file @@ -301,6 +306,7 @@ Example JSON: // skipped field BroadcastMessage.BroadcastReport with unsupported type: gitlab.com/elixxir/client/bindings.BroadcastReport @property (nonatomic) NSData* _Nullable payload; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -317,9 +323,11 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -@property (nonatomic) long roundID; +// skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList + // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -332,12 +340,21 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; /** - * Broadcast sends a given payload over the broadcast channel using symmetric broadcast. + * Broadcast sends a given payload over the broadcast channel using symmetric +broadcast. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcast:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; /** - * BroadcastAsymmetric sends a given payload over the broadcast channel using asymmetric broadcast. -This mode of encryption requires a private key. + * BroadcastAsymmetric sends a given payload over the broadcast channel using +asymmetric broadcast. This mode of encryption requires a private key. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcastAsymmetric:(NSData* _Nullable)payload pk:(NSData* _Nullable)pk error:(NSError* _Nullable* _Nullable)error; /** @@ -348,9 +365,10 @@ This mode of encryption requires a private key. * Listen registers a BroadcastListener for a given method. This allows users to handle incoming broadcast messages. -Params: +Parameters: - l - BroadcastListener object - - method - int corresponding to broadcast.Method constant, 0 for symmetric or 1 for asymmetric + - method - int corresponding to broadcast.Method constant, 0 for symmetric + or 1 for asymmetric */ - (BOOL)listen:(id<BindingsBroadcastListener> _Nullable)l method:(long)method error:(NSError* _Nullable* _Nullable)error; /** @@ -527,7 +545,12 @@ most likely be in an unrecoverable state and need to be trashed. */ - (BOOL)stopNetworkFollower:(NSError* _Nullable* _Nullable)error; /** - * WaitForMessageDelivery allows the caller to get notified if the rounds a + * WaitForNetwork will block until either the network is healthy or the passed +timeout is reached. It will return true if the network is healthy. + */ +- (BOOL)waitForNetwork:(long)timeoutMS; +/** + * WaitForRoundResult allows the caller to get notified if the rounds a message was sent in successfully completed. Under the hood, this uses an API that uses the internal round data, network historical round lookup, and waiting on network events to determine what has (or will) occur. @@ -537,13 +560,11 @@ The callbacks will return at timeoutMS if no state update occurs. This function takes the marshaled send report to ensure a memory leak does not occur as a result of both sides of the bindings holding a reference to the same pointer. + +roundList is a JSON marshalled RoundsList or any JSON marshalled send report +that inherits a RoundsList object. */ -- (BOOL)waitForMessageDelivery:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; -/** - * WaitForNetwork will block until either the network is healthy or the passed -timeout is reached. It will return true if the network is healthy. - */ -- (BOOL)waitForNetwork:(long)timeoutMS; +- (BOOL)waitForRoundResult:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; @end /** @@ -575,7 +596,11 @@ from the partner.Manager. - (BOOL)registerListener:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * SendE2E is a wrapper for sending specifically to the Connection's -partner.Manager. Returns a marshalled E2ESendReport. +partner.Manager. + +Returns: + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)mt payload:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; @end @@ -694,11 +719,11 @@ payload. */ - (long)firstPartitionSize; /** - * GetAllPartnerIDs returns a marshalled list of all partner IDs that the user -has an E2E relationship with. + * GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E +relationship with. Returns: - - []byte - the marshalled bytes of the IdList object. + - []byte - the marshalled bytes of []*id.ID. */ - (NSData* _Nullable)getAllPartnerIDs:(NSError* _Nullable* _Nullable)error; /** @@ -853,7 +878,8 @@ Parameters: - e2eParams - the marshalled bytes of the e2e.Params object. Returns: - - []byte - the marshalled bytes of the E2ESendReport object. + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)messageType recipientId:(NSData* _Nullable)recipientId payload:(NSData* _Nullable)payload e2eParams:(NSData* _Nullable)e2eParams error:(NSError* _Nullable* _Nullable)error; /** @@ -1130,10 +1156,10 @@ Returns: */ - (BindingsGroup* _Nullable)getGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** - * GetGroups returns an IdList containing a list of group IDs that the user is a member of. + * GetGroups returns a list of group IDs that the user is a member of. Returns: - - []byte - a JSON marshalled IdList representing all group ID's. + - []byte - a JSON marshalled []*id.ID representing all group ID's. */ - (NSData* _Nullable)getGroups:(NSError* _Nullable* _Nullable)error; /** @@ -1143,7 +1169,7 @@ with the same trackedGroupId. Parameters: - trackedGroupId - the ID to retrieve the Group object within the backend's - tracking system. This is received by GroupRequest.Callback. + tracking system. This is received by GroupRequest.Callback. */ - (BOOL)joinGroup:(long)trackedGroupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1154,8 +1180,25 @@ Parameters: This can be pulled from a marshalled GroupReport. */ - (BOOL)leaveGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; -// skipped method GroupChat.MakeGroup with unsupported parameter or return types +/** + * MakeGroup creates a new Group and sends a group request to all members in the +group. + +Parameters: + - membershipBytes - the JSON marshalled list of []*id.ID; it contains the + IDs of members the user wants to add to the group. + - message - the initial message sent to all members in the group. This is an + optional parameter and may be nil. + - tag - the name of the group decided by the creator. This is an optional + parameter and may be nil. If nil the group will be assigned the default + name. +Returns: + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. + */ +- (NSData* _Nullable)makeGroup:(NSData* _Nullable)membershipBytes message:(NSData* _Nullable)message name:(NSData* _Nullable)name error:(NSError* _Nullable* _Nullable)error; /** * NumGroups returns the number of groups the user is a part of. */ @@ -1168,7 +1211,9 @@ Parameters: This can be found in the report returned by GroupChat.MakeGroup. Returns: - - []byte - a JSON-marshalled GroupReport. + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. */ - (NSData* _Nullable)resendRequest:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1181,7 +1226,9 @@ Parameters: - tag - the tag associated with the message. This tag may be empty. Returns: - - []byte - a JSON marshalled GroupSendReport. + - []byte - the JSON marshalled bytes of the GroupSendReport object, which + can be passed into WaitForRoundResult to see if the group message send + succeeded. */ - (NSData* _Nullable)send:(NSData* _Nullable)groupId message:(NSData* _Nullable)message tag:(NSString* _Nullable)tag error:(NSError* _Nullable* _Nullable)error; @end @@ -1198,9 +1245,10 @@ status of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; @property (nonatomic) NSData* _Nullable id_; -// skipped field GroupReport.Rounds with unsupported type: []int +// skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) long status; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1213,23 +1261,11 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field GroupSendReport.RoundID with unsupported type: uint64 +// skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; -@end - -/** - * IdList is a wrapper for a list of marshalled id.ID objects. - */ -@interface BindingsIdList : NSObject <goSeqRefInterface> { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field IdList.Ids with unsupported type: [][]byte - +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1393,7 +1429,7 @@ Example marshalled roundList object: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field RoundsList.Rounds with unsupported type: []int +// skipped field RoundsList.Rounds with unsupported type: []uint64 /** * Marshal JSON marshals the RoundsList. @@ -1802,14 +1838,15 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsLookupUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdLookupCallback> _Nullable cb, NSData* _Nullable lookupId, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); /** * NewBroadcastChannel creates a bindings-layer broadcast channel & starts listening for new messages -Params +Parameters: - cmixId - internal ID of cmix - channelDefinition - JSON marshalled ChannelDef object */ @@ -1942,7 +1979,8 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); @@ -1976,7 +2014,8 @@ Parameters: - responseCB - the callback that will be called when a response is received Returns: - - []byte - JSON marshalled SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); @@ -2053,8 +2092,12 @@ FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, @end /** - * BroadcastListener is the public function type bindings can use to listen for broadcast messages. -It accepts the result of calling json.Marshal on a BroadcastMessage object. + * BroadcastListener is the public function type bindings can use to listen for +broadcast messages. + +Parameters: + - []byte - the JSON marshalled bytes of the BroadcastMessage object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ @interface BindingsBroadcastListener : NSObject <goSeqRefInterface, BindingsBroadcastListener> { } @@ -2267,7 +2310,9 @@ Parameters: received. Parameters: - - callbackReport - JSON marshalled SingleUseCallbackReport + - callbackReport - the JSON marshalled bytes of the SingleUseCallbackReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseCallback : NSObject <goSeqRefInterface, BindingsSingleUseCallback> { } @@ -2282,7 +2327,9 @@ Parameters: clients into TransmitSingleUse. Parameters: - - callbackReport - JSON marshalled SingleUseResponseReport + - callbackReport - the JSON marshalled bytes of the SingleUseResponseReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseResponse : NSObject <goSeqRefInterface, BindingsSingleUseResponse> { } diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings index 9ee144b911c2fd99b30fee3e8903698938973dc7..de3447dcf74c1b6a9083db4a3dfa65fd21b0bc59 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h index a87e7b1adf40a466e486637f98f905fb706e6485..525c5d58f7977f0c8be4a79a023d321675f37b10 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Headers/Bindings.objc.h @@ -31,7 +31,6 @@ @class BindingsGroupChat; @class BindingsGroupReport; @class BindingsGroupSendReport; -@class BindingsIdList; @class BindingsMessage; @class BindingsNodeRegistrationReport; @class BindingsProgress; @@ -267,7 +266,13 @@ storage. To enable backups again, call InitializeBackup. NewCmixFromBackup. Example BackupReport: -{"RestoredContacts":["0AeVYBe87SV45A2UI4AtIe6H4AIyZSLPBPrT6eTBLycD"],"Params":""} + { + "RestoredContacts": [ + "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID", + "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + ], + "Params": "" + } */ @interface BindingsBackupReport : NSObject <goSeqRefInterface> { } @@ -275,7 +280,7 @@ Example BackupReport: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field BackupReport.RestoredContacts with unsupported type: gitlab.com/elixxir/client/bindings.IdList +// skipped field BackupReport.RestoredContacts with unsupported type: []*gitlab.com/xx_network/primitives/id.ID /** * The backup parameters found within the backup file @@ -301,6 +306,7 @@ Example JSON: // skipped field BroadcastMessage.BroadcastReport with unsupported type: gitlab.com/elixxir/client/bindings.BroadcastReport @property (nonatomic) NSData* _Nullable payload; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -317,9 +323,11 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -@property (nonatomic) long roundID; +// skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList + // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -332,12 +340,21 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; /** - * Broadcast sends a given payload over the broadcast channel using symmetric broadcast. + * Broadcast sends a given payload over the broadcast channel using symmetric +broadcast. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcast:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; /** - * BroadcastAsymmetric sends a given payload over the broadcast channel using asymmetric broadcast. -This mode of encryption requires a private key. + * BroadcastAsymmetric sends a given payload over the broadcast channel using +asymmetric broadcast. This mode of encryption requires a private key. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcastAsymmetric:(NSData* _Nullable)payload pk:(NSData* _Nullable)pk error:(NSError* _Nullable* _Nullable)error; /** @@ -348,9 +365,10 @@ This mode of encryption requires a private key. * Listen registers a BroadcastListener for a given method. This allows users to handle incoming broadcast messages. -Params: +Parameters: - l - BroadcastListener object - - method - int corresponding to broadcast.Method constant, 0 for symmetric or 1 for asymmetric + - method - int corresponding to broadcast.Method constant, 0 for symmetric + or 1 for asymmetric */ - (BOOL)listen:(id<BindingsBroadcastListener> _Nullable)l method:(long)method error:(NSError* _Nullable* _Nullable)error; /** @@ -527,7 +545,12 @@ most likely be in an unrecoverable state and need to be trashed. */ - (BOOL)stopNetworkFollower:(NSError* _Nullable* _Nullable)error; /** - * WaitForMessageDelivery allows the caller to get notified if the rounds a + * WaitForNetwork will block until either the network is healthy or the passed +timeout is reached. It will return true if the network is healthy. + */ +- (BOOL)waitForNetwork:(long)timeoutMS; +/** + * WaitForRoundResult allows the caller to get notified if the rounds a message was sent in successfully completed. Under the hood, this uses an API that uses the internal round data, network historical round lookup, and waiting on network events to determine what has (or will) occur. @@ -537,13 +560,11 @@ The callbacks will return at timeoutMS if no state update occurs. This function takes the marshaled send report to ensure a memory leak does not occur as a result of both sides of the bindings holding a reference to the same pointer. + +roundList is a JSON marshalled RoundsList or any JSON marshalled send report +that inherits a RoundsList object. */ -- (BOOL)waitForMessageDelivery:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; -/** - * WaitForNetwork will block until either the network is healthy or the passed -timeout is reached. It will return true if the network is healthy. - */ -- (BOOL)waitForNetwork:(long)timeoutMS; +- (BOOL)waitForRoundResult:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; @end /** @@ -575,7 +596,11 @@ from the partner.Manager. - (BOOL)registerListener:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * SendE2E is a wrapper for sending specifically to the Connection's -partner.Manager. Returns a marshalled E2ESendReport. +partner.Manager. + +Returns: + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)mt payload:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; @end @@ -694,11 +719,11 @@ payload. */ - (long)firstPartitionSize; /** - * GetAllPartnerIDs returns a marshalled list of all partner IDs that the user -has an E2E relationship with. + * GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E +relationship with. Returns: - - []byte - the marshalled bytes of the IdList object. + - []byte - the marshalled bytes of []*id.ID. */ - (NSData* _Nullable)getAllPartnerIDs:(NSError* _Nullable* _Nullable)error; /** @@ -853,7 +878,8 @@ Parameters: - e2eParams - the marshalled bytes of the e2e.Params object. Returns: - - []byte - the marshalled bytes of the E2ESendReport object. + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)messageType recipientId:(NSData* _Nullable)recipientId payload:(NSData* _Nullable)payload e2eParams:(NSData* _Nullable)e2eParams error:(NSError* _Nullable* _Nullable)error; /** @@ -1130,10 +1156,10 @@ Returns: */ - (BindingsGroup* _Nullable)getGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** - * GetGroups returns an IdList containing a list of group IDs that the user is a member of. + * GetGroups returns a list of group IDs that the user is a member of. Returns: - - []byte - a JSON marshalled IdList representing all group ID's. + - []byte - a JSON marshalled []*id.ID representing all group ID's. */ - (NSData* _Nullable)getGroups:(NSError* _Nullable* _Nullable)error; /** @@ -1143,7 +1169,7 @@ with the same trackedGroupId. Parameters: - trackedGroupId - the ID to retrieve the Group object within the backend's - tracking system. This is received by GroupRequest.Callback. + tracking system. This is received by GroupRequest.Callback. */ - (BOOL)joinGroup:(long)trackedGroupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1154,8 +1180,25 @@ Parameters: This can be pulled from a marshalled GroupReport. */ - (BOOL)leaveGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; -// skipped method GroupChat.MakeGroup with unsupported parameter or return types +/** + * MakeGroup creates a new Group and sends a group request to all members in the +group. + +Parameters: + - membershipBytes - the JSON marshalled list of []*id.ID; it contains the + IDs of members the user wants to add to the group. + - message - the initial message sent to all members in the group. This is an + optional parameter and may be nil. + - tag - the name of the group decided by the creator. This is an optional + parameter and may be nil. If nil the group will be assigned the default + name. +Returns: + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. + */ +- (NSData* _Nullable)makeGroup:(NSData* _Nullable)membershipBytes message:(NSData* _Nullable)message name:(NSData* _Nullable)name error:(NSError* _Nullable* _Nullable)error; /** * NumGroups returns the number of groups the user is a part of. */ @@ -1168,7 +1211,9 @@ Parameters: This can be found in the report returned by GroupChat.MakeGroup. Returns: - - []byte - a JSON-marshalled GroupReport. + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. */ - (NSData* _Nullable)resendRequest:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1181,7 +1226,9 @@ Parameters: - tag - the tag associated with the message. This tag may be empty. Returns: - - []byte - a JSON marshalled GroupSendReport. + - []byte - the JSON marshalled bytes of the GroupSendReport object, which + can be passed into WaitForRoundResult to see if the group message send + succeeded. */ - (NSData* _Nullable)send:(NSData* _Nullable)groupId message:(NSData* _Nullable)message tag:(NSString* _Nullable)tag error:(NSError* _Nullable* _Nullable)error; @end @@ -1198,9 +1245,10 @@ status of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; @property (nonatomic) NSData* _Nullable id_; -// skipped field GroupReport.Rounds with unsupported type: []int +// skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) long status; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1213,23 +1261,11 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field GroupSendReport.RoundID with unsupported type: uint64 +// skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; -@end - -/** - * IdList is a wrapper for a list of marshalled id.ID objects. - */ -@interface BindingsIdList : NSObject <goSeqRefInterface> { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field IdList.Ids with unsupported type: [][]byte - +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1393,7 +1429,7 @@ Example marshalled roundList object: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field RoundsList.Rounds with unsupported type: []int +// skipped field RoundsList.Rounds with unsupported type: []uint64 /** * Marshal JSON marshals the RoundsList. @@ -1802,14 +1838,15 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsLookupUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdLookupCallback> _Nullable cb, NSData* _Nullable lookupId, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); /** * NewBroadcastChannel creates a bindings-layer broadcast channel & starts listening for new messages -Params +Parameters: - cmixId - internal ID of cmix - channelDefinition - JSON marshalled ChannelDef object */ @@ -1942,7 +1979,8 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); @@ -1976,7 +2014,8 @@ Parameters: - responseCB - the callback that will be called when a response is received Returns: - - []byte - JSON marshalled SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); @@ -2053,8 +2092,12 @@ FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, @end /** - * BroadcastListener is the public function type bindings can use to listen for broadcast messages. -It accepts the result of calling json.Marshal on a BroadcastMessage object. + * BroadcastListener is the public function type bindings can use to listen for +broadcast messages. + +Parameters: + - []byte - the JSON marshalled bytes of the BroadcastMessage object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ @interface BindingsBroadcastListener : NSObject <goSeqRefInterface, BindingsBroadcastListener> { } @@ -2267,7 +2310,9 @@ Parameters: received. Parameters: - - callbackReport - JSON marshalled SingleUseCallbackReport + - callbackReport - the JSON marshalled bytes of the SingleUseCallbackReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseCallback : NSObject <goSeqRefInterface, BindingsSingleUseCallback> { } @@ -2282,7 +2327,9 @@ Parameters: clients into TransmitSingleUse. Parameters: - - callbackReport - JSON marshalled SingleUseResponseReport + - callbackReport - the JSON marshalled bytes of the SingleUseResponseReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseResponse : NSObject <goSeqRefInterface, BindingsSingleUseResponse> { } diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings index 9ee144b911c2fd99b30fee3e8903698938973dc7..de3447dcf74c1b6a9083db4a3dfa65fd21b0bc59 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h index a87e7b1adf40a466e486637f98f905fb706e6485..525c5d58f7977f0c8be4a79a023d321675f37b10 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/A/Headers/Bindings.objc.h @@ -31,7 +31,6 @@ @class BindingsGroupChat; @class BindingsGroupReport; @class BindingsGroupSendReport; -@class BindingsIdList; @class BindingsMessage; @class BindingsNodeRegistrationReport; @class BindingsProgress; @@ -267,7 +266,13 @@ storage. To enable backups again, call InitializeBackup. NewCmixFromBackup. Example BackupReport: -{"RestoredContacts":["0AeVYBe87SV45A2UI4AtIe6H4AIyZSLPBPrT6eTBLycD"],"Params":""} + { + "RestoredContacts": [ + "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID", + "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + ], + "Params": "" + } */ @interface BindingsBackupReport : NSObject <goSeqRefInterface> { } @@ -275,7 +280,7 @@ Example BackupReport: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field BackupReport.RestoredContacts with unsupported type: gitlab.com/elixxir/client/bindings.IdList +// skipped field BackupReport.RestoredContacts with unsupported type: []*gitlab.com/xx_network/primitives/id.ID /** * The backup parameters found within the backup file @@ -301,6 +306,7 @@ Example JSON: // skipped field BroadcastMessage.BroadcastReport with unsupported type: gitlab.com/elixxir/client/bindings.BroadcastReport @property (nonatomic) NSData* _Nullable payload; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -317,9 +323,11 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -@property (nonatomic) long roundID; +// skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList + // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -332,12 +340,21 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; /** - * Broadcast sends a given payload over the broadcast channel using symmetric broadcast. + * Broadcast sends a given payload over the broadcast channel using symmetric +broadcast. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcast:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; /** - * BroadcastAsymmetric sends a given payload over the broadcast channel using asymmetric broadcast. -This mode of encryption requires a private key. + * BroadcastAsymmetric sends a given payload over the broadcast channel using +asymmetric broadcast. This mode of encryption requires a private key. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcastAsymmetric:(NSData* _Nullable)payload pk:(NSData* _Nullable)pk error:(NSError* _Nullable* _Nullable)error; /** @@ -348,9 +365,10 @@ This mode of encryption requires a private key. * Listen registers a BroadcastListener for a given method. This allows users to handle incoming broadcast messages. -Params: +Parameters: - l - BroadcastListener object - - method - int corresponding to broadcast.Method constant, 0 for symmetric or 1 for asymmetric + - method - int corresponding to broadcast.Method constant, 0 for symmetric + or 1 for asymmetric */ - (BOOL)listen:(id<BindingsBroadcastListener> _Nullable)l method:(long)method error:(NSError* _Nullable* _Nullable)error; /** @@ -527,7 +545,12 @@ most likely be in an unrecoverable state and need to be trashed. */ - (BOOL)stopNetworkFollower:(NSError* _Nullable* _Nullable)error; /** - * WaitForMessageDelivery allows the caller to get notified if the rounds a + * WaitForNetwork will block until either the network is healthy or the passed +timeout is reached. It will return true if the network is healthy. + */ +- (BOOL)waitForNetwork:(long)timeoutMS; +/** + * WaitForRoundResult allows the caller to get notified if the rounds a message was sent in successfully completed. Under the hood, this uses an API that uses the internal round data, network historical round lookup, and waiting on network events to determine what has (or will) occur. @@ -537,13 +560,11 @@ The callbacks will return at timeoutMS if no state update occurs. This function takes the marshaled send report to ensure a memory leak does not occur as a result of both sides of the bindings holding a reference to the same pointer. + +roundList is a JSON marshalled RoundsList or any JSON marshalled send report +that inherits a RoundsList object. */ -- (BOOL)waitForMessageDelivery:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; -/** - * WaitForNetwork will block until either the network is healthy or the passed -timeout is reached. It will return true if the network is healthy. - */ -- (BOOL)waitForNetwork:(long)timeoutMS; +- (BOOL)waitForRoundResult:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; @end /** @@ -575,7 +596,11 @@ from the partner.Manager. - (BOOL)registerListener:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * SendE2E is a wrapper for sending specifically to the Connection's -partner.Manager. Returns a marshalled E2ESendReport. +partner.Manager. + +Returns: + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)mt payload:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; @end @@ -694,11 +719,11 @@ payload. */ - (long)firstPartitionSize; /** - * GetAllPartnerIDs returns a marshalled list of all partner IDs that the user -has an E2E relationship with. + * GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E +relationship with. Returns: - - []byte - the marshalled bytes of the IdList object. + - []byte - the marshalled bytes of []*id.ID. */ - (NSData* _Nullable)getAllPartnerIDs:(NSError* _Nullable* _Nullable)error; /** @@ -853,7 +878,8 @@ Parameters: - e2eParams - the marshalled bytes of the e2e.Params object. Returns: - - []byte - the marshalled bytes of the E2ESendReport object. + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)messageType recipientId:(NSData* _Nullable)recipientId payload:(NSData* _Nullable)payload e2eParams:(NSData* _Nullable)e2eParams error:(NSError* _Nullable* _Nullable)error; /** @@ -1130,10 +1156,10 @@ Returns: */ - (BindingsGroup* _Nullable)getGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** - * GetGroups returns an IdList containing a list of group IDs that the user is a member of. + * GetGroups returns a list of group IDs that the user is a member of. Returns: - - []byte - a JSON marshalled IdList representing all group ID's. + - []byte - a JSON marshalled []*id.ID representing all group ID's. */ - (NSData* _Nullable)getGroups:(NSError* _Nullable* _Nullable)error; /** @@ -1143,7 +1169,7 @@ with the same trackedGroupId. Parameters: - trackedGroupId - the ID to retrieve the Group object within the backend's - tracking system. This is received by GroupRequest.Callback. + tracking system. This is received by GroupRequest.Callback. */ - (BOOL)joinGroup:(long)trackedGroupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1154,8 +1180,25 @@ Parameters: This can be pulled from a marshalled GroupReport. */ - (BOOL)leaveGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; -// skipped method GroupChat.MakeGroup with unsupported parameter or return types +/** + * MakeGroup creates a new Group and sends a group request to all members in the +group. + +Parameters: + - membershipBytes - the JSON marshalled list of []*id.ID; it contains the + IDs of members the user wants to add to the group. + - message - the initial message sent to all members in the group. This is an + optional parameter and may be nil. + - tag - the name of the group decided by the creator. This is an optional + parameter and may be nil. If nil the group will be assigned the default + name. +Returns: + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. + */ +- (NSData* _Nullable)makeGroup:(NSData* _Nullable)membershipBytes message:(NSData* _Nullable)message name:(NSData* _Nullable)name error:(NSError* _Nullable* _Nullable)error; /** * NumGroups returns the number of groups the user is a part of. */ @@ -1168,7 +1211,9 @@ Parameters: This can be found in the report returned by GroupChat.MakeGroup. Returns: - - []byte - a JSON-marshalled GroupReport. + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. */ - (NSData* _Nullable)resendRequest:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1181,7 +1226,9 @@ Parameters: - tag - the tag associated with the message. This tag may be empty. Returns: - - []byte - a JSON marshalled GroupSendReport. + - []byte - the JSON marshalled bytes of the GroupSendReport object, which + can be passed into WaitForRoundResult to see if the group message send + succeeded. */ - (NSData* _Nullable)send:(NSData* _Nullable)groupId message:(NSData* _Nullable)message tag:(NSString* _Nullable)tag error:(NSError* _Nullable* _Nullable)error; @end @@ -1198,9 +1245,10 @@ status of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; @property (nonatomic) NSData* _Nullable id_; -// skipped field GroupReport.Rounds with unsupported type: []int +// skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) long status; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1213,23 +1261,11 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field GroupSendReport.RoundID with unsupported type: uint64 +// skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; -@end - -/** - * IdList is a wrapper for a list of marshalled id.ID objects. - */ -@interface BindingsIdList : NSObject <goSeqRefInterface> { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field IdList.Ids with unsupported type: [][]byte - +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1393,7 +1429,7 @@ Example marshalled roundList object: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field RoundsList.Rounds with unsupported type: []int +// skipped field RoundsList.Rounds with unsupported type: []uint64 /** * Marshal JSON marshals the RoundsList. @@ -1802,14 +1838,15 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsLookupUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdLookupCallback> _Nullable cb, NSData* _Nullable lookupId, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); /** * NewBroadcastChannel creates a bindings-layer broadcast channel & starts listening for new messages -Params +Parameters: - cmixId - internal ID of cmix - channelDefinition - JSON marshalled ChannelDef object */ @@ -1942,7 +1979,8 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); @@ -1976,7 +2014,8 @@ Parameters: - responseCB - the callback that will be called when a response is received Returns: - - []byte - JSON marshalled SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); @@ -2053,8 +2092,12 @@ FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, @end /** - * BroadcastListener is the public function type bindings can use to listen for broadcast messages. -It accepts the result of calling json.Marshal on a BroadcastMessage object. + * BroadcastListener is the public function type bindings can use to listen for +broadcast messages. + +Parameters: + - []byte - the JSON marshalled bytes of the BroadcastMessage object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ @interface BindingsBroadcastListener : NSObject <goSeqRefInterface, BindingsBroadcastListener> { } @@ -2267,7 +2310,9 @@ Parameters: received. Parameters: - - callbackReport - JSON marshalled SingleUseCallbackReport + - callbackReport - the JSON marshalled bytes of the SingleUseCallbackReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseCallback : NSObject <goSeqRefInterface, BindingsSingleUseCallback> { } @@ -2282,7 +2327,9 @@ Parameters: clients into TransmitSingleUse. Parameters: - - callbackReport - JSON marshalled SingleUseResponseReport + - callbackReport - the JSON marshalled bytes of the SingleUseResponseReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseResponse : NSObject <goSeqRefInterface, BindingsSingleUseResponse> { } diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings index 9ee144b911c2fd99b30fee3e8903698938973dc7..de3447dcf74c1b6a9083db4a3dfa65fd21b0bc59 100644 Binary files a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings and b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Bindings differ diff --git a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h index a87e7b1adf40a466e486637f98f905fb706e6485..525c5d58f7977f0c8be4a79a023d321675f37b10 100644 --- a/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h +++ b/Frameworks/Bindings.xcframework/ios-arm64_x86_64-simulator/Bindings.framework/Versions/Current/Headers/Bindings.objc.h @@ -31,7 +31,6 @@ @class BindingsGroupChat; @class BindingsGroupReport; @class BindingsGroupSendReport; -@class BindingsIdList; @class BindingsMessage; @class BindingsNodeRegistrationReport; @class BindingsProgress; @@ -267,7 +266,13 @@ storage. To enable backups again, call InitializeBackup. NewCmixFromBackup. Example BackupReport: -{"RestoredContacts":["0AeVYBe87SV45A2UI4AtIe6H4AIyZSLPBPrT6eTBLycD"],"Params":""} + { + "RestoredContacts": [ + "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID", + "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + ], + "Params": "" + } */ @interface BindingsBackupReport : NSObject <goSeqRefInterface> { } @@ -275,7 +280,7 @@ Example BackupReport: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field BackupReport.RestoredContacts with unsupported type: gitlab.com/elixxir/client/bindings.IdList +// skipped field BackupReport.RestoredContacts with unsupported type: []*gitlab.com/xx_network/primitives/id.ID /** * The backup parameters found within the backup file @@ -301,6 +306,7 @@ Example JSON: // skipped field BroadcastMessage.BroadcastReport with unsupported type: gitlab.com/elixxir/client/bindings.BroadcastReport @property (nonatomic) NSData* _Nullable payload; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -317,9 +323,11 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -@property (nonatomic) long roundID; +// skipped field BroadcastReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList + // skipped field BroadcastReport.EphID with unsupported type: gitlab.com/xx_network/primitives/id/ephemeral.Id +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -332,12 +340,21 @@ Example JSON: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; /** - * Broadcast sends a given payload over the broadcast channel using symmetric broadcast. + * Broadcast sends a given payload over the broadcast channel using symmetric +broadcast. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcast:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; /** - * BroadcastAsymmetric sends a given payload over the broadcast channel using asymmetric broadcast. -This mode of encryption requires a private key. + * BroadcastAsymmetric sends a given payload over the broadcast channel using +asymmetric broadcast. This mode of encryption requires a private key. + +Returns: + - []byte - the JSON marshalled bytes of the BroadcastReport object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ - (NSData* _Nullable)broadcastAsymmetric:(NSData* _Nullable)payload pk:(NSData* _Nullable)pk error:(NSError* _Nullable* _Nullable)error; /** @@ -348,9 +365,10 @@ This mode of encryption requires a private key. * Listen registers a BroadcastListener for a given method. This allows users to handle incoming broadcast messages. -Params: +Parameters: - l - BroadcastListener object - - method - int corresponding to broadcast.Method constant, 0 for symmetric or 1 for asymmetric + - method - int corresponding to broadcast.Method constant, 0 for symmetric + or 1 for asymmetric */ - (BOOL)listen:(id<BindingsBroadcastListener> _Nullable)l method:(long)method error:(NSError* _Nullable* _Nullable)error; /** @@ -527,7 +545,12 @@ most likely be in an unrecoverable state and need to be trashed. */ - (BOOL)stopNetworkFollower:(NSError* _Nullable* _Nullable)error; /** - * WaitForMessageDelivery allows the caller to get notified if the rounds a + * WaitForNetwork will block until either the network is healthy or the passed +timeout is reached. It will return true if the network is healthy. + */ +- (BOOL)waitForNetwork:(long)timeoutMS; +/** + * WaitForRoundResult allows the caller to get notified if the rounds a message was sent in successfully completed. Under the hood, this uses an API that uses the internal round data, network historical round lookup, and waiting on network events to determine what has (or will) occur. @@ -537,13 +560,11 @@ The callbacks will return at timeoutMS if no state update occurs. This function takes the marshaled send report to ensure a memory leak does not occur as a result of both sides of the bindings holding a reference to the same pointer. + +roundList is a JSON marshalled RoundsList or any JSON marshalled send report +that inherits a RoundsList object. */ -- (BOOL)waitForMessageDelivery:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; -/** - * WaitForNetwork will block until either the network is healthy or the passed -timeout is reached. It will return true if the network is healthy. - */ -- (BOOL)waitForNetwork:(long)timeoutMS; +- (BOOL)waitForRoundResult:(NSData* _Nullable)roundList mdc:(id<BindingsMessageDeliveryCallback> _Nullable)mdc timeoutMS:(long)timeoutMS error:(NSError* _Nullable* _Nullable)error; @end /** @@ -575,7 +596,11 @@ from the partner.Manager. - (BOOL)registerListener:(long)messageType newListener:(id<BindingsListener> _Nullable)newListener error:(NSError* _Nullable* _Nullable)error; /** * SendE2E is a wrapper for sending specifically to the Connection's -partner.Manager. Returns a marshalled E2ESendReport. +partner.Manager. + +Returns: + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)mt payload:(NSData* _Nullable)payload error:(NSError* _Nullable* _Nullable)error; @end @@ -694,11 +719,11 @@ payload. */ - (long)firstPartitionSize; /** - * GetAllPartnerIDs returns a marshalled list of all partner IDs that the user -has an E2E relationship with. + * GetAllPartnerIDs returns a list of all partner IDs that the user has an E2E +relationship with. Returns: - - []byte - the marshalled bytes of the IdList object. + - []byte - the marshalled bytes of []*id.ID. */ - (NSData* _Nullable)getAllPartnerIDs:(NSError* _Nullable* _Nullable)error; /** @@ -853,7 +878,8 @@ Parameters: - e2eParams - the marshalled bytes of the e2e.Params object. Returns: - - []byte - the marshalled bytes of the E2ESendReport object. + - []byte - the JSON marshalled bytes of the E2ESendReport object, which can + be passed into WaitForRoundResult to see if the send succeeded. */ - (NSData* _Nullable)sendE2E:(long)messageType recipientId:(NSData* _Nullable)recipientId payload:(NSData* _Nullable)payload e2eParams:(NSData* _Nullable)e2eParams error:(NSError* _Nullable* _Nullable)error; /** @@ -1130,10 +1156,10 @@ Returns: */ - (BindingsGroup* _Nullable)getGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** - * GetGroups returns an IdList containing a list of group IDs that the user is a member of. + * GetGroups returns a list of group IDs that the user is a member of. Returns: - - []byte - a JSON marshalled IdList representing all group ID's. + - []byte - a JSON marshalled []*id.ID representing all group ID's. */ - (NSData* _Nullable)getGroups:(NSError* _Nullable* _Nullable)error; /** @@ -1143,7 +1169,7 @@ with the same trackedGroupId. Parameters: - trackedGroupId - the ID to retrieve the Group object within the backend's - tracking system. This is received by GroupRequest.Callback. + tracking system. This is received by GroupRequest.Callback. */ - (BOOL)joinGroup:(long)trackedGroupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1154,8 +1180,25 @@ Parameters: This can be pulled from a marshalled GroupReport. */ - (BOOL)leaveGroup:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; -// skipped method GroupChat.MakeGroup with unsupported parameter or return types +/** + * MakeGroup creates a new Group and sends a group request to all members in the +group. + +Parameters: + - membershipBytes - the JSON marshalled list of []*id.ID; it contains the + IDs of members the user wants to add to the group. + - message - the initial message sent to all members in the group. This is an + optional parameter and may be nil. + - tag - the name of the group decided by the creator. This is an optional + parameter and may be nil. If nil the group will be assigned the default + name. +Returns: + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. + */ +- (NSData* _Nullable)makeGroup:(NSData* _Nullable)membershipBytes message:(NSData* _Nullable)message name:(NSData* _Nullable)name error:(NSError* _Nullable* _Nullable)error; /** * NumGroups returns the number of groups the user is a part of. */ @@ -1168,7 +1211,9 @@ Parameters: This can be found in the report returned by GroupChat.MakeGroup. Returns: - - []byte - a JSON-marshalled GroupReport. + - []byte - the JSON marshalled bytes of the GroupReport object, which can be + passed into WaitForRoundResult to see if the group request message send + succeeded. */ - (NSData* _Nullable)resendRequest:(NSData* _Nullable)groupId error:(NSError* _Nullable* _Nullable)error; /** @@ -1181,7 +1226,9 @@ Parameters: - tag - the tag associated with the message. This tag may be empty. Returns: - - []byte - a JSON marshalled GroupSendReport. + - []byte - the JSON marshalled bytes of the GroupSendReport object, which + can be passed into WaitForRoundResult to see if the group message send + succeeded. */ - (NSData* _Nullable)send:(NSData* _Nullable)groupId message:(NSData* _Nullable)message tag:(NSString* _Nullable)tag error:(NSError* _Nullable* _Nullable)error; @end @@ -1198,9 +1245,10 @@ status of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; @property (nonatomic) NSData* _Nullable id_; -// skipped field GroupReport.Rounds with unsupported type: []int +// skipped field GroupReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) long status; +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1213,23 +1261,11 @@ round ID sent on and the timestamp of the send operation. - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field GroupSendReport.RoundID with unsupported type: uint64 +// skipped field GroupSendReport.RoundsList with unsupported type: gitlab.com/elixxir/client/bindings.RoundsList @property (nonatomic) int64_t timestamp; @property (nonatomic) NSData* _Nullable messageID; -@end - -/** - * IdList is a wrapper for a list of marshalled id.ID objects. - */ -@interface BindingsIdList : NSObject <goSeqRefInterface> { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field IdList.Ids with unsupported type: [][]byte - +- (NSData* _Nullable)marshal:(NSError* _Nullable* _Nullable)error; @end /** @@ -1393,7 +1429,7 @@ Example marshalled roundList object: - (nonnull instancetype)initWithRef:(_Nonnull id)ref; - (nonnull instancetype)init; -// skipped field RoundsList.Rounds with unsupported type: []int +// skipped field RoundsList.Rounds with unsupported type: []uint64 /** * Marshal JSON marshals the RoundsList. @@ -1802,14 +1838,15 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsLookupUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdLookupCallback> _Nullable cb, NSData* _Nullable lookupId, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); /** * NewBroadcastChannel creates a bindings-layer broadcast channel & starts listening for new messages -Params +Parameters: - cmixId - internal ID of cmix - channelDefinition - JSON marshalled ChannelDef object */ @@ -1942,7 +1979,8 @@ Parameters: - singleRequestParams - the JSON marshalled bytes of single.RequestParams Returns: - - []byte - the JSON marshalled bytes of SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsSearchUD(long e2eID, NSData* _Nullable udContact, id<BindingsUdSearchCallback> _Nullable cb, NSData* _Nullable factListJSON, NSData* _Nullable singleRequestParamsJSON, NSError* _Nullable* _Nullable error); @@ -1976,7 +2014,8 @@ Parameters: - responseCB - the callback that will be called when a response is received Returns: - - []byte - JSON marshalled SingleUseSendReport + - []byte - the JSON marshalled bytes of the SingleUseSendReport object, + which can be passed into WaitForRoundResult to see if the send succeeded. */ FOUNDATION_EXPORT NSData* _Nullable BindingsTransmitSingleUse(long e2eID, NSData* _Nullable recipient, NSString* _Nullable tag, NSData* _Nullable payload, NSData* _Nullable paramsJSON, id<BindingsSingleUseResponse> _Nullable responseCB, NSError* _Nullable* _Nullable error); @@ -2053,8 +2092,12 @@ FOUNDATION_EXPORT BOOL BindingsUpdateCommonErrors(NSString* _Nullable jsonFile, @end /** - * BroadcastListener is the public function type bindings can use to listen for broadcast messages. -It accepts the result of calling json.Marshal on a BroadcastMessage object. + * BroadcastListener is the public function type bindings can use to listen for +broadcast messages. + +Parameters: + - []byte - the JSON marshalled bytes of the BroadcastMessage object, which + can be passed into WaitForRoundResult to see if the broadcast succeeded. */ @interface BindingsBroadcastListener : NSObject <goSeqRefInterface, BindingsBroadcastListener> { } @@ -2267,7 +2310,9 @@ Parameters: received. Parameters: - - callbackReport - JSON marshalled SingleUseCallbackReport + - callbackReport - the JSON marshalled bytes of the SingleUseCallbackReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseCallback : NSObject <goSeqRefInterface, BindingsSingleUseCallback> { } @@ -2282,7 +2327,9 @@ Parameters: clients into TransmitSingleUse. Parameters: - - callbackReport - JSON marshalled SingleUseResponseReport + - callbackReport - the JSON marshalled bytes of the SingleUseResponseReport + object, which can be passed into WaitForRoundResult to see if the send + succeeded. */ @interface BindingsSingleUseResponse : NSObject <goSeqRefInterface, BindingsSingleUseResponse> { } diff --git a/Sources/ElixxirDAppsSDK/CMix/CMix.swift b/Sources/ElixxirDAppsSDK/CMix/CMix.swift index 5edb9fe00d25b62fd414c05a6b43c42325d86dd6..fe9e27b70c11aa952d9ca026155d01cc0ac988aa 100644 --- a/Sources/ElixxirDAppsSDK/CMix/CMix.swift +++ b/Sources/ElixxirDAppsSDK/CMix/CMix.swift @@ -14,7 +14,7 @@ public struct CMix { public var waitForNetwork: CMixWaitForNetwork public var registerClientErrorCallback: CMixRegisterClientErrorCallback public var addHealthCallback: CMixAddHealthCallback - public var waitForMessageDelivery: CMixWaitForMessageDelivery + public var waitForRoundResult: CMixWaitForRoundResult public var connect: CMixConnect } @@ -34,7 +34,7 @@ extension CMix { waitForNetwork: .live(bindingsCMix), registerClientErrorCallback: .live(bindingsCMix), addHealthCallback: .live(bindingsCMix), - waitForMessageDelivery: .live(bindingsCMix), + waitForRoundResult: .live(bindingsCMix), connect: .live(bindingsCMix) ) } @@ -55,7 +55,7 @@ extension CMix { waitForNetwork: .unimplemented, registerClientErrorCallback: .unimplemented, addHealthCallback: .unimplemented, - waitForMessageDelivery: .unimplemented, + waitForRoundResult: .unimplemented, connect: .unimplemented ) } diff --git a/Sources/ElixxirDAppsSDK/CMix/Functors/CMixWaitForMessageDelivery.swift b/Sources/ElixxirDAppsSDK/CMix/Functors/CMixWaitForMessageDelivery.swift deleted file mode 100644 index 7649a1da784a5fdb2b499ca53d7ae61ffb125c7c..0000000000000000000000000000000000000000 --- a/Sources/ElixxirDAppsSDK/CMix/Functors/CMixWaitForMessageDelivery.swift +++ /dev/null @@ -1,32 +0,0 @@ -import Bindings -import XCTestDynamicOverlay - -public struct CMixWaitForMessageDelivery { - public var run: (E2ESendReport, Int, MessageDeliveryCallback) throws -> Void - - public func callAsFunction( - report: E2ESendReport, - timeoutMS: Int, - callback: MessageDeliveryCallback - ) throws { - try run(report, timeoutMS, callback) - } -} - -extension CMixWaitForMessageDelivery { - public static func live(_ bindingsCMix: BindingsCmix) -> CMixWaitForMessageDelivery { - CMixWaitForMessageDelivery { report, timeoutMS, callback in - try bindingsCMix.wait( - forMessageDelivery: try report.encode(), - mdc: callback.makeBindingsMessageDeliveryCallback(), - timeoutMS: timeoutMS - ) - } - } -} - -extension CMixWaitForMessageDelivery { - public static let unimplemented = CMixWaitForMessageDelivery( - run: XCTUnimplemented("\(Self.self)") - ) -} diff --git a/Sources/ElixxirDAppsSDK/CMix/Functors/CMixWaitForRoundResult.swift b/Sources/ElixxirDAppsSDK/CMix/Functors/CMixWaitForRoundResult.swift new file mode 100644 index 0000000000000000000000000000000000000000..13ae2e7617349451be9ce64d2a51c1a34cab15fb --- /dev/null +++ b/Sources/ElixxirDAppsSDK/CMix/Functors/CMixWaitForRoundResult.swift @@ -0,0 +1,32 @@ +import Bindings +import XCTestDynamicOverlay + +public struct CMixWaitForRoundResult { + public var run: (Data, Int, MessageDeliveryCallback) throws -> Void + + public func callAsFunction( + roundList: Data, + timeoutMS: Int, + callback: MessageDeliveryCallback + ) throws { + try run(roundList, timeoutMS, callback) + } +} + +extension CMixWaitForRoundResult { + public static func live(_ bindingsCMix: BindingsCmix) -> CMixWaitForRoundResult { + CMixWaitForRoundResult { roundList, timeoutMS, callback in + try bindingsCMix.wait( + forRoundResult: roundList, + mdc: callback.makeBindingsMessageDeliveryCallback(), + timeoutMS: timeoutMS + ) + } + } +} + +extension CMixWaitForRoundResult { + public static let unimplemented = CMixWaitForRoundResult( + run: XCTUnimplemented("\(Self.self)") + ) +} diff --git a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift index ee9a3adf8b5f4cf6e745a9f103715663165279bd..9c7e895e541b9a3e713f27b1d5205b033d1b7ee3 100644 --- a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift +++ b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift @@ -2,16 +2,19 @@ import Bindings import XCTestDynamicOverlay public struct ChannelBroadcast { - public var run: (Data) throws -> Data + public var run: (Data) throws -> BroadcastReport - public func callAsFunction(_ payload: Data) throws -> Data { + public func callAsFunction(_ payload: Data) throws -> BroadcastReport { try run(payload) } } extension ChannelBroadcast { public static func live(_ bindingsChannel: BindingsChannel) -> ChannelBroadcast { - ChannelBroadcast(run: bindingsChannel.broadcast) + ChannelBroadcast { payload in + let reportData = try bindingsChannel.broadcast(payload) + return try BroadcastReport.decode(reportData) + } } } diff --git a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift index 9d92e00297cc99ce2b0b195180994cb0aa8666d0..b3b82e0186b552683e1f2c95d0866d7810d26847 100644 --- a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift +++ b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift @@ -2,19 +2,22 @@ import Bindings import XCTestDynamicOverlay public struct ChannelBroadcastAsymmetric { - public var run: (Data, Data) throws -> Data + public var run: (Data, Data) throws -> BroadcastReport public func callAsFunction( payload: Data, privateKey: Data - ) throws -> Data { + ) throws -> BroadcastReport { try run(payload, privateKey) } } extension ChannelBroadcastAsymmetric { public static func live(_ bindingsChannel: BindingsChannel) -> ChannelBroadcastAsymmetric { - ChannelBroadcastAsymmetric(run: bindingsChannel.broadcastAsymmetric(_:pk:)) + ChannelBroadcastAsymmetric { payload, privateKey in + let reportData = try bindingsChannel.broadcastAsymmetric(payload, pk: privateKey) + return try BroadcastReport.decode(reportData) + } } } diff --git a/Sources/ElixxirDAppsSDK/E2E/Functors/E2EGetAllPartnerIds.swift b/Sources/ElixxirDAppsSDK/E2E/Functors/E2EGetAllPartnerIds.swift index f4375932eaf69d4b95f3d78886da972e21878a0b..ccffadaabe56a362a1da5a914772590abee24d9f 100644 --- a/Sources/ElixxirDAppsSDK/E2E/Functors/E2EGetAllPartnerIds.swift +++ b/Sources/ElixxirDAppsSDK/E2E/Functors/E2EGetAllPartnerIds.swift @@ -2,16 +2,19 @@ import Bindings import XCTestDynamicOverlay public struct E2EGetAllPartnerIds { - public var run: () throws -> Data + public var run: () throws -> [Data] - public func callAsFunction() throws -> Data { + public func callAsFunction() throws -> [Data] { try run() } } extension E2EGetAllPartnerIds { public static func live(_ bindingsE2E: BindingsE2e) -> E2EGetAllPartnerIds { - E2EGetAllPartnerIds(run: bindingsE2E.getAllPartnerIDs) + E2EGetAllPartnerIds { + let listData = try bindingsE2E.getAllPartnerIDs() + return try JSONDecoder().decode([Data].self, from: listData) + } } } diff --git a/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift b/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift index 16f6d1bc6e923e9eccb725e9e0f97d597c27b13a..8f2540a1a7a1072e88a29387bf25e0f55c9e7972 100644 --- a/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift +++ b/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift @@ -2,21 +2,29 @@ import Bindings import XCTestDynamicOverlay public struct E2ESend { - public var run: (Int, Data, Data, Data) throws -> Data + public var run: (Int, Data, Data, Data) throws -> E2ESendReport public func callAsFunction( messageType: Int, recipientId: Data, payload: Data, e2eParams: Data - ) throws -> Data { + ) throws -> E2ESendReport { try run(messageType, recipientId, payload, e2eParams) } } extension E2ESend { public static func live(_ bindingsE2E: BindingsE2e) -> E2ESend { - E2ESend(run: bindingsE2E.sendE2E(_:recipientId:payload:e2eParams:)) + E2ESend { messageType, recipientId, payload, e2eParams in + let reportData = try bindingsE2E.sendE2E( + messageType, + recipientId: recipientId, + payload: payload, + e2eParams: e2eParams + ) + return try E2ESendReport.decode(reportData) + } } } diff --git a/Sources/ElixxirDAppsSDK/GroupChat/Functors/GroupChatMakeGroup.swift b/Sources/ElixxirDAppsSDK/GroupChat/Functors/GroupChatMakeGroup.swift new file mode 100644 index 0000000000000000000000000000000000000000..04a57502665e567b8038cf07bb909f2596e2f34f --- /dev/null +++ b/Sources/ElixxirDAppsSDK/GroupChat/Functors/GroupChatMakeGroup.swift @@ -0,0 +1,33 @@ +import Bindings +import XCTestDynamicOverlay + +public struct GroupChatMakeGroup { + public var run: ([Data], Data?, Data?) throws -> GroupReport + + public func callAsFunction( + membership: [Data], + message: Data?, + name: Data? + ) throws -> GroupReport { + try run(membership, message, name) + } +} + +extension GroupChatMakeGroup { + public static func live(_ bindingsGroupChat: BindingsGroupChat) -> GroupChatMakeGroup { + GroupChatMakeGroup { membership, message, name in + let reportData = try bindingsGroupChat.makeGroup( + try JSONEncoder().encode(membership), + message: message, + name: name + ) + return try GroupReport.decode(reportData) + } + } +} + +extension GroupChatMakeGroup { + public static let unimplemented = GroupChatMakeGroup( + run: XCTUnimplemented("\(Self.self)") + ) +} diff --git a/Sources/ElixxirDAppsSDK/GroupChat/GroupChat.swift b/Sources/ElixxirDAppsSDK/GroupChat/GroupChat.swift index 10f24edf28af41e468c5e0573a9cb12c01ac960e..ef3167cefba5f72b8dd7b4ea7da92762f2413394 100644 --- a/Sources/ElixxirDAppsSDK/GroupChat/GroupChat.swift +++ b/Sources/ElixxirDAppsSDK/GroupChat/GroupChat.swift @@ -3,6 +3,7 @@ import Bindings public struct GroupChat { public var getGroup: GroupChatGetGroup public var getGroups: GroupChatGetGroups + public var makeGroup: GroupChatMakeGroup public var joinGroup: GroupChatJoinGroup public var leaveGroup: GroupChatLeaveGroup public var numGroups: GroupChatNumGroups @@ -15,6 +16,7 @@ extension GroupChat { GroupChat( getGroup: .live(bindingsGroupChat), getGroups: .live(bindingsGroupChat), + makeGroup: .live(bindingsGroupChat), joinGroup: .live(bindingsGroupChat), leaveGroup: .live(bindingsGroupChat), numGroups: .live(bindingsGroupChat), @@ -28,6 +30,7 @@ extension GroupChat { public static let unimplemented = GroupChat( getGroup: .unimplemented, getGroups: .unimplemented, + makeGroup: .unimplemented, joinGroup: .unimplemented, leaveGroup: .unimplemented, numGroups: .unimplemented, diff --git a/Sources/ElixxirDAppsSDK/Models/BackupReport.swift b/Sources/ElixxirDAppsSDK/Models/BackupReport.swift index bea36500f38262156de14598f27faea0e3c5e598..5b4056054143742a2c1f8c0e5862f0d09ca6635f 100644 --- a/Sources/ElixxirDAppsSDK/Models/BackupReport.swift +++ b/Sources/ElixxirDAppsSDK/Models/BackupReport.swift @@ -3,14 +3,14 @@ import Foundation public struct BackupReport: Equatable { public init( restoredContacts: [Data], - params: Data + params: String ) { self.restoredContacts = restoredContacts self.params = params } public var restoredContacts: [Data] - public var params: Data + public var params: String } extension BackupReport: Codable { diff --git a/Tests/ElixxirDAppsSDKTests/Models/BackupReportTests.swift b/Tests/ElixxirDAppsSDKTests/Models/BackupReportTests.swift index cd37b514e3954470e727981f80750a5eddadc112..5fb9912849c9309d7fd86cf79a3579a9027a93d0 100644 --- a/Tests/ElixxirDAppsSDKTests/Models/BackupReportTests.swift +++ b/Tests/ElixxirDAppsSDKTests/Models/BackupReportTests.swift @@ -4,24 +4,27 @@ import XCTest final class BackupReportTests: XCTestCase { func testCoding() throws { - let restoredContacts: [Data] = [ - "id1".data(using: .utf8)!, - "id2".data(using: .utf8)!, - "id3".data(using: .utf8)!, - ] - let paramsB64 = "cGFyYW1z" + let restoredContact1B64 = "U4x/lrFkvxuXu59LtHLon1sUhPJSCcnZND6SugndnVID" + let restoredContact2B64 = "15tNdkKbYXoMn58NO6VbDMDWFEyIhTWEGsvgcJsHWAgD" + let params = "test1234" let jsonString = """ { - "RestoredContacts": [\(restoredContacts.map { "\"\($0.base64EncodedString())\"" }.joined(separator: ", "))], - "Params": "\(paramsB64)" + "RestoredContacts": [ + "\(restoredContact1B64)", + "\(restoredContact2B64)" + ], + "Params": "\(params)" } """ let jsonData = jsonString.data(using: .utf8)! let model = try BackupReport.decode(jsonData) XCTAssertNoDifference(model, BackupReport( - restoredContacts: restoredContacts, - params: Data(base64Encoded: paramsB64)! + restoredContacts: [ + Data(base64Encoded: restoredContact1B64)!, + Data(base64Encoded: restoredContact2B64)!, + ], + params: params )) let encodedModel = try model.encode()