@coinbase-sample/prime-sdk-ts 0.8.0 → 0.8.1
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/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 +41 -0
- package/dist/transactions/index.js +42 -0
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/index.d.ts +3 -0
- package/dist/types/orders/types.d.ts +1 -1
- package/dist/types/shared/validation.d.ts +19 -107
- 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
package/dist/activities/index.js
CHANGED
|
@@ -36,6 +36,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.ActivitiesService = void 0;
|
|
39
|
+
const validation_1 = require("../shared/validation");
|
|
39
40
|
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
40
41
|
class ActivitiesService {
|
|
41
42
|
constructor(client) {
|
|
@@ -43,6 +44,9 @@ class ActivitiesService {
|
|
|
43
44
|
}
|
|
44
45
|
getActivity(request, options) {
|
|
45
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
(0, validation_1.validate)(request)
|
|
48
|
+
.requiredUUID((r) => r.activityId)
|
|
49
|
+
.check();
|
|
46
50
|
const response = yield this.client.request({
|
|
47
51
|
url: `activities/${request.activityId}`,
|
|
48
52
|
callOptions: options,
|
|
@@ -52,6 +56,10 @@ class ActivitiesService {
|
|
|
52
56
|
}
|
|
53
57
|
getPortfolioActivity(request, options) {
|
|
54
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
(0, validation_1.validate)(request)
|
|
60
|
+
.requiredUUID((r) => r.portfolioId)
|
|
61
|
+
.requiredUUID((r) => r.activityId)
|
|
62
|
+
.check();
|
|
55
63
|
const response = yield this.client.request({
|
|
56
64
|
url: `portfolios/${request.portfolioId}/activities/${request.activityId}`,
|
|
57
65
|
callOptions: options,
|
|
@@ -61,6 +69,9 @@ class ActivitiesService {
|
|
|
61
69
|
}
|
|
62
70
|
listEntityActivities(request, options) {
|
|
63
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
(0, validation_1.validate)(request)
|
|
73
|
+
.requiredUUID((r) => r.entityId)
|
|
74
|
+
.check();
|
|
64
75
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
65
76
|
const { limit, cursor, sortDirection, entityId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "entityId"]);
|
|
66
77
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -75,6 +86,9 @@ class ActivitiesService {
|
|
|
75
86
|
}
|
|
76
87
|
listPortfolioActivities(request, options) {
|
|
77
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
(0, validation_1.validate)(request)
|
|
90
|
+
.requiredUUID((r) => r.portfolioId)
|
|
91
|
+
.check();
|
|
78
92
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
79
93
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
80
94
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -37,6 +37,7 @@ exports.AddressBooksService = 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 AddressBooksService {
|
|
42
43
|
constructor(client) {
|
|
@@ -44,6 +45,9 @@ class AddressBooksService {
|
|
|
44
45
|
}
|
|
45
46
|
listAddressBooks(request, options) {
|
|
46
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
(0, validation_1.validate)(request)
|
|
49
|
+
.requiredUUID((r) => r.portfolioId)
|
|
50
|
+
.check();
|
|
47
51
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
48
52
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
49
53
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -58,6 +62,12 @@ class AddressBooksService {
|
|
|
58
62
|
}
|
|
59
63
|
createAddressBook(request, options) {
|
|
60
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
(0, validation_1.validate)(request)
|
|
66
|
+
.requiredUUID((r) => r.portfolioId)
|
|
67
|
+
.requiredString((r) => r.address)
|
|
68
|
+
.requiredString((r) => r.currencySymbol)
|
|
69
|
+
.requiredString((r) => r.name)
|
|
70
|
+
.check();
|
|
61
71
|
const bodyParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
62
72
|
const response = yield this.client.request({
|
|
63
73
|
url: `portfolios/${request.portfolioId}/address_book`,
|
|
@@ -37,6 +37,7 @@ exports.AllocationService = 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 AllocationService {
|
|
42
43
|
constructor(client) {
|
|
@@ -66,6 +67,9 @@ class AllocationService {
|
|
|
66
67
|
}
|
|
67
68
|
listPortfolioAllocations(request, options) {
|
|
68
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
(0, validation_1.validate)(request)
|
|
71
|
+
.requiredUUID((r) => r.portfolioId)
|
|
72
|
+
.check();
|
|
69
73
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
70
74
|
const { limit, cursor, sortDirection, portfolioId } = request, queryParams = __rest(request, ["limit", "cursor", "sortDirection", "portfolioId"]);
|
|
71
75
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -80,6 +84,10 @@ class AllocationService {
|
|
|
80
84
|
}
|
|
81
85
|
listNetAllocations(request, options) {
|
|
82
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
(0, validation_1.validate)(request)
|
|
88
|
+
.requiredUUID((r) => r.portfolioId)
|
|
89
|
+
.requiredUUID((r) => r.nettingId)
|
|
90
|
+
.check();
|
|
83
91
|
const queryParams = {
|
|
84
92
|
allocationId: request.allocationId,
|
|
85
93
|
};
|
|
@@ -93,6 +101,10 @@ class AllocationService {
|
|
|
93
101
|
}
|
|
94
102
|
getAllocation(request, options) {
|
|
95
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
(0, validation_1.validate)(request)
|
|
105
|
+
.requiredUUID((r) => r.portfolioId)
|
|
106
|
+
.requiredUUID((r) => r.allocationId)
|
|
107
|
+
.check();
|
|
96
108
|
const response = yield this.client.request({
|
|
97
109
|
url: `portfolios/${request.portfolioId}/allocations/${request.allocationId}`,
|
|
98
110
|
callOptions: options,
|
package/dist/assets/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.AssetsService = void 0;
|
|
13
|
+
const validation_1 = require("../shared/validation");
|
|
13
14
|
class AssetsService {
|
|
14
15
|
constructor(client) {
|
|
15
16
|
this.client = client;
|
|
16
17
|
}
|
|
17
18
|
listAssets(request, options) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
(0, validation_1.validate)(request)
|
|
21
|
+
.requiredUUID((r) => r.entityId)
|
|
22
|
+
.check();
|
|
19
23
|
const response = yield this.client.request({
|
|
20
24
|
url: `entities/${request.entityId}/assets`,
|
|
21
25
|
callOptions: options,
|
package/dist/balances/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.BalancesService = void 0;
|
|
24
|
+
const validation_1 = require("../shared/validation");
|
|
24
25
|
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
25
26
|
class BalancesService {
|
|
26
27
|
constructor(client) {
|
|
@@ -28,6 +29,9 @@ class BalancesService {
|
|
|
28
29
|
}
|
|
29
30
|
listPortfolioBalances(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 { portfolioId } = request, queryParams = __rest(request, ["portfolioId"]);
|
|
32
36
|
const response = yield this.client.request({
|
|
33
37
|
url: `portfolios/${portfolioId}/balances`,
|
|
@@ -39,6 +43,10 @@ class BalancesService {
|
|
|
39
43
|
}
|
|
40
44
|
getWalletBalance(request, options) {
|
|
41
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
(0, validation_1.validate)(request)
|
|
47
|
+
.requiredUUID((r) => r.portfolioId)
|
|
48
|
+
.requiredUUID((r) => r.walletId)
|
|
49
|
+
.check();
|
|
42
50
|
const response = yield this.client.request({
|
|
43
51
|
url: `portfolios/${request.portfolioId}/wallets/${request.walletId}/balance`,
|
|
44
52
|
callOptions: options,
|
|
@@ -48,6 +56,10 @@ class BalancesService {
|
|
|
48
56
|
}
|
|
49
57
|
listOnchainWalletBalances(request, options) {
|
|
50
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
(0, validation_1.validate)(request)
|
|
60
|
+
.requiredUUID((r) => r.portfolioId)
|
|
61
|
+
.requiredUUID((r) => r.walletId)
|
|
62
|
+
.check();
|
|
51
63
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
52
64
|
const { limit, cursor, portfolioId, walletId } = request, queryParams = __rest(request, ["limit", "cursor", "portfolioId", "walletId"]);
|
|
53
65
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
|
@@ -62,6 +74,9 @@ class BalancesService {
|
|
|
62
74
|
}
|
|
63
75
|
listEntityBalances(request, options) {
|
|
64
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
(0, validation_1.validate)(request)
|
|
78
|
+
.requiredUUID((r) => r.entityId)
|
|
79
|
+
.check();
|
|
65
80
|
const paginationParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
66
81
|
const { limit, cursor, entityId } = request, queryParams = __rest(request, ["limit", "cursor", "entityId"]);
|
|
67
82
|
const finalQueryParams = Object.assign(Object.assign({}, paginationParams), queryParams);
|
package/dist/commission/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.CommissionService = void 0;
|
|
13
|
+
const validation_1 = require("../shared/validation");
|
|
13
14
|
class CommissionService {
|
|
14
15
|
constructor(client) {
|
|
15
16
|
this.client = client;
|
|
16
17
|
}
|
|
17
18
|
getPortfolioCommission(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}/commission`,
|
|
21
25
|
callOptions: options,
|
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.
|
|
19
|
+
exports.VERSION = '0.8.1';
|
|
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/financing/index.js
CHANGED
|
@@ -21,12 +21,16 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.FinancingService = void 0;
|
|
24
|
+
const validation_1 = require("../shared/validation");
|
|
24
25
|
class FinancingService {
|
|
25
26
|
constructor(client) {
|
|
26
27
|
this.client = client;
|
|
27
28
|
}
|
|
28
29
|
listExistingLocates(request, options) {
|
|
29
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
(0, validation_1.validate)(request)
|
|
32
|
+
.requiredUUID((r) => r.portfolioId)
|
|
33
|
+
.check();
|
|
30
34
|
const { portfolioId } = request, queryParams = __rest(request, ["portfolioId"]);
|
|
31
35
|
const response = yield this.client.request({
|
|
32
36
|
url: `portfolios/${portfolioId}/locates`,
|
|
@@ -38,6 +42,9 @@ class FinancingService {
|
|
|
38
42
|
}
|
|
39
43
|
listInterestAccruals(request, options) {
|
|
40
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
(0, validation_1.validate)(request)
|
|
46
|
+
.requiredUUID((r) => r.entityId)
|
|
47
|
+
.check();
|
|
41
48
|
const { entityId } = request, queryParams = __rest(request, ["entityId"]);
|
|
42
49
|
const response = yield this.client.request({
|
|
43
50
|
url: `entities/${entityId}/accruals`,
|
|
@@ -49,6 +56,9 @@ class FinancingService {
|
|
|
49
56
|
}
|
|
50
57
|
listPortfolioInterestAccruals(request, options) {
|
|
51
58
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
(0, validation_1.validate)(request)
|
|
60
|
+
.requiredUUID((r) => r.portfolioId)
|
|
61
|
+
.check();
|
|
52
62
|
const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
53
63
|
const response = yield this.client.request({
|
|
54
64
|
url: `portfolios/${request.portfolioId}/accruals`,
|
|
@@ -60,6 +70,9 @@ class FinancingService {
|
|
|
60
70
|
}
|
|
61
71
|
listMarginCallSummaries(request, options) {
|
|
62
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
(0, validation_1.validate)(request)
|
|
74
|
+
.requiredUUID((r) => r.entityId)
|
|
75
|
+
.check();
|
|
63
76
|
const queryParams = Object.assign(Object.assign({}, request), { entityId: undefined });
|
|
64
77
|
const response = yield this.client.request({
|
|
65
78
|
url: `entities/${request.entityId}/margin_summaries`,
|
|
@@ -71,6 +84,9 @@ class FinancingService {
|
|
|
71
84
|
}
|
|
72
85
|
listMarginConversions(request, options) {
|
|
73
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
(0, validation_1.validate)(request)
|
|
88
|
+
.requiredUUID((r) => r.portfolioId)
|
|
89
|
+
.check();
|
|
74
90
|
const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
75
91
|
const response = yield this.client.request({
|
|
76
92
|
url: `portfolios/${request.portfolioId}/margin_conversions`,
|
|
@@ -82,6 +98,9 @@ class FinancingService {
|
|
|
82
98
|
}
|
|
83
99
|
getEntityLocateAvailabilities(request, options) {
|
|
84
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
(0, validation_1.validate)(request)
|
|
102
|
+
.requiredUUID((r) => r.entityId)
|
|
103
|
+
.check();
|
|
85
104
|
const queryParams = Object.assign(Object.assign({}, request), { entityId: undefined });
|
|
86
105
|
const response = yield this.client.request({
|
|
87
106
|
url: `entities/${request.entityId}/locates_availability`,
|
|
@@ -93,6 +112,9 @@ class FinancingService {
|
|
|
93
112
|
}
|
|
94
113
|
getMarginInformation(request, options) {
|
|
95
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
(0, validation_1.validate)(request)
|
|
116
|
+
.requiredUUID((r) => r.entityId)
|
|
117
|
+
.check();
|
|
96
118
|
const response = yield this.client.request({
|
|
97
119
|
url: `entities/${request.entityId}/margin`,
|
|
98
120
|
callOptions: options,
|
|
@@ -102,6 +124,11 @@ class FinancingService {
|
|
|
102
124
|
}
|
|
103
125
|
getPortfolioBuyingPower(request, options) {
|
|
104
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
(0, validation_1.validate)(request)
|
|
128
|
+
.requiredUUID((r) => r.portfolioId)
|
|
129
|
+
.requiredString((r) => r.baseCurrency)
|
|
130
|
+
.requiredString((r) => r.quoteCurrency)
|
|
131
|
+
.check();
|
|
105
132
|
const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
106
133
|
const response = yield this.client.request({
|
|
107
134
|
url: `portfolios/${request.portfolioId}/buying_power`,
|
|
@@ -113,6 +140,9 @@ class FinancingService {
|
|
|
113
140
|
}
|
|
114
141
|
getPortfolioCreditInformation(request, options) {
|
|
115
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
(0, validation_1.validate)(request)
|
|
144
|
+
.requiredUUID((r) => r.portfolioId)
|
|
145
|
+
.check();
|
|
116
146
|
const response = yield this.client.request({
|
|
117
147
|
url: `portfolios/${request.portfolioId}/credit`,
|
|
118
148
|
callOptions: options,
|
|
@@ -122,6 +152,10 @@ class FinancingService {
|
|
|
122
152
|
}
|
|
123
153
|
getPortfolioWithdrawalPower(request, options) {
|
|
124
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
(0, validation_1.validate)(request)
|
|
156
|
+
.requiredUUID((r) => r.portfolioId)
|
|
157
|
+
.requiredString((r) => r.symbol)
|
|
158
|
+
.check();
|
|
125
159
|
const queryParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
126
160
|
const response = yield this.client.request({
|
|
127
161
|
url: `portfolios/${request.portfolioId}/withdrawal_power`,
|
|
@@ -133,6 +167,9 @@ class FinancingService {
|
|
|
133
167
|
}
|
|
134
168
|
getTieredPricingFees(request, options) {
|
|
135
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
(0, validation_1.validate)(request)
|
|
171
|
+
.requiredUUID((r) => r.entityId)
|
|
172
|
+
.check();
|
|
136
173
|
const queryParams = Object.assign(Object.assign({}, request), { entityId: undefined });
|
|
137
174
|
const response = yield this.client.request({
|
|
138
175
|
url: `entities/${request.entityId}/tf_tiered_fees`,
|
|
@@ -144,6 +181,9 @@ class FinancingService {
|
|
|
144
181
|
}
|
|
145
182
|
getFcmMarginCallDetails(request, options) {
|
|
146
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
(0, validation_1.validate)(request)
|
|
185
|
+
.requiredUUID((r) => r.entityId)
|
|
186
|
+
.check();
|
|
147
187
|
const response = yield this.client.request({
|
|
148
188
|
url: `entities/${request.entityId}/futures/margin_call_details`,
|
|
149
189
|
callOptions: options,
|
|
@@ -153,6 +193,9 @@ class FinancingService {
|
|
|
153
193
|
}
|
|
154
194
|
getFcmRiskLimits(request, options) {
|
|
155
195
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
(0, validation_1.validate)(request)
|
|
197
|
+
.requiredUUID((r) => r.entityId)
|
|
198
|
+
.check();
|
|
156
199
|
const response = yield this.client.request({
|
|
157
200
|
url: `entities/${request.entityId}/futures/risk_limits`,
|
|
158
201
|
callOptions: options,
|
|
@@ -162,6 +205,9 @@ class FinancingService {
|
|
|
162
205
|
}
|
|
163
206
|
createNewLocates(request, options) {
|
|
164
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
(0, validation_1.validate)(request)
|
|
209
|
+
.requiredUUID((r) => r.portfolioId)
|
|
210
|
+
.check();
|
|
165
211
|
const bodyParams = Object.assign(Object.assign({}, request), { portfolioId: undefined });
|
|
166
212
|
const response = yield this.client.request({
|
|
167
213
|
url: `portfolios/${request.portfolioId}/locates`,
|
|
@@ -173,6 +219,9 @@ class FinancingService {
|
|
|
173
219
|
}
|
|
174
220
|
getCrossMarginOverview(request, options) {
|
|
175
221
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
(0, validation_1.validate)(request)
|
|
223
|
+
.requiredUUID((r) => r.entityId)
|
|
224
|
+
.check();
|
|
176
225
|
const response = yield this.client.request({
|
|
177
226
|
url: `entities/${request.entityId}/cross_margin`,
|
|
178
227
|
callOptions: options,
|
|
@@ -182,6 +231,9 @@ class FinancingService {
|
|
|
182
231
|
}
|
|
183
232
|
listTFObligations(request, options) {
|
|
184
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
(0, validation_1.validate)(request)
|
|
235
|
+
.requiredUUID((r) => r.entityId)
|
|
236
|
+
.check();
|
|
185
237
|
const response = yield this.client.request({
|
|
186
238
|
url: `entities/${request.entityId}/tf_obligations`,
|
|
187
239
|
callOptions: options,
|
package/dist/futures/index.js
CHANGED
|
@@ -26,12 +26,16 @@ exports.FuturesService = 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 FuturesService {
|
|
30
31
|
constructor(client) {
|
|
31
32
|
this.client = client;
|
|
32
33
|
}
|
|
33
34
|
listEntitySweeps(request, options) {
|
|
34
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
(0, validation_1.validate)(request)
|
|
37
|
+
.requiredUUID((r) => r.entityId)
|
|
38
|
+
.check();
|
|
35
39
|
const response = yield this.client.request({
|
|
36
40
|
url: `entities/${request.entityId}/futures/sweeps`,
|
|
37
41
|
callOptions: options,
|
|
@@ -41,6 +45,9 @@ class FuturesService {
|
|
|
41
45
|
}
|
|
42
46
|
getEntityBalance(request, options) {
|
|
43
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
(0, validation_1.validate)(request)
|
|
49
|
+
.requiredUUID((r) => r.entityId)
|
|
50
|
+
.check();
|
|
44
51
|
const response = yield this.client.request({
|
|
45
52
|
url: `entities/${request.entityId}/futures/balance_summary`,
|
|
46
53
|
callOptions: options,
|
|
@@ -50,6 +57,9 @@ class FuturesService {
|
|
|
50
57
|
}
|
|
51
58
|
getEntityPositions(request, options) {
|
|
52
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
(0, validation_1.validate)(request)
|
|
61
|
+
.requiredUUID((r) => r.entityId)
|
|
62
|
+
.check();
|
|
53
63
|
const queryParams = Object.assign(Object.assign({}, request), { entityId: undefined });
|
|
54
64
|
const response = yield this.client.request({
|
|
55
65
|
url: `entities/${request.entityId}/futures/positions`,
|
|
@@ -61,6 +71,10 @@ class FuturesService {
|
|
|
61
71
|
}
|
|
62
72
|
scheduleEntitySweep(request, options) {
|
|
63
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
(0, validation_1.validate)(request)
|
|
75
|
+
.requiredUUID((r) => r.entityId)
|
|
76
|
+
.requiredString((r) => r.currency)
|
|
77
|
+
.check();
|
|
64
78
|
const response = yield this.client.request({
|
|
65
79
|
url: `entities/${request.entityId}/futures/sweeps`,
|
|
66
80
|
method: clients_1.Method.POST,
|
|
@@ -72,6 +86,10 @@ class FuturesService {
|
|
|
72
86
|
}
|
|
73
87
|
updateEntityAutoSweep(request, options) {
|
|
74
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
(0, validation_1.validate)(request)
|
|
90
|
+
.requiredUUID((r) => r.entityId)
|
|
91
|
+
.requiredBoolean((r) => r.autoSweep)
|
|
92
|
+
.check();
|
|
75
93
|
const response = yield this.client.request({
|
|
76
94
|
url: `entities/${request.entityId}/futures/auto_sweep`,
|
|
77
95
|
method: clients_1.Method.POST,
|
|
@@ -83,6 +101,9 @@ class FuturesService {
|
|
|
83
101
|
}
|
|
84
102
|
cancelEntitySweep(request, options) {
|
|
85
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
(0, validation_1.validate)(request)
|
|
105
|
+
.requiredUUID((r) => r.entityId)
|
|
106
|
+
.check();
|
|
86
107
|
const response = yield this.client.request({
|
|
87
108
|
url: `entities/${request.entityId}/futures/sweeps`,
|
|
88
109
|
method: clients_1.Method.DELETE,
|
|
@@ -93,6 +114,9 @@ class FuturesService {
|
|
|
93
114
|
}
|
|
94
115
|
getRiskLimits(request, options) {
|
|
95
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
(0, validation_1.validate)(request)
|
|
118
|
+
.requiredUUID((r) => r.entityId)
|
|
119
|
+
.check();
|
|
96
120
|
const response = yield this.client.request({
|
|
97
121
|
url: `entities/${request.entityId}/futures/risk_limits`,
|
|
98
122
|
callOptions: options,
|
|
@@ -102,6 +126,9 @@ class FuturesService {
|
|
|
102
126
|
}
|
|
103
127
|
getMarginCallDetails(request, options) {
|
|
104
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
(0, validation_1.validate)(request)
|
|
130
|
+
.requiredUUID((r) => r.entityId)
|
|
131
|
+
.check();
|
|
105
132
|
const response = yield this.client.request({
|
|
106
133
|
url: `entities/${request.entityId}/futures/margin_call_details`,
|
|
107
134
|
callOptions: options,
|
|
@@ -111,6 +138,9 @@ class FuturesService {
|
|
|
111
138
|
}
|
|
112
139
|
getFcmSettings(request, options) {
|
|
113
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
(0, validation_1.validate)(request)
|
|
142
|
+
.requiredUUID((r) => r.entityId)
|
|
143
|
+
.check();
|
|
114
144
|
const response = yield this.client.request({
|
|
115
145
|
url: `entities/${request.entityId}/futures/settings`,
|
|
116
146
|
callOptions: options,
|
|
@@ -120,6 +150,9 @@ class FuturesService {
|
|
|
120
150
|
}
|
|
121
151
|
setFcmSettings(request, options) {
|
|
122
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
(0, validation_1.validate)(request)
|
|
154
|
+
.requiredUUID((r) => r.entityId)
|
|
155
|
+
.check();
|
|
123
156
|
const response = yield this.client.request({
|
|
124
157
|
url: `entities/${request.entityId}/futures/settings`,
|
|
125
158
|
method: clients_1.Method.POST,
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
29
29
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
30
30
|
};
|
|
31
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;
|
|
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.isValidUUID = exports.validate = exports.CoinbasePrimeException = exports.CoinbasePrimeClientException = exports.createCredentialsFromEnv = exports.CoinbasePrimeCredentials = exports.CoinbasePrimeClient = exports.CoinbasePrimeClientWithServices = exports.CoinbaseError = exports.CoinbaseClientException = exports.Method = exports.CoinbaseClient = void 0;
|
|
33
33
|
// Re-export commonly used core-ts objects for convenience
|
|
34
34
|
// This allows users to import everything from a single package
|
|
35
35
|
var clients_1 = require("./clients");
|
|
@@ -43,6 +43,12 @@ var credentials_1 = require("./credentials");
|
|
|
43
43
|
Object.defineProperty(exports, "CoinbasePrimeCredentials", { enumerable: true, get: function () { return credentials_1.CoinbasePrimeCredentials; } });
|
|
44
44
|
var envUtils_1 = require("./shared/envUtils");
|
|
45
45
|
Object.defineProperty(exports, "createCredentialsFromEnv", { enumerable: true, get: function () { return envUtils_1.createCredentialsFromEnv; } });
|
|
46
|
+
var errors_1 = require("./errors");
|
|
47
|
+
Object.defineProperty(exports, "CoinbasePrimeClientException", { enumerable: true, get: function () { return errors_1.CoinbasePrimeClientException; } });
|
|
48
|
+
Object.defineProperty(exports, "CoinbasePrimeException", { enumerable: true, get: function () { return errors_1.CoinbasePrimeException; } });
|
|
49
|
+
var validation_1 = require("./shared/validation");
|
|
50
|
+
Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validation_1.validate; } });
|
|
51
|
+
Object.defineProperty(exports, "isValidUUID", { enumerable: true, get: function () { return validation_1.isValidUUID; } });
|
|
46
52
|
var activities_1 = require("./activities");
|
|
47
53
|
Object.defineProperty(exports, "ActivitiesService", { enumerable: true, get: function () { return activities_1.ActivitiesService; } });
|
|
48
54
|
var addressBooks_1 = require("./addressBooks");
|
package/dist/invoices/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.InvoicesService = void 0;
|
|
24
|
+
const validation_1 = require("../shared/validation");
|
|
24
25
|
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
25
26
|
class InvoicesService {
|
|
26
27
|
constructor(client) {
|
|
@@ -28,6 +29,9 @@ class InvoicesService {
|
|
|
28
29
|
}
|
|
29
30
|
listInvoices(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);
|
|
@@ -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,
|