Commit e77df3ad authored by Jeremy Bokobza's avatar Jeremy Bokobza Committed by GitHub

Merge pull request #55 from bokobza/master

Added transactionId to the "build transaction" return message
parents 4bb45a35 d0019951
...@@ -297,7 +297,8 @@ Unconfirmed balance is the difference of unconfirmed incoming and outgoing trans ...@@ -297,7 +297,8 @@ Unconfirmed balance is the difference of unconfirmed incoming and outgoing trans
``` ```
{ {
"fee": "0.0001", "fee": "0.0001",
"hex": "0100000002d9dced2b6fc80c706d3564670cb6706afe7a798863a9218efcdcf415d58f0f82000000006a473044022030b8bea478444bd52f08de33b082cde1176d3137111f506eefefa91b47b1f6bf02204f12746abd1aeac5805872d163592cf145967fa0619339a9c5348d674852ef4801210224ec1e4c270ce373e6999eebfa01d0a7e7db3c537c026f265233350d5aab81fbfeffffffa0706db65c5e3594d43df5a2a8b6dfd3c9ee506b678f8c26f7820b324b26aa0f000000006a473044022061b718034f876590d6d80bac77a63248b2548d934849acd02c4f4236309e853002201aded6b24f553b6902cf571276b37b12f76b75650164d8738c74469b4edd547e012103d649294a0ca4db920a69eacd6a75cb8a38ae1b81129900621ce45e6ba3438a7bfeffffff0280a90300000000001976a914d0965947ebb329b776328624ebde8f8b32dc639788ac1cc80f00000000001976a914c2a420d34fc86cff932b8c3191549a0ddfd2b0d088acba770f00" "hex": "0100000002d9dced2b6fc80c706d3564670cb6706afe7a798863a9218efcdcf415d58f0f82000000006a473044022030b8bea478444bd52f08de33b082cde1176d3137111f506eefefa91b47b1f6bf02204f12746abd1aeac5805872d163592cf145967fa0619339a9c5348d674852ef4801210224ec1e4c270ce373e6999eebfa01d0a7e7db3c537c026f265233350d5aab81fbfeffffffa0706db65c5e3594d43df5a2a8b6dfd3c9ee506b678f8c26f7820b324b26aa0f000000006a473044022061b718034f876590d6d80bac77a63248b2548d934849acd02c4f4236309e853002201aded6b24f553b6902cf571276b37b12f76b75650164d8738c74469b4edd547e012103d649294a0ca4db920a69eacd6a75cb8a38ae1b81129900621ce45e6ba3438a7bfeffffff0280a90300000000001976a914d0965947ebb329b776328624ebde8f8b32dc639788ac1cc80f00000000001976a914c2a420d34fc86cff932b8c3191549a0ddfd2b0d088acba770f00",
"transactionId": "86f348bce07b04b2f7a00d882349e66d98765e935484516ce5fca97685566155"
} }
``` ```
......
...@@ -280,7 +280,8 @@ namespace Breeze.Wallet.Controllers ...@@ -280,7 +280,8 @@ namespace Breeze.Wallet.Controllers
var model = new WalletBuildTransactionModel var model = new WalletBuildTransactionModel
{ {
Hex = transactionResult.hex, Hex = transactionResult.hex,
Fee = transactionResult.fee Fee = transactionResult.fee,
TransactionId = transactionResult.transactionId
}; };
return this.Json(model); return this.Json(model);
} }
......
...@@ -135,7 +135,7 @@ namespace Breeze.Wallet ...@@ -135,7 +135,7 @@ namespace Breeze.Wallet
/// <param name="feeType">The type of fee to be included.</param> /// <param name="feeType">The type of fee to be included.</param>
/// <param name="allowUnconfirmed">Whether or not we allow this transaction to rely on unconfirmed outputs.</param> /// <param name="allowUnconfirmed">Whether or not we allow this transaction to rely on unconfirmed outputs.</param>
/// <returns></returns> /// <returns></returns>
(string hex, Money fee) BuildTransaction(string walletName, string accountName, CoinType coinType, string password, string destinationAddress, Money amount, string feeType, bool allowUnconfirmed); (string hex, uint256 transactionId, Money fee) BuildTransaction(string walletName, string accountName, CoinType coinType, string password, string destinationAddress, Money amount, string feeType, bool allowUnconfirmed);
/// <summary> /// <summary>
/// Sends a transaction to the network. /// Sends a transaction to the network.
......
...@@ -14,5 +14,8 @@ namespace Breeze.Wallet.Models ...@@ -14,5 +14,8 @@ namespace Breeze.Wallet.Models
[JsonProperty(PropertyName = "hex")] [JsonProperty(PropertyName = "hex")]
public string Hex { get; set; } public string Hex { get; set; }
[JsonProperty(PropertyName = "transactionId")]
public uint256 TransactionId { get; set; }
} }
} }
...@@ -325,7 +325,7 @@ namespace Breeze.Wallet ...@@ -325,7 +325,7 @@ namespace Breeze.Wallet
} }
/// <inheritdoc /> /// <inheritdoc />
public (string hex, Money fee) BuildTransaction(string walletName, string accountName, CoinType coinType, string password, string destinationAddress, Money amount, string feeType, bool allowUnconfirmed) public (string hex, uint256 transactionId, Money fee) BuildTransaction(string walletName, string accountName, CoinType coinType, string password, string destinationAddress, Money amount, string feeType, bool allowUnconfirmed)
{ {
if (amount == Money.Zero) if (amount == Money.Zero)
{ {
...@@ -388,7 +388,7 @@ namespace Breeze.Wallet ...@@ -388,7 +388,7 @@ namespace Breeze.Wallet
throw new Exception("Could not build transaction, please make sure you entered the correct data."); throw new Exception("Could not build transaction, please make sure you entered the correct data.");
} }
return (tx.ToHex(), calculationResult.fee); return (tx.ToHex(), tx.GetHash(), calculationResult.fee);
} }
/// <summary> /// <summary>
......
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