@coinbase-sample/prime-sdk-ts 0.6.2 → 0.6.4
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 +207 -67
- package/dist/addressBooks/index.js +2 -2
- package/dist/allocations/index.js +3 -3
- package/dist/client-manual.js +84 -0
- package/dist/client-modular.js +57 -0
- package/dist/client-only.js +31 -0
- package/dist/{client.js → clients/client.js} +12 -2
- package/dist/clients/clientWithServices.js +323 -0
- package/dist/{types/client.d.ts → clients/clientWithServicesTypes.js} +3 -6
- package/dist/clients/index.js +28 -0
- package/dist/clients/types.js +2 -0
- package/dist/constants.js +1 -1
- package/dist/futures/index.js +4 -4
- package/dist/index.js +27 -18
- package/dist/model/enumPrefixes.js +330 -0
- package/dist/onchainAddressBook/index.js +4 -4
- package/dist/orders/index.js +6 -6
- package/dist/paymentMethods/index.js +2 -1
- package/dist/services.js +75 -0
- package/dist/shared/dynamicEnumValidation.js +184 -0
- package/dist/shared/dynamicEnumValidation.old.js +746 -0
- package/dist/shared/enumHelpers.js +219 -0
- package/dist/shared/enumRegistry.js +153 -0
- package/dist/shared/enumValidationCore.js +194 -0
- package/dist/shared/enumValidators.js +115 -0
- package/dist/shared/envUtils.js +66 -0
- package/dist/shared/fieldMapping.js +242 -0
- package/dist/shared/serviceContext.js +157 -0
- package/dist/staking/index.js +5 -5
- package/dist/transactions/index.js +5 -5
- package/dist/types/activities/index.d.ts +2 -3
- package/dist/types/addressBooks/index.d.ts +2 -3
- package/dist/types/allocations/index.d.ts +2 -3
- package/dist/types/assets/index.d.ts +2 -3
- package/dist/types/balances/index.d.ts +2 -3
- package/dist/types/balances/types.d.ts +1 -1
- package/dist/types/client-manual.d.ts +58 -0
- package/dist/types/client-modular.d.ts +39 -0
- package/dist/types/client-only.d.ts +18 -0
- package/dist/types/clients/client.d.ts +27 -0
- package/dist/types/clients/clientWithServices.d.ts +229 -0
- package/dist/types/clients/clientWithServicesTypes.d.ts +115 -0
- package/dist/types/clients/index.d.ts +19 -0
- package/dist/types/clients/types.d.ts +48 -0
- package/dist/types/commission/index.d.ts +2 -3
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/financing/index.d.ts +2 -3
- package/dist/types/futures/index.d.ts +2 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/invoices/index.d.ts +2 -3
- package/dist/types/model/enumPrefixes.d.ts +206 -0
- package/dist/types/onchainAddressBook/index.d.ts +2 -3
- package/dist/types/orders/index.d.ts +2 -3
- package/dist/types/paymentMethods/index.d.ts +2 -3
- package/dist/types/paymentMethods/types.d.ts +1 -0
- package/dist/types/portfolios/index.d.ts +2 -3
- package/dist/types/positions/index.d.ts +2 -3
- package/dist/types/products/index.d.ts +2 -3
- package/dist/types/services.d.ts +39 -0
- package/dist/types/shared/dynamicEnumValidation.d.ts +48 -0
- package/dist/types/shared/dynamicEnumValidation.old.d.ts +143 -0
- package/dist/types/shared/enumHelpers.d.ts +135 -0
- package/dist/types/shared/enumRegistry.d.ts +74 -0
- package/dist/types/shared/enumValidationCore.d.ts +68 -0
- package/dist/types/shared/enumValidators.d.ts +117 -0
- package/dist/types/shared/envUtils.d.ts +36 -0
- package/dist/types/shared/fieldMapping.d.ts +35 -0
- package/dist/types/shared/paginatedResponse.d.ts +3 -4
- package/dist/types/shared/serviceContext.d.ts +46 -0
- package/dist/types/staking/index.d.ts +2 -3
- package/dist/types/transactions/index.d.ts +2 -3
- package/dist/types/types.d.ts +37 -0
- package/dist/types/users/index.d.ts +2 -3
- package/dist/types/wallets/index.d.ts +2 -3
- package/dist/types.js +39 -0
- package/dist/wallets/index.js +3 -3
- package/package.json +33 -2
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CoinbasePrimeClientWithServices = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*/
|
|
19
|
+
const core_ts_1 = require("@coinbase-sample/core-ts");
|
|
20
|
+
const constants_1 = require("../constants");
|
|
21
|
+
const toCamelCase_1 = require("../shared/toCamelCase");
|
|
22
|
+
const envUtils_1 = require("../shared/envUtils");
|
|
23
|
+
/**
|
|
24
|
+
* Enhanced Coinbase Prime Client with lazy-loaded service getters.
|
|
25
|
+
* Services are only instantiated when first accessed, improving tree-shaking
|
|
26
|
+
* and reducing initial bundle size.
|
|
27
|
+
*/
|
|
28
|
+
class CoinbasePrimeClientWithServices extends core_ts_1.CoinbaseClient {
|
|
29
|
+
constructor(credentials, apiBasePath, options) {
|
|
30
|
+
const defaultClientOptions = Object.assign({ defaultLimit: constants_1.DEFAULT_PAGINATION_LIMIT, maxPages: constants_1.DEFAULT_MAX_PAGES, maxItems: constants_1.DEFAULT_MAX_ITEMS }, options);
|
|
31
|
+
let basePath = constants_1.API_BASE_PATH;
|
|
32
|
+
if (apiBasePath && apiBasePath.length > 0) {
|
|
33
|
+
basePath = apiBasePath;
|
|
34
|
+
}
|
|
35
|
+
super(basePath, credentials, constants_1.USER_AGENT, defaultClientOptions);
|
|
36
|
+
// transform the response data to camelCase
|
|
37
|
+
this.addTransformResponse((response) => {
|
|
38
|
+
return Object.assign(Object.assign({}, response), { data: (0, toCamelCase_1.toCamelCase)(response.data) });
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a client from environment variables
|
|
43
|
+
* Requires PRIME_CREDENTIALS environment variable with JSON containing:
|
|
44
|
+
* { "AccessKey": "...", "SecretKey": "...", "Passphrase": "..." }
|
|
45
|
+
*/
|
|
46
|
+
static fromEnv(baseUrl, options) {
|
|
47
|
+
const credentials = (0, envUtils_1.createCredentialsFromEnv)();
|
|
48
|
+
return new CoinbasePrimeClientWithServices(credentials, baseUrl, options);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Lazy getter for ActivitiesService
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const activities = await client.activities.listPortfolioActivities({ portfolioId });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
get activities() {
|
|
58
|
+
if (!this._activitiesService) {
|
|
59
|
+
const { ActivitiesService } = require('../activities');
|
|
60
|
+
this._activitiesService = new ActivitiesService(this);
|
|
61
|
+
}
|
|
62
|
+
return this._activitiesService;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Lazy getter for AddressBooksService
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const addressBooks = await client.addressBooks.listAddressBooks({ portfolioId });
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
get addressBooks() {
|
|
72
|
+
if (!this._addressBooksService) {
|
|
73
|
+
const { AddressBooksService } = require('../addressBooks');
|
|
74
|
+
this._addressBooksService = new AddressBooksService(this);
|
|
75
|
+
}
|
|
76
|
+
return this._addressBooksService;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Lazy getter for AllocationService
|
|
80
|
+
* @example
|
|
81
|
+
* ```typescript
|
|
82
|
+
* const allocation = await client.allocations.createAllocation({ portfolioId, ... });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
get allocations() {
|
|
86
|
+
if (!this._allocationService) {
|
|
87
|
+
const { AllocationService } = require('../allocations');
|
|
88
|
+
this._allocationService = new AllocationService(this);
|
|
89
|
+
}
|
|
90
|
+
return this._allocationService;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Lazy getter for AssetsService
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const assets = await client.assets.listAssets({ entityId });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
get assets() {
|
|
100
|
+
if (!this._assetsService) {
|
|
101
|
+
const { AssetsService } = require('../assets');
|
|
102
|
+
this._assetsService = new AssetsService(this);
|
|
103
|
+
}
|
|
104
|
+
return this._assetsService;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Lazy getter for BalancesService
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const balance = await client.balances.getWalletBalance({ portfolioId, walletId });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
get balances() {
|
|
114
|
+
if (!this._balancesService) {
|
|
115
|
+
const { BalancesService } = require('../balances');
|
|
116
|
+
this._balancesService = new BalancesService(this);
|
|
117
|
+
}
|
|
118
|
+
return this._balancesService;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Lazy getter for CommissionService
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* const commission = await client.commission.getPortfolioCommission({ portfolioId });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
get commission() {
|
|
128
|
+
if (!this._commissionService) {
|
|
129
|
+
const { CommissionService } = require('../commission');
|
|
130
|
+
this._commissionService = new CommissionService(this);
|
|
131
|
+
}
|
|
132
|
+
return this._commissionService;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Lazy getter for FinancingService
|
|
136
|
+
* @example
|
|
137
|
+
* ```typescript
|
|
138
|
+
* const buyingPower = await client.financing.getPortfolioBuyingPower({ portfolioId });
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
get financing() {
|
|
142
|
+
if (!this._financingService) {
|
|
143
|
+
const { FinancingService } = require('../financing');
|
|
144
|
+
this._financingService = new FinancingService(this);
|
|
145
|
+
}
|
|
146
|
+
return this._financingService;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Lazy getter for FuturesService
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* const positions = await client.futures.getEntityFuturesPositions({ entityId });
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
get futures() {
|
|
156
|
+
if (!this._futuresService) {
|
|
157
|
+
const { FuturesService } = require('../futures');
|
|
158
|
+
this._futuresService = new FuturesService(this);
|
|
159
|
+
}
|
|
160
|
+
return this._futuresService;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Lazy getter for InvoicesService
|
|
164
|
+
* @example
|
|
165
|
+
* ```typescript
|
|
166
|
+
* const invoices = await client.invoices.listInvoices({ entityId });
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
get invoices() {
|
|
170
|
+
if (!this._invoicesService) {
|
|
171
|
+
const { InvoicesService } = require('../invoices');
|
|
172
|
+
this._invoicesService = new InvoicesService(this);
|
|
173
|
+
}
|
|
174
|
+
return this._invoicesService;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Lazy getter for OnchainAddressBookService
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* const addressBook = await client.onchainAddressBook.listOnchainAddressBook({ portfolioId });
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
get onchainAddressBook() {
|
|
184
|
+
if (!this._onchainAddressBookService) {
|
|
185
|
+
const { OnchainAddressBookService } = require('../onchainAddressBook');
|
|
186
|
+
this._onchainAddressBookService = new OnchainAddressBookService(this);
|
|
187
|
+
}
|
|
188
|
+
return this._onchainAddressBookService;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Lazy getter for OrdersService
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* const order = await client.orders.createOrder({
|
|
195
|
+
* portfolioId: "123",
|
|
196
|
+
* side: "BUY",
|
|
197
|
+
* productId: "BTC-USD",
|
|
198
|
+
* type: "MARKET",
|
|
199
|
+
* baseQuantity: "0.001"
|
|
200
|
+
* });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
get orders() {
|
|
204
|
+
if (!this._ordersService) {
|
|
205
|
+
const { OrdersService } = require('../orders');
|
|
206
|
+
this._ordersService = new OrdersService(this);
|
|
207
|
+
}
|
|
208
|
+
return this._ordersService;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Lazy getter for PaymentMethodsService
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* const paymentMethods = await client.paymentMethods.listEntityPaymentMethods({ entityId });
|
|
215
|
+
* ```
|
|
216
|
+
*/
|
|
217
|
+
get paymentMethods() {
|
|
218
|
+
if (!this._paymentMethodsService) {
|
|
219
|
+
const { PaymentMethodsService } = require('../paymentMethods');
|
|
220
|
+
this._paymentMethodsService = new PaymentMethodsService(this);
|
|
221
|
+
}
|
|
222
|
+
return this._paymentMethodsService;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Lazy getter for PortfoliosService
|
|
226
|
+
* @example
|
|
227
|
+
* ```typescript
|
|
228
|
+
* const portfolios = await client.portfolios.listPortfolios();
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
get portfolios() {
|
|
232
|
+
if (!this._portfoliosService) {
|
|
233
|
+
const { PortfoliosService } = require('../portfolios');
|
|
234
|
+
this._portfoliosService = new PortfoliosService(this);
|
|
235
|
+
}
|
|
236
|
+
return this._portfoliosService;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Lazy getter for PositionsService
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* const positions = await client.positions.listAggregateEntityPositions({ entityId });
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
get positions() {
|
|
246
|
+
if (!this._positionsService) {
|
|
247
|
+
const { PositionsService } = require('../positions');
|
|
248
|
+
this._positionsService = new PositionsService(this);
|
|
249
|
+
}
|
|
250
|
+
return this._positionsService;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Lazy getter for ProductsService
|
|
254
|
+
* @example
|
|
255
|
+
* ```typescript
|
|
256
|
+
* const products = await client.products.listProducts({ portfolioId });
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
get products() {
|
|
260
|
+
if (!this._productsService) {
|
|
261
|
+
const { ProductsService } = require('../products');
|
|
262
|
+
this._productsService = new ProductsService(this);
|
|
263
|
+
}
|
|
264
|
+
return this._productsService;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Lazy getter for StakingService
|
|
268
|
+
* @example
|
|
269
|
+
* ```typescript
|
|
270
|
+
* const stake = await client.staking.createStake({ walletId, assetId, amount });
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
get staking() {
|
|
274
|
+
if (!this._stakingService) {
|
|
275
|
+
const { StakingService } = require('../staking');
|
|
276
|
+
this._stakingService = new StakingService(this);
|
|
277
|
+
}
|
|
278
|
+
return this._stakingService;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Lazy getter for TransactionsService
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* const transaction = await client.transactions.getTransaction({ portfolioId, transactionId });
|
|
285
|
+
* ```
|
|
286
|
+
*/
|
|
287
|
+
get transactions() {
|
|
288
|
+
if (!this._transactionsService) {
|
|
289
|
+
const { TransactionsService } = require('../transactions');
|
|
290
|
+
this._transactionsService = new TransactionsService(this);
|
|
291
|
+
}
|
|
292
|
+
return this._transactionsService;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Lazy getter for UsersService
|
|
296
|
+
* @example
|
|
297
|
+
* ```typescript
|
|
298
|
+
* const users = await client.users.listUsers({ entityId });
|
|
299
|
+
* ```
|
|
300
|
+
*/
|
|
301
|
+
get users() {
|
|
302
|
+
if (!this._usersService) {
|
|
303
|
+
const { UsersService } = require('../users');
|
|
304
|
+
this._usersService = new UsersService(this);
|
|
305
|
+
}
|
|
306
|
+
return this._usersService;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Lazy getter for WalletsService
|
|
310
|
+
* @example
|
|
311
|
+
* ```typescript
|
|
312
|
+
* const wallets = await client.wallets.listWallets({ portfolioId });
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
get wallets() {
|
|
316
|
+
if (!this._walletsService) {
|
|
317
|
+
const { WalletsService } = require('../wallets');
|
|
318
|
+
this._walletsService = new WalletsService(this);
|
|
319
|
+
}
|
|
320
|
+
return this._walletsService;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
exports.CoinbasePrimeClientWithServices = CoinbasePrimeClientWithServices;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
|
-
* Copyright
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
3
4
|
*
|
|
4
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
6
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,8 +14,4 @@
|
|
|
13
14
|
* See the License for the specific language governing permissions and
|
|
14
15
|
* limitations under the License.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
-
import { CoinbasePrimeCredentials } from './credentials';
|
|
18
|
-
export declare class CoinbasePrimeClient extends CoinbaseClient {
|
|
19
|
-
constructor(credentials?: CoinbasePrimeCredentials, apiBasePath?: string, options?: CoinbaseHttpClientRetryOptions);
|
|
20
|
-
}
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.CoinbaseError = exports.CoinbaseClientException = exports.Method = exports.CoinbaseClient = exports.CoinbasePrimeClientWithServices = exports.CoinbasePrimeClient = void 0;
|
|
19
|
+
var client_1 = require("./client");
|
|
20
|
+
Object.defineProperty(exports, "CoinbasePrimeClient", { enumerable: true, get: function () { return client_1.CoinbasePrimeClient; } });
|
|
21
|
+
var clientWithServices_1 = require("./clientWithServices");
|
|
22
|
+
Object.defineProperty(exports, "CoinbasePrimeClientWithServices", { enumerable: true, get: function () { return clientWithServices_1.CoinbasePrimeClientWithServices; } });
|
|
23
|
+
// Re-export core-ts objects for central control of service's usage of core-ts
|
|
24
|
+
var core_ts_1 = require("@coinbase-sample/core-ts");
|
|
25
|
+
Object.defineProperty(exports, "CoinbaseClient", { enumerable: true, get: function () { return core_ts_1.CoinbaseClient; } });
|
|
26
|
+
Object.defineProperty(exports, "Method", { enumerable: true, get: function () { return core_ts_1.Method; } });
|
|
27
|
+
Object.defineProperty(exports, "CoinbaseClientException", { enumerable: true, get: function () { return core_ts_1.CoinbaseClientException; } });
|
|
28
|
+
Object.defineProperty(exports, "CoinbaseError", { enumerable: true, get: function () { return core_ts_1.CoinbaseError; } });
|
package/dist/constants.js
CHANGED
|
@@ -16,7 +16,7 @@ exports.DEFAULT_MAX_ITEMS = exports.DEFAULT_MAX_PAGES = exports.DEFAULT_PAGINATI
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
-
exports.VERSION = '0.6.
|
|
19
|
+
exports.VERSION = '0.6.4';
|
|
20
20
|
exports.API_BASE_PATH = 'https://api.prime.coinbase.com/v1/';
|
|
21
21
|
exports.USER_AGENT = 'coinbase-prime-ts/' + exports.VERSION;
|
|
22
22
|
exports.CB_ACCESS_KEY_HEADER = 'X-CB-ACCESS-KEY';
|
package/dist/futures/index.js
CHANGED
|
@@ -25,7 +25,7 @@ exports.FuturesService = void 0;
|
|
|
25
25
|
* See the License for the specific language governing permissions and
|
|
26
26
|
* limitations under the License.
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const clients_1 = require("../clients");
|
|
29
29
|
class FuturesService {
|
|
30
30
|
constructor(client) {
|
|
31
31
|
this.client = client;
|
|
@@ -63,7 +63,7 @@ class FuturesService {
|
|
|
63
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
64
|
const response = yield this.client.request({
|
|
65
65
|
url: `entities/${request.entityId}/futures/sweeps`,
|
|
66
|
-
method:
|
|
66
|
+
method: clients_1.Method.POST,
|
|
67
67
|
bodyParams: Object.assign(Object.assign({}, request), { entityId: undefined }),
|
|
68
68
|
callOptions: options,
|
|
69
69
|
});
|
|
@@ -74,7 +74,7 @@ class FuturesService {
|
|
|
74
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
75
|
const response = yield this.client.request({
|
|
76
76
|
url: `entities/${request.entityId}/futures/auto_sweep`,
|
|
77
|
-
method:
|
|
77
|
+
method: clients_1.Method.POST,
|
|
78
78
|
bodyParams: Object.assign(Object.assign({}, request), { entityId: undefined }),
|
|
79
79
|
callOptions: options,
|
|
80
80
|
});
|
|
@@ -85,7 +85,7 @@ class FuturesService {
|
|
|
85
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
86
|
const response = yield this.client.request({
|
|
87
87
|
url: `entities/${request.entityId}/futures/sweeps`,
|
|
88
|
-
method:
|
|
88
|
+
method: clients_1.Method.DELETE,
|
|
89
89
|
callOptions: options,
|
|
90
90
|
});
|
|
91
91
|
return response.data;
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WalletsService = exports.UsersService = exports.TransactionsService = exports.StakingService = exports.ProductsService = exports.PositionsService = exports.PortfoliosService = exports.PaymentMethodsService = exports.OrdersService = exports.OnchainAddressBookService = exports.InvoicesService = exports.FuturesService = exports.FinancingService = exports.CommissionService = exports.BalancesService = exports.AssetsService = exports.AllocationService = exports.AddressBooksService = exports.ActivitiesService = exports.CoinbasePrimeCredentials = exports.CoinbasePrimeClient = void 0;
|
|
18
2
|
/**
|
|
19
3
|
* Copyright 2024-present Coinbase Global, Inc.
|
|
20
4
|
*
|
|
@@ -30,10 +14,35 @@ exports.WalletsService = exports.UsersService = exports.TransactionsService = ex
|
|
|
30
14
|
* See the License for the specific language governing permissions and
|
|
31
15
|
* limitations under the License.
|
|
32
16
|
*/
|
|
33
|
-
var
|
|
34
|
-
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
29
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.WalletsService = exports.UsersService = exports.TransactionsService = exports.StakingService = exports.ProductsService = exports.PositionsService = exports.PortfoliosService = exports.PaymentMethodsService = exports.OrdersService = exports.OnchainAddressBookService = exports.InvoicesService = exports.FuturesService = exports.FinancingService = exports.CommissionService = exports.BalancesService = exports.AssetsService = exports.AllocationService = exports.AddressBooksService = exports.ActivitiesService = exports.createCredentialsFromEnv = exports.CoinbasePrimeCredentials = exports.CoinbasePrimeClient = exports.CoinbasePrimeClientWithServices = exports.CoinbaseError = exports.CoinbaseClientException = exports.Method = exports.CoinbaseClient = void 0;
|
|
33
|
+
// Re-export commonly used core-ts objects for convenience
|
|
34
|
+
// This allows users to import everything from a single package
|
|
35
|
+
var clients_1 = require("./clients");
|
|
36
|
+
Object.defineProperty(exports, "CoinbaseClient", { enumerable: true, get: function () { return clients_1.CoinbaseClient; } });
|
|
37
|
+
Object.defineProperty(exports, "Method", { enumerable: true, get: function () { return clients_1.Method; } });
|
|
38
|
+
Object.defineProperty(exports, "CoinbaseClientException", { enumerable: true, get: function () { return clients_1.CoinbaseClientException; } });
|
|
39
|
+
Object.defineProperty(exports, "CoinbaseError", { enumerable: true, get: function () { return clients_1.CoinbaseError; } });
|
|
40
|
+
Object.defineProperty(exports, "CoinbasePrimeClientWithServices", { enumerable: true, get: function () { return clients_1.CoinbasePrimeClientWithServices; } });
|
|
41
|
+
Object.defineProperty(exports, "CoinbasePrimeClient", { enumerable: true, get: function () { return clients_1.CoinbasePrimeClient; } });
|
|
35
42
|
var credentials_1 = require("./credentials");
|
|
36
43
|
Object.defineProperty(exports, "CoinbasePrimeCredentials", { enumerable: true, get: function () { return credentials_1.CoinbasePrimeCredentials; } });
|
|
44
|
+
var envUtils_1 = require("./shared/envUtils");
|
|
45
|
+
Object.defineProperty(exports, "createCredentialsFromEnv", { enumerable: true, get: function () { return envUtils_1.createCredentialsFromEnv; } });
|
|
37
46
|
var activities_1 = require("./activities");
|
|
38
47
|
Object.defineProperty(exports, "ActivitiesService", { enumerable: true, get: function () { return activities_1.ActivitiesService; } });
|
|
39
48
|
var addressBooks_1 = require("./addressBooks");
|