RESPONSE: responsecode (`200` if success, `400`/`500` if error, see later)
```
{
success: "true"
"success": "true"
}
```
...
...
@@ -22,9 +22,9 @@ API should standardize that all `400` series errors come with consumable JSON er
BODY
```
{
"success": "false",
"message": "something bad happened", // ex.Message maybe?
"description": ex.ToString()
"success": "false",
"message": "something bad happened", // ex.Message maybe?
"description": ex.ToString()
}
```
...
...
@@ -37,9 +37,9 @@ This error message comes at all request if the wallet is not created yet, except
```
{
"success": "false",
"message": "wallet is not created",
"description": ""
"success": "false",
"message": "wallet is not created",
"description": ""
}
```
...
...
@@ -54,9 +54,9 @@ This error message comes at all request if the wallet is not loaded yet, except
```
{
"success": "false",
"message": "wallet is not decrypted",
"description": ""
"success": "false",
"message": "wallet is not decrypted",
"description": ""
}
```
...
...
@@ -102,32 +102,32 @@ POST /wallet/send-transaction - Attempts to send a transaction
### Parameters
```
{
network : "network",
password : "password"
"network": "main", // "main" or "testnet"
"password": "password"
}
```
### Response
```
{
success : "true",
mnemonic : "foo bar buz",
"success": "true",
"mnemonic": "foo bar buz",
}
```
## POST /wallet/load - Loads the wallet and starts syncing
### Parameters
```
{
password : "password"
"password": "password"
}
```
## POST /wallet/recover - Recovers the wallet
### Parameters
```
{
network : "network",
password : "password",
mnemonic : "foo bar buz",
creationTime : "2017-02-03" // DateTimeOffset.ParseExact("1998-01-01", "yyyy-MM-dd", CultureInfo.InvariantCulture), utc time
"network": "main", // "main" or "testnet"
"password": "password",
"mnemonic": "foo bar buz",
"creationTime": "2017-02-03" // DateTimeOffset.ParseExact("1998-01-01", "yyyy-MM-dd", CultureInfo.InvariantCulture), utc time
}
```
### Response
...
...
@@ -143,11 +143,82 @@ Works as expected.
## GET /wallet/history/[account1/account2] - Displays the history of the specified wallet account
## GET /wallet/balance/[account1/account2] - Displays the balances of the specified wallet account
## POST /wallet/build-transaction/[account1/account2] - Attempts to build a transaction with the specified wallet account
### Parameters
```
{
"address": "1Xyz...",
"amount": "0.12", // in btc, if 0, then spends all available
"feeType": "low", // "low"/"medium"/"high"
"allowUnconfirmed": "true" // if spending unconfirmed outputs is allowed
}
```
### Responses
### Successful
```
{
"success": "true",
"spendsUnconfirmed": "false", // If spends unconfirmed you can ask the user if it's sure about spending unconfirmed transaction (if inputs are malleated or inputs never confirm then this transaction will never confirm either"
"fee": "0.0001",
"feePercentOfSent": "0.1" // Percentage of the total spent amount, there must be a safety limit implemented here