-
Notifications
You must be signed in to change notification settings - Fork 9
/
schema.js
191 lines (172 loc) · 3.28 KB
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
const { makeExecutableSchema } = require('graphql-tools');
const resolvers = require('./resolvers');
const typeDefs = `
type Query {
coin(symbol: String): Coin
allCoins: [Coin]
allICO: [Coin]
allExchanges : [Exchange]
exchange(exchange: String): Exchange
priceHistory(symbol: String, toSymbol: String, exchange: String, period: String, limit: Int): [PriceHistory]
marketCap(currency: String, start: Int, limit: Int) : [MarketCap]
orderBook(exchange: String, symbol: String, toSymbol: String, start: Int, limit: Int) : OrderBook
}
type ErrorMessage {
message: String
type: String
}
type Symbol {
symbol: String
}
type ICO {
blog: String
blogLink: String
date: Float
description: String
endDate: Float
features: [String]
fundingCap: String
fundingTarget: String
fundsRaisedList: String
fundsRaisedUSD: String
tokenSupply: String
jurisdiction: String
legalAdvisers: String
legalForm: String
paymentMethod: [Symbol]
publicPortfolioId: String
publicPortfolioUrl: String
securityAuditCompany: String
startPrice: String
startPriceCurrency: String
status: String
tokenPercentageForInvestors: String
tokenReserveSplit: [String]
tokenSupplyPostICO: String
tokenType: String
website: String
websiteURL: String
whitePaper: String
whitePaperLink: String
}
type Coin {
algorithm: String
coinName: String
fullName: String
fullyPremined: String
id: String
imageUrl: String
name: String
preMinedValue: String
proofType: String
sortOrder: String
sponsored: String
symbol: String
totalCoinSupply: String
totalCoinsFreeFloat: String
url: String
description: String
messages: [ErrorMessage]
ICO: ICO
}
type Tier {
tier: Float
fee: Float
}
type TradingTiers {
taker: [Tier]
maker: [Tier]
}
type TradingFees {
tierBased: Boolean
percentage: Boolean
tiers: TradingTiers
}
type FundingFee {
symbol: String
fee: Float
coin: Coin
}
type FundingFees {
tierBased: Boolean
percentage: Boolean
withdraw: [FundingFee]
deposit: [FundingFee]
}
type Fees {
trading: TradingFees
funding: FundingFees
}
type Market {
id: String
symbol: String
base: String
quote: String
darkpool: String
maker: Float
taker: Float
limits: String
precision: Int
tierBased: Boolean
percentage: Float
}
type Currency {
id: String
code: String
precision: Int
coin: Coin
}
type Exchange {
id: String
name: String
logo: String
url: [String]
hasOrderBook: Boolean
countries: [String]
fees: Fees
currencies: [Currency]
markets: [Market]
}
type PriceHistory{
time: Int
close: Float
high: Float
low: Float
open: Float
volumefrom: Float
volumeto: Float
}
type MarketCap {
symbol: String
rank: Int
last_updated: Float
price_usd: Float
volume_24h_usd: Float
market_cap_usd: Float
price_btc: Float
available_supply: Float
price: Float
market_cap: Float
volume_24h: Float
percent_change_1h: Float
percent_change_24h: Float
percent_change_7d: Float
total_supply: Float
coin: Coin
}
type Order {
price: Float
qty: Float
}
type OrderBook {
symbol: String
coin: Coin
exchange: Exchange
realToSymbol: String
last_updated: Float
asks: [Order]
bids: [Order]
}
`;
const schema = makeExecutableSchema({ typeDefs, resolvers });
module.exports = schema;