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.
- package/README.md +438 -14
- package/dist/cjs/CBAdvancedTradeClient.d.ts +559 -0
- package/dist/cjs/CBAdvancedTradeClient.js +574 -0
- package/dist/cjs/CBAdvancedTradeClient.js.map +1 -0
- package/dist/cjs/CBAppClient.d.ts +359 -0
- package/dist/cjs/CBAppClient.js +336 -0
- package/dist/cjs/CBAppClient.js.map +1 -0
- package/dist/cjs/CBCommerceClient.d.ts +110 -0
- package/dist/cjs/CBCommerceClient.js +105 -0
- package/dist/cjs/CBCommerceClient.js.map +1 -0
- package/dist/cjs/CBExchangeClient.d.ts +640 -0
- package/dist/cjs/CBExchangeClient.js +751 -0
- package/dist/cjs/CBExchangeClient.js.map +1 -0
- package/dist/cjs/CBInternationalClient.d.ts +381 -0
- package/dist/cjs/CBInternationalClient.js +437 -0
- package/dist/cjs/CBInternationalClient.js.map +1 -0
- package/dist/cjs/CBPrimeClient.d.ts +363 -0
- package/dist/cjs/CBPrimeClient.js +451 -0
- package/dist/cjs/CBPrimeClient.js.map +1 -0
- package/dist/cjs/WebsocketClient.d.ts +78 -0
- package/dist/cjs/WebsocketClient.js +534 -0
- package/dist/cjs/WebsocketClient.js.map +1 -0
- package/dist/cjs/index.d.ts +13 -0
- package/dist/cjs/index.js +30 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/lib/BaseRestClient.d.ts +66 -0
- package/dist/cjs/lib/BaseRestClient.js +436 -0
- package/dist/cjs/lib/BaseRestClient.js.map +1 -0
- package/dist/cjs/lib/BaseWSClient.d.ts +169 -0
- package/dist/cjs/lib/BaseWSClient.js +638 -0
- package/dist/cjs/lib/BaseWSClient.js.map +1 -0
- package/dist/cjs/lib/jwtNode.d.ts +13 -0
- package/dist/cjs/lib/jwtNode.js +52 -0
- package/dist/cjs/lib/jwtNode.js.map +1 -0
- package/dist/cjs/lib/misc-util.d.ts +1 -0
- package/dist/cjs/lib/misc-util.js +7 -0
- package/dist/cjs/lib/misc-util.js.map +1 -0
- package/dist/cjs/lib/requestUtils.d.ts +98 -0
- package/dist/cjs/lib/requestUtils.js +75 -0
- package/dist/cjs/lib/requestUtils.js.map +1 -0
- package/dist/cjs/lib/webCryptoAPI.d.ts +10 -0
- package/dist/cjs/lib/webCryptoAPI.js +83 -0
- package/dist/cjs/lib/webCryptoAPI.js.map +1 -0
- package/dist/cjs/lib/websocket/WsStore.d.ts +63 -0
- package/dist/cjs/lib/websocket/WsStore.js +254 -0
- package/dist/cjs/lib/websocket/WsStore.js.map +1 -0
- package/dist/cjs/lib/websocket/WsStore.types.d.ts +49 -0
- package/dist/cjs/lib/websocket/WsStore.types.js +14 -0
- package/dist/cjs/lib/websocket/WsStore.types.js.map +1 -0
- package/dist/cjs/lib/websocket/logger.d.ts +6 -0
- package/dist/cjs/lib/websocket/logger.js +16 -0
- package/dist/cjs/lib/websocket/logger.js.map +1 -0
- package/dist/cjs/lib/websocket/typeGuards.d.ts +27 -0
- package/dist/cjs/lib/websocket/typeGuards.js +86 -0
- package/dist/cjs/lib/websocket/typeGuards.js.map +1 -0
- package/dist/cjs/lib/websocket/websocket-util.d.ts +120 -0
- package/dist/cjs/lib/websocket/websocket-util.js +173 -0
- package/dist/cjs/lib/websocket/websocket-util.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/types/request/advanced-trade-client.d.ts +194 -0
- package/dist/cjs/types/request/advanced-trade-client.js +18 -0
- package/dist/cjs/types/request/advanced-trade-client.js.map +1 -0
- package/dist/cjs/types/request/coinbase-app-client.d.ts +80 -0
- package/dist/cjs/types/request/coinbase-app-client.js +28 -0
- package/dist/cjs/types/request/coinbase-app-client.js.map +1 -0
- package/dist/cjs/types/request/coinbase-exchange.d.ts +332 -0
- package/dist/cjs/types/request/coinbase-exchange.js +3 -0
- package/dist/cjs/types/request/coinbase-exchange.js.map +1 -0
- package/dist/cjs/types/request/coinbase-international.d.ts +160 -0
- package/dist/cjs/types/request/coinbase-international.js +13 -0
- package/dist/cjs/types/request/coinbase-international.js.map +1 -0
- package/dist/cjs/types/request/coinbase-prime.d.ts +298 -0
- package/dist/cjs/types/request/coinbase-prime.js +8 -0
- package/dist/cjs/types/request/coinbase-prime.js.map +1 -0
- package/dist/cjs/types/response/advanced-trade-client.d.ts +759 -0
- package/dist/cjs/types/response/advanced-trade-client.js +8 -0
- package/dist/cjs/types/response/advanced-trade-client.js.map +1 -0
- package/dist/cjs/types/response/coinbase-app-client.d.ts +168 -0
- package/dist/cjs/types/response/coinbase-app-client.js +18 -0
- package/dist/cjs/types/response/coinbase-app-client.js.map +1 -0
- package/dist/cjs/types/response/coinbase-exchange.d.ts +80 -0
- package/dist/cjs/types/response/coinbase-exchange.js +82 -0
- package/dist/cjs/types/response/coinbase-exchange.js.map +1 -0
- package/dist/cjs/types/response/coinbase-international.d.ts +40 -0
- package/dist/cjs/types/response/coinbase-international.js +42 -0
- package/dist/cjs/types/response/coinbase-international.js.map +1 -0
- package/dist/cjs/types/response/coinbase-prime.d.ts +70 -0
- package/dist/cjs/types/response/coinbase-prime.js +72 -0
- package/dist/cjs/types/response/coinbase-prime.js.map +1 -0
- package/dist/cjs/types/response/ws.d.ts +7 -0
- package/dist/cjs/types/response/ws.js +3 -0
- package/dist/cjs/types/response/ws.js.map +1 -0
- package/dist/cjs/types/shared.types.d.ts +60 -0
- package/dist/cjs/types/shared.types.js +3 -0
- package/dist/cjs/types/shared.types.js.map +1 -0
- package/dist/cjs/types/websockets/client.d.ts +73 -0
- package/dist/cjs/types/websockets/client.js +3 -0
- package/dist/cjs/types/websockets/client.js.map +1 -0
- package/dist/cjs/types/websockets/events.d.ts +40 -0
- package/dist/cjs/types/websockets/events.js +3 -0
- package/dist/cjs/types/websockets/events.js.map +1 -0
- package/dist/cjs/types/websockets/requests.d.ts +76 -0
- package/dist/cjs/types/websockets/requests.js +3 -0
- package/dist/cjs/types/websockets/requests.js.map +1 -0
- package/dist/cjs/types/websockets/wsAPI.d.ts +9 -0
- package/dist/cjs/types/websockets/wsAPI.js +3 -0
- package/dist/cjs/types/websockets/wsAPI.js.map +1 -0
- package/dist/mjs/CBAdvancedTradeClient.d.ts +559 -0
- package/dist/mjs/CBAdvancedTradeClient.js +570 -0
- package/dist/mjs/CBAdvancedTradeClient.js.map +1 -0
- package/dist/mjs/CBAppClient.d.ts +359 -0
- package/dist/mjs/CBAppClient.js +332 -0
- package/dist/mjs/CBAppClient.js.map +1 -0
- package/dist/mjs/CBCommerceClient.d.ts +110 -0
- package/dist/mjs/CBCommerceClient.js +101 -0
- package/dist/mjs/CBCommerceClient.js.map +1 -0
- package/dist/mjs/CBExchangeClient.d.ts +640 -0
- package/dist/mjs/CBExchangeClient.js +747 -0
- package/dist/mjs/CBExchangeClient.js.map +1 -0
- package/dist/mjs/CBInternationalClient.d.ts +381 -0
- package/dist/mjs/CBInternationalClient.js +433 -0
- package/dist/mjs/CBInternationalClient.js.map +1 -0
- package/dist/mjs/CBPrimeClient.d.ts +363 -0
- package/dist/mjs/CBPrimeClient.js +447 -0
- package/dist/mjs/CBPrimeClient.js.map +1 -0
- package/dist/mjs/WebsocketClient.d.ts +78 -0
- package/dist/mjs/WebsocketClient.js +530 -0
- package/dist/mjs/WebsocketClient.js.map +1 -0
- package/dist/mjs/index.d.ts +13 -0
- package/dist/mjs/index.js +14 -0
- package/dist/mjs/index.js.map +1 -0
- package/dist/mjs/lib/BaseRestClient.d.ts +66 -0
- package/dist/mjs/lib/BaseRestClient.js +429 -0
- package/dist/mjs/lib/BaseRestClient.js.map +1 -0
- package/dist/mjs/lib/BaseWSClient.d.ts +169 -0
- package/dist/mjs/lib/BaseWSClient.js +631 -0
- package/dist/mjs/lib/BaseWSClient.js.map +1 -0
- package/dist/mjs/lib/jwtNode.d.ts +13 -0
- package/dist/mjs/lib/jwtNode.js +45 -0
- package/dist/mjs/lib/jwtNode.js.map +1 -0
- package/dist/mjs/lib/misc-util.d.ts +1 -0
- package/dist/mjs/lib/misc-util.js +4 -0
- package/dist/mjs/lib/misc-util.js.map +1 -0
- package/dist/mjs/lib/requestUtils.d.ts +98 -0
- package/dist/mjs/lib/requestUtils.js +69 -0
- package/dist/mjs/lib/requestUtils.js.map +1 -0
- package/dist/mjs/lib/webCryptoAPI.d.ts +10 -0
- package/dist/mjs/lib/webCryptoAPI.js +79 -0
- package/dist/mjs/lib/webCryptoAPI.js.map +1 -0
- package/dist/mjs/lib/websocket/WsStore.d.ts +63 -0
- package/dist/mjs/lib/websocket/WsStore.js +249 -0
- package/dist/mjs/lib/websocket/WsStore.js.map +1 -0
- package/dist/mjs/lib/websocket/WsStore.types.d.ts +49 -0
- package/dist/mjs/lib/websocket/WsStore.types.js +11 -0
- package/dist/mjs/lib/websocket/WsStore.types.js.map +1 -0
- package/dist/mjs/lib/websocket/logger.d.ts +6 -0
- package/dist/mjs/lib/websocket/logger.js +13 -0
- package/dist/mjs/lib/websocket/logger.js.map +1 -0
- package/dist/mjs/lib/websocket/typeGuards.d.ts +27 -0
- package/dist/mjs/lib/websocket/typeGuards.js +78 -0
- package/dist/mjs/lib/websocket/typeGuards.js.map +1 -0
- package/dist/mjs/lib/websocket/websocket-util.d.ts +120 -0
- package/dist/mjs/lib/websocket/websocket-util.js +164 -0
- package/dist/mjs/lib/websocket/websocket-util.js.map +1 -0
- package/dist/mjs/package.json +3 -0
- package/dist/mjs/types/request/advanced-trade-client.d.ts +194 -0
- package/dist/mjs/types/request/advanced-trade-client.js +17 -0
- package/dist/mjs/types/request/advanced-trade-client.js.map +1 -0
- package/dist/mjs/types/request/coinbase-app-client.d.ts +80 -0
- package/dist/mjs/types/request/coinbase-app-client.js +27 -0
- package/dist/mjs/types/request/coinbase-app-client.js.map +1 -0
- package/dist/mjs/types/request/coinbase-exchange.d.ts +332 -0
- package/dist/mjs/types/request/coinbase-exchange.js +2 -0
- package/dist/mjs/types/request/coinbase-exchange.js.map +1 -0
- package/dist/mjs/types/request/coinbase-international.d.ts +160 -0
- package/dist/mjs/types/request/coinbase-international.js +12 -0
- package/dist/mjs/types/request/coinbase-international.js.map +1 -0
- package/dist/mjs/types/request/coinbase-prime.d.ts +298 -0
- package/dist/mjs/types/request/coinbase-prime.js +7 -0
- package/dist/mjs/types/request/coinbase-prime.js.map +1 -0
- package/dist/mjs/types/response/advanced-trade-client.d.ts +759 -0
- package/dist/mjs/types/response/advanced-trade-client.js +7 -0
- package/dist/mjs/types/response/advanced-trade-client.js.map +1 -0
- package/dist/mjs/types/response/coinbase-app-client.d.ts +168 -0
- package/dist/mjs/types/response/coinbase-app-client.js +17 -0
- package/dist/mjs/types/response/coinbase-app-client.js.map +1 -0
- package/dist/mjs/types/response/coinbase-exchange.d.ts +80 -0
- package/dist/mjs/types/response/coinbase-exchange.js +82 -0
- package/dist/mjs/types/response/coinbase-exchange.js.map +1 -0
- package/dist/mjs/types/response/coinbase-international.d.ts +40 -0
- package/dist/mjs/types/response/coinbase-international.js +42 -0
- package/dist/mjs/types/response/coinbase-international.js.map +1 -0
- package/dist/mjs/types/response/coinbase-prime.d.ts +70 -0
- package/dist/mjs/types/response/coinbase-prime.js +72 -0
- package/dist/mjs/types/response/coinbase-prime.js.map +1 -0
- package/dist/mjs/types/response/ws.d.ts +7 -0
- package/dist/mjs/types/response/ws.js +2 -0
- package/dist/mjs/types/response/ws.js.map +1 -0
- package/dist/mjs/types/shared.types.d.ts +60 -0
- package/dist/mjs/types/shared.types.js +2 -0
- package/dist/mjs/types/shared.types.js.map +1 -0
- package/dist/mjs/types/websockets/client.d.ts +73 -0
- package/dist/mjs/types/websockets/client.js +2 -0
- package/dist/mjs/types/websockets/client.js.map +1 -0
- package/dist/mjs/types/websockets/events.d.ts +40 -0
- package/dist/mjs/types/websockets/events.js +2 -0
- package/dist/mjs/types/websockets/events.js.map +1 -0
- package/dist/mjs/types/websockets/requests.d.ts +76 -0
- package/dist/mjs/types/websockets/requests.js +2 -0
- package/dist/mjs/types/websockets/requests.js.map +1 -0
- package/dist/mjs/types/websockets/wsAPI.d.ts +9 -0
- package/dist/mjs/types/websockets/wsAPI.js +2 -0
- package/dist/mjs/types/websockets/wsAPI.js.map +1 -0
- package/package.json +42 -30
- package/index.js +0 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -16
- package/lib/index.js.map +0 -1
|
@@ -0,0 +1,751 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CBExchangeClient = void 0;
|
|
4
|
+
const BaseRestClient_js_1 = require("./lib/BaseRestClient.js");
|
|
5
|
+
const requestUtils_js_1 = require("./lib/requestUtils.js");
|
|
6
|
+
/**
|
|
7
|
+
* REST client for Coinbase's Institutional Exchange API:
|
|
8
|
+
* https://docs.cdp.coinbase.com/exchange/docs/welcome
|
|
9
|
+
*/
|
|
10
|
+
class CBExchangeClient extends BaseRestClient_js_1.BaseRestClient {
|
|
11
|
+
constructor(restClientOptions = {}, requestOptions = {}) {
|
|
12
|
+
super(restClientOptions, requestOptions);
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
getClientType() {
|
|
16
|
+
return requestUtils_js_1.REST_CLIENT_TYPE_ENUM.exchange;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* Accounts Endpoints
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Get all accounts for a profile
|
|
25
|
+
*
|
|
26
|
+
* Get a list of trading accounts from the profile of the API key.
|
|
27
|
+
* Your trading accounts are separate from your Coinbase accounts. See Deposit from Coinbase account for documentation on how to deposit funds to begin trading.
|
|
28
|
+
*/
|
|
29
|
+
getAccounts() {
|
|
30
|
+
return this.getPrivate('/accounts');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a single account by id
|
|
34
|
+
*
|
|
35
|
+
* Information for a single account. Use this endpoint when you know the account_id. API key must belong to the same profile as the account.
|
|
36
|
+
*/
|
|
37
|
+
getAccount(params) {
|
|
38
|
+
return this.getPrivate(`/accounts/${params.account_id}`);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get a single account's holds
|
|
42
|
+
*
|
|
43
|
+
* List the holds of an account that belong to the same profile as the API key. Holds are placed on an account for any active orders or
|
|
44
|
+
* pending withdraw requests. As an order is filled, the hold amount is updated.
|
|
45
|
+
* If an order is canceled, any remaining hold is removed. For withdrawals, the hold is removed after it is completed.
|
|
46
|
+
*/
|
|
47
|
+
getAccountHolds(params) {
|
|
48
|
+
const { account_id, ...query } = params;
|
|
49
|
+
return this.getPrivate(`/accounts/${account_id}/holds`, query);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get a single account's ledger
|
|
53
|
+
*
|
|
54
|
+
* Lists ledger activity for an account. This includes anything that would affect the account's balance - transfers, trades, fees, etc.
|
|
55
|
+
* If neither start_date nor end_date is set, the endpoint will return ledger activity for the past 1 day only.
|
|
56
|
+
* List account activity of the API key's profile. Account activity either increases or decreases your account balance.
|
|
57
|
+
*
|
|
58
|
+
* Entry Types:
|
|
59
|
+
* - transfer: Funds moved to/from Coinbase to Coinbase Exchange
|
|
60
|
+
* - match: Funds moved as a result of a trade
|
|
61
|
+
* - fee: Fee as a result of a trade
|
|
62
|
+
* - rebate: Fee rebate as per our fee schedule
|
|
63
|
+
* - conversion: Funds converted between fiat currency and a stablecoin
|
|
64
|
+
*/
|
|
65
|
+
getAccountLedger(params) {
|
|
66
|
+
const { account_id, ...query } = params;
|
|
67
|
+
return this.getPrivate(`/accounts/${account_id}/ledger`, query);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get a single account's transfers
|
|
71
|
+
*
|
|
72
|
+
* Lists past withdrawals and deposits for an account.
|
|
73
|
+
*/
|
|
74
|
+
getAccountTransfers(params) {
|
|
75
|
+
const { account_id, ...query } = params;
|
|
76
|
+
return this.getPrivate(`/accounts/${account_id}/transfers`, query);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
*
|
|
80
|
+
* Address book Endpoints
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
/**
|
|
84
|
+
* Get address book
|
|
85
|
+
*
|
|
86
|
+
* Get all addresses stored in the address book.
|
|
87
|
+
*/
|
|
88
|
+
getAddressBook() {
|
|
89
|
+
return this.getPrivate('/address-book');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Add addresses
|
|
93
|
+
*
|
|
94
|
+
* Add new addresses to address book.
|
|
95
|
+
*/
|
|
96
|
+
addAddresses(params) {
|
|
97
|
+
return this.postPrivate('/address-book', { body: params });
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Delete address
|
|
101
|
+
*
|
|
102
|
+
* Delete address from address book.
|
|
103
|
+
*/
|
|
104
|
+
deleteAddress(params) {
|
|
105
|
+
return this.deletePrivate(`/address-book/${params.id}`);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
*
|
|
109
|
+
* Coinbase Accounts Endpoints
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* Get all Coinbase wallets
|
|
114
|
+
*
|
|
115
|
+
* Gets all the user's available Coinbase wallets. These are the wallets/accounts that are used for buying and selling on www.coinbase.com.
|
|
116
|
+
*/
|
|
117
|
+
getCoinbaseWallets() {
|
|
118
|
+
return this.getPrivate('/coinbase-accounts');
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Generate crypto address
|
|
122
|
+
*
|
|
123
|
+
* Generates a one-time crypto address for depositing crypto.
|
|
124
|
+
*/
|
|
125
|
+
createNewCryptoAddress(params) {
|
|
126
|
+
const { account_id, ...body } = params;
|
|
127
|
+
return this.postPrivate(`/coinbase-accounts/${account_id}/addresses`, {
|
|
128
|
+
body: body,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
*
|
|
133
|
+
* Conversions Endpoints
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
/**
|
|
137
|
+
* Convert currency
|
|
138
|
+
*
|
|
139
|
+
* Converts funds from one currency to another. Funds are converted on the from account in the profile_id profile.
|
|
140
|
+
*/
|
|
141
|
+
convertCurrency(params) {
|
|
142
|
+
return this.postPrivate('/conversions', { body: params });
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Get conversion fee rates
|
|
146
|
+
*
|
|
147
|
+
* Gets a list of current conversion fee rates and trailing 30 day volume by currency pair.
|
|
148
|
+
*/
|
|
149
|
+
getConversionFeeRates() {
|
|
150
|
+
return this.getPrivate('/conversions/fees');
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Get a conversion
|
|
154
|
+
*
|
|
155
|
+
* Gets a currency conversion by id (i.e. USD -> USDC).
|
|
156
|
+
*/
|
|
157
|
+
getConversion(params) {
|
|
158
|
+
const { conversion_id, ...query } = params;
|
|
159
|
+
return this.getPrivate(`/conversions/${conversion_id}`, query);
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
*
|
|
163
|
+
* Currencies Endpoints
|
|
164
|
+
*
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* Get all known currencies
|
|
168
|
+
*
|
|
169
|
+
* Gets a list of all known currencies. Note: Not all currencies may be currently in use for trading.
|
|
170
|
+
*/
|
|
171
|
+
getCurrencies() {
|
|
172
|
+
return this.get('/currencies');
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Get a currency
|
|
176
|
+
*
|
|
177
|
+
* Gets a single currency by id.
|
|
178
|
+
*/
|
|
179
|
+
getCurrency(currency_id) {
|
|
180
|
+
return this.get(`/currencies/${currency_id}`);
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
*
|
|
184
|
+
* Transfers Endpoints
|
|
185
|
+
*
|
|
186
|
+
*/
|
|
187
|
+
/**
|
|
188
|
+
* Deposit from Coinbase account
|
|
189
|
+
*
|
|
190
|
+
* Deposits funds from a www.coinbase.com wallet to the specified profile_id.
|
|
191
|
+
*/
|
|
192
|
+
depositFromCoinbaseAccount(params) {
|
|
193
|
+
return this.postPrivate('/deposits/coinbase-account', {
|
|
194
|
+
body: params,
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Deposit from payment method
|
|
199
|
+
*
|
|
200
|
+
* Deposits funds from a linked external payment method to the specified profile_id.
|
|
201
|
+
* See Get all payment methods. The SEPA payment method is not allowed for depositing funds because it is a push payment method.
|
|
202
|
+
*/
|
|
203
|
+
depositFromPaymentMethod(params) {
|
|
204
|
+
return this.postPrivate('/deposits/payment-method', { body: params });
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Get all payment methods
|
|
208
|
+
*
|
|
209
|
+
* Gets a list of the user's linked payment methods.
|
|
210
|
+
*/
|
|
211
|
+
getPaymentMethods() {
|
|
212
|
+
return this.getPrivate('/payment-methods');
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Get all transfers
|
|
216
|
+
*
|
|
217
|
+
* Gets a list of in-progress and completed transfers of funds in/out of any of the user's accounts.
|
|
218
|
+
*/
|
|
219
|
+
getTransfers(params) {
|
|
220
|
+
return this.getPrivate('/transfers', params);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Get a single transfer
|
|
224
|
+
*
|
|
225
|
+
* Get information on a single transfer.
|
|
226
|
+
*/
|
|
227
|
+
getTransfer(params) {
|
|
228
|
+
return this.getPrivate(`/transfers/${params.transfer_id}`);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Submit travel information for a transfer
|
|
232
|
+
*
|
|
233
|
+
* Submit travel information for a transfer.
|
|
234
|
+
*/
|
|
235
|
+
submitTravelInformation(params) {
|
|
236
|
+
const { transfer_id, ...body } = params;
|
|
237
|
+
return this.postPrivate(`/transfers/${transfer_id}/travel-rules`, {
|
|
238
|
+
body: body,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Withdraw to Coinbase account
|
|
243
|
+
*
|
|
244
|
+
* Withdraws funds from the specified profile_id to a www.coinbase.com wallet.
|
|
245
|
+
* You can move funds between your Coinbase accounts and your Coinbase Exchange trading accounts within your daily limits. Moving funds between Coinbase and Coinbase Exchange is instant and free.
|
|
246
|
+
* See the Coinbase Accounts section for retrieving your Coinbase accounts.
|
|
247
|
+
*/
|
|
248
|
+
withdrawToCoinbaseAccount(params) {
|
|
249
|
+
return this.postPrivate('/withdrawals/coinbase-account', { body: params });
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Withdraw to crypto address
|
|
253
|
+
*
|
|
254
|
+
* Withdraws funds from the specified profile_id to an external crypto address.
|
|
255
|
+
*/
|
|
256
|
+
withdrawToCryptoAddress(params) {
|
|
257
|
+
return this.postPrivate('/withdrawals/crypto', { body: params });
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get fee estimate for crypto withdrawal
|
|
261
|
+
*
|
|
262
|
+
* Gets the fee estimate for the crypto withdrawal to a crypto address.
|
|
263
|
+
*/
|
|
264
|
+
getCryptoWithdrawalFeeEstimate(params) {
|
|
265
|
+
return this.getPrivate('/withdrawals/fee-estimate', params);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Withdraw to payment method
|
|
269
|
+
*
|
|
270
|
+
* Withdraws funds from the specified profile_id to a linked external payment method.
|
|
271
|
+
* See the Payment Methods section for retrieving your payment methods.
|
|
272
|
+
*/
|
|
273
|
+
withdrawToPaymentMethod(params) {
|
|
274
|
+
return this.postPrivate('/withdrawals/payment-method', { body: params });
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
*
|
|
278
|
+
* Fees Endpoints
|
|
279
|
+
*
|
|
280
|
+
*/
|
|
281
|
+
/**
|
|
282
|
+
* Get fees
|
|
283
|
+
*
|
|
284
|
+
* Get fee rates and 30 days trailing volume.
|
|
285
|
+
* This request returns your current maker & taker fee rates, as well as your 30-day trailing volume. Quoted rates are subject to change.
|
|
286
|
+
*/
|
|
287
|
+
getFees() {
|
|
288
|
+
return this.getPrivate('/fees');
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
*
|
|
292
|
+
* Orders Endpoints
|
|
293
|
+
*
|
|
294
|
+
*/
|
|
295
|
+
/**
|
|
296
|
+
* Get all fills
|
|
297
|
+
*
|
|
298
|
+
* Get a list of recent fills of the API key's profile. A fill is a partial or complete match on a specific order.
|
|
299
|
+
*/
|
|
300
|
+
getFills(params) {
|
|
301
|
+
return this.getPrivate('/fills', params);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Get all orders
|
|
305
|
+
*
|
|
306
|
+
* List your current open orders. Only open or un-settled orders are returned by default. As soon as an order is no longer open and settled, it will no longer appear in the default request.
|
|
307
|
+
* Open orders may change state between the request and the response depending on market conditions.
|
|
308
|
+
*/
|
|
309
|
+
getOrders(params) {
|
|
310
|
+
return this.getPrivate('/orders', params);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Cancel all orders
|
|
314
|
+
*
|
|
315
|
+
* With best effort, cancel all open orders. This may require you to make the request multiple times until all of the open orders are deleted.
|
|
316
|
+
*/
|
|
317
|
+
cancelAllOrders(params) {
|
|
318
|
+
return this.deletePrivate('/orders', { query: params });
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Create a new order
|
|
322
|
+
*
|
|
323
|
+
* Create an order. You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds.
|
|
324
|
+
* Once an order is placed, your account funds will be put on hold for the duration of the order.
|
|
325
|
+
*/
|
|
326
|
+
submitOrder(params) {
|
|
327
|
+
this.validateOrderId(params, 'client_oid');
|
|
328
|
+
return this.postPrivate('/orders', { body: params });
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Get single order
|
|
332
|
+
*
|
|
333
|
+
* Get a single order by id.
|
|
334
|
+
*/
|
|
335
|
+
getOrder(params) {
|
|
336
|
+
const { order_id, ...otherParams } = params;
|
|
337
|
+
return this.getPrivate(`/orders/${order_id}`, otherParams);
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Cancel an order
|
|
341
|
+
*
|
|
342
|
+
* Cancel a single open order by id.
|
|
343
|
+
*/
|
|
344
|
+
cancelOrder(params) {
|
|
345
|
+
const { order_id, ...otherParams } = params;
|
|
346
|
+
return this.deletePrivate(`/orders/${order_id}`, {
|
|
347
|
+
body: otherParams,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
*
|
|
352
|
+
* Loans Endpoints
|
|
353
|
+
*
|
|
354
|
+
*/
|
|
355
|
+
/**
|
|
356
|
+
* List loans
|
|
357
|
+
*
|
|
358
|
+
* Accepts zero or more loan IDs as input. If no loan IDs are specified, it returns all loans for the user. Otherwise, it returns only the loan IDs specified.
|
|
359
|
+
*/
|
|
360
|
+
getLoans(params) {
|
|
361
|
+
return this.getPrivate('/loans', params);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* List loan assets
|
|
365
|
+
*
|
|
366
|
+
* Get a list of lendable assets, a map of assets we accept as collateral for loans, and the haircut weight.
|
|
367
|
+
*/
|
|
368
|
+
getLoanAssets() {
|
|
369
|
+
return this.getPrivate('/loans/assets');
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* List interest summaries
|
|
373
|
+
*
|
|
374
|
+
* List summaries of interest owed by asset.
|
|
375
|
+
*/
|
|
376
|
+
getInterestSummaries() {
|
|
377
|
+
return this.getPrivate('/loans/interest');
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* List interest rate history
|
|
381
|
+
*
|
|
382
|
+
* List interest rate history for a loan.
|
|
383
|
+
*/
|
|
384
|
+
getInterestRateHistory(params) {
|
|
385
|
+
return this.getPrivate(`/loans/interest/history/${params.loan_id}`);
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* List interest charges
|
|
389
|
+
*
|
|
390
|
+
* List interest charges for a loan.
|
|
391
|
+
*/
|
|
392
|
+
getInterestCharges(params) {
|
|
393
|
+
return this.getPrivate(`/loans/interest/${params.loan_id}`);
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Get lending overview
|
|
397
|
+
*
|
|
398
|
+
* This API summarizes lending for a given client. It calculates the overall loan balance, collateral level, and amounts available to borrow.
|
|
399
|
+
* It also returns any withdrawal restrictions in force on the client.
|
|
400
|
+
*
|
|
401
|
+
* Get lending overview returns all amounts in USD notional values, except available_per_asset mappings which are returned in both notional and native values.
|
|
402
|
+
*/
|
|
403
|
+
getLendingOverview() {
|
|
404
|
+
return this.getPrivate('/loans/lending-overview');
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Get new loan preview
|
|
408
|
+
*
|
|
409
|
+
* This API is similar to lending-overview but is used to preview the results of opening a new loan.
|
|
410
|
+
* The values returned in the preview response take the existing loans, collateral and the potential change being previewed into account.
|
|
411
|
+
* Note the preview request accepts native currency amounts as input.
|
|
412
|
+
*/
|
|
413
|
+
getNewLoanPreview(params) {
|
|
414
|
+
return this.getPrivate('/loans/loan-preview', params);
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Open new loan
|
|
418
|
+
*
|
|
419
|
+
* This API triggers a loan open request. Funding is not necessarily instantaneous and there is no SLA.
|
|
420
|
+
* You are notified when funds have settled in your Exchange account. Loan open requests, once initiated, cannot be canceled.
|
|
421
|
+
*/
|
|
422
|
+
submitNewLoan(params) {
|
|
423
|
+
return this.postPrivate('/loans/open', { body: params });
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* List new loan options
|
|
427
|
+
*
|
|
428
|
+
* Get available currencies and interest rates for new loans. All amounts returned by this API are notional values (i.e., USD).
|
|
429
|
+
*/
|
|
430
|
+
getNewLoanOptions() {
|
|
431
|
+
return this.getPrivate('/loans/options');
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Repay loan interest
|
|
435
|
+
*
|
|
436
|
+
* Submit an interest repayment for a loan.
|
|
437
|
+
*/
|
|
438
|
+
repayLoanInterest(params) {
|
|
439
|
+
return this.postPrivate('/loans/repay-interest', { body: params });
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* Repay loan principal
|
|
443
|
+
*
|
|
444
|
+
* Submit a principal repayment for a loan.
|
|
445
|
+
*/
|
|
446
|
+
repayLoanPrincipal(params) {
|
|
447
|
+
return this.postPrivate('/loans/repay-principal', { body: params });
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Get principal repayment preview
|
|
451
|
+
*
|
|
452
|
+
* Preview the results of a loan principal repayment.
|
|
453
|
+
* Like the Get lending overview API, all values are notional except available_per_asset which returns both notional and native values per currency.
|
|
454
|
+
*/
|
|
455
|
+
getPrincipalRepaymentPreview(params) {
|
|
456
|
+
return this.getPrivate('/loans/repayment-preview', params);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
*
|
|
460
|
+
* Coinbase Price Oracle Endpoints
|
|
461
|
+
*
|
|
462
|
+
*/
|
|
463
|
+
/**
|
|
464
|
+
* Get signed prices
|
|
465
|
+
*
|
|
466
|
+
* Get cryptographically signed prices ready to be posted on-chain using Compound's Open Oracle smart contract.
|
|
467
|
+
*/
|
|
468
|
+
getSignedPrices() {
|
|
469
|
+
return this.getPrivate('/oracle');
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
*
|
|
473
|
+
* Products Endpoints
|
|
474
|
+
*
|
|
475
|
+
*/
|
|
476
|
+
/**
|
|
477
|
+
* Get all known trading pairs
|
|
478
|
+
*
|
|
479
|
+
* Gets a list of available currency pairs for trading.
|
|
480
|
+
*/
|
|
481
|
+
getAllTradingPairs(params) {
|
|
482
|
+
return this.get('/products', params);
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Get all product volume
|
|
486
|
+
*
|
|
487
|
+
* Gets 30-day and 24-hour volume for all products and market types.
|
|
488
|
+
*/
|
|
489
|
+
getAllProductVolume() {
|
|
490
|
+
return this.get('/products/volume-summary');
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Get single product
|
|
494
|
+
*
|
|
495
|
+
* Get information on a single product.
|
|
496
|
+
*/
|
|
497
|
+
getProduct(params) {
|
|
498
|
+
return this.get(`/products/${params.product_id}`);
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Get product book
|
|
502
|
+
*
|
|
503
|
+
* Get a list of open orders for a product. The amount of detail shown can be customized with the level parameter.
|
|
504
|
+
* By default, only the inside (i.e., the best) bid and ask are returned. This is equivalent to a book depth of 1 level.
|
|
505
|
+
* To see a larger order book, specify the level query parameter.
|
|
506
|
+
*/
|
|
507
|
+
getProductBook(params) {
|
|
508
|
+
const { product_id, ...query } = params;
|
|
509
|
+
return this.get(`/products/${product_id}/book`, query);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Get product candles
|
|
513
|
+
*
|
|
514
|
+
* Historic rates for a product. Rates are returned in grouped buckets.
|
|
515
|
+
* Candle schema is of the form [timestamp, price_low, price_high, price_open, price_close].
|
|
516
|
+
*/
|
|
517
|
+
getProductCandles(params) {
|
|
518
|
+
const { product_id, ...query } = params;
|
|
519
|
+
return this.get(`/products/${product_id}/candles`, query);
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Get product stats
|
|
523
|
+
*
|
|
524
|
+
* Gets 30-day and 24-hour stats for a product.
|
|
525
|
+
*/
|
|
526
|
+
getProductStats(params) {
|
|
527
|
+
return this.get(`/products/${params.product_id}/stats`);
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Get product ticker
|
|
531
|
+
*
|
|
532
|
+
* Gets snapshot information about the last trade (tick), best bid/ask, and 24h volume.
|
|
533
|
+
*/
|
|
534
|
+
getProductTicker(params) {
|
|
535
|
+
return this.get(`/products/${params.product_id}/ticker`);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Get product trades
|
|
539
|
+
*
|
|
540
|
+
* Gets a list of the latest trades for a product.
|
|
541
|
+
*/
|
|
542
|
+
getProductTrades(params) {
|
|
543
|
+
const { product_id, ...query } = params;
|
|
544
|
+
return this.get(`/products/${product_id}/trades`, query);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
*
|
|
548
|
+
* Profiles Endpoints
|
|
549
|
+
*
|
|
550
|
+
*/
|
|
551
|
+
/**
|
|
552
|
+
* Get profiles
|
|
553
|
+
*
|
|
554
|
+
* Gets a list of all of the current user's profiles.
|
|
555
|
+
*/
|
|
556
|
+
getProfiles(params) {
|
|
557
|
+
return this.getPrivate('/profiles', params);
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Create a profile
|
|
561
|
+
*
|
|
562
|
+
* Create a new profile. Will fail if no name is provided or if user already has max number of profiles.
|
|
563
|
+
*/
|
|
564
|
+
createProfile(params) {
|
|
565
|
+
return this.postPrivate('/profiles', { body: params });
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Transfer funds between profiles
|
|
569
|
+
*
|
|
570
|
+
* Transfer an amount of currency from one profile to another.
|
|
571
|
+
*/
|
|
572
|
+
transferFundsBetweenProfiles(params) {
|
|
573
|
+
return this.postPrivate('/profiles/transfer', { body: params });
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Get profile by id
|
|
577
|
+
*
|
|
578
|
+
* Information for a single profile. Use this endpoint when you know the profile_id.
|
|
579
|
+
*/
|
|
580
|
+
getProfileById(params) {
|
|
581
|
+
const { profile_id, ...query } = params;
|
|
582
|
+
return this.getPrivate(`/profiles/${profile_id}`, query);
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Rename a profile
|
|
586
|
+
*
|
|
587
|
+
* Rename a profile. Names 'default' and 'margin' are reserved.
|
|
588
|
+
*/
|
|
589
|
+
renameProfile(params) {
|
|
590
|
+
const { profile_id, ...body } = params;
|
|
591
|
+
return this.putPrivate(`/profiles/${profile_id}`, { body: body });
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Delete a profile
|
|
595
|
+
*
|
|
596
|
+
* Deletes the profile specified by profile_id and transfers all funds to the profile specified by to.
|
|
597
|
+
* Fails if there are any open orders on the profile to be deleted.
|
|
598
|
+
*/
|
|
599
|
+
deleteProfile(params) {
|
|
600
|
+
const { profile_id, ...body } = params;
|
|
601
|
+
return this.putPrivate(`/profiles/${profile_id}/deactivate`, {
|
|
602
|
+
body: body,
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
*
|
|
607
|
+
* Reports Endpoints
|
|
608
|
+
*
|
|
609
|
+
*/
|
|
610
|
+
/**
|
|
611
|
+
* Get all reports
|
|
612
|
+
*
|
|
613
|
+
* Gets a list of all user-generated reports.
|
|
614
|
+
*/
|
|
615
|
+
getAllReports(params) {
|
|
616
|
+
return this.getPrivate('/reports', params);
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Create a report
|
|
620
|
+
*
|
|
621
|
+
* Generates a report. You can create reports with historical data for all report types.
|
|
622
|
+
* Balance reports can be snapshots of historical or current data.
|
|
623
|
+
*/
|
|
624
|
+
createReport(params) {
|
|
625
|
+
return this.postPrivate('/reports', { body: params });
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Get a report
|
|
629
|
+
*
|
|
630
|
+
* Get a specific report by report_id.
|
|
631
|
+
*/
|
|
632
|
+
getReport(params) {
|
|
633
|
+
return this.getPrivate(`/reports/${params.report_id}`);
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
*
|
|
637
|
+
* Travel Rule Endpoints
|
|
638
|
+
*
|
|
639
|
+
*/
|
|
640
|
+
/**
|
|
641
|
+
* Get all travel rule information
|
|
642
|
+
*
|
|
643
|
+
* Return a list of all stored travel rule information.
|
|
644
|
+
*/
|
|
645
|
+
getTravelRuleInformation(params) {
|
|
646
|
+
return this.getPrivate('/travel-rules', params);
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Create travel rule entry
|
|
650
|
+
*
|
|
651
|
+
* Create travel rule entry for sending address.
|
|
652
|
+
*/
|
|
653
|
+
createTravelRuleEntry(params) {
|
|
654
|
+
return this.postPrivate('/travel-rules', { body: params });
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Delete existing travel rule entry
|
|
658
|
+
*
|
|
659
|
+
* Delete existing travel rule entry.
|
|
660
|
+
*/
|
|
661
|
+
deleteTravelRuleEntry(params) {
|
|
662
|
+
return this.deletePrivate(`/travel-rules/${params.id}`);
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
*
|
|
666
|
+
* Users Endpoints
|
|
667
|
+
*
|
|
668
|
+
*/
|
|
669
|
+
/**
|
|
670
|
+
* Get user exchange limits
|
|
671
|
+
*
|
|
672
|
+
* Gets exchange limits information for a single user.
|
|
673
|
+
*/
|
|
674
|
+
getUserExchangeLimits(params) {
|
|
675
|
+
return this.getPrivate(`/users/${params.user_id}/exchange-limits`);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Update settlement preference
|
|
679
|
+
*
|
|
680
|
+
* Updates the settlement preference to hold funds in either USDC or USD.
|
|
681
|
+
*/
|
|
682
|
+
updateSettlementPreference(params) {
|
|
683
|
+
const { user_id, ...body } = params;
|
|
684
|
+
return this.postPrivate(`/users/${user_id}/settlement-preferences`, {
|
|
685
|
+
body: body,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* Get user trading volume
|
|
690
|
+
*
|
|
691
|
+
* Gets aggregated and individual trading volumes for users.
|
|
692
|
+
*/
|
|
693
|
+
getUserTradingVolume(params) {
|
|
694
|
+
return this.getPrivate(`/users/${params.user_id}/trading-volumes`);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
*
|
|
698
|
+
* Wrapped Assets Endpoints
|
|
699
|
+
*
|
|
700
|
+
*/
|
|
701
|
+
/**
|
|
702
|
+
* Get all wrapped assets
|
|
703
|
+
*
|
|
704
|
+
* Returns a list of all supported wrapped assets details objects.
|
|
705
|
+
*/
|
|
706
|
+
getAllWrappedAssets() {
|
|
707
|
+
return this.get('/wrapped-assets');
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Get all stake-wraps
|
|
711
|
+
*
|
|
712
|
+
* Get details for all stake-wraps in the profile associated with the API key.
|
|
713
|
+
*/
|
|
714
|
+
getAllStakeWraps(params) {
|
|
715
|
+
return this.getPrivate('/wrapped-assets/stake-wrap', params);
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Create a new stake-wrap
|
|
719
|
+
*
|
|
720
|
+
* Stakes and wraps from_currency to to_currency. Funds are stake-wrapped in the profile associated with the API key.
|
|
721
|
+
*/
|
|
722
|
+
createStakeWrap(params) {
|
|
723
|
+
return this.postPrivate('/wrapped-assets/stake-wrap', { body: params });
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Get a single stake-wrap
|
|
727
|
+
*
|
|
728
|
+
* Get details for a specific stake-wrap in the profile associated with the API key.
|
|
729
|
+
*/
|
|
730
|
+
getStakeWrap(params) {
|
|
731
|
+
return this.getPrivate(`/wrapped-assets/stake-wrap/${params.stake_wrap_id}`);
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Get wrapped asset details
|
|
735
|
+
*
|
|
736
|
+
* Returns the circulating and total supply of a wrapped asset, and its conversion rate.
|
|
737
|
+
*/
|
|
738
|
+
getWrappedAssetDetails(params) {
|
|
739
|
+
return this.getPrivate(`/wrapped-assets/${params.wrapped_asset_id}`);
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Get wrapped asset conversion rate
|
|
743
|
+
*
|
|
744
|
+
* Returns the conversion rate of a wrapped asset.
|
|
745
|
+
*/
|
|
746
|
+
getWrappedAssetConversionRate(params) {
|
|
747
|
+
return this.getPrivate(`/wrapped-assets/${params.wrapped_asset_id}/conversion-rate`);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
exports.CBExchangeClient = CBExchangeClient;
|
|
751
|
+
//# sourceMappingURL=CBExchangeClient.js.map
|