coinbase-api 0.3.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/README.md +438 -14
  2. package/dist/cjs/CBAdvancedTradeClient.d.ts +559 -0
  3. package/dist/cjs/CBAdvancedTradeClient.js +574 -0
  4. package/dist/cjs/CBAdvancedTradeClient.js.map +1 -0
  5. package/dist/cjs/CBAppClient.d.ts +359 -0
  6. package/dist/cjs/CBAppClient.js +336 -0
  7. package/dist/cjs/CBAppClient.js.map +1 -0
  8. package/dist/cjs/CBCommerceClient.d.ts +110 -0
  9. package/dist/cjs/CBCommerceClient.js +105 -0
  10. package/dist/cjs/CBCommerceClient.js.map +1 -0
  11. package/dist/cjs/CBExchangeClient.d.ts +640 -0
  12. package/dist/cjs/CBExchangeClient.js +751 -0
  13. package/dist/cjs/CBExchangeClient.js.map +1 -0
  14. package/dist/cjs/CBInternationalClient.d.ts +381 -0
  15. package/dist/cjs/CBInternationalClient.js +437 -0
  16. package/dist/cjs/CBInternationalClient.js.map +1 -0
  17. package/dist/cjs/CBPrimeClient.d.ts +363 -0
  18. package/dist/cjs/CBPrimeClient.js +451 -0
  19. package/dist/cjs/CBPrimeClient.js.map +1 -0
  20. package/dist/cjs/WebsocketClient.d.ts +78 -0
  21. package/dist/cjs/WebsocketClient.js +534 -0
  22. package/dist/cjs/WebsocketClient.js.map +1 -0
  23. package/dist/cjs/index.d.ts +13 -0
  24. package/dist/cjs/index.js +30 -0
  25. package/dist/cjs/index.js.map +1 -0
  26. package/dist/cjs/lib/BaseRestClient.d.ts +66 -0
  27. package/dist/cjs/lib/BaseRestClient.js +436 -0
  28. package/dist/cjs/lib/BaseRestClient.js.map +1 -0
  29. package/dist/cjs/lib/BaseWSClient.d.ts +169 -0
  30. package/dist/cjs/lib/BaseWSClient.js +638 -0
  31. package/dist/cjs/lib/BaseWSClient.js.map +1 -0
  32. package/dist/cjs/lib/jwtNode.d.ts +13 -0
  33. package/dist/cjs/lib/jwtNode.js +52 -0
  34. package/dist/cjs/lib/jwtNode.js.map +1 -0
  35. package/dist/cjs/lib/misc-util.d.ts +1 -0
  36. package/dist/cjs/lib/misc-util.js +7 -0
  37. package/dist/cjs/lib/misc-util.js.map +1 -0
  38. package/dist/cjs/lib/requestUtils.d.ts +98 -0
  39. package/dist/cjs/lib/requestUtils.js +75 -0
  40. package/dist/cjs/lib/requestUtils.js.map +1 -0
  41. package/dist/cjs/lib/webCryptoAPI.d.ts +10 -0
  42. package/dist/cjs/lib/webCryptoAPI.js +83 -0
  43. package/dist/cjs/lib/webCryptoAPI.js.map +1 -0
  44. package/dist/cjs/lib/websocket/WsStore.d.ts +63 -0
  45. package/dist/cjs/lib/websocket/WsStore.js +254 -0
  46. package/dist/cjs/lib/websocket/WsStore.js.map +1 -0
  47. package/dist/cjs/lib/websocket/WsStore.types.d.ts +49 -0
  48. package/dist/cjs/lib/websocket/WsStore.types.js +14 -0
  49. package/dist/cjs/lib/websocket/WsStore.types.js.map +1 -0
  50. package/dist/cjs/lib/websocket/logger.d.ts +6 -0
  51. package/dist/cjs/lib/websocket/logger.js +16 -0
  52. package/dist/cjs/lib/websocket/logger.js.map +1 -0
  53. package/dist/cjs/lib/websocket/typeGuards.d.ts +27 -0
  54. package/dist/cjs/lib/websocket/typeGuards.js +86 -0
  55. package/dist/cjs/lib/websocket/typeGuards.js.map +1 -0
  56. package/dist/cjs/lib/websocket/websocket-util.d.ts +120 -0
  57. package/dist/cjs/lib/websocket/websocket-util.js +173 -0
  58. package/dist/cjs/lib/websocket/websocket-util.js.map +1 -0
  59. package/dist/cjs/package.json +3 -0
  60. package/dist/cjs/types/request/advanced-trade-client.d.ts +194 -0
  61. package/dist/cjs/types/request/advanced-trade-client.js +18 -0
  62. package/dist/cjs/types/request/advanced-trade-client.js.map +1 -0
  63. package/dist/cjs/types/request/coinbase-app-client.d.ts +80 -0
  64. package/dist/cjs/types/request/coinbase-app-client.js +28 -0
  65. package/dist/cjs/types/request/coinbase-app-client.js.map +1 -0
  66. package/dist/cjs/types/request/coinbase-exchange.d.ts +332 -0
  67. package/dist/cjs/types/request/coinbase-exchange.js +3 -0
  68. package/dist/cjs/types/request/coinbase-exchange.js.map +1 -0
  69. package/dist/cjs/types/request/coinbase-international.d.ts +160 -0
  70. package/dist/cjs/types/request/coinbase-international.js +13 -0
  71. package/dist/cjs/types/request/coinbase-international.js.map +1 -0
  72. package/dist/cjs/types/request/coinbase-prime.d.ts +298 -0
  73. package/dist/cjs/types/request/coinbase-prime.js +8 -0
  74. package/dist/cjs/types/request/coinbase-prime.js.map +1 -0
  75. package/dist/cjs/types/response/advanced-trade-client.d.ts +759 -0
  76. package/dist/cjs/types/response/advanced-trade-client.js +8 -0
  77. package/dist/cjs/types/response/advanced-trade-client.js.map +1 -0
  78. package/dist/cjs/types/response/coinbase-app-client.d.ts +168 -0
  79. package/dist/cjs/types/response/coinbase-app-client.js +18 -0
  80. package/dist/cjs/types/response/coinbase-app-client.js.map +1 -0
  81. package/dist/cjs/types/response/coinbase-exchange.d.ts +80 -0
  82. package/dist/cjs/types/response/coinbase-exchange.js +82 -0
  83. package/dist/cjs/types/response/coinbase-exchange.js.map +1 -0
  84. package/dist/cjs/types/response/coinbase-international.d.ts +40 -0
  85. package/dist/cjs/types/response/coinbase-international.js +42 -0
  86. package/dist/cjs/types/response/coinbase-international.js.map +1 -0
  87. package/dist/cjs/types/response/coinbase-prime.d.ts +70 -0
  88. package/dist/cjs/types/response/coinbase-prime.js +72 -0
  89. package/dist/cjs/types/response/coinbase-prime.js.map +1 -0
  90. package/dist/cjs/types/response/ws.d.ts +7 -0
  91. package/dist/cjs/types/response/ws.js +3 -0
  92. package/dist/cjs/types/response/ws.js.map +1 -0
  93. package/dist/cjs/types/shared.types.d.ts +60 -0
  94. package/dist/cjs/types/shared.types.js +3 -0
  95. package/dist/cjs/types/shared.types.js.map +1 -0
  96. package/dist/cjs/types/websockets/client.d.ts +73 -0
  97. package/dist/cjs/types/websockets/client.js +3 -0
  98. package/dist/cjs/types/websockets/client.js.map +1 -0
  99. package/dist/cjs/types/websockets/events.d.ts +40 -0
  100. package/dist/cjs/types/websockets/events.js +3 -0
  101. package/dist/cjs/types/websockets/events.js.map +1 -0
  102. package/dist/cjs/types/websockets/requests.d.ts +76 -0
  103. package/dist/cjs/types/websockets/requests.js +3 -0
  104. package/dist/cjs/types/websockets/requests.js.map +1 -0
  105. package/dist/cjs/types/websockets/wsAPI.d.ts +9 -0
  106. package/dist/cjs/types/websockets/wsAPI.js +3 -0
  107. package/dist/cjs/types/websockets/wsAPI.js.map +1 -0
  108. package/dist/mjs/CBAdvancedTradeClient.d.ts +559 -0
  109. package/dist/mjs/CBAdvancedTradeClient.js +570 -0
  110. package/dist/mjs/CBAdvancedTradeClient.js.map +1 -0
  111. package/dist/mjs/CBAppClient.d.ts +359 -0
  112. package/dist/mjs/CBAppClient.js +332 -0
  113. package/dist/mjs/CBAppClient.js.map +1 -0
  114. package/dist/mjs/CBCommerceClient.d.ts +110 -0
  115. package/dist/mjs/CBCommerceClient.js +101 -0
  116. package/dist/mjs/CBCommerceClient.js.map +1 -0
  117. package/dist/mjs/CBExchangeClient.d.ts +640 -0
  118. package/dist/mjs/CBExchangeClient.js +747 -0
  119. package/dist/mjs/CBExchangeClient.js.map +1 -0
  120. package/dist/mjs/CBInternationalClient.d.ts +381 -0
  121. package/dist/mjs/CBInternationalClient.js +433 -0
  122. package/dist/mjs/CBInternationalClient.js.map +1 -0
  123. package/dist/mjs/CBPrimeClient.d.ts +363 -0
  124. package/dist/mjs/CBPrimeClient.js +447 -0
  125. package/dist/mjs/CBPrimeClient.js.map +1 -0
  126. package/dist/mjs/WebsocketClient.d.ts +78 -0
  127. package/dist/mjs/WebsocketClient.js +530 -0
  128. package/dist/mjs/WebsocketClient.js.map +1 -0
  129. package/dist/mjs/index.d.ts +13 -0
  130. package/dist/mjs/index.js +14 -0
  131. package/dist/mjs/index.js.map +1 -0
  132. package/dist/mjs/lib/BaseRestClient.d.ts +66 -0
  133. package/dist/mjs/lib/BaseRestClient.js +429 -0
  134. package/dist/mjs/lib/BaseRestClient.js.map +1 -0
  135. package/dist/mjs/lib/BaseWSClient.d.ts +169 -0
  136. package/dist/mjs/lib/BaseWSClient.js +631 -0
  137. package/dist/mjs/lib/BaseWSClient.js.map +1 -0
  138. package/dist/mjs/lib/jwtNode.d.ts +13 -0
  139. package/dist/mjs/lib/jwtNode.js +45 -0
  140. package/dist/mjs/lib/jwtNode.js.map +1 -0
  141. package/dist/mjs/lib/misc-util.d.ts +1 -0
  142. package/dist/mjs/lib/misc-util.js +4 -0
  143. package/dist/mjs/lib/misc-util.js.map +1 -0
  144. package/dist/mjs/lib/requestUtils.d.ts +98 -0
  145. package/dist/mjs/lib/requestUtils.js +69 -0
  146. package/dist/mjs/lib/requestUtils.js.map +1 -0
  147. package/dist/mjs/lib/webCryptoAPI.d.ts +10 -0
  148. package/dist/mjs/lib/webCryptoAPI.js +79 -0
  149. package/dist/mjs/lib/webCryptoAPI.js.map +1 -0
  150. package/dist/mjs/lib/websocket/WsStore.d.ts +63 -0
  151. package/dist/mjs/lib/websocket/WsStore.js +249 -0
  152. package/dist/mjs/lib/websocket/WsStore.js.map +1 -0
  153. package/dist/mjs/lib/websocket/WsStore.types.d.ts +49 -0
  154. package/dist/mjs/lib/websocket/WsStore.types.js +11 -0
  155. package/dist/mjs/lib/websocket/WsStore.types.js.map +1 -0
  156. package/dist/mjs/lib/websocket/logger.d.ts +6 -0
  157. package/dist/mjs/lib/websocket/logger.js +13 -0
  158. package/dist/mjs/lib/websocket/logger.js.map +1 -0
  159. package/dist/mjs/lib/websocket/typeGuards.d.ts +27 -0
  160. package/dist/mjs/lib/websocket/typeGuards.js +78 -0
  161. package/dist/mjs/lib/websocket/typeGuards.js.map +1 -0
  162. package/dist/mjs/lib/websocket/websocket-util.d.ts +120 -0
  163. package/dist/mjs/lib/websocket/websocket-util.js +164 -0
  164. package/dist/mjs/lib/websocket/websocket-util.js.map +1 -0
  165. package/dist/mjs/package.json +3 -0
  166. package/dist/mjs/types/request/advanced-trade-client.d.ts +194 -0
  167. package/dist/mjs/types/request/advanced-trade-client.js +17 -0
  168. package/dist/mjs/types/request/advanced-trade-client.js.map +1 -0
  169. package/dist/mjs/types/request/coinbase-app-client.d.ts +80 -0
  170. package/dist/mjs/types/request/coinbase-app-client.js +27 -0
  171. package/dist/mjs/types/request/coinbase-app-client.js.map +1 -0
  172. package/dist/mjs/types/request/coinbase-exchange.d.ts +332 -0
  173. package/dist/mjs/types/request/coinbase-exchange.js +2 -0
  174. package/dist/mjs/types/request/coinbase-exchange.js.map +1 -0
  175. package/dist/mjs/types/request/coinbase-international.d.ts +160 -0
  176. package/dist/mjs/types/request/coinbase-international.js +12 -0
  177. package/dist/mjs/types/request/coinbase-international.js.map +1 -0
  178. package/dist/mjs/types/request/coinbase-prime.d.ts +298 -0
  179. package/dist/mjs/types/request/coinbase-prime.js +7 -0
  180. package/dist/mjs/types/request/coinbase-prime.js.map +1 -0
  181. package/dist/mjs/types/response/advanced-trade-client.d.ts +759 -0
  182. package/dist/mjs/types/response/advanced-trade-client.js +7 -0
  183. package/dist/mjs/types/response/advanced-trade-client.js.map +1 -0
  184. package/dist/mjs/types/response/coinbase-app-client.d.ts +168 -0
  185. package/dist/mjs/types/response/coinbase-app-client.js +17 -0
  186. package/dist/mjs/types/response/coinbase-app-client.js.map +1 -0
  187. package/dist/mjs/types/response/coinbase-exchange.d.ts +80 -0
  188. package/dist/mjs/types/response/coinbase-exchange.js +82 -0
  189. package/dist/mjs/types/response/coinbase-exchange.js.map +1 -0
  190. package/dist/mjs/types/response/coinbase-international.d.ts +40 -0
  191. package/dist/mjs/types/response/coinbase-international.js +42 -0
  192. package/dist/mjs/types/response/coinbase-international.js.map +1 -0
  193. package/dist/mjs/types/response/coinbase-prime.d.ts +70 -0
  194. package/dist/mjs/types/response/coinbase-prime.js +72 -0
  195. package/dist/mjs/types/response/coinbase-prime.js.map +1 -0
  196. package/dist/mjs/types/response/ws.d.ts +7 -0
  197. package/dist/mjs/types/response/ws.js +2 -0
  198. package/dist/mjs/types/response/ws.js.map +1 -0
  199. package/dist/mjs/types/shared.types.d.ts +60 -0
  200. package/dist/mjs/types/shared.types.js +2 -0
  201. package/dist/mjs/types/shared.types.js.map +1 -0
  202. package/dist/mjs/types/websockets/client.d.ts +73 -0
  203. package/dist/mjs/types/websockets/client.js +2 -0
  204. package/dist/mjs/types/websockets/client.js.map +1 -0
  205. package/dist/mjs/types/websockets/events.d.ts +40 -0
  206. package/dist/mjs/types/websockets/events.js +2 -0
  207. package/dist/mjs/types/websockets/events.js.map +1 -0
  208. package/dist/mjs/types/websockets/requests.d.ts +76 -0
  209. package/dist/mjs/types/websockets/requests.js +2 -0
  210. package/dist/mjs/types/websockets/requests.js.map +1 -0
  211. package/dist/mjs/types/websockets/wsAPI.d.ts +9 -0
  212. package/dist/mjs/types/websockets/wsAPI.js +2 -0
  213. package/dist/mjs/types/websockets/wsAPI.js.map +1 -0
  214. package/package.json +42 -30
  215. package/index.js +0 -1
  216. package/lib/index.d.ts +0 -1
  217. package/lib/index.js +0 -16
  218. package/lib/index.js.map +0 -1
@@ -0,0 +1,559 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+ import { BaseRestClient } from './lib/BaseRestClient.js';
3
+ import { RestClientOptions, RestClientType } from './lib/requestUtils.js';
4
+ import { AllocateAdvTradePortfolioRequest, CloseAdvTradePositionRequest, GetAdvTradeFillsRequest, GetAdvTradeMarketTradesRequest, GetAdvTradeOrdersRequest, GetAdvTradeProductCandlesRequest, GetAdvTradeProductsRequest, GetAdvTradePublicMarketTradesRequest, GetAdvTradePublicProductCandlesRequest, GetAdvTradePublicProductsRequest, GetAdvTradeTransactionSummaryRequest, MoveAdvTradePortfolioFundsRequest, PreviewAdvTradeOrderRequest, SubmitAdvTradeConvertQuoteRequest, SubmitAdvTradeOrderRequest } from './types/request/advanced-trade-client.js';
5
+ import { AdvTradeAccount, AdvTradeAccountsList, AdvTradeApiKeyPermissions, AdvTradeCancelOrdersResponse, AdvTradeCandle, AdvTradeClosePositionResponse, AdvTradeCurrentMarginWindow, AdvTradeEditOrderPreviewResponse, AdvTradeEditOrderResponse, AdvTradeFill, AdvTradeFuturesBalance, AdvTradeFuturesPosition, AdvTradeFuturesSweep, AdvTradeMarketTrades, AdvTradeOrder, AdvTradeOrderPreview, AdvTradePaymentMethod, AdvTradePerpetualsPortfolio, AdvTradePerpetualsPosition, AdvTradePerpetualsPositionSummary, AdvTradePortfolio, AdvTradePortfolioBalance, AdvTradePortfolioBreakdown, AdvTradePricebook, AdvTradeProduct, AdvTradePublicProduct, AdvTradeSubmitOrderResponse, AdvTradeTransactionSummary } from './types/response/advanced-trade-client.js';
6
+ /**
7
+ * REST client for Coinbase's Advanced Trade API:
8
+ * https://docs.cdp.coinbase.com/advanced-trade/docs/api-overview/
9
+ */
10
+ export declare class CBAdvancedTradeClient extends BaseRestClient {
11
+ constructor(restClientOptions?: RestClientOptions, requestOptions?: AxiosRequestConfig);
12
+ getClientType(): RestClientType;
13
+ /**
14
+ *
15
+ * Account Endpoints
16
+ *
17
+ */
18
+ /**
19
+ * List Accounts
20
+ *
21
+ * Get a list of authenticated accounts for the current user.
22
+ */
23
+ getAccounts(params?: {
24
+ limit?: number;
25
+ cursor?: string;
26
+ retail_portfolio_id?: string;
27
+ }): Promise<AdvTradeAccountsList>;
28
+ /**
29
+ * Get Account
30
+ *
31
+ * Get a list of information about single account, given an account UUID.
32
+ * Tip: Use List Accounts (getAccounts funcion) to find account UUIDs.
33
+ */
34
+ getAccount(params: {
35
+ account_id: string;
36
+ }): Promise<{
37
+ account: AdvTradeAccount;
38
+ }>;
39
+ /**
40
+ *
41
+ * Products Endpoints
42
+ *
43
+ */
44
+ /**
45
+ * Get Best Bid/Ask
46
+ *
47
+ * Get the best bid/ask for all products. A subset of all products can be returned instead by using the product_ids input.
48
+ */
49
+ getBestBidAsk(params?: {
50
+ product_ids?: string[];
51
+ }): Promise<{
52
+ pricebooks: AdvTradePricebook[];
53
+ }>;
54
+ /**
55
+ * Get Product Book
56
+ *
57
+ * Get a list of bids/asks for a single product. The amount of detail shown can be customized with the limit parameter.
58
+ */
59
+ getProductBook(params: {
60
+ product_id: string;
61
+ limit?: number;
62
+ aggregation_price_increment?: string;
63
+ }): Promise<{
64
+ pricebook: AdvTradePricebook;
65
+ }>;
66
+ /**
67
+ * List Products
68
+ *
69
+ * Get a list of the available currency pairs for trading.
70
+ *
71
+ */
72
+ getProducts(params?: GetAdvTradeProductsRequest): Promise<{
73
+ products: AdvTradeProduct[];
74
+ num_products: number;
75
+ }>;
76
+ /**
77
+ * Get Product
78
+ *
79
+ * Get information on a single product by product ID.
80
+ */
81
+ getProduct(params: {
82
+ product_id: string;
83
+ get_tradability_status?: boolean;
84
+ }): Promise<AdvTradeProduct>;
85
+ /**
86
+ * Get Product Candles
87
+ *
88
+ * Get rates for a single product by product ID, grouped in buckets.
89
+ */
90
+ getProductCandles(params: GetAdvTradeProductCandlesRequest): Promise<{
91
+ candles: AdvTradeCandle[];
92
+ }>;
93
+ /**
94
+ * Get Market Trades
95
+ *
96
+ * Get snapshot information by product ID about the last trades (ticks) and best bid/ask.
97
+ */
98
+ getMarketTrades(params: GetAdvTradeMarketTradesRequest): Promise<AdvTradeMarketTrades>;
99
+ /**
100
+ *
101
+ * Orders Endpoints
102
+ *
103
+ */
104
+ /**
105
+ * Create Order
106
+ *
107
+ * Create an order with a specified product_id (asset-pair), side (buy/sell), etc.
108
+ *
109
+ */
110
+ submitOrder(params: SubmitAdvTradeOrderRequest): Promise<AdvTradeSubmitOrderResponse>;
111
+ /**
112
+ * Cancel Orders
113
+ *
114
+ * Initiate cancel requests for one or more orders.
115
+ * The maximum number of order_ids that can be cancelled per request is 100.
116
+ * This number may be subject to change in emergency, but if a request exceeds the max,
117
+ * then an InvalidArgument error code will be returned with an error message denoting the limit.
118
+ */
119
+ cancelOrders(params: {
120
+ order_ids: string[];
121
+ }): Promise<AdvTradeCancelOrdersResponse>;
122
+ /**
123
+ * Edit Order
124
+ *
125
+ * Edit an order with a specified new size, or new price.
126
+ *
127
+ * - Your request moves to the back of the queue if you increase the size or increase or decrease the price.
128
+ * - If you decrease the size, you keep your place in line.
129
+ * - A client can only send an Edit Order request after the previous request for the same order has been fully processed.
130
+ */
131
+ updateOrder(params: {
132
+ order_id: string;
133
+ price?: string;
134
+ size?: string;
135
+ }): Promise<AdvTradeEditOrderResponse>;
136
+ /**
137
+ * Edit Order Preview
138
+ *
139
+ * Preview an edit order request with a specified new size, or new price.
140
+ *
141
+ */
142
+ updateOrderPreview(params: {
143
+ order_id: string;
144
+ price?: string;
145
+ size?: string;
146
+ }): Promise<AdvTradeEditOrderPreviewResponse>;
147
+ /**
148
+ * List Orders
149
+ *
150
+ * Get a list of orders filtered by optional query parameters.
151
+ *
152
+ * - The maximum number of OPEN orders returned is 1000.
153
+ * - The parameters start_date and end_date don't apply to open orders.
154
+ * - You cannot pair open orders with other order types.
155
+ * - You cannot query for OPEN orders with other order types.
156
+ */
157
+ getOrders(params?: GetAdvTradeOrdersRequest): Promise<{
158
+ orders: AdvTradeOrder[];
159
+ sequence?: number;
160
+ has_next: boolean;
161
+ cursor?: string;
162
+ }>;
163
+ /**
164
+ * List Fills
165
+ *
166
+ * Get a list of fills filtered by optional query parameters (product_id, order_id, etc).
167
+ *
168
+ */
169
+ getFills(params?: GetAdvTradeFillsRequest): Promise<{
170
+ fills: AdvTradeFill[];
171
+ cursor?: string;
172
+ }>;
173
+ /**
174
+ * Get Order
175
+ *
176
+ * Get a single order by order ID.
177
+ */
178
+ getOrder(params: {
179
+ order_id: string;
180
+ client_order_id?: string;
181
+ user_native_currency?: string;
182
+ }): Promise<{
183
+ order: AdvTradeOrder;
184
+ }>;
185
+ /**
186
+ * Preview Order
187
+ *
188
+ * Preview an order.
189
+ *
190
+ */
191
+ previewOrder(params: PreviewAdvTradeOrderRequest): Promise<AdvTradeOrderPreview>;
192
+ /**
193
+ * Close Position
194
+ *
195
+ * Places an order to close any open positions for a specified product_id.
196
+ *
197
+ */
198
+ closePosition(params: CloseAdvTradePositionRequest): Promise<AdvTradeClosePositionResponse>;
199
+ /**
200
+ *
201
+ * Portfolios Endpoints
202
+ *
203
+ */
204
+ /**
205
+ * List Portfolios
206
+ *
207
+ * Get all portfolios of a user.
208
+ */
209
+ getPortfolios(params?: {
210
+ portfolio_type?: 'UNDEFINED' | 'DEFAULT' | 'CONSUMER' | 'INTX';
211
+ }): Promise<{
212
+ portfolios: AdvTradePortfolio[];
213
+ }>;
214
+ /**
215
+ * Create Portfolio
216
+ *
217
+ * Create a portfolio.
218
+ */
219
+ createPortfolio(params: {
220
+ name: string;
221
+ }): Promise<{
222
+ portfolio: AdvTradePortfolio;
223
+ }>;
224
+ /**
225
+ * Move Portfolio Funds
226
+ *
227
+ * Move funds between portfolios.
228
+ */
229
+ movePortfolioFunds(params: MoveAdvTradePortfolioFundsRequest): Promise<{
230
+ source_portfolio_uuid: string;
231
+ target_portfolio_uuid: string;
232
+ }>;
233
+ /**
234
+ * Get Portfolio Breakdown
235
+ *
236
+ * Get the breakdown of a portfolio.
237
+ */
238
+ getPortfolioBreakdown(params: {
239
+ portfolio_uuid: string;
240
+ currency?: string;
241
+ }): Promise<{
242
+ breakdown: AdvTradePortfolioBreakdown;
243
+ }>;
244
+ /**
245
+ * Delete Portfolio
246
+ *
247
+ * Delete a portfolio.
248
+ */
249
+ deletePortfolio(params: {
250
+ portfolio_uuid: string;
251
+ }): Promise<any>;
252
+ /**
253
+ * Edit Portfolio
254
+ *
255
+ * Edit a portfolio.
256
+ *
257
+ */
258
+ updatePortfolio(params: {
259
+ portfolio_uuid: string;
260
+ name: string;
261
+ }): Promise<{
262
+ portfolio: AdvTradePortfolio;
263
+ }>;
264
+ /**
265
+ *
266
+ * Futures Endpoints
267
+ *
268
+ */
269
+ /**
270
+ * Get Futures Balance Summary
271
+ *
272
+ * Get a summary of balances for CFM trading.
273
+ *
274
+ * Futures vs Spot Accounts:
275
+ * - Futures and spot balances are held in different accounts.
276
+ * - Cash is always deposited into your Coinbase Inc. (CBI) spot account.
277
+ * - Cash is automatically transferred to your Coinbase Financial Markets (CFM) futures account to satisfy margin requirements.
278
+ * - You can transfer cash that isn't being used to margin or maintain futures positions into your CBI spot account.
279
+ * - Funds held in a CBI spot account do not receive the preferential treatment given to funds held in a regulated futures account.
280
+ *
281
+ * Intraday vs. Overnight Margin Health:
282
+ * - If you are opted in to receive increased leverage on futures trades during the intraday window (from 8am-4pm ET), this endpoint will return your intraday and overnight margin health.
283
+ */
284
+ getFuturesBalanceSummary(): Promise<{
285
+ balance_summary: AdvTradeFuturesBalance;
286
+ }>;
287
+ /**
288
+ * Get Intraday Margin Setting
289
+ *
290
+ * Get the futures intraday margin setting.
291
+ */
292
+ getIntradayMarginSetting(): Promise<{
293
+ setting: 'INTRADAY_MARGIN_SETTING_UNSPECIFIED' | 'INTRADAY_MARGIN_SETTING_STANDARD' | 'INTRADAY_MARGIN_SETTING_INTRADAY';
294
+ }>;
295
+ /**
296
+ * Set Intraday Margin Setting
297
+ *
298
+ * Set the futures intraday margin setting.
299
+ */
300
+ setIntradayMarginSetting(params?: {
301
+ setting?: 'INTRADAY_MARGIN_SETTING_UNSPECIFIED' | 'INTRADAY_MARGIN_SETTING_STANDARD' | 'INTRADAY_MARGIN_SETTING_INTRADAY';
302
+ }): Promise<any>;
303
+ /**
304
+ * Get Current Margin Window
305
+ *
306
+ * Get the futures current margin window.
307
+ */
308
+ getCurrentMarginWindow(params?: {
309
+ margin_profile_type?: 'MARGIN_PROFILE_TYPE_UNSPECIFIED' | 'MARGIN_PROFILE_TYPE_RETAIL_REGULAR' | 'MARGIN_PROFILE_TYPE_RETAIL_INTRADAY_MARGIN_1';
310
+ }): Promise<AdvTradeCurrentMarginWindow>;
311
+ /**
312
+ * List Futures Positions
313
+ *
314
+ * Get a list of positions in CFM products.
315
+ */
316
+ getFuturesPositions(): Promise<{
317
+ positions: AdvTradeFuturesPosition[];
318
+ }>;
319
+ /**
320
+ * Get Futures Position
321
+ *
322
+ * Get positions for a specific CFM product.
323
+ */
324
+ getFuturesPosition(params: {
325
+ product_id: string;
326
+ }): Promise<{
327
+ position: AdvTradeFuturesPosition;
328
+ }>;
329
+ /**
330
+ * Schedule Futures Sweep
331
+ *
332
+ * Schedules a sweep of funds from FCM wallet to USD Spot wallet.
333
+ *
334
+ * Futures Sweep Processing:
335
+ * - Sweep requests submitted before 5PM ET each day are processed the following business day.
336
+ * - Sweep requests submitted after 5PM ET each day are processed in 2 business days.
337
+ * - You can have at most one pending sweep request at a time.
338
+ *
339
+ * Market movements related to your open positions may impact the final amount that is transferred into your spot account.
340
+ * The final funds transferred, up to your specified amount, depend on the available excess in your futures account.
341
+ */
342
+ scheduleFuturesSweep(params?: {
343
+ usd_amount?: string;
344
+ }): Promise<{
345
+ success: boolean;
346
+ }>;
347
+ /**
348
+ * List Futures Sweeps
349
+ *
350
+ * Get pending and processing sweeps of funds from FCM wallet to USD Spot wallet.
351
+ *
352
+ * Pending vs. Processing Sweeps:
353
+ * - A pending sweep is a sweep that has not started processing and can be cancelled.
354
+ * - A processing sweep is a sweep that is currently being processed and cannot be cancelled.
355
+ * - Once a sweep is complete, it no longer appears in the list of sweeps.
356
+ */
357
+ getFuturesSweeps(): Promise<{
358
+ sweeps: AdvTradeFuturesSweep[];
359
+ }>;
360
+ /**
361
+ * Cancel Pending Futures Sweep
362
+ *
363
+ * Cancel the pending sweep of funds from FCM wallet to USD Spot wallet.
364
+ */
365
+ cancelPendingFuturesSweep(): Promise<{
366
+ success: boolean;
367
+ }>;
368
+ /**
369
+ *
370
+ * Perpetuals Endpoints
371
+ *
372
+ */
373
+ /**
374
+ * Allocate Portfolio
375
+ *
376
+ * Allocate portfolio funds to a sub-portfolio on Intx Portfolio.
377
+ *
378
+ */
379
+ allocatePortfolio(params: AllocateAdvTradePortfolioRequest): Promise<any>;
380
+ /**
381
+ * Get Perpetuals Portfolio Summary
382
+ *
383
+ * Get a summary of your Perpetuals portfolio.
384
+ */
385
+ getPerpetualsPortfolioSummary(params: {
386
+ portfolio_uuid: string;
387
+ }): Promise<AdvTradePerpetualsPortfolio>;
388
+ /**
389
+ * List Perpetuals Positions
390
+ *
391
+ * Get a list of open positions in your Perpetuals portfolio.
392
+ */
393
+ getPerpetualsPositions(params: {
394
+ portfolio_uuid: string;
395
+ }): Promise<AdvTradePerpetualsPositionSummary>;
396
+ /**
397
+ * Get Perpetuals Position
398
+ *
399
+ * Get a specific open position on Intx.
400
+ *
401
+ */
402
+ getPerpetualsPosition(params: {
403
+ portfolio_uuid: string;
404
+ symbol: string;
405
+ }): Promise<{
406
+ position: AdvTradePerpetualsPosition;
407
+ }>;
408
+ /**
409
+ * Get Portfolios Balances
410
+ *
411
+ * Get a list of asset balances on Intx for a given Portfolio.
412
+ */
413
+ getPortfoliosBalances(params: {
414
+ portfolio_uuid: string;
415
+ }): Promise<{
416
+ portfolio_balances: AdvTradePortfolioBalance[];
417
+ }>;
418
+ /**
419
+ * Opt In or Out of Multi Asset Collateral
420
+ *
421
+ * Enable or Disable Multi Asset Collateral for a given Portfolio.
422
+ */
423
+ updateMultiAssetCollateral(params?: {
424
+ portfolio_uuid?: string;
425
+ multi_asset_collateral_enabled?: boolean;
426
+ }): Promise<{
427
+ multi_asset_collateral_enabled: boolean;
428
+ }>;
429
+ /**
430
+ *
431
+ * Fees Endpoints
432
+ *
433
+ */
434
+ /**
435
+ * Get Transaction Summary
436
+ *
437
+ * Get a summary of transactions with fee tiers, total volume, and fees.
438
+ */
439
+ getTransactionSummary(params?: GetAdvTradeTransactionSummaryRequest): Promise<AdvTradeTransactionSummary>;
440
+ /**
441
+ *
442
+ * Converts Endpoints
443
+ *
444
+ */
445
+ /**
446
+ * Create Convert Quote
447
+ *
448
+ * Create a convert quote with a specified source account, target account, and amount.
449
+ * Convert is applicable for USDC-USD and EURC-EUR conversion.
450
+ */
451
+ submitConvertQuote(params: SubmitAdvTradeConvertQuoteRequest): Promise<any>;
452
+ /**
453
+ * Get Convert Trade
454
+ *
455
+ * Gets a list of information about a convert trade with a specified trade id, source account, and target account.
456
+ */
457
+ getConvertTrade(params: {
458
+ trade_id: string;
459
+ from_account: string;
460
+ to_account: string;
461
+ }): Promise<any>;
462
+ /**
463
+ * Commit Convert Trade
464
+ *
465
+ * Commits a convert trade with a specified trade id, source account, and target account.
466
+ */
467
+ commitConvertTrade(params: {
468
+ trade_id: string;
469
+ from_account: string;
470
+ to_account: string;
471
+ }): Promise<any>;
472
+ /**
473
+ *
474
+ * Public Endpoints
475
+ *
476
+ */
477
+ getServerTime(): Promise<{
478
+ iso: string;
479
+ epochSeconds: number;
480
+ epochMillis: number;
481
+ }>;
482
+ /**
483
+ * Get Public Product Book
484
+ *
485
+ * Get a list of bids/asks for a single product. The amount of detail shown can be customized with the limit parameter.
486
+ */
487
+ getPublicProductBook(params: {
488
+ product_id: string;
489
+ limit?: number;
490
+ aggregation_price_increment?: string;
491
+ }): Promise<{
492
+ pricebook: AdvTradePricebook;
493
+ }>;
494
+ /**
495
+ * List Public Products
496
+ *
497
+ * Get a list of the available currency pairs for trading.
498
+ */
499
+ getPublicProducts(params?: GetAdvTradePublicProductsRequest): Promise<{
500
+ products: AdvTradePublicProduct[];
501
+ num_products: number;
502
+ }>;
503
+ /**
504
+ * Get Public Product
505
+ *
506
+ * Get information on a single product by product ID.
507
+ */
508
+ getPublicProduct(params: {
509
+ product_id: string;
510
+ }): Promise<AdvTradePublicProduct>;
511
+ /**
512
+ * Get Public Product Candles
513
+ *
514
+ * Get rates for a single product by product ID, grouped in buckets.
515
+ */
516
+ getPublicProductCandles(params: GetAdvTradePublicProductCandlesRequest): Promise<{
517
+ candles: AdvTradeCandle[];
518
+ }>;
519
+ /**
520
+ * Get Public Market Trades
521
+ *
522
+ * Get snapshot information by product ID about the last trades (ticks) and best bid/ask.
523
+ */
524
+ getPublicMarketTrades(params: GetAdvTradePublicMarketTradesRequest): Promise<AdvTradeMarketTrades>;
525
+ /**
526
+ *
527
+ * Payment Methods Endpoints
528
+ *
529
+ */
530
+ /**
531
+ * List Payment Methods
532
+ *
533
+ * Get a list of payment methods for the current user.
534
+ */
535
+ getPaymentMethods(): Promise<{
536
+ payment_methods: AdvTradePaymentMethod[];
537
+ }>;
538
+ /**
539
+ * Get Payment Method
540
+ *
541
+ * Get information about a payment method for the current user.
542
+ */
543
+ getPaymentMethod(params: {
544
+ payment_method_id: string;
545
+ }): Promise<{
546
+ payment_method: AdvTradePaymentMethod;
547
+ }>;
548
+ /**
549
+ *
550
+ * Data API Endpoints
551
+ *
552
+ */
553
+ /**
554
+ * Get API Key Permissions
555
+ *
556
+ * Get information about your CDP API key permissions.
557
+ */
558
+ getApiKeyPermissions(): Promise<AdvTradeApiKeyPermissions>;
559
+ }