@coinbase-sample/prime-sdk-ts 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/activities/index.js +40 -4
- package/dist/addressBooks/index.js +4 -2
- package/dist/allocations/index.js +19 -3
- package/dist/balances/index.js +17 -5
- package/dist/client.js +7 -2
- package/dist/constants.js +5 -2
- package/dist/financing/index.js +18 -0
- package/dist/index.js +3 -1
- package/dist/invoices/index.js +16 -3
- package/dist/model/Counterparty.js +21 -0
- package/dist/model/CounterpartyDestination.js +21 -0
- package/dist/model/CreateNetAllocationRequest.js +21 -0
- package/dist/model/CreateWalletDepositAddressRequest.js +21 -0
- package/dist/model/FCMMarginCall.js +21 -0
- package/dist/model/GetFcmMarginCallDetailsResponse.js +21 -0
- package/dist/model/GetFcmRiskLimitsResponse.js +21 -0
- package/dist/model/GetOrderEditHistoryResponse.js +21 -0
- package/dist/model/GetPortfolioCounterpartyIDResponse.js +21 -0
- package/dist/model/LimitOrderEdit.js +21 -0
- package/dist/model/ListWalletAddressesResponse.js +21 -0
- package/dist/model/OrderEdit.js +21 -0
- package/dist/model/PortfolioStakingInitiateRequest.js +21 -0
- package/dist/model/PortfolioStakingInitiateResponse.js +21 -0
- package/dist/model/PortfolioStakingMetadata.js +21 -0
- package/dist/model/PortfolioStakingUnstakeRequest.js +21 -0
- package/dist/model/PortfolioStakingUnstakeResponse.js +21 -0
- package/dist/model/StakingUnstakeRequest.js +21 -0
- package/dist/model/WalletStakeInputs.js +21 -0
- package/dist/model/WalletUnstakeInputs.js +21 -0
- package/dist/model/enums/AllocationSizeType.js +0 -1
- package/dist/model/enums/AssetChangeType.js +0 -1
- package/dist/model/enums/CustodyActivityType.js +0 -1
- package/dist/model/enums/DestinationType.js +4 -4
- package/dist/model/enums/FcmMarginCallState.js +30 -0
- package/dist/model/enums/FcmMarginCallType.js +28 -0
- package/dist/model/enums/OrderSide.js +0 -1
- package/dist/model/enums/OrderStatus.js +0 -1
- package/dist/model/enums/OrderType.js +0 -1
- package/dist/model/enums/PaymentMethodType.js +3 -4
- package/dist/model/enums/PortfolioBalanceType.js +0 -1
- package/dist/model/enums/ProductPermissions.js +0 -1
- package/dist/model/enums/SigningStatus.js +0 -1
- package/dist/model/enums/TimeInForceType.js +0 -1
- package/dist/model/enums/TransactionStatus.js +1 -2
- package/dist/model/enums/TransactionType.js +0 -1
- package/dist/model/enums/TransferLocationType.js +0 -1
- package/dist/model/enums/UserRole.js +0 -1
- package/dist/model/enums/VisibilityStatus.js +0 -1
- package/dist/model/enums/WalletDepositInstructionType.js +0 -1
- package/dist/model/enums/WalletType.js +0 -1
- package/dist/model/enums/index.js +5 -1
- package/dist/orders/index.js +63 -8
- package/dist/portfolios/index.js +9 -0
- package/dist/portfolios/types.js +15 -0
- package/dist/positions/index.js +9 -6
- package/dist/products/index.js +4 -2
- package/dist/shared/brand.js +15 -0
- package/dist/shared/paginatedResponse.js +185 -0
- package/dist/shared/pagination.js +15 -0
- package/dist/shared/toCamelCase.js +15 -0
- package/dist/staking/index.js +24 -0
- package/dist/transactions/index.js +17 -2
- package/dist/types/activities/types.d.ts +6 -3
- package/dist/types/addressBooks/types.d.ts +4 -2
- package/dist/types/allocations/types.d.ts +4 -2
- package/dist/types/assets/types.d.ts +1 -1
- package/dist/types/balances/types.d.ts +6 -3
- package/dist/types/client.d.ts +2 -2
- package/dist/types/commission/types.d.ts +1 -1
- package/dist/types/constants.d.ts +4 -1
- package/dist/types/financing/index.d.ts +5 -1
- package/dist/types/financing/types.d.ts +10 -2
- package/dist/types/futures/types.d.ts +1 -1
- package/dist/types/index.d.ts +5 -4
- package/dist/types/invoices/index.d.ts +2 -2
- package/dist/types/invoices/types.d.ts +9 -3
- package/dist/types/model/Commission.d.ts +1 -1
- package/dist/types/model/Counterparty.d.ts +25 -0
- package/dist/types/model/CounterpartyDestination.d.ts +22 -0
- package/dist/types/model/CreateAllocationRequest.d.ts +0 -4
- package/dist/types/model/CreateNetAllocationRequest.d.ts +48 -0
- package/dist/types/model/CreateOnchainTransactionRequestEvmParams.d.ts +1 -1
- package/dist/types/model/CreateOrderRequest.d.ts +6 -2
- package/dist/types/model/CreateWalletDepositAddressRequest.d.ts +25 -0
- package/dist/types/model/CreateWalletWithdrawalRequest.d.ts +2 -0
- package/dist/types/model/CreateWalletWithdrawalResponse.d.ts +2 -0
- package/dist/types/model/FCMMarginCall.d.ts +41 -0
- package/dist/types/model/Fill.d.ts +9 -1
- package/dist/types/model/GetFcmBalanceResponse.d.ts +4 -0
- package/dist/types/model/GetFcmMarginCallDetailsResponse.d.ts +26 -0
- package/dist/types/model/GetFcmRiskLimitsResponse.d.ts +45 -0
- package/dist/types/model/GetOrderEditHistoryResponse.d.ts +35 -0
- package/dist/types/model/GetPortfolioCounterpartyIDResponse.d.ts +23 -0
- package/dist/types/model/LimitOrderEdit.d.ts +29 -0
- package/dist/types/model/ListWalletAddressesResponse.d.ts +25 -0
- package/dist/types/model/Order.d.ts +31 -1
- package/dist/types/model/OrderEdit.d.ts +30 -0
- package/dist/types/model/OrderPreviewRequest.d.ts +11 -2
- package/dist/types/model/PortfolioStakingInitiateRequest.d.ts +35 -0
- package/dist/types/model/PortfolioStakingInitiateResponse.d.ts +29 -0
- package/dist/types/model/PortfolioStakingMetadata.d.ts +25 -0
- package/dist/types/model/PortfolioStakingUnstakeRequest.d.ts +35 -0
- package/dist/types/model/PortfolioStakingUnstakeResponse.d.ts +29 -0
- package/dist/types/model/PostOrderPreviewResponse.d.ts +20 -0
- package/dist/types/model/RFQProductDetails.d.ts +4 -0
- package/dist/types/model/StakingInitiateRequest.d.ts +5 -2
- package/dist/types/model/StakingInitiateResponse.d.ts +3 -0
- package/dist/types/model/StakingUnstakeRequest.d.ts +30 -0
- package/dist/types/model/StakingUnstakeResponse.d.ts +3 -0
- package/dist/types/model/TransferLocation.d.ts +8 -0
- package/dist/types/model/WalletStakeInputs.d.ts +32 -0
- package/dist/types/model/WalletUnstakeInputs.d.ts +28 -0
- package/dist/types/model/enums/AllocationSizeType.d.ts +0 -1
- package/dist/types/model/enums/AssetChangeType.d.ts +0 -1
- package/dist/types/model/enums/CustodyActivityType.d.ts +0 -1
- package/dist/types/model/enums/DestinationType.d.ts +4 -4
- package/dist/types/model/enums/FcmMarginCallState.d.ts +26 -0
- package/dist/types/model/enums/FcmMarginCallType.d.ts +24 -0
- package/dist/types/model/enums/OrderSide.d.ts +0 -1
- package/dist/types/model/enums/OrderStatus.d.ts +0 -1
- package/dist/types/model/enums/OrderType.d.ts +0 -1
- package/dist/types/model/enums/PaymentMethodType.d.ts +3 -4
- package/dist/types/model/enums/PortfolioBalanceType.d.ts +0 -1
- package/dist/types/model/enums/ProductPermissions.d.ts +0 -1
- package/dist/types/model/enums/SigningStatus.d.ts +0 -1
- package/dist/types/model/enums/TimeInForceType.d.ts +0 -1
- package/dist/types/model/enums/TransactionStatus.d.ts +1 -2
- package/dist/types/model/enums/TransactionType.d.ts +0 -1
- package/dist/types/model/enums/TransferLocationType.d.ts +0 -1
- package/dist/types/model/enums/UserRole.d.ts +0 -1
- package/dist/types/model/enums/VisibilityStatus.d.ts +0 -1
- package/dist/types/model/enums/WalletDepositInstructionType.d.ts +0 -1
- package/dist/types/model/enums/WalletType.d.ts +0 -1
- package/dist/types/model/enums/index.d.ts +2 -0
- package/dist/types/model/index.d.ts +20 -0
- package/dist/types/onchainAddressBook/types.d.ts +1 -1
- package/dist/types/orders/index.d.ts +3 -1
- package/dist/types/orders/types.d.ts +17 -7
- package/dist/types/paymentMethods/types.d.ts +1 -1
- package/dist/types/portfolios/index.d.ts +3 -1
- package/dist/types/portfolios/types.d.ts +6 -2
- package/dist/types/positions/types.d.ts +9 -9
- package/dist/types/products/types.d.ts +4 -2
- package/dist/types/shared/brand.d.ts +15 -0
- package/dist/types/shared/paginatedResponse.d.ts +120 -0
- package/dist/types/shared/toCamelCase.d.ts +15 -0
- package/dist/types/staking/index.d.ts +5 -1
- package/dist/types/staking/types.d.ts +10 -2
- package/dist/types/transactions/types.d.ts +7 -3
- package/dist/types/users/types.d.ts +9 -5
- package/dist/types/wallets/types.d.ts +7 -5
- package/dist/users/index.js +11 -2
- package/dist/wallets/index.js +17 -21
- package/package.json +12 -11
|
@@ -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 });
|
|
@@ -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 });
|
|
@@ -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 });
|
|
@@ -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 });
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.AllocationSizeType = void 0;
|
|
23
23
|
var AllocationSizeType;
|
|
24
24
|
(function (AllocationSizeType) {
|
|
25
|
-
AllocationSizeType["AllocationSizeTypeUnknown"] = "ALLOCATION_SIZE_TYPE_UNKNOWN";
|
|
26
25
|
AllocationSizeType["Base"] = "BASE";
|
|
27
26
|
AllocationSizeType["Quote"] = "QUOTE";
|
|
28
27
|
AllocationSizeType["Percent"] = "PERCENT";
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.AssetChangeType = void 0;
|
|
23
23
|
var AssetChangeType;
|
|
24
24
|
(function (AssetChangeType) {
|
|
25
|
-
AssetChangeType["AssetChangeTypeUnknown"] = "ASSET_CHANGE_TYPE_UNKNOWN";
|
|
26
25
|
AssetChangeType["BalanceTransfer"] = "BALANCE_TRANSFER";
|
|
27
26
|
AssetChangeType["BalanceApproval"] = "BALANCE_APPROVAL";
|
|
28
27
|
AssetChangeType["ItemTransfer"] = "ITEM_TRANSFER";
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.ActivityType = void 0;
|
|
23
23
|
var ActivityType;
|
|
24
24
|
(function (ActivityType) {
|
|
25
|
-
ActivityType["Unknown"] = "ACTIVITY_TYPE_UNKNOWN";
|
|
26
25
|
ActivityType["GovernanceVote"] = "ACTIVITY_TYPE_GOVERNANCE_VOTE";
|
|
27
26
|
ActivityType["Invitation"] = "ACTIVITY_TYPE_INVITATION";
|
|
28
27
|
ActivityType["WalletChange"] = "ACTIVITY_TYPE_WALLET_CHANGE";
|
|
@@ -22,8 +22,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.DestinationType = void 0;
|
|
23
23
|
var DestinationType;
|
|
24
24
|
(function (DestinationType) {
|
|
25
|
-
DestinationType["
|
|
26
|
-
DestinationType["
|
|
27
|
-
DestinationType["
|
|
28
|
-
DestinationType["
|
|
25
|
+
DestinationType["PaymentMethod"] = "DESTINATION_PAYMENT_METHOD";
|
|
26
|
+
DestinationType["Blockchain"] = "DESTINATION_BLOCKCHAIN";
|
|
27
|
+
DestinationType["Wallet"] = "DESTINATION_WALLET";
|
|
28
|
+
DestinationType["Counterparty"] = "DESTINATION_COUNTERPARTY";
|
|
29
29
|
})(DestinationType || (exports.DestinationType = DestinationType = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
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.FcmMarginCallState = void 0;
|
|
23
|
+
var FcmMarginCallState;
|
|
24
|
+
(function (FcmMarginCallState) {
|
|
25
|
+
FcmMarginCallState["Unspecified"] = "FCM_MARGIN_CALL_STATE_UNSPECIFIED";
|
|
26
|
+
FcmMarginCallState["Closed"] = "FCM_MARGIN_CALL_STATE_CLOSED";
|
|
27
|
+
FcmMarginCallState["RolledOver"] = "FCM_MARGIN_CALL_STATE_ROLLED_OVER";
|
|
28
|
+
FcmMarginCallState["Default"] = "FCM_MARGIN_CALL_STATE_DEFAULT";
|
|
29
|
+
FcmMarginCallState["Official"] = "FCM_MARGIN_CALL_STATE_OFFICIAL";
|
|
30
|
+
})(FcmMarginCallState || (exports.FcmMarginCallState = FcmMarginCallState = {}));
|
|
@@ -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.FcmMarginCallType = void 0;
|
|
23
|
+
var FcmMarginCallType;
|
|
24
|
+
(function (FcmMarginCallType) {
|
|
25
|
+
FcmMarginCallType["Unspecified"] = "FCM_MARGIN_CALL_TYPE_UNSPECIFIED";
|
|
26
|
+
FcmMarginCallType["Urgent"] = "FCM_MARGIN_CALL_TYPE_URGENT";
|
|
27
|
+
FcmMarginCallType["Regular"] = "FCM_MARGIN_CALL_TYPE_REGULAR";
|
|
28
|
+
})(FcmMarginCallType || (exports.FcmMarginCallType = FcmMarginCallType = {}));
|
|
@@ -25,8 +25,7 @@ exports.PaymentMethodType = void 0;
|
|
|
25
25
|
*/
|
|
26
26
|
var PaymentMethodType;
|
|
27
27
|
(function (PaymentMethodType) {
|
|
28
|
-
PaymentMethodType["
|
|
29
|
-
PaymentMethodType["
|
|
30
|
-
PaymentMethodType["
|
|
31
|
-
PaymentMethodType["MethodSwift"] = "METHOD_SWIFT";
|
|
28
|
+
PaymentMethodType["Wire"] = "METHOD_WIRE";
|
|
29
|
+
PaymentMethodType["Sen"] = "METHOD_SEN";
|
|
30
|
+
PaymentMethodType["Swift"] = "METHOD_SWIFT";
|
|
32
31
|
})(PaymentMethodType || (exports.PaymentMethodType = PaymentMethodType = {}));
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.PortfolioBalanceType = void 0;
|
|
23
23
|
var PortfolioBalanceType;
|
|
24
24
|
(function (PortfolioBalanceType) {
|
|
25
|
-
PortfolioBalanceType["UnknownBalanceType"] = "UNKNOWN_BALANCE_TYPE";
|
|
26
25
|
PortfolioBalanceType["TradingBalances"] = "TRADING_BALANCES";
|
|
27
26
|
PortfolioBalanceType["VaultBalances"] = "VAULT_BALANCES";
|
|
28
27
|
PortfolioBalanceType["TotalBalances"] = "TOTAL_BALANCES";
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.ProductPermissions = void 0;
|
|
23
23
|
var ProductPermissions;
|
|
24
24
|
(function (ProductPermissions) {
|
|
25
|
-
ProductPermissions["Unknown"] = "PRODUCT_PERMISSION_UNKNOWN";
|
|
26
25
|
ProductPermissions["Read"] = "PRODUCT_PERMISSION_READ";
|
|
27
26
|
ProductPermissions["Trade"] = "PRODUCT_PERMISSION_TRADE";
|
|
28
27
|
ProductPermissions["Lending"] = "PRODUCT_PERMISSION_LENDING";
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.SigningStatus = void 0;
|
|
23
23
|
var SigningStatus;
|
|
24
24
|
(function (SigningStatus) {
|
|
25
|
-
SigningStatus["SigningStatusUnknown"] = "SIGNING_STATUS_UNKNOWN";
|
|
26
25
|
SigningStatus["Signed"] = "SIGNED";
|
|
27
26
|
SigningStatus["Unsigned"] = "UNSIGNED";
|
|
28
27
|
})(SigningStatus || (exports.SigningStatus = SigningStatus = {}));
|
|
@@ -25,7 +25,6 @@ exports.TimeInForceType = void 0;
|
|
|
25
25
|
*/
|
|
26
26
|
var TimeInForceType;
|
|
27
27
|
(function (TimeInForceType) {
|
|
28
|
-
TimeInForceType["UnknownTimeInForce"] = "UNKNOWN_TIME_IN_FORCE";
|
|
29
28
|
TimeInForceType["GoodUntilDateTime"] = "GOOD_UNTIL_DATE_TIME";
|
|
30
29
|
TimeInForceType["GoodUntilCancelled"] = "GOOD_UNTIL_CANCELLED";
|
|
31
30
|
TimeInForceType["ImmediateOrCancel"] = "IMMEDIATE_OR_CANCEL";
|
|
@@ -21,11 +21,10 @@
|
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.TransactionStatus = void 0;
|
|
23
23
|
/**
|
|
24
|
-
* - UNKNOWN_TRANSACTION_STATUS: An Unknown Transaction status - TRANSACTION_CREATED: The Transaction has been created and is awaiting Consensus approval This is a non-terminal status - TRANSACTION_REQUESTED: The Transaction has reached User Consensus and is awaiting Coinbase Prime approval This is a non-terminal status - TRANSACTION_APPROVED: The Transaction has been authorized by Coinbase Prime This is a non-terminal status - TRANSACTION_GASSING: The transaction is awaiting blockchain resources for broadcast This is a non-terminal status - TRANSACTION_GASSED: The transaction has received blockchain resources for broadcasting This is a non-terminal status - TRANSACTION_PROVISIONED: The transaction has been provisioned and is awaiting planning This is a non-terminal status - TRANSACTION_PLANNED: The transaction has been constructed.
|
|
24
|
+
* - UNKNOWN_TRANSACTION_STATUS: An Unknown Transaction status - TRANSACTION_CREATED: The Transaction has been created and is awaiting Consensus approval This is a non-terminal status - TRANSACTION_REQUESTED: The Transaction has reached User Consensus and is awaiting Coinbase Prime approval This is a non-terminal status - TRANSACTION_APPROVED: The Transaction has been authorized by Coinbase Prime This is a non-terminal status - TRANSACTION_GASSING: The transaction is awaiting blockchain resources for broadcast This is a non-terminal status - TRANSACTION_GASSED: The transaction has received blockchain resources for broadcasting This is a non-terminal status - TRANSACTION_PROVISIONED: The transaction has been provisioned and is awaiting planning This is a non-terminal status - TRANSACTION_PLANNED: The transaction has been constructed. This is a non-terminal status - TRANSACTION_PROCESSING: The transaction is currently processing and awaiting finalization This is a non-terminal status - TRANSACTION_RESTORED: The transaction has been broadcasted to the network. This is a non-terminal status - TRANSACTION_DONE: The transaction has confirmed on-chain and finished. This is a terminal status - TRANSACTION_IMPORT_PENDING: The transaction deposit has been detected and is awaiting finalization. This is a non-terminal status - TRANSACTION_IMPORTED: The transaction deposit and reward has been detected. This is a terminal status - TRANSACTION_CANCELLED: The transaction has been cancelled This is a terminal status - TRANSACTION_REJECTED: The transaction was rejected before construction and broadcasting. This is a terminal status - TRANSACTION_DELAYED: The transaction s taking longer than expected to confirm on-chain. This is a non-terminal status - TRANSACTION_RETRIED: The transaction has been recreated and retried, this occurs when network congestion results in transfers becoming extremely delayed due to insufficient fees or network resources such as CPU, RAM, or NET This is a terminal status - TRANSACTION_FAILED: The transaction failed on-chain (the fee was spent but the operation failed). This is a terminal status - TRANSACTION_EXPIRED: The transaction has expired. This is a terminal status - TRANSACTION_BROADCASTING: The transaction is currently broadcasting to the cryptocurrency network. This is a non-terminal status - OTHER_TRANSACTION_STATUS: The transaction has reached an OTHER status. This is a non-terminal status - TRANSACTION_CONSTRUCTED: The transaction bctx is constructed but not yet broadcasting on chain This is a non-terminal status
|
|
25
25
|
*/
|
|
26
26
|
var TransactionStatus;
|
|
27
27
|
(function (TransactionStatus) {
|
|
28
|
-
TransactionStatus["UnknownTransactionStatus"] = "UNKNOWN_TRANSACTION_STATUS";
|
|
29
28
|
TransactionStatus["TransactionCreated"] = "TRANSACTION_CREATED";
|
|
30
29
|
TransactionStatus["TransactionRequested"] = "TRANSACTION_REQUESTED";
|
|
31
30
|
TransactionStatus["TransactionApproved"] = "TRANSACTION_APPROVED";
|
|
@@ -25,7 +25,6 @@ exports.TransactionType = void 0;
|
|
|
25
25
|
*/
|
|
26
26
|
var TransactionType;
|
|
27
27
|
(function (TransactionType) {
|
|
28
|
-
TransactionType["TransactionTypeUnknown"] = "TRANSACTION_TYPE_UNKNOWN";
|
|
29
28
|
TransactionType["Deposit"] = "DEPOSIT";
|
|
30
29
|
TransactionType["Withdrawal"] = "WITHDRAWAL";
|
|
31
30
|
TransactionType["InternalDeposit"] = "INTERNAL_DEPOSIT";
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.TransferLocationType = void 0;
|
|
23
23
|
var TransferLocationType;
|
|
24
24
|
(function (TransferLocationType) {
|
|
25
|
-
TransferLocationType["TransferLocationTypeUnknown"] = "TRANSFER_LOCATION_TYPE_UNKNOWN";
|
|
26
25
|
TransferLocationType["PaymentMethod"] = "PAYMENT_METHOD";
|
|
27
26
|
TransferLocationType["Wallet"] = "WALLET";
|
|
28
27
|
TransferLocationType["Address"] = "ADDRESS";
|
|
@@ -22,7 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.VisibilityStatus = void 0;
|
|
23
23
|
var VisibilityStatus;
|
|
24
24
|
(function (VisibilityStatus) {
|
|
25
|
-
VisibilityStatus["UnknownVisibilityStatus"] = "UNKNOWN_VISIBILITY_STATUS";
|
|
26
25
|
VisibilityStatus["Visible"] = "VISIBLE";
|
|
27
26
|
VisibilityStatus["Hidden"] = "HIDDEN";
|
|
28
27
|
VisibilityStatus["Spam"] = "SPAM";
|
|
@@ -25,7 +25,6 @@ exports.WalletDepositInstructionType = void 0;
|
|
|
25
25
|
*/
|
|
26
26
|
var WalletDepositInstructionType;
|
|
27
27
|
(function (WalletDepositInstructionType) {
|
|
28
|
-
WalletDepositInstructionType["UnknownWalletDepositType"] = "UNKNOWN_WALLET_DEPOSIT_TYPE";
|
|
29
28
|
WalletDepositInstructionType["Crypto"] = "CRYPTO";
|
|
30
29
|
WalletDepositInstructionType["Wire"] = "WIRE";
|
|
31
30
|
WalletDepositInstructionType["Sen"] = "SEN";
|
|
@@ -25,7 +25,6 @@ exports.WalletType = void 0;
|
|
|
25
25
|
*/
|
|
26
26
|
var WalletType;
|
|
27
27
|
(function (WalletType) {
|
|
28
|
-
WalletType["UnknownWalletType"] = "UNKNOWN_WALLET_TYPE";
|
|
29
28
|
WalletType["Vault"] = "VAULT";
|
|
30
29
|
WalletType["Trading"] = "TRADING";
|
|
31
30
|
WalletType["WalletTypeOther"] = "WALLET_TYPE_OTHER";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletVisibility = exports.WalletType = exports.WalletDepositInstructionType = exports.VisibilityStatus = exports.UserRole = exports.TransferLocationType = exports.TransactionType = exports.TransactionStatus = exports.TimeInForceType = exports.SortDirection = exports.SigningStatus = exports.RateType = exports.ProductPermissions = exports.PositionReferenceType = exports.PortfolioBalanceType = 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.FcmFuturesSweepStatus = exports.DestinationType = 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;
|
|
3
|
+
exports.WalletVisibility = exports.WalletType = exports.WalletDepositInstructionType = exports.VisibilityStatus = exports.UserRole = exports.TransferLocationType = exports.TransactionType = exports.TransactionStatus = exports.TimeInForceType = exports.SortDirection = exports.SigningStatus = exports.RateType = exports.ProductPermissions = exports.PositionReferenceType = exports.PortfolioBalanceType = 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.DestinationType = 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
4
|
var CustodyActivityType_1 = require("./CustodyActivityType");
|
|
5
5
|
Object.defineProperty(exports, "CustodyActivityType", { enumerable: true, get: function () { return CustodyActivityType_1.ActivityType; } });
|
|
6
6
|
var AddressBookType_1 = require("./AddressBookType");
|
|
@@ -29,6 +29,10 @@ var DestinationType_1 = require("./DestinationType");
|
|
|
29
29
|
Object.defineProperty(exports, "DestinationType", { enumerable: true, get: function () { return DestinationType_1.DestinationType; } });
|
|
30
30
|
var FcmFuturesSweepStatus_1 = require("./FcmFuturesSweepStatus");
|
|
31
31
|
Object.defineProperty(exports, "FcmFuturesSweepStatus", { enumerable: true, get: function () { return FcmFuturesSweepStatus_1.FcmFuturesSweepStatus; } });
|
|
32
|
+
var FcmMarginCallState_1 = require("./FcmMarginCallState");
|
|
33
|
+
Object.defineProperty(exports, "FcmMarginCallState", { enumerable: true, get: function () { return FcmMarginCallState_1.FcmMarginCallState; } });
|
|
34
|
+
var FcmMarginCallType_1 = require("./FcmMarginCallType");
|
|
35
|
+
Object.defineProperty(exports, "FcmMarginCallType", { enumerable: true, get: function () { return FcmMarginCallType_1.FcmMarginCallType; } });
|
|
32
36
|
var FcmPositionSide_1 = require("./FcmPositionSide");
|
|
33
37
|
Object.defineProperty(exports, "FcmPositionSide", { enumerable: true, get: function () { return FcmPositionSide_1.FcmPositionSide; } });
|
|
34
38
|
var HierarchyType_1 = require("./HierarchyType");
|
package/dist/orders/index.js
CHANGED
|
@@ -26,6 +26,7 @@ exports.OrdersService = void 0;
|
|
|
26
26
|
* limitations under the License.
|
|
27
27
|
*/
|
|
28
28
|
const core_ts_1 = require("@coinbase-sample/core-ts");
|
|
29
|
+
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
29
30
|
class OrdersService {
|
|
30
31
|
constructor(client) {
|
|
31
32
|
this.client = client;
|
|
@@ -39,48 +40,102 @@ class OrdersService {
|
|
|
39
40
|
return response.data;
|
|
40
41
|
});
|
|
41
42
|
}
|
|
43
|
+
getOrderEditHistory(request, options) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const response = yield this.client.request({
|
|
46
|
+
url: `portfolios/${request.portfolioId}/orders/${request.orderId}/edit_history`,
|
|
47
|
+
callOptions: options,
|
|
48
|
+
});
|
|
49
|
+
// drop deprecated field
|
|
50
|
+
delete response.data.orderEditHistory;
|
|
51
|
+
return response.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
42
54
|
listPortfolioFills(request, options) {
|
|
43
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
|
|
56
|
+
let queryParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
57
|
+
if (request.startDate) {
|
|
58
|
+
queryParams.startDate = new Date(request.startDate).toISOString();
|
|
59
|
+
}
|
|
60
|
+
if (request.endDate) {
|
|
61
|
+
queryParams.endDate = new Date(request.endDate).toISOString();
|
|
62
|
+
}
|
|
45
63
|
const response = yield this.client.request({
|
|
46
64
|
url: `portfolios/${request.portfolioId}/fills`,
|
|
47
65
|
queryParams,
|
|
48
66
|
callOptions: options,
|
|
49
67
|
});
|
|
50
|
-
|
|
68
|
+
const paginationOptions = (0, paginatedResponse_1.getDefaultPaginationOptions)(this.client, options);
|
|
69
|
+
return (0, paginatedResponse_1.createPaginatedResponse)(response.data, this.listPortfolioFills.bind(this), request, paginatedResponse_1.ResponseExtractors.fills, paginationOptions);
|
|
51
70
|
});
|
|
52
71
|
}
|
|
53
72
|
listPortfolioOrders(request, options) {
|
|
54
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
|
|
74
|
+
let queryParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
75
|
+
if (request.orderStatuses) {
|
|
76
|
+
queryParams.orderStatuses = request.orderStatuses;
|
|
77
|
+
}
|
|
78
|
+
if (request.productIds) {
|
|
79
|
+
queryParams.productIds = request.productIds;
|
|
80
|
+
}
|
|
81
|
+
if (request.orderType) {
|
|
82
|
+
queryParams.orderType = request.orderType;
|
|
83
|
+
}
|
|
84
|
+
if (request.orderSide) {
|
|
85
|
+
queryParams.orderSide = request.orderSide;
|
|
86
|
+
}
|
|
87
|
+
if (request.startDate) {
|
|
88
|
+
queryParams.startDate = new Date(request.startDate).toISOString();
|
|
89
|
+
}
|
|
90
|
+
if (request.endDate) {
|
|
91
|
+
queryParams.endDate = new Date(request.endDate).toISOString();
|
|
92
|
+
}
|
|
56
93
|
const response = yield this.client.request({
|
|
57
94
|
url: `portfolios/${request.portfolioId}/orders`,
|
|
58
95
|
queryParams,
|
|
59
96
|
callOptions: options,
|
|
60
97
|
});
|
|
61
|
-
|
|
98
|
+
const paginationOptions = (0, paginatedResponse_1.getDefaultPaginationOptions)(this.client, options);
|
|
99
|
+
return (0, paginatedResponse_1.createPaginatedResponse)(response.data, this.listPortfolioOrders.bind(this), request, paginatedResponse_1.ResponseExtractors.orders, paginationOptions);
|
|
62
100
|
});
|
|
63
101
|
}
|
|
64
102
|
listOrderFills(request, options) {
|
|
65
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const queryParams =
|
|
104
|
+
const queryParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
67
105
|
const response = yield this.client.request({
|
|
68
106
|
url: `portfolios/${request.portfolioId}/orders/${request.orderId}/fills`,
|
|
69
107
|
queryParams,
|
|
70
108
|
callOptions: options,
|
|
71
109
|
});
|
|
72
|
-
|
|
110
|
+
const paginationOptions = (0, paginatedResponse_1.getDefaultPaginationOptions)(this.client, options);
|
|
111
|
+
return (0, paginatedResponse_1.createPaginatedResponse)(response.data, this.listOrderFills.bind(this), request, paginatedResponse_1.ResponseExtractors.fills, paginationOptions);
|
|
73
112
|
});
|
|
74
113
|
}
|
|
75
114
|
listOpenOrders(request, options) {
|
|
76
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
|
|
116
|
+
let queryParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
117
|
+
if (request.productIds) {
|
|
118
|
+
queryParams.productIds = request.productIds;
|
|
119
|
+
}
|
|
120
|
+
if (request.orderType) {
|
|
121
|
+
queryParams.orderType = request.orderType;
|
|
122
|
+
}
|
|
123
|
+
if (request.orderSide) {
|
|
124
|
+
queryParams.orderSide = request.orderSide;
|
|
125
|
+
}
|
|
126
|
+
if (request.startDate) {
|
|
127
|
+
queryParams.startDate = new Date(request.startDate).toISOString();
|
|
128
|
+
}
|
|
129
|
+
if (request.endDate) {
|
|
130
|
+
queryParams.endDate = new Date(request.endDate).toISOString();
|
|
131
|
+
}
|
|
78
132
|
const response = yield this.client.request({
|
|
79
133
|
url: `portfolios/${request.portfolioId}/open_orders`,
|
|
80
134
|
queryParams,
|
|
81
135
|
callOptions: options,
|
|
82
136
|
});
|
|
83
|
-
|
|
137
|
+
const paginationOptions = (0, paginatedResponse_1.getDefaultPaginationOptions)(this.client, options);
|
|
138
|
+
return (0, paginatedResponse_1.createPaginatedResponse)(response.data, this.listOpenOrders.bind(this), request, paginatedResponse_1.ResponseExtractors.orders, paginationOptions);
|
|
84
139
|
});
|
|
85
140
|
}
|
|
86
141
|
createOrderPreview(request, options) {
|
package/dist/portfolios/index.js
CHANGED
|
@@ -32,6 +32,15 @@ class PortfoliosService {
|
|
|
32
32
|
return response.data;
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
+
getCounterpartyId(request, options) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const response = yield this.client.request({
|
|
38
|
+
url: `portfolios/${request.portfolioId}/counterparty`,
|
|
39
|
+
callOptions: options,
|
|
40
|
+
});
|
|
41
|
+
return response.data;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
35
44
|
listPortfolios(request, options) {
|
|
36
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
46
|
const response = yield this.client.request({
|
package/dist/portfolios/types.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2024-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
|
+
*/
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/positions/index.js
CHANGED
|
@@ -10,30 +10,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.PositionsService = void 0;
|
|
13
|
+
const paginatedResponse_1 = require("../shared/paginatedResponse");
|
|
13
14
|
class PositionsService {
|
|
14
15
|
constructor(client) {
|
|
15
16
|
this.client = client;
|
|
16
17
|
}
|
|
17
18
|
listAggregateEntityPositions(request, options) {
|
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const queryParams =
|
|
20
|
+
const queryParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
20
21
|
const response = yield this.client.request({
|
|
21
|
-
url: `
|
|
22
|
+
url: `entities/${request.entityId}/aggregate_positions`,
|
|
22
23
|
callOptions: options,
|
|
23
24
|
queryParams,
|
|
24
25
|
});
|
|
25
|
-
|
|
26
|
+
const paginationOptions = (0, paginatedResponse_1.getDefaultPaginationOptions)(this.client, options);
|
|
27
|
+
return (0, paginatedResponse_1.createPaginatedResponse)(response.data, this.listAggregateEntityPositions.bind(this), request, paginatedResponse_1.ResponseExtractors.positions, paginationOptions);
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
listEntityPositions(request, options) {
|
|
29
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const queryParams =
|
|
32
|
+
const queryParams = (0, paginatedResponse_1.getQueryParams)(this.client, request);
|
|
31
33
|
const response = yield this.client.request({
|
|
32
|
-
url: `
|
|
34
|
+
url: `entities/${request.entityId}/positions`,
|
|
33
35
|
callOptions: options,
|
|
34
36
|
queryParams,
|
|
35
37
|
});
|
|
36
|
-
|
|
38
|
+
const paginationOptions = (0, paginatedResponse_1.getDefaultPaginationOptions)(this.client, options);
|
|
39
|
+
return (0, paginatedResponse_1.createPaginatedResponse)(response.data, this.listEntityPositions.bind(this), request, paginatedResponse_1.ResponseExtractors.positions, paginationOptions);
|
|
37
40
|
});
|
|
38
41
|
}
|
|
39
42
|
}
|