This is .Net API for interact with Tinkoff Invest OpenApi. Please, write your questions and suggestions to issues.
Library uses GRPC to interact with Tinkoff API.
At first, register grpc client in ServiceProvider, you can use overloads of AddInvestApiClient
:
services.AddInvestApiClient(configuration);
If you are using method with IConfiguration
add InvestApiOptions
section to configuration file:
"InvestApiOptions":
{
"AccessToken": "_TOKEN_",
"ApplicationName": "_YOUR_APP_NAME_"
}
Then register required services, using one or many methods (All registered here):
services.AddUsersService()
.AddOperationsService()
.AddInstrumentsService()
.AddOrdersService()
.AddMarketDataStreamService();
- IUsersService - Information about user (accounts).
- IInstrumentsService - Information about instruments.
- IOrdersService - Post/Cancel/Get information about order.
- IOperationsService - Get information about operations.
- IMarketDataStreamService - Information about market in real time.
Check CONTRIBUTING.md.
If we return a task with GRPC result from a method, we may have RpcException at awaiting code.
This approach allows throwing unified ApiException
despite a little lack of performance.