Commit 51335f7e authored by dev0tion's avatar dev0tion

Add fee estimation call

parent eda831ee
export class FeeEstimation {
constructor(walletName: string, accountName: string, destinationAddress: string, amount: string, feeType: string, allowUnconfirmed: boolean) {
this.walletName = walletName;
this.accountName = accountName;
this.destinationAddress = destinationAddress;
this.amount = amount;
this.feeType = feeType;
this.allowUnconfirmed = allowUnconfirmed;
}
walletName: string;
accountName: string;
destinationAddress: string;
amount: string;
feeType: string;
allowUnconfirmed: boolean;
}
\ No newline at end of file
......@@ -14,6 +14,7 @@ import { WalletRecovery } from '../classes/wallet-recovery';
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 { TransactionSending } from '../classes/transaction-sending';
......@@ -227,6 +228,17 @@ export class ApiService {
.map((response: Response) => response);
}
/**
* Estimate the fee of a transaction
*/
estimateFee(data: FeeEstimation): Observable<any> {
this.getCurrentCoin();
return this.http
.post(this.currentApiUrl + '/wallet/estimate-txfee/', JSON.stringify(data), {headers: this.headers})
.map((response: Response) => response);
}
/**
* Build a transaction
*/
......
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