· 6 years ago · Aug 28, 2019, 04:04 AM
1input BTCPriceQuery {
2 time: DateTime
3 fiatCurrency: FiatCurrency
4}
5
6type CreateCredential {
7 credential: Credential
8}
9
10type Credential {
11 status: CredentialStatus
12 apiKey: String
13 apiSecret: String
14 exchange: Exchange
15 password: String
16}
17
18input CredentialInput {
19 exchange: Exchange
20 apiKey: String!
21 apiSecret: String!
22 apiPassword: String
23}
24
25enum CredentialStatus {
26 NORMAL
27 ERROR
28}
29
30type DailyAssetAggregation {
31 amountBtc: String!
32 amountUsd: String!
33 amountCny: String!
34 time: DateTime!
35}
36
37"""
38The `DateTime` scalar type represents a DateTime
39value as specified by
40[iso8601](https://en.wikipedia.org/wiki/ISO_8601).
41"""
42scalar DateTime
43
44input DeleteCredentialInput {
45 exchange: Exchange
46}
47
48type DepositWithdrawHistory {
49 time: DateTime!
50 txId: String!
51 amount: String!
52 currency: String!
53 status: String
54 tag: String
55 txType: String!
56}
57
58enum DeviceType {
59 IOS
60 ANDROID
61}
62
63"""Debugging information for the current query."""
64type DjangoDebug {
65 """Executed SQL queries for this API query."""
66 sql: [DjangoDebugSQL]
67}
68
69"""Represents a single database query made to a Django managed DB."""
70type DjangoDebugSQL {
71 """The type of database being used (e.g. postrgesql, mysql, sqlite)."""
72 vendor: String!
73
74 """The Django database alias (e.g. 'default')."""
75 alias: String!
76
77 """The actual SQL sent to this database."""
78 sql: String
79
80 """Duration of this database query in seconds."""
81 duration: Float!
82
83 """The raw SQL of this query, without params."""
84 rawSql: String!
85
86 """JSON encoded database query parameters."""
87 params: String!
88
89 """Start time of this database query."""
90 startTime: Float!
91
92 """Stop time of this database query."""
93 stopTime: Float!
94
95 """Whether this database query took more than 10 seconds."""
96 isSlow: Boolean!
97
98 """Whether this database query was a SELECT."""
99 isSelect: Boolean!
100
101 """Postgres transaction ID if available."""
102 transId: String
103
104 """Postgres transaction status if available."""
105 transStatus: String
106
107 """Postgres isolation level if available."""
108 isoLevel: String
109
110 """Postgres connection encoding if available."""
111 encoding: String
112}
113
114enum EventActionEnum {
115 HIDE
116 UNHIDE
117 STAR
118 UNSTAR
119}
120
121type EventNode implements Node {
122 title: String
123 url: String
124 content: String
125 time: DateTime!
126 id: ID!
127 labels: [Label]
128 starred: Boolean!
129 notifications: [Notification]
130}
131
132type EventNodeConnection {
133 """Pagination data for this connection."""
134 pageInfo: PageInfo!
135
136 """Contains the nodes in this connection."""
137 edges: [EventNodeEdge]!
138}
139
140"""A Relay edge containing a `EventNode` and its cursor."""
141type EventNodeEdge {
142 """The item at the end of the edge"""
143 node: EventNode
144
145 """A cursor for use in pagination"""
146 cursor: String!
147}
148
149enum EventQueryType {
150 PAST
151 FUTURE
152 STARRED
153 HIDDEN
154 NOTIFIED
155}
156
157enum Exchange {
158 BINANCE
159 HUOBI
160 OKEX
161}
162
163enum FiatCurrency {
164 USD
165 CNY
166}
167
168type FiatPrice {
169 price: String
170 fiatCurrency: FiatCurrency
171 time: DateTime
172 requestTime: DateTime
173}
174
175"""
176The `GenericScalar` scalar type represents a generic
177GraphQL scalar value that could be:
178String, Boolean, Int, Float, List or Object.
179"""
180scalar GenericScalar
181
182"""
183Allows use of a JSON String for input / output from the GraphQL schema.
184
185Use of this type is *not recommended* as you lose the benefits of having a defined, static
186schema (one of the key benefits of GraphQL).
187"""
188scalar JSONString
189
190type Label {
191 name: String!
192 type: LabelType
193}
194
195"""An enumeration."""
196enum LabelType {
197 """CURRENCY"""
198 CURRENCY
199
200 """EVENT"""
201 EVENT
202}
203
204type Me {
205 id: String!
206 avatar: String
207 nickname: String
208 lastName: String
209 firstName: String
210 bio: String
211 username: String!
212 email: String
213 phone: String!
214 credentials: [Credential]
215}
216
217type Mutation {
218 newsFlashAction(
219 action: NewsFlashActionEnum!
220
221 """news_flash id"""
222 id: ID!
223 ): Result
224 createViewpoint(input: ViewpointInput!): Result
225 viewpointAction(
226 action: ViewpointActionEnum!
227
228 """viewpoint id"""
229 id: ID!
230 ): Result
231 testMultipleUpload(files: [Upload]!): UploadTest
232 eventAction(
233 action: EventActionEnum!
234
235 """event id"""
236 id: ID!
237 ): Result
238 updateEventNotify(
239 """event id"""
240 id: ID!
241 notifyDates: [DateTime]
242 ): Result
243 requestVerificationCode(phone: String!): Result
244 verifyCode(code: String!, phone: String!): Result
245 signIn(username: String!, password: String!): SignIn
246 signUp(
247 """Deprecated, verify with session"""
248 code: String
249 password: String!
250 username: String!
251 ): SignUp
252 verifyToken(token: String!): Verify
253 refreshToken(refreshToken: String!): Refresh
254 createCredential(input: CredentialInput!): CreateCredential
255 updateCredential(input: CredentialInput!): UpdateCredential
256 deleteCredential(input: DeleteCredentialInput!): Result
257 updatePushToken(action: UpdatePushTokenAction!, device: DeviceType!, token: String!): Result
258 updateUserInfo(input: UpdateUserInfoInput!): Result
259 uploadAvatar(
260 """base64 encoded image data"""
261 content: String!
262 ): Result
263}
264
265enum NewsFlashActionEnum {
266 STAR
267 UNSTAR
268}
269
270type NewsFlashLabel {
271 name: String!
272 type: NewsFlashLabelType
273}
274
275"""An enumeration."""
276enum NewsFlashLabelType {
277 """大V"""
278 PERSON
279
280 """资讯平台"""
281 PLATFORM
282}
283
284type NewsFlashNode implements Node {
285 title: String
286 content: String
287 publishedAt: DateTime!
288 id: ID!
289 labels: [NewsFlashLabel]
290 pictureUrl: String
291 starred: Boolean!
292}
293
294type NewsFlashNodeConnection {
295 """Pagination data for this connection."""
296 pageInfo: PageInfo!
297
298 """Contains the nodes in this connection."""
299 edges: [NewsFlashNodeEdge]!
300}
301
302"""A Relay edge containing a `NewsFlashNode` and its cursor."""
303type NewsFlashNodeEdge {
304 """The item at the end of the edge"""
305 node: NewsFlashNode
306
307 """A cursor for use in pagination"""
308 cursor: String!
309}
310
311"""An object with an ID"""
312interface Node {
313 """The ID of the object."""
314 id: ID!
315}
316
317type Notification {
318 startDate: DateTime!
319}
320
321type OrderHistory {
322 time: DateTime!
323 orderId: String
324 quantity: String
325 price: String
326 type: String
327 symbol: String
328 side: String
329 average: String
330 filled: String
331 baseCurrencyUsdPrice: String
332 baseCurrencyCnyPrice: String
333}
334
335"""
336The Relay compliant `PageInfo` type, containing data necessary to paginate this connection.
337"""
338type PageInfo {
339 """When paginating forwards, are there more items?"""
340 hasNextPage: Boolean!
341
342 """When paginating backwards, are there more items?"""
343 hasPreviousPage: Boolean!
344
345 """When paginating backwards, the cursor to continue."""
346 startCursor: String
347
348 """When paginating forwards, the cursor to continue."""
349 endCursor: String
350}
351
352type PushMsgHistoryNode implements Node {
353 extraInfo: JSONString
354 type: PushMsgHistoryType
355 id: ID!
356 title: String
357 content: String
358 pushedAt: DateTime!
359}
360
361type PushMsgHistoryNodeConnection {
362 """Pagination data for this connection."""
363 pageInfo: PageInfo!
364
365 """Contains the nodes in this connection."""
366 edges: [PushMsgHistoryNodeEdge]!
367}
368
369"""A Relay edge containing a `PushMsgHistoryNode` and its cursor."""
370type PushMsgHistoryNodeEdge {
371 """The item at the end of the edge"""
372 node: PushMsgHistoryNode
373
374 """A cursor for use in pagination"""
375 cursor: String!
376}
377
378"""An enumeration."""
379enum PushMsgHistoryType {
380 """EVENT"""
381 EVENT
382
383 """INCOME"""
384 INCOME
385}
386
387type Query {
388 pushMsgs(queryType: PushMsgHistoryType, before: String, after: String, first: Int, last: Int): PushMsgHistoryNodeConnection
389 newsFlashes(
390 """search by title or content or label"""
391 query: String
392 starred: Boolean
393 before: String
394 after: String
395 first: Int
396 last: Int
397 ): NewsFlashNodeConnection
398 viewpoints(
399 """search by title or content"""
400 query: String
401 starred: Boolean
402 authorId: ID
403 authorNickname: String
404 before: String
405 after: String
406 first: Int
407 last: Int
408 ): ViewpointNodeConnection
409 viewpoint(id: ID!): ViewpointNode!
410 events(
411 query: String
412
413 """When query_type is empty, return all events"""
414 queryType: EventQueryType
415 byLabel: String
416 before: String
417 after: String
418 first: Int
419 last: Int
420 ): EventNodeConnection
421 event(id: ID): EventNode!
422 eventByBatch(ids: [ID]): EventNode!
423 labels(
424 """When query_type is empty, return all labels"""
425 queryType: LabelType
426 ): [Label]
427 dailyAssetsAggregation(start: DateTime, end: DateTime): [DailyAssetAggregation]
428 dailyProfitsAggregation(start: DateTime, end: DateTime): [DailyAssetAggregation]
429 orderHistory(exchange: Exchange, start: DateTime, end: DateTime): [OrderHistory]
430 depositWithdrawHistory(exchange: Exchange, start: DateTime, end: DateTime): [DepositWithdrawHistory]
431
432 """Get the history ticker. If time is None, return latest ticker"""
433 ticker(currency: String!, time: DateTime): Ticker
434
435 """Get the history or latest of tickers"""
436 tickers(queries: [TickerQuery]): [Ticker]
437
438 """Get the history of btc price"""
439 btcPrices(queries: [BTCPriceQuery]!): [FiatPrice]
440
441 """If time is none return latest btc price"""
442 btcPrice(fiatCurrency: FiatCurrency!, time: DateTime): FiatPrice
443 me: Me
444
445 """check user's registered status by phone with country code prefix"""
446 registered(phone: String!): Boolean
447 teachers(query: String): Teachers
448 _debug: DjangoDebug
449}
450
451type Refresh {
452 token: String
453 payload: GenericScalar
454 refreshToken: String
455}
456
457type Result {
458 success: Boolean
459 message: String
460}
461
462type SignIn {
463 token: String
464 me: Me
465 refreshToken: String
466}
467
468type SignUp {
469 me: Me
470 token: String
471 refreshToken: String
472}
473
474type Teacher {
475 id: String!
476 avatar: String
477 nickname: String
478 lastName: String
479 firstName: String
480 bio: String
481 followerCount: Int
482}
483
484type Teachers {
485 teacher: [Teacher]
486}
487
488type Ticker {
489 price: String
490 symbol: String
491 time: DateTime
492 requestTime: DateTime
493}
494
495input TickerQuery {
496 time: DateTime
497 currency: String
498}
499
500type UpdateCredential {
501 credential: Credential
502}
503
504enum UpdatePushTokenAction {
505 BIND
506 UNBIND
507}
508
509input UpdateUserInfoInput {
510 nickname: String
511 email: String
512 bio: String
513 avatar: Upload
514}
515
516"""
517Create scalar that ignores normal serialization/deserialization, since
518that will be handled by the multipart request spec
519"""
520scalar Upload
521
522type UploadTest {
523 id: String
524}
525
526type User {
527 id: String!
528 avatar: String
529 nickname: String
530 lastName: String
531 firstName: String
532 bio: String
533}
534
535type Verify {
536 payload: GenericScalar
537}
538
539enum ViewpointActionEnum {
540 STAR
541 UNSTAR
542}
543
544input ViewpointInput {
545 """uuid from client in case of submit mutiple times"""
546 requestId: ID!
547 title: String
548 content: String!
549 files: [Upload]
550}
551
552type ViewpointNode implements Node {
553 createdAt: DateTime!
554 updatedAt: DateTime!
555 title: String
556 content: String
557 id: ID!
558 author: User
559 starred: Boolean!
560 pictures: [ViewpointPicture]
561}
562
563type ViewpointNodeConnection {
564 """Pagination data for this connection."""
565 pageInfo: PageInfo!
566
567 """Contains the nodes in this connection."""
568 edges: [ViewpointNodeEdge]!
569}
570
571"""A Relay edge containing a `ViewpointNode` and its cursor."""
572type ViewpointNodeEdge {
573 """The item at the end of the edge"""
574 node: ViewpointNode
575
576 """A cursor for use in pagination"""
577 cursor: String!
578}
579
580type ViewpointPicture {
581 image: String
582 url: String
583}