diff --git a/ios/IndySdk.swift b/ios/IndySdk.swift index f0d2ab5..d680ace 100644 --- a/ios/IndySdk.swift +++ b/ios/IndySdk.swift @@ -208,7 +208,7 @@ class IndySdk : NSObject { IndyCrypto.verifySignature(signatureData, forMessage: messageData, key: signerVk, completion: completionWithBool(resolve, reject)) } - @objc func packMessage(_ wh: NSNumber, message: Array, receiverKeys: String, senderVk: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { + @objc func packMessage(_ wh: NSNumber, message: Array, receiverKeys: String, senderVk: String?, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void { let whNumber = Int32(truncating: wh) let messageData = Data(message) IndyCrypto.packMessage(messageData, receivers: receiverKeys, sender: senderVk, walletHandle: whNumber, completion: completionWithData(resolve, reject)) diff --git a/src/index.js b/src/index.js index 53574c3..a80ac77 100644 --- a/src/index.js +++ b/src/index.js @@ -413,7 +413,12 @@ const indy = { return IndySdk.cryptoVerify(signerVk, Array.from(message), Array.from(signature)) }, - async packMessage(wh: WalletHandle, message: Buffer, receiverKeys: Verkey[], senderVk: string): Promise { + async packMessage( + wh: WalletHandle, + message: Buffer, + receiverKeys: Verkey[], + senderVk: string | null + ): Promise { if (Platform.OS == 'ios') { return Buffer.from(await IndySdk.packMessage(wh, Array.from(message), JSON.stringify(receiverKeys), senderVk)) }