@coinbase-sample/prime-sdk-ts 0.6.2 → 0.6.3

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 (56) hide show
  1. package/README.md +207 -67
  2. package/dist/addressBooks/index.js +2 -2
  3. package/dist/allocations/index.js +3 -3
  4. package/dist/client-manual.js +84 -0
  5. package/dist/client-modular.js +57 -0
  6. package/dist/client-only.js +31 -0
  7. package/dist/{client.js → clients/client.js} +12 -2
  8. package/dist/clients/clientWithServices.js +323 -0
  9. package/dist/{types/client.d.ts → clients/clientWithServicesTypes.js} +3 -6
  10. package/dist/clients/index.js +28 -0
  11. package/dist/clients/types.js +2 -0
  12. package/dist/constants.js +1 -1
  13. package/dist/futures/index.js +4 -4
  14. package/dist/index.js +27 -18
  15. package/dist/onchainAddressBook/index.js +4 -4
  16. package/dist/orders/index.js +6 -6
  17. package/dist/services.js +75 -0
  18. package/dist/shared/envUtils.js +66 -0
  19. package/dist/staking/index.js +5 -5
  20. package/dist/transactions/index.js +5 -5
  21. package/dist/types/activities/index.d.ts +2 -3
  22. package/dist/types/addressBooks/index.d.ts +2 -3
  23. package/dist/types/allocations/index.d.ts +2 -3
  24. package/dist/types/assets/index.d.ts +2 -3
  25. package/dist/types/balances/index.d.ts +2 -3
  26. package/dist/types/client-manual.d.ts +58 -0
  27. package/dist/types/client-modular.d.ts +39 -0
  28. package/dist/types/client-only.d.ts +18 -0
  29. package/dist/types/clients/client.d.ts +27 -0
  30. package/dist/types/clients/clientWithServices.d.ts +229 -0
  31. package/dist/types/clients/clientWithServicesTypes.d.ts +115 -0
  32. package/dist/types/clients/index.d.ts +19 -0
  33. package/dist/types/clients/types.d.ts +48 -0
  34. package/dist/types/commission/index.d.ts +2 -3
  35. package/dist/types/constants.d.ts +1 -1
  36. package/dist/types/financing/index.d.ts +2 -3
  37. package/dist/types/futures/index.d.ts +2 -3
  38. package/dist/types/index.d.ts +2 -1
  39. package/dist/types/invoices/index.d.ts +2 -3
  40. package/dist/types/onchainAddressBook/index.d.ts +2 -3
  41. package/dist/types/orders/index.d.ts +2 -3
  42. package/dist/types/paymentMethods/index.d.ts +2 -3
  43. package/dist/types/portfolios/index.d.ts +2 -3
  44. package/dist/types/positions/index.d.ts +2 -3
  45. package/dist/types/products/index.d.ts +2 -3
  46. package/dist/types/services.d.ts +39 -0
  47. package/dist/types/shared/envUtils.d.ts +36 -0
  48. package/dist/types/shared/paginatedResponse.d.ts +3 -4
  49. package/dist/types/staking/index.d.ts +2 -3
  50. package/dist/types/transactions/index.d.ts +2 -3
  51. package/dist/types/types.d.ts +37 -0
  52. package/dist/types/users/index.d.ts +2 -3
  53. package/dist/types/wallets/index.d.ts +2 -3
  54. package/dist/types.js +39 -0
  55. package/dist/wallets/index.js +3 -3
  56. package/package.json +32 -1
@@ -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 2024-present Coinbase Global, Inc.
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
- import { CoinbaseClient, CoinbaseHttpClientRetryOptions } from '@coinbase-sample/core-ts';
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; } });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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.2';
19
+ exports.VERSION = '0.6.3';
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';
@@ -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 core_ts_1 = require("@coinbase-sample/core-ts");
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: core_ts_1.Method.POST,
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: core_ts_1.Method.POST,
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: core_ts_1.Method.DELETE,
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 client_1 = require("./client");
34
- Object.defineProperty(exports, "CoinbasePrimeClient", { enumerable: true, get: function () { return client_1.CoinbasePrimeClient; } });
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");
@@ -25,7 +25,7 @@ exports.OnchainAddressBookService = void 0;
25
25
  * See the License for the specific language governing permissions and
26
26
  * limitations under the License.
27
27
  */
28
- const core_ts_1 = require("@coinbase-sample/core-ts");
28
+ const clients_1 = require("../clients");
29
29
  class OnchainAddressBookService {
30
30
  constructor(client) {
31
31
  this.client = client;
@@ -44,7 +44,7 @@ class OnchainAddressBookService {
44
44
  const response = yield this.client.request({
45
45
  url: `portfolios/${request.portfolioId}/onchain_address_group`,
46
46
  bodyParams: Object.assign(Object.assign({}, request), { portfolioId: undefined }),
47
- method: core_ts_1.Method.POST,
47
+ method: clients_1.Method.POST,
48
48
  callOptions: options,
49
49
  });
50
50
  return response.data;
@@ -55,7 +55,7 @@ class OnchainAddressBookService {
55
55
  const response = yield this.client.request({
56
56
  url: `portfolios/${request.portfolioId}/onchain_address_group`,
57
57
  bodyParams: Object.assign(Object.assign({}, request), { portfolioId: undefined }),
58
- method: core_ts_1.Method.PUT,
58
+ method: clients_1.Method.PUT,
59
59
  callOptions: options,
60
60
  });
61
61
  return response.data;
@@ -65,7 +65,7 @@ class OnchainAddressBookService {
65
65
  return __awaiter(this, void 0, void 0, function* () {
66
66
  const response = yield this.client.request({
67
67
  url: `portfolios/${request.portfolioId}/onchain_address_group/${request.addressGroupId}`,
68
- method: core_ts_1.Method.DELETE,
68
+ method: clients_1.Method.DELETE,
69
69
  callOptions: options,
70
70
  });
71
71
  return response.data;
@@ -36,7 +36,7 @@ exports.OrdersService = void 0;
36
36
  * See the License for the specific language governing permissions and
37
37
  * limitations under the License.
38
38
  */
39
- const core_ts_1 = require("@coinbase-sample/core-ts");
39
+ const clients_1 = require("../clients");
40
40
  const paginatedResponse_1 = require("../shared/paginatedResponse");
41
41
  class OrdersService {
42
42
  constructor(client) {
@@ -122,7 +122,7 @@ class OrdersService {
122
122
  return __awaiter(this, void 0, void 0, function* () {
123
123
  const response = yield this.client.request({
124
124
  url: `portfolios/${request.portfolioId}/order_preview`,
125
- method: core_ts_1.Method.POST,
125
+ method: clients_1.Method.POST,
126
126
  bodyParams: request,
127
127
  callOptions: options,
128
128
  });
@@ -133,7 +133,7 @@ class OrdersService {
133
133
  return __awaiter(this, void 0, void 0, function* () {
134
134
  const response = yield this.client.request({
135
135
  url: `portfolios/${request.portfolioId}/orders/${request.orderId}/cancel`,
136
- method: core_ts_1.Method.POST,
136
+ method: clients_1.Method.POST,
137
137
  callOptions: options,
138
138
  });
139
139
  return response.data;
@@ -143,7 +143,7 @@ class OrdersService {
143
143
  return __awaiter(this, void 0, void 0, function* () {
144
144
  const response = yield this.client.request({
145
145
  url: `portfolios/${request.portfolioId}/order`,
146
- method: core_ts_1.Method.POST,
146
+ method: clients_1.Method.POST,
147
147
  bodyParams: request,
148
148
  callOptions: options,
149
149
  });
@@ -154,7 +154,7 @@ class OrdersService {
154
154
  return __awaiter(this, void 0, void 0, function* () {
155
155
  const response = yield this.client.request({
156
156
  url: `portfolios/${request.portfolioId}/rfq`,
157
- method: core_ts_1.Method.POST,
157
+ method: clients_1.Method.POST,
158
158
  bodyParams: request,
159
159
  callOptions: options,
160
160
  });
@@ -165,7 +165,7 @@ class OrdersService {
165
165
  return __awaiter(this, void 0, void 0, function* () {
166
166
  const response = yield this.client.request({
167
167
  url: `portfolios/${request.portfolioId}/accept_quote`,
168
- method: core_ts_1.Method.POST,
168
+ method: clients_1.Method.POST,
169
169
  bodyParams: request,
170
170
  callOptions: options,
171
171
  });
@@ -0,0 +1,75 @@
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
+ 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 = void 0;
33
+ // Services-only entry point - for users who want to import specific services
34
+ // without pulling in client classes. Ideal for custom client implementations
35
+ // or when using dependency injection frameworks.
36
+ // Export all service classes and interfaces
37
+ var activities_1 = require("./activities");
38
+ Object.defineProperty(exports, "ActivitiesService", { enumerable: true, get: function () { return activities_1.ActivitiesService; } });
39
+ var addressBooks_1 = require("./addressBooks");
40
+ Object.defineProperty(exports, "AddressBooksService", { enumerable: true, get: function () { return addressBooks_1.AddressBooksService; } });
41
+ var allocations_1 = require("./allocations");
42
+ Object.defineProperty(exports, "AllocationService", { enumerable: true, get: function () { return allocations_1.AllocationService; } });
43
+ var assets_1 = require("./assets");
44
+ Object.defineProperty(exports, "AssetsService", { enumerable: true, get: function () { return assets_1.AssetsService; } });
45
+ var balances_1 = require("./balances");
46
+ Object.defineProperty(exports, "BalancesService", { enumerable: true, get: function () { return balances_1.BalancesService; } });
47
+ var commission_1 = require("./commission");
48
+ Object.defineProperty(exports, "CommissionService", { enumerable: true, get: function () { return commission_1.CommissionService; } });
49
+ var financing_1 = require("./financing");
50
+ Object.defineProperty(exports, "FinancingService", { enumerable: true, get: function () { return financing_1.FinancingService; } });
51
+ var futures_1 = require("./futures");
52
+ Object.defineProperty(exports, "FuturesService", { enumerable: true, get: function () { return futures_1.FuturesService; } });
53
+ var invoices_1 = require("./invoices");
54
+ Object.defineProperty(exports, "InvoicesService", { enumerable: true, get: function () { return invoices_1.InvoicesService; } });
55
+ var onchainAddressBook_1 = require("./onchainAddressBook");
56
+ Object.defineProperty(exports, "OnchainAddressBookService", { enumerable: true, get: function () { return onchainAddressBook_1.OnchainAddressBookService; } });
57
+ var orders_1 = require("./orders");
58
+ Object.defineProperty(exports, "OrdersService", { enumerable: true, get: function () { return orders_1.OrdersService; } });
59
+ var paymentMethods_1 = require("./paymentMethods");
60
+ Object.defineProperty(exports, "PaymentMethodsService", { enumerable: true, get: function () { return paymentMethods_1.PaymentMethodsService; } });
61
+ var portfolios_1 = require("./portfolios");
62
+ Object.defineProperty(exports, "PortfoliosService", { enumerable: true, get: function () { return portfolios_1.PortfoliosService; } });
63
+ var positions_1 = require("./positions");
64
+ Object.defineProperty(exports, "PositionsService", { enumerable: true, get: function () { return positions_1.PositionsService; } });
65
+ var products_1 = require("./products");
66
+ Object.defineProperty(exports, "ProductsService", { enumerable: true, get: function () { return products_1.ProductsService; } });
67
+ var staking_1 = require("./staking");
68
+ Object.defineProperty(exports, "StakingService", { enumerable: true, get: function () { return staking_1.StakingService; } });
69
+ var transactions_1 = require("./transactions");
70
+ Object.defineProperty(exports, "TransactionsService", { enumerable: true, get: function () { return transactions_1.TransactionsService; } });
71
+ var users_1 = require("./users");
72
+ Object.defineProperty(exports, "UsersService", { enumerable: true, get: function () { return users_1.UsersService; } });
73
+ var wallets_1 = require("./wallets");
74
+ Object.defineProperty(exports, "WalletsService", { enumerable: true, get: function () { return wallets_1.WalletsService; } });
75
+ __exportStar(require("./model/enums/"), exports);