Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
b08ea8bc
Commit
b08ea8bc
authored
Apr 04, 2017
by
Jeremy Bokobza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some comments to the controller methods
parent
79f14616
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
5 deletions
+70
-5
Breeze.Api.csproj
Breeze/src/Breeze.Api/Breeze.Api.csproj
+5
-1
NodeController.cs
Breeze/src/Breeze.Api/Controllers/NodeController.cs
+10
-0
Startup.cs
Breeze/src/Breeze.Api/Startup.cs
+11
-2
Breeze.Wallet.csproj
Breeze/src/Breeze.Wallet/Breeze.Wallet.csproj
+4
-0
WalletController.cs
Breeze/src/Breeze.Wallet/Controllers/WalletController.cs
+40
-2
No files found.
Breeze/src/Breeze.Api/Breeze.Api.csproj
View file @
b08ea8bc
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
...
...
@@ -11,6 +11,10 @@
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>..\\Breeze.Deamon\\bin\\Debug\\netcoreapp1.0\\Breeze.Api.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="1.0.3" />
...
...
Breeze/src/Breeze.Api/Controllers/NodeController.cs
View file @
b08ea8bc
...
...
@@ -15,6 +15,10 @@ namespace Breeze.Api.Controllers
this
.
blockNotification
=
blockNotification
;
}
/// <summary>
/// Returns some general information about the status of the underlying node.
/// </summary>
/// <returns></returns>
[
HttpGet
]
[
Route
(
"status"
)]
public
IActionResult
Status
()
...
...
@@ -22,6 +26,12 @@ namespace Breeze.Api.Controllers
return
this
.
NotFound
();
}
/// <summary>
/// Starts sending block to the wallet for synchronisation.
/// This is for demo and testing use only.
/// </summary>
/// <param name="model">The hash of the block from which to start syncing.</param>
/// <returns></returns>
[
HttpPost
]
[
Route
(
"sync"
)]
public
IActionResult
Sync
([
FromBody
]
HashModel
model
)
...
...
Breeze/src/Breeze.Api/Startup.cs
View file @
b08ea8bc
using
System.Linq
;
using
System.IO
;
using
System.Linq
;
using
Microsoft.AspNetCore.Builder
;
using
Microsoft.AspNetCore.Hosting
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.Extensions.Configuration
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.PlatformAbstractions
;
using
Swashbuckle.AspNetCore.Swagger
;
namespace
Breeze.Api
...
...
@@ -55,7 +57,14 @@ namespace Breeze.Api
return
true
;
});
});
//Set the comments path for the swagger json and ui.
var
basePath
=
PlatformServices
.
Default
.
Application
.
ApplicationBasePath
;
var
apiXmlPath
=
Path
.
Combine
(
basePath
,
"Breeze.Api.xml"
);
var
walletXmlPath
=
Path
.
Combine
(
basePath
,
"Breeze.Wallet.xml"
);
setup
.
IncludeXmlComments
(
apiXmlPath
);
setup
.
IncludeXmlComments
(
walletXmlPath
);
});
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
...
...
Breeze/src/Breeze.Wallet/Breeze.Wallet.csproj
View file @
b08ea8bc
...
...
@@ -11,6 +11,10 @@
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>..\\Breeze.Deamon\\bin\\Debug\\netcoreapp1.0\\Breeze.Wallet.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HBitcoin" Version="0.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="1.0.3" />
...
...
Breeze/src/Breeze.Wallet/Controllers/WalletController.cs
View file @
b08ea8bc
...
...
@@ -11,6 +11,9 @@ using Breeze.Wallet.Wrappers;
namespace
Breeze.Wallet.Controllers
{
/// <summary>
/// Controller providing operations on a wallet.
/// </summary>
[
Route
(
"api/v{version:apiVersion}/[controller]"
)]
public
class
WalletController
:
Controller
{
...
...
@@ -49,6 +52,11 @@ namespace Breeze.Wallet.Controllers
}
}
/// <summary>
/// Loads a wallet previously created by the user.
/// </summary>
/// <param name="walletLoad">The name of the wallet to load.</param>
/// <returns></returns>
[
Route
(
"load"
)]
[
HttpPost
]
public
IActionResult
Load
([
FromBody
]
WalletLoadRequest
walletLoad
)
...
...
@@ -81,6 +89,11 @@ namespace Breeze.Wallet.Controllers
}
}
/// <summary>
/// Recovers a wallet.
/// </summary>
/// <param name="walletRecovery">The object containing the parameters used to recover a wallet.</param>
/// <returns></returns>
[
Route
(
"recover"
)]
[
HttpPost
]
public
IActionResult
Recover
([
FromBody
]
WalletRecoveryRequest
walletRecovery
)
...
...
@@ -113,8 +126,13 @@ namespace Breeze.Wallet.Controllers
return
ErrorHelpers
.
BuildErrorResponse
(
HttpStatusCode
.
BadRequest
,
e
.
Message
,
e
.
ToString
());
}
}
[
Route
(
"info"
)]
/// <summary>
/// Get some general info about a wallet.
/// </summary>
/// <param name="model">The name of the wallet.</param>
/// <returns></returns>
[
Route
(
"info"
)]
[
HttpGet
]
public
IActionResult
GetInfo
([
FromQuery
]
WalletName
model
)
{
...
...
@@ -136,6 +154,11 @@ namespace Breeze.Wallet.Controllers
}
}
/// <summary>
/// Retrieves the history of a wallet.
/// </summary>
/// <param name="model">The name of the wallet.</param>
/// <returns></returns>
[
Route
(
"history"
)]
[
HttpGet
]
public
IActionResult
GetHistory
([
FromQuery
]
WalletName
model
)
...
...
@@ -158,6 +181,11 @@ namespace Breeze.Wallet.Controllers
}
}
/// <summary>
/// Gets the balance of a wallet.
/// </summary>
/// <param name="model">The name of the wallet.</param>
/// <returns></returns>
[
Route
(
"balance"
)]
[
HttpGet
]
public
IActionResult
GetBalance
([
FromQuery
]
WalletName
model
)
...
...
@@ -180,6 +208,11 @@ namespace Breeze.Wallet.Controllers
}
}
/// <summary>
/// Builds a transaction.
/// </summary>
/// <param name="request">The transaction parameters.</param>
/// <returns>All the details of the transaction, including the hex used to execute it.</returns>
[
Route
(
"build-transaction"
)]
[
HttpPost
]
public
IActionResult
BuildTransaction
([
FromBody
]
BuildTransactionRequest
request
)
...
...
@@ -202,6 +235,11 @@ namespace Breeze.Wallet.Controllers
}
}
/// <summary>
/// Sends a transaction.
/// </summary>
/// <param name="request">The hex representing the transaction.</param>
/// <returns></returns>
[
Route
(
"send-transaction"
)]
[
HttpPost
]
public
IActionResult
SendTransaction
([
FromBody
]
SendTransactionRequest
request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment