Ejemplo n.º 1
0
        static void BuildMintRequestCallbackMethod(int xcommand_handle, int err, string mint_req_json, string payment_method)
        {
            var taskCompletionSource = PendingCommands.Remove <PaymentResult>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(new PaymentResult(mint_req_json, payment_method));
        }
Ejemplo n.º 2
0
        static void BuildGetTxnFeesReqCallbackMethod(int xcommand_handle, int err, string get_txn_fees_json)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(get_txn_fees_json);
        }
Ejemplo n.º 3
0
        private static void GenerateWalletKeyCallbackMethod(int xcommand_handle, int err, string key)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(key);
        }
Ejemplo n.º 4
0
        private static void ListMyDidsWithMetaCompletedCallback(int xcommand_handle, int err, string dids)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(dids);
        }
Ejemplo n.º 5
0
        private static void GetPairwiseCallback(int xcommand_handle, int err, string get_pairwise_json)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(get_pairwise_json);
        }
Ejemplo n.º 6
0
        private static void OpenWalletCallbackMethod(int xcommand_handle, int err, int wallet_handle)
        {
            var taskCompletionSource = PendingCommands.Remove <Wallet>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(new Wallet(wallet_handle));
        }
Ejemplo n.º 7
0
        private static void ParseResponseCallbackMethod(int xcommand_handle, int err, string id, string object_json)
        {
            var taskCompletionSource = PendingCommands.Remove <ParseResponseResult>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(new ParseResponseResult(id, object_json));
        }
Ejemplo n.º 8
0
        private static void IsPairwiseExistsCallback(int xcommand_handle, int err, bool exists)
        {
            var taskCompletionSource = PendingCommands.Remove <bool>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(exists);
        }
Ejemplo n.º 9
0
        private static void BuildRequestCallbackMethod(int xcommand_handle, int err, string request_json)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(request_json);
        }
Ejemplo n.º 10
0
        private static void KeyForLocalDidCompletedCallback(int xcommand_handle, int err, string key)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(key);
        }
Ejemplo n.º 11
0
        private static void ReplaceKeysCallback(int xcommand_handle, int err, string verkey)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(verkey);
        }
Ejemplo n.º 12
0
        static void CreatePaymentAddressCallbackMethod(int xcommand_handle, int err, string payment_address)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(payment_address);
        }
Ejemplo n.º 13
0
        static void ParsePaymentResponseCallbackMethod(int xcommand_handle, int err, string utxo_json)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(utxo_json);
        }
Ejemplo n.º 14
0
        private static void GetDidMetadataCompletedCallback(int xcommand_handle, int err, string metadata)
        {
            var taskCompletionSource = PendingCommands.Remove <string>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            taskCompletionSource.SetResult(metadata);
        }
Ejemplo n.º 15
0
        private static void CreateAndStoreMyDidCallbackMethod(int xcommand_handle, int err, string did, string verkey)
        {
            var taskCompletionSource = PendingCommands.Remove <CreateAndStoreMyDidResult>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var callbackResult = new CreateAndStoreMyDidResult(did, verkey);

            taskCompletionSource.SetResult(callbackResult);
        }
Ejemplo n.º 16
0
        private static void GetEndpointForDidCompletedCallbackMethod(int xcommand_handle, int err, string endpoint, string transport_vk)
        {
            var taskCompletionSource = PendingCommands.Remove <EndpointForDidResult>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var result = new EndpointForDidResult(endpoint, transport_vk);

            taskCompletionSource.SetResult(result);
        }
Ejemplo n.º 17
0
        private static void CryptoSignCompletedCallbackMethod(int xcommand_handle, int err, IntPtr signature_raw, int signature_len)
        {
            var taskCompletionSource = PendingCommands.Remove <byte[]>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var signatureBytes = new byte[signature_len];

            Marshal.Copy(signature_raw, signatureBytes, 0, signature_len);

            taskCompletionSource.SetResult(signatureBytes);
        }
Ejemplo n.º 18
0
        private static void UnpackMessageCompletedCallbackMethod(int command_handle, int err, IntPtr msg_data, int msg_len)
        {
            var taskCompletionSource = PendingCommands.Remove <byte[]>(command_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var decryptedMsgBytes = new byte[msg_len];

            Marshal.Copy(msg_data, decryptedMsgBytes, 0, msg_len);

            taskCompletionSource.SetResult(decryptedMsgBytes);
        }
Ejemplo n.º 19
0
        private static void CryptoEncryptCompletedCallbackMethod(int xcommand_handle, int err, IntPtr encrypted_msg, int encrypted_len)
        {
            var taskCompletionSource = PendingCommands.Remove <byte[]>(xcommand_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var messageBytes = new byte[encrypted_len];

            Marshal.Copy(encrypted_msg, messageBytes, 0, encrypted_len);

            taskCompletionSource.SetResult(messageBytes);
        }
Ejemplo n.º 20
0
        private static void CryptoAuthDecryptCompletedCallbackMethod(int command_handle, int err, string their_vk, IntPtr msg_data, int msg_len)
        {
            var taskCompletionSource = PendingCommands.Remove <AuthDecryptResult>(command_handle);

            if (!CallbackHelper.CheckCallback(taskCompletionSource, err))
            {
                return;
            }

            var messageBytes = new byte[msg_len];

            Marshal.Copy(msg_data, messageBytes, 0, msg_len);

            var result = new AuthDecryptResult(their_vk, messageBytes);

            taskCompletionSource.SetResult(result);
        }