Пример #1
0
        public async Task <BaseTransactionResponse> Store(PublicKeyStoreDto publicKeyDto)
        {
            var storePayload     = GenarateStorePayload(publicKeyDto);
            var remmeTransaction = _remmeTransactionService.GetTransactionPayload(storePayload, 0);

            var nodeStoragePublicKey = (await _remmeTransactionService.GetNodeConfig()).StoragePublicKey;
            var pubKeyAddress        = REMChainUtils.GetAddressFromData(publicKeyDto.KeyPair.GetPublicKeyPem(), FAMILY_NAME);

            var inputsOutputs = _remmeTransactionService.GetDataInputOutput(pubKeyAddress);

            inputsOutputs.Add(REMChainUtils.GetSettingsAddressFromData("remme.economy_enabled"));
            inputsOutputs.Add(REMChainUtils.GetSettingsAddressFromData("remme.settings.storage_pub_key"));
            inputsOutputs.Add(REMChainUtils.GetAddressFromData(nodeStoragePublicKey, RemmeAccount.ACCOUNT_FAMILY_NAME));

            var transactionDto = _remmeTransactionService.GenerateTransactionDto(
                remmeTransaction,
                inputsOutputs,
                FAMILY_NAME,
                FAMILY_VERSION);

            var resultTrans = await _remmeTransactionService.CreateTransaction(transactionDto);

            return(await _remmeTransactionService.SendTransaction(resultTrans));
        }
Пример #2
0
        public async Task <BaseTransactionResponse> TransferByAddress(string addressTo, ulong amount)
        {
            var transferProto    = GenerateTransferPayload(addressTo, amount);
            var remmeTransaction = _remmeTransactionService.GetTransactionPayload(transferProto, 0);
            var inputsOutputs    = _remmeTransactionService.GetDataInputOutput(transferProto.AddressTo);
            var transactionDto   = _remmeTransactionService.GenerateTransactionDto(
                remmeTransaction,
                inputsOutputs,
                FAMILY_NAME,
                FAMILY_VERSION);

            var resultTrans = await _remmeTransactionService.CreateTransaction(transactionDto);

            return(await _remmeTransactionService.SendTransaction(resultTrans));
        }
        private async Task <BaseTransactionResponse> SendTransaction(IMessage message,
                                                                     string swapId,
                                                                     AtomicSwapMethodEnum method,
                                                                     string receiverAddress = "")
        {
            var remmeTransaction = _remmeTransactionService.GetTransactionPayload(message, (uint)method);
            var inputsOutputs    = GetInputsOutputs(swapId, method, receiverAddress);
            var transactionDto   = _remmeTransactionService.GenerateTransactionDto(
                remmeTransaction,
                inputsOutputs,
                FAMILY_NAME,
                FAMILY_VERSION);

            var resultTrans = await _remmeTransactionService.CreateTransaction(transactionDto);

            return(await _remmeTransactionService.SendTransaction(resultTrans));
        }