fcoin_ruby_client 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/issue_template.md +12 -0
- data/.github/pull_request_template.md +12 -0
- data/.gitignore +13 -0
- data/.rspec +3 -0
- data/.rubocop.yml +12 -0
- data/.rubocop_todo.yml +431 -0
- data/.travis.yml +26 -0
- data/CHANGELOG.md +2 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +176 -0
- data/LICENSE.txt +21 -0
- data/README.md +204 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/fcoin +95 -0
- data/bin/setup +8 -0
- data/examples/cli/realtime_api.md +78 -0
- data/examples/cli/rest_api.md +149 -0
- data/examples/cli/setting.md +39 -0
- data/examples/realtime_api.rb +43 -0
- data/examples/rest_api.rb +47 -0
- data/fcoin_ruby_client.gemspec +39 -0
- data/lib/fcoin/api.rb +47 -0
- data/lib/fcoin/authorization.rb +83 -0
- data/lib/fcoin/cli/endpoint/accounts_task.rb +33 -0
- data/lib/fcoin/cli/endpoint/market_task.rb +98 -0
- data/lib/fcoin/cli/endpoint/orders_task.rb +196 -0
- data/lib/fcoin/cli/endpoint/public_task.rb +59 -0
- data/lib/fcoin/cli/realtime/endpoint_task.rb +107 -0
- data/lib/fcoin/cli.rb +77 -0
- data/lib/fcoin/client.rb +7 -0
- data/lib/fcoin/config/custom_settings.yml +171 -0
- data/lib/fcoin/config/settings.yml +10 -0
- data/lib/fcoin/configuration.rb +95 -0
- data/lib/fcoin/connection.rb +33 -0
- data/lib/fcoin/endpoint/accounts.rb +23 -0
- data/lib/fcoin/endpoint/market.rb +91 -0
- data/lib/fcoin/endpoint/orders.rb +171 -0
- data/lib/fcoin/endpoint/public.rb +51 -0
- data/lib/fcoin/endpoint/utility.rb +14 -0
- data/lib/fcoin/endpoint.rb +13 -0
- data/lib/fcoin/error.rb +4 -0
- data/lib/fcoin/faraday/fcoin_formatter.rb +17 -0
- data/lib/fcoin/formatter/base_formatter.rb +8 -0
- data/lib/fcoin/formatter/depth_formatter.rb +33 -0
- data/lib/fcoin/formatter/ticker_formatter.rb +34 -0
- data/lib/fcoin/formatter.rb +38 -0
- data/lib/fcoin/generators/locale.rb +18 -0
- data/lib/fcoin/generators/templates/locale/locales/en.yml +176 -0
- data/lib/fcoin/generators/templates/locale/locales/ja.yml +176 -0
- data/lib/fcoin/generators/templates/locale/locales/zh_CN.yml +176 -0
- data/lib/fcoin/generators/templates/validation/my_settings.yml +171 -0
- data/lib/fcoin/generators/validation.rb +18 -0
- data/lib/fcoin/realtime/api.rb +38 -0
- data/lib/fcoin/realtime/client.rb +9 -0
- data/lib/fcoin/realtime/endpoint.rb +160 -0
- data/lib/fcoin/realtime/formatter/base_formatter.rb +10 -0
- data/lib/fcoin/realtime/formatter/depth_formatter.rb +37 -0
- data/lib/fcoin/realtime/formatter/ticker_formatter.rb +36 -0
- data/lib/fcoin/realtime/formatter.rb +40 -0
- data/lib/fcoin/realtime/wss.rb +113 -0
- data/lib/fcoin/request.rb +73 -0
- data/lib/fcoin/validator/market_validator.rb +60 -0
- data/lib/fcoin/validator/orders/base_validator.rb +96 -0
- data/lib/fcoin/validator/orders/create_order_limit_validator.rb +54 -0
- data/lib/fcoin/validator/orders/create_order_market_validator.rb +95 -0
- data/lib/fcoin/validator/orders/order_list_validator.rb +33 -0
- data/lib/fcoin/validator/orders_validator.rb +69 -0
- data/lib/fcoin/validator/validator_utility.rb +24 -0
- data/lib/fcoin/validator.rb +58 -0
- data/lib/fcoin/version.rb +3 -0
- data/lib/fcoin.rb +11 -0
- metadata +353 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative 'base_formatter'
|
2
|
+
|
3
|
+
module Fcoin
|
4
|
+
class TickerFormatter < BaseFormatter
|
5
|
+
|
6
|
+
attr_accessor :body
|
7
|
+
|
8
|
+
def initialize(body)
|
9
|
+
self.body = body
|
10
|
+
end
|
11
|
+
|
12
|
+
# Format response body for JSON
|
13
|
+
#
|
14
|
+
# @return [Hash]
|
15
|
+
def formatted_body
|
16
|
+
# https://developer.fcoin.com/en.html
|
17
|
+
ticker = body['data']['ticker'].dup
|
18
|
+
self.body['data']['ticker'] = {
|
19
|
+
"latest_price" => ticker[0],
|
20
|
+
"most_recent_trade_vol" => ticker[1],
|
21
|
+
"max_buy_price" => ticker[2],
|
22
|
+
"max_buy_amount" => ticker[3],
|
23
|
+
"min_sell_price" => ticker[4],
|
24
|
+
"min_sell_amount" => ticker[5],
|
25
|
+
"trade_price_yesterday" => ticker[6],
|
26
|
+
"highest_price_today" => ticker[7],
|
27
|
+
"lowest_price_today" => ticker[8],
|
28
|
+
"symbol_base_vol_today" => ticker[9],
|
29
|
+
"symbol_base_price_today" => ticker[10]
|
30
|
+
}
|
31
|
+
body
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative 'formatter/ticker_formatter.rb'
|
2
|
+
require_relative 'formatter/depth_formatter.rb'
|
3
|
+
|
4
|
+
module Fcoin
|
5
|
+
class Formatter
|
6
|
+
def initialize(body)
|
7
|
+
self.body = body
|
8
|
+
end
|
9
|
+
|
10
|
+
# Format body
|
11
|
+
def formatted_body
|
12
|
+
formatter.present? ? formatter.formatted_body : body
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
attr_accessor :body
|
18
|
+
|
19
|
+
def formatter
|
20
|
+
if use_formatter?(body)
|
21
|
+
case body['data']['type']
|
22
|
+
when /ticker/
|
23
|
+
TickerFormatter.new(body)
|
24
|
+
when /depth/
|
25
|
+
DepthFormatter.new(body)
|
26
|
+
else
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
else
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def use_formatter?(body)
|
35
|
+
!(body['data'].nil? || !body['data'].is_a?(Hash) || body['data']['type'].nil?)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'thor/group'
|
3
|
+
|
4
|
+
module Fcoin
|
5
|
+
module Generators
|
6
|
+
class Locale < Thor::Group
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
def self.source_root
|
10
|
+
File.dirname(__FILE__) + '/templates/locale'
|
11
|
+
end
|
12
|
+
|
13
|
+
def copy_files
|
14
|
+
directory '.'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,176 @@
|
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
fcoin:
|
4
|
+
endpoints:
|
5
|
+
rest:
|
6
|
+
accounts: Account Information
|
7
|
+
accounts/balance: Finance
|
8
|
+
accounts/balance/data:
|
9
|
+
currency: Currency
|
10
|
+
category: Category (MainBoard A or MainBoard B or GPM)
|
11
|
+
available: Available
|
12
|
+
frozen: Frozen
|
13
|
+
balance: Blance
|
14
|
+
market: Trade Market
|
15
|
+
market/candles: Candle Information
|
16
|
+
market/candles/data:
|
17
|
+
open: Open Price
|
18
|
+
close: Close Price
|
19
|
+
high: Highest Price
|
20
|
+
quote_vol: Quote Volume (Quote Volume %{coin} of %{symbol})
|
21
|
+
id: ID
|
22
|
+
count: Count
|
23
|
+
low: Low Price
|
24
|
+
seq: Seq
|
25
|
+
base_vol: Base Volume (Base Volume %{coin} of %{symbol})
|
26
|
+
market/candles/params:
|
27
|
+
symbol: Symbol
|
28
|
+
resolution: resolution
|
29
|
+
resolution/M1: 1 minute
|
30
|
+
resolution/M3: 3 minutes
|
31
|
+
resolution/M5: 5 minutes
|
32
|
+
resolution/M15: 15 minutes
|
33
|
+
resolution/M30: 30 minutes
|
34
|
+
resolution/H1: 1 hour
|
35
|
+
resolution/H4: 4 hours
|
36
|
+
resolution/H6: 6 hours
|
37
|
+
resolution/D1: 1 day
|
38
|
+
resolution/W1: 1 week
|
39
|
+
resolution/MN: 1 month
|
40
|
+
market/depth: Trading Information
|
41
|
+
market/depth/data:
|
42
|
+
bids: Bids
|
43
|
+
price: Price
|
44
|
+
amount: Amount
|
45
|
+
asks: Asks
|
46
|
+
price: Price
|
47
|
+
amount: Amount
|
48
|
+
ts: Server Time (epoc millisecond)
|
49
|
+
seq: Seq
|
50
|
+
market/depth/params:
|
51
|
+
symbol: Symbol
|
52
|
+
level: Level
|
53
|
+
level/L20: 20 Level
|
54
|
+
level/L100: 100 Level
|
55
|
+
level/full: Full Level
|
56
|
+
market/ticker: Ticker Information
|
57
|
+
market/ticker/data:
|
58
|
+
ticker:
|
59
|
+
last_price: Last Price
|
60
|
+
most_recent_trade_vol: Most Recent Trade Volume
|
61
|
+
max_buy_price: Max Buy Price
|
62
|
+
max_buy_amount: Max Buy Amount
|
63
|
+
min_sell_price: Min Sell Price
|
64
|
+
min_sell_amount: Min Sell Amount
|
65
|
+
trade_price_yesterday: Trade Price at Yesterday
|
66
|
+
highest_price_today: Highest Price at Today
|
67
|
+
lowest_price_today: Lowest Price at Today
|
68
|
+
symbol_base_vol_today: Base Volume %{coin} of %{symbol}
|
69
|
+
symbol_base_price_today: Base Price %{coin} of %{symbol}
|
70
|
+
market/trades: Trade Information
|
71
|
+
market/trades/data:
|
72
|
+
amount: Amount
|
73
|
+
ts: Server Time (epoc millisecond)
|
74
|
+
id: ID
|
75
|
+
side: buy or sell
|
76
|
+
price: Price
|
77
|
+
orders: Order Information
|
78
|
+
orders/list: Order List
|
79
|
+
orders/list/data:
|
80
|
+
id: ID
|
81
|
+
symbol: Symbol
|
82
|
+
amount: Amount
|
83
|
+
price: Price
|
84
|
+
created_at: Created At
|
85
|
+
type: limit or market
|
86
|
+
side: buy or sell
|
87
|
+
filled_amount: Filled Amount
|
88
|
+
executed_value: Executed Value
|
89
|
+
fill_fees: Fill Fees
|
90
|
+
source: Source (API or Handling)
|
91
|
+
state: Order State
|
92
|
+
state/submitted: Submitted
|
93
|
+
state/partial_filled: Partial Filled
|
94
|
+
state/partial_canceled: Partial Canceled
|
95
|
+
state/filled: Filled
|
96
|
+
state/canceled: Canceled
|
97
|
+
state/pending_cancel: Pending Cancel
|
98
|
+
public:
|
99
|
+
public/server-time: Server Time (epoc millisecond)
|
100
|
+
public/currencies: Currencies
|
101
|
+
public/symbols: Symbols
|
102
|
+
wss:
|
103
|
+
candle: Candle Information (RealTime)
|
104
|
+
candle/data:
|
105
|
+
open: Open Price
|
106
|
+
type: Sucscribe Channel
|
107
|
+
close: Close Price
|
108
|
+
high: Highest Price
|
109
|
+
quote_vol: Quote Volume (Quote Volume %{coin} of %{symbol})
|
110
|
+
id: ID
|
111
|
+
count: Count
|
112
|
+
low: Low Price
|
113
|
+
seq: Seq
|
114
|
+
base_vol: Base Volume (Base Volume %{coin} of %{symbol})
|
115
|
+
candle/params:
|
116
|
+
symbol: Symbol
|
117
|
+
resolution: resolution
|
118
|
+
resolution/M1: 1 minute
|
119
|
+
resolution/M3: 3 minutes
|
120
|
+
resolution/M5: 5 minutes
|
121
|
+
resolution/M15: 15 minutes
|
122
|
+
resolution/M30: 30 minutes
|
123
|
+
resolution/H1: 1 hour
|
124
|
+
resolution/H4: 4 hours
|
125
|
+
resolution/H6: 6 hours
|
126
|
+
resolution/D1: 1 day
|
127
|
+
resolution/W1: 1 week
|
128
|
+
resolution/MN: 1 month
|
129
|
+
depth: Depth Information (RealTime)
|
130
|
+
depth/data:
|
131
|
+
bids: Bids
|
132
|
+
price: Price
|
133
|
+
amount: Amount
|
134
|
+
asks: Asks
|
135
|
+
price: Price
|
136
|
+
amount: Amount
|
137
|
+
ts: Server Time (epoc millisecond)
|
138
|
+
seq: Seq
|
139
|
+
type: Sucscribe Channel
|
140
|
+
depth/params:
|
141
|
+
symbol: Symbol
|
142
|
+
level: Level
|
143
|
+
level/L20: 20 Level
|
144
|
+
level/L100: 100 Level
|
145
|
+
level/full: Full Level
|
146
|
+
trade: Trade Information (RealTime)
|
147
|
+
trade/data:
|
148
|
+
amount: Amount
|
149
|
+
type: Subscribe Channel
|
150
|
+
ts: Server Time (epoc millisecond)
|
151
|
+
id: ID
|
152
|
+
side: buy or sell
|
153
|
+
price: Price
|
154
|
+
ticker: Ticker Information (RealTime)
|
155
|
+
ticker/data:
|
156
|
+
last_price: Last Price
|
157
|
+
most_recent_trade_vol: Most Recent Trade Volume
|
158
|
+
max_buy_price: Max Buy Price
|
159
|
+
max_buy_amount: Max Buy Amount
|
160
|
+
min_sell_price: Min Sell Price
|
161
|
+
min_sell_amount: Min Sell Amount
|
162
|
+
trade_price_yesterday: Trade Price at Yesterday
|
163
|
+
highest_price_today: Highest Price at Today
|
164
|
+
lowest_price_today: Lowest Price at Today
|
165
|
+
symbol_base_vol_today: Base Volume %{coin} of %{symbol}
|
166
|
+
symbol_base_price_today: Base Price %{coin} of %{symbol}
|
167
|
+
type: Subscribe Channel
|
168
|
+
topics: Topics (RealTime)
|
169
|
+
topics/data:
|
170
|
+
id: ID
|
171
|
+
type: Subscribe Channel
|
172
|
+
topics: Subscribe Channel Index
|
173
|
+
hello:
|
174
|
+
hello/data:
|
175
|
+
type: Subscribe Channel
|
176
|
+
ts: Server Time (epoc millisecond)
|
@@ -0,0 +1,176 @@
|
|
1
|
+
---
|
2
|
+
en:
|
3
|
+
fcoin:
|
4
|
+
endpoints:
|
5
|
+
rest:
|
6
|
+
accounts: アカウント情報
|
7
|
+
accounts/balance: 資産
|
8
|
+
accounts/balance/data:
|
9
|
+
currency: 通貨
|
10
|
+
category: カテゴリ(メインボードA or メインボードB or GPM)
|
11
|
+
available: 利用可能
|
12
|
+
frozen: 凍結
|
13
|
+
balance: 資産
|
14
|
+
market: 取引市場
|
15
|
+
market/candles: キャンドル情報
|
16
|
+
market/candles/data:
|
17
|
+
open: 始値
|
18
|
+
close: 終値
|
19
|
+
high: 高値
|
20
|
+
quote_vol: 取引額 (%{symbol}板の%{coin}の取引額)
|
21
|
+
id: ID
|
22
|
+
count: カウント
|
23
|
+
low: 低値
|
24
|
+
seq: Seq
|
25
|
+
base_vol: 出来高 (%{symbol}板の%{coin}の出来高)
|
26
|
+
market/candles/params:
|
27
|
+
symbol: ペア
|
28
|
+
resolution: 分解能
|
29
|
+
resolution/M1: 1分足
|
30
|
+
resolution/M3: 3分足
|
31
|
+
resolution/M5: 5分足
|
32
|
+
resolution/M15: 15分足
|
33
|
+
resolution/M30: 30分足
|
34
|
+
resolution/H1: 1時間足
|
35
|
+
resolution/H4: 4時間足
|
36
|
+
resolution/H6: 6時間足
|
37
|
+
resolution/D1: 日足
|
38
|
+
resolution/W1: 週足
|
39
|
+
resolution/MN: 月足
|
40
|
+
market/depth: 板情報
|
41
|
+
market/depth/data:
|
42
|
+
bids: 売り
|
43
|
+
price: 価格
|
44
|
+
amount: 数量
|
45
|
+
asks: 買い
|
46
|
+
price: 価格
|
47
|
+
amount: 数量
|
48
|
+
ts: サーバータイム (エポックミリ秒)
|
49
|
+
seq: Seq
|
50
|
+
market/depth/params:
|
51
|
+
symbol: ペア
|
52
|
+
level: 深度
|
53
|
+
level/L20: 20度
|
54
|
+
level/L100: 100度
|
55
|
+
level/full: フル
|
56
|
+
market/ticker: ティッカー
|
57
|
+
market/ticker/data:
|
58
|
+
ticker:
|
59
|
+
last_price: 最終値
|
60
|
+
most_recent_trade_vol: 最近のトランザクション出来高
|
61
|
+
max_buy_price: 最大購入価格
|
62
|
+
max_buy_amount: 最大購入数量
|
63
|
+
min_sell_price: 最小売却価格
|
64
|
+
min_sell_amount: 最小売却数量
|
65
|
+
trade_price_yesterday: 24時間前の取引価格
|
66
|
+
highest_price_today: 本日の高値
|
67
|
+
lowest_price_today: 本日の低値
|
68
|
+
symbol_base_vol_today: 本日の%{symbol}板の%{coin}の出来高
|
69
|
+
symbol_base_price_today: 本日の%{symbol}板の%{coin}の取引額
|
70
|
+
market/trades: 取引
|
71
|
+
market/trades/data:
|
72
|
+
amount: 数量
|
73
|
+
ts: サーバータイム(エポックミリ秒)
|
74
|
+
id: ID
|
75
|
+
side: buy or sell
|
76
|
+
price: 価格
|
77
|
+
orders: 注文
|
78
|
+
orders/list: 注文一覧
|
79
|
+
orders/list/data:
|
80
|
+
id: ID
|
81
|
+
symbol: ペア
|
82
|
+
amount: 数量
|
83
|
+
price: 価格
|
84
|
+
created_at: 注文日時
|
85
|
+
type: limit or market
|
86
|
+
side: buy or sell
|
87
|
+
filled_amount: 部分約定数量
|
88
|
+
executed_value: 約定値
|
89
|
+
fill_fees: 手数料
|
90
|
+
source: ソース (api or 手動)
|
91
|
+
state: 注文ステータス
|
92
|
+
state/submitted: 注文済み
|
93
|
+
state/partial_filled: 部分約定
|
94
|
+
state/partial_canceled: 一部取引キャンセル
|
95
|
+
state/filled: 約定済み
|
96
|
+
state/canceled: キャンセル済み
|
97
|
+
state/pending_cancel: キャンセル
|
98
|
+
public:
|
99
|
+
public/server-time: サーバータイム
|
100
|
+
public/currencies: 取扱通貨
|
101
|
+
public/symbols: 取引通貨詳細情報
|
102
|
+
wss:
|
103
|
+
candle: キャンドル情報 (リアルタイム)
|
104
|
+
candle/data:
|
105
|
+
open: 始値
|
106
|
+
type: 購読チャンネル
|
107
|
+
close: 終値
|
108
|
+
high: 高値
|
109
|
+
quote_vol: 取引額 (%{symbol}板の%{coin}の取引額)
|
110
|
+
id: ID
|
111
|
+
count: カウント
|
112
|
+
low: 低値
|
113
|
+
seq: Seq
|
114
|
+
base_vol: 出来高 (%{symbol}板の%{coin}の出来高)
|
115
|
+
candle/params:
|
116
|
+
symbol: ペア
|
117
|
+
resolution: 分解能
|
118
|
+
resolution/M1: 1分足
|
119
|
+
resolution/M3: 3分足
|
120
|
+
resolution/M5: 5分足
|
121
|
+
resolution/M15: 15分足
|
122
|
+
resolution/M30: 30分足
|
123
|
+
resolution/H1: 1時間足
|
124
|
+
resolution/H4: 4時間足
|
125
|
+
resolution/H6: 6時間足
|
126
|
+
resolution/D1: 日足
|
127
|
+
resolution/W1: 週足
|
128
|
+
resolution/MN: 月足
|
129
|
+
depth: 板情報 (リアルタイム)
|
130
|
+
depth/data:
|
131
|
+
bids: 売り
|
132
|
+
price: 価格
|
133
|
+
amount: 数量
|
134
|
+
asks: 買い
|
135
|
+
price: 価格
|
136
|
+
amount: 数量
|
137
|
+
ts: サーバータイム(エポックミリ秒)
|
138
|
+
seq: Seq
|
139
|
+
type: 購読チャンネル
|
140
|
+
depth/params:
|
141
|
+
symbol: ペア
|
142
|
+
level: 深度
|
143
|
+
level/L20: 20度
|
144
|
+
level/L100: 100度
|
145
|
+
level/full: フル
|
146
|
+
trade: 取引情報 (リアルタイム)
|
147
|
+
trade/data:
|
148
|
+
amount: 数量
|
149
|
+
type: 購読チャンネル
|
150
|
+
ts: サーバータイム(エポックミリ秒)
|
151
|
+
id: ID
|
152
|
+
side: buy or sell
|
153
|
+
price: 価格
|
154
|
+
ticker: ティッカー情報 (リアルタイム)
|
155
|
+
ticker/data:
|
156
|
+
last_price: 最終値
|
157
|
+
most_recent_trade_vol: 最近のトランザクション出来高
|
158
|
+
max_buy_price: 最大購入価格
|
159
|
+
max_buy_amount: 最大購入数量
|
160
|
+
min_sell_price: 最小売却価格
|
161
|
+
min_sell_amount: 最小売却数量
|
162
|
+
trade_price_yesterday: 24時間前の取引価格
|
163
|
+
highest_price_today: 本日の高値
|
164
|
+
lowest_price_today: 本日の低値
|
165
|
+
symbol_base_vol_today: 本日の%{symbol}板の%{coin}の出来高
|
166
|
+
symbol_base_price_today: 本日の%{symbol}板の%{coin}の取引額
|
167
|
+
type: 購読チャンネル
|
168
|
+
topics: 購読チャンネル一覧 (リアルタム)
|
169
|
+
topics/data:
|
170
|
+
id: ID
|
171
|
+
type: 購読チャンネル
|
172
|
+
topics: 購読チャンネル一覧
|
173
|
+
hello:
|
174
|
+
hello/data:
|
175
|
+
type: 購読チャンネル
|
176
|
+
ts: サーバータイム(エポックミリ秒)
|
@@ -0,0 +1,176 @@
|
|
1
|
+
---
|
2
|
+
zh_CN:
|
3
|
+
fcoin:
|
4
|
+
endpoints:
|
5
|
+
rest:
|
6
|
+
accounts: 账户
|
7
|
+
accounts/balance: 资产
|
8
|
+
accounts/balance/data:
|
9
|
+
currency: 货币
|
10
|
+
category: 类别 (主板A or 主板B or GPM)
|
11
|
+
available: 可用
|
12
|
+
frozen: 冻结
|
13
|
+
balance: 资产
|
14
|
+
market: 行情
|
15
|
+
market/candles: Candle Information
|
16
|
+
market/candles/data:
|
17
|
+
open: 开盘价
|
18
|
+
close: 收盘价
|
19
|
+
high: 价格高
|
20
|
+
quote_vol: 货币成交量, %{symbol} 中 %{coin} 的量
|
21
|
+
id: ID
|
22
|
+
count: 算
|
23
|
+
low: 价值低
|
24
|
+
seq: Seq
|
25
|
+
base_vol: 货币成交量, %{symbol} 中 %{coin} 的量
|
26
|
+
market/candles/params:
|
27
|
+
symbol: 交易对
|
28
|
+
resolution: 分解能
|
29
|
+
resolution/M1: 1分钟
|
30
|
+
resolution/M3: 3分钟
|
31
|
+
resolution/M5: 5分钟
|
32
|
+
resolution/M15: 15分钟
|
33
|
+
resolution/M30: 30分钟
|
34
|
+
resolution/H1: 1小时
|
35
|
+
resolution/H4: 4小时
|
36
|
+
resolution/H6: 6小时
|
37
|
+
resolution/D1: 1日
|
38
|
+
resolution/W1: 1週
|
39
|
+
resolution/MN: 1月
|
40
|
+
market/depth: Depth Information
|
41
|
+
market/depth/data:
|
42
|
+
bids: Bids
|
43
|
+
price: 价格
|
44
|
+
amount: 数量
|
45
|
+
asks: Asks
|
46
|
+
price: 价格
|
47
|
+
amount: 数量
|
48
|
+
ts: 推送服务器的时间. 是毫秒为单位的数字型字段, unix epoch in millisecond.
|
49
|
+
seq: Seq
|
50
|
+
market/depth/params:
|
51
|
+
symbol: 交易对
|
52
|
+
level: 行情深度类型
|
53
|
+
level/L20: 20档行情深度
|
54
|
+
level/L100: 100档行情深度
|
55
|
+
level/full: 全量的行情深度
|
56
|
+
market/ticker: Ticker Information
|
57
|
+
market/ticker/data:
|
58
|
+
ticker:
|
59
|
+
last_price: 最新成交价
|
60
|
+
most_recent_trade_vol: 最近一笔成交的成交量
|
61
|
+
max_buy_price: 最大买一价
|
62
|
+
max_buy_amount: 最大买一量
|
63
|
+
min_sell_price: 最小卖一价
|
64
|
+
min_sell_amount: 最小卖一量
|
65
|
+
trade_price_yesterday: 24小时前成交价
|
66
|
+
highest_price_today: 24小时内最高价
|
67
|
+
lowest_price_today: 24小时内最低价
|
68
|
+
symbol_base_vol_today: 24小时内基准货币成交量, %{symbol} 中 %{coin} 的量
|
69
|
+
symbol_base_price_today: 24小时内计价货币成交量, %{symbol} 中 %{coin} 的量
|
70
|
+
market/trades: 成交
|
71
|
+
market/trades/data:
|
72
|
+
amount: 数量
|
73
|
+
ts: 推送服务器的时间. 是毫秒为单位的数字型字段, unix epoch in millisecond.
|
74
|
+
id: ID
|
75
|
+
side: 交易方向(buy, sell)
|
76
|
+
price: 价格
|
77
|
+
orders: 订单
|
78
|
+
orders/list: 订单清单
|
79
|
+
orders/list/data:
|
80
|
+
id: ID
|
81
|
+
symbol: 交易对
|
82
|
+
amount: 下单数量
|
83
|
+
price: 下单价格
|
84
|
+
created_at: 创建时间
|
85
|
+
type: 订单类型(limit,market)
|
86
|
+
side: 交易方向(buy, sell)
|
87
|
+
filled_amount: 成交量
|
88
|
+
executed_value: 已成交
|
89
|
+
fill_fees: 手续费
|
90
|
+
source: 来源 (api or 手册)
|
91
|
+
state: 订单状态
|
92
|
+
state/submitted: 已提交
|
93
|
+
state/partial_filled: 部分成交
|
94
|
+
state/partial_canceled: 部分成交已撤销
|
95
|
+
state/filled: 完全成交
|
96
|
+
state/canceled: 已撤销
|
97
|
+
state/pending_cancel: 撤销已提交
|
98
|
+
public:
|
99
|
+
public/server-time: 推送服务器的时间. 是毫秒为单位的数字型字段, unix epoch in millisecond.
|
100
|
+
public/currencies: 处理货币
|
101
|
+
public/symbols: 交易对
|
102
|
+
wss:
|
103
|
+
candle: Candle Information (实时)
|
104
|
+
candle/data:
|
105
|
+
open: 开盘价
|
106
|
+
type: 订阅频道
|
107
|
+
close: 收盘价
|
108
|
+
high: 价格高
|
109
|
+
quote_vol: 货币成交量, %{symbol} 中 %{coin} 的量
|
110
|
+
id: ID
|
111
|
+
count: 算
|
112
|
+
low: 价值低
|
113
|
+
seq: Seq
|
114
|
+
base_vol: 货币成交量, %{symbol} 中 %{coin} 的量
|
115
|
+
candle/params:
|
116
|
+
symbol: 交易对
|
117
|
+
resolution: 分解能
|
118
|
+
resolution/M1: 1分钟
|
119
|
+
resolution/M3: 3分钟
|
120
|
+
resolution/M5: 5分钟
|
121
|
+
resolution/M15: 15分钟
|
122
|
+
resolution/M30: 30分钟
|
123
|
+
resolution/H1: 1小时
|
124
|
+
resolution/H4: 4小时
|
125
|
+
resolution/H6: 6小时
|
126
|
+
resolution/D1: 1日
|
127
|
+
resolution/W1: 1週
|
128
|
+
resolution/MN: 1月
|
129
|
+
depth: Depth Infrmation (实时)
|
130
|
+
depth/data:
|
131
|
+
bids: Bids
|
132
|
+
price: 价格
|
133
|
+
amount: 数量
|
134
|
+
asks: Asks
|
135
|
+
price: 价格
|
136
|
+
amount: 数量
|
137
|
+
ts: 推送服务器的时间. 是毫秒为单位的数字型字段, unix epoch in millisecond.
|
138
|
+
seq: Seq
|
139
|
+
type: 订阅频道
|
140
|
+
depth/params:
|
141
|
+
symbol: 交易对
|
142
|
+
level: 行情深度类型
|
143
|
+
level/L20: 20档行情深度
|
144
|
+
level/L100: 100档行情深度
|
145
|
+
level/full: 全量的行情深度
|
146
|
+
trade: 成交 (实时)
|
147
|
+
trade/data:
|
148
|
+
amount: 下单数量
|
149
|
+
type: 订阅频道
|
150
|
+
ts: 推送服务器的时间. 是毫秒为单位的数字型字段, unix epoch in millisecond.
|
151
|
+
id: ID
|
152
|
+
side: 交易方向(buy, sell)
|
153
|
+
price: 下单价格
|
154
|
+
ticker: Ticker Infrmation (实时)
|
155
|
+
ticker/data:
|
156
|
+
last_price: 最新成交价
|
157
|
+
most_recent_trade_vol: 最近一笔成交的成交量
|
158
|
+
max_buy_price: 最大买一价
|
159
|
+
max_buy_amount: 最大买一量
|
160
|
+
min_sell_price: 最小卖一价
|
161
|
+
min_sell_amount: 最小卖一量
|
162
|
+
trade_price_yesterday: 24小时前成交价
|
163
|
+
highest_price_today: 24小时内最高价
|
164
|
+
lowest_price_today: 24小时内最低价
|
165
|
+
symbol_base_vol_today: 24小时内基准货币成交量, %{symbol} 中 %{coin} 的量
|
166
|
+
symbol_base_price_today: 24小时内计价货币成交量, %{symbol} 中 %{coin} 的量
|
167
|
+
type: 订阅频道
|
168
|
+
topics: 订阅频道列表 (实时)
|
169
|
+
topics/data:
|
170
|
+
id: ID
|
171
|
+
type: 订阅频道
|
172
|
+
topics: 订阅频道列表
|
173
|
+
hello:
|
174
|
+
hello/data:
|
175
|
+
type: 订阅频道
|
176
|
+
ts: 推送服务器的时间. 是毫秒为单位的数字型字段, unix epoch in millisecond.
|