@coinbase-sample/prime-sdk-ts 0.8.0 → 0.8.2
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/dist/activities/index.js +14 -0
- package/dist/addressBooks/index.js +10 -0
- package/dist/allocations/index.js +12 -0
- package/dist/assets/index.js +4 -0
- package/dist/balances/index.js +15 -0
- package/dist/commission/index.js +4 -0
- package/dist/constants.js +1 -1
- package/dist/financing/index.js +52 -0
- package/dist/futures/index.js +33 -0
- package/dist/index.js +7 -1
- package/dist/invoices/index.js +4 -0
- package/dist/model/GetStakingStatusResponse.js +21 -0
- package/dist/model/StakingStatus.js +21 -0
- package/dist/model/SubmitDepositTravelRuleDataResponse.js +21 -0
- package/dist/model/TravelRuleData.js +21 -0
- package/dist/model/ValidatorStakingInfo.js +21 -0
- package/dist/model/enums/StakeType.js +28 -0
- package/dist/model/enums/index.js +4 -2
- package/dist/model/googleTypeDate.js +21 -0
- package/dist/model/requestToSubmitTravelRuleDataForAnExistingDepositTransaction.js +21 -0
- package/dist/onchainAddressBook/index.js +14 -0
- package/dist/orders/index.js +59 -0
- package/dist/paymentMethods/index.js +8 -0
- package/dist/portfolios/index.js +10 -0
- package/dist/positions/index.js +7 -0
- package/dist/products/index.js +11 -0
- package/dist/shared/__tests__/validation.test.js +184 -124
- package/dist/shared/validation.js +90 -260
- package/dist/staking/index.js +55 -0
- package/dist/transactions/index.js +58 -0
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/model/Balance.d.ts +4 -0
- package/dist/types/model/CreatePortfolioAddressBookEntryRequest.d.ts +0 -2
- package/dist/types/model/CreateWalletWithdrawalRequest.d.ts +2 -0
- package/dist/types/model/GetStakingStatusResponse.d.ts +42 -0
- package/dist/types/model/StakingStatus.d.ts +39 -0
- package/dist/types/model/SubmitDepositTravelRuleDataResponse.d.ts +22 -0
- package/dist/types/model/TravelRuleData.d.ts +37 -0
- package/dist/types/model/TravelRuleParty.d.ts +19 -4
- package/dist/types/model/ValidatorStakingInfo.d.ts +30 -0
- package/dist/types/model/enums/StakeType.d.ts +24 -0
- package/dist/types/model/enums/index.d.ts +1 -0
- package/dist/types/model/googleTypeDate.d.ts +36 -0
- package/dist/types/model/index.d.ts +7 -0
- package/dist/types/model/requestToSubmitTravelRuleDataForAnExistingDepositTransaction.d.ts +26 -0
- package/dist/types/orders/types.d.ts +1 -1
- package/dist/types/shared/validation.d.ts +19 -107
- package/dist/types/staking/index.d.ts +3 -1
- package/dist/types/staking/types.d.ts +6 -1
- package/dist/types/transactions/index.d.ts +3 -1
- package/dist/types/transactions/types.d.ts +6 -1
- package/dist/types/wallets/types.d.ts +1 -1
- package/dist/users/index.js +7 -0
- package/dist/wallets/index.js +27 -0
- package/package.json +6 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
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
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.StakeType = void 0;
|
|
23
|
+
var StakeType;
|
|
24
|
+
(function (StakeType) {
|
|
25
|
+
StakeType["StakeTypeUnspecified"] = "STAKE_TYPE_UNSPECIFIED";
|
|
26
|
+
StakeType["StakeTypeInitialDeposit"] = "STAKE_TYPE_INITIAL_DEPOSIT";
|
|
27
|
+
StakeType["StakeTypeTopUp"] = "STAKE_TYPE_TOP_UP";
|
|
28
|
+
})(StakeType || (exports.StakeType = StakeType = {}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.XMParty = exports.XMMarginLevel = exports.XMEntityCallStatus = exports.XMControlStatus = exports.XMCallType = exports.XMCallStatus = exports.WalletVisibility = void 0;
|
|
3
|
+
exports.WalletDepositInstructionType = exports.VisibilityStatus = exports.ValidatorStatus = exports.UserRole = exports.UnstakeType = exports.TravelRuleWalletType = exports.TravelRuleStatus = exports.TransferLocationType = exports.TransactionType = exports.TransactionStatus = exports.TimeInForceType = exports.StakeType = exports.SortDirection = exports.SigningStatus = exports.RewardSubtype = exports.RateType = exports.ProductPermissions = exports.PositionReferenceType = exports.PortfolioBalanceType = exports.PegOffsetType = exports.PaymentMethodType = exports.OrderType = exports.OrderStatus = exports.OrderSide = exports.NetworkType = exports.NetworkFamily = exports.MarginAddOnType = exports.LoanType = exports.InvoiceType = exports.InvoiceState = exports.HierarchyType = exports.FcmPositionSide = exports.FcmMarginCallType = exports.FcmMarginCallState = exports.FcmFuturesSweepStatus = exports.EstimateType = exports.DestinationType = exports.CandlesGranularity = exports.Benchmark = exports.AssetChangeType = exports.AllocationStatus = exports.AllocationSizeType = exports.PrimeActivityType = exports.ActivityStatus = exports.ActivitySecondaryType = exports.ActivityLevel = exports.ActivityCategory = exports.Action = exports.AddressBookType = exports.CustodyActivityType = void 0;
|
|
4
|
+
exports.XMParty = exports.XMMarginLevel = exports.XMEntityCallStatus = exports.XMControlStatus = exports.XMCallType = exports.XMCallStatus = exports.WalletVisibility = exports.WalletType = void 0;
|
|
5
5
|
var CustodyActivityType_1 = require("./CustodyActivityType");
|
|
6
6
|
Object.defineProperty(exports, "CustodyActivityType", { enumerable: true, get: function () { return CustodyActivityType_1.ActivityType; } });
|
|
7
7
|
var AddressBookType_1 = require("./AddressBookType");
|
|
@@ -78,6 +78,8 @@ var SigningStatus_1 = require("./SigningStatus");
|
|
|
78
78
|
Object.defineProperty(exports, "SigningStatus", { enumerable: true, get: function () { return SigningStatus_1.SigningStatus; } });
|
|
79
79
|
var SortDirection_1 = require("./SortDirection");
|
|
80
80
|
Object.defineProperty(exports, "SortDirection", { enumerable: true, get: function () { return SortDirection_1.SortDirection; } });
|
|
81
|
+
var StakeType_1 = require("./StakeType");
|
|
82
|
+
Object.defineProperty(exports, "StakeType", { enumerable: true, get: function () { return StakeType_1.StakeType; } });
|
|
81
83
|
var TimeInForceType_1 = require("./TimeInForceType");
|
|
82
84
|
Object.defineProperty(exports, "TimeInForceType", { enumerable: true, get: function () { return TimeInForceType_1.TimeInForceType; } });
|
|
83
85
|
var TransactionStatus_1 = require("./TransactionStatus");
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
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
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2025-present Coinbase Global, Inc.
|
|
4
|
+
*
|
|
5
|
+
* This file is generated by Openapi Generator https://github.com/openapitools/openapi-generator
|
|
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
|
+
* Do not edit the class manually.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -26,12 +26,16 @@ exports.OnchainAddressBookService = void 0;
|
|
|
26
26
|
* limitations under the License.
|
|
27
27
|
*/
|
|
28
28
|
const clients_1 = require("../clients");
|
|
29
|
+
const validation_1 = require("../shared/validation");
|
|
29
30
|
class OnchainAddressBookService {
|
|
30
31
|
constructor(client) {
|
|
31
32
|
this.client = client;
|
|
32
33
|
}
|
|
33
34
|
listOnchainAddressBook(request, options) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
(0, validation_1.validate)(request)
|
|
37
|
+
.requiredUUID((r) => r.portfolioId)
|
|
38
|
+
.check();
|
|
35
39
|
const response = yield this.client.request({
|
|
36
40
|
url: `portfolios/${request.portfolioId}/onchain_address_groups`,
|
|
37
41
|
callOptions: options,
|
|
@@ -41,6 +45,9 @@ class OnchainAddressBookService {
|
|
|
41
45
|
}
|
|
42
46
|
createOnchainAddressBookEntry(request, options) {
|
|
43
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
(0, validation_1.validate)(request)
|
|
49
|
+
.requiredUUID((r) => r.portfolioId)
|
|
50
|
+
.check();
|
|
44
51
|
const response = yield this.client.request({
|
|
45
52
|
url: `portfolios/${request.portfolioId}/onchain_address_group`,
|
|
46
53
|
bodyParams: Object.assign(Object.assign({}, request), { portfolioId: undefined }),
|
|
@@ -52,6 +59,9 @@ class OnchainAddressBookService {
|
|
|
52
59
|
}
|
|
53
60
|
updateOnchainAddressBookEntry(request, options) {
|
|
54
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
(0, validation_1.validate)(request)
|
|
63
|
+
.requiredUUID((r) => r.portfolioId)
|
|
64
|
+
.check();
|
|
55
65
|
const response = yield this.client.request({
|
|
56
66
|
url: `portfolios/${request.portfolioId}/onchain_address_group`,
|
|
57
67
|
bodyParams: Object.assign(Object.assign({}, request), { portfolioId: undefined }),
|
|
@@ -63,6 +73,10 @@ class OnchainAddressBookService {
|
|
|
63
73
|
}
|
|
64
74
|
deleteOnchainAddressBook(request, options) {
|
|
65
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
(0, validation_1.validate)(request)
|
|
77
|
+
.requiredUUID((r) => r.portfolioId)
|
|
78
|
+
.requiredUUID((r) => r.addressGroupId)
|
|
79
|
+
.check();
|
|
66
80
|
const response = yield this.client.request({
|
|
67
81
|
url: `portfolios/${request.portfolioId}/onchain_address_group/${request.addressGroupId}`,
|
|
68
82
|
method: clients_1.Method.DELETE,
|
package/dist/orders/index.js
CHANGED
|
@@ -37,6 +37,7 @@ exports.OrdersService = void 0;
|
|
|
37
37
|
* limitations under the License.
|
|
38
38
|
*/
|
|
39
39
|
const clients_1 = require("../clients");
|
|
40
|
+
const validation_1 = require("../shared/validation");
|
|
40
41
|
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
41
42
|
class OrdersService {
|
|
42
43
|
constructor(client) {
|
|
@@ -44,6 +45,10 @@ class OrdersService {
|
|
|
44
45
|
}
|
|
45
46
|
getOrder(request, options) {
|
|
46
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
(0, validation_1.validate)(request)
|
|
49
|
+
.requiredUUID((r) => r.portfolioId)
|
|
50
|
+
.requiredUUID((r) => r.orderId)
|
|
51
|
+
.check();
|
|
47
52
|
const response = yield this.client.request({
|
|
48
53
|
url: `portfolios/${request.portfolioId}/orders/${request.orderId}`,
|
|
49
54
|
callOptions: options,
|
|
@@ -53,6 +58,10 @@ class OrdersService {
|
|
|
53
58
|
}
|
|
54
59
|
getOrderEditHistory(request, options) {
|
|
55
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
(0, validation_1.validate)(request)
|
|
62
|
+
.requiredUUID((r) => r.portfolioId)
|
|
63
|
+
.requiredUUID((r) => r.orderId)
|
|
64
|
+
.check();
|
|
56
65
|
const response = yield this.client.request({
|
|
57
66
|
url: `portfolios/${request.portfolioId}/orders/${request.orderId}/edit_history`,
|
|
58
67
|
callOptions: options,
|
|
@@ -64,6 +73,9 @@ class OrdersService {
|
|
|
64
73
|
}
|
|
65
74
|
listPortfolioFills(request, options) {
|
|
66
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
(0, validation_1.validate)(request)
|
|
77
|
+
.requiredUUID((r) => r.portfolioId)
|
|
78
|
+
.check();
|
|
67
79
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
68
80
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
69
81
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -78,6 +90,9 @@ class OrdersService {
|
|
|
78
90
|
}
|
|
79
91
|
listPortfolioOrders(request, options) {
|
|
80
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
(0, validation_1.validate)(request)
|
|
94
|
+
.requiredUUID((r) => r.portfolioId)
|
|
95
|
+
.check();
|
|
81
96
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
82
97
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
83
98
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -92,6 +107,10 @@ class OrdersService {
|
|
|
92
107
|
}
|
|
93
108
|
listOrderFills(request, options) {
|
|
94
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
(0, validation_1.validate)(request)
|
|
111
|
+
.requiredUUID((r) => r.portfolioId)
|
|
112
|
+
.requiredUUID((r) => r.orderId)
|
|
113
|
+
.check();
|
|
95
114
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
96
115
|
const { limit, cursor, sortDirection, portfolioId, orderId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId", "orderId"]);
|
|
97
116
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -106,6 +125,9 @@ class OrdersService {
|
|
|
106
125
|
}
|
|
107
126
|
listOpenOrders(request, options) {
|
|
108
127
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
(0, validation_1.validate)(request)
|
|
129
|
+
.requiredUUID((r) => r.portfolioId)
|
|
130
|
+
.check();
|
|
109
131
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
110
132
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
111
133
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -120,6 +142,12 @@ class OrdersService {
|
|
|
120
142
|
}
|
|
121
143
|
createOrderPreview(request, options) {
|
|
122
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
(0, validation_1.validate)(request)
|
|
146
|
+
.requiredUUID((r) => r.portfolioId)
|
|
147
|
+
.requiredString((r) => r.productId)
|
|
148
|
+
.requiredString((r) => r.side)
|
|
149
|
+
.requiredString((r) => r.type)
|
|
150
|
+
.check();
|
|
123
151
|
const response = yield this.client.request({
|
|
124
152
|
url: `portfolios/${request.portfolioId}/order_preview`,
|
|
125
153
|
method: clients_1.Method.POST,
|
|
@@ -131,6 +159,10 @@ class OrdersService {
|
|
|
131
159
|
}
|
|
132
160
|
cancelOrder(request, options) {
|
|
133
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
(0, validation_1.validate)(request)
|
|
163
|
+
.requiredUUID((r) => r.portfolioId)
|
|
164
|
+
.requiredUUID((r) => r.orderId)
|
|
165
|
+
.check();
|
|
134
166
|
const response = yield this.client.request({
|
|
135
167
|
url: `portfolios/${request.portfolioId}/orders/${request.orderId}/cancel`,
|
|
136
168
|
method: clients_1.Method.POST,
|
|
@@ -141,6 +173,13 @@ class OrdersService {
|
|
|
141
173
|
}
|
|
142
174
|
createOrder(request, options) {
|
|
143
175
|
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
(0, validation_1.validate)(request)
|
|
177
|
+
.requiredUUID((r) => r.portfolioId)
|
|
178
|
+
.requiredString((r) => r.productId)
|
|
179
|
+
.requiredString((r) => r.side)
|
|
180
|
+
.requiredUUID((r) => r.clientOrderId)
|
|
181
|
+
.requiredString((r) => r.type)
|
|
182
|
+
.check();
|
|
144
183
|
const response = yield this.client.request({
|
|
145
184
|
url: `portfolios/${request.portfolioId}/order`,
|
|
146
185
|
method: clients_1.Method.POST,
|
|
@@ -152,6 +191,13 @@ class OrdersService {
|
|
|
152
191
|
}
|
|
153
192
|
createQuote(request, options) {
|
|
154
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
+
(0, validation_1.validate)(request)
|
|
195
|
+
.requiredUUID((r) => r.portfolioId)
|
|
196
|
+
.requiredString((r) => r.productId)
|
|
197
|
+
.requiredString((r) => r.side)
|
|
198
|
+
.requiredUUID((r) => r.clientOrderId)
|
|
199
|
+
.requiredString((r) => r.type)
|
|
200
|
+
.check();
|
|
155
201
|
const response = yield this.client.request({
|
|
156
202
|
url: `portfolios/${request.portfolioId}/rfq`,
|
|
157
203
|
method: clients_1.Method.POST,
|
|
@@ -163,6 +209,13 @@ class OrdersService {
|
|
|
163
209
|
}
|
|
164
210
|
acceptQuote(request, options) {
|
|
165
211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
(0, validation_1.validate)(request)
|
|
213
|
+
.requiredUUID((r) => r.portfolioId)
|
|
214
|
+
.requiredString((r) => r.productId)
|
|
215
|
+
.requiredString((r) => r.side)
|
|
216
|
+
.requiredUUID((r) => r.clientOrderId)
|
|
217
|
+
.requiredString((r) => r.quoteId)
|
|
218
|
+
.check();
|
|
166
219
|
const response = yield this.client.request({
|
|
167
220
|
url: `portfolios/${request.portfolioId}/accept_quote`,
|
|
168
221
|
method: clients_1.Method.POST,
|
|
@@ -174,6 +227,12 @@ class OrdersService {
|
|
|
174
227
|
}
|
|
175
228
|
editOrder(request, options) {
|
|
176
229
|
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
(0, validation_1.validate)(request)
|
|
231
|
+
.requiredUUID((r) => r.portfolioId)
|
|
232
|
+
.requiredUUID((r) => r.orderId)
|
|
233
|
+
.requiredUUID((r) => r.clientOrderId)
|
|
234
|
+
.requiredString((r) => r.origClientOrderId)
|
|
235
|
+
.check();
|
|
177
236
|
const { portfolioId, orderId } = request, bodyParams = __rest(request, ["portfolioId", "orderId"]);
|
|
178
237
|
const response = yield this.client.request({
|
|
179
238
|
url: `portfolios/${portfolioId}/orders/${orderId}/edit`,
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PaymentMethodsService = void 0;
|
|
13
|
+
const validation_1 = require("../shared/validation");
|
|
13
14
|
class PaymentMethodsService {
|
|
14
15
|
constructor(client) {
|
|
15
16
|
this.client = client;
|
|
@@ -17,6 +18,9 @@ class PaymentMethodsService {
|
|
|
17
18
|
// TODO: rename me to remove Entity in a minor version change
|
|
18
19
|
listEntityPaymentMethods(request, options) {
|
|
19
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
(0, validation_1.validate)(request)
|
|
22
|
+
.requiredUUID((r) => r.entityId)
|
|
23
|
+
.check();
|
|
20
24
|
const response = yield this.client.request({
|
|
21
25
|
url: `entities/${request.entityId}/payment-methods`,
|
|
22
26
|
callOptions: options,
|
|
@@ -26,6 +30,10 @@ class PaymentMethodsService {
|
|
|
26
30
|
}
|
|
27
31
|
getPaymentMethod(request, options) {
|
|
28
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
(0, validation_1.validate)(request)
|
|
34
|
+
.requiredUUID((r) => r.entityId)
|
|
35
|
+
.requiredUUID((r) => r.paymentMethodId)
|
|
36
|
+
.check();
|
|
29
37
|
const response = yield this.client.request({
|
|
30
38
|
url: `entities/${request.entityId}/payment-methods/${request.paymentMethodId}`,
|
|
31
39
|
callOptions: options,
|
package/dist/portfolios/index.js
CHANGED
|
@@ -10,12 +10,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PortfoliosService = void 0;
|
|
13
|
+
const validation_1 = require("../shared/validation");
|
|
13
14
|
class PortfoliosService {
|
|
14
15
|
constructor(client) {
|
|
15
16
|
this.client = client;
|
|
16
17
|
}
|
|
17
18
|
getPortfolio(request, options) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
(0, validation_1.validate)(request)
|
|
21
|
+
.requiredUUID((r) => r.portfolioId)
|
|
22
|
+
.check();
|
|
19
23
|
const response = yield this.client.request({
|
|
20
24
|
url: `portfolios/${request.portfolioId}`,
|
|
21
25
|
callOptions: options,
|
|
@@ -25,6 +29,9 @@ class PortfoliosService {
|
|
|
25
29
|
}
|
|
26
30
|
getPortfolioCredit(request, options) {
|
|
27
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
(0, validation_1.validate)(request)
|
|
33
|
+
.requiredUUID((r) => r.portfolioId)
|
|
34
|
+
.check();
|
|
28
35
|
const response = yield this.client.request({
|
|
29
36
|
url: `portfolios/${request.portfolioId}/credit`,
|
|
30
37
|
callOptions: options,
|
|
@@ -34,6 +41,9 @@ class PortfoliosService {
|
|
|
34
41
|
}
|
|
35
42
|
getCounterpartyId(request, options) {
|
|
36
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
(0, validation_1.validate)(request)
|
|
45
|
+
.requiredUUID((r) => r.portfolioId)
|
|
46
|
+
.check();
|
|
37
47
|
const response = yield this.client.request({
|
|
38
48
|
url: `portfolios/${request.portfolioId}/counterparty`,
|
|
39
49
|
callOptions: options,
|
package/dist/positions/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.PositionsService = void 0;
|
|
24
|
+
const validation_1 = require("../shared/validation");
|
|
24
25
|
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
25
26
|
class PositionsService {
|
|
26
27
|
constructor(client) {
|
|
@@ -28,6 +29,9 @@ class PositionsService {
|
|
|
28
29
|
}
|
|
29
30
|
listAggregateEntityPositions(request, options) {
|
|
30
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
(0, validation_1.validate)(request)
|
|
33
|
+
.requiredUUID((r) => r.entityId)
|
|
34
|
+
.check();
|
|
31
35
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
32
36
|
const { limit, cursor, sortDirection, entityId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "entityId"]);
|
|
33
37
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -42,6 +46,9 @@ class PositionsService {
|
|
|
42
46
|
}
|
|
43
47
|
listEntityPositions(request, options) {
|
|
44
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
(0, validation_1.validate)(request)
|
|
50
|
+
.requiredUUID((r) => r.entityId)
|
|
51
|
+
.check();
|
|
45
52
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
46
53
|
const { limit, cursor, sortDirection, entityId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "entityId"]);
|
|
47
54
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
package/dist/products/index.js
CHANGED
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.ProductsService = void 0;
|
|
24
|
+
const validation_1 = require("../shared/validation");
|
|
24
25
|
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
25
26
|
class ProductsService {
|
|
26
27
|
constructor(client) {
|
|
@@ -28,6 +29,9 @@ class ProductsService {
|
|
|
28
29
|
}
|
|
29
30
|
listProducts(request, options) {
|
|
30
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
(0, validation_1.validate)(request)
|
|
33
|
+
.requiredUUID((r) => r.portfolioId)
|
|
34
|
+
.check();
|
|
31
35
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
32
36
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
33
37
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -42,6 +46,13 @@ class ProductsService {
|
|
|
42
46
|
}
|
|
43
47
|
listProductCandles(request, options) {
|
|
44
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
(0, validation_1.validate)(request)
|
|
50
|
+
.requiredUUID((r) => r.portfolioId)
|
|
51
|
+
.requiredString((r) => r.productId)
|
|
52
|
+
.requiredString((r) => r.startTime)
|
|
53
|
+
.requiredString((r) => r.endTime)
|
|
54
|
+
.requiredString((r) => r.granularity)
|
|
55
|
+
.check();
|
|
45
56
|
const { portfolioId, productId, startTime, endTime, granularity } = request;
|
|
46
57
|
const response = yield this.client.request({
|
|
47
58
|
url: `portfolios/${portfolioId}/candles`,
|