1+ # ########### Last Trade For A Crypto Pair ####################
2+ """
3+ """
4+ function last_trade_crypto_pair (opts:: PolyOpts , from= " BTC" , to= " USD" )
5+ params = Dict (
6+ " apiKey" => opts. api_key,
7+ " from" => from,
8+ " to" => to
9+ )
10+ last_trade_crypto_pair_url = " $crypto_last_trade_pair_base_url /$from /$to "
11+
12+ return generate_output_from_url (YesSinkYesLast (), last_trade_crypto_pair_url, params, opts. sink)
13+ end
14+
15+
16+ # ########################### Crypto Daily Open Close ####################
17+ """
18+ """
19+ function crypto_daily_open_close (opts:: PolyOpts , from= " BTC" , to= " USD" , date= " 2020-10-14" ; adjusted= true )
20+ params = Dict (
21+ " apiKey" => opts. api_key,
22+ " from" => from,
23+ " to" => to,
24+ " date" => date,
25+ " adjusted" => adjusted
26+ )
27+ crypto_daily_open_close_url = " $crypto_daily_open_close_base_url /$from /$to /$date "
28+
29+ return generate_output_from_url (NoSinkNoResults (), crypto_daily_open_close_url, params, opts. sink)
30+
31+ end
32+
33+
34+ # ########################### Historic Crypto Trades ####################
35+ """
36+ """
37+ function historic_crypto_trades (opts:: PolyOpts , from= " BTC" , to= " USD" , date= " 2020-10-14" ; limit= 100 , kwargs... )
38+ params = Dict (
39+ " apiKey" => opts. api_key,
40+ " from" => from,
41+ " to" => to,
42+ " date" => date,
43+ " limit" => limit
44+ )
45+
46+ merge! (params, Dict (kwargs))
47+ historic_crypto_trades_url = " $crypto_historic_trades_base_url /$from /$to /$date "
48+ return generate_output_from_url (NoSinkNoResults (), historic_crypto_trades_url, params, opts. sink)
49+ end
50+
51+
52+ # ########################### Crypto Grouped Daily Bars ####################
53+ """
54+ """
55+ function crypto_grouped_daily_bars (opts:: PolyOpts , date= " 2020-10-14" ; adjusted= true )
56+ params = Dict (
57+ " apiKey" => opts. api_key,
58+ " adjusted" => adjusted
59+ )
60+
61+ crypto_grouped_daily_bars_url = " $crypto_grouped_daily_bars_base_url /$date "
62+ return generate_output_from_url (YesSinkYesResults (), crypto_grouped_daily_bars_url, params, opts. sink)
63+ end
64+
65+
66+ # ########################### Crypto Previous Close ####################
67+ """
68+ """
69+ function crypto_previous_close (opts:: PolyOpts , cryptoTicker= " X:BTCUSD" ; adjusted= true )
70+ params = Dict (
71+ " apiKey" => opts. api_key,
72+ " adjusted" => adjusted
73+ )
74+
75+ crypto_previous_close_url = " $crypto_previous_close_base_url /$cryptoTicker /prev"
76+ return generate_output_from_url (YesSinkYesResults (), crypto_previous_close_url, params, opts. sink)
77+ end
78+
79+
80+ # ########################### Crypto Aggregate Bars ####################
81+ """
82+ """
83+ function crypto_aggregates_bars (opts:: PolyOpts ,
84+ cryptoTicker= " X:BTCUSD" ,
85+ multiplier= 1 ,
86+ timespan= " day" ,
87+ from= " 2020-10-14" ,
88+ to= " 2020-10-14" ;
89+ adjusted= true ,
90+ sort= " asc" ,
91+ limit= 120 ,
92+ kwargs... )
93+ params = Dict (
94+ " apiKey" => opts. api_key,
95+ " adjusted" => adjusted,
96+ " from" => from,
97+ " to" => to,
98+ " sort" => sort,
99+ " limit" => limit
100+ )
101+ merge! (params, Dict (kwargs))
102+ crypto_aggregate_bars_url = " $crypto_aggregates_bars_base_url /$cryptoTicker /range/$multiplier /$timespan /$from /$to "
103+ return generate_output_from_url (YesSinkYesResults (), crypto_aggregate_bars_url, params, opts. sink)
104+ end
105+
106+
107+ # ########################### Crypto Snapshot All Tickers ####################
108+ """
109+ """
110+ function crypto_snapshot_all_tickers (opts:: PolyOpts ; kwargs... )
111+ params = Dict (
112+ " apiKey" => opts. api_key
113+ )
114+ merge! (params, Dict (kwargs))
115+ crypto_snapshot_all_tickers_url = " $crypto_snapshot_all_tickers_base_url "
116+ return generate_output_from_url (YesSinkYesTickers (), crypto_snapshot_all_tickers_url, params, opts. sink)
117+ end
118+
119+
120+ # ########################### Crypto Snapshot Ticker ####################
121+ """
122+ """
123+ function crypto_snapshot_ticker (opts:: PolyOpts , ticker= " X:BTCUSD" )
124+ params = Dict (
125+ " apiKey" => opts. api_key
126+ )
127+
128+ crypto_snapshot_ticker_url = " $crypto_snapshot_ticker_base_url /$ticker "
129+ return generate_output_from_url (YesSinkYesTicker (), crypto_snapshot_ticker_url, params, opts. sink)
130+ end
131+
132+ # ########################### Crypto Snapshot Ticker Full Book ####################
133+ """
134+ """
135+ function crypto_snapshot_ticker_full_book (opts:: PolyOpts , ticker= " X:BTCUSD" )
136+ params = Dict (
137+ " apiKey" => opts. api_key,
138+ )
139+ crypto_snapshot_ticker_full_book_url = " $crypto_snapshot_ticker_full_book_base_url /$ticker /book"
140+ return generate_output_from_url (YesSinkYesData (), crypto_snapshot_ticker_full_book_url, params, opts. sink)
141+ end
142+
143+
144+ # ########################### Crypto Snapshot Gainers/Losers ####################
145+ """
146+ """
147+ function crypto_snapshot_gainers_losers (opts:: PolyOpts , direction= " gainers" )
148+ params = Dict (
149+ " apiKey" => opts. api_key
150+ )
151+ crypto_snapshot_gainers_losers_url = " $crypto_snapshot_gainers_losers_base_url /$direction "
152+ return generate_output_from_url (YesSinkYesTickers (), crypto_snapshot_gainers_losers_url, params, opts. sink)
153+ end
0 commit comments