tinkoff_invest_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +169 -0
- data/Rakefile +10 -0
- data/docs/BrokerAccountType.md +15 -0
- data/docs/Candle.md +32 -0
- data/docs/CandleResolution.md +15 -0
- data/docs/Candles.md +22 -0
- data/docs/CandlesResponse.md +22 -0
- data/docs/Currencies.md +18 -0
- data/docs/Currency.md +15 -0
- data/docs/CurrencyPosition.md +22 -0
- data/docs/Empty.md +22 -0
- data/docs/Error.md +22 -0
- data/docs/ErrorPayload.md +20 -0
- data/docs/InstrumentType.md +15 -0
- data/docs/LimitOrderRequest.md +22 -0
- data/docs/LimitOrderResponse.md +22 -0
- data/docs/MarketApi.md +547 -0
- data/docs/MarketInstrument.md +34 -0
- data/docs/MarketInstrumentList.md +20 -0
- data/docs/MarketInstrumentListResponse.md +22 -0
- data/docs/MarketInstrumentResponse.md +22 -0
- data/docs/MarketOrderRequest.md +20 -0
- data/docs/MarketOrderResponse.md +22 -0
- data/docs/MoneyAmount.md +20 -0
- data/docs/Operation.md +44 -0
- data/docs/OperationStatus.md +15 -0
- data/docs/OperationTrade.md +24 -0
- data/docs/OperationType.md +15 -0
- data/docs/OperationTypeWithCommission.md +15 -0
- data/docs/Operations.md +18 -0
- data/docs/OperationsApi.md +83 -0
- data/docs/OperationsResponse.md +22 -0
- data/docs/Order.md +32 -0
- data/docs/OrderResponse.md +20 -0
- data/docs/OrderStatus.md +15 -0
- data/docs/OrderType.md +15 -0
- data/docs/Orderbook.md +38 -0
- data/docs/OrderbookResponse.md +22 -0
- data/docs/OrdersApi.md +297 -0
- data/docs/OrdersResponse.md +22 -0
- data/docs/PlacedLimitOrder.md +32 -0
- data/docs/PlacedMarketOrder.md +32 -0
- data/docs/Portfolio.md +18 -0
- data/docs/PortfolioApi.md +147 -0
- data/docs/PortfolioCurrenciesResponse.md +22 -0
- data/docs/PortfolioPosition.md +38 -0
- data/docs/PortfolioResponse.md +22 -0
- data/docs/SandboxAccount.md +20 -0
- data/docs/SandboxApi.md +367 -0
- data/docs/SandboxCurrency.md +15 -0
- data/docs/SandboxRegisterRequest.md +18 -0
- data/docs/SandboxRegisterResponse.md +22 -0
- data/docs/SandboxSetCurrencyBalanceRequest.md +20 -0
- data/docs/SandboxSetPositionBalanceRequest.md +20 -0
- data/docs/SearchMarketInstrument.md +32 -0
- data/docs/SearchMarketInstrumentResponse.md +22 -0
- data/docs/TradeStatus.md +15 -0
- data/docs/UserAccount.md +20 -0
- data/docs/UserAccounts.md +18 -0
- data/docs/UserAccountsResponse.md +22 -0
- data/docs/UserApi.md +72 -0
- data/generator_options.md +1 -0
- data/git_push.sh +58 -0
- data/lib/tinkoff_invest_client.rb +98 -0
- data/lib/tinkoff_invest_client/api/market_api.rb +518 -0
- data/lib/tinkoff_invest_client/api/operations_api.rb +97 -0
- data/lib/tinkoff_invest_client/api/orders_api.rb +291 -0
- data/lib/tinkoff_invest_client/api/portfolio_api.rb +138 -0
- data/lib/tinkoff_invest_client/api/sandbox_api.rb +335 -0
- data/lib/tinkoff_invest_client/api/user_api.rb +77 -0
- data/lib/tinkoff_invest_client/api_client.rb +390 -0
- data/lib/tinkoff_invest_client/api_error.rb +57 -0
- data/lib/tinkoff_invest_client/configuration.rb +281 -0
- data/lib/tinkoff_invest_client/models/broker_account_type.rb +37 -0
- data/lib/tinkoff_invest_client/models/candle.rb +322 -0
- data/lib/tinkoff_invest_client/models/candle_resolution.rb +46 -0
- data/lib/tinkoff_invest_client/models/candles.rb +253 -0
- data/lib/tinkoff_invest_client/models/candles_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/currencies.rb +225 -0
- data/lib/tinkoff_invest_client/models/currency.rb +44 -0
- data/lib/tinkoff_invest_client/models/currency_position.rb +246 -0
- data/lib/tinkoff_invest_client/models/empty.rb +253 -0
- data/lib/tinkoff_invest_client/models/error.rb +253 -0
- data/lib/tinkoff_invest_client/models/error_payload.rb +227 -0
- data/lib/tinkoff_invest_client/models/instrument_type.rb +39 -0
- data/lib/tinkoff_invest_client/models/limit_order_request.rb +251 -0
- data/lib/tinkoff_invest_client/models/limit_order_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/market_instrument.rb +317 -0
- data/lib/tinkoff_invest_client/models/market_instrument_list.rb +239 -0
- data/lib/tinkoff_invest_client/models/market_instrument_list_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/market_instrument_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/market_order_request.rb +237 -0
- data/lib/tinkoff_invest_client/models/market_order_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/money_amount.rb +237 -0
- data/lib/tinkoff_invest_client/models/operation.rb +370 -0
- data/lib/tinkoff_invest_client/models/operation_status.rb +38 -0
- data/lib/tinkoff_invest_client/models/operation_trade.rb +266 -0
- data/lib/tinkoff_invest_client/models/operation_type.rb +37 -0
- data/lib/tinkoff_invest_client/models/operation_type_with_commission.rb +56 -0
- data/lib/tinkoff_invest_client/models/operations.rb +225 -0
- data/lib/tinkoff_invest_client/models/operations_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/order.rb +321 -0
- data/lib/tinkoff_invest_client/models/order_response.rb +237 -0
- data/lib/tinkoff_invest_client/models/order_status.rb +44 -0
- data/lib/tinkoff_invest_client/models/order_type.rb +37 -0
- data/lib/tinkoff_invest_client/models/orderbook.rb +346 -0
- data/lib/tinkoff_invest_client/models/orderbook_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/orders_response.rb +255 -0
- data/lib/tinkoff_invest_client/models/placed_limit_order.rb +307 -0
- data/lib/tinkoff_invest_client/models/placed_market_order.rb +307 -0
- data/lib/tinkoff_invest_client/models/portfolio.rb +225 -0
- data/lib/tinkoff_invest_client/models/portfolio_currencies_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/portfolio_position.rb +333 -0
- data/lib/tinkoff_invest_client/models/portfolio_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/sandbox_account.rb +237 -0
- data/lib/tinkoff_invest_client/models/sandbox_currency.rb +44 -0
- data/lib/tinkoff_invest_client/models/sandbox_register_request.rb +218 -0
- data/lib/tinkoff_invest_client/models/sandbox_register_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/sandbox_set_currency_balance_request.rb +237 -0
- data/lib/tinkoff_invest_client/models/sandbox_set_position_balance_request.rb +232 -0
- data/lib/tinkoff_invest_client/models/search_market_instrument.rb +307 -0
- data/lib/tinkoff_invest_client/models/search_market_instrument_response.rb +253 -0
- data/lib/tinkoff_invest_client/models/trade_status.rb +37 -0
- data/lib/tinkoff_invest_client/models/user_account.rb +237 -0
- data/lib/tinkoff_invest_client/models/user_accounts.rb +225 -0
- data/lib/tinkoff_invest_client/models/user_accounts_response.rb +253 -0
- data/lib/tinkoff_invest_client/version.rb +15 -0
- data/spec/api/market_api_spec.rb +123 -0
- data/spec/api/operations_api_spec.rb +49 -0
- data/spec/api/orders_api_spec.rb +84 -0
- data/spec/api/portfolio_api_spec.rb +57 -0
- data/spec/api/sandbox_api_spec.rb +95 -0
- data/spec/api/user_api_spec.rb +45 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/broker_account_type_spec.rb +28 -0
- data/spec/models/candle_resolution_spec.rb +28 -0
- data/spec/models/candle_spec.rb +76 -0
- data/spec/models/candles_response_spec.rb +46 -0
- data/spec/models/candles_spec.rb +46 -0
- data/spec/models/currencies_spec.rb +34 -0
- data/spec/models/currency_position_spec.rb +46 -0
- data/spec/models/currency_spec.rb +28 -0
- data/spec/models/empty_spec.rb +46 -0
- data/spec/models/error_payload_spec.rb +40 -0
- data/spec/models/error_spec.rb +46 -0
- data/spec/models/instrument_type_spec.rb +28 -0
- data/spec/models/limit_order_request_spec.rb +46 -0
- data/spec/models/limit_order_response_spec.rb +46 -0
- data/spec/models/market_instrument_list_response_spec.rb +46 -0
- data/spec/models/market_instrument_list_spec.rb +40 -0
- data/spec/models/market_instrument_response_spec.rb +46 -0
- data/spec/models/market_instrument_spec.rb +82 -0
- data/spec/models/market_order_request_spec.rb +40 -0
- data/spec/models/market_order_response_spec.rb +46 -0
- data/spec/models/money_amount_spec.rb +40 -0
- data/spec/models/operation_spec.rb +112 -0
- data/spec/models/operation_status_spec.rb +28 -0
- data/spec/models/operation_trade_spec.rb +52 -0
- data/spec/models/operation_type_spec.rb +28 -0
- data/spec/models/operation_type_with_commission_spec.rb +28 -0
- data/spec/models/operations_response_spec.rb +46 -0
- data/spec/models/operations_spec.rb +34 -0
- data/spec/models/order_response_spec.rb +40 -0
- data/spec/models/order_spec.rb +76 -0
- data/spec/models/order_status_spec.rb +28 -0
- data/spec/models/order_type_spec.rb +28 -0
- data/spec/models/orderbook_response_spec.rb +46 -0
- data/spec/models/orderbook_spec.rb +94 -0
- data/spec/models/orders_response_spec.rb +46 -0
- data/spec/models/placed_limit_order_spec.rb +76 -0
- data/spec/models/placed_market_order_spec.rb +76 -0
- data/spec/models/portfolio_currencies_response_spec.rb +46 -0
- data/spec/models/portfolio_position_spec.rb +94 -0
- data/spec/models/portfolio_response_spec.rb +46 -0
- data/spec/models/portfolio_spec.rb +34 -0
- data/spec/models/sandbox_account_spec.rb +40 -0
- data/spec/models/sandbox_currency_spec.rb +28 -0
- data/spec/models/sandbox_register_request_spec.rb +34 -0
- data/spec/models/sandbox_register_response_spec.rb +46 -0
- data/spec/models/sandbox_set_currency_balance_request_spec.rb +40 -0
- data/spec/models/sandbox_set_position_balance_request_spec.rb +40 -0
- data/spec/models/search_market_instrument_response_spec.rb +46 -0
- data/spec/models/search_market_instrument_spec.rb +76 -0
- data/spec/models/trade_status_spec.rb +28 -0
- data/spec/models/user_account_spec.rb +40 -0
- data/spec/models/user_accounts_response_spec.rb +46 -0
- data/spec/models/user_accounts_spec.rb +34 -0
- data/spec/spec_helper.rb +111 -0
- data/tinkoff_invest_client.gemspec +38 -0
- metadata +336 -0
@@ -0,0 +1,20 @@
|
|
1
|
+
# TinkoffInvestClient::OrderResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **price** | **Float** | | |
|
8
|
+
| **quantity** | **Integer** | | |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'tinkoff_invest_client'
|
14
|
+
|
15
|
+
instance = TinkoffInvestClient::OrderResponse.new(
|
16
|
+
price: null,
|
17
|
+
quantity: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
data/docs/OrderStatus.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# TinkoffInvestClient::OrderStatus
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'tinkoff_invest_client'
|
12
|
+
|
13
|
+
instance = TinkoffInvestClient::OrderStatus.new()
|
14
|
+
```
|
15
|
+
|
data/docs/OrderType.md
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# TinkoffInvestClient::OrderType
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'tinkoff_invest_client'
|
12
|
+
|
13
|
+
instance = TinkoffInvestClient::OrderType.new()
|
14
|
+
```
|
15
|
+
|
data/docs/Orderbook.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# TinkoffInvestClient::Orderbook
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **figi** | **String** | | |
|
8
|
+
| **depth** | **Integer** | | |
|
9
|
+
| **bids** | [**Array<OrderResponse>**](OrderResponse.md) | | |
|
10
|
+
| **asks** | [**Array<OrderResponse>**](OrderResponse.md) | | |
|
11
|
+
| **trade_status** | [**TradeStatus**](TradeStatus.md) | | |
|
12
|
+
| **min_price_increment** | **Float** | Шаг цены | |
|
13
|
+
| **face_value** | **Float** | Номинал для облигаций | [optional] |
|
14
|
+
| **last_price** | **Float** | | [optional] |
|
15
|
+
| **close_price** | **Float** | | [optional] |
|
16
|
+
| **limit_up** | **Float** | Верхняя граница цены | [optional] |
|
17
|
+
| **limit_down** | **Float** | Нижняя граница цены | [optional] |
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'tinkoff_invest_client'
|
23
|
+
|
24
|
+
instance = TinkoffInvestClient::Orderbook.new(
|
25
|
+
figi: null,
|
26
|
+
depth: null,
|
27
|
+
bids: null,
|
28
|
+
asks: null,
|
29
|
+
trade_status: null,
|
30
|
+
min_price_increment: null,
|
31
|
+
face_value: null,
|
32
|
+
last_price: null,
|
33
|
+
close_price: null,
|
34
|
+
limit_up: null,
|
35
|
+
limit_down: null
|
36
|
+
)
|
37
|
+
```
|
38
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# TinkoffInvestClient::OrderbookResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **tracking_id** | **String** | | |
|
8
|
+
| **status** | **String** | | [default to 'Ok'] |
|
9
|
+
| **payload** | [**Orderbook**](Orderbook.md) | | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'tinkoff_invest_client'
|
15
|
+
|
16
|
+
instance = TinkoffInvestClient::OrderbookResponse.new(
|
17
|
+
tracking_id: null,
|
18
|
+
status: null,
|
19
|
+
payload: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
data/docs/OrdersApi.md
ADDED
@@ -0,0 +1,297 @@
|
|
1
|
+
# TinkoffInvestClient::OrdersApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://api-invest.tinkoff.ru/openapi*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**orders_cancel_post**](OrdersApi.md#orders_cancel_post) | **POST** /orders/cancel | Отмена заявки |
|
8
|
+
| [**orders_get**](OrdersApi.md#orders_get) | **GET** /orders | Получение списка активных заявок |
|
9
|
+
| [**orders_limit_order_post**](OrdersApi.md#orders_limit_order_post) | **POST** /orders/limit-order | Создание лимитной заявки |
|
10
|
+
| [**orders_market_order_post**](OrdersApi.md#orders_market_order_post) | **POST** /orders/market-order | Создание рыночной заявки |
|
11
|
+
|
12
|
+
|
13
|
+
## orders_cancel_post
|
14
|
+
|
15
|
+
> <Empty> orders_cancel_post(order_id, opts)
|
16
|
+
|
17
|
+
Отмена заявки
|
18
|
+
|
19
|
+
### Examples
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'time'
|
23
|
+
require 'tinkoff_invest_client'
|
24
|
+
# setup authorization
|
25
|
+
TinkoffInvestClient.configure do |config|
|
26
|
+
# Configure Bearer authorization: sso_auth
|
27
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
28
|
+
end
|
29
|
+
|
30
|
+
api_instance = TinkoffInvestClient::OrdersApi.new
|
31
|
+
order_id = 'order_id_example' # String | ID заявки
|
32
|
+
opts = {
|
33
|
+
broker_account_id: 'broker_account_id_example' # String | Номер счета (по умолчанию - Тинькофф)
|
34
|
+
}
|
35
|
+
|
36
|
+
begin
|
37
|
+
# Отмена заявки
|
38
|
+
result = api_instance.orders_cancel_post(order_id, opts)
|
39
|
+
p result
|
40
|
+
rescue TinkoffInvestClient::ApiError => e
|
41
|
+
puts "Error when calling OrdersApi->orders_cancel_post: #{e}"
|
42
|
+
end
|
43
|
+
```
|
44
|
+
|
45
|
+
#### Using the orders_cancel_post_with_http_info variant
|
46
|
+
|
47
|
+
This returns an Array which contains the response data, status code and headers.
|
48
|
+
|
49
|
+
> <Array(<Empty>, Integer, Hash)> orders_cancel_post_with_http_info(order_id, opts)
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
begin
|
53
|
+
# Отмена заявки
|
54
|
+
data, status_code, headers = api_instance.orders_cancel_post_with_http_info(order_id, opts)
|
55
|
+
p status_code # => 2xx
|
56
|
+
p headers # => { ... }
|
57
|
+
p data # => <Empty>
|
58
|
+
rescue TinkoffInvestClient::ApiError => e
|
59
|
+
puts "Error when calling OrdersApi->orders_cancel_post_with_http_info: #{e}"
|
60
|
+
end
|
61
|
+
```
|
62
|
+
|
63
|
+
### Parameters
|
64
|
+
|
65
|
+
| Name | Type | Description | Notes |
|
66
|
+
| ---- | ---- | ----------- | ----- |
|
67
|
+
| **order_id** | **String** | ID заявки | |
|
68
|
+
| **broker_account_id** | **String** | Номер счета (по умолчанию - Тинькофф) | [optional] |
|
69
|
+
|
70
|
+
### Return type
|
71
|
+
|
72
|
+
[**Empty**](Empty.md)
|
73
|
+
|
74
|
+
### Authorization
|
75
|
+
|
76
|
+
[sso_auth](../README.md#sso_auth)
|
77
|
+
|
78
|
+
### HTTP request headers
|
79
|
+
|
80
|
+
- **Content-Type**: Not defined
|
81
|
+
- **Accept**: application/json
|
82
|
+
|
83
|
+
|
84
|
+
## orders_get
|
85
|
+
|
86
|
+
> <OrdersResponse> orders_get(opts)
|
87
|
+
|
88
|
+
Получение списка активных заявок
|
89
|
+
|
90
|
+
### Examples
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
require 'time'
|
94
|
+
require 'tinkoff_invest_client'
|
95
|
+
# setup authorization
|
96
|
+
TinkoffInvestClient.configure do |config|
|
97
|
+
# Configure Bearer authorization: sso_auth
|
98
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
99
|
+
end
|
100
|
+
|
101
|
+
api_instance = TinkoffInvestClient::OrdersApi.new
|
102
|
+
opts = {
|
103
|
+
broker_account_id: 'broker_account_id_example' # String | Номер счета (по умолчанию - Тинькофф)
|
104
|
+
}
|
105
|
+
|
106
|
+
begin
|
107
|
+
# Получение списка активных заявок
|
108
|
+
result = api_instance.orders_get(opts)
|
109
|
+
p result
|
110
|
+
rescue TinkoffInvestClient::ApiError => e
|
111
|
+
puts "Error when calling OrdersApi->orders_get: #{e}"
|
112
|
+
end
|
113
|
+
```
|
114
|
+
|
115
|
+
#### Using the orders_get_with_http_info variant
|
116
|
+
|
117
|
+
This returns an Array which contains the response data, status code and headers.
|
118
|
+
|
119
|
+
> <Array(<OrdersResponse>, Integer, Hash)> orders_get_with_http_info(opts)
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
begin
|
123
|
+
# Получение списка активных заявок
|
124
|
+
data, status_code, headers = api_instance.orders_get_with_http_info(opts)
|
125
|
+
p status_code # => 2xx
|
126
|
+
p headers # => { ... }
|
127
|
+
p data # => <OrdersResponse>
|
128
|
+
rescue TinkoffInvestClient::ApiError => e
|
129
|
+
puts "Error when calling OrdersApi->orders_get_with_http_info: #{e}"
|
130
|
+
end
|
131
|
+
```
|
132
|
+
|
133
|
+
### Parameters
|
134
|
+
|
135
|
+
| Name | Type | Description | Notes |
|
136
|
+
| ---- | ---- | ----------- | ----- |
|
137
|
+
| **broker_account_id** | **String** | Номер счета (по умолчанию - Тинькофф) | [optional] |
|
138
|
+
|
139
|
+
### Return type
|
140
|
+
|
141
|
+
[**OrdersResponse**](OrdersResponse.md)
|
142
|
+
|
143
|
+
### Authorization
|
144
|
+
|
145
|
+
[sso_auth](../README.md#sso_auth)
|
146
|
+
|
147
|
+
### HTTP request headers
|
148
|
+
|
149
|
+
- **Content-Type**: Not defined
|
150
|
+
- **Accept**: application/json
|
151
|
+
|
152
|
+
|
153
|
+
## orders_limit_order_post
|
154
|
+
|
155
|
+
> <LimitOrderResponse> orders_limit_order_post(figi, limit_order_request, opts)
|
156
|
+
|
157
|
+
Создание лимитной заявки
|
158
|
+
|
159
|
+
### Examples
|
160
|
+
|
161
|
+
```ruby
|
162
|
+
require 'time'
|
163
|
+
require 'tinkoff_invest_client'
|
164
|
+
# setup authorization
|
165
|
+
TinkoffInvestClient.configure do |config|
|
166
|
+
# Configure Bearer authorization: sso_auth
|
167
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
168
|
+
end
|
169
|
+
|
170
|
+
api_instance = TinkoffInvestClient::OrdersApi.new
|
171
|
+
figi = 'figi_example' # String | FIGI инструмента
|
172
|
+
limit_order_request = TinkoffInvestClient::LimitOrderRequest.new({lots: 37, operation: TinkoffInvestClient::OperationType::BUY, price: 3.56}) # LimitOrderRequest |
|
173
|
+
opts = {
|
174
|
+
broker_account_id: 'broker_account_id_example' # String | Номер счета (по умолчанию - Тинькофф)
|
175
|
+
}
|
176
|
+
|
177
|
+
begin
|
178
|
+
# Создание лимитной заявки
|
179
|
+
result = api_instance.orders_limit_order_post(figi, limit_order_request, opts)
|
180
|
+
p result
|
181
|
+
rescue TinkoffInvestClient::ApiError => e
|
182
|
+
puts "Error when calling OrdersApi->orders_limit_order_post: #{e}"
|
183
|
+
end
|
184
|
+
```
|
185
|
+
|
186
|
+
#### Using the orders_limit_order_post_with_http_info variant
|
187
|
+
|
188
|
+
This returns an Array which contains the response data, status code and headers.
|
189
|
+
|
190
|
+
> <Array(<LimitOrderResponse>, Integer, Hash)> orders_limit_order_post_with_http_info(figi, limit_order_request, opts)
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
begin
|
194
|
+
# Создание лимитной заявки
|
195
|
+
data, status_code, headers = api_instance.orders_limit_order_post_with_http_info(figi, limit_order_request, opts)
|
196
|
+
p status_code # => 2xx
|
197
|
+
p headers # => { ... }
|
198
|
+
p data # => <LimitOrderResponse>
|
199
|
+
rescue TinkoffInvestClient::ApiError => e
|
200
|
+
puts "Error when calling OrdersApi->orders_limit_order_post_with_http_info: #{e}"
|
201
|
+
end
|
202
|
+
```
|
203
|
+
|
204
|
+
### Parameters
|
205
|
+
|
206
|
+
| Name | Type | Description | Notes |
|
207
|
+
| ---- | ---- | ----------- | ----- |
|
208
|
+
| **figi** | **String** | FIGI инструмента | |
|
209
|
+
| **limit_order_request** | [**LimitOrderRequest**](LimitOrderRequest.md) | | |
|
210
|
+
| **broker_account_id** | **String** | Номер счета (по умолчанию - Тинькофф) | [optional] |
|
211
|
+
|
212
|
+
### Return type
|
213
|
+
|
214
|
+
[**LimitOrderResponse**](LimitOrderResponse.md)
|
215
|
+
|
216
|
+
### Authorization
|
217
|
+
|
218
|
+
[sso_auth](../README.md#sso_auth)
|
219
|
+
|
220
|
+
### HTTP request headers
|
221
|
+
|
222
|
+
- **Content-Type**: application/json
|
223
|
+
- **Accept**: application/json
|
224
|
+
|
225
|
+
|
226
|
+
## orders_market_order_post
|
227
|
+
|
228
|
+
> <MarketOrderResponse> orders_market_order_post(figi, market_order_request, opts)
|
229
|
+
|
230
|
+
Создание рыночной заявки
|
231
|
+
|
232
|
+
### Examples
|
233
|
+
|
234
|
+
```ruby
|
235
|
+
require 'time'
|
236
|
+
require 'tinkoff_invest_client'
|
237
|
+
# setup authorization
|
238
|
+
TinkoffInvestClient.configure do |config|
|
239
|
+
# Configure Bearer authorization: sso_auth
|
240
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
241
|
+
end
|
242
|
+
|
243
|
+
api_instance = TinkoffInvestClient::OrdersApi.new
|
244
|
+
figi = 'figi_example' # String | FIGI инструмента
|
245
|
+
market_order_request = TinkoffInvestClient::MarketOrderRequest.new({lots: 37, operation: TinkoffInvestClient::OperationType::BUY}) # MarketOrderRequest |
|
246
|
+
opts = {
|
247
|
+
broker_account_id: 'broker_account_id_example' # String | Уникальный идентификатор счета (по умолчанию - Тинькофф)
|
248
|
+
}
|
249
|
+
|
250
|
+
begin
|
251
|
+
# Создание рыночной заявки
|
252
|
+
result = api_instance.orders_market_order_post(figi, market_order_request, opts)
|
253
|
+
p result
|
254
|
+
rescue TinkoffInvestClient::ApiError => e
|
255
|
+
puts "Error when calling OrdersApi->orders_market_order_post: #{e}"
|
256
|
+
end
|
257
|
+
```
|
258
|
+
|
259
|
+
#### Using the orders_market_order_post_with_http_info variant
|
260
|
+
|
261
|
+
This returns an Array which contains the response data, status code and headers.
|
262
|
+
|
263
|
+
> <Array(<MarketOrderResponse>, Integer, Hash)> orders_market_order_post_with_http_info(figi, market_order_request, opts)
|
264
|
+
|
265
|
+
```ruby
|
266
|
+
begin
|
267
|
+
# Создание рыночной заявки
|
268
|
+
data, status_code, headers = api_instance.orders_market_order_post_with_http_info(figi, market_order_request, opts)
|
269
|
+
p status_code # => 2xx
|
270
|
+
p headers # => { ... }
|
271
|
+
p data # => <MarketOrderResponse>
|
272
|
+
rescue TinkoffInvestClient::ApiError => e
|
273
|
+
puts "Error when calling OrdersApi->orders_market_order_post_with_http_info: #{e}"
|
274
|
+
end
|
275
|
+
```
|
276
|
+
|
277
|
+
### Parameters
|
278
|
+
|
279
|
+
| Name | Type | Description | Notes |
|
280
|
+
| ---- | ---- | ----------- | ----- |
|
281
|
+
| **figi** | **String** | FIGI инструмента | |
|
282
|
+
| **market_order_request** | [**MarketOrderRequest**](MarketOrderRequest.md) | | |
|
283
|
+
| **broker_account_id** | **String** | Уникальный идентификатор счета (по умолчанию - Тинькофф) | [optional] |
|
284
|
+
|
285
|
+
### Return type
|
286
|
+
|
287
|
+
[**MarketOrderResponse**](MarketOrderResponse.md)
|
288
|
+
|
289
|
+
### Authorization
|
290
|
+
|
291
|
+
[sso_auth](../README.md#sso_auth)
|
292
|
+
|
293
|
+
### HTTP request headers
|
294
|
+
|
295
|
+
- **Content-Type**: application/json
|
296
|
+
- **Accept**: application/json
|
297
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# TinkoffInvestClient::OrdersResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **tracking_id** | **String** | | |
|
8
|
+
| **status** | **String** | | [default to 'Ok'] |
|
9
|
+
| **payload** | [**Array<Order>**](Order.md) | | |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'tinkoff_invest_client'
|
15
|
+
|
16
|
+
instance = TinkoffInvestClient::OrdersResponse.new(
|
17
|
+
tracking_id: null,
|
18
|
+
status: null,
|
19
|
+
payload: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# TinkoffInvestClient::PlacedLimitOrder
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **order_id** | **String** | | |
|
8
|
+
| **operation** | [**OperationType**](OperationType.md) | | |
|
9
|
+
| **status** | [**OrderStatus**](OrderStatus.md) | | |
|
10
|
+
| **reject_reason** | **String** | | [optional] |
|
11
|
+
| **message** | **String** | Сообщение об ошибке | [optional] |
|
12
|
+
| **requested_lots** | **Integer** | | |
|
13
|
+
| **executed_lots** | **Integer** | | |
|
14
|
+
| **commission** | [**MoneyAmount**](MoneyAmount.md) | | [optional] |
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'tinkoff_invest_client'
|
20
|
+
|
21
|
+
instance = TinkoffInvestClient::PlacedLimitOrder.new(
|
22
|
+
order_id: null,
|
23
|
+
operation: null,
|
24
|
+
status: null,
|
25
|
+
reject_reason: null,
|
26
|
+
message: null,
|
27
|
+
requested_lots: null,
|
28
|
+
executed_lots: null,
|
29
|
+
commission: null
|
30
|
+
)
|
31
|
+
```
|
32
|
+
|