Commit c3c98463 authored by Sergei Zubov's avatar Sergei Zubov

Update estimate-tx and build-tx

parent 07b3c2ce
......@@ -100,7 +100,7 @@ app.on('window-all-closed', function () {
}
})
.then(response => app.quit())
.catch(error => setTimeout(() => app.quit(), 5000));
.catch(error => setTimeout(() => app.quit(), 5000));
}
});
......@@ -123,7 +123,7 @@ function startDeStreamApi() {
} else if(os.platform() === 'linux') {
apiPath = path.resolve(__dirname, '..//..//resources//daemon//DeStream.BreezeD');
} else {
apiPath = path.resolve(__dirname, '..//..//resources//daemon//DeStream.BreezeD');
apiPath = path.resolve(__dirname, '..//..//resources//daemon//DeStream.DeStreamD');
}
if (!testnet) {
......
import { OutpointRequest } from '../../shared/classes/transaction-building';
import { RecipientModel } from '../../shared/classes/transaction-building';
export class FeeEstimation {
constructor(walletName: string, accountName: string, destinationAddress: string, amount: string, feeType: string, allowUnconfirmed: boolean) {
constructor(walletName: string, accountName: string, outpoints: OutpointRequest[], recipients: RecipientModel[], feeType: string, allowUnconfirmed: boolean) {
this.walletName = walletName;
this.accountName = accountName;
this.destinationAddress = destinationAddress;
this.amount = amount;
this.outpoints = outpoints;
this.recipients = recipients;
this.feeType = feeType;
this.allowUnconfirmed = allowUnconfirmed;
}
walletName: string;
accountName: string;
destinationAddress: string;
amount: string;
feeType: string;
allowUnconfirmed: boolean;
outpoints: OutpointRequest[];
recipients: RecipientModel[];
}
\ No newline at end of file
export class TransactionBuilding {
constructor(walletName: string, accountName: string, password: string, destinationAddress: string, amount: string, feeType: string, allowUnconfirmed: boolean) {
constructor(walletName: string, accountName: string, password: string, outpoints: OutpointRequest[], recipients: RecipientModel[], feeType: string, allowUnconfirmed: boolean) {
this.walletName = walletName;
this.accountName = accountName;
this.password = password;
this.destinationAddress = destinationAddress;
this.amount = amount;
this.outpoints = outpoints;
this.recipients = recipients;
this.feeType = feeType;
this.allowUnconfirmed = allowUnconfirmed;
}
......@@ -13,8 +13,30 @@ export class TransactionBuilding {
walletName: string;
accountName: string;
password: string;
destinationAddress: string;
amount: string;
feeType: string;
allowUnconfirmed: boolean;
outpoints: OutpointRequest[];
recipients: RecipientModel[];
}
export class OutpointRequest {
constructor(transactionId: string, index: number) {
this.transactionId = transactionId;
this.index = index;
}
transactionId: string;
index: number;
}
export class RecipientModel {
constructor(destinationAddress: string, amount: string) {
this.destinationAddress = destinationAddress;
this.amount = amount;
}
destinationAddress: string;
amount: string;
}
......@@ -15,7 +15,7 @@ import { WalletLoad } from '../classes/wallet-load';
import { WalletInfo } from '../classes/wallet-info';
import { Mnemonic } from '../classes/mnemonic';
import { FeeEstimation } from '../classes/fee-estimation';
import { TransactionBuilding } from '../classes/transaction-building';
import {RecipientModel, TransactionBuilding} from '../classes/transaction-building';
import { TransactionSending } from '../classes/transaction-sending';
/**
......@@ -199,8 +199,8 @@ export class ApiService {
let params: URLSearchParams = new URLSearchParams();
params.set('walletName', data.walletName);
params.set('accountName', data.accountName);
params.set('destinationAddress', data.destinationAddress);
params.set('amount', data.amount);
params.set('recipients[0].destinationAddress', data.recipients[0].destinationAddress);
params.set('recipients[0].amount', data.recipients[0].amount);
params.set('feeType', data.feeType);
params.set('allowUnconfirmed', "true");
......
......@@ -10,6 +10,8 @@ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { FeeEstimation } from '../../shared/classes/fee-estimation';
import { TransactionBuilding } from '../../shared/classes/transaction-building';
import { OutpointRequest } from '../../shared/classes/transaction-building';
import { RecipientModel } from '../../shared/classes/transaction-building';
import { TransactionSending } from '../../shared/classes/transaction-sending';
import { SendConfirmationComponent } from './send-confirmation/send-confirmation.component';
......@@ -141,8 +143,8 @@ export class SendComponent implements OnInit {
let transaction = new FeeEstimation(
this.globalService.getWalletName(),
"account 0",
this.sendForm.get("address").value.trim(),
this.sendForm.get("amount").value,
[],
new Array<RecipientModel>(new RecipientModel(this.sendForm.get("address").value.trim(), this.sendForm.get("amount").value)),
this.sendForm.get("fee").value,
true
);
......@@ -180,8 +182,8 @@ export class SendComponent implements OnInit {
this.globalService.getWalletName(),
"account 0",
this.sendForm.get("password").value,
this.sendForm.get("address").value.trim(),
this.sendForm.get("amount").value,
[],
new Array<RecipientModel>(new RecipientModel(this.sendForm.get("address").value.trim(), this.sendForm.get("amount").value)),
this.sendForm.get("fee").value,
true
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment