RESPONSE: responsecode (`200` if success, `400`/`500` if error, see later)
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
...
@@ -22,9 +22,9 @@ API should standardize that all `400` series errors come with consumable JSON er
BODY
BODY
```
```
{
{
"success": "false",
"success": "false",
"message": "something bad happened", // ex.Message maybe?
"message": "something bad happened", // ex.Message maybe?
"description": ex.ToString()
"description": ex.ToString()
}
}
```
```
...
@@ -37,9 +37,9 @@ This error message comes at all request if the wallet is not created yet, except
...
@@ -37,9 +37,9 @@ This error message comes at all request if the wallet is not created yet, except
```
```
{
{
"success": "false",
"success": "false",
"message": "wallet is not created",
"message": "wallet is not created",
"description": ""
"description": ""
}
}
```
```
...
@@ -54,9 +54,9 @@ This error message comes at all request if the wallet is not loaded yet, except
...
@@ -54,9 +54,9 @@ This error message comes at all request if the wallet is not loaded yet, except
```
```
{
{
"success": "false",
"success": "false",
"message": "wallet is not decrypted",
"message": "wallet is not decrypted",
"description": ""
"description": ""
}
}
```
```
...
@@ -102,32 +102,32 @@ POST /wallet/send-transaction - Attempts to send a transaction
...
@@ -102,32 +102,32 @@ POST /wallet/send-transaction - Attempts to send a transaction
### Parameters
### Parameters
```
```
{
{
network : "network",
"network": "main", // "main" or "testnet"
password : "password"
"password": "password"
}
}
```
```
### Response
### Response
```
```
{
{
success : "true",
"success": "true",
mnemonic : "foo bar buz",
"mnemonic": "foo bar buz",
}
}
```
```
## POST /wallet/load - Loads the wallet and starts syncing
## POST /wallet/load - Loads the wallet and starts syncing
### Parameters
### Parameters
```
```
{
{
password : "password"
"password": "password"
}
}
```
```
## POST /wallet/recover - Recovers the wallet
## POST /wallet/recover - Recovers the wallet
### Parameters
### Parameters
```
```
{
{
network : "network",
"network": "main", // "main" or "testnet"
password : "password",
"password": "password",
mnemonic : "foo bar buz",
"mnemonic": "foo bar buz",
creationTime : "2017-02-03" // DateTimeOffset.ParseExact("1998-01-01", "yyyy-MM-dd", CultureInfo.InvariantCulture), utc time
"creationTime": "2017-02-03" // DateTimeOffset.ParseExact("1998-01-01", "yyyy-MM-dd", CultureInfo.InvariantCulture), utc time
}
}
```
```
### Response
### Response
...
@@ -143,11 +143,82 @@ Works as expected.
...
@@ -143,11 +143,82 @@ Works as expected.
## GET /wallet/history/[account1/account2] - Displays the history of the specified wallet account
## 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
## 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
## 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