-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
119 lines (96 loc) · 5.88 KB
/
index.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
const querystring = require('querystring')
const client = require('./client')
exports.getProducts = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/products?' + stringify(query)
}, env).then(toString).then(parse)
exports.getProductOrderBook = (productId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/products/' + productId + '/book?' + stringify(query)
}, env).then(toString).then(parse)
exports.getProductTicker = (productId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/products/' + productId + '/ticker?' + stringify(query)
}, env).then(toString).then(parse)
exports.getProductTrades = (productId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/products/' + productId + '/trades?' + stringify(query)
}, env).then(toString).then(parse)
exports.getProductHistoricRates = (productId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/products/' + productId + '/candles?' + stringify(query)
}, env).then(toString).then(parse)
exports.getProduct24HrStats = (productId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/products/' + productId + '/stats?' + stringify(query)
}, env).then(toString).then(parse)
exports.getCurrencies = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/currencies?' + stringify(query)
}, env).then(toString).then(parse)
exports.getTime = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/time?' + stringify(query)
}, env).then(toString).then(parse)
exports.getCoinbaseAccounts = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/coinbase-accounts?' + stringify(query)
}, env).then(toString).then(parse)
exports.getPaymentMethods = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/payment-methods?' + stringify(query)
}, env).then(toString).then(parse)
exports.getAccounts = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/accounts?' + stringify(query)
}, env).then(toString).then(parse)
exports.getAccount = (accountId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/accounts/' + accountId + '?' + stringify(query)
}, env).then(toString).then(parse)
exports.getAccountHistory = (accountId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/accounts/' + accountId + '/ledger?' + stringify(query)
}, env).then(toString).then(parse)
exports.getAccountTransfers = (accountId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/accounts/' + accountId + '/transfers?' + stringify(query)
}, env).then(toString).then(parse)
exports.getAccountHolds = (accountId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/accounts/' + accountId + '/holds?' + stringify(query)
}, env).then(toString).then(parse)
exports.placeOrder = (data, env = process.env, { parse } = JSON, { stringify } = JSON, { toString, request } = client) => request({
method: 'post',
path: '/orders',
body: stringify(data)
}, env).then(toString).then(parse)
exports.getTrailingVolume = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/users/self/trailing-volume?' + stringify(query)
}, env).then(toString).then(parse)
exports.cancelOrder = (orderId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'delete',
path: '/orders/' + orderId + '?' + stringify(query)
}, env).then(toString).then(parse)
exports.cancelOrders = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'delete',
path: '/orders?' + stringify(query)
}, env).then(toString).then(parse)
exports.getOrders = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/orders?' + stringify(query)
}, env).then(toString).then(parse)
exports.getOrder = (orderId, query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/orders/' + orderId + '?' + stringify(query)
}, env).then(toString).then(parse)
exports.getFills = (query = {}, env = process.env, { parse } = JSON, { stringify } = querystring, { toString, request } = client) => request({
method: 'get',
path: '/fills?' + stringify(query)
}, env).then(toString).then(parse)
exports.convert = (data, env = process.env, { parse } = JSON, { stringify } = JSON, { toString, request } = client) => request({
method: 'post',
path: '/conversions',
body: stringify(data)
}, env).then(toString).then(parse)