Commit 753d3eee authored by dev0tion's avatar dev0tion

Add transaction building and sending

parent 1cd49669
export class TransactionBuilding {
constructor(walletName: string, coinType: number, accountName: string, password: string, destinationAddress: string, amount: string, feeType: string, allowUnconfirmed: boolean) {
this.walletName = walletName;
this.coinType = coinType;
this.accountName = accountName;
this.password = password;
this.destinationAddress = destinationAddress;
this.amount = amount;
this.feeType = feeType;
this.allowUnconfirmed = allowUnconfirmed;
}
walletName: string;
coinType: number;
accountName: string;
password: string;
destinationAddress: string;
amount: string;
feeType: string;
allowUnconfirmed: boolean;
}
export class TransactionSending {
constructor(hex: string) {
this.hex = hex;
}
hex: string;
}
......@@ -9,6 +9,8 @@ import { WalletRecovery } from '../classes/wallet-recovery';
import { WalletLoad } from '../classes/wallet-load';
import { WalletInfo } from '../classes/wallet-info';
import { Mnemonic } from '../classes/mnemonic';
import { TransactionBuilding } from '../classes/transaction-building';
import { TransactionSending } from '../classes/transaction-sending';
/**
* For information on the API specification have a look at our Github:
......@@ -106,4 +108,16 @@ export class ApiService {
.get(this.webApiUrl + '/wallet/address', new RequestOptions({headers: this.headers, search: params}))
.map((response: Response) => response);
}
buildTransaction(data: TransactionBuilding): Observable<any> {
return this.http
.post(this.webApiUrl + '/wallet/build-transaction/', JSON.stringify(data), {headers: this.headers})
.map((response: Response) => response);
}
sendTransaction(data: TransactionSending): Observable<any> {
return this.http
.post(this.webApiUrl + '/wallet/send-transaction/', JSON.stringify(data), {headers: this.headers})
.map((response: Response) => response);
}
}
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