From 4abd28358729d1b1aea2b0b1e8077a034c4deac2 Mon Sep 17 00:00:00 2001 From: Nick Morgan Date: Wed, 25 Nov 2026 11:21:09 -0800 Subject: [PATCH 1/4] feat(generator): add make update, beta prefix stripping, and empty-object response fix - Add make update target (fetch-spec + generate) - Avoid wrapping empty-object response schemas in ResponsePhase - Map period inline enum on webhook stats endpoints and RotateWebhookHmacSecret in operations-overrides.json - Strip CoinbasePublicRestApiBeta prefix in PostProcessor (aligns Webhook* and RewardsRateTier* with TypeScript) - Skip overridden inline enum parameters in OperationBindingGeneratorTest - Gitignore generated-files.json and generated-model-files.json --- .gitignore | 5 ++++- Makefile | 4 +++- .../config/operations-overrides.json | 16 ++++++++++++++++ .../tools/modelgenerator/PostProcessor.java | 3 +++ .../tools/modelgenerator/ResponsePhase.java | 2 +- .../OperationBindingGeneratorTest.java | 6 +++++- 6 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9bc479c0..5240cb82 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,7 @@ docs/ # SDK generator download + OpenAPI CLI output generated/ -.java-version \ No newline at end of file +.java-version +# Generator ownership manifests +tools/model-generator/generated-files.json +tools/model-generator/generated-model-files.json diff --git a/Makefile b/Makefile index 197e958b..dc001505 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: fetch-spec compile format generate check-generated generate-live-diff +.PHONY: fetch-spec compile format generate update check-generated generate-live-diff fetch-spec: mvn -B -f tools/model-generator/pom.xml compile exec:java@generate-models -Dexec.args="--fetch-spec" @@ -13,6 +13,8 @@ generate: mvn -B -f tools/model-generator/pom.xml compile exec:java@generate-models mvn -B spotless:apply +update: fetch-spec generate + check-generated: mvn -B -f tools/model-generator/pom.xml compile exec:java@generate-models -Dexec.args="--check" diff --git a/tools/model-generator/config/operations-overrides.json b/tools/model-generator/config/operations-overrides.json index 1061eb2a..2428cce4 100644 --- a/tools/model-generator/config/operations-overrides.json +++ b/tools/model-generator/config/operations-overrides.json @@ -422,5 +422,21 @@ "message": "Use getTieredPricingFees instead." } ] + }, + { + "operationId": "PrimeBeta_RotateWebhookHMACSecret", + "sdkMethod": "RotateWebhookHmacSecret" + }, + { + "operationId": "PrimeBeta_GetWebhookSubscriptionStats", + "parameterTypeOverrides": { + "period": "String" + } + }, + { + "operationId": "PrimeBeta_GetWebhookOwnerStats", + "parameterTypeOverrides": { + "period": "String" + } } ] diff --git a/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/PostProcessor.java b/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/PostProcessor.java index 57ee8cbd..044a7b4f 100644 --- a/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/PostProcessor.java +++ b/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/PostProcessor.java @@ -455,6 +455,7 @@ private String extractClassName(String content) { put("CoinbaseCustodyApiActivityType", "CustodyActivityType"); put("CoinbasePublicRestApiActivityType", "PrimeActivityType"); put("CoinbaseBrokerageProxyEventsMaterializedApi", ""); + put("CoinbasePublicRestApiBeta", ""); put("CoinbasePublicRestApi", ""); put("CoinbaseCustodyApi", ""); put("PrimeRESTAPI", ""); @@ -471,6 +472,8 @@ private String extractClassName(String content) { put("coinbasePublicRestApiActivityType", "PrimeActivityType"); put("CoinbaseCustodyApiActivityType", "CustodyActivityType"); put("CoinbasePublicRestApiActivityType", "PrimeActivityType"); + put("CoinbasePublicRestApiBeta", ""); + put("coinbasePublicRestApiBeta", ""); put("CoinbasePublicRestApi", ""); put("coinbasePublicRestApi", ""); put("PrimeRESTAPI", ""); diff --git a/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/ResponsePhase.java b/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/ResponsePhase.java index 46bf1c65..ebf5ef05 100644 --- a/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/ResponsePhase.java +++ b/tools/model-generator/src/main/java/com/coinbase/tools/modelgenerator/ResponsePhase.java @@ -99,7 +99,7 @@ private static String renderOne( type(binding, property.getKey(), propertySchema, types), description(propertySchema))); } - if (fields.isEmpty() && !schema.isEmpty()) { + if (fields.isEmpty() && !schema.isEmpty() && (!"object".equals(schema.get("type")) || schema.containsKey("additionalProperties"))) { fields.put("value", new Field("value", "value", types.resolve(operation.successResponseSchema()), "")); } diff --git a/tools/model-generator/src/test/java/com/coinbase/tools/modelgenerator/OperationBindingGeneratorTest.java b/tools/model-generator/src/test/java/com/coinbase/tools/modelgenerator/OperationBindingGeneratorTest.java index 513889cb..1b0a49c5 100644 --- a/tools/model-generator/src/test/java/com/coinbase/tools/modelgenerator/OperationBindingGeneratorTest.java +++ b/tools/model-generator/src/test/java/com/coinbase/tools/modelgenerator/OperationBindingGeneratorTest.java @@ -107,9 +107,13 @@ void resolvesEveryCommittedInlineRequestEnumToAPublicNamedEnum() throws Exceptio new NamingResolver(configuration.modelTypeMappings()), configuration.sharedModelMappings()); int inlineEnumCount = 0; + List bindings = OperationBindingGenerator.deriveAll(document, configuration); + Map byOperation = new java.util.LinkedHashMap<>(); + for (OperationBinding binding : bindings) byOperation.put(binding.operationId(), binding); for (SpecModels.Operation operation : document.operations()) { + OperationBinding binding = byOperation.get(operation.operationId()); for (SpecModels.Parameter parameter : operation.parameters()) { - if (parameter.schema().containsKey("enum")) { + if (parameter.schema().containsKey("enum") && (binding == null || !binding.parameterTypeOverrides().containsKey(parameter.name()))) { assertFalse(types.resolve(parameter.schema()).name().equals("String")); inlineEnumCount++; } From 0e3bd72e010d8521c3fae54931d9e3b8d0b0e8b9 Mon Sep 17 00:00:00 2001 From: Nick Morgan Date: Wed, 25 Nov 2026 11:21:09 -0800 Subject: [PATCH 2/4] feat(sdk): sync OpenAPI spec and commit generated SDK baseline - Run make update against the live OpenAPI spec - Add WebhooksService (13 beta endpoints) and new/updated models and enums - Rename BetaRewardsRateTier/BetaRewardsRateTierType to RewardsRateTier/RewardsRateTierType - Add 25 canonical service methods and request/response DTOs with @Deprecated legacy aliases - Update FinancingServiceImpl /v2 calls to use primeClient.getBaseUrl() and align success codes to 200 --- apiSpec/prime-public-spec.yaml | 12254 ++++++++++------ .../prime/activities/ActivitiesService.java | 15 + .../activities/ActivitiesServiceImpl.java | 12 + .../activities/ListActivitiesRequest.java | 194 + .../activities/ListActivitiesResponse.java | 48 + .../ListPortfolioActivitiesRequest.java | 160 +- .../ListPortfolioActivitiesResponse.java | 35 +- .../prime/addressbook/AddressBookService.java | 15 + .../addressbook/AddressBookServiceImpl.java | 14 +- .../addressbook/GetAddressBookRequest.java | 120 + .../addressbook/GetAddressBookResponse.java | 48 + .../addressbook/ListAddressBookRequest.java | 96 +- .../addressbook/ListAddressBookResponse.java | 35 +- .../AdvancedTransferService.java | 15 + .../AdvancedTransferServiceImpl.java | 14 +- .../CreateAdvancedTransferRequest.java | 23 + .../GetCounterpartyIdRequest.java | 66 + .../GetCounterpartyIdResponse.java | 36 + .../GetPortfolioCounterpartyIdRequest.java | 51 +- .../GetPortfolioCounterpartyIdResponse.java | 23 +- .../prime/allocations/AllocationsService.java | 48 + .../allocations/AllocationsServiceImpl.java | 41 +- .../allocations/CreateAllocationRequest.java | 145 +- .../allocations/CreateAllocationResponse.java | 23 +- .../CreateNetAllocationRequest.java | 139 +- .../CreateNetAllocationResponse.java | 23 +- .../CreatePortfolioAllocationsRequest.java | 174 + .../CreatePortfolioAllocationsResponse.java | 36 + .../CreatePortfolioNetAllocationsRequest.java | 168 + ...CreatePortfolioNetAllocationsResponse.java | 36 + ...etAllocationsByClientNettingIdRequest.java | 88 + ...tAllocationsByClientNettingIdResponse.java | 36 + .../ListAllocationsByNettingIdRequest.java | 71 +- .../ListAllocationsByNettingIdResponse.java | 23 +- .../prime/factory/PrimeServiceFactory.java | 6 + .../prime/financing/FinancingService.java | 60 + .../prime/financing/FinancingServiceImpl.java | 71 +- .../GetEntityRewardsRateResponse.java | 8 +- .../GetPortfolioCreditInformationRequest.java | 51 +- ...GetPortfolioCreditInformationResponse.java | 23 +- .../financing/GetPortfolioCreditRequest.java | 66 + .../financing/GetPortfolioCreditResponse.java | 36 + .../GetPortfolioRewardsRateResponse.java | 8 +- .../GetTieredPricingFeesRequest.java | 84 + .../GetTieredPricingFeesResponse.java | 36 + ...tTradeFinanceTieredPricingFeesRequest.java | 67 +- ...TradeFinanceTieredPricingFeesResponse.java | 23 +- ...stInterestAccrualsForPortfolioRequest.java | 84 +- ...tInterestAccrualsForPortfolioResponse.java | 35 +- .../ListPortfolioInterestAccrualsRequest.java | 102 + ...ListPortfolioInterestAccrualsResponse.java | 47 + .../financing/SetFundingSettingsRequest.java | 178 + .../financing/SetFundingSettingsResponse.java | 60 + .../UpdateFundingSettingsRequest.java | 153 +- .../UpdateFundingSettingsResponse.java | 47 +- .../prime/futures/FuturesService.java | 15 + .../prime/futures/FuturesServiceImpl.java | 12 + .../futures/GetEntityPositionsRequest.java | 86 + .../futures/GetEntityPositionsResponse.java | 48 + .../prime/futures/GetPositionsRequest.java | 69 +- .../prime/futures/GetPositionsResponse.java | 35 +- .../prime/model/AdvancedTransfer.java | 29 +- .../com/coinbase/prime/model/Allocation.java | 6 +- .../com/coinbase/prime/model/CoinbaseFee.java | 93 + .../com/coinbase/prime/model/ComboLeg.java | 6 +- .../model/CrossMarginPositionBreakdown.java | 107 + .../model/CrossMarginPrimeMarginSummary.java | 46 + .../CrossMarginPrimeSpotEquityBreakdown.java | 40 + ...rossMarginPrimeSpotMarginContribution.java | 124 + .../model/CrossMarginPrimeXMPosition.java | 79 + .../prime/model/DerivativePosition.java | 20 + .../com/coinbase/prime/model/FcmPosition.java | 20 + .../java/com/coinbase/prime/model/Fill.java | 10 +- .../java/com/coinbase/prime/model/Leg.java | 99 + .../com/coinbase/prime/model/LegPreview.java | 216 + .../prime/model/MarginCallThresholds.java | 63 + .../coinbase/prime/model/MarginSummary.java | 243 + .../coinbase/prime/model/MarginThreshold.java | 125 + .../model/OnchainTransactionDetails.java | 34 +- .../coinbase/prime/model/OptionGreeks.java | 109 + .../java/com/coinbase/prime/model/Order.java | 108 +- .../prime/model/PaymentMethodDetails.java | 6 +- .../prime/model/PaymentMethodSummary.java | 6 +- .../prime/model/PortfolioStakingMetadata.java | 4 +- .../com/coinbase/prime/model/Product.java | 4 +- .../coinbase/prime/model/RewardMetadata.java | 3 +- ...ardsRateTier.java => RewardsRateTier.java} | 24 +- .../coinbase/prime/model/SpreadConfig.java | 172 + .../coinbase/prime/model/SpreadDetails.java | 215 + .../prime/model/SpreadLegDetails.java | 221 + .../coinbase/prime/model/SpreadPreview.java | 181 + .../com/coinbase/prime/model/Transaction.java | 55 +- .../prime/model/TransferLocation.java | 5 +- .../WalletCryptoDepositInstructions.java | 2 +- .../model/WalletFiatDepositInstructions.java | 2 +- .../prime/model/WalletStakingMetadata.java | 9 +- .../prime/model/WebhookDeliveryAttempt.java | 190 + .../prime/model/WebhookDeliveryLogEntry.java | 306 + .../prime/model/WebhookEventType.java | 90 + .../prime/model/WebhookEventTypeStats.java | 165 + .../prime/model/WebhookOAuthConfig.java | 92 + .../prime/model/WebhookOAuthConfigInput.java | 111 + .../prime/model/WebhookRecentFailure.java | 171 + .../prime/model/WebhookSubscription.java | 324 + .../model/WebhookSubscriptionSummary.java | 131 + .../model/enums/AdvancedTransferState.java | 14 +- .../prime/model/enums/LimitPriceType.java | 38 + .../model/enums/MarginControlStatus.java | 39 + .../model/enums/MarginEntityCallStatus.java | 49 + .../prime/model/enums/MarginHealthStatus.java | 70 + .../prime/model/enums/MarginLevel.java | 52 + .../MarginThresholdMarginThresholdType.java | 25 + .../prime/model/enums/MaxDeltaType.java | 33 + .../coinbase/prime/model/enums/OrderSide.java | 12 +- .../coinbase/prime/model/enums/OrderType.java | 12 +- .../prime/model/enums/PaymentMethodType.java | 18 +- .../prime/model/enums/PrimeXMAssetClass.java | 43 + .../prime/model/enums/ProductType.java | 11 +- .../prime/model/enums/RewardSubtype.java | 7 +- ...TierType.java => RewardsRateTierType.java} | 3 +- .../model/enums/SecondaryPermission.java | 4 +- .../prime/model/enums/SpreadLimitType.java | 30 + .../prime/model/enums/TransactionType.java | 12 +- .../model/enums/TransferLocationType.java | 10 +- .../enums/WalletDepositInstructionType.java | 6 +- .../prime/model/enums/WalletType.java | 3 +- .../prime/model/enums/WebhookAuthType.java | 41 + .../model/enums/WebhookDeliveryStatus.java | 27 + .../prime/model/enums/WebhookErrorType.java | 31 + .../model/enums/WebhookHealthStatus.java | 27 + .../prime/model/enums/XMPositionType.java | 32 + .../OnchainAddressBookServiceImpl.java | 2 +- .../orders/CreateOrderPreviewRequest.java | 469 + .../orders/CreateOrderPreviewResponse.java | 377 + .../prime/orders/CreateOrderRequest.java | 38 + .../prime/orders/CreateQuoteRequest.java | 46 + .../prime/orders/CreateQuoteResponse.java | 27 + .../prime/orders/EditOrderRequest.java | 45 + .../orders/GetOrderByOrderIdRequest.java | 71 +- .../orders/GetOrderByOrderIdResponse.java | 23 +- .../orders/GetOrderEditHistoryRequest.java | 88 + .../orders/GetOrderEditHistoryResponse.java | 59 + .../prime/orders/GetOrderPreviewRequest.java | 386 +- .../prime/orders/GetOrderPreviewResponse.java | 268 +- .../prime/orders/GetOrderRequest.java | 88 + .../prime/orders/GetOrderResponse.java | 36 + .../orders/ListOrderEditHistoryRequest.java | 71 +- .../orders/ListOrderEditHistoryResponse.java | 46 +- .../prime/orders/ListOrdersRequest.java | 195 + .../prime/orders/ListOrdersResponse.java | 48 + .../orders/ListPortfolioOrdersRequest.java | 160 +- .../orders/ListPortfolioOrdersResponse.java | 35 +- .../coinbase/prime/orders/OrdersService.java | 65 + .../prime/orders/OrdersServiceImpl.java | 112 +- .../GetEntityPaymentMethodRequest.java | 88 + .../GetEntityPaymentMethodResponse.java | 36 + .../GetPaymentMethodDetailsRequest.java | 71 +- .../GetPaymentMethodDetailsResponse.java | 23 +- .../ListEntityPaymentMethodsRequest.java | 66 + .../ListEntityPaymentMethodsResponse.java | 36 + .../ListPaymentMethodsRequest.java | 51 +- .../ListPaymentMethodsResponse.java | 23 +- .../paymentmethods/PaymentMethodsService.java | 30 + .../PaymentMethodsServiceImpl.java | 25 + .../prime/products/GetCandlesRequest.java | 120 +- .../prime/products/GetCandlesResponse.java | 23 +- .../products/GetProductCandlesRequest.java | 144 + .../products/GetProductCandlesResponse.java | 36 + .../ListPortfolioProductsRequest.java | 112 +- .../ListPortfolioProductsResponse.java | 35 +- .../prime/products/ListProductsRequest.java | 141 + .../prime/products/ListProductsResponse.java | 48 + .../prime/products/ProductsService.java | 31 + .../prime/products/ProductsServiceImpl.java | 24 + .../prime/staking/ClaimRewardsRequest.java | 103 +- .../prime/staking/ClaimRewardsResponse.java | 44 +- .../staking/ClaimStakingRewardsRequest.java | 125 + .../staking/ClaimStakingRewardsResponse.java | 57 + .../staking/CreatePortfolioStakeRequest.java | 146 + .../staking/CreatePortfolioStakeResponse.java | 48 + .../CreatePortfolioUnstakeRequest.java | 165 + .../CreatePortfolioUnstakeResponse.java | 48 + .../ListTransactionValidatorsRequest.java | 125 +- .../ListTransactionValidatorsResponse.java | 39 +- .../PortfolioStakingInitiateRequest.java | 122 +- .../PortfolioStakingInitiateResponse.java | 35 +- .../PortfolioStakingUnstakeRequest.java | 138 +- .../PortfolioStakingUnstakeResponse.java | 35 +- .../QueryTransactionValidatorsRequest.java | 149 + .../QueryTransactionValidatorsResponse.java | 52 + .../prime/staking/StakingService.java | 68 + .../prime/staking/StakingServiceImpl.java | 97 +- .../transactions/CreateTransferRequest.java | 166 + .../transactions/CreateTransferResponse.java | 144 + .../CreateWalletTransferRequest.java | 141 +- .../CreateWalletTransferResponse.java | 131 +- .../CreateWalletWithdrawalRequest.java | 212 +- .../CreateWalletWithdrawalResponse.java | 143 +- .../transactions/CreateWithdrawalRequest.java | 250 + .../CreateWithdrawalResponse.java | 156 + .../transactions/TransactionsService.java | 30 + .../transactions/TransactionsServiceImpl.java | 33 +- .../com/coinbase/prime/utils/Constants.java | 2 +- .../prime/wallets/WalletsServiceImpl.java | 4 +- .../CreateWebhookSubscriptionRequest.java | 196 + .../CreateWebhookSubscriptionResponse.java | 51 + .../DeleteWebhookSubscriptionRequest.java | 88 + .../DeleteWebhookSubscriptionResponse.java | 22 + .../GetWebhookDeliveryAttemptsRequest.java | 110 + .../GetWebhookDeliveryAttemptsResponse.java | 93 + .../GetWebhookDeliveryLogsRequest.java | 143 + .../GetWebhookDeliveryLogsResponse.java | 58 + .../GetWebhookEventTypesResponse.java | 36 + .../webhooks/GetWebhookOwnerStatsRequest.java | 84 + .../GetWebhookOwnerStatsResponse.java | 103 + .../GetWebhookSubscriptionRequest.java | 88 + .../GetWebhookSubscriptionResponse.java | 36 + .../GetWebhookSubscriptionStatsRequest.java | 106 + .../GetWebhookSubscriptionStatsResponse.java | 159 + .../ListWebhookSubscriptionsRequest.java | 120 + .../ListWebhookSubscriptionsResponse.java | 58 + .../webhooks/ReplayWebhookEventRequest.java | 106 + .../webhooks/ReplayWebhookEventResponse.java | 57 + .../RotateWebhookHmacSecretRequest.java | 110 + .../RotateWebhookHmacSecretResponse.java | 66 + .../SendWebhookSimulationRequest.java | 106 + .../SendWebhookSimulationResponse.java | 35 + .../UpdateWebhookSubscriptionRequest.java | 253 + .../UpdateWebhookSubscriptionResponse.java | 36 + .../prime/webhooks/WebhooksService.java | 207 + .../prime/webhooks/WebhooksServiceImpl.java | 190 + 231 files changed, 22100 insertions(+), 8093 deletions(-) create mode 100644 src/main/java/com/coinbase/prime/activities/ListActivitiesRequest.java create mode 100644 src/main/java/com/coinbase/prime/activities/ListActivitiesResponse.java create mode 100644 src/main/java/com/coinbase/prime/addressbook/GetAddressBookRequest.java create mode 100644 src/main/java/com/coinbase/prime/addressbook/GetAddressBookResponse.java create mode 100644 src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdRequest.java create mode 100644 src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdResponse.java create mode 100644 src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsRequest.java create mode 100644 src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsResponse.java create mode 100644 src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsRequest.java create mode 100644 src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsResponse.java create mode 100644 src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdRequest.java create mode 100644 src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdResponse.java create mode 100644 src/main/java/com/coinbase/prime/financing/GetPortfolioCreditRequest.java create mode 100644 src/main/java/com/coinbase/prime/financing/GetPortfolioCreditResponse.java create mode 100644 src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesRequest.java create mode 100644 src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesResponse.java create mode 100644 src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsRequest.java create mode 100644 src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsResponse.java create mode 100644 src/main/java/com/coinbase/prime/financing/SetFundingSettingsRequest.java create mode 100644 src/main/java/com/coinbase/prime/financing/SetFundingSettingsResponse.java create mode 100644 src/main/java/com/coinbase/prime/futures/GetEntityPositionsRequest.java create mode 100644 src/main/java/com/coinbase/prime/futures/GetEntityPositionsResponse.java create mode 100644 src/main/java/com/coinbase/prime/model/CoinbaseFee.java create mode 100644 src/main/java/com/coinbase/prime/model/CrossMarginPositionBreakdown.java create mode 100644 src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotMarginContribution.java create mode 100644 src/main/java/com/coinbase/prime/model/Leg.java create mode 100644 src/main/java/com/coinbase/prime/model/LegPreview.java create mode 100644 src/main/java/com/coinbase/prime/model/MarginCallThresholds.java create mode 100644 src/main/java/com/coinbase/prime/model/MarginThreshold.java create mode 100644 src/main/java/com/coinbase/prime/model/OptionGreeks.java rename src/main/java/com/coinbase/prime/model/{BetaRewardsRateTier.java => RewardsRateTier.java} (77%) create mode 100644 src/main/java/com/coinbase/prime/model/SpreadConfig.java create mode 100644 src/main/java/com/coinbase/prime/model/SpreadDetails.java create mode 100644 src/main/java/com/coinbase/prime/model/SpreadLegDetails.java create mode 100644 src/main/java/com/coinbase/prime/model/SpreadPreview.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookDeliveryAttempt.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookDeliveryLogEntry.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookEventType.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookEventTypeStats.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookOAuthConfig.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookOAuthConfigInput.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookRecentFailure.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookSubscription.java create mode 100644 src/main/java/com/coinbase/prime/model/WebhookSubscriptionSummary.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/LimitPriceType.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/MarginControlStatus.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/MarginEntityCallStatus.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/MarginHealthStatus.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/MarginLevel.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/MarginThresholdMarginThresholdType.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/MaxDeltaType.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/PrimeXMAssetClass.java rename src/main/java/com/coinbase/prime/model/enums/{BetaRewardsRateTierType.java => RewardsRateTierType.java} (88%) create mode 100644 src/main/java/com/coinbase/prime/model/enums/SpreadLimitType.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/WebhookAuthType.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/WebhookDeliveryStatus.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/WebhookErrorType.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/WebhookHealthStatus.java create mode 100644 src/main/java/com/coinbase/prime/model/enums/XMPositionType.java create mode 100644 src/main/java/com/coinbase/prime/orders/CreateOrderPreviewRequest.java create mode 100644 src/main/java/com/coinbase/prime/orders/CreateOrderPreviewResponse.java create mode 100644 src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryRequest.java create mode 100644 src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryResponse.java create mode 100644 src/main/java/com/coinbase/prime/orders/GetOrderRequest.java create mode 100644 src/main/java/com/coinbase/prime/orders/GetOrderResponse.java create mode 100644 src/main/java/com/coinbase/prime/orders/ListOrdersRequest.java create mode 100644 src/main/java/com/coinbase/prime/orders/ListOrdersResponse.java create mode 100644 src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodRequest.java create mode 100644 src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodResponse.java create mode 100644 src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsRequest.java create mode 100644 src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsResponse.java create mode 100644 src/main/java/com/coinbase/prime/products/GetProductCandlesRequest.java create mode 100644 src/main/java/com/coinbase/prime/products/GetProductCandlesResponse.java create mode 100644 src/main/java/com/coinbase/prime/products/ListProductsRequest.java create mode 100644 src/main/java/com/coinbase/prime/products/ListProductsResponse.java create mode 100644 src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsRequest.java create mode 100644 src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsResponse.java create mode 100644 src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeRequest.java create mode 100644 src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeResponse.java create mode 100644 src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeRequest.java create mode 100644 src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeResponse.java create mode 100644 src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsRequest.java create mode 100644 src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsResponse.java create mode 100644 src/main/java/com/coinbase/prime/transactions/CreateTransferRequest.java create mode 100644 src/main/java/com/coinbase/prime/transactions/CreateTransferResponse.java create mode 100644 src/main/java/com/coinbase/prime/transactions/CreateWithdrawalRequest.java create mode 100644 src/main/java/com/coinbase/prime/transactions/CreateWithdrawalResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookEventTypesResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionRequest.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionResponse.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/WebhooksService.java create mode 100644 src/main/java/com/coinbase/prime/webhooks/WebhooksServiceImpl.java diff --git a/apiSpec/prime-public-spec.yaml b/apiSpec/prime-public-spec.yaml index df368bc9..ae92cf4b 100644 --- a/apiSpec/prime-public-spec.yaml +++ b/apiSpec/prime-public-spec.yaml @@ -827,6 +827,52 @@ tags: httpStatus: 400 description: The counterparty_id field is required when destination_type is a counterparty destination. + - name: WEBHOOK_SUBSCRIPTION_NOT_FOUND + errorCode: RESOURCE_NOT_FOUND + httpStatus: 404 + description: No webhook subscription matching the given subscription_id exists + for the specified portfolio. + - name: WEBHOOK_SUBSCRIPTION_ID_REQUIRED + errorCode: REQUIRED_FIELD_MISSING + httpStatus: 400 + description: The subscription_id field is required but was not provided. + - name: WEBHOOK_SUBSCRIPTION_ID_INVALID + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: The subscription_id provided is not a valid UUID. + - name: WEBHOOK_TARGET_URL_INVALID + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: "The target_url provided is not an acceptable webhook destination,\ + \ for example because its scheme or host is disallowed." + - name: WEBHOOK_EVENT_TYPE_INVALID + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: One or more values in event_types are not recognized or are not available + for this portfolio. + - name: WEBHOOK_VERSION_CONFLICT + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: The subscription was modified by another request since it was last + read. Reload the subscription to get its current state and retry the update + with the latest expected_version. + - name: WEBHOOK_IDEMPOTENCY_CONFLICT + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: The same idempotency key was already used to create a subscription + with different parameters. + - name: WEBHOOK_EVENT_NOT_FOUND + errorCode: RESOURCE_NOT_FOUND + httpStatus: 404 + description: No webhook event matching the given event_id exists for this subscription. + - name: WEBHOOK_INVALID_ARGUMENT + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: One or more fields in the request failed validation. + - name: WEBHOOK_FEATURE_DISABLED + errorCode: PERMISSION_DENIED + httpStatus: 403 + description: The webhooks API is not enabled for this portfolio. - name: ORDER_ID_REQUIRED errorCode: REQUIRED_FIELD_MISSING httpStatus: 400 @@ -1031,6 +1077,10 @@ tags: errorCode: PERMISSION_DENIED httpStatus: 403 description: Size-in-quote RFQ requests are not enabled for this portfolio. + - name: ORDER_SPREAD_NOT_ENABLED + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: SPREAD orders are not enabled for this portfolio. - name: CONVERSION_FEE_FEATURE_DISABLED errorCode: PERMISSION_DENIED httpStatus: 403 @@ -1311,6 +1361,10 @@ tags: errorCode: REQUIRED_FIELD_MISSING httpStatus: 400 description: One or more fund movements is missing its counterparty identifier. + - name: ADVANCED_TRANSFER_IDEMPOTENCY_KEY_INVALID + errorCode: VALIDATION_ERROR + httpStatus: 400 + description: The idempotency_key field is present but is not a valid UUID. - name: ONCHAIN_TRANSACTION_REQUEST_INVALID errorCode: VALIDATION_ERROR httpStatus: 400 @@ -2434,7 +2488,10 @@ paths: tags: - Futures summary: Set Auto Sweep - description: Set auto sweep for a given entity. + description: "Set auto sweep for a given entity. Note: Exchange clients accessing\ + \ this endpoint as a Cross-Margin customer, must pass their designated Exchange\ + \ UUID as the *entity_id* path parameter. If you do not have this value, please\ + \ reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_SetAutoSweep parameters: - name: entity_id @@ -2500,7 +2557,10 @@ paths: tags: - Futures summary: Get Entity FCM Balance - description: Retrieve fcm balance for a given entity. + description: "Retrieve fcm balance for a given entity. Note: Exchange clients\ + \ accessing this endpoint as a Cross-Margin customer, must pass their designated\ + \ Exchange UUID as the *entity_id* path parameter. If you do not have this\ + \ value, please reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_GetFcmBalance parameters: - name: entity_id @@ -2552,7 +2612,10 @@ paths: tags: - Futures summary: Get FCM Equity - description: Retrieve the equity data for a given entity. + description: "Retrieve the equity data for a given entity. Note: Exchange clients\ + \ accessing this endpoint as a Cross-Margin customer, must pass their designated\ + \ Exchange UUID as the *entity_id* path parameter. If you do not have this\ + \ value, please reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_GetFcmEquity parameters: - name: entity_id @@ -2604,7 +2667,10 @@ paths: tags: - Futures summary: Get FCM Margin Call Details - description: Retrieve the margin call details for a given entity. + description: "Retrieve the margin call details for a given entity. Note: Exchange\ + \ clients accessing this endpoint as a Cross-Margin customer, must pass their\ + \ designated Exchange UUID as the *entity_id* path parameter. If you do not\ + \ have this value, please reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_GetFcmMarginCallDetails parameters: - name: entity_id @@ -2656,7 +2722,10 @@ paths: tags: - Futures summary: Get Entity Positions - description: Retrieve all active fcm positions for a given entity. + description: "Retrieve all active fcm positions for a given entity. Note: Exchange\ + \ clients accessing this endpoint as a Cross-Margin customer, must pass their\ + \ designated Exchange UUID as the *entity_id* path parameter. If you do not\ + \ have this value, please reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_GetPositions parameters: - name: entity_id @@ -2720,7 +2789,10 @@ paths: tags: - Futures summary: Get FCM Risk Limits - description: Retrieve the risk limits for a given entity. + description: "Retrieve the risk limits for a given entity. Note: Exchange clients\ + \ accessing this endpoint as a Cross-Margin customer, must pass their designated\ + \ Exchange UUID as the *entity_id* path parameter. If you do not have this\ + \ value, please reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_GetFcmRiskLimits parameters: - name: entity_id @@ -2772,7 +2844,10 @@ paths: tags: - Futures summary: Get FCM Settings - description: Get settings related to FCM. + description: "Get settings related to FCM. Note: Exchange clients accessing\ + \ this endpoint as a Cross-Margin customer, must pass their designated Exchange\ + \ UUID as the *entity_id* path parameter. If you do not have this value, please\ + \ reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_GetFcmSettings parameters: - name: entity_id @@ -2823,7 +2898,10 @@ paths: tags: - Futures summary: Set FCM Settings - description: Update settings related to FCM. + description: "Update settings related to FCM. Note: Exchange clients accessing\ + \ this endpoint as a Cross-Margin customer, must pass their designated Exchange\ + \ UUID as the *entity_id* path parameter. If you do not have this value, please\ + \ reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_SetFcmSettings parameters: - name: entity_id @@ -2889,7 +2967,10 @@ paths: - Futures summary: List Entity Futures Sweeps description: "Retrieve fcm sweeps in open status, including pending and processing\ - \ sweeps." + \ sweeps. Note: Exchange clients accessing this endpoint as a Cross-Margin\ + \ customer, must pass their designated Exchange UUID as the *entity_id* path\ + \ parameter. If you do not have this value, please reach out to your dedicated\ + \ Technical Account Manager." operationId: PrimeRESTAPI_GetFuturesSweeps parameters: - name: entity_id @@ -2940,8 +3021,11 @@ paths: tags: - Futures summary: Schedule Entity Futures Sweep - description: Schedule a sweep for a given entity from FCM wallet to USD Spot - wallet. Only one pending sweep is allowed at a time per entity. + description: "Schedule a sweep for a given entity from FCM wallet to USD Spot\ + \ wallet. Only one pending sweep is allowed at a time per entity. Note: Exchange\ + \ clients accessing this endpoint as a Cross-Margin customer, must pass their\ + \ designated Exchange UUID as the *entity_id* path parameter. If you do not\ + \ have this value, please reach out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_ScheduleFuturesSweep parameters: - name: entity_id @@ -3012,7 +3096,10 @@ paths: summary: Cancel Entity Futures Sweep description: "Cancel the pending sweep for a given entity. A user will only\ \ be able to have one pending sweep at a time. If the sweep is not found,\ - \ a 404 will be returned." + \ a 404 will be returned. Note: Exchange clients accessing this endpoint as\ + \ a Cross-Margin customer, must pass their designated Exchange UUID as the\ + \ *entity_id* path parameter. If you do not have this value, please reach\ + \ out to your dedicated Technical Account Manager." operationId: PrimeRESTAPI_CancelFuturesSweep parameters: - name: entity_id @@ -4426,7 +4513,10 @@ paths: type: string - name: state in: query - description: The state of the Advanced Transfer to filter by + description: |- + The state of the Advanced Transfer to filter by + + - ADVANCED_TRANSFER_STATE_MATCHED: The counterparties have matched. Settlement has not started. Happy path is CREATED, MATCHED, PROCESSING, DONE. schema: type: string enum: @@ -4436,6 +4526,8 @@ paths: - ADVANCED_TRANSFER_STATE_CANCELLED - ADVANCED_TRANSFER_STATE_FAILED - ADVANCED_TRANSFER_STATE_EXPIRED + - ADVANCED_TRANSFER_STATE_REJECTED + - ADVANCED_TRANSFER_STATE_MATCHED - name: type in: query description: The type of the Advanced Transfer to filter by @@ -4552,6 +4644,12 @@ paths: properties: advanced_transfer: $ref: '#/components/schemas/coinbase.public_rest_api.AdvancedTransfer' + idempotency_key: + type: string + description: "Optional client-generated idempotency key. When set,\ + \ it must be a UUID. A request with the same key returns the stored\ + \ transfer (id, legs, and state); the request body is not compared.\ + \ Omit the field to create a new transfer." description: CreateAdvancedTransferRequest is the request to create an advanced transfer. required: true @@ -4706,6 +4804,12 @@ paths: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.ListAdvancedTransferTransactionsResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ListAdvancedTransferTransactionsBadRequestErrorResponse' "401": description: "Authentication failed. The request signature, key, or timestamp\ \ is invalid." @@ -4769,11 +4873,13 @@ paths: - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order + - MULTIPLE: Response only: a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in requests schema: type: string enum: - BUY - SELL + - MULTIPLE - name: start_date in: query description: A start date for the allocations to be queried from. @@ -6080,6 +6186,7 @@ paths: - STOP_LIMIT: A [conditional order combined of stop order and limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - RFQ: A [request for quote](https://en.wikipedia.org/wiki/Request_for_quote) - PEG: A pegged order that dynamically adjust based on market conditions while maintaining execution discretion and avoiding adverse selection + - SPREAD: A spread order that trades a futures contract against its spot underlying, or against another futures contract of the same underlying (calendar spread), to capture a target spread (futures price - spot price, or back month - front month) schema: type: string enum: @@ -6091,6 +6198,7 @@ paths: - STOP_LIMIT - RFQ - PEG + - SPREAD - name: cursor in: query description: "**Deprecated** - this endpoint always returns one page with\ @@ -6128,11 +6236,13 @@ paths: - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order + - MULTIPLE: Response only: a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in requests schema: type: string enum: - BUY - SELL + - MULTIPLE - name: end_date in: query description: An end date for the orders to be queried from @@ -6198,7 +6308,6 @@ paths: required: - client_order_id - product_id - - side - type type: object properties: @@ -6213,15 +6322,17 @@ paths: type: $ref: '#/components/schemas/coinbase.public_rest_api.OrderType' base_quantity: - title: Order size in base asset units (either `base_quantity` or - `quote_value` is required) + title: "Order size in base asset units (either `base_quantity` or\ + \ `quote_value` is required). For SPREAD orders, required and\ + \ in the primary leg's units: a whole number of contracts when\ + \ it is a futures product" type: string quote_value: title: "Order size in quote asset units, i.e. the amount the user\ \ wants to spend (when buying) or receive (when selling); the\ \ quantity in base units will be determined based on the market\ \ liquidity and indicated `quote_value` (either `base_quantity`\ - \ or `quote_value` is required)" + \ or `quote_value` is required). Not supported for SPREAD orders" type: string limit_price: title: "The limit price (required for TWAP, VWAP, LIMIT, and STOP_LIMIT\ @@ -6287,6 +6398,14 @@ paths: \ sized in quote_value are charged on top of the requested quote_value\ \ instead of being carved out of it. Only valid for BUY orders\ \ sized in quote_value on SPOT products." + limit_price_type: + $ref: '#/components/schemas/coinbase.public_rest_api.LimitPriceType' + spread_config: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadConfig' + description: "`side` is required for every order type except SPREAD,\ + \ which must leave it unset: each leg carries its own side in `spread_config`.\ + \ `spread_config` is required when `type` is SPREAD and must be unset\ + \ for every other order type." required: true responses: "200": @@ -6353,7 +6472,6 @@ paths: schema: required: - product_id - - side - type type: object properties: @@ -6365,15 +6483,17 @@ paths: type: $ref: '#/components/schemas/coinbase.public_rest_api.OrderType' base_quantity: - title: Order size in base asset units (either `base_quantity` or - `quote_value` is required) + title: "Order size in base asset units (either `base_quantity` or\ + \ `quote_value` is required). For SPREAD orders, required and\ + \ in the primary leg's units: a whole number of contracts when\ + \ it is a futures product" type: string quote_value: title: "Order size in quote asset units, i.e. the amount the user\ \ wants to spend (when buying) or receive (when selling); the\ \ quantity in base units will be determined based on the market\ \ liquidity and indicated `quote_value` (either `base_quantity`\ - \ or `quote_value` is required)" + \ or `quote_value` is required). Not supported for SPREAD orders" type: string limit_price: title: "The limit price (required for TWAP, VWAP, LIMIT and STOP_LIMIT\ @@ -6435,6 +6555,14 @@ paths: \ sized in quote_value are charged on top of the requested quote_value\ \ instead of being carved out of it. Only valid for BUY orders\ \ sized in quote_value on SPOT products." + limit_price_type: + $ref: '#/components/schemas/coinbase.public_rest_api.LimitPriceType' + spread_config: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadConfig' + description: "`side` is required for every order type except SPREAD,\ + \ which must leave it unset: each leg carries its own side in `spread_config`.\ + \ `spread_config` is required when `type` is SPREAD and must be unset\ + \ for every other order type." required: true responses: "200": @@ -6548,6 +6676,7 @@ paths: - STOP_LIMIT: A [conditional order combined of stop order and limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - RFQ: A [request for quote](https://en.wikipedia.org/wiki/Request_for_quote) - PEG: A pegged order that dynamically adjust based on market conditions while maintaining execution discretion and avoiding adverse selection + - SPREAD: A spread order that trades a futures contract against its spot underlying, or against another futures contract of the same underlying (calendar spread), to capture a target spread (futures price - spot price, or back month - front month) schema: type: string enum: @@ -6559,6 +6688,7 @@ paths: - STOP_LIMIT - RFQ - PEG + - SPREAD - name: cursor in: query description: Cursor used for pagination (last consumed record) @@ -6587,11 +6717,13 @@ paths: - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order + - MULTIPLE: Response only: a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in requests schema: type: string enum: - BUY - SELL + - MULTIPLE - name: start_date in: query description: A start date for the orders to be queried from @@ -7044,7 +7176,7 @@ paths: - name: limit in: query description: Number of items to retrieve. Must be between 0 (defaulted to - 10) and 1000. + 10) and 3000. schema: type: integer format: int32 @@ -7066,12 +7198,14 @@ paths: - SPOT: Spot product - FUTURE: Future product - OPTION: Option product + - BASIS: Basis product: a futures contract traded against its spot underlying, or against another futures contract of the same underlying (calendar spread); the product of SPREAD orders schema: type: string enum: - SPOT - FUTURE - OPTION + - BASIS - name: contract_expiry_type in: query description: |- @@ -7204,6 +7338,12 @@ paths: Mirrors FIX tag 8090 (QuoteRequestGoodForMs). format: int64 example: "5000" + is_buy_exact: + type: boolean + description: "Buy Exact order flag. When true, fees for a BUY RFQ\ + \ sized in quote_value are charged on top of the requested quote_value\ + \ instead of being carved out of it. Only valid for BUY RFQs sized\ + \ in quote_value on SPOT products." description: based off PostOrderPreviewRequest required: true responses: @@ -7556,6 +7696,9 @@ paths: - PORTFOLIO_STAKE: Portfolio-level staking operation - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation - MERGE_STAKE: On-chain transaction consolidating funds from different addresses belonging to the same wallet. + - ONCHAIN_DEPOSIT: On-chain deposit detected into a Prime Onchain Wallet + - ONCHAIN_REWARD: Automated on-chain reward payout to a blockchain address + - ONCHAIN_MESSAGE: Message signing initiated with Prime Onchain Wallet; no funds move on-chain. style: form explode: true schema: @@ -7599,17 +7742,22 @@ paths: - PORTFOLIO_STAKE - PORTFOLIO_UNSTAKE - MERGE_STAKE + - ONCHAIN_DEPOSIT + - ONCHAIN_REWARD + - ONCHAIN_MESSAGE - name: start_time in: query description: "UTC timestamp from which to filter the response (inclusive,\ - \ ISO-8601 format)" + \ ISO-8601 format). This filter is only sensitive to the second; fractional\ + \ seconds are truncated." schema: type: string format: date-time - name: end_time in: query description: "UTC timestamp until which to filter the response (exclusive,\ - \ ISO-8601 format)" + \ ISO-8601 format). This filter is only sensitive to the second; fractional\ + \ seconds are truncated." schema: type: string format: date-time @@ -8016,6 +8164,7 @@ paths: - WALLET_TYPE_OTHER - QC - ONCHAIN + - INTERNATIONAL_DERIVATIVES - name: cursor in: query description: Cursor used for pagination (last consumed record) @@ -8502,7 +8651,13 @@ paths: properties: amount: type: string - description: The amount in whole units to convert + description: |- + The amount in whole units to convert. For example, "1.50" represents 1.5 of the source symbol. + + Examples: + - "100" + - "1.123456" (precision varies by asset; USDC, for example, supports up to 6 decimal places) + - "0.50" example: "50.50" destination: type: string @@ -8591,6 +8746,7 @@ paths: - SEN: DEPRECATED. A Silvergate Exchange Network deposit - SWIFT: A SWIFT deposit - SEPA: A SEPA deposit (Single Euro Payments Area) + - KINEXYS: A JPM Kinexys deposit required: true schema: type: string @@ -8600,6 +8756,7 @@ paths: - SEN - SWIFT - SEPA + - KINEXYS - name: network.id in: query description: |- @@ -9247,6 +9404,9 @@ paths: - PORTFOLIO_STAKE: Portfolio-level staking operation - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation - MERGE_STAKE: On-chain transaction consolidating funds from different addresses belonging to the same wallet. + - ONCHAIN_DEPOSIT: On-chain deposit detected into a Prime Onchain Wallet + - ONCHAIN_REWARD: Automated on-chain reward payout to a blockchain address + - ONCHAIN_MESSAGE: Message signing initiated with Prime Onchain Wallet; no funds move on-chain. style: form explode: true schema: @@ -9290,17 +9450,22 @@ paths: - PORTFOLIO_STAKE - PORTFOLIO_UNSTAKE - MERGE_STAKE + - ONCHAIN_DEPOSIT + - ONCHAIN_REWARD + - ONCHAIN_MESSAGE - name: start_time in: query description: "UTC timestamp from which to filter the response (inclusive,\ - \ ISO-8601 format)" + \ ISO-8601 format). This filter is only sensitive to the second; fractional\ + \ seconds are truncated." schema: type: string format: date-time - name: end_time in: query description: "UTC timestamp until which to filter the response (exclusive,\ - \ ISO-8601 format)" + \ ISO-8601 format). This filter is only sensitive to the second; fractional\ + \ seconds are truncated." schema: type: string format: date-time @@ -9403,7 +9568,14 @@ paths: properties: amount: type: string - description: The amount in whole units to send + description: |- + The amount in whole units to transfer. For example, "1.50" represents 1.5 of the wallet's asset. + + Examples: + - "100" + - "1.123456" (precision varies by asset; USDC, for example, supports up to 6 decimal places) + - "0.50" + example: "1.0001" destination: type: string description: The UUID of the destination wallet @@ -9589,7 +9761,14 @@ paths: properties: amount: type: string - description: The amount in whole units of the withdrawal + description: |- + The amount in whole units to withdraw. For example, "1.50" represents 1.5 of the wallet's asset. + + Examples: + - "100" + - "1.123456" (precision varies by asset; USDC, for example, supports up to 6 decimal places) + - "0.50" + example: "1.0001" destination_type: $ref: '#/components/schemas/coinbase.public_rest_api.DestinationType' idempotency_key: @@ -9777,73 +9956,166 @@ paths: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' - /v1/entities/{entity_id}/rewards/rate: + /v1/portfolios/{portfolio_id}/webhooks/subscriptions: get: tags: - - Financing - summary: Get Entity Rewards Rate (Beta) - description: Returns the current rewards rate and available rate tiers for the - entity. - operationId: PrimeBeta_GetEntityRewardsRate + - Webhooks + summary: List Webhook Subscriptions + description: Returns cursor-paginated webhook subscriptions for the portfolio + in the URL path. + operationId: PrimeBeta_ListWebhookSubscriptions parameters: - - name: entity_id + - name: portfolio_id in: path - description: The ID of the Prime entity whose rewards rate information is - requested. required: true schema: type: string + - name: include_disabled + in: query + schema: + type: boolean + - name: event_type_filter + in: query + schema: + type: string + - name: cursor + in: query + schema: + type: string responses: "200": description: A successful response. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetRewardsRateResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.beta.ListWebhookSubscriptionsResponse' "400": description: Bad request. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateBadRequestErrorResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.ListWebhookSubscriptionsBadRequestErrorResponse' "403": description: Permission denied. The API key lacks the required scope for this resource. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateForbiddenErrorResponse' - "404": - description: The requested resource was not found. + $ref: '#/components/schemas/coinbase.public_rest_api.ListWebhookSubscriptionsForbiddenErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateNotFoundErrorResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + post: + tags: + - Webhooks + summary: Create Webhook Subscription + description: Creates a new webhook subscription for the portfolio in the URL + path. Returns the HMAC signing secret exactly once; store it securely. + operationId: PrimeBeta_CreateWebhookSubscription + parameters: + - name: portfolio_id + in: path + description: Populated from the URL path. + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + event_types: + type: array + items: + type: string + target_url: + type: string + auth_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookAuthType' + oauth_config: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookOAuthConfigInput' + custom_headers: + type: object + additionalProperties: + type: string + description: + type: string + idempotency_key: + type: string + description: "CreateWebhookSubscriptionRequest specifies the events,\ + \ destination, and authentication for a new subscription." + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.CreateWebhookSubscriptionResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWebhookSubscriptionBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWebhookSubscriptionForbiddenErrorResponse' "429": description: Too many requests. Rate limit exceeded. content: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' "503": description: Service unavailable. content: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' - /v1/portfolios/{portfolio_id}/rewards/rate: + x-codegen-request-body-name: body + /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}: get: tags: - - Financing - summary: Get Portfolio Rewards Rate (Beta) - description: Returns the current rewards rate and available rate tiers for the - portfolio. - operationId: PrimeBeta_GetPortfolioRewardsRate + - Webhooks + summary: Get Webhook Subscription + description: Returns a single webhook subscription by ID. Auth secrets are never + returned. + operationId: PrimeBeta_GetWebhookSubscription parameters: - name: portfolio_id in: path - description: The ID of the Prime portfolio whose rewards rate information - is requested. + required: true + schema: + type: string + - name: subscription_id + in: path required: true schema: type: string @@ -9853,81 +10125,910 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetRewardsRateResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetWebhookSubscriptionResponse' "400": description: Bad request. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestErrorResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionBadRequestErrorResponse' "403": description: Permission denied. The API key lacks the required scope for this resource. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenErrorResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionForbiddenErrorResponse' "404": description: The requested resource was not found. content: application/json: schema: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundErrorResponse' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionNotFoundErrorResponse' "429": description: Too many requests. Rate limit exceeded. content: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' "503": description: Service unavailable. content: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' -components: - schemas: - coinbase.brokerage.proxy.events.materialized.api.LimitOrderEdit: - title: LimitOrderEdit represents an order edit that is accepted - type: object - properties: - price: - title: New price for the edited order - type: string - size: - title: New size for the edited order - type: string - display_size: - title: New display size for the edited order - type: string - stop_price: - title: New stop price for the edited order - type: string - stop_limit_price: - title: New stop limit price for the edited order + delete: + tags: + - Webhooks + summary: Delete Webhook Subscription + description: Soft-deletes a webhook subscription. The subscription stops matching + events immediately but audit history is retained. + operationId: PrimeBeta_DeleteWebhookSubscription + parameters: + - name: portfolio_id + in: path + required: true + schema: type: string - end_time: - title: New end time for the edited order + - name: subscription_id + in: path + required: true + schema: type: string - format: date-time - accept_time: - title: Time when the edit was accepted + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.DeleteWebhookSubscriptionResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + patch: + tags: + - Webhooks + summary: Update Webhook Subscription + description: Applies a partial patch to a webhook subscription using FieldMask + semantics. + operationId: PrimeBeta_UpdateWebhookSubscription + parameters: + - name: portfolio_id + in: path + required: true + schema: type: string - format: date-time - client_order_id: - title: Client order id of the order being replaced + - name: subscription_id + in: path + required: true + schema: type: string - coinbase.custody.api.ActivityType: - title: "- ACTIVITY_TYPE_WITHDRAWAL: PrimeActivityService Custody ActivityTypes\ - \ that will replace the above" - type: string - enum: - - ACTIVITY_TYPE_GOVERNANCE_VOTE - - ACTIVITY_TYPE_INVITATION - - ACTIVITY_TYPE_WALLET_CHANGE - - ACTIVITY_TYPE_API_KEY_CHANGE - - ACTIVITY_TYPE_SETTINGS_CHANGE - - ACTIVITY_TYPE_BILLING_PREFERENCE_CHANGE + requestBody: + content: + application/json: + schema: + type: object + properties: + event_types: + type: array + items: + type: string + target_url: + type: string + auth_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookAuthType' + oauth_config: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookOAuthConfigInput' + custom_headers: + type: object + additionalProperties: + type: string + description: + type: string + is_enabled: + type: boolean + update_mask: + type: string + expected_version: + type: string + format: int64 + description: UpdateWebhookSubscriptionRequest specifies a partial subscription + update using a field mask. + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.UpdateWebhookSubscriptionResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + x-codegen-request-body-name: body + /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/rotate-hmac-secret: + post: + tags: + - Webhooks + summary: Rotate Webhook HMAC Secret + description: Issues a new HMAC signing secret for the subscription and returns + the plaintext exactly once. By default the previous secret remains valid for + a server-configured grace window; set revoke_previous_immediately to invalidate + it at once. + operationId: PrimeBeta_RotateWebhookHMACSecret + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: subscription_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + revoke_previous_immediately: + type: boolean + description: |- + revoke_previous_immediately invalidates the old secret immediately instead of + keeping it valid for the server grace window. Use when the secret may be compromised. + description: |- + RotateWebhookHMACSecretRequest is the request message for rotating a webhook + HMAC signing secret. + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.RotateWebhookHMACSecretResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + x-codegen-request-body-name: body + /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/simulate: + post: + tags: + - Webhooks + summary: Send Webhook Simulation + description: Fires a synthetic simulation event to the subscription's endpoint + for integration testing. + operationId: PrimeBeta_SendWebhookSimulation + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: subscription_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + event_type: + type: string + description: SendWebhookSimulationRequest selects a subscription and + event type for a synthetic test delivery. + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.SendWebhookSimulationResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + x-codegen-request-body-name: body + /v1/webhooks/event-types: + get: + tags: + - Webhooks + summary: Get Webhook Event Types + description: Returns the registered webhook event types available to subscribe + to. + operationId: PrimeBeta_GetWebhookEventTypes + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetWebhookEventTypesResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookEventTypesForbiddenErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/deliveries: + get: + tags: + - Webhooks + summary: Get Webhook Delivery Logs + description: Returns cursor-paginated delivery logs for a single subscription. + Delivery history is retained for up to 30 days from each attempt's `attempted_at` + timestamp; older entries may be unavailable. + operationId: PrimeBeta_GetWebhookDeliveryLogs + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: subscription_id + in: path + required: true + schema: + type: string + - name: status_filter + in: query + schema: + type: string + enum: + - WEBHOOK_DELIVERY_STATUS_DELIVERED + - WEBHOOK_DELIVERY_STATUS_RETRYING + - WEBHOOK_DELIVERY_STATUS_FAILED + - WEBHOOK_DELIVERY_STATUS_PENDING + - name: event_type_filter + in: query + schema: + type: string + - name: cursor + in: query + schema: + type: string + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetWebhookDeliveryLogsResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/deliveries/{event_id}/attempts: + get: + tags: + - Webhooks + summary: Get Webhook Delivery Attempts + description: "Returns all HTTP POST attempts for a specific (event_id, subscription_id)\ + \ pair. Attempt history is retained for up to 30 days from each attempt's\ + \ `attempted_at` timestamp; older records may be unavailable." + operationId: PrimeBeta_GetWebhookDeliveryAttempts + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: subscription_id + in: path + required: true + schema: + type: string + - name: event_id + in: path + required: true + schema: + type: string + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetWebhookDeliveryAttemptsResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/stats: + get: + tags: + - Webhooks + summary: Get Webhook Subscription Stats + description: Returns pre-aggregated delivery statistics for a single subscription + over a fixed time window. + operationId: PrimeBeta_GetWebhookSubscriptionStats + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: subscription_id + in: path + required: true + schema: + type: string + - name: period + in: query + schema: + type: string + enum: + - WEBHOOK_STATS_PERIOD_24H + - WEBHOOK_STATS_PERIOD_7D + - WEBHOOK_STATS_PERIOD_30D + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetWebhookSubscriptionStatsResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + /v1/portfolios/{portfolio_id}/webhooks/stats: + get: + tags: + - Webhooks + summary: Get Webhook Owner Stats + description: Returns a dashboard-level rollup of delivery statistics across + all subscriptions for the portfolio in the URL path. + operationId: PrimeBeta_GetWebhookOwnerStats + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: period + in: query + schema: + type: string + enum: + - WEBHOOK_STATS_PERIOD_24H + - WEBHOOK_STATS_PERIOD_7D + - WEBHOOK_STATS_PERIOD_30D + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetWebhookOwnerStatsResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookOwnerStatsBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookOwnerStatsForbiddenErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + /v1/portfolios/{portfolio_id}/webhooks/events/{event_id}/replay: + post: + tags: + - Webhooks + summary: Replay Webhook Event + description: Replays a previously published event for the portfolio in the URL + path. When subscription_id is set the event is re-delivered to that single + subscription; otherwise it is re-delivered to every matching subscription + owned by the path owner. + operationId: PrimeBeta_ReplayWebhookEvent + parameters: + - name: portfolio_id + in: path + required: true + schema: + type: string + - name: event_id + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + properties: + subscription_id: + type: string + description: |- + ReplayWebhookEventRequest replays a previously published event. + portfolio_id is set from the URL path. When subscription_id is non-empty, + the event is re-delivered to that single subscription. When subscription_id + is empty, the event is re-delivered to every matching subscription owned + by the portfolio in the URL path. + required: true + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.ReplayWebhookEventResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "500": + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.InternalServerErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + x-codegen-request-body-name: body + /v1/entities/{entity_id}/rewards/rate: + get: + tags: + - Financing + summary: Get Entity Rewards Rate (Beta) + description: Returns the current rewards rate and available rate tiers for the + entity. + operationId: PrimeBeta_GetEntityRewardsRate + parameters: + - name: entity_id + in: path + description: The ID of the Prime entity whose rewards rate information is + requested. + required: true + schema: + type: string + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetRewardsRateResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' + /v1/portfolios/{portfolio_id}/rewards/rate: + get: + tags: + - Financing + summary: Get Portfolio Rewards Rate (Beta) + description: Returns the current rewards rate and available rate tiers for the + portfolio. + operationId: PrimeBeta_GetPortfolioRewardsRate + parameters: + - name: portfolio_id + in: path + description: The ID of the Prime portfolio whose rewards rate information + is requested. + required: true + schema: + type: string + responses: + "200": + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.GetRewardsRateResponse' + "400": + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestErrorResponse' + "403": + description: Permission denied. The API key lacks the required scope for + this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenErrorResponse' + "404": + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundErrorResponse' + "429": + description: Too many requests. Rate limit exceeded. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.TooManyRequestsErrorResponse' + "503": + description: Service unavailable. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ServiceUnavailableErrorResponse' +components: + schemas: + coinbase.brokerage.proxy.events.materialized.api.LimitOrderEdit: + title: LimitOrderEdit represents an order edit that is accepted + type: object + properties: + price: + title: New price for the edited order + type: string + size: + title: New size for the edited order + type: string + display_size: + title: New display size for the edited order + type: string + stop_price: + title: New stop price for the edited order + type: string + stop_limit_price: + title: New stop limit price for the edited order + type: string + end_time: + title: New end time for the edited order + type: string + format: date-time + accept_time: + title: Time when the edit was accepted + type: string + format: date-time + client_order_id: + title: Client order id of the order being replaced + type: string + coinbase.custody.api.ActivityType: + title: "- ACTIVITY_TYPE_WITHDRAWAL: PrimeActivityService Custody ActivityTypes\ + \ that will replace the above" + type: string + enum: + - ACTIVITY_TYPE_GOVERNANCE_VOTE + - ACTIVITY_TYPE_INVITATION + - ACTIVITY_TYPE_WALLET_CHANGE + - ACTIVITY_TYPE_API_KEY_CHANGE + - ACTIVITY_TYPE_SETTINGS_CHANGE + - ACTIVITY_TYPE_BILLING_PREFERENCE_CHANGE - ACTIVITY_TYPE_PAYMENT_METHOD_CHANGE - ACTIVITY_TYPE_WITHDRAWAL - ACTIVITY_TYPE_DEPOSIT @@ -10333,12 +11434,20 @@ components: $ref: '#/components/schemas/coinbase.public_rest_api.FundMovement' blind_match_metadata: $ref: '#/components/schemas/coinbase.public_rest_api.BlindMatchMetadata' + coinbase_fees: + type: array + description: Coinbase fees charged to this portfolio's wallets on this Advanced + Transfer. Empty on create and when no fee applies. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.CoinbaseFee' description: AdvancedTransfer represents a complex transfer operation such as a blind match settlement. coinbase.public_rest_api.AdvancedTransferState: type: string - description: AdvancedTransferState represents the lifecycle state of an advanced - transfer. + description: |- + AdvancedTransferState represents the lifecycle state of an advanced transfer. + + - ADVANCED_TRANSFER_STATE_MATCHED: The counterparties have matched. Settlement has not started. Happy path is CREATED, MATCHED, PROCESSING, DONE. enum: - ADVANCED_TRANSFER_STATE_CREATED - ADVANCED_TRANSFER_STATE_PROCESSING @@ -10346,6 +11455,8 @@ components: - ADVANCED_TRANSFER_STATE_CANCELLED - ADVANCED_TRANSFER_STATE_FAILED - ADVANCED_TRANSFER_STATE_EXPIRED + - ADVANCED_TRANSFER_STATE_REJECTED + - ADVANCED_TRANSFER_STATE_MATCHED coinbase.public_rest_api.AdvancedTransferType: type: string description: AdvancedTransferType specifies the type of advanced transfer. @@ -10746,6 +11857,22 @@ components: - THIRTY_MINUTES - TWO_HOURS - FOUR_HOURS + coinbase.public_rest_api.CoinbaseFee: + type: object + properties: + amount: + type: string + description: The fee amount in whole units of the fee symbol + example: "0.05" + symbol: + type: string + description: The asset symbol in which the fee was charged + example: USDC + wallet_id: + type: string + description: The wallet that paid the fee + example: cde8dd34-b6cf-4c2c-82bc-5f86adacc868 + description: A Coinbase fee charged on an Advanced Transfer. coinbase.public_rest_api.ComboLeg: type: object properties: @@ -10995,7 +12122,13 @@ components: example: USDC amount: type: string - description: The amount in whole units to convert + description: |- + The amount in whole units to convert. For example, "1.50" represents 1.5 of the source symbol. + + Examples: + - "100" + - "1.123456" (precision varies by asset; USDC, for example, supports up to 6 decimal places) + - "0.50" example: "50.50" destination: type: string @@ -11220,6 +12353,22 @@ components: $ref: '#/components/schemas/coinbase.public_rest_api.XMLoan' active_liquidation: $ref: '#/components/schemas/coinbase.public_rest_api.ActiveLiquidationSummary' + coinbase.public_rest_api.CrossMarginPositionBreakdown: + type: object + properties: + position_type: + $ref: '#/components/schemas/coinbase.public_rest_api.XMPositionType' + balance: + type: string + description: "Signed balance of this leg in the position currency, after\ + \ pending withdrawals and before collateral caps and haircuts." + example: "-0.19652944" + notional_balance: + type: string + description: "Signed USD notional of this leg, after pending withdrawals\ + \ and before collateral caps and haircuts." + example: "-22508.85" + description: A single typed position leg of a per-asset XM row. coinbase.public_rest_api.CrossMarginPrimeDerivativesEquityBreakdown: type: object properties: @@ -11320,6 +12469,16 @@ components: type: string description: FCM excess available to return. example: "5000.00" + raw_account_equity: + type: string + description: "Total account equity in USD after pending withdrawals, before\ + \ collateral caps and cash-equivalent haircuts." + example: "-21542.63" + pre_haircut_account_equity: + type: string + description: "Total account equity in USD after pending withdrawals and\ + \ collateral caps, before cash-equivalent haircuts." + example: "-21542.63" description: Cross-margin account summary and nested breakdowns. coinbase.public_rest_api.CrossMarginPrimeRiskNettingInfo: type: object @@ -11384,7 +12543,40 @@ components: type: string description: Pending transfers affecting spot equity. example: "15303.77" + fx_balance: + type: string + description: Equity contribution from FX positions. + example: "0.00" + stablecoin_balance: + type: string + description: Equity contribution from non-USDC stablecoins. USDC is included + in cash_balance. + example: "-1000000.00" description: Breakdown of the components of spot equity. + coinbase.public_rest_api.CrossMarginPrimeSpotMarginContribution: + type: object + properties: + raw_notional: + type: string + description: "Signed spot value in USD after pending withdrawals, before\ + \ collateral caps and cash-equivalent haircuts." + example: "1000000.00" + ineligible_notional: + type: string + description: Long notional excluded above the collateral cap. + example: "0" + haircut_notional: + type: string + description: Amount removed by the cash-equivalent long haircut. + example: "20000.00" + equity_contribution: + type: string + description: Final spot equity contribution. Positive values are eligible + collateral; negative values are liabilities. + example: "980000.00" + description: "Breakdown of a position row's spot equity contribution. All values\ + \ are zero when no contribution data is available. If the asset class is unknown,\ + \ the contribution amounts are still returned." coinbase.public_rest_api.CrossMarginPrimeXMPosition: type: object properties: @@ -11448,6 +12640,16 @@ components: type: string description: Liquidity margin add-on for this asset. example: "0.49" + asset_class: + $ref: '#/components/schemas/coinbase.public_rest_api.PrimeXMAssetClass' + spot_margin_contribution: + $ref: '#/components/schemas/coinbase.public_rest_api.CrossMarginPrimeSpotMarginContribution' + spot_position_breakdown: + type: array + description: "Spot balance of this asset by position type. Contains SPOT_TRADING\ + \ and SPOT_VAULT legs, which sum to spot_balance and spot_balance_notional." + items: + $ref: '#/components/schemas/coinbase.public_rest_api.CrossMarginPositionBreakdown' description: CrossMarginPrimeXMPosition is a single per-asset XM row (proto-backed fields from XMPositionDetails). coinbase.public_rest_api.CrossMarginRiskParameters: @@ -11580,6 +12782,10 @@ components: type: string description: Venue ID of the position example: CDE + funding_pnl: + type: string + description: "Funding PNL, populated only for perpetual futures positions" + example: "10.12" description: A single derivative position across all derivative product types. coinbase.public_rest_api.DerivativeProductType: type: string @@ -11974,6 +13180,10 @@ components: description: Expiration time of position format: date-time example: 2021-01-01T00:00:00Z + funding_pnl: + type: string + description: "Funding PNL, populated only for perpetual futures positions" + example: "10.12" coinbase.public_rest_api.FcmPositionSide: type: string enum: @@ -12951,6 +14161,65 @@ components: - INVOICE_TYPE_WITHDRAWAL_FEE - INVOICE_TYPE_NEW_WALLET_FEE - INVOICE_TYPE_STAKING_FEE + coinbase.public_rest_api.Leg: + title: One leg of a SPREAD order + type: object + properties: + product_id: + title: "Product ID of the leg, e.g. BTC-USD for spot or BIP-20DEC30-CDE\ + \ for futures" + type: string + side: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' + support_passive_order: + type: boolean + description: Whether this leg may rest passively on the book. At least one + leg must be true. + coinbase.public_rest_api.LegPreview: + title: Preview values for one leg of a SPREAD order + type: object + properties: + product_id: + type: string + side: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' + support_passive_order: + type: boolean + leg_commission: + title: Estimated commission for this leg + type: string + quote_value: + title: Estimated notional of this leg in quote currency + type: string + best_bid: + title: Current best bid for this leg's order book + type: string + best_ask: + title: Current best ask for this leg's order book + type: string + average_filled_price: + title: Estimated average fill price for this leg + type: string + slippage: + title: Expected slippage for this leg + type: string + coinbase.public_rest_api.LimitPriceType: + type: string + description: |- + LimitPriceType indicates the unit `limit_price` is denominated in. Only meaningful for + Deribit options - leave unspecified for every other order type and product, which are + always priced in the quote currency. + + - UNKNOWN_LIMIT_PRICE_TYPE: nil value - `limit_price` is interpreted in the product's default/native unit + - LIMIT_PRICE_TYPE_BASE_ASSET: `limit_price` is denominated in the underlying base asset (e.g. BTC for a BTC option). + Only valid for Deribit options settled in the base asset. + - LIMIT_PRICE_TYPE_QUOTE_ASSET: `limit_price` is denominated in the quote asset (e.g. USD/USDC). + - LIMIT_PRICE_TYPE_IMPLIED_VOLATILITY: `limit_price` is an implied volatility percentage rather than a monetary amount + (e.g. "65.5" means 65.5% implied volatility). + enum: + - LIMIT_PRICE_TYPE_BASE_ASSET + - LIMIT_PRICE_TYPE_QUOTE_ASSET + - LIMIT_PRICE_TYPE_IMPLIED_VOLATILITY coinbase.public_rest_api.ListAdvancedTransferTransactionsResponse: required: - transactions @@ -13017,3344 +14286,4758 @@ components: assets with their details type: object properties: - assets: + assets: + type: array + description: List of assets eligible for Trade Finance + items: + $ref: '#/components/schemas/coinbase.public_rest_api.TFAsset' + coinbase.public_rest_api.ListOnchainAddressGroupsResponse: + required: + - address_groups + type: object + properties: + address_groups: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.AddressGroup' + coinbase.public_rest_api.ListTFObligationsResponse: + title: Response containing trade finance obligations for an entity + type: object + properties: + obligations: + type: array + description: The list of obligations (loans) for the entity. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.TFObligation' + coinbase.public_rest_api.ListTransactionValidatorsResponse: + required: + - pagination + - transaction_validators + type: object + properties: + transaction_validators: + type: array + description: List of transaction-to-validator associations. Each entry represents + one transaction staking to one validator. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.TransactionValidator' + pagination: + $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' + coinbase.public_rest_api.ListWalletAddressesResponse: + required: + - addresses + - pagination + type: object + properties: + addresses: + title: Addresses + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.BlockchainAddress' + pagination: + $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' + coinbase.public_rest_api.ListWeb3WalletBalancesResponse: + type: object + properties: + balances: + title: List of balances in the onchain wallet + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.Web3Balance' + pagination: + $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' + defi_balances: + type: array + description: DeFi balances only return for the initial request. No pagination + support. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.DefiBalance' + coinbase.public_rest_api.ListXMLiquidationsResponse: + title: ListXMLiquidationsResponse contains a paginated list of XM liquidation + summaries + type: object + properties: + liquidations: + type: array + description: List of XM liquidation summaries + items: + $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidationSummary' + pagination: + $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' + coinbase.public_rest_api.LoanInfo: + type: object + properties: + portfolio_id: + type: string + description: The unique ID of the portfolio + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + symbol: + type: string + description: The currency symbol + example: BTC + amount: + type: string + description: Balance amount + example: "150000" + notional_amount: + type: string + description: Notional balance amount + example: "250000" + due_date: + type: string + description: Settlement due date + example: "1000" + coinbase.public_rest_api.LoanType: + type: string + enum: + - BILATERAL_LENDING + - TRADE_FINANCE + - PORTFOLIO_MARGIN + - SHORT_COLLATERAL_LOAN + - SHORT_COLLATERAL + - CROSS_MARGIN + coinbase.public_rest_api.Locate: + type: object + properties: + symbol: + type: string + description: The currency symbol + example: BTC + quantity: + type: string + description: The available quantity located + example: "100" + rate: + type: string + description: The interest rate for located symbol + example: "0.05" + coinbase.public_rest_api.MarginAddOn: + type: object + properties: + amount: + type: string + description: margin add on amount + add_on_type: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOnType' + coinbase.public_rest_api.MarginAddOnType: + type: string + enum: + - SINGLE_COIN_STRESS + - CONCENTRATION_STRESS + - MACRO_STRESS + - SHORT_BIASED_STRESS + coinbase.public_rest_api.MarginCallRecord: + type: object + properties: + margin_call_id: + type: string + description: The unique ID of the margin call + example: e8bbed13-fa33-41de-86d5-4335d8f08122 + initial_notional_amount: + type: string + description: The initial margin call amount in notional value + example: "123.45" + outstanding_notional_amount: + type: string + description: The outstanding margin call amount in notional value + example: "122.45" + created_at: + type: string + description: The time the margin call is created in RFC3330 format + example: 2023-01-01T00:00:00Z5 + due_at: + type: string + description: The time the margin call is due in RFC3339 format + example: 2023-01-01T00:00:00Z + coinbase.public_rest_api.MarginCallThresholds: + type: object + properties: + margin_thresholds: + type: array + description: Ordered thresholds used to select a margin level. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginThreshold' + description: |- + Configured thresholds used to determine `margin_level`. Each entry identifies a margin level, the ratio used to evaluate it, and its threshold value. + Historical responses contain the thresholds recorded with the historical health evaluation. + + Equity at or above the margin requirement produces a healthy margin level. Otherwise, the evaluator selects the first matching rule in the configured order. + A threshold comparison identifies a matching level; it doesn't by itself issue a margin call or change account permissions. + coinbase.public_rest_api.MarginControlStatus: + type: string + description: |- + Trading and withdrawal permissions derived from the account's recorded health state, outstanding margin calls, and account restrictions. + These permissions can remain restricted even when the calculated `margin_level` improves. + Returns `MARGIN_CONTROL_STATUS_UNSPECIFIED` when the margin service doesn't provide a control status. + + - MARGIN_CONTROL_STATUS_UNSPECIFIED: No control status is provided. Don't infer permission to trade or withdraw from this value. + - MARGIN_CONTROL_STATUS_TRADES_AND_WITHDRAWALS: Allowed to trade and withdraw under the applicable margin methodology. + - MARGIN_CONTROL_STATUS_TRADES_ONLY: Allowed to trade but not withdraw under the applicable margin methodology. + - MARGIN_CONTROL_STATUS_SESSION_LOCKED: Not allowed to trade or withdraw. + enum: + - MARGIN_CONTROL_STATUS_TRADES_AND_WITHDRAWALS + - MARGIN_CONTROL_STATUS_TRADES_ONLY + - MARGIN_CONTROL_STATUS_SESSION_LOCKED + coinbase.public_rest_api.MarginEntityCallStatus: + type: string + description: |- + MarginEntityCallStatus summarizes the entity's open margin calls. When several calls are open, it reflects the highest-priority one: aged, then urgent, then standard, then debit. + `call_status` describes outstanding calls. Use `margin_level` for calculated margin condition and `control_status` for trading and withdrawal permissions. + + - MARGIN_ENTITY_CALL_STATUS_UNSPECIFIED: No call status is provided. Don't infer that the entity has no margin calls from this value. + - MARGIN_ENTITY_CALL_STATUS_NO_CALL: The entity has no open margin calls. + - MARGIN_ENTITY_CALL_STATUS_OPEN_STANDARD_CALL: The entity has an open standard margin call and no urgent or aged calls. + - MARGIN_ENTITY_CALL_STATUS_OPEN_URGENT_CALL: The entity has an open urgent margin call and no aged calls. + - MARGIN_ENTITY_CALL_STATUS_AGED_CALL: At least one open margin call is past its due time. This status alone does not indicate a contractual Event of Default or that liquidation has begun. + - MARGIN_ENTITY_CALL_STATUS_OPEN_DEBIT_CALL: The entity has an open debit call and no standard, urgent, or aged calls. + enum: + - MARGIN_ENTITY_CALL_STATUS_NO_CALL + - MARGIN_ENTITY_CALL_STATUS_OPEN_STANDARD_CALL + - MARGIN_ENTITY_CALL_STATUS_OPEN_URGENT_CALL + - MARGIN_ENTITY_CALL_STATUS_AGED_CALL + - MARGIN_ENTITY_CALL_STATUS_OPEN_DEBIT_CALL + coinbase.public_rest_api.MarginHealthStatus: + type: string + description: |- + Recorded account health state maintained by the margin-management process. + Persistence rules filter out short-lived threshold changes. Margin-call and liquidation events also affect this state. + A change in the calculated `margin_level` may not immediately change this status. + Use `control_status` for trading and withdrawal permissions in live responses. + Historical responses contain the recorded health state at the historical evaluation. + + - MARGIN_HEALTH_STATUS_UNSPECIFIED: No account health state is provided. Don't interpret this value as healthy or as permission to trade or withdraw. + - MARGIN_HEALTH_STATUS_HEALTHY: The account's recorded health state is healthy. + - MARGIN_HEALTH_STATUS_WARNING: The account's recorded health state is warning. Margin-call issuance follows the applicable margin methodology. + - MARGIN_HEALTH_STATUS_CRITICAL: The account's recorded health state is critical, corresponding to an urgent margin-call condition under the applicable margin methodology. + - MARGIN_HEALTH_STATUS_SUSPENDED: The account is recorded as suspended under the applicable margin methodology. + - MARGIN_HEALTH_STATUS_RESTRICTED: The account is recorded as restricted under the applicable margin methodology. + - MARGIN_HEALTH_STATUS_PRE_LIQUIDATION: The account is in a pre-liquidation state. Liquidation may commence under the applicable margin methodology. + - MARGIN_HEALTH_STATUS_LIQUIDATING: Liquidation has commenced. + - MARGIN_HEALTH_STATUS_IN_DEFICIT: The account's recorded health state is in deficit. Margin-call issuance follows the applicable margin methodology. + enum: + - MARGIN_HEALTH_STATUS_HEALTHY + - MARGIN_HEALTH_STATUS_WARNING + - MARGIN_HEALTH_STATUS_CRITICAL + - MARGIN_HEALTH_STATUS_SUSPENDED + - MARGIN_HEALTH_STATUS_RESTRICTED + - MARGIN_HEALTH_STATUS_PRE_LIQUIDATION + - MARGIN_HEALTH_STATUS_LIQUIDATING + - MARGIN_HEALTH_STATUS_IN_DEFICIT + coinbase.public_rest_api.MarginInformation: + type: object + properties: + margin_call_records: type: array - description: List of assets eligible for Trade Finance + description: The current margin call records items: - $ref: '#/components/schemas/coinbase.public_rest_api.TFAsset' - coinbase.public_rest_api.ListOnchainAddressGroupsResponse: - required: - - address_groups + $ref: '#/components/schemas/coinbase.public_rest_api.MarginCallRecord' + margin_summary: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginSummary' + coinbase.public_rest_api.MarginLevel: + type: string + description: |- + Calculated margin level based on the account's equity, margin requirement, margin limit, and configured thresholds. + This reflects the current calculation for live responses or the recorded calculation for historical responses. + It can differ from `health_status`, which is maintained by the margin-management process. + The level alone doesn't determine whether a margin call is open or whether trading and withdrawals are allowed. + + - MARGIN_LEVEL_UNSPECIFIED: No calculated margin level is provided. + - MARGIN_LEVEL_HEALTHY: Account equity is at or above the margin requirement. + - MARGIN_LEVEL_DEFICIT: The calculation places the account in the deficit band. Margin-call issuance follows the applicable margin methodology. + - MARGIN_LEVEL_WARNING: The calculation places the account in the warning band, approaching the critical threshold. + - MARGIN_LEVEL_CRITICAL: The calculation places the account in the critical band. + - MARGIN_LEVEL_LIQUIDATION: The calculation places the account in the liquidation band. This value alone doesn't indicate that liquidation has commenced. + enum: + - MARGIN_LEVEL_HEALTHY + - MARGIN_LEVEL_DEFICIT + - MARGIN_LEVEL_WARNING + - MARGIN_LEVEL_CRITICAL + - MARGIN_LEVEL_LIQUIDATION + coinbase.public_rest_api.MarginSummary: type: object properties: - address_groups: + entity_id: + type: string + description: The unique ID of the entity + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + margin_equity: + type: string + description: The margin equity at the entity level. Margin Equity = LMV + + SMV + Trading Cash Balance + Short Collateral - Pending Withdrawals + example: "2539231.5903575355" + margin_requirement: + type: string + description: USD notional value of required equity in entity portfolios + example: "15131.725279884091" + excess_deficit: + type: string + description: margin_equity - margin_requirement + example: "2524099.865077651" + pm_credit_consumed: + type: string + description: The raw amount of portfolio margin credit used + example: "10000" + tf_credit_limit: + type: string + description: The maximum trade finance credit limit. This field is deprecated + and will be removed in the future. + example: "2000000" + tf_credit_consumed: + type: string + description: The amount of trade finance credit used (USD). This field is + deprecated and will be removed in the future. + example: "20000" + tf_adjusted_asset_value: + type: string + description: TF Asset Adjusted Value (USD). This field is deprecated and + will be removed in the future. + example: "40000" + tf_adjusted_liability_value: + type: string + description: TF Adjusted Liability Value (USD). This field is deprecated + and will be removed in the future. + example: "40000" + tf_adjusted_credit_consumed: + type: string + description: The amount of adjusted credit used. This field is deprecated + and will be removed in the future. + example: "30000" + tf_adjusted_equity: + type: string + description: The amount of adjusted equity. This field is deprecated and + will be removed in the future. + example: "30000" + frozen: + type: boolean + description: Whether or not a entity is frozen due to balance outstanding + or other reason + example: false + frozen_reason: + type: string + description: The reason why a entity is frozen + tf_enabled: + type: boolean + description: Whether TF is enabled for the entity. This field is deprecated + and will be removed in the future. + example: true + pm_enabled: + type: boolean + description: Whether PM is enabled for the entity + example: true + market_rates: type: array + description: Market rates for the list of assets items: - $ref: '#/components/schemas/coinbase.public_rest_api.AddressGroup' - coinbase.public_rest_api.ListTFObligationsResponse: - title: Response containing trade finance obligations for an entity - type: object - properties: - obligations: + $ref: '#/components/schemas/coinbase.public_rest_api.MarketRate' + asset_balances: type: array - description: The list of obligations (loans) for the entity. + description: Asset Balances across portfolios items: - $ref: '#/components/schemas/coinbase.public_rest_api.TFObligation' - coinbase.public_rest_api.ListTransactionValidatorsResponse: - required: - - pagination - - transaction_validators - type: object - properties: - transaction_validators: + $ref: '#/components/schemas/coinbase.public_rest_api.AssetBalance' + tf_loans: type: array - description: List of transaction-to-validator associations. Each entry represents - one transaction staking to one validator. + description: Trade finance debit loan amounts. This field is deprecated + and will be removed in the future. items: - $ref: '#/components/schemas/coinbase.public_rest_api.TransactionValidator' - pagination: - $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' - coinbase.public_rest_api.ListWalletAddressesResponse: - required: - - addresses - - pagination - type: object - properties: - addresses: - title: Addresses + $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo' + pm_loans: type: array + description: Portfolio Margin debit loan amounts items: - $ref: '#/components/schemas/coinbase.public_rest_api.BlockchainAddress' - pagination: - $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' - coinbase.public_rest_api.ListWeb3WalletBalancesResponse: - type: object - properties: - balances: - title: List of balances in the onchain wallet + $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo' + short_collateral: type: array + description: Short collateral amounts items: - $ref: '#/components/schemas/coinbase.public_rest_api.Web3Balance' - pagination: - $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' - defi_balances: + $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo' + gross_market_value: + type: string + description: Gross market value (GMV) = LMV + Abs (SMV) + net_market_value: + type: string + description: Net Market Value (NMV) = LMV + SMV + long_market_value: + type: string + description: Long Market Value (LMV) = Sum of positive notional for all + assets + non_marginable_long_market_value: + type: string + description: "Non_Marginable LMV: Sum of positive notional for each non-margin\ + \ eligible coin" + short_market_value: + type: string + description: Short Market Value (SMV) = Sum of negative notional for each + margin eligible coin + gross_leverage: + type: string + description: Gross Leverage = GMV / Margin Requirement + net_exposure: + type: string + description: Net Exposure = (LMV + SMV) / GMV + portfolio_stress_triggered: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn' + pm_asset_info: type: array - description: DeFi balances only return for the initial request. No pagination - support. + description: PM asset info netted across the entity items: - $ref: '#/components/schemas/coinbase.public_rest_api.DefiBalance' - coinbase.public_rest_api.ListXMLiquidationsResponse: - title: ListXMLiquidationsResponse contains a paginated list of XM liquidation - summaries + $ref: '#/components/schemas/coinbase.public_rest_api.PMAssetInfo' + pm_credit_limit: + type: string + description: PM limit that monitors gross notional borrowings (crypto + + fiat) + example: "1000000" + pm_margin_limit: + type: string + description: PM limit that monitors excess deficit + example: "200000" + pm_margin_consumed: + type: string + description: The amount of the margin limit that is consumed by the excess + deficit + example: "5000" + short_collateral_transfer: + type: string + description: |- + Signed cash adjustment associated with the short collateral balance in a historical margin summary. Negative amounts move cash into short collateral; positive amounts return cash from short collateral. Add this signed amount to the snapshot's cash balance to calculate cash after the transfer. Live margin responses return an empty string for this field. + + For example, a cash balance of 60000000 and a short collateral transfer of -20000000 produce a cash balance of 40000000 after the transfer. This calculation doesn't determine the amount available to withdraw. + example: "10000" + health_status: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginHealthStatus' + margin_level: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginLevel' + margin_thresholds: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginCallThresholds' + control_status: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginControlStatus' + equity_ratio: + type: string + description: "Account equity divided by margin requirement, expressed as\ + \ a decimal ratio. For example, \"1.2\" represents equity equal to 120%\ + \ of the margin requirement. Returns an empty string when either input\ + \ is unavailable or the margin requirement is zero." + example: "3.633" + deficit_ratio: + type: string + description: "Margin deficit divided by the account's margin limit, calculated\ + \ as `max(0, (margin requirement - account equity) / pm_margin_limit)`.\ + \ Expressed as a decimal ratio, not a percentage. Returns an empty string\ + \ when an input is unavailable or the margin limit is zero." + example: "0" + call_status: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginEntityCallStatus' + coinbase.public_rest_api.MarginSummaryHistorical: type: object properties: - liquidations: - type: array - description: List of XM liquidation summaries - items: - $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidationSummary' - pagination: - $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse' - coinbase.public_rest_api.LoanInfo: + conversion_datetime: + type: string + description: The UTC date time used for conversion + example: 2023-05-01T12:00:00Z + conversion_date: + type: string + description: The date used for conversion + example: 2023-05-01 + margin_summary: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginSummary' + coinbase.public_rest_api.MarginThreshold: + type: object + properties: + margin_level: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginLevel' + threshold_type: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginThreshold.MarginThresholdType' + threshold_value: + type: string + description: "Threshold expressed as a decimal ratio, not a percentage.\ + \ For example, \"0.8\" represents 80%. Interpret this value together with\ + \ threshold_type." + example: "0.8" + description: "A single margin level, the ratio used to evaluate its threshold,\ + \ and the threshold value." + coinbase.public_rest_api.MarginThreshold.MarginThresholdType: + type: string + description: |- + Ratio used to evaluate a threshold. Rules are evaluated in configured order; the first matching rule determines the margin level when equity is below the margin requirement. + A zero threshold imposes no constraint for that ratio. If the denominator is zero, the evaluator skips the division and checks the numerator condition: nonnegative equity for an equity-ratio rule, or a positive deficit for a deficit-ratio rule. + + - MARGIN_THRESHOLD_TYPE_UNSPECIFIED: No threshold type is provided. + - MARGIN_THRESHOLD_TYPE_EQUITY_RATIO: For a nonzero threshold and positive margin requirement, the rule matches when equity is nonnegative and equity / margin requirement is greater than or equal to threshold_value. + - MARGIN_THRESHOLD_TYPE_DEFICIT_RATIO: For a nonzero threshold and positive margin limit, the rule matches when the deficit is positive and (margin requirement - equity) / margin limit is greater than threshold_value. + - MARGIN_THRESHOLD_TYPE_NONE: Fallback rule with no numeric ratio threshold. + enum: + - MARGIN_THRESHOLD_TYPE_EQUITY_RATIO + - MARGIN_THRESHOLD_TYPE_DEFICIT_RATIO + - MARGIN_THRESHOLD_TYPE_NONE + coinbase.public_rest_api.MarketData: + type: object + properties: + symbol: + type: string + description: "Base asset symbol (e.g., BTC, ETH, SOL)" + example: BTC + vol_5d: + type: string + description: "Daily historical volatility over trailing 5 days (decimal,\ + \ e.g., 0.65 = 65%)" + example: "0.65" + vol_30d: + type: string + description: "Daily historical volatility over trailing 30 days (decimal,\ + \ e.g., 0.65 = 65%)" + example: "0.65" + vol_90d: + type: string + description: "Daily historical volatility over trailing 90 days (decimal,\ + \ e.g., 0.65 = 65%)" + example: "0.65" + adv_30d: + type: string + description: Average daily trading volume over trailing 30 days (USD) + example: "1234567.89" + weighted_vol: + type: string + description: Weighted blend of the most recent vol_5d and the max vol_5d + over last 30 days into a single volatility measure (decimal). + example: "0.0345" + coinbase.public_rest_api.MarketRate: type: object properties: - portfolio_id: - type: string - description: The unique ID of the portfolio - example: e8bbed13-fa33-41de-86d5-4335d8f08166 symbol: type: string description: The currency symbol example: BTC - amount: + rate: type: string - description: Balance amount - example: "150000" - notional_amount: + description: The current market rate of currency + example: "27,123" + coinbase.public_rest_api.MatchMetadata: + type: object + properties: + reference_id: type: string - description: Notional balance amount - example: "250000" - due_date: + description: The reference id of the match + settlement_date: type: string - description: Settlement due date - example: "1000" - coinbase.public_rest_api.LoanType: + description: The settlement date of the match + coinbase.public_rest_api.MaxDeltaType: + title: Unit of a SPREAD order's max delta size type: string - enum: - - BILATERAL_LENDING - - TRADE_FINANCE - - PORTFOLIO_MARGIN - - SHORT_COLLATERAL_LOAN - - SHORT_COLLATERAL - - CROSS_MARGIN - coinbase.public_rest_api.Locate: + description: |- + - UNKNOWN_MAX_DELTA_TYPE: nil value + - MAX_DELTA_TYPE_SPOT: Absolute size in spot base units. Not accepted for a calendar spread (two futures). + - MAX_DELTA_TYPE_PERCENT: Percentage of the order size + - MAX_DELTA_TYPE_CONTRACT: Absolute number of futures contracts + enum: + - MAX_DELTA_TYPE_SPOT + - MAX_DELTA_TYPE_PERCENT + - MAX_DELTA_TYPE_CONTRACT + coinbase.public_rest_api.NFTCollection: type: object properties: - symbol: + name: type: string - description: The currency symbol - example: BTC - quantity: + description: NFT collection name + coinbase.public_rest_api.NFTItem: + type: object + properties: + name: type: string - description: The available quantity located - example: "100" - rate: + description: NFT item name + coinbase.public_rest_api.NaturalPersonName: + title: Natural person name components + type: object + properties: + first_name: + title: Given/first name type: string - description: The interest rate for located symbol - example: "0.05" - coinbase.public_rest_api.MarginAddOn: + middle_name: + title: optional middle name (currently unused) + type: string + last_name: + title: Family/last name + type: string + coinbase.public_rest_api.Network: type: object properties: - amount: + id: + title: The name of the network type: string - description: margin add on amount - add_on_type: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOnType' - coinbase.public_rest_api.MarginAddOnType: - type: string - enum: - - SINGLE_COIN_STRESS - - CONCENTRATION_STRESS - - MACRO_STRESS - - SHORT_BIASED_STRESS - coinbase.public_rest_api.MarginCallRecord: + description: "The network id: base, bitcoin, ethereum, solana etc" + type: + title: The network type + type: string + description: "The network type: mainnet, testnet, etc" + coinbase.public_rest_api.NetworkDetails: type: object properties: - margin_call_id: + network: + $ref: '#/components/schemas/coinbase.public_rest_api.Network' + name: type: string - description: The unique ID of the margin call - example: e8bbed13-fa33-41de-86d5-4335d8f08122 - initial_notional_amount: + description: The name of the network + example: Ethereum + max_decimals: type: string - description: The initial margin call amount in notional value - example: "123.45" - outstanding_notional_amount: + description: The maximum number of decimals supported for this network + example: "8" + default: + type: boolean + description: Indicates whether this network is the default network for the + asset + example: true + trading_supported: + type: boolean + description: Indicates whether this network supports trading + example: true + vault_supported: + type: boolean + description: Indicates whether this network supports vault + example: true + prime_custody_supported: + type: boolean + description: Indicates whether this network supports prime custody + example: true + destination_tag_required: + type: boolean + description: Indicates whether this network requires a destination tag + example: true + network_link: type: string - description: The outstanding margin call amount in notional value - example: "122.45" - created_at: + description: Base URL to our recommended block explorer (crypto only) + example: https://live.blockcypher.com/btc/ + network_scoped_symbol: type: string - description: The time the margin call is created in RFC3330 format - example: 2023-01-01T00:00:00Z5 - due_at: + description: "Indicates the symbol that can be used to query other endpoints,\ + \ related to transactions, wallets, and activities, to get information\ + \ particularly for this asset on the network" + example: BASEUSDC + min_withdrawal_amount: type: string - description: The time the margin call is due in RFC3339 format - example: 2023-01-01T00:00:00Z - coinbase.public_rest_api.MarginInformation: + description: "The minimum withdrawal amount for this network. Applies to\ + \ trading, prime custody, and vault wallets." + example: "0.001" + max_withdrawal_amount: + type: string + description: "The platform maximum withdrawal amount for this network. Applies\ + \ to trading, prime custody, and vault wallets. Note that Prime Transfer\ + \ policies may override this value." + example: "1000" + min_deposit_amount: + type: string + description: "The minimum deposit amount for this network. Applies to trading,\ + \ prime custody, and vault wallets." + example: "0.001" + coinbase.public_rest_api.NetworkFamily: + type: string + enum: + - NETWORK_FAMILY_EVM + - NETWORK_FAMILY_SOLANA + coinbase.public_rest_api.NetworkType: + type: string + enum: + - NETWORK_TYPE_EVM + - NETWORK_TYPE_SOLANA + coinbase.public_rest_api.OnchainTransactionDetails: type: object properties: - margin_call_records: - type: array - description: The current margin call records - items: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginCallRecord' - margin_summary: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginSummary' - coinbase.public_rest_api.MarginSummary: + signed_transaction: + type: string + description: "The hex-encoded signed transaction. Only returned for transactions\ + \ created with skip_broadcast set to true; empty for all other transactions,\ + \ including broadcast transactions that have been signed." + example: 01ac1872bb2967df00124a7fd15e470a10aab04852e19fc6f... + risk_assessment: + $ref: '#/components/schemas/coinbase.public_rest_api.RiskAssessment' + chain_id: + type: string + description: The blockchain network chain ID. Will be empty for Solana transactions. + example: "1" + nonce: + type: string + description: The transaction nonce. Only present for EVM-based blockchain + transactions. + example: "42" + replaced_transaction_id: + type: string + description: The ID of the transaction that this transaction replaced + example: 123e4567-e89b-12d3-a456-426614174000 + destination_address: + type: string + description: The destination address for the transaction + example: 0x742d35Cc6634C0532925a3b844Bc454e4438f44e + skip_broadcast: + type: boolean + description: "If set to true, the transaction will not be broadcast to the\ + \ network. You can still retrieve the signed transaction from the GetTransaction\ + \ endpoint by transaction ID once the transaction is created." + example: false + failure_reason: + type: string + description: Reason for transaction failure if applicable + example: insufficient_funds + signing_status: + $ref: '#/components/schemas/coinbase.public_rest_api.SigningStatus' + original_unsigned_transaction: + type: string + description: "The hex-encoded unsigned transaction exactly as submitted\ + \ when the transaction was created. This value is never updated. Before\ + \ signing, Prime may set the nonce, network fees, or gas limit on EVM\ + \ transactions, or refresh the recent blockhash on Solana transactions,\ + \ so the transaction that is signed and broadcast can differ from this\ + \ payload. The transfer amount is only changed for EVM transactions initiated\ + \ as a maximum transfer of the network's native asset, where Prime lowers\ + \ it so that the amount plus network fees does not exceed the wallet's\ + \ current balance." + example: 02f872818980850db7504633854f33d9a27882c1a4947ceb23fd6bc0add59e62ac25578270cff1b9f61980b844a9059cbb... + coinbase.public_rest_api.OptionGreeks: type: object properties: - entity_id: + delta: type: string - description: The unique ID of the entity - example: e8bbed13-fa33-41de-86d5-4335d8f08166 - margin_equity: + description: "Delta greek, in units of the underlying" + example: "0.36833" + gamma: type: string - description: The margin equity at the entity level. Margin Equity = LMV - + SMV + Trading Cash Balance + Short Collateral - Pending Withdrawals - example: "2539231.5903575355" - margin_requirement: + description: Gamma greek + example: "0.00046" + theta: type: string - description: USD notional value of required equity in entity portfolios - example: "15131.725279884091" - excess_deficit: + description: "Theta greek, in USD per day" + example: "-155.79411" + vega: type: string - description: margin_equity - margin_requirement - example: "2524099.865077651" - pm_credit_consumed: + description: "Vega greek, in USD per 1% change in implied volatility" + example: "7.86142" + description: "Greeks of one option contract as quoted by the venue, not scaled\ + \ by order size or side." + coinbase.public_rest_api.OptionProductDetails: + title: OptionProductDetails contains details specific to option products + type: object + properties: + option_type: + $ref: '#/components/schemas/coinbase.public_rest_api.OptionType' + strike: + title: Strike price of the option type: string - description: The raw amount of portfolio margin credit used - example: "10000" - tf_credit_limit: + description: Strike price of the option + example: "2400" + contract_root_unit: + title: Contract root unit (underlying asset) + type: string + description: Contract root unit (underlying asset) + example: ETH + settlement_currency: + title: Currency the option settles in type: string - description: The maximum trade finance credit limit. This field is deprecated - and will be removed in the future. - example: "2000000" - tf_credit_consumed: + description: Currency the option settles in + example: ETH + contract_code: + title: Contract code identifier type: string - description: The amount of trade finance credit used (USD). This field is - deprecated and will be removed in the future. - example: "20000" - tf_adjusted_asset_value: + description: Contract code identifier + example: eth_usd + group_description: + title: Descriptive name for the product group type: string - description: TF Asset Adjusted Value (USD). This field is deprecated and - will be removed in the future. - example: "40000" - tf_adjusted_liability_value: + description: Descriptive name for the product group + example: Deribit ETH Inverse Options + contract_size: + title: Contract size type: string - description: TF Adjusted Liability Value (USD). This field is deprecated - and will be removed in the future. - example: "40000" - tf_adjusted_credit_consumed: + description: Contract size + example: "1" + contract_expiry: + title: Contract expiry timestamp type: string - description: The amount of adjusted credit used. This field is deprecated - and will be removed in the future. - example: "30000" - tf_adjusted_equity: + description: Contract expiry timestamp + format: date-time + settlement_period: + $ref: '#/components/schemas/coinbase.public_rest_api.SettlementPeriod' + settlement_model: + $ref: '#/components/schemas/coinbase.public_rest_api.SettlementModel' + counter_currency: + title: Currency the option is quoted against type: string - description: The amount of adjusted equity. This field is deprecated and - will be removed in the future. - example: "30000" - frozen: - type: boolean - description: Whether or not a entity is frozen due to balance outstanding - or other reason - example: false - frozen_reason: + description: Currency the option is quoted against + example: ETH + lot_size: + title: Smallest tradable quantity of the contract type: string - description: The reason why a entity is frozen - tf_enabled: - type: boolean - description: Whether TF is enabled for the entity. This field is deprecated - and will be removed in the future. - example: true - pm_enabled: - type: boolean - description: Whether PM is enabled for the entity - example: true - market_rates: - type: array - description: Market rates for the list of assets - items: - $ref: '#/components/schemas/coinbase.public_rest_api.MarketRate' - asset_balances: - type: array - description: Asset Balances across portfolios - items: - $ref: '#/components/schemas/coinbase.public_rest_api.AssetBalance' - tf_loans: - type: array - description: Trade finance debit loan amounts. This field is deprecated - and will be removed in the future. - items: - $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo' - pm_loans: - type: array - description: Portfolio Margin debit loan amounts - items: - $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo' - short_collateral: + description: Smallest tradable quantity of the contract + example: "10" + price_increment_steps: type: array - description: Short collateral amounts + description: Tiered price increments that override price_increment above + a threshold; empty when a single price_increment applies items: - $ref: '#/components/schemas/coinbase.public_rest_api.LoanInfo' - gross_market_value: + $ref: '#/components/schemas/coinbase.public_rest_api.PriceIncrementStep' + coinbase.public_rest_api.OptionType: + type: string + description: |- + The type of an option position. + + - OPTION_TYPE_UNSPECIFIED: Unspecified option type. + - OPTION_TYPE_CALL: Call option. + - OPTION_TYPE_PUT: Put option. + enum: + - OPTION_TYPE_CALL + - OPTION_TYPE_PUT + coinbase.public_rest_api.OptionsDetails: + type: object + properties: + delta: type: string - description: Gross market value (GMV) = LMV + Abs (SMV) - net_market_value: + description: Delta greek + example: "0.5" + gamma: type: string - description: Net Market Value (NMV) = LMV + SMV - long_market_value: + description: Gamma greek + example: "0.1" + theta: type: string - description: Long Market Value (LMV) = Sum of positive notional for all - assets - non_marginable_long_market_value: + description: Theta greek + example: "-0.05" + vega: type: string - description: "Non_Marginable LMV: Sum of positive notional for each non-margin\ - \ eligible coin" - short_market_value: + description: Vega greek + example: "0.2" + strike: type: string - description: Short Market Value (SMV) = Sum of negative notional for each - margin eligible coin - gross_leverage: + description: Strike price + example: "50000.00" + option_type: + $ref: '#/components/schemas/coinbase.public_rest_api.OptionType' + description: "Options-specific details for a derivative position, including\ + \ greeks." + coinbase.public_rest_api.Order: + type: object + properties: + id: type: string - description: Gross Leverage = GMV / Margin Requirement - net_exposure: + description: The unique order ID generated by Coinbase + example: 82c879c1-84e1-44ed-a8c2-1ac239cf09ad + user_id: type: string - description: Net Exposure = (LMV + SMV) / GMV - portfolio_stress_triggered: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn' - pm_asset_info: - type: array - description: PM asset info netted across the entity - items: - $ref: '#/components/schemas/coinbase.public_rest_api.PMAssetInfo' - pm_credit_limit: + description: The ID of the user that created the order + example: "42" + portfolio_id: type: string - description: PM limit that monitors gross notional borrowings (crypto + - fiat) - example: "1000000" - pm_margin_limit: + description: The ID of the portfolio that owns the order + example: 3e1fe27e-26fe-46d8-b118-c752a2ae6b47 + product_id: type: string - description: PM limit that monitors excess deficit - example: "200000" - pm_margin_consumed: + description: The ID of the product being traded by the order + example: BTC-USD + side: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' + client_order_id: type: string - description: The amount of the margin limit that is consumed by the excess - deficit - example: "5000" - coinbase.public_rest_api.MarginSummaryHistorical: - type: object - properties: - conversion_datetime: + description: "A client-generated order ID used for reference purposes (note:\ + \ order will be rejected if this ID is not unique among all currently\ + \ active orders)" + example: f69a20b1-4ac4-420e-90b5-814a12565bfa + type: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderType' + base_quantity: type: string - description: The UTC date time used for conversion - example: 2023-05-01T12:00:00Z - conversion_date: + description: "Order size in base asset units (either `base_quantity` or\ + \ `quote_value` is required). For SPREAD orders, in the primary leg's\ + \ units: a whole number of contracts when it is a futures product" + example: "50" + quote_value: type: string - description: The date used for conversion - example: 2023-05-01 - margin_summary: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginSummary' - coinbase.public_rest_api.MarketData: - type: object - properties: - symbol: + description: "Order size in quote asset units, i.e. the amount the user\ + \ wants to spend (when buying) or receive (when selling); the quantity\ + \ in base units will be determined based on the market liquidity and indicated\ + \ `quote_value`. Either `base_quantity` or `quote_value` is required.\ + \ Not supported for SPREAD orders" + example: "100" + limit_price: type: string - description: "Base asset symbol (e.g., BTC, ETH, SOL)" - example: BTC - vol_5d: + description: "The limit price (required for TWAP, VWAP, LIMIT and STOP_LIMIT\ + \ orders). Empty for SPREAD orders, which carry a spread limit in `spread_details`\ + \ instead" + example: "50.12" + start_time: type: string - description: "Daily historical volatility over trailing 5 days (decimal,\ - \ e.g., 0.65 = 65%)" - example: "0.65" - vol_30d: + description: "The start time of the order in UTC (only applies to TWAP,\ + \ VWAP orders.)" + format: date-time + example: 2021-05-31T09:59:59Z + expiry_time: type: string - description: "Daily historical volatility over trailing 30 days (decimal,\ - \ e.g., 0.65 = 65%)" - example: "0.65" - vol_90d: + description: "The expiry time of the order in UTC (applies to TWAP, VWAP,\ + \ LIMIT, and STOP_LIMIT orders with `time_in_force` set to `GTD`)" + format: date-time + example: 2021-05-31T10:59:59Z + status: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderStatus' + time_in_force: + $ref: '#/components/schemas/coinbase.public_rest_api.TimeInForceType' + created_at: + type: string + description: The order creation time as a UTC timestamp + format: date-time + example: 2021-05-31T10:59:59Z + filled_quantity: + type: string + description: "Size filled (in base asset units). Empty for SPREAD orders,\ + \ whose legs fill in different units; see `spread_details` for each leg's\ + \ value" + example: "100" + filled_value: + type: string + description: "Market value filled (in quote asset units). For SPREAD orders,\ + \ the sum of both legs' filled values" + example: "100" + average_filled_price: + type: string + description: Indicates the average `filled_price`. Empty for SPREAD orders; + see `spread_details` for each leg's value + example: "50.19" + commission: type: string - description: "Daily historical volatility over trailing 90 days (decimal,\ - \ e.g., 0.65 = 65%)" - example: "0.65" - adv_30d: + description: "Total commission paid on this order (in quote asset units)\ + \ -- only applicable for partially- or fully-filled orders. For SPREAD\ + \ orders, the sum of both legs' commissions; `commission_detail_total`\ + \ is empty and each leg's breakdown is in `spread_details`" + example: "4.99" + exchange_fee: type: string - description: Average daily trading volume over trailing 30 days (USD) - example: "1234567.89" - weighted_vol: + description: "Fee charged by the exchange for Cost Plus commission configurations.\ + \ Exchange fee will be 0 for All In commission configurations. For SPREAD\ + \ orders, the sum of both legs' exchange fees (`spread_details.primary_leg.exchange_fee`\ + \ and `spread_details.secondary_leg.exchange_fee`)." + example: "2.50" + historical_pov: type: string - description: Weighted blend of the most recent vol_5d and the max vol_5d - over last 30 days into a single volatility measure (decimal). - example: "0.0345" - coinbase.public_rest_api.MarketRate: - type: object - properties: - symbol: + description: historical pov for the order + example: "2.50" + stop_price: type: string - description: The currency symbol - example: BTC - rate: + description: Specifies the stop price at which the order activates. The + order is activated if the last trade price on Coinbase Exchange crosses + the stop price specified on the order + example: "50.12" + net_average_filled_price: type: string - description: The current market rate of currency - example: "27,123" - coinbase.public_rest_api.MatchMetadata: - type: object - properties: - reference_id: + description: Indicates the average `filled_price` net of commissions and + fees. Empty for SPREAD orders; see `spread_details` for each leg's value + example: "57.68" + user_context: type: string - description: The reference id of the match - settlement_date: + description: Indicates a user friendly message for regarding various aspects + of the order such as cancellation or rejection reasons + example: User initiated cancellation + client_product_id: type: string - description: The settlement date of the match - coinbase.public_rest_api.NFTCollection: - type: object - properties: - name: + description: The client product ID of the fill indictating the settlment + currency + example: BTC-USDC + post_only: + title: Post-only flag - indicates whether the order was placed as post-only + type: boolean + description: Post-only flag - indicates whether the order was placed as + post-only + example: true + order_edit_history: + title: "deprecated: use edit_history instead" + type: array + description: "The history of order edits (deprecated: use edit_history instead)" + items: + $ref: '#/components/schemas/coinbase.brokerage.proxy.events.materialized.api.LimitOrderEdit' + is_raise_exact: + type: boolean + description: Indicates if this was a raise exact order (size inclusive of + fees for sell orders in quote) + example: true + display_size: type: string - description: NFT collection name - coinbase.public_rest_api.NFTItem: - type: object - properties: - name: + description: Display size for the order + example: "10.5" + edit_history: + title: Order Edit History + type: array + description: The history of order edits + example: + - price: "100" + base_quantity: "1" + quote_value: "100" + display_base_size: "1.00" + display_quote_size: "1.00" + stop_price: "120" + expiry_time: 2021-05-31T10:59:59Z + accept_time: 2021-06-20T10:59:59Z + client_order_id: "123" + items: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderEdit' + display_quote_size: type: string - description: NFT item name - coinbase.public_rest_api.NaturalPersonName: - title: Natural person name components - type: object - properties: - first_name: - title: Given/first name + description: The maximum order size that will show up on venue order books + (in quote currency). + example: "100.50" + display_base_size: type: string - middle_name: - title: optional middle name (currently unused) + description: The maximum order size that will show up on venue order books + (in base currency). + example: "10.5" + peg_offset_type: + title: PEG order specific fields type: string - last_name: - title: Family/last name + description: "The peg offset type for PEG orders (PRICE, BASIS_POINTS, or\ + \ CUMULATIVE_DEPTH_IN_BASE_UNITS)" + example: PEG_OFFSET_TYPE_PRICE + offset: type: string - coinbase.public_rest_api.Network: + description: The offset value for PEG orders + example: "100" + wig_level: + type: string + description: The wig (would if good) level for PEG orders - best price opposite + to limit_price + example: "100000" + product_type: + $ref: '#/components/schemas/coinbase.public_rest_api.ProductType' + commission_detail_total: + $ref: '#/components/schemas/coinbase.public_rest_api.CommissionDetailTotal' + is_buy_exact: + type: boolean + description: Indicates if this was a buy exact order (fees charged on top + of quote size for BUY orders sized in quote) + example: false + limit_price_type: + $ref: '#/components/schemas/coinbase.public_rest_api.LimitPriceType' + spread_details: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadDetails' + coinbase.public_rest_api.OrderEdit: type: object properties: - id: - title: The name of the network + price: + title: New price for the edited order type: string - description: "The network id: base, bitcoin, ethereum, solana etc" - type: - title: The network type + base_quantity: + title: "New base quantity for the edited order, populated if order is in\ + \ base size" type: string - description: "The network type: mainnet, testnet, etc" - coinbase.public_rest_api.NetworkDetails: - type: object - properties: - network: - $ref: '#/components/schemas/coinbase.public_rest_api.Network' - name: + quote_value: + title: "New quote value for the edited order, populated if order is in quote\ + \ size" type: string - description: The name of the network - example: Ethereum - max_decimals: + display_base_size: + title: "Display base size for the edited order, populated if order is in\ + \ base size" type: string - description: The maximum number of decimals supported for this network - example: "8" - default: - type: boolean - description: Indicates whether this network is the default network for the - asset - example: true - trading_supported: - type: boolean - description: Indicates whether this network supports trading - example: true - vault_supported: - type: boolean - description: Indicates whether this network supports vault - example: true - prime_custody_supported: - type: boolean - description: Indicates whether this network supports prime custody - example: true - destination_tag_required: - type: boolean - description: Indicates whether this network requires a destination tag - example: true - network_link: + display_quote_size: + title: "Display quote size for the edited order, populated if order is in\ + \ quote size" type: string - description: Base URL to our recommended block explorer (crypto only) - example: https://live.blockcypher.com/btc/ - network_scoped_symbol: + stop_price: + title: New stop price for the edited order type: string - description: "Indicates the symbol that can be used to query other endpoints,\ - \ related to transactions, wallets, and activities, to get information\ - \ particularly for this asset on the network" - example: BASEUSDC - min_withdrawal_amount: + expiry_time: + title: New expiry/end time for the edited order type: string - description: "The minimum withdrawal amount for this network. Applies to\ - \ trading, prime custody, and vault wallets." - example: "0.001" - max_withdrawal_amount: + format: date-time + accept_time: + title: Time when the edit was accepted type: string - description: "The platform maximum withdrawal amount for this network. Applies\ - \ to trading, prime custody, and vault wallets. Note that Prime Transfer\ - \ policies may override this value." - example: "1000" - min_deposit_amount: + format: date-time + client_order_id: + title: The new client order identifier that the order adopted after the + replacement was successfully accepted type: string - description: "The minimum deposit amount for this network. Applies to trading,\ - \ prime custody, and vault wallets." - example: "0.001" - coinbase.public_rest_api.NetworkFamily: + coinbase.public_rest_api.OrderSide: + title: Order side type: string + description: |- + - UNKNOWN_ORDER_SIDE: nil value + - BUY: Buy order + - SELL: Sell order + - MULTIPLE: Response only: a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in requests enum: - - NETWORK_FAMILY_EVM - - NETWORK_FAMILY_SOLANA - coinbase.public_rest_api.NetworkType: + - BUY + - SELL + - MULTIPLE + coinbase.public_rest_api.OrderStatus: + title: Indicates the order status + type: string + description: |- + - UNKNOWN_ORDER_STATUS: nil value + - OPEN: The order is open but unfilled + - FILLED: The order was filled + - CANCELLED: The order was cancelled + - EXPIRED: The order has expired + - FAILED: Order submission failed + - PENDING: The order has been sent but is not yet confirmed + enum: + - OPEN + - FILLED + - CANCELLED + - EXPIRED + - FAILED + - PENDING + coinbase.public_rest_api.OrderType: + title: Strategy (execution algorithm) type: string + description: |- + - UNKNOWN_ORDER_TYPE: nil value + - MARKET: A [market order](https://en.wikipedia.org/wiki/Order_(exchange)#Market_order) + - LIMIT: A [limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Limit_order) + - TWAP: A [time-weighted average price order](https://en.wikipedia.org/wiki/Time-weighted_average_price) + - BLOCK: A [block trade](https://en.wikipedia.org/wiki/Block_trade) + - VWAP: A [volume-weighted average price order](https://en.wikipedia.org/wiki/Volume-weighted_average_price) + - STOP_LIMIT: A [conditional order combined of stop order and limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) + - RFQ: A [request for quote](https://en.wikipedia.org/wiki/Request_for_quote) + - PEG: A pegged order that dynamically adjust based on market conditions while maintaining execution discretion and avoiding adverse selection + - SPREAD: A spread order that trades a futures contract against its spot underlying, or against another futures contract of the same underlying (calendar spread), to capture a target spread (futures price - spot price, or back month - front month) enum: - - NETWORK_TYPE_EVM - - NETWORK_TYPE_SOLANA - coinbase.public_rest_api.OnchainTransactionDetails: + - MARKET + - LIMIT + - TWAP + - BLOCK + - VWAP + - STOP_LIMIT + - RFQ + - PEG + - SPREAD + coinbase.public_rest_api.PMAssetInfo: type: object properties: - signed_transaction: + symbol: type: string - description: The signed transaction data - example: 01ac1872bb2967df00124a7fd15e470a10aab04852e19fc6f... - risk_assessment: - $ref: '#/components/schemas/coinbase.public_rest_api.RiskAssessment' - chain_id: + description: The currency symbol + amount: type: string - description: The blockchain network chain ID. Will be empty for Solana transactions. - example: "1" - nonce: + description: Nominal amount of the currency + price: type: string - description: The transaction nonce. Only present for EVM-based blockchain - transactions. - example: "42" - replaced_transaction_id: + description: Spot price for the currency + notional_amount: type: string - description: The ID of the transaction that this transaction replaced - example: 123e4567-e89b-12d3-a456-426614174000 - destination_address: + description: Notional amount of the currency + asset_tier: type: string - description: The destination address for the transaction - example: 0x742d35Cc6634C0532925a3b844Bc454e4438f44e - skip_broadcast: + description: Asset tier of the currency + margin_eligible: type: boolean - description: "If set to true, the transaction will not be broadcast to the\ - \ network. You can still retrieve the signed transaction from the GetTransaction\ - \ endpoint by transaction ID once the transaction is created." - example: false - failure_reason: + description: Whether the currency is margin eligible + base_margin_requirement: type: string - description: Reason for transaction failure if applicable - example: insufficient_funds - signing_status: - $ref: '#/components/schemas/coinbase.public_rest_api.SigningStatus' - coinbase.public_rest_api.OptionProductDetails: - title: OptionProductDetails contains details specific to option products - type: object - properties: - option_type: - $ref: '#/components/schemas/coinbase.public_rest_api.OptionType' - strike: - title: Strike price of the option + description: Base margin requirement of the currency + base_margin_requirement_notional: type: string - description: Strike price of the option - example: "2400" - contract_root_unit: - title: Contract root unit (underlying asset) + description: Notional amount of the currency's base margin requirement + adv_30d: type: string - description: Contract root unit (underlying asset) - example: ETH - settlement_currency: - title: Currency the option settles in + description: The 30d adv of the currency + hist_5d_vol: type: string - description: Currency the option settles in - example: ETH - contract_code: - title: Contract code identifier + description: Historic 5d volatility of the currency + hist_30d_vol: type: string - description: Contract code identifier - example: eth_usd - group_description: - title: Descriptive name for the product group + description: Historic 30d volatility of the currency + hist_90d_vol: type: string - description: Descriptive name for the product group - example: Deribit ETH Inverse Options - contract_size: - title: Contract size + description: Historic 90d volatility of the currency + volatility_addon: type: string - description: Contract size - example: "1" - contract_expiry: - title: Contract expiry timestamp + description: Volatility margin addon of the currency position + liquidity_addon: type: string - description: Contract expiry timestamp - format: date-time - settlement_period: - $ref: '#/components/schemas/coinbase.public_rest_api.SettlementPeriod' - settlement_model: - $ref: '#/components/schemas/coinbase.public_rest_api.SettlementModel' - counter_currency: - title: Currency the option is quoted against + description: Liquidity margin addon of the currency position + total_position_margin: type: string - description: Currency the option is quoted against - example: ETH - lot_size: - title: Smallest tradable quantity of the contract + description: Total position margin of the currency + short_nominal: type: string - description: Smallest tradable quantity of the contract - example: "10" - price_increment_steps: - type: array - description: Tiered price increments that override price_increment above - a threshold; empty when a single price_increment applies - items: - $ref: '#/components/schemas/coinbase.public_rest_api.PriceIncrementStep' - coinbase.public_rest_api.OptionType: - type: string - description: |- - The type of an option position. - - - OPTION_TYPE_UNSPECIFIED: Unspecified option type. - - OPTION_TYPE_CALL: Call option. - - OPTION_TYPE_PUT: Put option. - enum: - - OPTION_TYPE_CALL - - OPTION_TYPE_PUT - coinbase.public_rest_api.OptionsDetails: + description: Nominal short position of the currency + long_nominal: + type: string + description: Nominal long position of the currency + coinbase.public_rest_api.PaginatedResponse: + required: + - has_next + - next_cursor + - sort_direction type: object properties: - delta: - type: string - description: Delta greek - example: "0.5" - gamma: - type: string - description: Gamma greek - example: "0.1" - theta: - type: string - description: Theta greek - example: "-0.05" - vega: + next_cursor: type: string - description: Vega greek - example: "0.2" - strike: + description: Cursor to navigate to next page + sort_direction: + $ref: '#/components/schemas/coinbase.public_rest_api.SortDirection' + has_next: + type: boolean + description: A boolean value indicating whether there are more items to + paginate through + coinbase.public_rest_api.PaymentMethodDestination: + type: object + properties: + payment_method_id: + title: The payment method id to pay out type: string - description: Strike price - example: "50000.00" - option_type: - $ref: '#/components/schemas/coinbase.public_rest_api.OptionType' - description: "Options-specific details for a derivative position, including\ - \ greeks." - coinbase.public_rest_api.Order: + coinbase.public_rest_api.PaymentMethodDetails: type: object properties: id: type: string - description: The unique order ID generated by Coinbase - example: 82c879c1-84e1-44ed-a8c2-1ac239cf09ad - user_id: - type: string - description: The ID of the user that created the order - example: "42" - portfolio_id: - type: string - description: The ID of the portfolio that owns the order - example: 3e1fe27e-26fe-46d8-b118-c752a2ae6b47 - product_id: - type: string - description: The ID of the product being traded by the order - example: BTC-USD - side: - $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' - client_order_id: - type: string - description: "A client-generated order ID used for reference purposes (note:\ - \ order will be rejected if this ID is not unique among all currently\ - \ active orders)" - example: f69a20b1-4ac4-420e-90b5-814a12565bfa - type: - $ref: '#/components/schemas/coinbase.public_rest_api.OrderType' - base_quantity: - type: string - description: Order size in base asset units (either `base_quantity` or `quote_value` - is required) - example: "50" - quote_value: - type: string - description: "Order size in quote asset units, i.e. the amount the user\ - \ wants to spend (when buying) or receive (when selling); the quantity\ - \ in base units will be determined based on the market liquidity and indicated\ - \ `quote_value`. Either `base_quantity` or `quote_value` is required" - example: "100" - limit_price: + symbol: type: string - description: "The limit price (required for TWAP, VWAP, LIMIT and STOP_LIMIT\ - \ orders)" - example: "50.12" - start_time: + payment_method_type: + $ref: '#/components/schemas/coinbase.public_rest_api.PaymentMethodType' + name: type: string - description: "The start time of the order in UTC (only applies to TWAP,\ - \ VWAP orders.)" - format: date-time - example: 2021-05-31T09:59:59Z - expiry_time: + account_number: type: string - description: "The expiry time of the order in UTC (applies to TWAP, VWAP,\ - \ LIMIT, and STOP_LIMIT orders with `time_in_force` set to `GTD`)" - format: date-time - example: 2021-05-31T10:59:59Z - status: - $ref: '#/components/schemas/coinbase.public_rest_api.OrderStatus' - time_in_force: - $ref: '#/components/schemas/coinbase.public_rest_api.TimeInForceType' - created_at: + bank_code: type: string - description: The order creation time as a UTC timestamp - format: date-time - example: 2021-05-31T10:59:59Z - filled_quantity: + coinbase.public_rest_api.PaymentMethodSummary: + type: object + properties: + id: type: string - description: Size filled (in base asset units) - example: "100" - filled_value: + symbol: type: string - description: Market value filled (in quote asset units) - example: "100" - average_filled_price: + payment_method_type: + $ref: '#/components/schemas/coinbase.public_rest_api.PaymentMethodType' + bank_name: type: string - description: Indicates the average `filled_price` - example: "50.19" - commission: + account_number: type: string - description: Total commission paid on this order (in quote asset units) - -- only applicable for partially- or fully-filled orders - example: "4.99" - exchange_fee: + bank_name_2: type: string - description: Fee charged by the exchange for Cost Plus commission configurations. - Exchange fee will be 0 for All In commission configurations. - example: "2.50" - historical_pov: + coinbase.public_rest_api.PaymentMethodType: + title: Indicates the payment method type + type: string + description: |- + - UNKNOWN_PAYMENT_METHOD_TYPE: nil value + - METHOD_WIRE: Wire transfer + - METHOD_SEN: DEPRECATED. Silvergate exchange network + - METHOD_SWIFT: Swift + - METHOD_SEPA: Single Euro Payments Area + - METHOD_CBIT: Customers Bank Instant Token + - METHOD_PIX: Brazilian instant payment system + - METHOD_JPM_KINEXYS: JPMorgan Kinexys + enum: + - METHOD_WIRE + - METHOD_SEN + - METHOD_SWIFT + - METHOD_SEPA + - METHOD_CBIT + - METHOD_PIX + - METHOD_JPM_KINEXYS + coinbase.public_rest_api.PegOffsetType: + title: Peg offset type for PEG orders + type: string + description: |- + - UNKNOWN_PEG_OFFSET_TYPE: nil value + - PEG_OFFSET_TYPE_PRICE: Offset specified in price units + - PEG_OFFSET_TYPE_BPS: Offset specified in basis points (BPS) + - PEG_OFFSET_TYPE_DEPTH: Offset specified in depth + enum: + - PEG_OFFSET_TYPE_PRICE + - PEG_OFFSET_TYPE_BPS + - PEG_OFFSET_TYPE_DEPTH + coinbase.public_rest_api.PerpetualProductDetails: + title: PerpetualProductDetails contains details specific to perpetual futures + products + type: object + properties: + open_interest: + title: Open interest for the perpetual product type: string - description: historical pov for the order - example: "2.50" - stop_price: + description: Open interest + example: "1000000" + funding_rate: + title: Current funding rate type: string - description: Specifies the stop price at which the order activates. The - order is activated if the last trade price on Coinbase Exchange crosses - the stop price specified on the order - example: "50.12" - net_average_filled_price: + description: Current funding rate + example: "0.0001" + funding_time: + title: Next funding time type: string - description: Indicates the average `filled_price` net of commissions and - fees - example: "57.68" - user_context: + description: Next funding time + format: date-time + max_leverage: + title: Maximum leverage allowed type: string - description: Indicates a user friendly message for regarding various aspects - of the order such as cancellation or rejection reasons - example: User initiated cancellation - client_product_id: + description: Maximum leverage allowed + example: "5" + underlying_type: + title: "Underlying type (e.g. SPOT, INDEX)" type: string - description: The client product ID of the fill indictating the settlment - currency - example: BTC-USDC - post_only: - title: Post-only flag - indicates whether the order was placed as post-only - type: boolean - description: Post-only flag - indicates whether the order was placed as - post-only - example: true - order_edit_history: - title: "deprecated: use edit_history instead" - type: array - description: "The history of order edits (deprecated: use edit_history instead)" - items: - $ref: '#/components/schemas/coinbase.brokerage.proxy.events.materialized.api.LimitOrderEdit' - is_raise_exact: - type: boolean - description: Indicates if this was a raise exact order (size inclusive of - fees for sell orders in quote) - example: true - display_size: + description: The type of underlying for the perpetual product + example: SPOT + coinbase.public_rest_api.Portfolio: + type: object + properties: + id: type: string - description: Display size for the order - example: "10.5" - edit_history: - title: Order Edit History - type: array - description: The history of order edits - example: - - price: "100" - base_quantity: "1" - quote_value: "100" - display_base_size: "1.00" - display_quote_size: "1.00" - stop_price: "120" - expiry_time: 2021-05-31T10:59:59Z - accept_time: 2021-06-20T10:59:59Z - client_order_id: "123" - items: - $ref: '#/components/schemas/coinbase.public_rest_api.OrderEdit' - display_quote_size: + description: The unique ID of the portfolio + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + name: type: string - description: The maximum order size that will show up on venue order books - (in quote currency). - example: "100.50" - display_base_size: + description: The name of the portfolio + example: CryptoBalances + entity_id: type: string - description: The maximum order size that will show up on venue order books - (in base currency). - example: "10.5" - peg_offset_type: - title: PEG order specific fields + description: The ID of the entity to which the portfolio is associated + example: 2c521d6c-1cfb-4371-bf9c-5a42938d3e75 + organization_id: type: string - description: "The peg offset type for PEG orders (PRICE, BASIS_POINTS, or\ - \ CUMULATIVE_DEPTH_IN_BASE_UNITS)" - example: PEG_OFFSET_TYPE_PRICE - offset: + description: The ID of the organization to which the portfolio is associated + example: 4c1d4464-e53b-429f-a81d-71ae7e2e687c + entity_name: type: string - description: The offset value for PEG orders - example: "100" - wig_level: + description: The name of the entity to which the portfolio is associated + example: Sample Prime Entity + coinbase.public_rest_api.PortfolioBalanceType: + title: |- + - UNKNOWN_BALANCE_TYPE: nil + - TRADING_BALANCES: Trading balances + - VAULT_BALANCES: Vault balances + - TOTAL_BALANCES: Total balances (The sum of vault and trading + prime custody) + - PRIME_CUSTODY_BALANCES: Prime custody balances + - UNIFIED_TOTAL_BALANCES: Unified total balance across networks and wallet types (vault + trading + prime custody) + type: string + enum: + - TRADING_BALANCES + - VAULT_BALANCES + - TOTAL_BALANCES + - PRIME_CUSTODY_BALANCES + - UNIFIED_TOTAL_BALANCES + coinbase.public_rest_api.PortfolioStakingInitiateResponse: + type: object + properties: + activity_id: type: string - description: The wig (would if good) level for PEG orders - best price opposite - to limit_price - example: "100000" - product_type: - $ref: '#/components/schemas/coinbase.public_rest_api.ProductType' - commission_detail_total: - $ref: '#/components/schemas/coinbase.public_rest_api.CommissionDetailTotal' - is_buy_exact: - type: boolean - description: Indicates if this was a buy exact order (fees charged on top - of quote size for BUY orders sized in quote) - example: false - coinbase.public_rest_api.OrderEdit: + description: The ID for the created activity + transaction_id: + type: string + description: The ID for the created transaction + coinbase.public_rest_api.PortfolioStakingMetadata: type: object properties: - price: - title: New price for the edited order + external_id: type: string - base_quantity: - title: "New base quantity for the edited order, populated if order is in\ - \ base size" + description: An optional custom identifier (up to 255 bytes) to attach to + the transaction. This is not a searchable transaction field. + coinbase.public_rest_api.PortfolioStakingUnstakeResponse: + type: object + properties: + activity_id: type: string - quote_value: - title: "New quote value for the edited order, populated if order is in quote\ - \ size" + description: The ID for the created activity + transaction_id: type: string - display_base_size: - title: "Display base size for the edited order, populated if order is in\ - \ base size" + description: The ID for the created transaction + coinbase.public_rest_api.PortfolioUser: + type: object + properties: + id: type: string - display_quote_size: - title: "Display quote size for the edited order, populated if order is in\ - \ quote size" + description: The unique ID of the user. + name: type: string - stop_price: - title: New stop price for the edited order + description: The name of the user. + email: type: string - expiry_time: - title: New expiry/end time for the edited order + description: The email of the user. + portfolio_id: type: string - format: date-time - accept_time: - title: Time when the edit was accepted + description: The portfolio to which this user and associated permissions + are identified. + entity_id: + type: string + description: The entity to which this user and associated permissions are + identified. + role: + $ref: '#/components/schemas/coinbase.public_rest_api.UserRole' + roles: + type: array + description: All primary roles assigned to the user. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.UserRole' + secondary_permissions: + type: array + description: All secondary permissions assigned to the user. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.SecondaryPermission' + coinbase.public_rest_api.Position: + type: object + properties: + symbol: + type: string + description: Asset symbol + example: BTC + long: type: string - format: date-time - client_order_id: - title: The new client order identifier that the order adopted after the - replacement was successfully accepted + description: The long position based on 'reference' value + example: "10" + short: type: string - coinbase.public_rest_api.OrderSide: - title: Order side - type: string - description: |- - - UNKNOWN_ORDER_SIDE: nil value - - BUY: Buy order - - SELL: Sell order - enum: - - BUY - - SELL - coinbase.public_rest_api.OrderStatus: - title: Indicates the order status - type: string - description: |- - - UNKNOWN_ORDER_STATUS: nil value - - OPEN: The order is open but unfilled - - FILLED: The order was filled - - CANCELLED: The order was cancelled - - EXPIRED: The order has expired - - FAILED: Order submission failed - - PENDING: The order has been sent but is not yet confirmed - enum: - - OPEN - - FILLED - - CANCELLED - - EXPIRED - - FAILED - - PENDING - coinbase.public_rest_api.OrderType: - title: Strategy (execution algorithm) + description: The short position based on 'reference' value + example: "10" + position_reference: + $ref: '#/components/schemas/coinbase.public_rest_api.PositionReference' + coinbase.public_rest_api.PositionReference: + type: object + properties: + id: + type: string + description: Reference ID + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + type: + $ref: '#/components/schemas/coinbase.public_rest_api.PositionReferenceType' + coinbase.public_rest_api.PositionReferenceType: type: string - description: |- - - UNKNOWN_ORDER_TYPE: nil value - - MARKET: A [market order](https://en.wikipedia.org/wiki/Order_(exchange)#Market_order) - - LIMIT: A [limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Limit_order) - - TWAP: A [time-weighted average price order](https://en.wikipedia.org/wiki/Time-weighted_average_price) - - BLOCK: A [block trade](https://en.wikipedia.org/wiki/Block_trade) - - VWAP: A [volume-weighted average price order](https://en.wikipedia.org/wiki/Volume-weighted_average_price) - - STOP_LIMIT: A [conditional order combined of stop order and limit order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - - RFQ: A [request for quote](https://en.wikipedia.org/wiki/Request_for_quote) - - PEG: A pegged order that dynamically adjust based on market conditions while maintaining execution discretion and avoiding adverse selection enum: - - MARKET - - LIMIT - - TWAP - - BLOCK - - VWAP - - STOP_LIMIT - - RFQ - - PEG - coinbase.public_rest_api.PMAssetInfo: + - ENTITY + - PORTFOLIO + coinbase.public_rest_api.PostOrderPreviewResponse: type: object properties: - symbol: + portfolio_id: type: string - description: The currency symbol - amount: + description: The ID of the portfolio that owns the order + example: 3e1fe27e-26fe-46d8-b118-c752a2ae6b47 + product_id: type: string - description: Nominal amount of the currency - price: + description: The ID of the product being traded by the order + example: BTC-USD + side: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' + type: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderType' + base_quantity: type: string - description: Spot price for the currency - notional_amount: + description: Order size in base asset units (either `base_quantity` or `quote_value` + is required) + example: "50" + quote_value: type: string - description: Notional amount of the currency - asset_tier: + description: "Order size in quote asset units, i.e. the amount the user\ + \ wants to spend (when buying) or receive (when selling); the quantity\ + \ in base units will be determined based on the market liquidity and indicated\ + \ `quote_value`. Either `base_quantity` or `quote_value` is required" + example: "100" + limit_price: type: string - description: Asset tier of the currency - margin_eligible: - type: boolean - description: Whether the currency is margin eligible - base_margin_requirement: + description: "The limit price (required for TWAP, VWAP, LIMIT, and STOP_LIMIT\ + \ orders)" + example: "50.12" + start_time: type: string - description: Base margin requirement of the currency - base_margin_requirement_notional: + description: The start time of the order in UTC (only applies to TWAP orders.) + format: date-time + example: 2021-05-31T09:59:59Z + expiry_time: type: string - description: Notional amount of the currency's base margin requirement - adv_30d: + description: "The expiry time of the order in UTC (TWAP, VWAP, LIMIT and\ + \ STOP_LIMIT GTD only). Required for TWAP and VWAP orders if historical_pov\ + \ is unspecified" + format: date-time + example: 2021-05-31T10:59:59Z + time_in_force: + $ref: '#/components/schemas/coinbase.public_rest_api.TimeInForceType' + commission: type: string - description: The 30d adv of the currency - hist_5d_vol: + description: Indicate the total commission paid on this order in quote currency + - only applicable if the order has any fills + example: "4.99" + slippage: type: string - description: Historic 5d volatility of the currency - hist_30d_vol: + description: How much slippage is expected + example: "0.05" + best_bid: type: string - description: Historic 30d volatility of the currency - hist_90d_vol: + description: Current best bid for order book + example: "10" + best_ask: type: string - description: Historic 90d volatility of the currency - volatility_addon: + description: Current best ask for order book + example: "10" + average_filled_price: type: string - description: Volatility margin addon of the currency position - liquidity_addon: + description: Indicate expected average filled price based on the current + order book + example: "50.19" + order_total: type: string - description: Liquidity margin addon of the currency position - total_position_margin: + description: Order quantity + fees + example: "123" + historical_pov: type: string - description: Total position margin of the currency - short_nominal: + description: "The estimated participation rate for a TWAP/VWAP order. This\ + \ field can be specified instead of expiry time, and will be used to compute\ + \ the expiry time of the order based on historical participation rate." + example: "0.5" + is_raise_exact: + type: boolean + description: Raise Exact order flag + example: false + stop_price: type: string - description: Nominal short position of the currency - long_nominal: + description: Stop price for the order + example: "50000.00" + display_size: type: string - description: Nominal long position of the currency - coinbase.public_rest_api.PaginatedResponse: - required: - - has_next - - next_cursor - - sort_direction - type: object - properties: - next_cursor: + description: The maximum order size that will show up on venue order books. + example: "10.5" + display_quote_size: type: string - description: Cursor to navigate to next page - sort_direction: - $ref: '#/components/schemas/coinbase.public_rest_api.SortDirection' - has_next: + description: The maximum order size that will show up on venue order books + (in quote currency). + example: "100.50" + display_base_size: + type: string + description: The maximum order size that will show up on venue order books + (in base currency). + example: "10.5" + is_buy_exact: type: boolean - description: A boolean value indicating whether there are more items to - paginate through - coinbase.public_rest_api.PaymentMethodDestination: + description: Buy Exact order flag + example: false + option_greeks: + $ref: '#/components/schemas/coinbase.public_rest_api.OptionGreeks' + spread_preview: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadPreview' + current_margin_utilization: + type: string + description: "Futures and SPREAD orders only: amount of the portfolio's\ + \ derivatives margin limit used before this order. For cross-margin portfolios,\ + \ the cross-margin limit consumed." + example: "12000.00" + current_margin_utilization_ratio: + type: string + description: "Futures and SPREAD orders only: `current_margin_utilization`\ + \ as a percentage of the margin limit (0-100, e.g. \"1.2\" means 1.2%,\ + \ not a 0-1 decimal)" + example: "1.2" + projected_margin_utilization: + type: string + description: "Futures and SPREAD orders only: amount of the portfolio's\ + \ derivatives margin limit used if this order fills. For cross-margin\ + \ portfolios, the cross-margin limit consumed." + example: "36480.00" + projected_margin_utilization_ratio: + type: string + description: "Futures and SPREAD orders only: `projected_margin_utilization`\ + \ as a percentage of the margin limit (0-100, e.g. \"3.6\" means 3.6%,\ + \ not a 0-1 decimal)" + example: "3.6" + settl_currency: + type: string + description: "The requested `settl_currency`, echoed" + example: USDC + coinbase.public_rest_api.PostTradeCreditInformation: type: object properties: - payment_method_id: - title: The payment method id to pay out + portfolio_id: type: string - coinbase.public_rest_api.PaymentMethodDetails: - type: object - properties: - id: + description: The unique ID of the portfolio + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + currency: type: string - symbol: + description: The currency symbol credit is denoted in + example: USD + limit: type: string - payment_method_type: - $ref: '#/components/schemas/coinbase.public_rest_api.PaymentMethodType' - name: + description: The maximum credit limit + example: "100000" + utilized: type: string - account_number: + description: The amount of credit used + example: "4000" + available: type: string - bank_code: + description: The amount of credit available + example: "96000" + frozen: + type: boolean + description: Whether or not a portfolio is frozen due to balance outstanding + or other reason + example: true + frozen_reason: + type: string + description: The reason why the portfolio is frozen + example: Portfolio frozen manually by admin + amounts_due: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.AmountDue' + enabled: + type: boolean + description: Whether the portfolio has credit enabled + example: true + adjusted_credit_utilized: + type: string + description: The amount of adjusted credit used + example: "5000" + adjusted_portfolio_equity: type: string - coinbase.public_rest_api.PaymentMethodSummary: + description: The amount of adjusted portfolio equity + example: "2000" + coinbase.public_rest_api.PreviewUnstakeResponse: + required: + - estimated_amount type: object properties: - id: + estimated_amount: type: string - symbol: + description: Estimated amount that would be unstaked + wallet_id: type: string - payment_method_type: - $ref: '#/components/schemas/coinbase.public_rest_api.PaymentMethodType' - bank_name: + description: The wallet ID + wallet_address: type: string - account_number: + description: The blockchain address of the wallet + current_timestamp: type: string - bank_name_2: + description: Timestamp at which this preview was generated (ISO 8601) + validators: + type: array + description: Per-validator breakdown of the unstake simulation + items: + $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorUnstakePreview' + description: PreviewUnstakeResponse contains the response data from previewing + an unstaking operation. + coinbase.public_rest_api.PriceIncrementStep: + type: object + properties: + price_threshold: + title: Prices strictly greater than this threshold use this step's price + increment type: string - coinbase.public_rest_api.PaymentMethodType: - title: Indicates the payment method type - type: string + description: Prices strictly greater than this threshold use this step's + price increment; a price equal to it takes the next lower step + example: "0.005" + price_increment: + title: Minimum price increment applied above the threshold + type: string + description: Minimum price increment applied to prices above the threshold + example: "0.0005" description: |- - - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - - METHOD_WIRE: Wire transfer - - METHOD_SEN: Silvergate exchange network - - METHOD_SWIFT: Swift - enum: - - METHOD_WIRE - - METHOD_SEN - - METHOD_SWIFT - coinbase.public_rest_api.PegOffsetType: - title: Peg offset type for PEG orders + PriceIncrementStep overrides the product's price_increment for prices above a + threshold. A price takes the increment of the highest step whose threshold it + strictly exceeds, and the product's price_increment when it exceeds none. + coinbase.public_rest_api.PrimeXMAssetClass: type: string description: |- - - UNKNOWN_PEG_OFFSET_TYPE: nil value - - PEG_OFFSET_TYPE_PRICE: Offset specified in price units - - PEG_OFFSET_TYPE_BPS: Offset specified in basis points (BPS) - - PEG_OFFSET_TYPE_DEPTH: Offset specified in depth + Asset class of the XM position underlier. + + - PRIME_XM_ASSET_CLASS_UNSPECIFIED: The asset class is unavailable for this position, or is not recognized by this API version. + - PRIME_XM_ASSET_CLASS_CASH: USD and USDC. + - PRIME_XM_ASSET_CLASS_FX: Non-USD fiat currencies recognized as FX in the margin model, such as EUR, GBP, and CHF. + - PRIME_XM_ASSET_CLASS_STABLECOIN: Non-USDC stablecoins recognized as cash equivalents in the margin model, such as EURC and USDT. + - PRIME_XM_ASSET_CLASS_CRYPTO: Crypto assets (e.g. BTC, ETH). + enum: + - PRIME_XM_ASSET_CLASS_UNSPECIFIED + - PRIME_XM_ASSET_CLASS_CASH + - PRIME_XM_ASSET_CLASS_FX + - PRIME_XM_ASSET_CLASS_STABLECOIN + - PRIME_XM_ASSET_CLASS_CRYPTO + coinbase.public_rest_api.PrimeXMHealthStatus: + type: string + description: |2- + - HEALTH_STATUS_HEALTHY: Margin level is healthy. + - HEALTH_STATUS_WARNING: Margin level is breaching the warning threshold (WT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call (as defined in the margin methodology). WT is differentiated from DT in that it means margin health is approaching the UMCT. + - HEALTH_STATUS_CRITICAL: Margin level is breaching the UMCT and, as defined in the margin methodology, this will trigger an urgent margin call. + - HEALTH_STATUS_SUSPENDED: Trading and withdrawals are suspended per XM margin methodology. + - HEALTH_STATUS_RESTRICTED: Account is in a restricted state per XM margin methodology. + - HEALTH_STATUS_PRE_LIQUIDATION: Margin level is breaching the liquidation threshold (LT) and, as defined in the margin methodology, this will trigger the SESSION_LOCKED control status and liquidation may commence. + - HEALTH_STATUS_LIQUIDATING: Liquidation has commenced. + - HEALTH_STATUS_IN_DEFICIT: Margin level is breaching the deficit threshold (DT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call time (as defined in the margin methodology). enum: - - PEG_OFFSET_TYPE_PRICE - - PEG_OFFSET_TYPE_BPS - - PEG_OFFSET_TYPE_DEPTH - coinbase.public_rest_api.PerpetualProductDetails: - title: PerpetualProductDetails contains details specific to perpetual futures - products + - HEALTH_STATUS_HEALTHY + - HEALTH_STATUS_WARNING + - HEALTH_STATUS_CRITICAL + - HEALTH_STATUS_SUSPENDED + - HEALTH_STATUS_RESTRICTED + - HEALTH_STATUS_PRE_LIQUIDATION + - HEALTH_STATUS_LIQUIDATING + - HEALTH_STATUS_IN_DEFICIT + coinbase.public_rest_api.PrimeXMMarginCallThresholds: type: object properties: - open_interest: - title: Open interest for the perpetual product - type: string - description: Open interest - example: "1000000" - funding_rate: - title: Current funding rate + deficit_threshold: type: string - description: Current funding rate - example: "0.0001" - funding_time: - title: Next funding time + description: Deficit threshold (DT). + example: "0.8" + warning_threshold: type: string - description: Next funding time - format: date-time - max_leverage: - title: Maximum leverage allowed + description: Warning threshold (WT). + example: "0.8" + critical_threshold: type: string - description: Maximum leverage allowed - example: "5" - underlying_type: - title: "Underlying type (e.g. SPOT, INDEX)" + description: Urgent margin call threshold (UMCT). + example: "1.0" + liquidation_threshold: type: string - description: The type of underlying for the perpetual product - example: SPOT - coinbase.public_rest_api.Portfolio: + description: Liquidation threshold (LT). + example: "1.5" + margin_thresholds: + type: array + description: Structured margin thresholds by margin level. + items: + $ref: '#/components/schemas/coinbase.public_rest_api.PrimeXMMarginThreshold' + coinbase.public_rest_api.PrimeXMMarginRequirementBreakdown: type: object properties: - id: + base_margin: type: string - description: The unique ID of the portfolio - example: e8bbed13-fa33-41de-86d5-4335d8f08166 - name: + description: Base margin requirement component. + example: "30188.41" + volatility_addon: type: string - description: The name of the portfolio - example: CryptoBalances - entity_id: + description: Volatility add-on component. + example: "0.00" + liquidity_addon: type: string - description: The ID of the entity to which the portfolio is associated - example: 2c521d6c-1cfb-4371-bf9c-5a42938d3e75 - organization_id: + description: Liquidity add-on component. + example: "0.49" + offset_credit: type: string - description: The ID of the organization to which the portfolio is associated - example: 4c1d4464-e53b-429f-a81d-71ae7e2e687c - entity_name: + description: Credits that offset margin charges due to portfolio composition. + example: "-20.29" + futures_margin: type: string - description: The name of the entity to which the portfolio is associated - example: Sample Prime Entity - coinbase.public_rest_api.PortfolioBalanceType: - title: |- - - UNKNOWN_BALANCE_TYPE: nil - - TRADING_BALANCES: Trading balances - - VAULT_BALANCES: Vault balances - - TOTAL_BALANCES: Total balances (The sum of vault and trading + prime custody) - - PRIME_CUSTODY_BALANCES: Prime custody balances - - UNIFIED_TOTAL_BALANCES: Unified total balance across networks and wallet types (vault + trading + prime custody) + description: Futures margin charge applied for any futures trades of the + opposing direction but of the same underlying. + example: "0.00" + coinbase.public_rest_api.PrimeXMMarginRequirementType: type: string + description: |2- + - MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR: Integrated (netted) cross-margin requirement for spot assets and all derivatives contracts. + - MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMR: Combined cross-margin requirement: Integrated Portfolio Margin (IPMR) plus Ineligible Futures Margin (IFMR). enum: - - TRADING_BALANCES - - VAULT_BALANCES - - TOTAL_BALANCES - - PRIME_CUSTODY_BALANCES - - UNIFIED_TOTAL_BALANCES - coinbase.public_rest_api.PortfolioStakingInitiateResponse: - type: object - properties: - activity_id: - type: string - description: The ID for the created activity - transaction_id: - type: string - description: The ID for the created transaction - coinbase.public_rest_api.PortfolioStakingMetadata: - type: object - properties: - external_id: - type: string - description: An optional custom identifier (up to 255 characters) to attach - to the transaction. This is not a searchable transaction field. - coinbase.public_rest_api.PortfolioStakingUnstakeResponse: + - MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR + - MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMR + coinbase.public_rest_api.PrimeXMMarginThreshold: type: object properties: - activity_id: - type: string - description: The ID for the created activity - transaction_id: + margin_level: + $ref: '#/components/schemas/coinbase.public_rest_api.XMMarginLevel' + threshold_type: + $ref: '#/components/schemas/coinbase.public_rest_api.PrimeXMMarginThresholdType' + threshold_value: type: string - description: The ID for the created transaction - coinbase.public_rest_api.PortfolioUser: + example: "0.8" + coinbase.public_rest_api.PrimeXMMarginThresholdType: + type: string + description: |2- + - MARGIN_THRESHOLD_EQUITY_RATIO: Threshold based on equity ratio EQ / MR; triggers when EQ / MR >= threshold_value. + - MARGIN_THRESHOLD_DEFICIT_RATIO: Threshold based on deficit ratio (MR - EQ) / XMML; triggers when (MR - EQ) / XMML > threshold_value. + enum: + - MARGIN_THRESHOLD_EQUITY_RATIO + - MARGIN_THRESHOLD_DEFICIT_RATIO + - MARGIN_THRESHOLD_NONE + coinbase.public_rest_api.PrimeXMOffsetCreditBreakdown: type: object properties: - id: - type: string - description: The unique ID of the user. - name: - type: string - description: The name of the user. - email: + basis_credit: type: string - description: The email of the user. - portfolio_id: + description: Basis offset credit component. + example: "0" + long_short_credit: type: string - description: The portfolio to which this user and associated permissions - are identified. - entity_id: + description: Long/short tier-pair offset credit. + example: "0" + long_long_credit: type: string - description: The entity to which this user and associated permissions are - identified. - role: - $ref: '#/components/schemas/coinbase.public_rest_api.UserRole' - roles: - type: array - description: All primary roles assigned to the user. - items: - $ref: '#/components/schemas/coinbase.public_rest_api.UserRole' - secondary_permissions: - type: array - description: All secondary permissions assigned to the user. - items: - $ref: '#/components/schemas/coinbase.public_rest_api.SecondaryPermission' - coinbase.public_rest_api.Position: - type: object - properties: - symbol: + description: Long/long tier-pair offset credit. + example: "-1.15" + short_short_credit: type: string - description: Asset symbol - example: BTC - long: + description: Short/short tier-pair offset credit. + example: "0" + same_tier_credit: type: string - description: The long position based on 'reference' value - example: "10" - short: + description: Same-tier offset credit. + example: "-19.13" + total_credit: type: string - description: The short position based on 'reference' value - example: "10" - position_reference: - $ref: '#/components/schemas/coinbase.public_rest_api.PositionReference' - coinbase.public_rest_api.PositionReference: + description: Total offset credit. + example: "-20.29" + coinbase.public_rest_api.ProcessRequirements: + title: Represents the status of various process requirements for a transaction type: object properties: - id: - type: string - description: Reference ID - example: e8bbed13-fa33-41de-86d5-4335d8f08166 - type: - $ref: '#/components/schemas/coinbase.public_rest_api.PositionReferenceType' - coinbase.public_rest_api.PositionReferenceType: - type: string - enum: - - ENTITY - - PORTFOLIO - coinbase.public_rest_api.PostOrderPreviewResponse: + travel_rule_status: + $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleStatus' + coinbase.public_rest_api.Product: type: object properties: - portfolio_id: - type: string - description: The ID of the portfolio that owns the order - example: 3e1fe27e-26fe-46d8-b118-c752a2ae6b47 - product_id: + id: type: string - description: The ID of the product being traded by the order + description: "The product ID, written as `BASE-QUOTE`" example: BTC-USD - side: - $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' - type: - $ref: '#/components/schemas/coinbase.public_rest_api.OrderType' - base_quantity: + base_increment: type: string - description: Order size in base asset units (either `base_quantity` or `quote_value` - is required) - example: "50" - quote_value: + description: The smallest permitted unit of denomination for the base asset + (varies by product) + example: "1" + quote_increment: type: string - description: "Order size in quote asset units, i.e. the amount the user\ - \ wants to spend (when buying) or receive (when selling); the quantity\ - \ in base units will be determined based on the market liquidity and indicated\ - \ `quote_value`. Either `base_quantity` or `quote_value` is required" - example: "100" - limit_price: + description: The smallest permitted unit of denomination for the quote asset + (varies by product) + example: "1" + base_min_size: type: string - description: "The limit price (required for TWAP, VWAP, LIMIT, and STOP_LIMIT\ - \ orders)" - example: "50.12" - start_time: + description: The minimum size (in base asset units) for which an order can + be placed + example: "100" + quote_min_size: type: string - description: The start time of the order in UTC (only applies to TWAP orders.) - format: date-time - example: 2021-05-31T09:59:59Z - expiry_time: + description: The minimum size (in quote asset units) for which an order + can be placed + example: "100" + base_max_size: type: string - description: "The expiry time of the order in UTC (TWAP, VWAP, LIMIT and\ - \ STOP_LIMIT GTD only). Required for TWAP and VWAP orders if historical_pov\ - \ is unspecified" - format: date-time - example: 2021-05-31T10:59:59Z - time_in_force: - $ref: '#/components/schemas/coinbase.public_rest_api.TimeInForceType' - commission: + description: The maximum size (in base asset units) for which an order can + be placed + example: "1000" + quote_max_size: type: string - description: Indicate the total commission paid on this order in quote currency - - only applicable if the order has any fills - example: "4.99" - slippage: + description: The maximum size (in quote asset units) for which an order + can be placed + example: "1000" + permissions: + title: Permissions for the product based on portfolio + type: array + description: Permissions given to the user for a product + example: PRODUCT_PERMISSION_READ + items: + $ref: '#/components/schemas/coinbase.public_rest_api.ProductPermissions' + price_increment: type: string - description: How much slippage is expected - example: "0.05" - best_bid: + description: The smallest permitted price increment for the product + example: "0.01" + rfq_product_details: + $ref: '#/components/schemas/coinbase.public_rest_api.RFQProductDetails' + product_type: + $ref: '#/components/schemas/coinbase.public_rest_api.ProductType' + fcm_trading_session_details: + $ref: '#/components/schemas/coinbase.public_rest_api.FcmTradingSessionDetails' + future_product_details: + $ref: '#/components/schemas/coinbase.public_rest_api.FutureProductDetails' + option_product_details: + $ref: '#/components/schemas/coinbase.public_rest_api.OptionProductDetails' + coinbase.public_rest_api.ProductPermissions: + type: string + enum: + - PRODUCT_PERMISSION_READ + - PRODUCT_PERMISSION_TRADE + - PRODUCT_PERMISSION_LENDING + coinbase.public_rest_api.ProductType: + title: ProductType represents the general type of product + type: string + description: |- + - UNKNOWN_PRODUCT_TYPE: Unknown product type + - SPOT: Spot product + - FUTURE: Future product + - OPTION: Option product + - BASIS: Basis product: a futures contract traded against its spot underlying, or against another futures contract of the same underlying (calendar spread); the product of SPREAD orders + enum: + - SPOT + - FUTURE + - OPTION + - BASIS + coinbase.public_rest_api.QuoteResponse: + title: Copied from https://github.cbhq.net/institutional/trading/blob/3e6da61aceb64c7cbe6f0c0f8fbdb98fd3e868dc/proxy/trading/protos/coinbase/brokerage/proxy/trading/api/orderentry.proto#L366-L370 + type: object + properties: + quote_id: type: string - description: Current best bid for order book - example: "10" - best_ask: + expiration_time: type: string - description: Current best ask for order book - example: "10" - average_filled_price: + format: date-time + best_price: type: string - description: Indicate expected average filled price based on the current - order book - example: "50.19" order_total: + title: total quote amount for previewing type: string - description: Order quantity + fees - example: "123" - historical_pov: + price_inclusive_of_fees: type: string - description: "The estimated participation rate for a TWAP/VWAP order. This\ - \ field can be specified instead of expiry time, and will be used to compute\ - \ the expiry time of the order based on historical participation rate." - example: "0.5" - is_raise_exact: + quote_duration_ms: + type: string + description: "Echo of the quote_duration_ms supplied in the request. 0 if\ + \ the client did not supply a value, in which case the server applies\ + \ the default of 3000 ms (3 seconds)." + format: int64 + example: "5000" + is_buy_exact: type: boolean - description: Raise Exact order flag + description: Buy Exact order flag example: false - stop_price: + coinbase.public_rest_api.RFQProductDetails: + type: object + properties: + tradable: + type: boolean + description: Whether the product is tradable via RFQ + min_notional_size: type: string - description: Stop price for the order - example: "50000.00" - display_size: + description: "Deprecated: Value will be an empty string" + max_notional_size: type: string - description: The maximum order size that will show up on venue order books. - example: "10.5" - display_quote_size: + description: "Deprecated: Value will be an empty string" + min_base_size: type: string - description: The maximum order size that will show up on venue order books - (in quote currency). - example: "100.50" - display_base_size: + description: Minimum base size for RFQ + max_base_size: type: string - description: The maximum order size that will show up on venue order books - (in base currency). - example: "10.5" - is_buy_exact: + description: Maximum base size for RFQ + min_quote_size: + type: string + description: Minimum quote size for RFQ + max_quote_size: + type: string + description: Maximum quote size for RFQ + coinbase.public_rest_api.RateType: + type: string + enum: + - BPS + - APR_360 + - APR_365 + - APR + coinbase.public_rest_api.RewardMetadata: + type: object + properties: + subtype: + $ref: '#/components/schemas/coinbase.public_rest_api.RewardSubtype' + custom_stablecoin_reward_details: + $ref: '#/components/schemas/coinbase.public_rest_api.CustomStablecoinRewardDetails' + coinbase.public_rest_api.RewardSubtype: + title: Indicates the reward subtype + type: string + description: |- + - REWARD_SUBTYPE_UNKNOWN: An unknown reward subtype, reward subtype may not be supported in the API response yet + - MEV_REWARD: A maximal extractable value reward + i.e. sol mev rewards + - INFLATION_REWARD: An inflationary reward + i.e. solana inflationary rewards + - BLOCK_REWARD: A block reward + i.e. solana block rewards + - VALIDATOR_REWARD: A validator reward + i.e. ethereum validator (consensus layer) rewards + - TRANSACTION_REWARD: A transaction reward + i.e. ethereum transaction (execution layer) rewards + - STAKING_FEE_REBATE_REWARD: A staking fee rebate reward + i.e. coinbase pays rebates for staking fees to eligible delegators + - BUIDL_DIVIDEND: A BUIDL dividend reward + i.e. dividends from BUIDL fund holdings + - CUSTOM_STABLECOIN_REWARD: A custom stablecoin reward + i.e. USDC reward payouts + - TRADING_FEE_REBATE_REWARD: A trading fee rebate reward + i.e. USDC trading-fee rebates paid by Coinbase + enum: + - MEV_REWARD + - INFLATION_REWARD + - BLOCK_REWARD + - VALIDATOR_REWARD + - TRANSACTION_REWARD + - STAKING_FEE_REBATE_REWARD + - BUIDL_DIVIDEND + - CUSTOM_STABLECOIN_REWARD + - TRADING_FEE_REBATE_REWARD + coinbase.public_rest_api.RiskAssessment: + title: New message for risk assessment details + type: object + properties: + compliance_risk_detected: type: boolean - description: Buy Exact order flag + description: Indicates if the transaction has been flagged for compliance + concerns example: false - coinbase.public_rest_api.PostTradeCreditInformation: + security_risk_detected: + type: boolean + description: Indicates if the transaction has been flagged for security + concerns + example: false + coinbase.public_rest_api.RiskManagementType: + title: RiskManagementType represents how risk is managed for a product + type: string + description: |- + - RISK_MANAGEMENT_TYPE_UNSPECIFIED: Unspecified risk management type + - RISK_MANAGEMENT_TYPE_MANAGED_BY_FCM: Risk is managed by FCM (Futures Commission Merchant) + - RISK_MANAGEMENT_TYPE_MANAGED_BY_VENUE: Risk is managed by the venue + enum: + - RISK_MANAGEMENT_TYPE_MANAGED_BY_FCM + - RISK_MANAGEMENT_TYPE_MANAGED_BY_VENUE + coinbase.public_rest_api.RotateAPIKeyRequest: type: object properties: - portfolio_id: - type: string - description: The unique ID of the portfolio - example: e8bbed13-fa33-41de-86d5-4335d8f08166 - currency: - type: string - description: The currency symbol credit is denoted in - example: USD - limit: - type: string - description: The maximum credit limit - example: "100000" - utilized: + duration_seconds: + type: integer + description: "How long the old key remains active after the new key is approved,\ + \ in seconds. Set to 0 for immediate expiry on approval. Cannot extend\ + \ beyond the original key's expiry." + format: int64 + example: 3600 + coinbase.public_rest_api.RotateAPIKeyResponse: + type: object + properties: + encrypted_credentials: type: string - description: The amount of credit used - example: "4000" - available: + description: Base64-encoded encrypted payload containing the new API key + credentials. Decrypt using your current secret_key with HKDF-SHA256 + + AES-256-GCM. + activity_id: type: string - description: The amount of credit available - example: "96000" - frozen: + description: The Prime activity ID tracking the consensus approval for this + rotation. Use with the Activities endpoints to monitor approval status. + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + coinbase.public_rest_api.RpcConfig: + type: object + properties: + skip_broadcast: type: boolean - description: Whether or not a portfolio is frozen due to balance outstanding - or other reason - example: true - frozen_reason: + description: "If true, transaction will not be broadcast to the network" + example: false + url: type: string - description: The reason why the portfolio is frozen - example: Portfolio frozen manually by admin - amounts_due: - type: array - items: - $ref: '#/components/schemas/coinbase.public_rest_api.AmountDue' - enabled: + description: Custom blockchain node RPC URL. (EVM-only) + example: https://rpc.flashbots.net/fast + coinbase.public_rest_api.ScheduleFuturesSweepResponse: + type: object + properties: + success: type: boolean - description: Whether the portfolio has credit enabled + description: Success example: true - adjusted_credit_utilized: - type: string - description: The amount of adjusted credit used - example: "5000" - adjusted_portfolio_equity: + request_id: type: string - description: The amount of adjusted portfolio equity - example: "2000" - coinbase.public_rest_api.PreviewUnstakeResponse: - required: - - estimated_amount + description: Request ID + example: 00000000-0000-0000-0000-000000000000 + coinbase.public_rest_api.SecondaryPermission: + title: Indicates the user's secondary permission + type: string + description: |- + - SECONDARY_PERMISSION_UNKNOWN: nil value + - VIDEO_APPROVER: A video approver + - TEAM_APPROVER: A team approver + - WEB3_SIGNER: A web3/onchain signer + enum: + - VIDEO_APPROVER + - TEAM_APPROVER + - WEB3_SIGNER + coinbase.public_rest_api.SetAutoSweepResponse: type: object properties: - estimated_amount: - type: string - description: Estimated amount that would be unstaked - wallet_id: - type: string - description: The wallet ID - wallet_address: - type: string - description: The blockchain address of the wallet - current_timestamp: - type: string - description: Timestamp at which this preview was generated (ISO 8601) - validators: - type: array - description: Per-validator breakdown of the unstake simulation - items: - $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorUnstakePreview' - description: PreviewUnstakeResponse contains the response data from previewing - an unstaking operation. - coinbase.public_rest_api.PriceIncrementStep: + success: + type: boolean + description: Success + example: true + coinbase.public_rest_api.SetFcmSettingsResponse: type: object properties: - price_threshold: - title: Prices strictly greater than this threshold use this step's price - increment - type: string - description: Prices strictly greater than this threshold use this step's - price increment; a price equal to it takes the next lower step - example: "0.005" - price_increment: - title: Minimum price increment applied above the threshold - type: string - description: Minimum price increment applied to prices above the threshold - example: "0.0005" + success: + type: boolean + description: Success + example: true + coinbase.public_rest_api.SettlementModel: + title: SettlementModel represents the currency a derivative contract settles + in + type: string description: |- - PriceIncrementStep overrides the product's price_increment for prices above a - threshold. A price takes the increment of the highest step whose threshold it - strictly exceeds, and the product's price_increment when it exceeds none. - coinbase.public_rest_api.PrimeXMHealthStatus: + - SETTLEMENT_MODEL_UNSPECIFIED: Unspecified settlement model + - SETTLEMENT_MODEL_LINEAR: Settles in the quote currency + - SETTLEMENT_MODEL_INVERSE: Settles in the base currency + enum: + - SETTLEMENT_MODEL_LINEAR + - SETTLEMENT_MODEL_INVERSE + coinbase.public_rest_api.SettlementPeriod: + title: SettlementPeriod represents how often a derivative contract expires and + settles type: string - description: |2- - - HEALTH_STATUS_HEALTHY: Margin level is healthy. - - HEALTH_STATUS_WARNING: Margin level is breaching the warning threshold (WT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call (as defined in the margin methodology). WT is differentiated from DT in that it means margin health is approaching the UMCT. - - HEALTH_STATUS_CRITICAL: Margin level is breaching the UMCT and, as defined in the margin methodology, this will trigger an urgent margin call. - - HEALTH_STATUS_SUSPENDED: Trading and withdrawals are suspended per XM margin methodology. - - HEALTH_STATUS_RESTRICTED: Account is in a restricted state per XM margin methodology. - - HEALTH_STATUS_PRE_LIQUIDATION: Margin level is breaching the liquidation threshold (LT) and, as defined in the margin methodology, this will trigger the SESSION_LOCKED control status and liquidation may commence. - - HEALTH_STATUS_LIQUIDATING: Liquidation has commenced. - - HEALTH_STATUS_IN_DEFICIT: Margin level is breaching the deficit threshold (DT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call time (as defined in the margin methodology). + description: |- + - SETTLEMENT_PERIOD_UNSPECIFIED: Unspecified settlement period + - SETTLEMENT_PERIOD_PERPETUAL: Contract never expires + - SETTLEMENT_PERIOD_DAY: Contract expires daily + - SETTLEMENT_PERIOD_WEEK: Contract expires weekly + - SETTLEMENT_PERIOD_MONTH: Contract expires monthly enum: - - HEALTH_STATUS_HEALTHY - - HEALTH_STATUS_WARNING - - HEALTH_STATUS_CRITICAL - - HEALTH_STATUS_SUSPENDED - - HEALTH_STATUS_RESTRICTED - - HEALTH_STATUS_PRE_LIQUIDATION - - HEALTH_STATUS_LIQUIDATING - - HEALTH_STATUS_IN_DEFICIT - coinbase.public_rest_api.PrimeXMMarginCallThresholds: + - SETTLEMENT_PERIOD_PERPETUAL + - SETTLEMENT_PERIOD_DAY + - SETTLEMENT_PERIOD_WEEK + - SETTLEMENT_PERIOD_MONTH + coinbase.public_rest_api.ShortCollateral: type: object properties: - deficit_threshold: + old_balance: type: string - description: Deficit threshold (DT). - example: "0.8" - warning_threshold: + description: Existing short collateral balance + example: "1000" + new_balance: type: string - description: Warning threshold (WT). - example: "0.8" - critical_threshold: + description: New short collateral balance required + example: "1000" + loan_interest_rate: type: string - description: Urgent margin call threshold (UMCT). - example: "1.0" - liquidation_threshold: + description: Loan interest rate + example: "0.1" + collateral_interest_rate: type: string - description: Liquidation threshold (LT). - example: "1.5" - margin_thresholds: - type: array - description: Structured margin thresholds by margin level. - items: - $ref: '#/components/schemas/coinbase.public_rest_api.PrimeXMMarginThreshold' - coinbase.public_rest_api.PrimeXMMarginRequirementBreakdown: + description: Collateral interest rate + example: "0.1" + coinbase.public_rest_api.SigningStatus: + title: |- + - SIGNING_STATUS_UNKNOWN: Unknown signing status + - SIGNED: Transaction has been signed + - UNSIGNED: Transaction is unsigned + type: string + enum: + - SIGNED + - UNSIGNED + coinbase.public_rest_api.SortDirection: + type: string + default: DESC + enum: + - DESC + - ASC + coinbase.public_rest_api.SpreadConfig: + title: Configuration of a SPREAD order + type: object + properties: + limit: + type: string + description: |- + Worst acceptable spread (futures - spot), signed decimal. A buy-futures spread executes + when the spread is at or below the limit, a sell-futures spread when it is at or above. + limit_type: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadLimitType' + max_delta_size: + title: "Maximum allowed difference between the filled sizes of the two legs,\ + \ in the unit given by `max_delta_type`" + type: string + max_delta_type: + $ref: '#/components/schemas/coinbase.public_rest_api.MaxDeltaType' + primary_leg: + $ref: '#/components/schemas/coinbase.public_rest_api.Leg' + secondary_leg: + $ref: '#/components/schemas/coinbase.public_rest_api.Leg' + description: "`primary_leg`: its product_id must equal the order's `product_id`,\ + \ and `base_quantity` is in its units. For a calendar spread (two futures)\ + \ it must be the back month." + coinbase.public_rest_api.SpreadDetails: + title: "A SPREAD order as placed and executed: the spread configuration, the\ + \ spread product and each leg's fills" type: object properties: - base_margin: + limit: + title: "The spread limit the order was placed with, see `SpreadConfig.limit`" + type: string + limit_type: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadLimitType' + max_delta_size: + title: "The max delta size the order was placed with, see `SpreadConfig.max_delta_size`" + type: string + max_delta_type: + $ref: '#/components/schemas/coinbase.public_rest_api.MaxDeltaType' + group_product_id: + title: "Product ID of the spread product the order is placed on, in the\ + \ form : (back month:front month\ + \ for a futures-futures spread), e.g. BIP-20DEC30-CDE:BTC-USD" + type: string + realized_spread: + title: "Realized spread of the fills so far, in the unit of `limit_type`:\ + \ for SPREAD_LIMIT_TYPE_USD the futures leg's average filled price minus\ + \ the spot leg's, in the quote currency; for SPREAD_LIMIT_TYPE_BPS that\ + \ difference in basis points of the spot leg's average filled price ((futures\ + \ / spot - 1) x 10000). For a futures-futures spread, back month in place\ + \ of futures and front month in place of spot. Empty until both legs have\ + \ fills" + type: string + primary_leg: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadLegDetails' + secondary_leg: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadLegDetails' + coinbase.public_rest_api.SpreadLegDetails: + title: One leg of a SPREAD order as placed and executed + type: object + properties: + product_id: + title: "Product ID of the leg, e.g. BTC-USD or BIP-20DEC30-CDE" type: string - description: Base margin requirement component. - example: "30188.41" - volatility_addon: + side: + $ref: '#/components/schemas/coinbase.public_rest_api.OrderSide' + support_passive_order: + title: Whether this leg may rest passively on the book + type: boolean + filled_quantity: + title: "Quantity filled on this leg, in its units: contracts for a futures\ + \ product, base units for spot" type: string - description: Volatility add-on component. - example: "0.00" - liquidity_addon: + average_filled_price: + title: "Average price of this leg's fills, per unit of the underlying" type: string - description: Liquidity add-on component. - example: "0.49" - offset_credit: + commission: + title: Commission charged on this leg so far type: string - description: Credits that offset margin charges due to portfolio composition. - example: "-20.29" - futures_margin: + commission_detail_total: + $ref: '#/components/schemas/coinbase.public_rest_api.CommissionDetailTotal' + exchange_fee: + title: Fee charged by the exchange on this leg for Cost Plus commission + configurations; 0 for All In type: string - description: Futures margin charge applied for any futures trades of the - opposing direction but of the same underlying. - example: "0.00" - coinbase.public_rest_api.PrimeXMMarginRequirementType: + filled_value: + title: "Notional value of this leg's fills so far, in the quote currency" + type: string + coinbase.public_rest_api.SpreadLimitType: + title: Unit of a SPREAD order's spread limit type: string - description: |2- - - MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR: Integrated (netted) cross-margin requirement for spot assets and all derivatives contracts. - - MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMR: Combined cross-margin requirement: Integrated Portfolio Margin (IPMR) plus Ineligible Futures Margin (IFMR). + description: |- + - UNKNOWN_SPREAD_LIMIT_TYPE: nil value + - SPREAD_LIMIT_TYPE_BPS: Limit in basis points of the spot price + - SPREAD_LIMIT_TYPE_USD: Limit in USD enum: - - MARGIN_REQUIREMENT_TYPE_DMR_PLUS_PMR - - MARGIN_REQUIREMENT_TYPE_IPMR_PLUS_IFMR - coinbase.public_rest_api.PrimeXMMarginThreshold: + - SPREAD_LIMIT_TYPE_BPS + - SPREAD_LIMIT_TYPE_USD + coinbase.public_rest_api.SpreadPreview: + title: "SPREAD order preview: the submitted configuration plus per-leg values" type: object properties: - margin_level: - $ref: '#/components/schemas/coinbase.public_rest_api.XMMarginLevel' - threshold_type: - $ref: '#/components/schemas/coinbase.public_rest_api.PrimeXMMarginThresholdType' - threshold_value: + limit: type: string - example: "0.8" - coinbase.public_rest_api.PrimeXMMarginThresholdType: + limit_type: + $ref: '#/components/schemas/coinbase.public_rest_api.SpreadLimitType' + max_delta_size: + type: string + max_delta_type: + $ref: '#/components/schemas/coinbase.public_rest_api.MaxDeltaType' + group_product_id: + title: "Product ID of the spread product, in the form :" + type: string + primary_leg: + $ref: '#/components/schemas/coinbase.public_rest_api.LegPreview' + secondary_leg: + $ref: '#/components/schemas/coinbase.public_rest_api.LegPreview' + coinbase.public_rest_api.StakeType: type: string - description: |2- - - MARGIN_THRESHOLD_EQUITY_RATIO: Threshold based on equity ratio EQ / MR; triggers when EQ / MR >= threshold_value. - - MARGIN_THRESHOLD_DEFICIT_RATIO: Threshold based on deficit ratio (MR - EQ) / XMML; triggers when (MR - EQ) / XMML > threshold_value. enum: - - MARGIN_THRESHOLD_EQUITY_RATIO - - MARGIN_THRESHOLD_DEFICIT_RATIO - - MARGIN_THRESHOLD_NONE - coinbase.public_rest_api.PrimeXMOffsetCreditBreakdown: + - STAKE_TYPE_INITIAL_DEPOSIT + - STAKE_TYPE_TOP_UP + coinbase.public_rest_api.StakingClaimRewardsResponse: + required: + - activity_id + - transaction_id + - wallet_id type: object properties: - basis_credit: + wallet_id: type: string - description: Basis offset credit component. - example: "0" - long_short_credit: + description: The wallet ID + transaction_id: type: string - description: Long/short tier-pair offset credit. - example: "0" - long_long_credit: + description: "ID of the newly created transaction, can be used to fetch\ + \ details of the current state of execution" + activity_id: type: string - description: Long/long tier-pair offset credit. - example: "-1.15" - short_short_credit: + description: The ID for the activity generated for this request + coinbase.public_rest_api.StakingInitiateResponse: + required: + - activity_id + - transaction_id + - wallet_id + type: object + properties: + wallet_id: type: string - description: Short/short tier-pair offset credit. - example: "0" - same_tier_credit: + description: The wallet ID + transaction_id: type: string - description: Same-tier offset credit. - example: "-19.13" - total_credit: + description: "ID of the newly created transaction, can be used to fetch\ + \ details of the current state of execution" + activity_id: type: string - description: Total offset credit. - example: "-20.29" - coinbase.public_rest_api.ProcessRequirements: - title: Represents the status of various process requirements for a transaction + description: The ID for the activity generated for this request + description: StakingInitiateResponse contains the response data from initiating + a staking operation. + coinbase.public_rest_api.StakingStatus: + required: + - amount + - estimated_hours_to_stake + - estimated_stake_date + - stake_type type: object properties: - travel_rule_status: - $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleStatus' - coinbase.public_rest_api.Product: + amount: + type: string + description: "Amount being staked (whole amount, e.g., 16 ETH)" + example: "16" + stake_type: + $ref: '#/components/schemas/coinbase.public_rest_api.StakeType' + estimated_stake_date: + type: string + description: Estimated date when staking will complete (ISO 8601 format) + format: date-time + example: 2025-10-27T00:00:00Z + estimated_hours_to_stake: + type: integer + description: Estimated hours until this staking request completes + format: int64 + example: 672 + requested_at: + type: string + description: Timestamp when the stake request was originally created + format: date-time + example: 2025-09-29T12:00:00Z + coinbase.public_rest_api.StakingUnstakeResponse: + required: + - activity_id + - transaction_id + - wallet_id type: object properties: - id: + wallet_id: type: string - description: "The product ID, written as `BASE-QUOTE`" - example: BTC-USD - base_increment: + description: The wallet ID + transaction_id: type: string - description: The smallest permitted unit of denomination for the base asset - (varies by product) - example: "1" - quote_increment: + description: "ID of the newly created transaction, can be used to fetch\ + \ details of the current state of execution" + activity_id: type: string - description: The smallest permitted unit of denomination for the quote asset - (varies by product) - example: "1" - base_min_size: + description: The ID for the activity generated for this request + description: StakingUnstakeResponse contains the response data from initiating + an unstaking operation. + coinbase.public_rest_api.SubmitDepositTravelRuleDataResponse: + title: Response after submitting travel rule data for a deposit + required: + - ownership_verification_required + type: object + properties: + ownership_verification_required: + title: Whether additional ownership verification is required + type: boolean + coinbase.public_rest_api.TFAsset: + title: TFAsset represents an asset eligible for Trade Finance with adjustment + factors + type: object + properties: + symbol: type: string - description: The minimum size (in base asset units) for which an order can - be placed - example: "100" - quote_min_size: + description: The asset symbol + example: BTC + asset_adjustment: type: string - description: The minimum size (in quote asset units) for which an order - can be placed - example: "100" - base_max_size: + description: The asset adjustment factor for Trade Finance + example: "0.85" + liability_adjustment: type: string - description: The maximum size (in base asset units) for which an order can - be placed - example: "1000" - quote_max_size: + description: The liability adjustment factor for Trade Finance + example: "1.15" + coinbase.public_rest_api.TFObligation: + title: Trade finance obligation information + type: object + properties: + portfolio_id: type: string - description: The maximum size (in quote asset units) for which an order - can be placed + description: The unique ID of the portfolio + example: e8bbed13-fa33-41de-86d5-4335d8f08166 + symbol: + type: string + description: The currency symbol + example: BTC + amount_due: + type: string + description: Current amount due + example: "150000" + notional_amount: + type: string + description: Loan notional amount + example: "250000" + due_date: + type: string + description: Settlement due date example: "1000" - permissions: - title: Permissions for the product based on portfolio - type: array - description: Permissions given to the user for a product - example: PRODUCT_PERMISSION_READ - items: - $ref: '#/components/schemas/coinbase.public_rest_api.ProductPermissions' - price_increment: + coinbase.public_rest_api.TierPairRateEntry: + type: object + properties: + tier_a: type: string - description: The smallest permitted price increment for the product - example: "0.01" - rfq_product_details: - $ref: '#/components/schemas/coinbase.public_rest_api.RFQProductDetails' - product_type: - $ref: '#/components/schemas/coinbase.public_rest_api.ProductType' - fcm_trading_session_details: - $ref: '#/components/schemas/coinbase.public_rest_api.FcmTradingSessionDetails' - future_product_details: - $ref: '#/components/schemas/coinbase.public_rest_api.FutureProductDetails' - option_product_details: - $ref: '#/components/schemas/coinbase.public_rest_api.OptionProductDetails' - coinbase.public_rest_api.ProductPermissions: - type: string - enum: - - PRODUCT_PERMISSION_READ - - PRODUCT_PERMISSION_TRADE - - PRODUCT_PERMISSION_LENDING - coinbase.public_rest_api.ProductType: - title: ProductType represents the general type of product + description: First tier in the pair. + example: "0" + tier_b: + type: string + description: Second tier in the pair. + example: "0" + rate: + type: string + description: Credit rate for this tier pair. + example: "0.4579" + description: "TierPairRateEntry represents a single (tier_a, tier_b) -> rate\ + \ entry in an offset credit matrix." + coinbase.public_rest_api.TieredPricingFee: + type: object + properties: + symbol: + type: string + description: Asset symbol + example: BTC + fee: + type: string + description: The fee in bps + example: "4" + coinbase.public_rest_api.TimeInForceType: + title: Indicates the order time validity type: string description: |- - - UNKNOWN_PRODUCT_TYPE: Unknown product type - - SPOT: Spot product - - FUTURE: Future product - - OPTION: Option product + - UNKNOWN_TIME_IN_FORCE: nil value + - GOOD_UNTIL_DATE_TIME: Expires at a certain date/time + - GOOD_UNTIL_CANCELLED: Order stays on the books until cancelled + - IMMEDIATE_OR_CANCEL: Order is executed immediately at submission or is cancelled + - FILL_OR_KILL: Order is executed immediately and fully at submission or is cancelled enum: - - SPOT - - FUTURE - - OPTION - coinbase.public_rest_api.QuoteResponse: - title: Copied from https://github.cbhq.net/institutional/trading/blob/3e6da61aceb64c7cbe6f0c0f8fbdb98fd3e868dc/proxy/trading/protos/coinbase/brokerage/proxy/trading/api/orderentry.proto#L366-L370 + - GOOD_UNTIL_DATE_TIME + - GOOD_UNTIL_CANCELLED + - IMMEDIATE_OR_CANCEL + - FILL_OR_KILL + coinbase.public_rest_api.Transaction: type: object properties: - quote_id: + id: type: string - expiration_time: + description: The ID of the transaction + example: BTC-USD + wallet_id: type: string - format: date-time - best_price: + description: The wallet ID of the transaction + example: cde8dd34-b6cf-4c2c-82bc-5f86adacc868 + portfolio_id: type: string - order_total: - title: total quote amount for previewing + description: The portfolio ID of the transaction + example: 0a66a8c0-24ea-4f18-b14f-8c9cf7c1ba40 + type: + $ref: '#/components/schemas/coinbase.public_rest_api.TransactionType' + status: + $ref: '#/components/schemas/coinbase.public_rest_api.TransactionStatus' + symbol: type: string - price_inclusive_of_fees: + description: The asset symbol + example: BTC + created_at: type: string - quote_duration_ms: + description: The transaction creation time (as a UTC timestamp) + format: date-time + example: 2021-05-31T11:59:59Z + completed_at: type: string - description: "Echo of the quote_duration_ms supplied in the request. 0 if\ - \ the client did not supply a value, in which case the server applies\ - \ the default of 3000 ms (3 seconds)." - format: int64 - example: "5000" - coinbase.public_rest_api.RFQProductDetails: - type: object - properties: - tradable: - type: boolean - description: Whether the product is tradable via RFQ - min_notional_size: + description: The transaction completion time (as a UTC timestamp) + format: date-time + example: 2021-05-31T12:09:31Z + amount: type: string - description: "Deprecated: Value will be an empty string" - max_notional_size: + description: |- + The transaction amount (in whole units). For example, "1.50" represents 1.5 of the associated symbol. + + Examples: + - "100" + - "1.123456" (precision varies by asset; USDC, for example, supports up to 6 decimal places) + - "0.50" + example: "1.0001" + transfer_from: + $ref: '#/components/schemas/coinbase.public_rest_api.TransferLocation' + transfer_to: + $ref: '#/components/schemas/coinbase.public_rest_api.TransferLocation' + network_fees: type: string - description: "Deprecated: Value will be an empty string" - min_base_size: + description: The blockchain network fees (in whole units) required in order + to broadcast the transaction. Does not carry the Advanced Transfer Coinbase + fee. + example: "1.99" + fees: type: string - description: Minimum base size for RFQ - max_base_size: + description: "The charged fee (in whole units). On the transfer, coinbase_fees\ + \ is set and fees is 0. On the send, the same charge is on fees and fee_symbol,\ + \ and coinbase_fees is omitted. Crypto and fiat sends that belong to the\ + \ transfer use those transfer and send fields. A bank withdrawal that\ + \ is not part of the transfer is unchanged." + example: "4.53" + fee_symbol: type: string - description: Maximum base size for RFQ - min_quote_size: + description: "The asset in which fees is denominated. On the send, the same\ + \ charge is on fees and fee_symbol, and coinbase_fees is omitted. On the\ + \ transfer, fee_symbol is empty." + example: USD + blockchain_ids: + type: array + description: The cryptocurrency network transaction hashes/IDs generated + upon broadcast + example: + - 0x9adce14b8e03705ac342388ac35cd94ae4da74eaed33bbdc8c9aba01f9a3aec0 + items: + type: string + transaction_id: type: string - description: Minimum quote size for RFQ - max_quote_size: + description: The 8 character alphanumeric short form id for the transaction + example: A1B2C3D4 + destination_symbol: type: string - description: Maximum quote size for RFQ - coinbase.public_rest_api.RateType: - type: string - enum: - - BPS - - APR_360 - - APR_365 - - APR - coinbase.public_rest_api.RewardMetadata: + description: The destination asset symbol + example: USD + estimated_network_fees: + $ref: '#/components/schemas/coinbase.public_rest_api.EstimatedNetworkFees' + network: + type: string + description: The network name specific to web3/onchain wallet transactions + example: ethereum-mainnet + estimated_asset_changes: + type: array + description: The estimated asset changes (web3/onchain) + items: + $ref: '#/components/schemas/coinbase.public_rest_api.AssetChange' + metadata: + $ref: '#/components/schemas/coinbase.public_rest_api.TransactionMetadata' + idempotency_key: + type: string + description: The idempotency key associated with the transaction creation + request + onchain_details: + $ref: '#/components/schemas/coinbase.public_rest_api.OnchainTransactionDetails' + network_info: + $ref: '#/components/schemas/coinbase.public_rest_api.Network' + process_requirements: + $ref: '#/components/schemas/coinbase.public_rest_api.ProcessRequirements' + coinbase_fees: + type: array + description: "Coinbase fees on the transfer (amount, symbol, wallet_id),\ + \ where fees is 0. On the send, the same charge is on fees and fee_symbol,\ + \ and coinbase_fees is omitted. When you total fees, do not add coinbase_fees\ + \ from the transfer to the send's fees, or you will count the charge twice.\ + \ A wallet transaction list includes the fees paid by that wallet. Get\ + \ Transaction and the portfolio transaction list include every fee paid\ + \ in the requesting portfolio. Fees paid in the counterparty's portfolio\ + \ are omitted." + items: + $ref: '#/components/schemas/coinbase.public_rest_api.CoinbaseFee' + coinbase.public_rest_api.TransactionMetadata: type: object properties: - subtype: - $ref: '#/components/schemas/coinbase.public_rest_api.RewardSubtype' - custom_stablecoin_reward_details: - $ref: '#/components/schemas/coinbase.public_rest_api.CustomStablecoinRewardDetails' - coinbase.public_rest_api.RewardSubtype: - title: Indicates the reward subtype + match_metadata: + $ref: '#/components/schemas/coinbase.public_rest_api.MatchMetadata' + web3_transaction_metadata: + $ref: '#/components/schemas/coinbase.public_rest_api.Web3TransactionMetadata' + reward_metadata: + $ref: '#/components/schemas/coinbase.public_rest_api.RewardMetadata' + coinbase.public_rest_api.TransactionStatus: + title: Indicates the transaction status type: string description: |- - - REWARD_SUBTYPE_UNKNOWN: An unknown reward subtype, reward subtype may not be supported in the API response yet - - MEV_REWARD: A maximal extractable value reward - i.e. sol mev rewards - - INFLATION_REWARD: An inflationary reward - i.e. solana inflationary rewards - - BLOCK_REWARD: A block reward - i.e. solana block rewards - - VALIDATOR_REWARD: A validator reward - i.e. ethereum validator (consensus layer) rewards - - TRANSACTION_REWARD: A transaction reward - i.e. ethereum transaction (execution layer) rewards - - STAKING_FEE_REBATE_REWARD: A staking fee rebate reward - i.e. coinbase pays rebates for staking fees to eligible delegators - - BUIDL_DIVIDEND: A BUIDL dividend reward - i.e. dividends from BUIDL fund holdings - - CUSTOM_STABLECOIN_REWARD: A custom stablecoin reward - i.e. USDC reward payouts + - 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 enum: - - MEV_REWARD - - INFLATION_REWARD - - BLOCK_REWARD - - VALIDATOR_REWARD - - TRANSACTION_REWARD - - STAKING_FEE_REBATE_REWARD - - BUIDL_DIVIDEND - - CUSTOM_STABLECOIN_REWARD - coinbase.public_rest_api.RiskAssessment: - title: New message for risk assessment details - type: object - properties: - compliance_risk_detected: - type: boolean - description: Indicates if the transaction has been flagged for compliance - concerns - example: false - security_risk_detected: - type: boolean - description: Indicates if the transaction has been flagged for security - concerns - example: false - coinbase.public_rest_api.RiskManagementType: - title: RiskManagementType represents how risk is managed for a product + - TRANSACTION_CREATED + - TRANSACTION_REQUESTED + - TRANSACTION_APPROVED + - TRANSACTION_GASSING + - TRANSACTION_GASSED + - TRANSACTION_PROVISIONED + - TRANSACTION_PLANNED + - TRANSACTION_PROCESSING + - TRANSACTION_RESTORED + - TRANSACTION_DONE + - TRANSACTION_IMPORT_PENDING + - TRANSACTION_IMPORTED + - TRANSACTION_CANCELLED + - TRANSACTION_REJECTED + - TRANSACTION_DELAYED + - TRANSACTION_RETRIED + - TRANSACTION_FAILED + - TRANSACTION_EXPIRED + - TRANSACTION_BROADCASTING + - OTHER_TRANSACTION_STATUS + - TRANSACTION_CONSTRUCTED + coinbase.public_rest_api.TransactionType: + title: Indicates the transaction type type: string description: |- - - RISK_MANAGEMENT_TYPE_UNSPECIFIED: Unspecified risk management type - - RISK_MANAGEMENT_TYPE_MANAGED_BY_FCM: Risk is managed by FCM (Futures Commission Merchant) - - RISK_MANAGEMENT_TYPE_MANAGED_BY_VENUE: Risk is managed by the venue + - TRANSACTION_TYPE_UNKNOWN: An unknown transaction type + - DEPOSIT: A fiat or crypto deposit + - WITHDRAWAL: A fiat or crypto withdrawal + - INTERNAL_DEPOSIT: An internal fiat or crypto deposit + - INTERNAL_WITHDRAWAL: An internal fiat or crypto withdrawal + - SWEEP_DEPOSIT: Internal automated deposit to a cold address from a restored address + - SWEEP_WITHDRAWAL: Internal automated withdrawal from a restored address to a cold address + - PROXY_DEPOSIT: On-chain deposit of funds into proxy contract from cold address + - PROXY_WITHDRAWAL: On-chain withdrawal of funds from proxy contract to cold address + - BILLING_WITHDRAWAL: Coinbase Prime automated invoice settlement payment + - REWARD: Reward payment to an associated address for a staked asset + - COINBASE_REFUND: Coinbase Prime refund for the leftover amount for a CPFP (child pays for parent) transaction + - TRANSACTION_TYPE_OTHER: An OTHER type of transaction + - WITHDRAWAL_ADJUSTMENT: A manual adjustment withdrawal transaction + - DEPOSIT_ADJUSTMENT: A manual adjustment deposit transaction + - KEY_REGISTRATION: An on-chain registration for an address + - DELEGATION: An on-chain delegation transaction + - UNDELEGATION: An on-chain undelegation transaction + - RESTAKE: On-chain restaking transaction + - COMPLETE_UNBONDING: On-chain unbonding event transaction + - WITHDRAW_UNBONDED: On-chain event indicating unbonding period is over + - STAKE_ACCOUNT_CREATE: On-chain transaction to begin staking from an address + - CHANGE_VALIDATOR: On-chain transaction alter validator + - STAKE: On-chain transaction to begin staking in Cryptocurrency network + - UNSTAKE: On-chain transaction to stop staking in Cryptocurrency network + - REMOVE_AUTHORIZED_PARTY: On-chain transaction to remove a party from a multi-signature wallet + - STAKE_AUTHORIZE_WITH_SEED: On-chain transaction to begin staking from a seed account + - SLASH: On-chain transaction indicating a slash event has occurred + - COINBASE_DEPOSIT: On-chain transaction deposit for the purpose of transaction operations + - CONVERSION: Internal conversion between two assets + - CLAIM_REWARDS: On-chain transaction to claim rewards from Vote Account + - VOTE_AUTHORIZE: On-chain transaction to transfer the reward claiming permission to other pubkey + - WEB3_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet + Deprecated: Use ONCHAIN_TRANSACTION instead + - ONCHAIN_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet + - PORTFOLIO_STAKE: Portfolio-level staking operation + - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation + - MERGE_STAKE: On-chain transaction consolidating funds from different addresses belonging to the same wallet. + - ONCHAIN_DEPOSIT: On-chain deposit detected into a Prime Onchain Wallet + - ONCHAIN_REWARD: Automated on-chain reward payout to a blockchain address + - ONCHAIN_MESSAGE: Message signing initiated with Prime Onchain Wallet; no funds move on-chain. enum: - - RISK_MANAGEMENT_TYPE_MANAGED_BY_FCM - - RISK_MANAGEMENT_TYPE_MANAGED_BY_VENUE - coinbase.public_rest_api.RotateAPIKeyRequest: - type: object - properties: - duration_seconds: - type: integer - description: "How long the old key remains active after the new key is approved,\ - \ in seconds. Set to 0 for immediate expiry on approval. Cannot extend\ - \ beyond the original key's expiry." - format: int64 - example: 3600 - coinbase.public_rest_api.RotateAPIKeyResponse: + - DEPOSIT + - WITHDRAWAL + - INTERNAL_DEPOSIT + - INTERNAL_WITHDRAWAL + - SWEEP_DEPOSIT + - SWEEP_WITHDRAWAL + - PROXY_DEPOSIT + - PROXY_WITHDRAWAL + - BILLING_WITHDRAWAL + - REWARD + - COINBASE_REFUND + - TRANSACTION_TYPE_OTHER + - WITHDRAWAL_ADJUSTMENT + - DEPOSIT_ADJUSTMENT + - KEY_REGISTRATION + - DELEGATION + - UNDELEGATION + - RESTAKE + - COMPLETE_UNBONDING + - WITHDRAW_UNBONDED + - STAKE_ACCOUNT_CREATE + - CHANGE_VALIDATOR + - STAKE + - UNSTAKE + - REMOVE_AUTHORIZED_PARTY + - STAKE_AUTHORIZE_WITH_SEED + - SLASH + - COINBASE_DEPOSIT + - CONVERSION + - CLAIM_REWARDS + - VOTE_AUTHORIZE + - WEB3_TRANSACTION + - ONCHAIN_TRANSACTION + - PORTFOLIO_STAKE + - PORTFOLIO_UNSTAKE + - MERGE_STAKE + - ONCHAIN_DEPOSIT + - ONCHAIN_REWARD + - ONCHAIN_MESSAGE + coinbase.public_rest_api.TransactionValidator: + required: + - transaction_id + - validator_address + - validator_status type: object properties: - encrypted_credentials: + transaction_id: type: string - description: Base64-encoded encrypted payload containing the new API key - credentials. Decrypt using your current secret_key with HKDF-SHA256 + - AES-256-GCM. - activity_id: + description: The ID of the transaction which staked to this validator + validator_address: type: string - description: The Prime activity ID tracking the consensus approval for this - rotation. Use with the Activities endpoints to monitor approval status. - example: e8bbed13-fa33-41de-86d5-4335d8f08166 - coinbase.public_rest_api.RpcConfig: + description: The address (public key) of the validator + validator_status: + $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorStatus' + coinbase.public_rest_api.TransferLocation: type: object properties: - skip_broadcast: - type: boolean - description: "If true, transaction will not be broadcast to the network" - example: false - url: + type: + $ref: '#/components/schemas/coinbase.public_rest_api.TransferLocationType' + value: type: string - description: Custom blockchain node RPC URL. (EVM-only) - example: https://rpc.flashbots.net/fast - coinbase.public_rest_api.ScheduleFuturesSweepResponse: - type: object - properties: - success: - type: boolean - description: Success - example: true - request_id: + description: "The value of the transfer location: payment method ID, wallet\ + \ ID or crypto address" + example: 0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27 + address: type: string - description: Request ID - example: 00000000-0000-0000-0000-000000000000 - coinbase.public_rest_api.SecondaryPermission: - title: Indicates the user's secondary permission + description: The crypto address of the transfer location + example: 0x742d35Cc6634C0532925a3b844Bc454e4438f44e + account_identifier: + type: string + description: "The tag/memo of the address, if applicable -- required for\ + \ certain assets (e.g. XRP, XLM, etc.)" + example: "387879289" + coinbase.public_rest_api.TransferLocationType: + title: |- + - TRANSFER_LOCATION_TYPE_UNKNOWN: The nil value + - PAYMENT_METHOD: The ID of a fiat payment method + - WALLET: The ID of a wallet + - ADDRESS: A cryptocurrency address + - OTHER: Another type of transfer location: Blockchain Network, Coinbase + - MULTIPLE_ADDRESSES: More than one cryptocurrency address. value and address are empty; the addresses are not listed. A single address uses ADDRESS. + - COUNTERPARTY_ID: Counterparty ID type: string - description: |- - - SECONDARY_PERMISSION_UNKNOWN: nil value - - VIDEO_APPROVER: A video approver - - TEAM_APPROVER: A team approver - - WEB3_SIGNER: A web3 signer enum: - - VIDEO_APPROVER - - TEAM_APPROVER - - WEB3_SIGNER - coinbase.public_rest_api.SetAutoSweepResponse: + - PAYMENT_METHOD + - WALLET + - ADDRESS + - OTHER + - MULTIPLE_ADDRESSES + - COUNTERPARTY_ID + coinbase.public_rest_api.TravelRuleData: type: object properties: - success: + beneficiary: + $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleParty' + originator: + $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleParty' + is_self: + title: True if user owns the counterparty address (self-transfer) type: boolean - description: Success - example: true - coinbase.public_rest_api.SetFcmSettingsResponse: - type: object - properties: - success: + is_intermediary: type: boolean - description: Success - example: true - coinbase.public_rest_api.SettlementModel: - title: SettlementModel represents the currency a derivative contract settles - in - type: string - description: |- - - SETTLEMENT_MODEL_UNSPECIFIED: Unspecified settlement model - - SETTLEMENT_MODEL_LINEAR: Settles in the quote currency - - SETTLEMENT_MODEL_INVERSE: Settles in the base currency - enum: - - SETTLEMENT_MODEL_LINEAR - - SETTLEMENT_MODEL_INVERSE - coinbase.public_rest_api.SettlementPeriod: - title: SettlementPeriod represents how often a derivative contract expires and - settles - type: string - description: |- - - SETTLEMENT_PERIOD_UNSPECIFIED: Unspecified settlement period - - SETTLEMENT_PERIOD_PERPETUAL: Contract never expires - - SETTLEMENT_PERIOD_DAY: Contract expires daily - - SETTLEMENT_PERIOD_WEEK: Contract expires weekly - - SETTLEMENT_PERIOD_MONTH: Contract expires monthly - enum: - - SETTLEMENT_PERIOD_PERPETUAL - - SETTLEMENT_PERIOD_DAY - - SETTLEMENT_PERIOD_WEEK - - SETTLEMENT_PERIOD_MONTH - coinbase.public_rest_api.ShortCollateral: + description: True if Coinbase is being used as an intermediary for a customer + transfer. + opt_out_of_ownership_verification: + title: True to skip wallet ownership verification + type: boolean + attest_verified_wallet_ownership: + type: boolean + description: |- + Whether the originating VASP attests to verified wallet ownership. + When true with is_intermediary, enables automatic VASP data enrichment from the legal entity. + description: Data object used for withdrawals. + coinbase.public_rest_api.TravelRuleParty: type: object properties: - old_balance: + name: + title: Legal name (for entities or simple name format) + type: string + natural_person_name: + $ref: '#/components/schemas/coinbase.public_rest_api.NaturalPersonName' + address: + $ref: '#/components/schemas/coinbase.public_rest_api.DetailedAddress' + wallet_type: + $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleWalletType' + vasp_id: + title: VASP identifier when wallet_type is VASP type: string - description: Existing short collateral balance - example: "1000" - new_balance: + vasp_name: + title: VASP name fallback when vasp_id is unknown type: string - description: New short collateral balance required - example: "1000" - loan_interest_rate: + personal_id: type: string - description: Loan interest rate - example: "0.1" - collateral_interest_rate: + description: |- + Personal identifier for travel rule compliance. + For individuals: passport number, national ID, driver's license. + For institutions: LEI (Legal Entity Identifier). + date_of_birth: + $ref: '#/components/schemas/google.type.Date' + telephone_number: type: string - description: Collateral interest rate - example: "0.1" - coinbase.public_rest_api.SigningStatus: - title: |- - - SIGNING_STATUS_UNKNOWN: Unknown signing status - - SIGNED: Transaction has been signed - - UNSIGNED: Transaction is unsigned + description: Telephone number for contact purposes. + account_id: + type: string + description: |- + Account identifier for travel rule compliance. + If not provided, defaults to portfolio ID. + vasp_address: + $ref: '#/components/schemas/coinbase.public_rest_api.DetailedAddress' + description: Represents a party in a travel rule transfer (originator or beneficiary). + coinbase.public_rest_api.TravelRuleStatus: + title: Travel rule compliance status for a transaction type: string enum: - - SIGNED - - UNSIGNED - coinbase.public_rest_api.SortDirection: + - TRAVEL_RULE_STATUS_PENDING + - TRAVEL_RULE_STATUS_SUBMITTED + coinbase.public_rest_api.TravelRuleWalletType: + title: Type of wallet being used for transfers type: string - default: DESC + description: |- + - TRAVEL_RULE_WALLET_TYPE_UNSPECIFIED: Default unspecified wallet type + - TRAVEL_RULE_WALLET_TYPE_VASP: Centralized exchange wallet + - TRAVEL_RULE_WALLET_TYPE_SELF_CUSTODIED: Self-hosted/custodial wallet enum: - - DESC - - ASC - coinbase.public_rest_api.StakeType: + - TRAVEL_RULE_WALLET_TYPE_VASP + - TRAVEL_RULE_WALLET_TYPE_SELF_CUSTODIED + coinbase.public_rest_api.UnstakeType: type: string enum: - - STAKE_TYPE_INITIAL_DEPOSIT - - STAKE_TYPE_TOP_UP - coinbase.public_rest_api.StakingClaimRewardsResponse: + - UNSTAKE_TYPE_PARTIAL + - UNSTAKE_TYPE_FULL + coinbase.public_rest_api.UnstakingStatus: required: - - activity_id - - transaction_id - - wallet_id + - amount + - estimate_description + - estimate_type type: object properties: - wallet_id: + amount: type: string - description: The wallet ID - transaction_id: + description: "Amount being unstaked (whole amount, e.g., 16 ETH)" + example: "16" + unstake_type: + $ref: '#/components/schemas/coinbase.public_rest_api.UnstakeType' + finishing_at: type: string - description: "ID of the newly created transaction, can be used to fetch\ - \ details of the current state of execution" - activity_id: + description: Estimated date when unstaking will complete (ISO 8601 format) + format: date-time + example: 2025-10-27T00:00:00Z + remaining_hours: + type: integer + description: Estimated hours until this unstaking request completes + format: int64 + example: 672 + requested_at: type: string - description: The ID for the activity generated for this request - coinbase.public_rest_api.StakingInitiateResponse: - required: - - activity_id - - transaction_id - - wallet_id + description: Timestamp when the unstake request was originally created + format: date-time + example: 2025-09-29T12:00:00Z + estimate_type: + $ref: '#/components/schemas/coinbase.public_rest_api.EstimateType' + estimate_description: + type: string + description: Detailed explanation of the estimate status for display to + users. + example: Live estimate based on current network conditions + coinbase.public_rest_api.UpdateFundingSettingsResponse: type: object properties: - wallet_id: + activity_id: type: string - description: The wallet ID - transaction_id: + description: Identifier for the created activity / proposal + activity_type: type: string - description: "ID of the newly created transaction, can be used to fetch\ - \ details of the current state of execution" - activity_id: + description: Type of the activity (e.g. PCS proposal type) + num_approvals_remaining: + type: integer + description: Number of approvals still required before the change applies + format: int32 + coinbase.public_rest_api.UserAction: + type: object + properties: + action: + $ref: '#/components/schemas/coinbase.public_rest_api.Action' + user_id: type: string - description: The ID for the activity generated for this request - description: StakingInitiateResponse contains the response data from initiating - a staking operation. - coinbase.public_rest_api.StakingStatus: + description: Id of the user who executed the action + timestamp: + type: string + description: Time the action was taken + coinbase.public_rest_api.UserRole: + title: Indicates the user's role + type: string + description: |- + - USER_ROLE_UNKNOWN: nil value + - AUDITOR: An auditor + - SIGNATORY: A signatory + - ADMIN: An admin + - INITIATOR: An initiator + - REVIEWER: A reviewer + - TRADER: A trader + - FULL_TRADER: A trader with full permissions + - TEAM_MANAGER: A team manager + - APPROVER: An approver + - TAX_MANAGER: A tax manager + - BUSINESS_MANAGER: A business manager + enum: + - AUDITOR + - SIGNATORY + - ADMIN + - INITIATOR + - REVIEWER + - TRADER + - FULL_TRADER + - TEAM_MANAGER + - APPROVER + - TAX_MANAGER + - BUSINESS_MANAGER + coinbase.public_rest_api.ValidatorAllocation: required: - amount - - estimated_hours_to_stake - - estimated_stake_date - - stake_type + - validator_address type: object properties: + validator_address: + type: string + description: The validator address for performing staking operations amount: type: string - description: "Amount being staked (whole amount, e.g., 16 ETH)" - example: "16" - stake_type: - $ref: '#/components/schemas/coinbase.public_rest_api.StakeType' - estimated_stake_date: + description: Amount for performing staking operations with this validator + description: |- + ValidatorAllocation specifies the validator and amount for staking or unstaking. + Used for granular ETH V2 validator-level staking or unstaking operations. + coinbase.public_rest_api.ValidatorProvider: + type: string + description: ValidatorProvider enumerates the ETH validator service providers + accepted for unstaking. + enum: + - VALIDATOR_PROVIDER_COINBASE_CLOUD + - VALIDATOR_PROVIDER_MAVAN + - VALIDATOR_PROVIDER_FIGMENT + - VALIDATOR_PROVIDER_CODEFI + - VALIDATOR_PROVIDER_ATTESTANT + - VALIDATOR_PROVIDER_GALAXY + coinbase.public_rest_api.ValidatorStakingInfo: + required: + - statuses + - validator_address + type: object + properties: + validator_address: type: string - description: Estimated date when staking will complete (ISO 8601 format) - format: date-time - example: 2025-10-27T00:00:00Z - estimated_hours_to_stake: - type: integer - description: Estimated hours until this staking request completes - format: int64 - example: 672 - requested_at: + description: The validator address (public key) + statuses: + type: array + description: List of active staking requests for this validator + items: + $ref: '#/components/schemas/coinbase.public_rest_api.StakingStatus' + coinbase.public_rest_api.ValidatorStatus: + type: string + enum: + - VALIDATOR_STATUS_PENDING + - VALIDATOR_STATUS_ACTIVE + - VALIDATOR_STATUS_EXITING + - VALIDATOR_STATUS_EXITED + - VALIDATOR_STATUS_WITHDRAWN + coinbase.public_rest_api.ValidatorUnstakePreview: + type: object + properties: + validator_address: type: string - description: Timestamp when the stake request was originally created - format: date-time - example: 2025-09-29T12:00:00Z - coinbase.public_rest_api.StakingUnstakeResponse: + description: Public address of the validator being unstaked from + estimated_unstaking_amount: + type: string + description: Estimated amount that would be unstaked from this validator + (in ETH) + unstake_time_estimate_in_hours: + type: number + description: "Estimated time until this validator's unstake completes, in\ + \ hours" + format: double + estimated_unstake_date: + type: string + description: Estimated date when this validator's unstake will complete + (ISO 8601) + description: ValidatorUnstakePreview contains the per-validator breakdown for + an unstake preview. + coinbase.public_rest_api.ValidatorUnstakingInfo: required: - - activity_id - - transaction_id - - wallet_id + - statuses + - validator_address + type: object + properties: + validator_address: + type: string + description: The validator address (public key) + statuses: + type: array + description: List of active unstaking requests for this validator + items: + $ref: '#/components/schemas/coinbase.public_rest_api.UnstakingStatus' + coinbase.public_rest_api.VisibilityStatus: + title: |- + - UNKNOWN_VISIBILITY_STATUS: nil + - VISIBLE: Visible + - HIDDEN: Hidden + - SPAM: Spam + type: string + enum: + - VISIBLE + - HIDDEN + - SPAM + coinbase.public_rest_api.Wallet: type: object properties: - wallet_id: + id: + title: The unique UUID for the wallet type: string - description: The wallet ID - transaction_id: + name: + title: The name of the wallet type: string - description: "ID of the newly created transaction, can be used to fetch\ - \ details of the current state of execution" - activity_id: + symbol: + title: The asset stored in the wallet type: string - description: The ID for the activity generated for this request - description: StakingUnstakeResponse contains the response data from initiating - an unstaking operation. - coinbase.public_rest_api.SubmitDepositTravelRuleDataResponse: - title: Response after submitting travel rule data for a deposit - required: - - ownership_verification_required + type: + $ref: '#/components/schemas/coinbase.public_rest_api.WalletType' + created_at: + title: The UTC timestamp when this wallet was created + type: string + format: date-time + address: + title: The active address of the wallet + type: string + visibility: + $ref: '#/components/schemas/coinbase.public_rest_api.WalletVisibility' + network: + $ref: '#/components/schemas/coinbase.public_rest_api.Network' + coinbase.public_rest_api.WalletClaimRewardsInputs: type: object properties: - ownership_verification_required: - title: Whether additional ownership verification is required - type: boolean - coinbase.public_rest_api.TFAsset: - title: TFAsset represents an asset eligible for Trade Finance with adjustment - factors + amount: + type: string + description: "Optional amount to claim rewards (ETH only). If omitted, the\ + \ wallet will claim the maximum amount available" + description: |- + WalletClaimRewardsInputs contains the custom inputs for claim rewards operations on a wallet. + Requirements and supported fields vary by asset type. + coinbase.public_rest_api.WalletCryptoDepositInstructions: type: object properties: - symbol: + id: type: string - description: The asset symbol - example: BTC - asset_adjustment: + description: The ID of the wallet + example: e84255eb-2e21-439e-a1d0-f5dd1e1292b9 + name: type: string - description: The asset adjustment factor for Trade Finance - example: "0.85" - liability_adjustment: + description: The name of the wallet + example: Wallet 1 + type: + $ref: '#/components/schemas/coinbase.public_rest_api.WalletDepositInstructionType' + address: type: string - description: The liability adjustment factor for Trade Finance - example: "1.15" - coinbase.public_rest_api.TFObligation: - title: Trade finance obligation information + description: The address of the wallet + example: ca13fdc4-e459-4fd9-868e-82291343b213 + account_identifier: + type: string + description: "The tag/memo of the address, if applicable -- required for\ + \ certain assets (e.g. XRP, XLM, etc.)" + example: "387879289" + account_identifier_name: + type: string + description: "The blockchain network's terminology for the unique identifier\ + \ used to identify the receiver of the transaction (different blockchain\ + \ networks use different names, such as `destination_tag` or `memo`)" + example: memo + network: + $ref: '#/components/schemas/coinbase.public_rest_api.Network' + coinbase.public_rest_api.WalletDepositInstructionType: + title: Indicates the wallet's deposit instruction type + type: string + description: |- + - UNKNOWN_WALLET_DEPOSIT_TYPE: nil value + - CRYPTO: A cryptocurrency deposit + - WIRE: A wire deposit + - SEN: DEPRECATED. A Silvergate Exchange Network deposit + - SWIFT: A SWIFT deposit + - SEPA: A SEPA deposit (Single Euro Payments Area) + - KINEXYS: A JPM Kinexys deposit + enum: + - CRYPTO + - WIRE + - SEN + - SWIFT + - SEPA + - KINEXYS + coinbase.public_rest_api.WalletFiatDepositInstructions: type: object properties: - portfolio_id: + id: + title: The id of the wallet type: string - description: The unique ID of the portfolio - example: e8bbed13-fa33-41de-86d5-4335d8f08166 - symbol: + name: + title: The name of the wallet type: string - description: The currency symbol - example: BTC - amount_due: + type: + $ref: '#/components/schemas/coinbase.public_rest_api.WalletDepositInstructionType' + account_number: + title: The fiat account number type: string - description: Current amount due - example: "150000" - notional_amount: + routing_number: + title: The fiat routing number type: string - description: Loan notional amount - example: "250000" - due_date: + reference_code: + title: Reference code to be used as a memo/description type: string - description: Settlement due date - example: "1000" - coinbase.public_rest_api.TierPairRateEntry: + coinbase.public_rest_api.WalletStakeInputs: type: object properties: - tier_a: + amount: type: string - description: First tier in the pair. - example: "0" - tier_b: + description: "Optional amount to stake (ETH only). If omitted, the wallet\ + \ will stake the maximum amount available" + validator_address: type: string - description: Second tier in the pair. - example: "0" - rate: + description: "Optional validator address, defaults to Coinbase validator.\ + \ For SOL, must be the vote account address. Ignored for ETH." + end_date: type: string - description: Credit rate for this tier pair. - example: "0.4579" - description: "TierPairRateEntry represents a single (tier_a, tier_b) -> rate\ - \ entry in an offset credit matrix." - coinbase.public_rest_api.TieredPricingFee: + description: Optional delegation end date in ISO date format (e.g. 2026-07-15). + Required for AVAX; minimum 14-day delegation period applies. + description: |- + WalletStakeInputs contains the custom inputs for staking operations on a wallet. + Requirements and supported fields vary by asset type. + coinbase.public_rest_api.WalletStakingMetadata: type: object properties: - symbol: - type: string - description: Asset symbol - example: BTC - fee: + external_id: type: string - description: The fee in bps - example: "4" - coinbase.public_rest_api.TimeInForceType: - title: Indicates the order time validity + description: An optional custom identifier (up to 255 bytes) to attach to + the transaction. This is not a searchable transaction field. Retries with + the same idempotency_key must use the same external_id; a differing value + on retry will be silently ignored. + description: |- + WalletStakingMetadata contains optional metadata for wallet staking requests. + Optional metadata to attach to this staking or delegation request. Automatic reward crediting (such as SOL inflation) does not produce a taggable transaction and therefore does not support metadata; see the field descriptions below for details. + coinbase.public_rest_api.WalletType: + title: Indicates the wallet type type: string description: |- - - UNKNOWN_TIME_IN_FORCE: nil value - - GOOD_UNTIL_DATE_TIME: Expires at a certain date/time - - GOOD_UNTIL_CANCELLED: Order stays on the books until cancelled - - IMMEDIATE_OR_CANCEL: Order is executed immediately at submission or is cancelled - - FILL_OR_KILL: Order is executed immediately and fully at submission or is cancelled + - VAULT: A crypto vault + - TRADING: A trading wallet + - WALLET_TYPE_OTHER: Other wallet types (like consumer, etc) + - QC: A QC Wallet + - ONCHAIN: An Onchain wallet enum: - - GOOD_UNTIL_DATE_TIME - - GOOD_UNTIL_CANCELLED - - IMMEDIATE_OR_CANCEL - - FILL_OR_KILL - coinbase.public_rest_api.Transaction: + - VAULT + - TRADING + - WALLET_TYPE_OTHER + - QC + - ONCHAIN + - INTERNATIONAL_DERIVATIVES + coinbase.public_rest_api.WalletUnstakeInputs: type: object properties: - id: - type: string - description: The ID of the transaction - example: BTC-USD - wallet_id: - type: string - description: The wallet ID of the transaction - example: cde8dd34-b6cf-4c2c-82bc-5f86adacc868 - portfolio_id: - type: string - description: The portfolio ID of the transaction - example: 0a66a8c0-24ea-4f18-b14f-8c9cf7c1ba40 - type: - $ref: '#/components/schemas/coinbase.public_rest_api.TransactionType' - status: - $ref: '#/components/schemas/coinbase.public_rest_api.TransactionStatus' - symbol: - type: string - description: The asset symbol - example: BTC - created_at: + amount: type: string - description: The transaction creation time (as a UTC timestamp) - format: date-time - example: 2021-05-31T11:59:59Z - completed_at: + description: "Optional amount to unstake (ETH only). If omitted, the wallet\ + \ will unstake the maximum amount available" + validator_allocations: + type: array + description: (Alpha) Optional validator-level allocations for ETH V2 unstaking. + Allows specifying which validators to unstake from and how much. This + feature is in alpha. Please reach out to your Coinbase Prime account manager + for more information + items: + $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorAllocation' + validator_address: type: string - description: The transaction completion time (as a UTC timestamp) - format: date-time - example: 2021-05-31T12:09:31Z - amount: + description: Optional validator address to unstake from. Only supported + for a subset of protocols. + description: |- + WalletUnstakeInputs contains the custom inputs for unstaking operations on a wallet. + Requirements and supported fields vary by asset type. + coinbase.public_rest_api.WalletVisibility: + type: string + enum: + - WALLET_VISIBILITY_VISIBLE + - WALLET_VISIBILITY_HIDDEN + coinbase.public_rest_api.Web3Asset: + type: object + properties: + network: + title: Network this asset is on (ie "ethereum-mainnet") type: string - description: The transaction amount in whole units - example: "100" - transfer_from: - $ref: '#/components/schemas/coinbase.public_rest_api.TransferLocation' - transfer_to: - $ref: '#/components/schemas/coinbase.public_rest_api.TransferLocation' - network_fees: + contract_address: type: string - description: The blockchain network fees (in whole units) required in order - to broadcast the transaction - example: "1.99" - fees: + description: Contract Address of this asset (empty for native assets). + symbol: type: string - description: The fees that the customer paid for the transaction (in whole - units) - example: "4.53" - fee_symbol: + description: Symbol of this asset. + token_id: type: string - description: The asset in which fees will be paid - example: USD - blockchain_ids: - type: array - description: The cryptocurrency network transaction hashes/IDs generated - upon broadcast - example: - - 0x9adce14b8e03705ac342388ac35cd94ae4da74eaed33bbdc8c9aba01f9a3aec0 - items: - type: string - transaction_id: + description: Token ID of this asset (empty for non NFT assets). + name: type: string - description: The 8 character alphanumeric short form id for the transaction - example: A1B2C3D4 - destination_symbol: + description: "Name of this asset, either the name of the crypto token or\ + \ the NFT collection name." + coinbase.public_rest_api.Web3Balance: + type: object + properties: + asset: + $ref: '#/components/schemas/coinbase.public_rest_api.Web3Asset' + amount: type: string - description: The destination asset symbol - example: USD - estimated_network_fees: - $ref: '#/components/schemas/coinbase.public_rest_api.EstimatedNetworkFees' - network: + description: The total amount in whole units with full precision. + example: "109.42" + visibility_status: + $ref: '#/components/schemas/coinbase.public_rest_api.VisibilityStatus' + coinbase.public_rest_api.Web3TransactionMetadata: + type: object + properties: + label: type: string - description: The network name specific to web3/onchain wallet transactions - example: ethereum-mainnet - estimated_asset_changes: + description: The transaction type label of the confirmed transaction post + settlement + confirmed_asset_changes: type: array - description: The estimated asset changes (web3) + description: The confirmed asset changes (onchain) items: $ref: '#/components/schemas/coinbase.public_rest_api.AssetChange' - metadata: - $ref: '#/components/schemas/coinbase.public_rest_api.TransactionMetadata' - idempotency_key: - type: string - description: The idempotency key associated with the transaction creation - request - onchain_details: - $ref: '#/components/schemas/coinbase.public_rest_api.OnchainTransactionDetails' - network_info: - $ref: '#/components/schemas/coinbase.public_rest_api.Network' - process_requirements: - $ref: '#/components/schemas/coinbase.public_rest_api.ProcessRequirements' - coinbase.public_rest_api.TransactionMetadata: + coinbase.public_rest_api.WithdrawalPower: type: object properties: - match_metadata: - $ref: '#/components/schemas/coinbase.public_rest_api.MatchMetadata' - web3_transaction_metadata: - $ref: '#/components/schemas/coinbase.public_rest_api.Web3TransactionMetadata' - reward_metadata: - $ref: '#/components/schemas/coinbase.public_rest_api.RewardMetadata' - coinbase.public_rest_api.TransactionStatus: - title: Indicates the transaction status + symbol: + type: string + description: The currency symbol + example: BTC + amount: + type: string + description: Withdrawal power + example: "2.84882377" + coinbase.public_rest_api.XMCallStatus: + title: XMCallStatus is the current status of the margin call type: string description: |- - - 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 + - CALL_STATUS_OPEN: Margin call is open and not expired + - CALL_STATUS_AGED: Margin call is open and it is expired + - CALL_STATUS_SETTLED: Margin call is fully settled + - CALL_STATUS_CANCELED: Margin call was canceled by Credit Risk enum: - - TRANSACTION_CREATED - - TRANSACTION_REQUESTED - - TRANSACTION_APPROVED - - TRANSACTION_GASSING - - TRANSACTION_GASSED - - TRANSACTION_PROVISIONED - - TRANSACTION_PLANNED - - TRANSACTION_PROCESSING - - TRANSACTION_RESTORED - - TRANSACTION_DONE - - TRANSACTION_IMPORT_PENDING - - TRANSACTION_IMPORTED - - TRANSACTION_CANCELLED - - TRANSACTION_REJECTED - - TRANSACTION_DELAYED - - TRANSACTION_RETRIED - - TRANSACTION_FAILED - - TRANSACTION_EXPIRED - - TRANSACTION_BROADCASTING - - OTHER_TRANSACTION_STATUS - - TRANSACTION_CONSTRUCTED - coinbase.public_rest_api.TransactionType: - title: Indicates the transaction type + - CALL_STATUS_OPEN + - CALL_STATUS_AGED + - CALL_STATUS_SETTLED + - CALL_STATUS_CANCELED + coinbase.public_rest_api.XMCallType: + title: XMCallType is the type of margin call type: string description: |- - - TRANSACTION_TYPE_UNKNOWN: An unknown transaction type - - DEPOSIT: A fiat or crypto deposit - - WITHDRAWAL: A fiat or crypto withdrawal - - INTERNAL_DEPOSIT: An internal fiat or crypto deposit - - INTERNAL_WITHDRAWAL: An internal fiat or crypto withdrawal - - SWEEP_DEPOSIT: Internal automated deposit to a cold address from a restored address - - SWEEP_WITHDRAWAL: Internal automated withdrawal from a restored address to a cold address - - PROXY_DEPOSIT: On-chain deposit of funds into proxy contract from cold address - - PROXY_WITHDRAWAL: On-chain withdrawal of funds from proxy contract to cold address - - BILLING_WITHDRAWAL: Coinbase Prime automated invoice settlement payment - - REWARD: Reward payment to an associated address for a staked asset - - COINBASE_REFUND: Coinbase Prime refund for the leftover amount for a CPFP (child pays for parent) transaction - - TRANSACTION_TYPE_OTHER: An OTHER type of transaction - - WITHDRAWAL_ADJUSTMENT: A manual adjustment withdrawal transaction - - DEPOSIT_ADJUSTMENT: A manual adjustment deposit transaction - - KEY_REGISTRATION: An on-chain registration for an address - - DELEGATION: An on-chain delegation transaction - - UNDELEGATION: An on-chain undelegation transaction - - RESTAKE: On-chain restaking transaction - - COMPLETE_UNBONDING: On-chain unbonding event transaction - - WITHDRAW_UNBONDED: On-chain event indicating unbonding period is over - - STAKE_ACCOUNT_CREATE: On-chain transaction to begin staking from an address - - CHANGE_VALIDATOR: On-chain transaction alter validator - - STAKE: On-chain transaction to begin staking in Cryptocurrency network - - UNSTAKE: On-chain transaction to stop staking in Cryptocurrency network - - REMOVE_AUTHORIZED_PARTY: On-chain transaction to remove a party from a multi-signature wallet - - STAKE_AUTHORIZE_WITH_SEED: On-chain transaction to begin staking from a seed account - - SLASH: On-chain transaction indicating a slash event has occurred - - COINBASE_DEPOSIT: On-chain transaction deposit for the purpose of transaction operations - - CONVERSION: Internal conversion between two assets - - CLAIM_REWARDS: On-chain transaction to claim rewards from Vote Account - - VOTE_AUTHORIZE: On-chain transaction to transfer the reward claiming permission to other pubkey - - WEB3_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet - Deprecated: Use ONCHAIN_TRANSACTION instead - - ONCHAIN_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet - - PORTFOLIO_STAKE: Portfolio-level staking operation - - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation - - MERGE_STAKE: On-chain transaction consolidating funds from different addresses belonging to the same wallet. - enum: - - DEPOSIT - - WITHDRAWAL - - INTERNAL_DEPOSIT - - INTERNAL_WITHDRAWAL - - SWEEP_DEPOSIT - - SWEEP_WITHDRAWAL - - PROXY_DEPOSIT - - PROXY_WITHDRAWAL - - BILLING_WITHDRAWAL - - REWARD - - COINBASE_REFUND - - TRANSACTION_TYPE_OTHER - - WITHDRAWAL_ADJUSTMENT - - DEPOSIT_ADJUSTMENT - - KEY_REGISTRATION - - DELEGATION - - UNDELEGATION - - RESTAKE - - COMPLETE_UNBONDING - - WITHDRAW_UNBONDED - - STAKE_ACCOUNT_CREATE - - CHANGE_VALIDATOR - - STAKE - - UNSTAKE - - REMOVE_AUTHORIZED_PARTY - - STAKE_AUTHORIZE_WITH_SEED - - SLASH - - COINBASE_DEPOSIT - - CONVERSION - - CLAIM_REWARDS - - VOTE_AUTHORIZE - - WEB3_TRANSACTION - - ONCHAIN_TRANSACTION - - PORTFOLIO_STAKE - - PORTFOLIO_UNSTAKE - - MERGE_STAKE - coinbase.public_rest_api.TransactionValidator: - required: - - transaction_id - - validator_address - - validator_status + - CALL_TYPE_STANDARD: Evaluated at standard margin call evaluation time + - CALL_TYPE_URGENT: Evaluated in realtime + - CALL_TYPE_DEBIT: Evaluated at debit call evaluation time + enum: + - CALL_TYPE_STANDARD + - CALL_TYPE_URGENT + - CALL_TYPE_DEBIT + coinbase.public_rest_api.XMControlStatus: + title: XMControlStatus is a summarization of XM customer controls for trades + and withdrawals + type: string + description: |- + - TRADES_AND_WITHDRAWALS: Allowed to trade and withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled. + - TRADES_ONLY: Allowed to trade but not withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled. + - SESSION_LOCKED: Not allowed to trade or withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled. + enum: + - TRADES_AND_WITHDRAWALS + - TRADES_ONLY + - SESSION_LOCKED + coinbase.public_rest_api.XMEntityCallStatus: + type: string + description: |- + XMEntityCallStatus summarizes the state of open margin calls or debit calls. When multiple calls exist, the status reflects the highest priority call type. + Priority order (highest to lowest): aged > urgent > standard > debit. + + - ENTITY_NO_CALL: There are no margin calls or debit calls. + - ENTITY_OPEN_STANDARD_CALL: There is a standard margin call. There may also be debit calls, but there are no urgent margin calls or expired calls.. + - ENTITY_OPEN_URGENT_CALL: There is an urgent margin call. There may also be standard margin calls or debit calls, but there are no expired calls. + - ENTITY_AGED_CALL: At least one open margin call (standard or urgent) or debit call is aged. This will trigger the SESSION_LOCKED control status. + - ENTITY_OPEN_DEBIT_CALL: There is a debit call. There are no standard margin calls, urgent margin calls, or expired calls. + enum: + - ENTITY_NO_CALL + - ENTITY_OPEN_STANDARD_CALL + - ENTITY_OPEN_URGENT_CALL + - ENTITY_AGED_CALL + - ENTITY_OPEN_DEBIT_CALL + coinbase.public_rest_api.XMLiquidatedAsset: + title: XMLiquidatedAsset provides per-asset detail for a liquidation type: object properties: - transaction_id: + asset: type: string - description: The ID of the transaction which staked to this validator - validator_address: + description: Asset currency + example: BTC + liquidated_amount: type: string - description: The address (public key) of the validator - validator_status: - $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorStatus' - coinbase.public_rest_api.TransferLocation: + description: Amount (nominal) of the asset that has been liquidated + example: "0.1" + liquidated_notional: + type: string + description: USD notional value of the liquidated amount + example: "11453.17" + remaining_amount: + type: string + description: Amount (nominal) of the asset remaining to be liquidated + example: "0.05" + remaining_notional: + type: string + description: USD notional value of the remaining amount + example: "5726.59" + coinbase.public_rest_api.XMLiquidationDetail: + title: XMLiquidationDetail provides detailed information about a single XM liquidation type: object properties: - type: - $ref: '#/components/schemas/coinbase.public_rest_api.TransferLocationType' - value: + liquidation_id: type: string - description: "The value of the transfer location: payment method ID, wallet\ - \ ID or crypto address" - example: 0bf7bf1e-bafa-4d7e-9312-fa0bf3b63f27 - address: + description: Financing liquidation UUID + example: 63a2577a-930d-413b-81e4-9e77765da8f9 + status: + $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidationStatus' + shortfall_amount: type: string - description: The crypto address of the transfer location - example: 0x742d35Cc6634C0532925a3b844Bc454e4438f44e - account_identifier: + description: USD notional shortfall amount that triggered the liquidation + example: "32083.26" + pre_liquidation_start_time: type: string - description: "The tag/memo of the address, if applicable -- required for\ - \ certain assets (e.g. XRP, XLM, etc.)" - example: "387879289" - coinbase.public_rest_api.TransferLocationType: - title: |- - - TRANSFER_LOCATION_TYPE_UNKNOWN: The nil value - - PAYMENT_METHOD: The ID of a fiat payment method - - WALLET: The ID of a wallet - - ADDRESS: A cryptocurrency address - - OTHER: Another type of transfer location: Blockchain Network, Coinbase - - MULTIPLE_ADDRESSES: Multiple cryptocurrency addresses - - COUNTERPARTY_ID: Counterparty ID + description: Timestamp when the pre-liquidation phase started + format: date-time + margin_summary: + $ref: '#/components/schemas/coinbase.public_rest_api.XMSummary' + liquidation_start_time: + type: string + description: Timestamp when active liquidation started + format: date-time + filled_amount: + type: string + description: USD notional amount that has been filled so far + example: "15000.00" + remaining_amount: + type: string + description: USD notional amount remaining to be liquidated + example: "17083.26" + liquidation_finish_time: + type: string + description: Timestamp when the liquidation finished + format: date-time + asset_breakdown: + type: array + description: Per-asset breakdown of liquidated amounts + items: + $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidatedAsset' + coinbase.public_rest_api.XMLiquidationStatus: + title: XMLiquidationStatus is the current status of an XM liquidation type: string + description: |- + - XM_LIQUIDATION_STATUS_PRE_LIQUIDATION: Liquidation is in the pre-liquidation phase + - XM_LIQUIDATION_STATUS_LIQUIDATING: Liquidation is actively in progress + - XM_LIQUIDATION_STATUS_LIQUIDATED: Liquidation has completed successfully + - XM_LIQUIDATION_STATUS_CANCELED: Liquidation was canceled + - XM_LIQUIDATION_STATUS_FAILED: Liquidation failed enum: - - PAYMENT_METHOD - - WALLET - - ADDRESS - - OTHER - - MULTIPLE_ADDRESSES - - COUNTERPARTY_ID - coinbase.public_rest_api.TravelRuleData: + - XM_LIQUIDATION_STATUS_PRE_LIQUIDATION + - XM_LIQUIDATION_STATUS_LIQUIDATING + - XM_LIQUIDATION_STATUS_LIQUIDATED + - XM_LIQUIDATION_STATUS_CANCELED + - XM_LIQUIDATION_STATUS_FAILED + coinbase.public_rest_api.XMLiquidationSummary: + title: XMLiquidationSummary provides a summary of a single XM liquidation type: object properties: - beneficiary: - $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleParty' - originator: - $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleParty' - is_self: - title: True if user owns the counterparty address (self-transfer) - type: boolean - is_intermediary: - type: boolean - description: True if Coinbase is being used as an intermediary for a customer - transfer. - opt_out_of_ownership_verification: - title: True to skip wallet ownership verification - type: boolean - attest_verified_wallet_ownership: - type: boolean - description: |- - Whether the originating VASP attests to verified wallet ownership. - When true with is_intermediary, enables automatic VASP data enrichment from the legal entity. - description: Data object used for withdrawals. - coinbase.public_rest_api.TravelRuleParty: + liquidation_id: + type: string + description: Financing liquidation UUID + example: 63a2577a-930d-413b-81e4-9e77765da8f9 + status: + $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidationStatus' + shortfall_amount: + type: string + description: USD notional shortfall amount that triggered the liquidation + example: "32083.26" + filled_amount: + type: string + description: USD notional amount that has been filled so far + example: "15000.00" + remaining_amount: + type: string + description: USD notional amount remaining to be liquidated + example: "17083.26" + created_at: + type: string + description: Timestamp when the liquidation was created + format: date-time + completed_at: + type: string + description: Timestamp when the liquidation was completed + format: date-time + coinbase.public_rest_api.XMLoan: + title: XMLoan contains details about a Cross Margin loan type: object properties: - name: - title: Legal name (for entities or simple name format) + loan_id: type: string - natural_person_name: - $ref: '#/components/schemas/coinbase.public_rest_api.NaturalPersonName' - address: - $ref: '#/components/schemas/coinbase.public_rest_api.DetailedAddress' - wallet_type: - $ref: '#/components/schemas/coinbase.public_rest_api.TravelRuleWalletType' - vasp_id: - title: VASP identifier when wallet_type is VASP + description: Financing loan UUID + example: b91a0ed6-eeec-4496-a04e-98b72b33c2b4 + loan_party: + $ref: '#/components/schemas/coinbase.public_rest_api.XMParty' + principal_currency: type: string - vasp_name: - title: VASP name fallback when vasp_id is unknown + description: Loan principal currency + example: BTC + principal_currency_market_price: type: string - personal_id: + description: Loan principal currency market price + example: "114531.73" + initial_principal_amount: + type: string + description: Principal amount (nominal) as of loan initiation + example: "0.2" + outstanding_principal_amount: + type: string + description: Current outstanding amount (nominal) + example: "0.2" + created_at: + type: string + description: Timestamp when the loan was created / initiated + format: date-time + updated_at: + type: string + description: Timestamp when the loan was last updated + format: date-time + coinbase.public_rest_api.XMMarginCall: + title: XMMarginCall contains details about a margin call in Cross Margin + type: object + properties: + margin_call_id: + type: string + description: Financing margin call UUID + example: 63a2577a-930d-413b-81e4-9e77765da8f9 + currency: + type: string + description: Margin call currency + example: USD + initial_notional_amount: + type: string + description: Call amount (notional) as of the margin call creation + example: "32083.26" + outstanding_notional_amount: + type: string + description: Current outstanding call amount (notional) + example: "32083.26" + margin_call_type: + $ref: '#/components/schemas/coinbase.public_rest_api.XMCallType' + margin_call_status: + $ref: '#/components/schemas/coinbase.public_rest_api.XMCallStatus' + called_with_margin_level: + $ref: '#/components/schemas/coinbase.public_rest_api.XMMarginLevel' + called_with_margin_summary: + $ref: '#/components/schemas/coinbase.public_rest_api.XMSummary' + due_at: type: string - description: |- - Personal identifier for travel rule compliance. - For individuals: passport number, national ID, driver's license. - For institutions: LEI (Legal Entity Identifier). - date_of_birth: - $ref: '#/components/schemas/google.type.Date' - telephone_number: + description: Timestamp when the margin call settlement is due + format: date-time + created_at: type: string - description: Telephone number for contact purposes. - account_id: + description: Timestamp when the margin call was created + format: date-time + updated_at: type: string - description: |- - Account identifier for travel rule compliance. - If not provided, defaults to portfolio ID. - vasp_address: - $ref: '#/components/schemas/coinbase.public_rest_api.DetailedAddress' - description: Represents a party in a travel rule transfer (originator or beneficiary). - coinbase.public_rest_api.TravelRuleStatus: - title: Travel rule compliance status for a transaction - type: string - enum: - - TRAVEL_RULE_STATUS_PENDING - - TRAVEL_RULE_STATUS_SUBMITTED - coinbase.public_rest_api.TravelRuleWalletType: - title: Type of wallet being used for transfers + description: Timestamp when the margin call was last updated + format: date-time + coinbase.public_rest_api.XMMarginLevel: + title: XMMarginLevel is the realtime state of EQ/MR and MR-EQ monitored against + XM thresholds as defined in the methodology type: string description: |- - - TRAVEL_RULE_WALLET_TYPE_UNSPECIFIED: Default unspecified wallet type - - TRAVEL_RULE_WALLET_TYPE_VASP: Centralized exchange wallet - - TRAVEL_RULE_WALLET_TYPE_SELF_CUSTODIED: Self-hosted/custodial wallet + - HEALTHY_THRESHOLD: Margin level is healthy + - DEFICIT_THRESHOLD: Margin level is breaching the deficit threshold (DT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call time (as defined in the margin methodology) + - WARNING_THRESHOLD: Margin level is breaching the warning threshold (WT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call (as defined in the margin methodology). WT is differentiated from DT in that it means margin health is approaching the UMCT + - URGENT_MARGIN_CALL_THRESHOLD: Margin level is breaching the UMCT and, as defined in the margin methodology, this will trigger an urgent margin call + - LIQUIDATION_THRESHOLD: Margin level is breaching the liquidation threshold (LT) and, as defined in the margin methodology, this will trigger the SESSION_LOCKED control status and liquidation may commence. enum: - - TRAVEL_RULE_WALLET_TYPE_VASP - - TRAVEL_RULE_WALLET_TYPE_SELF_CUSTODIED - coinbase.public_rest_api.UnstakeType: + - HEALTHY_THRESHOLD + - DEFICIT_THRESHOLD + - WARNING_THRESHOLD + - URGENT_MARGIN_CALL_THRESHOLD + - LIQUIDATION_THRESHOLD + coinbase.public_rest_api.XMParty: + title: XMParty is a specific Cross Margin trading venue type: string + description: |- + - CBE: Coinbase Exchange, trading venue that can receive the XM loan + - FCM: Coinbase’s Futures Commission Merchant, trading venue that can receive the XM loan enum: - - UNSTAKE_TYPE_PARTIAL - - UNSTAKE_TYPE_FULL - coinbase.public_rest_api.UnstakingStatus: - required: - - amount - - estimate_description - - estimate_type + - CBE + - FCM + coinbase.public_rest_api.XMPosition: + title: XMPosition type: object properties: - amount: + currency: type: string - description: "Amount being unstaked (whole amount, e.g., 16 ETH)" - example: "16" - unstake_type: - $ref: '#/components/schemas/coinbase.public_rest_api.UnstakeType' - finishing_at: + description: Position currency + example: BTC + market_price: type: string - description: Estimated date when unstaking will complete (ISO 8601 format) - format: date-time - example: 2025-10-27T00:00:00Z - remaining_hours: - type: integer - description: Estimated hours until this unstaking request completes - format: int64 - example: 672 - requested_at: + description: Current market price + example: "114531.73" + margin_eligible: + type: boolean + description: "True if margin eligible, false otherwise" + example: true + market_cap: type: string - description: Timestamp when the unstake request was originally created - format: date-time - example: 2025-09-29T12:00:00Z - estimate_type: - $ref: '#/components/schemas/coinbase.public_rest_api.EstimateType' - estimate_description: + description: Total market capitalization + example: "770000000000.00" + adv30_days: type: string - description: Detailed explanation of the estimate status for display to - users. - example: Live estimate based on current network conditions - coinbase.public_rest_api.UpdateFundingSettingsResponse: - type: object - properties: - activity_id: + description: Average daily volume calculated over a 30-day period + example: "1166623585.534257" + hist5d_vol: type: string - description: Identifier for the created activity / proposal - activity_type: + description: Historic volatility calculated over a 5-day period + example: "0.010996074377389616" + hist30d_vol: type: string - description: Type of the activity (e.g. PCS proposal type) - num_approvals_remaining: - type: integer - description: Number of approvals still required before the change applies - format: int32 - coinbase.public_rest_api.UserAction: - type: object - properties: - action: - $ref: '#/components/schemas/coinbase.public_rest_api.Action' - user_id: + description: Historic volatility calculated over a 30-day period + example: "0.013617999336643158" + hist90d_vol: type: string - description: Id of the user who executed the action - timestamp: + description: Historic volatility calculated over a 90-day period + example: "0.015196480084775355" + margin_requirement: type: string - description: Time the action was taken - coinbase.public_rest_api.UserRole: - title: Indicates the user's role - type: string - description: |- - - USER_ROLE_UNKNOWN: nil value - - AUDITOR: An auditor - - SIGNATORY: A signatory - - ADMIN: An admin - - INITIATOR: An initiator - - REVIEWER: A reviewer - - TRADER: A trader - - FULL_TRADER: A trader with full permissions - - TEAM_MANAGER: A team manager - - APPROVER: An approver - - TAX_MANAGER: A tax manager - - BUSINESS_MANAGER: A business manager - enum: - - AUDITOR - - SIGNATORY - - ADMIN - - INITIATOR - - REVIEWER - - TRADER - - FULL_TRADER - - TEAM_MANAGER - - APPROVER - - TAX_MANAGER - - BUSINESS_MANAGER - coinbase.public_rest_api.ValidatorAllocation: - required: - - amount - - validator_address - type: object - properties: - validator_address: + description: Base margin requirement for the specific asset + example: "0.015" + spot_balance: type: string - description: The validator address for performing staking operations - amount: + description: XM spot balance nominal + example: "-0.19652944" + spot_balance_notional: type: string - description: Amount for performing staking operations with this validator - description: |- - ValidatorAllocation specifies the validator and amount for staking or unstaking. - Used for granular ETH V2 validator-level staking or unstaking operations. - coinbase.public_rest_api.ValidatorProvider: - type: string - description: ValidatorProvider enumerates the ETH validator service providers - accepted for unstaking. - enum: - - VALIDATOR_PROVIDER_COINBASE_CLOUD - - VALIDATOR_PROVIDER_MAVAN - - VALIDATOR_PROVIDER_FIGMENT - - VALIDATOR_PROVIDER_CODEFI - - VALIDATOR_PROVIDER_ATTESTANT - - VALIDATOR_PROVIDER_GALAXY - coinbase.public_rest_api.ValidatorStakingInfo: - required: - - statuses - - validator_address - type: object - properties: - validator_address: + description: XM spot balance notional + example: "-22508.85" + spot_total_position_margin: type: string - description: The validator address (public key) - statuses: - type: array - description: List of active staking requests for this validator - items: - $ref: '#/components/schemas/coinbase.public_rest_api.StakingStatus' - coinbase.public_rest_api.ValidatorStatus: + description: Pre-netted spot total position margin + futures_balance: + type: string + description: XM futures balance nominal + example: "-0.19652944" + futures_balance_notional: + type: string + description: XM futures balance notional + example: "-22508.85" + futures_total_position_margin: + type: string + description: Pre-netted futures total position margin + gmv_basis: + type: string + description: Basis GMV = |futures| + |spot| - |unnetted position| + base_requirement: + type: string + description: Base margin requirement notional + liq_shorts_add_on: + type: string + description: Effective liquidity add-on for the short positions + liq_longs_add_on: + type: string + description: Effective liquidity add-on for the long positions + vol_shorts_add_on: + type: string + description: Effective volatility add-on for the short positions + vol_longs_add_on: + type: string + description: Effective volatility add-on for the long positions + vol5days_add_on: + type: string + description: 5-day volatility add-on + vol30days_add_on: + type: string + description: 30-day volatility add-on + vol90days_add_on: + type: string + description: 90-day volatility add-on + total_position_margin: + type: string + description: Total margin required + coinbase.public_rest_api.XMPositionType: type: string + description: |- + Type of a position leg within a per-asset XM row. New values may be added as more legs are broken out. + + - XM_POSITION_TYPE_UNSPECIFIED: The position type is unavailable, or is not recognized by this API version. + - XM_POSITION_TYPE_SPOT_TRADING: Spot balance held outside Prime Vault (trading balance, including Prime Loans). + - XM_POSITION_TYPE_SPOT_VAULT: Spot balance held in Prime Vault. enum: - - VALIDATOR_STATUS_PENDING - - VALIDATOR_STATUS_ACTIVE - - VALIDATOR_STATUS_EXITING - - VALIDATOR_STATUS_EXITED - - VALIDATOR_STATUS_WITHDRAWN - coinbase.public_rest_api.ValidatorUnstakePreview: + - XM_POSITION_TYPE_SPOT_TRADING + - XM_POSITION_TYPE_SPOT_VAULT + coinbase.public_rest_api.XMRiskNettingInfo: type: object properties: - validator_address: + dco_margin_requirement: type: string - description: Public address of the validator being unstaked from - estimated_unstaking_amount: + description: "Derivatives Clearing Organization Margin Requirement (DMR)\ + \ is the margin requirement for all futures positions, derived from the\ + \ Derivatives Clearing Organization model" + example: "9243.25" + portfolio_margin_requirement: type: string - description: Estimated amount that would be unstaked from this validator - (in ETH) - unstake_time_estimate_in_hours: - type: number - description: "Estimated time until this validator's unstake completes, in\ - \ hours" - format: double - estimated_unstake_date: + description: "Portfolio Margin Requirement (PMR) is the margin requirement\ + \ for all spot positions, derived from the XM model" + example: "9003.67" + integrated_portfolio_margin_requirement: type: string - description: Estimated date when this validator's unstake will complete - (ISO 8601) - description: ValidatorUnstakePreview contains the per-validator breakdown for - an unstake preview. - coinbase.public_rest_api.ValidatorUnstakingInfo: - required: - - statuses - - validator_address - type: object - properties: - validator_address: + description: "Integrated Portfolio Margin Requirement (IPMR) is the margin\ + \ requirement for all spot positions + futures positions with underlying\ + \ assets eligible in Portfolio Margin, via the XM model with one-leg netting" + example: "10154.67" + ineligible_futures_margin_requirement: type: string - description: The validator address (public key) - statuses: + description: Ineligible Futures Margin Requirement (IFMR) is the margin + requirement for IPMR-ineligible futures contracts + example: "194.36" + position_margin_requirement: + type: string + description: Position margin requirement for all spot positions + example: "3376.45" + portfolio_margin_addon: + type: string + description: Portfolio margin addon for all spot positions + example: "5627.21" + integrated_position_margin_requirement: + type: string + description: Position margin requirement for spot + futures positions + example: "3376.45" + integrated_portfolio_margin_addon: + type: string + description: Portfolio margin addon for spot + futures positions + example: "6778.21" + netted_futures_notional: + type: string + description: Post-netting USD notional for all futures positions + example: "11510.00" + total_gmv_basis: + type: string + description: Total basis gross market value of all XM-eligible positions + (i.e. crypto underliers) + ipm_cash_balance: + type: string + description: Integrated Portfolio Margin cash balance + example: "1002.94" + integrated_scenario_addon: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn' + all_integrated_scenario_addons: type: array - description: List of active unstaking requests for this validator + description: All integrated scenario add-ons items: - $ref: '#/components/schemas/coinbase.public_rest_api.UnstakingStatus' - coinbase.public_rest_api.VisibilityStatus: - title: |- - - UNKNOWN_VISIBILITY_STATUS: nil - - VISIBLE: Visible - - HIDDEN: Hidden - - SPAM: Spam - type: string - enum: - - VISIBLE - - HIDDEN - - SPAM - coinbase.public_rest_api.Wallet: + $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn' + xm_positions: + type: array + description: Netted positions used in the model calculation + items: + $ref: '#/components/schemas/coinbase.public_rest_api.XMPosition' + coinbase.public_rest_api.XMSummary: + title: "XMSummary is the realtime evaluated XM margin model, containing positions\ + \ and netting info" type: object properties: - id: - title: The unique UUID for the wallet + margin_requirement: type: string - name: - title: The name of the wallet + description: Cross Margin Margin Requirement (XMMR) notional + example: "10362.72" + account_equity: type: string - symbol: - title: The asset stored in the wallet + description: Equity notional + example: "-21542.63" + margin_excess_shortfall: type: string - type: - $ref: '#/components/schemas/coinbase.public_rest_api.WalletType' - created_at: - title: The UTC timestamp when this wallet was created + description: Equity - XMMR (margin excess is > 0) + example: "-31891.67" + consumed_credit: type: string - format: date-time - address: - title: The active address of the wallet + description: Credit consumed from Cross Margin Credit Limit (XMCL) + example: "22906.34" + xm_credit_limit: type: string - visibility: - $ref: '#/components/schemas/coinbase.public_rest_api.WalletVisibility' - network: - $ref: '#/components/schemas/coinbase.public_rest_api.Network' - coinbase.public_rest_api.WalletClaimRewardsInputs: + description: XM Credit Limit (XMCL) is the maximum notional USD of total + fiat and digital asset loans + example: "1222322.00" + xm_margin_limit: + type: string + description: XM Margin Limit (XMML) is the maximum notional USD deficit + example: "22123.00" + spot_equity: + type: string + description: Equity attributed by spot + example: "-21505.91" + futures_equity: + type: string + description: Equity attributed by futures + example: "-36.71" + risk_netting_info: + $ref: '#/components/schemas/coinbase.public_rest_api.XMRiskNettingInfo' + google.type.Date: + title: |- + Represents a whole or partial calendar date, such as a birthday. The time of + day and time zone are either specified elsewhere or are insignificant. The + date is relative to the Gregorian Calendar. This can represent one of the + following: type: object properties: - amount: - type: string - description: "Optional amount to claim rewards (ETH only). If omitted, the\ - \ wallet will claim the maximum amount available" + year: + type: integer + description: |- + Year of the date. Must be from 1 to 9999, or 0 to specify a date without + a year. + format: int32 + month: + type: integer + description: |- + Month of a year. Must be from 1 to 12, or 0 to specify a year without a + month and day. + format: int32 + day: + type: integer + description: |- + Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 + to specify a year by itself or a year and month where the day isn't + significant. + format: int32 description: |- - WalletClaimRewardsInputs contains the custom inputs for claim rewards operations on a wallet. - Requirements and supported fields vary by asset type. - coinbase.public_rest_api.WalletCryptoDepositInstructions: + * A full date, with non-zero year, month, and day values. + * A month and day, with a zero year (for example, an anniversary). + * A year on its own, with a zero month and a zero day. + * A year and month, with a zero day (for example, a credit card expiration + date). + + Related types: + + * [google.type.TimeOfDay][google.type.TimeOfDay] + * [google.type.DateTime][google.type.DateTime] + * [google.protobuf.Timestamp][google.protobuf.Timestamp] + coinbase.public_rest_api.beta.CreateWebhookSubscriptionResponse: type: object properties: - id: - type: string - description: The ID of the wallet - example: e84255eb-2e21-439e-a1d0-f5dd1e1292b9 - name: - type: string - description: The name of the wallet - example: Wallet 1 - type: - $ref: '#/components/schemas/coinbase.public_rest_api.WalletDepositInstructionType' - address: + subscription: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookSubscription' + hmac_secret: type: string - description: The address of the wallet - example: ca13fdc4-e459-4fd9-868e-82291343b213 - account_identifier: - type: string - description: "The tag/memo of the address, if applicable -- required for\ - \ certain assets (e.g. XRP, XLM, etc.)" - example: "387879289" - account_identifier_name: - type: string - description: "The blockchain network's terminology for the unique identifier\ - \ used to identify the receiver of the transaction (different blockchain\ - \ networks use different names, such as `destination_tag` or `memo`)" - example: memo - network: - $ref: '#/components/schemas/coinbase.public_rest_api.Network' - coinbase.public_rest_api.WalletDepositInstructionType: - title: Indicates the wallet's deposit instruction type + description: |- + hmac_secret is the plaintext HMAC signing secret. Returned exactly once + on creation; store it securely — it is never surfaced again. + description: CreateWebhookSubscriptionResponse returns the created subscription + and its one-time HMAC secret. + coinbase.public_rest_api.beta.WebhookAuthType: type: string description: |- - - UNKNOWN_WALLET_DEPOSIT_TYPE: nil value - - CRYPTO: A cryptocurrency deposit - - WIRE: A wire deposit - - SEN: DEPRECATED. A Silvergate Exchange Network deposit - - SWIFT: A SWIFT deposit - - SEPA: A SEPA deposit (Single Euro Payments Area) + WebhookAuthType is how Prime authenticates to your endpoint, on top of the + signatures. Every delivery is signed twice, whatever the auth type: with + HMAC-SHA256 in X-Coinbase-Signature, keyed by the subscription's + hmac_secret, and with Ed25519 in X-Coinbase-Signature-Ed25519, verifiable + with the public key named by X-Coinbase-Signature-Key-Id at + /.well-known/jwks.json. Verify either one. + + - WEBHOOK_AUTH_TYPE_SIGNATURE_ONLY: Signatures only. Used when a subscription is created without auth_type. + - WEBHOOK_AUTH_TYPE_OAUTH: Signatures plus an OAuth 2.0 bearer token, fetched with oauth_config, in + the Authorization header. + - WEBHOOK_AUTH_TYPE_MTLS: Signatures plus a Coinbase client certificate (mutual TLS). + - WEBHOOK_AUTH_TYPE_OAUTH_MTLS: Signatures plus both an OAuth 2.0 bearer token and a client certificate. enum: - - CRYPTO - - WIRE - - SEN - - SWIFT - - SEPA - coinbase.public_rest_api.WalletFiatDepositInstructions: + - WEBHOOK_AUTH_TYPE_SIGNATURE_ONLY + - WEBHOOK_AUTH_TYPE_OAUTH + - WEBHOOK_AUTH_TYPE_MTLS + - WEBHOOK_AUTH_TYPE_OAUTH_MTLS + coinbase.public_rest_api.beta.WebhookOAuthConfigInput: type: object properties: - id: - title: The id of the wallet - type: string - name: - title: The name of the wallet - type: string - type: - $ref: '#/components/schemas/coinbase.public_rest_api.WalletDepositInstructionType' - account_number: - title: The fiat account number + token_url: type: string - routing_number: - title: The fiat routing number + client_id: type: string - reference_code: - title: Reference code to be used as a memo/description + client_secret: type: string - coinbase.public_rest_api.WalletStakeInputs: + scopes: + type: array + items: + type: string + description: WebhookOAuthConfigInput supplies OAuth credentials and scopes for + a subscription. + coinbase.public_rest_api.beta.ListWebhookSubscriptionsResponse: type: object properties: - amount: + subscriptions: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookSubscription' + next_cursor: type: string - description: "Optional amount to stake (ETH only). If omitted, the wallet\ - \ will stake the maximum amount available" - validator_address: + has_next: + type: boolean + description: ListWebhookSubscriptionsResponse returns a page of subscriptions + and pagination metadata. + coinbase.public_rest_api.beta.GetWebhookSubscriptionResponse: + type: object + properties: + subscription: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookSubscription' + description: GetWebhookSubscriptionResponse returns the requested subscription + without authentication secrets. + coinbase.public_rest_api.beta.UpdateWebhookSubscriptionResponse: + type: object + properties: + subscription: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookSubscription' + description: UpdateWebhookSubscriptionResponse returns the updated subscription + without authentication secrets. + coinbase.public_rest_api.beta.DeleteWebhookSubscriptionResponse: + type: object + description: DeleteWebhookSubscriptionResponse confirms that the subscription + was soft-deleted. + coinbase.public_rest_api.beta.RotateWebhookHMACSecretResponse: + type: object + properties: + subscription: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookSubscription' + hmac_secret: type: string - description: "Optional validator address, defaults to Coinbase validator.\ - \ For SOL, must be the vote account address. Ignored for ETH." - end_date: + description: |- + hmac_secret is the new plaintext HMAC signing secret. Returned exactly once; + store it securely — it is never surfaced again. + previous_secret_expires_at: type: string - description: Optional delegation end date in ISO date format (e.g. 2026-07-15). - Required for AVAX; minimum 14-day delegation period applies. + description: |- + previous_secret_expires_at is when the prior secret stops being accepted. + Unset when revoke_previous_immediately was true. + format: date-time description: |- - WalletStakeInputs contains the custom inputs for staking operations on a wallet. - Requirements and supported fields vary by asset type. - coinbase.public_rest_api.WalletStakingMetadata: + RotateWebhookHMACSecretResponse is the response message for rotating a webhook + HMAC signing secret. + coinbase.public_rest_api.beta.SendWebhookSimulationResponse: type: object properties: - external_id: + event_id: type: string - description: An optional custom identifier (up to 255 bytes) to attach to - the transaction. This is not a searchable transaction field. Retries with - the same idempotency_key must use the same external_id; a differing value - on retry will be silently ignored. - description: |- - WalletStakingMetadata contains optional metadata for wallet staking requests. - external_id tags the discrete TWS transaction stake/unstake create; automatic reward crediting (e.g. SOL inflation) does not produce one. - StakingClaimRewardsRequest intentionally omits this field; add metadata to claim rewards only if a supported network's claim flow creates a discrete TWS transaction clients need to tag. - coinbase.public_rest_api.WalletType: - title: Indicates the wallet type - type: string - description: |- - - VAULT: A crypto vault - - TRADING: A trading wallet - - WALLET_TYPE_OTHER: Other wallet types (like consumer, etc) - - QC: A QC Wallet - - ONCHAIN: An Onchain wallet - enum: - - VAULT - - TRADING - - WALLET_TYPE_OTHER - - QC - - ONCHAIN - coinbase.public_rest_api.WalletUnstakeInputs: + description: SendWebhookSimulationResponse identifies the synthetic event created + for the test delivery. + coinbase.public_rest_api.beta.GetWebhookEventTypesResponse: type: object properties: - amount: + event_types: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookEventType' + description: GetWebhookEventTypesResponse lists the webhook event types available + for subscriptions. + coinbase.public_rest_api.beta.GetWebhookDeliveryLogsResponse: + type: object + properties: + entries: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookDeliveryLogEntry' + next_cursor: type: string - description: "Optional amount to unstake (ETH only). If omitted, the wallet\ - \ will unstake the maximum amount available" - validator_allocations: + has_next: + type: boolean + description: GetWebhookDeliveryLogsResponse returns a page of delivery logs + and pagination metadata. + coinbase.public_rest_api.beta.GetWebhookDeliveryAttemptsResponse: + type: object + properties: + event_id: + type: string + event_type: + type: string + subscription_id: + type: string + delivery_status: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookDeliveryStatus' + attempts: type: array - description: (Alpha) Optional validator-level allocations for ETH V2 unstaking. - Allows specifying which validators to unstake from and how much. This - feature is in alpha. Please reach out to your Coinbase Prime account manager - for more information items: - $ref: '#/components/schemas/coinbase.public_rest_api.ValidatorAllocation' - validator_address: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookDeliveryAttempt' + event_payload: + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string - description: Optional validator address to unstake from. Only supported - for a subset of protocols. - description: |- - WalletUnstakeInputs contains the custom inputs for unstaking operations on a wallet. - Requirements and supported fields vary by asset type. - coinbase.public_rest_api.WalletVisibility: - type: string - enum: - - WALLET_VISIBILITY_VISIBLE - - WALLET_VISIBILITY_HIDDEN - coinbase.public_rest_api.Web3Asset: + description: event_payload is the raw JSON bytes delivered to the subscriber. + format: byte + description: "GetWebhookDeliveryAttemptsResponse returns an event's payload,\ + \ delivery state, and attempts for a subscription." + coinbase.public_rest_api.beta.GetWebhookSubscriptionStatsResponse: type: object properties: - network: - title: Network this asset is on (ie "ethereum-mainnet") + subscription_id: type: string - contract_address: + health_status: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookHealthStatus' + total_events: type: string - description: Contract Address of this asset (empty for native assets). - symbol: + format: int64 + successful: type: string - description: Symbol of this asset. - token_id: + format: int64 + failed: type: string - description: Token ID of this asset (empty for non NFT assets). - name: + format: int64 + success_rate: + type: number + format: double + avg_latency_ms: type: string - description: "Name of this asset, either the name of the crypto token or\ - \ the NFT collection name." - coinbase.public_rest_api.Web3Balance: + format: int64 + p95_latency_ms: + type: string + format: int64 + p99_latency_ms: + type: string + format: int64 + event_type_breakdown: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookEventTypeStats' + recent_failures: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookRecentFailure' + in_progress: + type: string + format: int64 + description: "GetWebhookSubscriptionStatsResponse returns subscription health,\ + \ delivery statistics, and recent failures." + coinbase.public_rest_api.beta.GetWebhookOwnerStatsResponse: type: object properties: - asset: - $ref: '#/components/schemas/coinbase.public_rest_api.Web3Asset' - amount: + total_subscriptions: type: string - description: The total amount in whole units with full precision. - example: "109.42" - visibility_status: - $ref: '#/components/schemas/coinbase.public_rest_api.VisibilityStatus' - coinbase.public_rest_api.Web3TransactionMetadata: + format: int64 + active_subscriptions: + type: string + format: int64 + total_events: + type: string + format: int64 + overall_success_rate: + type: number + format: double + avg_latency_ms: + type: string + format: int64 + subscriptions: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookSubscriptionSummary' + recent_failures: + type: array + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookRecentFailure' + description: GetWebhookOwnerStatsResponse summarizes delivery statistics across + a portfolio's subscriptions. + coinbase.public_rest_api.beta.ReplayWebhookEventResponse: type: object properties: - label: - type: string - description: The transaction type label of the confirmed transaction post - settlement - confirmed_asset_changes: + deliveries_queued: + type: integer + format: int32 + delivery_ids: type: array - description: The confirmed asset changes (onchain) items: - $ref: '#/components/schemas/coinbase.public_rest_api.AssetChange' - coinbase.public_rest_api.WithdrawalPower: + type: string + delivery_ids_truncated: + type: boolean + description: ReplayWebhookEventResponse reports the number and identifiers of + queued replay deliveries. + coinbase.public_rest_api.beta.GetRewardsRateResponse: type: object properties: - symbol: - type: string - description: The currency symbol - example: BTC - amount: + current_rate: type: string - description: Withdrawal power - example: "2.84882377" - coinbase.public_rest_api.XMCallStatus: - title: XMCallStatus is the current status of the margin call - type: string - description: |- - - CALL_STATUS_OPEN: Margin call is open and not expired - - CALL_STATUS_AGED: Margin call is open and it is expired - - CALL_STATUS_SETTLED: Margin call is fully settled - - CALL_STATUS_CANCELED: Margin call was canceled by Credit Risk - enum: - - CALL_STATUS_OPEN - - CALL_STATUS_AGED - - CALL_STATUS_SETTLED - - CALL_STATUS_CANCELED - coinbase.public_rest_api.XMCallType: - title: XMCallType is the type of margin call - type: string - description: |- - - CALL_TYPE_STANDARD: Evaluated at standard margin call evaluation time - - CALL_TYPE_URGENT: Evaluated in realtime - - CALL_TYPE_DEBIT: Evaluated at debit call evaluation time - enum: - - CALL_TYPE_STANDARD - - CALL_TYPE_URGENT - - CALL_TYPE_DEBIT - coinbase.public_rest_api.XMControlStatus: - title: XMControlStatus is a summarization of XM customer controls for trades - and withdrawals - type: string - description: |- - - TRADES_AND_WITHDRAWALS: Allowed to trade and withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled. - - TRADES_ONLY: Allowed to trade but not withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled. - - SESSION_LOCKED: Not allowed to trade or withdraw. See XM Margin Methodology for full description of when trading and withdrawals are enabled or disabled. - enum: - - TRADES_AND_WITHDRAWALS - - TRADES_ONLY - - SESSION_LOCKED - coinbase.public_rest_api.XMEntityCallStatus: - type: string - description: |- - XMEntityCallStatus summarizes the state of open margin calls or debit calls. When multiple calls exist, the status reflects the highest priority call type. - Priority order (highest to lowest): aged > urgent > standard > debit. - - - ENTITY_NO_CALL: There are no margin calls or debit calls. - - ENTITY_OPEN_STANDARD_CALL: There is a standard margin call. There may also be debit calls, but there are no urgent margin calls or expired calls.. - - ENTITY_OPEN_URGENT_CALL: There is an urgent margin call. There may also be standard margin calls or debit calls, but there are no expired calls. - - ENTITY_AGED_CALL: At least one open margin call (standard or urgent) or debit call is aged. This will trigger the SESSION_LOCKED control status. - - ENTITY_OPEN_DEBIT_CALL: There is a debit call. There are no standard margin calls, urgent margin calls, or expired calls. - enum: - - ENTITY_NO_CALL - - ENTITY_OPEN_STANDARD_CALL - - ENTITY_OPEN_URGENT_CALL - - ENTITY_AGED_CALL - - ENTITY_OPEN_DEBIT_CALL - coinbase.public_rest_api.XMLiquidatedAsset: - title: XMLiquidatedAsset provides per-asset detail for a liquidation + description: The current effective rewards rate. + example: "0.045" + available_rates: + type: array + description: "All available rewards rates, including qualifying bounds for\ + \ each rate." + items: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.RewardsRateTier' + description: GetRewardsRateResponse returns the current rewards rate and the + available rates. + coinbase.public_rest_api.beta.WebhookSubscription: type: object properties: - asset: + subscription_id: type: string - description: Asset currency - example: BTC - liquidated_amount: + event_types: + type: array + items: + type: string + target_url: + type: string + auth_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookAuthType' + oauth_config: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookOAuthConfig' + custom_headers: + type: object + additionalProperties: + type: string + is_enabled: + type: boolean + description: type: string - description: Amount (nominal) of the asset that has been liquidated - example: "0.1" - liquidated_notional: + created_by: type: string - description: USD notional value of the liquidated amount - example: "11453.17" - remaining_amount: + updated_by: type: string - description: Amount (nominal) of the asset remaining to be liquidated - example: "0.05" - remaining_notional: + created_at: + type: string + format: date-time + updated_at: + type: string + format: date-time + health_status: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookHealthStatus' + version: + type: string + format: int64 + description: |- + WebhookSubscription is the customer-facing representation of a webhook + subscription. auth secrets (hmac_secret, oauth client_secret) are never + included; hmac_secret is returned exactly once in CreateWebhookSubscriptionResponse. + coinbase.public_rest_api.beta.WebhookEventType: + type: object + properties: + name: + type: string + domain_object: type: string - description: USD notional value of the remaining amount - example: "5726.59" - coinbase.public_rest_api.XMLiquidationDetail: - title: XMLiquidationDetail provides detailed information about a single XM liquidation + description: + type: string + description: WebhookEventType describes a registered webhook event customers + can subscribe to. + coinbase.public_rest_api.beta.WebhookDeliveryLogEntry: type: object properties: - liquidation_id: + delivery_id: type: string - description: Financing liquidation UUID - example: 63a2577a-930d-413b-81e4-9e77765da8f9 - status: - $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidationStatus' - shortfall_amount: + event_id: type: string - description: USD notional shortfall amount that triggered the liquidation - example: "32083.26" - pre_liquidation_start_time: + event_type: + type: string + delivery_status: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookDeliveryStatus' + status_code: + type: integer + format: int32 + latency_ms: + type: integer + format: int32 + attempt_number: + type: integer + format: int32 + max_retries: + type: integer + format: int32 + error_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookErrorType' + error_message: + type: string + is_test: + type: boolean + is_replay: + type: boolean + occurred_at: type: string - description: Timestamp when the pre-liquidation phase started format: date-time - margin_summary: - $ref: '#/components/schemas/coinbase.public_rest_api.XMSummary' - liquidation_start_time: + attempted_at: type: string - description: Timestamp when active liquidation started format: date-time - filled_amount: + description: WebhookDeliveryLogEntry summarizes a webhook event delivery and + its latest attempt. + coinbase.public_rest_api.beta.WebhookDeliveryStatus: + type: string + description: WebhookDeliveryStatus describes the delivery state of a webhook + event. + enum: + - WEBHOOK_DELIVERY_STATUS_DELIVERED + - WEBHOOK_DELIVERY_STATUS_RETRYING + - WEBHOOK_DELIVERY_STATUS_FAILED + - WEBHOOK_DELIVERY_STATUS_PENDING + coinbase.public_rest_api.beta.WebhookDeliveryAttempt: + type: object + properties: + delivery_attempt_id: type: string - description: USD notional amount that has been filled so far - example: "15000.00" - remaining_amount: + delivery_id: type: string - description: USD notional amount remaining to be liquidated - example: "17083.26" - liquidation_finish_time: + attempt_number: + type: integer + format: int32 + status_code: + type: integer + format: int32 + latency_ms: + type: integer + format: int32 + error_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookErrorType' + error_message: + type: string + attempted_at: type: string - description: Timestamp when the liquidation finished format: date-time - asset_breakdown: - type: array - description: Per-asset breakdown of liquidated amounts - items: - $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidatedAsset' - coinbase.public_rest_api.XMLiquidationStatus: - title: XMLiquidationStatus is the current status of an XM liquidation + description: WebhookDeliveryAttempt records the outcome and timing of an individual + delivery attempt. + coinbase.public_rest_api.beta.WebhookHealthStatus: type: string - description: |- - - XM_LIQUIDATION_STATUS_PRE_LIQUIDATION: Liquidation is in the pre-liquidation phase - - XM_LIQUIDATION_STATUS_LIQUIDATING: Liquidation is actively in progress - - XM_LIQUIDATION_STATUS_LIQUIDATED: Liquidation has completed successfully - - XM_LIQUIDATION_STATUS_CANCELED: Liquidation was canceled - - XM_LIQUIDATION_STATUS_FAILED: Liquidation failed + description: WebhookHealthStatus describes the current delivery health of a + subscription. enum: - - XM_LIQUIDATION_STATUS_PRE_LIQUIDATION - - XM_LIQUIDATION_STATUS_LIQUIDATING - - XM_LIQUIDATION_STATUS_LIQUIDATED - - XM_LIQUIDATION_STATUS_CANCELED - - XM_LIQUIDATION_STATUS_FAILED - coinbase.public_rest_api.XMLiquidationSummary: - title: XMLiquidationSummary provides a summary of a single XM liquidation + - WEBHOOK_HEALTH_STATUS_HEALTHY + - WEBHOOK_HEALTH_STATUS_DEGRADED + - WEBHOOK_HEALTH_STATUS_FAILING + - WEBHOOK_HEALTH_STATUS_DISABLED + coinbase.public_rest_api.beta.WebhookEventTypeStats: type: object properties: - liquidation_id: + event_type: type: string - description: Financing liquidation UUID - example: 63a2577a-930d-413b-81e4-9e77765da8f9 - status: - $ref: '#/components/schemas/coinbase.public_rest_api.XMLiquidationStatus' - shortfall_amount: + total: type: string - description: USD notional shortfall amount that triggered the liquidation - example: "32083.26" - filled_amount: + format: int64 + successful: type: string - description: USD notional amount that has been filled so far - example: "15000.00" - remaining_amount: + format: int64 + success_rate: + type: number + format: double + avg_latency_ms: type: string - description: USD notional amount remaining to be liquidated - example: "17083.26" - created_at: + format: int64 + failed: type: string - description: Timestamp when the liquidation was created - format: date-time - completed_at: + format: int64 + in_progress: type: string - description: Timestamp when the liquidation was completed - format: date-time - coinbase.public_rest_api.XMLoan: - title: XMLoan contains details about a Cross Margin loan + format: int64 + description: WebhookEventTypeStats contains aggregated delivery statistics for + one event type. + coinbase.public_rest_api.beta.WebhookRecentFailure: type: object properties: - loan_id: - type: string - description: Financing loan UUID - example: b91a0ed6-eeec-4496-a04e-98b72b33c2b4 - loan_party: - $ref: '#/components/schemas/coinbase.public_rest_api.XMParty' - principal_currency: + delivery_id: type: string - description: Loan principal currency - example: BTC - principal_currency_market_price: + subscription_id: type: string - description: Loan principal currency market price - example: "114531.73" - initial_principal_amount: + event_id: type: string - description: Principal amount (nominal) as of loan initiation - example: "0.2" - outstanding_principal_amount: + event_type: type: string - description: Current outstanding amount (nominal) - example: "0.2" - created_at: + error_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookErrorType' + attempt_number: + type: integer + format: int32 + attempted_at: type: string - description: Timestamp when the loan was created / initiated format: date-time - updated_at: + description: WebhookRecentFailure identifies a recent failed delivery attempt. + coinbase.public_rest_api.beta.WebhookSubscriptionSummary: + type: object + properties: + subscription_id: type: string - description: Timestamp when the loan was last updated - format: date-time - coinbase.public_rest_api.XMMarginCall: - title: XMMarginCall contains details about a margin call in Cross Margin + description: + type: string + health_status: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.WebhookHealthStatus' + events_in_period: + type: string + format: int64 + success_rate: + type: number + format: double + description: WebhookSubscriptionSummary summarizes a subscription's health and + delivery statistics. + coinbase.public_rest_api.beta.RewardsRateTier: type: object properties: - margin_call_id: + rate: type: string - description: Financing margin call UUID - example: 63a2577a-930d-413b-81e4-9e77765da8f9 - currency: + description: Rate for this tier. + example: "0.045" + lower_limit: type: string - description: Margin call currency - example: USD - initial_notional_amount: + description: Lower bound of the tier's qualifying criteria (e.g. balance + floor). + example: "0" + upper_limit: type: string - description: Call amount (notional) as of the margin call creation - example: "32083.26" - outstanding_notional_amount: + description: Upper bound of the tier's qualifying criteria. + example: "1000000" + criteria_type: + $ref: '#/components/schemas/coinbase.public_rest_api.beta.RewardsRateTierType' + description: RewardsRateTier is a single tier in the rewards rate card. + coinbase.public_rest_api.beta.WebhookOAuthConfig: + type: object + properties: + token_url: type: string - description: Current outstanding call amount (notional) - example: "32083.26" - margin_call_type: - $ref: '#/components/schemas/coinbase.public_rest_api.XMCallType' - margin_call_status: - $ref: '#/components/schemas/coinbase.public_rest_api.XMCallStatus' - called_with_margin_level: - $ref: '#/components/schemas/coinbase.public_rest_api.XMMarginLevel' - called_with_margin_summary: - $ref: '#/components/schemas/coinbase.public_rest_api.XMSummary' - due_at: + client_id: type: string - description: Timestamp when the margin call settlement is due - format: date-time - created_at: + scopes: + type: array + items: + type: string + description: WebhookOAuthConfig describes a subscription's OAuth configuration + without its client secret. + coinbase.public_rest_api.beta.WebhookErrorType: + type: string + description: WebhookErrorType classifies the outcome of a webhook delivery attempt. + enum: + - WEBHOOK_ERROR_TYPE_SUCCESS + - WEBHOOK_ERROR_TYPE_HTTP_4XX + - WEBHOOK_ERROR_TYPE_HTTP_5XX + - WEBHOOK_ERROR_TYPE_TIMEOUT + - WEBHOOK_ERROR_TYPE_CONNECTION_ERROR + - WEBHOOK_ERROR_TYPE_HTTP_3XX + - WEBHOOK_ERROR_TYPE_INVALID_EVENT + - WEBHOOK_ERROR_TYPE_CANCELED + coinbase.public_rest_api.beta.RewardsRateTierType: + type: string + description: RewardsRateTierType describes what a rewards rate tier is scoped + by. + enum: + - REWARDS_RATE_TIER_TYPE_BALANCE + - REWARDS_RATE_TIER_TYPE_OPEN_INTEREST + - REWARDS_RATE_TIER_TYPE_PERCENT_VOLUME + coinbase.public_rest_api.AcceptQuoteBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: Timestamp when the margin call was created - format: date-time - updated_at: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.AcceptQuoteBadRequestSubcode' + trace_id: type: string - description: Timestamp when the margin call was last updated - format: date-time - coinbase.public_rest_api.XMMarginLevel: - title: XMMarginLevel is the realtime state of EQ/MR and MR-EQ monitored against - XM thresholds as defined in the methodology + description: AcceptQuoteBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.AcceptQuoteBadRequestSubcode: + type: string + enum: + - ENTITY_ID_INVALID + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - BUYING_POWER_CURRENCY_INVALID + - BUYING_POWER_FAILED_PRECONDITION + - ORDER_REQUEST_INVALID + - ORDER_DUPLICATE_CLIENT_ORDER_ID + - ORDER_REJECTED + - ORDER_PRODUCT_ID_INVALID + - ORDER_PRODUCT_ID_REQUIRED + - ORDER_CLIENT_ORDER_ID_REQUIRED + - ORDER_QUOTE_ID_REQUIRED + - ORDER_SIDE_REQUIRED + - ORDER_SIDE_INVALID + coinbase.public_rest_api.AcceptQuoteForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.AcceptQuoteForbiddenSubcode' + trace_id: + type: string + description: AcceptQuoteForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.AcceptQuoteForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - BUYING_POWER_PERMISSION_DENIED + coinbase.public_rest_api.AcceptQuoteNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.AcceptQuoteNotFoundSubcode' + trace_id: + type: string + description: AcceptQuoteNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.AcceptQuoteNotFoundSubcode: type: string - description: |- - - HEALTHY_THRESHOLD: Margin level is healthy - - DEFICIT_THRESHOLD: Margin level is breaching the deficit threshold (DT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call time (as defined in the margin methodology) - - WARNING_THRESHOLD: Margin level is breaching the warning threshold (WT) which will result in the issuance of a Margin Call if this is still the case by the scheduled next Margin Call (as defined in the margin methodology). WT is differentiated from DT in that it means margin health is approaching the UMCT - - URGENT_MARGIN_CALL_THRESHOLD: Margin level is breaching the UMCT and, as defined in the margin methodology, this will trigger an urgent margin call - - LIQUIDATION_THRESHOLD: Margin level is breaching the liquidation threshold (LT) and, as defined in the margin methodology, this will trigger the SESSION_LOCKED control status and liquidation may commence. enum: - - HEALTHY_THRESHOLD - - DEFICIT_THRESHOLD - - WARNING_THRESHOLD - - URGENT_MARGIN_CALL_THRESHOLD - - LIQUIDATION_THRESHOLD - coinbase.public_rest_api.XMParty: - title: XMParty is a specific Cross Margin trading venue + - AUTH_RESOURCE_NOT_FOUND + - ENTITY_NOT_FOUND + - PORTFOLIO_NOT_FOUND + - BUYING_POWER_NOT_FOUND + coinbase.public_rest_api.BadRequestErrorCode: type: string - description: |- - - CBE: Coinbase Exchange, trading venue that can receive the XM loan - - FCM: Coinbase’s Futures Commission Merchant, trading venue that can receive the XM loan enum: - - CBE - - FCM - coinbase.public_rest_api.XMPosition: - title: XMPosition + - VALIDATION_ERROR + - REQUIRED_FIELD_MISSING + - FAILED_PRECONDITION + coinbase.public_rest_api.CancelAdvancedTransferBadRequestErrorResponse: type: object properties: - currency: - type: string - description: Position currency - example: BTC - market_price: - type: string - description: Current market price - example: "114531.73" - margin_eligible: - type: boolean - description: "True if margin eligible, false otherwise" - example: true - market_cap: - type: string - description: Total market capitalization - example: "770000000000.00" - adv30_days: - type: string - description: Average daily volume calculated over a 30-day period - example: "1166623585.534257" - hist5d_vol: - type: string - description: Historic volatility calculated over a 5-day period - example: "0.010996074377389616" - hist30d_vol: - type: string - description: Historic volatility calculated over a 30-day period - example: "0.013617999336643158" - hist90d_vol: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: Historic volatility calculated over a 90-day period - example: "0.015196480084775355" - margin_requirement: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferBadRequestSubcode' + trace_id: type: string - description: Base margin requirement for the specific asset - example: "0.015" - spot_balance: + description: CancelAdvancedTransferBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.CancelAdvancedTransferBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_INVALID + - ADVANCED_TRANSFER_REQUEST_INVALID + - ADVANCED_TRANSFER_ID_INVALID + - ADVANCED_TRANSFER_CANCEL_PRECONDITION_FAILED + coinbase.public_rest_api.CancelAdvancedTransferForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: XM spot balance nominal - example: "-0.19652944" - spot_balance_notional: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferForbiddenSubcode' + trace_id: type: string - description: XM spot balance notional - example: "-22508.85" - spot_total_position_margin: + description: CancelAdvancedTransferForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.CancelAdvancedTransferForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - ADVANCED_TRANSFER_NOT_ENABLED + coinbase.public_rest_api.CancelAdvancedTransferNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: Pre-netted spot total position margin - futures_balance: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferNotFoundSubcode' + trace_id: type: string - description: XM futures balance nominal - example: "-0.19652944" - futures_balance_notional: + description: CancelAdvancedTransferNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.CancelAdvancedTransferNotFoundSubcode: + type: string + enum: + - AUTH_RESOURCE_NOT_FOUND + - TRANSACTION_NOT_FOUND + coinbase.public_rest_api.CancelFuturesSweepBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: XM futures balance notional - example: "-22508.85" - futures_total_position_margin: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelFuturesSweepBadRequestSubcode' + trace_id: type: string - description: Pre-netted futures total position margin - gmv_basis: + description: CancelFuturesSweepBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.CancelFuturesSweepBadRequestSubcode: + type: string + enum: + - ENTITY_ID_REQUIRED + - FCM_INVALID_ARGUMENT + coinbase.public_rest_api.CancelFuturesSweepForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: Basis GMV = |futures| + |spot| - |unnetted position| - base_requirement: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelFuturesSweepForbiddenSubcode' + trace_id: type: string - description: Base margin requirement notional - liq_shorts_add_on: + description: CancelFuturesSweepForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.CancelFuturesSweepForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.CancelFuturesSweepNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: Effective liquidity add-on for the short positions - liq_longs_add_on: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelFuturesSweepNotFoundSubcode' + trace_id: type: string - description: Effective liquidity add-on for the long positions - vol_shorts_add_on: + description: CancelFuturesSweepNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.CancelFuturesSweepNotFoundSubcode: + type: string + enum: + - AUTH_RESOURCE_NOT_FOUND + - FCM_SWEEP_NOT_FOUND + coinbase.public_rest_api.CancelOrderBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: Effective volatility add-on for the short positions - vol_longs_add_on: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelOrderBadRequestSubcode' + trace_id: type: string - description: Effective volatility add-on for the long positions - vol5days_add_on: + description: CancelOrderBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.CancelOrderBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ORDER_ID_REQUIRED + - ORDER_ID_INVALID + - ORDER_PRODUCT_ID_INVALID + - ORDER_FULLY_FILLED + - ORDER_BEING_REPLACED + - ORDER_CANCEL_DUPLICATE + - ORDER_SESSION_INVALID + coinbase.public_rest_api.CancelOrderForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: 5-day volatility add-on - vol30days_add_on: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelOrderForbiddenSubcode' + trace_id: type: string - description: 30-day volatility add-on - vol90days_add_on: + description: CancelOrderForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.CancelOrderForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - ORDER_CANCEL_NOT_ALLOWED + coinbase.public_rest_api.CancelOrderNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: 90-day volatility add-on - total_position_margin: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CancelOrderNotFoundSubcode' + trace_id: type: string - description: Total margin required - coinbase.public_rest_api.XMRiskNettingInfo: + description: CancelOrderNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.CancelOrderNotFoundSubcode: + type: string + enum: + - AUTH_RESOURCE_NOT_FOUND + - ORDER_NOT_FOUND + coinbase.public_rest_api.CreateAdvancedTransferBadRequestErrorResponse: type: object properties: - dco_margin_requirement: - type: string - description: "Derivatives Clearing Organization Margin Requirement (DMR)\ - \ is the margin requirement for all futures positions, derived from the\ - \ Derivatives Clearing Organization model" - example: "9243.25" - portfolio_margin_requirement: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: "Portfolio Margin Requirement (PMR) is the margin requirement\ - \ for all spot positions, derived from the XM model" - example: "9003.67" - integrated_portfolio_margin_requirement: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateAdvancedTransferBadRequestSubcode' + trace_id: type: string - description: "Integrated Portfolio Margin Requirement (IPMR) is the margin\ - \ requirement for all spot positions + futures positions with underlying\ - \ assets eligible in Portfolio Margin, via the XM model with one-leg netting" - example: "10154.67" - ineligible_futures_margin_requirement: + description: CreateAdvancedTransferBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.CreateAdvancedTransferBadRequestSubcode: + type: string + enum: + - ADVANCED_TRANSFER_REQUEST_INVALID + - ADVANCED_TRANSFER_PRECONDITION_FAILED + - ADVANCED_TRANSFER_DATE_INVALID + - ADVANCED_TRANSFER_TOO_MANY_FUND_MOVEMENTS + - ADVANCED_TRANSFER_COUNTERPARTY_INVALID + - ADVANCED_TRANSFER_AMOUNT_INVALID + - ADVANCED_TRANSFER_COUNTERPARTY_REQUIRED + - ADVANCED_TRANSFER_IDEMPOTENCY_KEY_INVALID + coinbase.public_rest_api.CreateAdvancedTransferForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: Ineligible Futures Margin Requirement (IFMR) is the margin - requirement for IPMR-ineligible futures contracts - example: "194.36" - position_margin_requirement: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateAdvancedTransferForbiddenSubcode' + trace_id: type: string - description: Position margin requirement for all spot positions - example: "3376.45" - portfolio_margin_addon: + description: CreateAdvancedTransferForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.CreateAdvancedTransferForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - ADVANCED_TRANSFER_NOT_ENABLED + coinbase.public_rest_api.CreateAdvancedTransferNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: Portfolio margin addon for all spot positions - example: "5627.21" - integrated_position_margin_requirement: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateAdvancedTransferNotFoundSubcode' + trace_id: type: string - description: Position margin requirement for spot + futures positions - example: "3376.45" - integrated_portfolio_margin_addon: + description: CreateAdvancedTransferNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.CreateAdvancedTransferNotFoundSubcode: + type: string + enum: + - AUTH_RESOURCE_NOT_FOUND + - ADVANCED_TRANSFER_NOT_FOUND + coinbase.public_rest_api.CreateAllocationBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: Portfolio margin addon for spot + futures positions - example: "6778.21" - netted_futures_notional: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateAllocationBadRequestSubcode' + trace_id: type: string - description: Post-netting USD notional for all futures positions - example: "11510.00" - total_gmv_basis: + description: CreateAllocationBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.CreateAllocationBadRequestSubcode: + type: string + enum: + - PORTFOLIO_TYPE_UNSUPPORTED + - PORTFOLIO_ID_INVALID + - ALLOCATION_ID_REQUIRED + - ALLOCATION_NETTING_ID_REQUIRED + - ALLOCATION_REQUEST_INVALID + - ALLOCATION_PRECONDITION_FAILED + - ALLOCATION_SOURCE_PORTFOLIO_ID_REQUIRED + - ALLOCATION_DESTINATION_PORTFOLIO_ID_REQUIRED + - ALLOCATION_ORDERS_MIXED_SIDES + - ALLOCATION_ORDERS_MIXED_PRODUCTS + - ALLOCATION_ORDER_NOT_TERMINAL + - ALLOCATION_ORDER_TOO_OLD + - ALLOCATION_ORDER_ALREADY_ALLOCATED + coinbase.public_rest_api.CreateAllocationForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: Total basis gross market value of all XM-eligible positions - (i.e. crypto underliers) - ipm_cash_balance: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateAllocationForbiddenSubcode' + trace_id: type: string - description: Integrated Portfolio Margin cash balance - example: "1002.94" - integrated_scenario_addon: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn' - all_integrated_scenario_addons: - type: array - description: All integrated scenario add-ons - items: - $ref: '#/components/schemas/coinbase.public_rest_api.MarginAddOn' - xm_positions: - type: array - description: Netted positions used in the model calculation - items: - $ref: '#/components/schemas/coinbase.public_rest_api.XMPosition' - coinbase.public_rest_api.XMSummary: - title: "XMSummary is the realtime evaluated XM margin model, containing positions\ - \ and netting info" + description: CreateAllocationForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.CreateAllocationForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.CreateAllocationNotFoundErrorResponse: type: object properties: - margin_requirement: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: Cross Margin Margin Requirement (XMMR) notional - example: "10362.72" - account_equity: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateAllocationNotFoundSubcode' + trace_id: type: string - description: Equity notional - example: "-21542.63" - margin_excess_shortfall: + description: CreateAllocationNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.CreateAllocationNotFoundSubcode: + type: string + enum: + - PORTFOLIO_NOT_FOUND + - ALLOCATION_NOT_FOUND + coinbase.public_rest_api.CreateConversionBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: type: string - description: Equity - XMMR (margin excess is > 0) - example: "-31891.67" - consumed_credit: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateConversionBadRequestSubcode' + trace_id: type: string - description: Credit consumed from Cross Margin Credit Limit (XMCL) - example: "22906.34" - xm_credit_limit: + description: CreateConversionBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.CreateConversionBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_INVALID + - WALLET_ID_INVALID + - CONVERSION_DESTINATION_INVALID + - CONVERSION_IDEMPOTENCY_KEY_INVALID + - CONVERSION_AMOUNT_INVALID + - CONVERSION_SOURCE_SYMBOL_REQUIRED + - CONVERSION_DESTINATION_REQUIRED + - CONVERSION_REQUEST_INVALID + - CONVERSION_FAILED_PRECONDITION + coinbase.public_rest_api.CreateConversionForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: XM Credit Limit (XMCL) is the maximum notional USD of total - fiat and digital asset loans - example: "1222322.00" - xm_margin_limit: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateConversionForbiddenSubcode' + trace_id: type: string - description: XM Margin Limit (XMML) is the maximum notional USD deficit - example: "22123.00" - spot_equity: + description: CreateConversionForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.CreateConversionForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - CONVERSION_PERMISSION_DENIED + coinbase.public_rest_api.CreateConversionNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: Equity attributed by spot - example: "-21505.91" - futures_equity: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateConversionNotFoundSubcode' + trace_id: type: string - description: Equity attributed by futures - example: "-36.71" - risk_netting_info: - $ref: '#/components/schemas/coinbase.public_rest_api.XMRiskNettingInfo' - google.type.Date: - title: |- - Represents a whole or partial calendar date, such as a birthday. The time of - day and time zone are either specified elsewhere or are insignificant. The - date is relative to the Gregorian Calendar. This can represent one of the - following: + description: CreateConversionNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.CreateConversionNotFoundSubcode: + type: string + enum: + - AUTH_RESOURCE_NOT_FOUND + - CONVERSION_WALLET_NOT_FOUND + coinbase.public_rest_api.CreateNetAllocationBadRequestErrorResponse: type: object properties: - year: - type: integer - description: |- - Year of the date. Must be from 1 to 9999, or 0 to specify a date without - a year. - format: int32 - month: - type: integer - description: |- - Month of a year. Must be from 1 to 12, or 0 to specify a year without a - month and day. - format: int32 - day: - type: integer - description: |- - Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 - to specify a year by itself or a year and month where the day isn't - significant. - format: int32 - description: |- - * A full date, with non-zero year, month, and day values. - * A month and day, with a zero year (for example, an anniversary). - * A year on its own, with a zero month and a zero day. - * A year and month, with a zero day (for example, a credit card expiration - date). - - Related types: - - * [google.type.TimeOfDay][google.type.TimeOfDay] - * [google.type.DateTime][google.type.DateTime] - * [google.protobuf.Timestamp][google.protobuf.Timestamp] - coinbase.public_rest_api.beta.GetRewardsRateResponse: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateNetAllocationBadRequestSubcode' + trace_id: + type: string + description: CreateNetAllocationBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.CreateNetAllocationBadRequestSubcode: + type: string + enum: + - PORTFOLIO_TYPE_UNSUPPORTED + - PORTFOLIO_ID_INVALID + - ALLOCATION_ID_REQUIRED + - ALLOCATION_NETTING_ID_REQUIRED + - ALLOCATION_REQUEST_INVALID + - ALLOCATION_PRECONDITION_FAILED + - ALLOCATION_SOURCE_PORTFOLIO_ID_REQUIRED + - ALLOCATION_DESTINATION_PORTFOLIO_ID_REQUIRED + - ALLOCATION_ORDERS_MIXED_SIDES + - ALLOCATION_ORDERS_MIXED_PRODUCTS + - ALLOCATION_ORDER_NOT_TERMINAL + - ALLOCATION_ORDER_TOO_OLD + - ALLOCATION_ORDER_ALREADY_ALLOCATED + coinbase.public_rest_api.CreateNetAllocationForbiddenErrorResponse: type: object properties: - current_rate: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: type: string - description: The current effective rewards rate. - example: "0.045" - available_rates: - type: array - description: "All available rewards rates, including qualifying bounds for\ - \ each rate." - items: - $ref: '#/components/schemas/coinbase.public_rest_api.beta.RewardsRateTier' - description: GetRewardsRateResponse returns the current rewards rate and the - available rates. - coinbase.public_rest_api.beta.RewardsRateTier: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateNetAllocationForbiddenSubcode' + trace_id: + type: string + description: CreateNetAllocationForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.CreateNetAllocationForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.CreateNetAllocationNotFoundErrorResponse: type: object properties: - rate: - type: string - description: Rate for this tier. - example: "0.045" - lower_limit: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: type: string - description: Lower bound of the tier's qualifying criteria (e.g. balance - floor). - example: "0" - upper_limit: + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateNetAllocationNotFoundSubcode' + trace_id: type: string - description: Upper bound of the tier's qualifying criteria. - example: "1000000" - criteria_type: - $ref: '#/components/schemas/coinbase.public_rest_api.beta.RewardsRateTierType' - description: RewardsRateTier is a single tier in the rewards rate card. - coinbase.public_rest_api.beta.RewardsRateTierType: + description: CreateNetAllocationNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.CreateNetAllocationNotFoundSubcode: type: string - description: RewardsRateTierType describes what a rewards rate tier is scoped - by. enum: - - REWARDS_RATE_TIER_TYPE_BALANCE - - REWARDS_RATE_TIER_TYPE_OPEN_INTEREST - - REWARDS_RATE_TIER_TYPE_PERCENT_VOLUME - coinbase.public_rest_api.AcceptQuoteBadRequestErrorResponse: + - PORTFOLIO_NOT_FOUND + - ALLOCATION_NOT_FOUND + coinbase.public_rest_api.CreateNewLocatesBadRequestErrorResponse: type: object properties: code: @@ -16362,29 +19045,23 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.AcceptQuoteBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateNewLocatesBadRequestSubcode' trace_id: type: string - description: AcceptQuoteBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.AcceptQuoteBadRequestSubcode: + description: CreateNewLocatesBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.CreateNewLocatesBadRequestSubcode: type: string enum: - - ENTITY_ID_INVALID - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - BUYING_POWER_CURRENCY_INVALID - - BUYING_POWER_FAILED_PRECONDITION - - ORDER_REQUEST_INVALID - - ORDER_DUPLICATE_CLIENT_ORDER_ID - - ORDER_REJECTED - - ORDER_PRODUCT_ID_INVALID - - ORDER_PRODUCT_ID_REQUIRED - - ORDER_CLIENT_ORDER_ID_REQUIRED - - ORDER_QUOTE_ID_REQUIRED - - ORDER_SIDE_REQUIRED - - ORDER_SIDE_INVALID - coinbase.public_rest_api.AcceptQuoteForbiddenErrorResponse: + - LOCATE_DATE_INVALID + - LOCATE_REQUEST_INVALID + - LOCATE_FAILED_PRECONDITION + - LOCATE_DATE_REQUIRED + - LOCATE_SYMBOL_REQUIRED + - LOCATE_AMOUNT_REQUIRED + coinbase.public_rest_api.CreateNewLocatesForbiddenErrorResponse: type: object properties: code: @@ -16392,20 +19069,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.AcceptQuoteForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateNewLocatesForbiddenSubcode' trace_id: type: string - description: AcceptQuoteForbiddenErrorResponse documents the HTTP 403 error + description: CreateNewLocatesForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.AcceptQuoteForbiddenSubcode: + coinbase.public_rest_api.CreateNewLocatesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - BUYING_POWER_PERMISSION_DENIED - coinbase.public_rest_api.AcceptQuoteNotFoundErrorResponse: + coinbase.public_rest_api.CreateNewLocatesNotFoundErrorResponse: type: object properties: code: @@ -16413,24 +19089,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.AcceptQuoteNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateNewLocatesNotFoundSubcode' trace_id: type: string - description: AcceptQuoteNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.AcceptQuoteNotFoundSubcode: + description: CreateNewLocatesNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.CreateNewLocatesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - - PORTFOLIO_NOT_FOUND - - BUYING_POWER_NOT_FOUND - coinbase.public_rest_api.BadRequestErrorCode: - type: string - enum: - - VALIDATION_ERROR - - REQUIRED_FIELD_MISSING - - FAILED_PRECONDITION - coinbase.public_rest_api.CancelAdvancedTransferBadRequestErrorResponse: + coinbase.public_rest_api.CreateOnchainAddressGroupBadRequestErrorResponse: type: object properties: code: @@ -16438,19 +19106,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainAddressGroupBadRequestSubcode' trace_id: type: string - description: CancelAdvancedTransferBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.CancelAdvancedTransferBadRequestSubcode: + description: CreateOnchainAddressGroupBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.CreateOnchainAddressGroupBadRequestSubcode: type: string enum: + - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ADVANCED_TRANSFER_REQUEST_INVALID - - ADVANCED_TRANSFER_ID_INVALID - - ADVANCED_TRANSFER_CANCEL_PRECONDITION_FAILED - coinbase.public_rest_api.CancelAdvancedTransferForbiddenErrorResponse: + - ONCHAIN_ADDRESS_GROUP_REQUEST_INVALID + coinbase.public_rest_api.CreateOnchainAddressGroupForbiddenErrorResponse: type: object properties: code: @@ -16458,20 +19125,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainAddressGroupForbiddenSubcode' trace_id: type: string - description: CancelAdvancedTransferForbiddenErrorResponse documents the HTTP + description: CreateOnchainAddressGroupForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.CancelAdvancedTransferForbiddenSubcode: + coinbase.public_rest_api.CreateOnchainAddressGroupForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - ADVANCED_TRANSFER_NOT_ENABLED - coinbase.public_rest_api.CancelAdvancedTransferNotFoundErrorResponse: + coinbase.public_rest_api.CreateOnchainAddressGroupNotFoundErrorResponse: type: object properties: code: @@ -16479,17 +19145,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainAddressGroupNotFoundSubcode' trace_id: type: string - description: CancelAdvancedTransferNotFoundErrorResponse documents the HTTP + description: CreateOnchainAddressGroupNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.CancelAdvancedTransferNotFoundSubcode: + coinbase.public_rest_api.CreateOnchainAddressGroupNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - TRANSACTION_NOT_FOUND - coinbase.public_rest_api.CancelFuturesSweepBadRequestErrorResponse: + coinbase.public_rest_api.CreateOnchainTransactionBadRequestErrorResponse: type: object properties: code: @@ -16497,17 +19162,31 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelFuturesSweepBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainTransactionBadRequestSubcode' trace_id: type: string - description: CancelFuturesSweepBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.CancelFuturesSweepBadRequestSubcode: + description: CreateOnchainTransactionBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.CreateOnchainTransactionBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - FCM_INVALID_ARGUMENT - coinbase.public_rest_api.CancelFuturesSweepForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_TYPE_NOT_SUPPORTED + - ONCHAIN_TRANSACTION_REQUEST_INVALID + - ONCHAIN_TRANSACTION_RAW_UNSIGNED_TXN_REQUIRED + - ONCHAIN_TRANSACTION_RAW_UNSIGNED_TXN_INVALID + - ONCHAIN_TRANSACTION_EVM_PARAMS_REQUIRED + - ONCHAIN_TRANSACTION_EVM_PARAMS_INVALID + - ONCHAIN_TRANSACTION_REPLACED_TRANSACTION_ID_INVALID + - ONCHAIN_TRANSACTION_DISABLE_DYNAMIC_NONCE_INVALID + - ONCHAIN_TRANSACTION_CHAIN_ID_REQUIRED + - ONCHAIN_TRANSACTION_CHAIN_ID_INVALID + - ONCHAIN_TRANSACTION_NETWORK_NAME_REQUIRED + - ONCHAIN_TRANSACTION_RPC_URL_INVALID + coinbase.public_rest_api.CreateOnchainTransactionForbiddenErrorResponse: type: object properties: code: @@ -16515,19 +19194,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelFuturesSweepForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainTransactionForbiddenSubcode' trace_id: type: string - description: CancelFuturesSweepForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.CancelFuturesSweepForbiddenSubcode: + description: CreateOnchainTransactionForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.CreateOnchainTransactionForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CancelFuturesSweepNotFoundErrorResponse: + coinbase.public_rest_api.CreateOnchainTransactionNotFoundErrorResponse: type: object properties: code: @@ -16535,17 +19214,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelFuturesSweepNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainTransactionNotFoundSubcode' trace_id: type: string - description: CancelFuturesSweepNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.CancelFuturesSweepNotFoundSubcode: + description: CreateOnchainTransactionNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.CreateOnchainTransactionNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_SWEEP_NOT_FOUND - coinbase.public_rest_api.CancelOrderBadRequestErrorResponse: + - WALLET_NOT_FOUND + coinbase.public_rest_api.CreateOrderBadRequestErrorResponse: type: object properties: code: @@ -16553,24 +19232,39 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelOrderBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOrderBadRequestSubcode' trace_id: type: string - description: CancelOrderBadRequestErrorResponse documents the HTTP 400 error + description: CreateOrderBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.CancelOrderBadRequestSubcode: + coinbase.public_rest_api.CreateOrderBadRequestSubcode: type: string enum: + - ENTITY_ID_INVALID - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ORDER_ID_REQUIRED - - ORDER_ID_INVALID + - BUYING_POWER_CURRENCY_INVALID + - BUYING_POWER_FAILED_PRECONDITION + - ORDER_REQUEST_INVALID + - ORDER_STOP_LIMIT_NOT_ENABLED + - ORDER_PEG_NOT_ENABLED + - ORDER_DUPLICATE_CLIENT_ORDER_ID + - ORDER_REJECTED - ORDER_PRODUCT_ID_INVALID - - ORDER_FULLY_FILLED - - ORDER_BEING_REPLACED - - ORDER_CANCEL_DUPLICATE - - ORDER_SESSION_INVALID - coinbase.public_rest_api.CancelOrderForbiddenErrorResponse: + - ORDER_TYPE_NOT_ALLOWED + - ORDER_TIF_NOT_ENABLED + - ORDER_FAILED_PRECONDITION + - ORDER_SIDE_INVALID + - ORDER_SIZE_REQUIRED + - ORDER_SIZE_INVALID + - ORDER_DISPLAY_SIZE_INVALID + - ORDER_PRICE_INVALID + - ORDER_STOP_PRICE_INVALID + - ORDER_TIME_IN_FORCE_INVALID + - ORDER_TIME_RANGE_INVALID + - ORDER_PEG_OFFSET_TYPE_INVALID + - ORDER_SPREAD_NOT_ENABLED + coinbase.public_rest_api.CreateOrderForbiddenErrorResponse: type: object properties: code: @@ -16578,20 +19272,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelOrderForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOrderForbiddenSubcode' trace_id: type: string - description: CancelOrderForbiddenErrorResponse documents the HTTP 403 error + description: CreateOrderForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.CancelOrderForbiddenSubcode: + coinbase.public_rest_api.CreateOrderForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - ORDER_CANCEL_NOT_ALLOWED - coinbase.public_rest_api.CancelOrderNotFoundErrorResponse: + - BUYING_POWER_PERMISSION_DENIED + coinbase.public_rest_api.CreateOrderNotFoundErrorResponse: type: object properties: code: @@ -16599,16 +19293,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CancelOrderNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateOrderNotFoundSubcode' trace_id: type: string - description: CancelOrderNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.CancelOrderNotFoundSubcode: + description: CreateOrderNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.CreateOrderNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ORDER_NOT_FOUND - coinbase.public_rest_api.CreateAdvancedTransferBadRequestErrorResponse: + - ENTITY_NOT_FOUND + - PORTFOLIO_NOT_FOUND + - BUYING_POWER_NOT_FOUND + coinbase.public_rest_api.CreatePortfolioAddressBookEntryBadRequestErrorResponse: type: object properties: code: @@ -16616,22 +19312,21 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateAdvancedTransferBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryBadRequestSubcode' trace_id: type: string - description: CreateAdvancedTransferBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.CreateAdvancedTransferBadRequestSubcode: + description: CreatePortfolioAddressBookEntryBadRequestErrorResponse documents + the HTTP 400 error body. + coinbase.public_rest_api.CreatePortfolioAddressBookEntryBadRequestSubcode: type: string enum: - - ADVANCED_TRANSFER_REQUEST_INVALID - - ADVANCED_TRANSFER_PRECONDITION_FAILED - - ADVANCED_TRANSFER_DATE_INVALID - - ADVANCED_TRANSFER_TOO_MANY_FUND_MOVEMENTS - - ADVANCED_TRANSFER_COUNTERPARTY_INVALID - - ADVANCED_TRANSFER_AMOUNT_INVALID - - ADVANCED_TRANSFER_COUNTERPARTY_REQUIRED - coinbase.public_rest_api.CreateAdvancedTransferForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - ADDRESS_BOOK_INVALID_ARGUMENT + - ADDRESS_BOOK_FAILED_PRECONDITION + - ADDRESS_BOOK_ADDRESS_REQUIRED + - ADDRESS_BOOK_CURRENCY_SYMBOL_REQUIRED + - ADDRESS_BOOK_NAME_REQUIRED + coinbase.public_rest_api.CreatePortfolioAddressBookEntryForbiddenErrorResponse: type: object properties: code: @@ -16639,20 +19334,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateAdvancedTransferForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryForbiddenSubcode' trace_id: type: string - description: CreateAdvancedTransferForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.CreateAdvancedTransferForbiddenSubcode: + description: CreatePortfolioAddressBookEntryForbiddenErrorResponse documents + the HTTP 403 error body. + coinbase.public_rest_api.CreatePortfolioAddressBookEntryForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - ADVANCED_TRANSFER_NOT_ENABLED - coinbase.public_rest_api.CreateAdvancedTransferNotFoundErrorResponse: + coinbase.public_rest_api.CreatePortfolioAddressBookEntryNotFoundErrorResponse: type: object properties: code: @@ -16660,17 +19354,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateAdvancedTransferNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryNotFoundSubcode' trace_id: type: string - description: CreateAdvancedTransferNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.CreateAdvancedTransferNotFoundSubcode: + description: CreatePortfolioAddressBookEntryNotFoundErrorResponse documents + the HTTP 404 error body. + coinbase.public_rest_api.CreatePortfolioAddressBookEntryNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ADVANCED_TRANSFER_NOT_FOUND - coinbase.public_rest_api.CreateAllocationBadRequestErrorResponse: + - ADDRESS_BOOK_NOT_FOUND + coinbase.public_rest_api.CreateQuoteRequestBadRequestErrorResponse: type: object properties: code: @@ -16678,28 +19372,31 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateAllocationBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateQuoteRequestBadRequestSubcode' trace_id: type: string - description: CreateAllocationBadRequestErrorResponse documents the HTTP 400 + description: CreateQuoteRequestBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.CreateAllocationBadRequestSubcode: + coinbase.public_rest_api.CreateQuoteRequestBadRequestSubcode: type: string enum: - - PORTFOLIO_TYPE_UNSUPPORTED + - ENTITY_ID_INVALID + - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ALLOCATION_ID_REQUIRED - - ALLOCATION_NETTING_ID_REQUIRED - - ALLOCATION_REQUEST_INVALID - - ALLOCATION_PRECONDITION_FAILED - - ALLOCATION_SOURCE_PORTFOLIO_ID_REQUIRED - - ALLOCATION_DESTINATION_PORTFOLIO_ID_REQUIRED - - ALLOCATION_ORDERS_MIXED_SIDES - - ALLOCATION_ORDERS_MIXED_PRODUCTS - - ALLOCATION_ORDER_NOT_TERMINAL - - ALLOCATION_ORDER_TOO_OLD - - ALLOCATION_ORDER_ALREADY_ALLOCATED - coinbase.public_rest_api.CreateAllocationForbiddenErrorResponse: + - BUYING_POWER_CURRENCY_INVALID + - BUYING_POWER_FAILED_PRECONDITION + - ORDER_REQUEST_INVALID + - ORDER_PRODUCT_ID_INVALID + - ORDER_FAILED_PRECONDITION + - ORDER_PRODUCT_ID_REQUIRED + - ORDER_SIDE_REQUIRED + - ORDER_RESOURCE_NOT_FOUND + - ORDER_SIDE_INVALID + - ORDER_SIZE_INVALID + - ORDER_PRICE_INVALID + - ORDER_CLIENT_QUOTE_ID_REQUIRED + - ORDER_QUOTE_DURATION_INVALID + coinbase.public_rest_api.CreateQuoteRequestForbiddenErrorResponse: type: object properties: code: @@ -16707,19 +19404,22 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateAllocationForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateQuoteRequestForbiddenSubcode' trace_id: type: string - description: CreateAllocationForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.CreateAllocationForbiddenSubcode: + description: CreateQuoteRequestForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.CreateQuoteRequestForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateAllocationNotFoundErrorResponse: + - BUYING_POWER_PERMISSION_DENIED + - ORDER_RFQ_NOT_ENABLED + - ORDER_RFQ_SIQ_NOT_ENABLED + coinbase.public_rest_api.CreateQuoteRequestNotFoundErrorResponse: type: object properties: code: @@ -16727,17 +19427,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateAllocationNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateQuoteRequestNotFoundSubcode' trace_id: type: string - description: CreateAllocationNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.CreateAllocationNotFoundSubcode: + description: CreateQuoteRequestNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.CreateQuoteRequestNotFoundSubcode: type: string enum: + - AUTH_RESOURCE_NOT_FOUND + - ENTITY_NOT_FOUND - PORTFOLIO_NOT_FOUND - - ALLOCATION_NOT_FOUND - coinbase.public_rest_api.CreateConversionBadRequestErrorResponse: + - BUYING_POWER_NOT_FOUND + coinbase.public_rest_api.CreateWalletBadRequestErrorResponse: type: object properties: code: @@ -16745,92 +19447,92 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateConversionBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletBadRequestSubcode' trace_id: type: string - description: CreateConversionBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.CreateConversionBadRequestSubcode: + description: CreateWalletBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.CreateWalletBadRequestSubcode: type: string enum: - PORTFOLIO_ID_INVALID - - WALLET_ID_INVALID - - CONVERSION_DESTINATION_INVALID - - CONVERSION_IDEMPOTENCY_KEY_INVALID - - CONVERSION_AMOUNT_INVALID - - CONVERSION_SOURCE_SYMBOL_REQUIRED - - CONVERSION_DESTINATION_REQUIRED - - CONVERSION_REQUEST_INVALID - - CONVERSION_FAILED_PRECONDITION - coinbase.public_rest_api.CreateConversionForbiddenErrorResponse: + - WALLET_TYPE_NOT_SUPPORTED + - WALLET_REQUEST_INVALID + - WALLET_ONCHAIN_SYMBOLS_NOT_ALLOWED + - WALLET_FAILED_PRECONDITION + - WALLET_NETWORK_ID_REQUIRED + - WALLET_NETWORK_INVALID + - WALLET_ONCHAIN_SETUP_UNAVAILABLE + - WALLET_NAME_REQUIRED + - WALLET_SYMBOL_REQUIRED + - WALLET_NETWORK_FAMILY_REQUIRED + - WALLET_NETWORK_FAMILY_NOT_ALLOWED + - WALLET_NETWORK_TYPE_REQUIRED + coinbase.public_rest_api.CreateWalletDepositAddressBadRequestErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateConversionForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletDepositAddressBadRequestSubcode' trace_id: type: string - description: CreateConversionForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.CreateConversionForbiddenSubcode: + description: CreateWalletDepositAddressBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.CreateWalletDepositAddressBadRequestSubcode: type: string enum: - - AUTH_RESOURCE_ACCESS_DENIED - - MTLS_CERTIFICATE_REQUIRED - - MTLS_CERTIFICATE_REVOKED - - MTLS_CERTIFICATE_INVALID - - CONVERSION_PERMISSION_DENIED - coinbase.public_rest_api.CreateConversionNotFoundErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_NOT_DEPOSITABLE + - WALLET_DEPOSIT_REQUEST_INVALID + - WALLET_FAILED_PRECONDITION + - WALLET_NETWORK_ID_REQUIRED + - WALLET_NETWORK_INVALID + - WALLET_NETWORK_TYPE_NOT_SUPPORTED + coinbase.public_rest_api.CreateWalletDepositAddressForbiddenErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateConversionNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletDepositAddressForbiddenSubcode' trace_id: type: string - description: CreateConversionNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.CreateConversionNotFoundSubcode: + description: CreateWalletDepositAddressForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.CreateWalletDepositAddressForbiddenSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - CONVERSION_WALLET_NOT_FOUND - coinbase.public_rest_api.CreateNetAllocationBadRequestErrorResponse: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.CreateWalletDepositAddressNotFoundErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateNetAllocationBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletDepositAddressNotFoundSubcode' trace_id: type: string - description: CreateNetAllocationBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.CreateNetAllocationBadRequestSubcode: + description: CreateWalletDepositAddressNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.CreateWalletDepositAddressNotFoundSubcode: type: string enum: - - PORTFOLIO_TYPE_UNSUPPORTED - - PORTFOLIO_ID_INVALID - - ALLOCATION_ID_REQUIRED - - ALLOCATION_NETTING_ID_REQUIRED - - ALLOCATION_REQUEST_INVALID - - ALLOCATION_PRECONDITION_FAILED - - ALLOCATION_SOURCE_PORTFOLIO_ID_REQUIRED - - ALLOCATION_DESTINATION_PORTFOLIO_ID_REQUIRED - - ALLOCATION_ORDERS_MIXED_SIDES - - ALLOCATION_ORDERS_MIXED_PRODUCTS - - ALLOCATION_ORDER_NOT_TERMINAL - - ALLOCATION_ORDER_TOO_OLD - - ALLOCATION_ORDER_ALREADY_ALLOCATED - coinbase.public_rest_api.CreateNetAllocationForbiddenErrorResponse: + - AUTH_RESOURCE_NOT_FOUND + - WALLET_NOT_FOUND + coinbase.public_rest_api.CreateWalletForbiddenErrorResponse: type: object properties: code: @@ -16838,19 +19540,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateNetAllocationForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletForbiddenSubcode' trace_id: type: string - description: CreateNetAllocationForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.CreateNetAllocationForbiddenSubcode: + description: CreateWalletForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.CreateWalletForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateNetAllocationNotFoundErrorResponse: + coinbase.public_rest_api.CreateWalletNotFoundErrorResponse: type: object properties: code: @@ -16858,17 +19560,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateNetAllocationNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletNotFoundSubcode' trace_id: type: string - description: CreateNetAllocationNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.CreateNetAllocationNotFoundSubcode: + description: CreateWalletNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.CreateWalletNotFoundSubcode: type: string enum: - - PORTFOLIO_NOT_FOUND - - ALLOCATION_NOT_FOUND - coinbase.public_rest_api.CreateNewLocatesBadRequestErrorResponse: + - AUTH_RESOURCE_NOT_FOUND + - ASSET_NOT_FOUND + - WALLET_NOT_FOUND + coinbase.public_rest_api.CreateWalletTransferBadRequestErrorResponse: type: object properties: code: @@ -16876,23 +19579,27 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateNewLocatesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletTransferBadRequestSubcode' trace_id: type: string - description: CreateNewLocatesBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.CreateNewLocatesBadRequestSubcode: + description: CreateWalletTransferBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.CreateWalletTransferBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - LOCATE_DATE_INVALID - - LOCATE_REQUEST_INVALID - - LOCATE_FAILED_PRECONDITION - - LOCATE_DATE_REQUIRED - - LOCATE_SYMBOL_REQUIRED - - LOCATE_AMOUNT_REQUIRED - coinbase.public_rest_api.CreateNewLocatesForbiddenErrorResponse: + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_REQUEST_INVALID + - WALLET_FAILED_PRECONDITION + - WALLET_AMOUNT_REQUIRED + - WALLET_IDEMPOTENCY_KEY_REQUIRED + - WALLET_IDEMPOTENCY_KEY_INVALID + - WALLET_CURRENCY_SYMBOL_REQUIRED + - WALLET_TRANSFER_DESTINATION_REQUIRED + - WALLET_TRANSFER_DESTINATION_INVALID + coinbase.public_rest_api.CreateWalletTransferForbiddenErrorResponse: type: object properties: code: @@ -16900,19 +19607,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateNewLocatesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletTransferForbiddenSubcode' trace_id: type: string - description: CreateNewLocatesForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.CreateNewLocatesForbiddenSubcode: + description: CreateWalletTransferForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.CreateWalletTransferForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateNewLocatesNotFoundErrorResponse: + - WALLET_PORTFOLIO_CREDIT_FROZEN + coinbase.public_rest_api.CreateWalletTransferNotFoundErrorResponse: type: object properties: code: @@ -16920,16 +19628,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateNewLocatesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletTransferNotFoundSubcode' trace_id: type: string - description: CreateNewLocatesNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.CreateNewLocatesNotFoundSubcode: + description: CreateWalletTransferNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.CreateWalletTransferNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.CreateOnchainAddressGroupBadRequestErrorResponse: + - WALLET_NOT_FOUND + coinbase.public_rest_api.CreateWalletWithdrawalBadRequestErrorResponse: type: object properties: code: @@ -16937,16 +19646,29 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainAddressGroupBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletWithdrawalBadRequestSubcode' trace_id: type: string - description: CreateOnchainAddressGroupBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.CreateOnchainAddressGroupBadRequestSubcode: + description: CreateWalletWithdrawalBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.CreateWalletWithdrawalBadRequestSubcode: type: string enum: - - ONCHAIN_ADDRESS_GROUP_REQUEST_INVALID - coinbase.public_rest_api.CreateOnchainAddressGroupForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_REQUEST_INVALID + - WALLET_FAILED_PRECONDITION + - WALLET_NETWORK_INVALID + - WALLET_AMOUNT_REQUIRED + - WALLET_IDEMPOTENCY_KEY_REQUIRED + - WALLET_IDEMPOTENCY_KEY_INVALID + - WALLET_CURRENCY_SYMBOL_REQUIRED + - WALLET_DESTINATION_TYPE_REQUIRED + - WALLET_DESTINATION_TYPE_INVALID + - WALLET_COUNTERPARTY_ID_REQUIRED + coinbase.public_rest_api.CreateWalletWithdrawalForbiddenErrorResponse: type: object properties: code: @@ -16954,19 +19676,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainAddressGroupForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletWithdrawalForbiddenSubcode' trace_id: type: string - description: CreateOnchainAddressGroupForbiddenErrorResponse documents the HTTP + description: CreateWalletWithdrawalForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.CreateOnchainAddressGroupForbiddenSubcode: + coinbase.public_rest_api.CreateWalletWithdrawalForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateOnchainAddressGroupNotFoundErrorResponse: + - WALLET_PORTFOLIO_CREDIT_FROZEN + coinbase.public_rest_api.CreateWalletWithdrawalNotFoundErrorResponse: type: object properties: code: @@ -16974,16 +19697,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainAddressGroupNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletWithdrawalNotFoundSubcode' trace_id: type: string - description: CreateOnchainAddressGroupNotFoundErrorResponse documents the HTTP + description: CreateWalletWithdrawalNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.CreateOnchainAddressGroupNotFoundSubcode: + coinbase.public_rest_api.CreateWalletWithdrawalNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.CreateOnchainTransactionBadRequestErrorResponse: + - ASSET_NOT_FOUND + - WALLET_NOT_FOUND + coinbase.public_rest_api.CreateWebhookSubscriptionBadRequestErrorResponse: type: object properties: code: @@ -16991,31 +19716,21 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainTransactionBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWebhookSubscriptionBadRequestSubcode' trace_id: type: string - description: CreateOnchainTransactionBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.CreateOnchainTransactionBadRequestSubcode: + description: CreateWebhookSubscriptionBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.CreateWebhookSubscriptionBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_TYPE_NOT_SUPPORTED - - ONCHAIN_TRANSACTION_REQUEST_INVALID - - ONCHAIN_TRANSACTION_RAW_UNSIGNED_TXN_REQUIRED - - ONCHAIN_TRANSACTION_RAW_UNSIGNED_TXN_INVALID - - ONCHAIN_TRANSACTION_EVM_PARAMS_REQUIRED - - ONCHAIN_TRANSACTION_EVM_PARAMS_INVALID - - ONCHAIN_TRANSACTION_REPLACED_TRANSACTION_ID_INVALID - - ONCHAIN_TRANSACTION_DISABLE_DYNAMIC_NONCE_INVALID - - ONCHAIN_TRANSACTION_CHAIN_ID_REQUIRED - - ONCHAIN_TRANSACTION_CHAIN_ID_INVALID - - ONCHAIN_TRANSACTION_NETWORK_NAME_REQUIRED - - ONCHAIN_TRANSACTION_RPC_URL_INVALID - coinbase.public_rest_api.CreateOnchainTransactionForbiddenErrorResponse: + - WEBHOOK_TARGET_URL_INVALID + - WEBHOOK_EVENT_TYPE_INVALID + - WEBHOOK_IDEMPOTENCY_CONFLICT + - WEBHOOK_INVALID_ARGUMENT + coinbase.public_rest_api.CreateWebhookSubscriptionForbiddenErrorResponse: type: object properties: code: @@ -17023,37 +19738,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainTransactionForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWebhookSubscriptionForbiddenSubcode' trace_id: type: string - description: CreateOnchainTransactionForbiddenErrorResponse documents the HTTP + description: CreateWebhookSubscriptionForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.CreateOnchainTransactionForbiddenSubcode: + coinbase.public_rest_api.CreateWebhookSubscriptionForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateOnchainTransactionNotFoundErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOnchainTransactionNotFoundSubcode' - trace_id: - type: string - description: CreateOnchainTransactionNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.CreateOnchainTransactionNotFoundSubcode: - type: string - enum: - - AUTH_RESOURCE_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.CreateOrderBadRequestErrorResponse: + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.DeleteOnchainAddressGroupBadRequestErrorResponse: type: object properties: code: @@ -17061,38 +19759,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOrderBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteOnchainAddressGroupBadRequestSubcode' trace_id: type: string - description: CreateOrderBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.CreateOrderBadRequestSubcode: + description: DeleteOnchainAddressGroupBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.DeleteOnchainAddressGroupBadRequestSubcode: type: string enum: - - ENTITY_ID_INVALID - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - BUYING_POWER_CURRENCY_INVALID - - BUYING_POWER_FAILED_PRECONDITION - - ORDER_REQUEST_INVALID - - ORDER_STOP_LIMIT_NOT_ENABLED - - ORDER_PEG_NOT_ENABLED - - ORDER_DUPLICATE_CLIENT_ORDER_ID - - ORDER_REJECTED - - ORDER_PRODUCT_ID_INVALID - - ORDER_TYPE_NOT_ALLOWED - - ORDER_TIF_NOT_ENABLED - - ORDER_FAILED_PRECONDITION - - ORDER_SIDE_INVALID - - ORDER_SIZE_REQUIRED - - ORDER_SIZE_INVALID - - ORDER_DISPLAY_SIZE_INVALID - - ORDER_PRICE_INVALID - - ORDER_STOP_PRICE_INVALID - - ORDER_TIME_IN_FORCE_INVALID - - ORDER_TIME_RANGE_INVALID - - ORDER_PEG_OFFSET_TYPE_INVALID - coinbase.public_rest_api.CreateOrderForbiddenErrorResponse: + - ONCHAIN_ADDRESS_GROUP_REQUEST_INVALID + coinbase.public_rest_api.DeleteOnchainAddressGroupForbiddenErrorResponse: type: object properties: code: @@ -17100,20 +19778,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOrderForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteOnchainAddressGroupForbiddenSubcode' trace_id: type: string - description: CreateOrderForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.CreateOrderForbiddenSubcode: + description: DeleteOnchainAddressGroupForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.DeleteOnchainAddressGroupForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - BUYING_POWER_PERMISSION_DENIED - coinbase.public_rest_api.CreateOrderNotFoundErrorResponse: + coinbase.public_rest_api.DeleteOnchainAddressGroupNotFoundErrorResponse: type: object properties: code: @@ -17121,18 +19798,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateOrderNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteOnchainAddressGroupNotFoundSubcode' trace_id: type: string - description: CreateOrderNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.CreateOrderNotFoundSubcode: + description: DeleteOnchainAddressGroupNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.DeleteOnchainAddressGroupNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - - PORTFOLIO_NOT_FOUND - - BUYING_POWER_NOT_FOUND - coinbase.public_rest_api.CreatePortfolioAddressBookEntryBadRequestErrorResponse: + coinbase.public_rest_api.DeleteWebhookSubscriptionBadRequestErrorResponse: type: object properties: code: @@ -17140,21 +19815,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionBadRequestSubcode' trace_id: type: string - description: CreatePortfolioAddressBookEntryBadRequestErrorResponse documents - the HTTP 400 error body. - coinbase.public_rest_api.CreatePortfolioAddressBookEntryBadRequestSubcode: + description: DeleteWebhookSubscriptionBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.DeleteWebhookSubscriptionBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - - ADDRESS_BOOK_INVALID_ARGUMENT - - ADDRESS_BOOK_FAILED_PRECONDITION - - ADDRESS_BOOK_ADDRESS_REQUIRED - - ADDRESS_BOOK_CURRENCY_SYMBOL_REQUIRED - - ADDRESS_BOOK_NAME_REQUIRED - coinbase.public_rest_api.CreatePortfolioAddressBookEntryForbiddenErrorResponse: + - PORTFOLIO_ID_INVALID + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + coinbase.public_rest_api.DeleteWebhookSubscriptionForbiddenErrorResponse: type: object properties: code: @@ -17162,19 +19835,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionForbiddenSubcode' trace_id: type: string - description: CreatePortfolioAddressBookEntryForbiddenErrorResponse documents - the HTTP 403 error body. - coinbase.public_rest_api.CreatePortfolioAddressBookEntryForbiddenSubcode: + description: DeleteWebhookSubscriptionForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.DeleteWebhookSubscriptionForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreatePortfolioAddressBookEntryNotFoundErrorResponse: + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.DeleteWebhookSubscriptionNotFoundErrorResponse: type: object properties: code: @@ -17182,17 +19856,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreatePortfolioAddressBookEntryNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionNotFoundSubcode' trace_id: - type: string - description: CreatePortfolioAddressBookEntryNotFoundErrorResponse documents - the HTTP 404 error body. - coinbase.public_rest_api.CreatePortfolioAddressBookEntryNotFoundSubcode: + type: string + description: DeleteWebhookSubscriptionNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.DeleteWebhookSubscriptionNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - ADDRESS_BOOK_NOT_FOUND - coinbase.public_rest_api.CreateQuoteRequestBadRequestErrorResponse: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND + coinbase.public_rest_api.EditOrderBadRequestErrorResponse: type: object properties: code: @@ -17200,12 +19873,11 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateQuoteRequestBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.EditOrderBadRequestSubcode' trace_id: type: string - description: CreateQuoteRequestBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.CreateQuoteRequestBadRequestSubcode: + description: EditOrderBadRequestErrorResponse documents the HTTP 400 error body. + coinbase.public_rest_api.EditOrderBadRequestSubcode: type: string enum: - ENTITY_ID_INVALID @@ -17214,17 +19886,12 @@ components: - BUYING_POWER_CURRENCY_INVALID - BUYING_POWER_FAILED_PRECONDITION - ORDER_REQUEST_INVALID + - ORDER_DUPLICATE_CLIENT_ORDER_ID + - ORDER_REJECTED - ORDER_PRODUCT_ID_INVALID - - ORDER_FAILED_PRECONDITION - - ORDER_PRODUCT_ID_REQUIRED - - ORDER_SIDE_REQUIRED - ORDER_RESOURCE_NOT_FOUND - ORDER_SIDE_INVALID - - ORDER_SIZE_INVALID - - ORDER_PRICE_INVALID - - ORDER_CLIENT_QUOTE_ID_REQUIRED - - ORDER_QUOTE_DURATION_INVALID - coinbase.public_rest_api.CreateQuoteRequestForbiddenErrorResponse: + coinbase.public_rest_api.EditOrderForbiddenErrorResponse: type: object properties: code: @@ -17232,12 +19899,11 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateQuoteRequestForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.EditOrderForbiddenSubcode' trace_id: type: string - description: CreateQuoteRequestForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.CreateQuoteRequestForbiddenSubcode: + description: EditOrderForbiddenErrorResponse documents the HTTP 403 error body. + coinbase.public_rest_api.EditOrderForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED @@ -17245,9 +19911,7 @@ components: - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - BUYING_POWER_PERMISSION_DENIED - - ORDER_RFQ_NOT_ENABLED - - ORDER_RFQ_SIQ_NOT_ENABLED - coinbase.public_rest_api.CreateQuoteRequestNotFoundErrorResponse: + coinbase.public_rest_api.EditOrderNotFoundErrorResponse: type: object properties: code: @@ -17255,112 +19919,81 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateQuoteRequestNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.EditOrderNotFoundSubcode' trace_id: type: string - description: CreateQuoteRequestNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.CreateQuoteRequestNotFoundSubcode: + description: EditOrderNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.EditOrderNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - ENTITY_NOT_FOUND - - PORTFOLIO_NOT_FOUND - BUYING_POWER_NOT_FOUND - coinbase.public_rest_api.CreateWalletBadRequestErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletBadRequestSubcode' - trace_id: - type: string - description: CreateWalletBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.CreateWalletBadRequestSubcode: + coinbase.public_rest_api.ForbiddenErrorCode: type: string enum: - - PORTFOLIO_ID_INVALID - - WALLET_TYPE_NOT_SUPPORTED - - WALLET_REQUEST_INVALID - - WALLET_ONCHAIN_SYMBOLS_NOT_ALLOWED - - WALLET_FAILED_PRECONDITION - - WALLET_NETWORK_ID_REQUIRED - - WALLET_NETWORK_INVALID - - WALLET_ONCHAIN_SETUP_UNAVAILABLE - - WALLET_NAME_REQUIRED - - WALLET_SYMBOL_REQUIRED - - WALLET_NETWORK_FAMILY_REQUIRED - - WALLET_NETWORK_FAMILY_NOT_ALLOWED - - WALLET_NETWORK_TYPE_REQUIRED - coinbase.public_rest_api.CreateWalletDepositAddressBadRequestErrorResponse: + - PERMISSION_DENIED + coinbase.public_rest_api.GetActivityForbiddenErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletDepositAddressBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetActivityForbiddenSubcode' trace_id: type: string - description: CreateWalletDepositAddressBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.CreateWalletDepositAddressBadRequestSubcode: + description: GetActivityForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetActivityForbiddenSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_NOT_DEPOSITABLE - - WALLET_DEPOSIT_REQUEST_INVALID - - WALLET_FAILED_PRECONDITION - - WALLET_NETWORK_ID_REQUIRED - - WALLET_NETWORK_INVALID - - WALLET_NETWORK_TYPE_NOT_SUPPORTED - coinbase.public_rest_api.CreateWalletDepositAddressForbiddenErrorResponse: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.GetActivityNotFoundErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletDepositAddressForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetActivityNotFoundSubcode' trace_id: type: string - description: CreateWalletDepositAddressForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.CreateWalletDepositAddressForbiddenSubcode: + description: GetActivityNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetActivityNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_ACCESS_DENIED - - MTLS_CERTIFICATE_REQUIRED - - MTLS_CERTIFICATE_REVOKED - - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateWalletDepositAddressNotFoundErrorResponse: + - AUTH_RESOURCE_NOT_FOUND + - ACTIVITY_NOT_FOUND + coinbase.public_rest_api.GetAllocationBadRequestErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletDepositAddressNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationBadRequestSubcode' trace_id: type: string - description: CreateWalletDepositAddressNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.CreateWalletDepositAddressNotFoundSubcode: + description: GetAllocationBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetAllocationBadRequestSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.CreateWalletForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ALLOCATION_ID_REQUIRED + - ALLOCATION_ID_INVALID + - ALLOCATION_NETTING_ID_REQUIRED + - ALLOCATION_NETTING_ID_INVALID + - ALLOCATION_REQUEST_INVALID + coinbase.public_rest_api.GetAllocationForbiddenErrorResponse: type: object properties: code: @@ -17368,19 +20001,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationForbiddenSubcode' trace_id: type: string - description: CreateWalletForbiddenErrorResponse documents the HTTP 403 error + description: GetAllocationForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.CreateWalletForbiddenSubcode: + coinbase.public_rest_api.GetAllocationForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.CreateWalletNotFoundErrorResponse: + coinbase.public_rest_api.GetAllocationNotFoundErrorResponse: type: object properties: code: @@ -17388,18 +20021,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationNotFoundSubcode' trace_id: type: string - description: CreateWalletNotFoundErrorResponse documents the HTTP 404 error + description: GetAllocationNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.CreateWalletNotFoundSubcode: + coinbase.public_rest_api.GetAllocationNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ASSET_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.CreateWalletTransferBadRequestErrorResponse: + - ALLOCATION_NOT_FOUND + coinbase.public_rest_api.GetAllocationsByClientNettingIdBadRequestErrorResponse: type: object properties: code: @@ -17407,27 +20039,22 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletTransferBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationsByClientNettingIdBadRequestSubcode' trace_id: type: string - description: CreateWalletTransferBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.CreateWalletTransferBadRequestSubcode: + description: GetAllocationsByClientNettingIdBadRequestErrorResponse documents + the HTTP 400 error body. + coinbase.public_rest_api.GetAllocationsByClientNettingIdBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_REQUEST_INVALID - - WALLET_FAILED_PRECONDITION - - WALLET_AMOUNT_REQUIRED - - WALLET_IDEMPOTENCY_KEY_REQUIRED - - WALLET_IDEMPOTENCY_KEY_INVALID - - WALLET_CURRENCY_SYMBOL_REQUIRED - - WALLET_TRANSFER_DESTINATION_REQUIRED - - WALLET_TRANSFER_DESTINATION_INVALID - coinbase.public_rest_api.CreateWalletTransferForbiddenErrorResponse: + - ALLOCATION_ID_REQUIRED + - ALLOCATION_ID_INVALID + - ALLOCATION_NETTING_ID_REQUIRED + - ALLOCATION_NETTING_ID_INVALID + - ALLOCATION_REQUEST_INVALID + coinbase.public_rest_api.GetAllocationsByClientNettingIdForbiddenErrorResponse: type: object properties: code: @@ -17435,20 +20062,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletTransferForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationsByClientNettingIdForbiddenSubcode' trace_id: type: string - description: CreateWalletTransferForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.CreateWalletTransferForbiddenSubcode: + description: GetAllocationsByClientNettingIdForbiddenErrorResponse documents + the HTTP 403 error body. + coinbase.public_rest_api.GetAllocationsByClientNettingIdForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - WALLET_PORTFOLIO_CREDIT_FROZEN - coinbase.public_rest_api.CreateWalletTransferNotFoundErrorResponse: + coinbase.public_rest_api.GetAllocationsByClientNettingIdNotFoundErrorResponse: type: object properties: code: @@ -17456,17 +20082,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletTransferNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationsByClientNettingIdNotFoundSubcode' trace_id: type: string - description: CreateWalletTransferNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.CreateWalletTransferNotFoundSubcode: + description: GetAllocationsByClientNettingIdNotFoundErrorResponse documents + the HTTP 404 error body. + coinbase.public_rest_api.GetAllocationsByClientNettingIdNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.CreateWalletWithdrawalBadRequestErrorResponse: + - ALLOCATION_NOT_FOUND + coinbase.public_rest_api.GetBuyingPowerBadRequestErrorResponse: type: object properties: code: @@ -17474,29 +20100,21 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletWithdrawalBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetBuyingPowerBadRequestSubcode' trace_id: type: string - description: CreateWalletWithdrawalBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.CreateWalletWithdrawalBadRequestSubcode: + description: GetBuyingPowerBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetBuyingPowerBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_REQUEST_INVALID - - WALLET_FAILED_PRECONDITION - - WALLET_NETWORK_INVALID - - WALLET_AMOUNT_REQUIRED - - WALLET_IDEMPOTENCY_KEY_REQUIRED - - WALLET_IDEMPOTENCY_KEY_INVALID - - WALLET_CURRENCY_SYMBOL_REQUIRED - - WALLET_DESTINATION_TYPE_REQUIRED - - WALLET_DESTINATION_TYPE_INVALID - - WALLET_COUNTERPARTY_ID_REQUIRED - coinbase.public_rest_api.CreateWalletWithdrawalForbiddenErrorResponse: + - BUYING_POWER_BASE_CURRENCY_REQUIRED + - BUYING_POWER_QUOTE_CURRENCY_REQUIRED + - BUYING_POWER_CURRENCY_INVALID + - BUYING_POWER_FAILED_PRECONDITION + coinbase.public_rest_api.GetBuyingPowerForbiddenErrorResponse: type: object properties: code: @@ -17504,20 +20122,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletWithdrawalForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetBuyingPowerForbiddenSubcode' trace_id: type: string - description: CreateWalletWithdrawalForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.CreateWalletWithdrawalForbiddenSubcode: + description: GetBuyingPowerForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetBuyingPowerForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - WALLET_PORTFOLIO_CREDIT_FROZEN - coinbase.public_rest_api.CreateWalletWithdrawalNotFoundErrorResponse: + - BUYING_POWER_PERMISSION_DENIED + coinbase.public_rest_api.GetBuyingPowerNotFoundErrorResponse: type: object properties: code: @@ -17525,18 +20143,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.CreateWalletWithdrawalNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetBuyingPowerNotFoundSubcode' trace_id: type: string - description: CreateWalletWithdrawalNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.CreateWalletWithdrawalNotFoundSubcode: + description: GetBuyingPowerNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetBuyingPowerNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ASSET_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.DeleteOnchainAddressGroupBadRequestErrorResponse: + - BUYING_POWER_NOT_FOUND + coinbase.public_rest_api.GetCandlesBadRequestErrorResponse: type: object properties: code: @@ -17544,16 +20161,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.DeleteOnchainAddressGroupBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCandlesBadRequestSubcode' trace_id: type: string - description: DeleteOnchainAddressGroupBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.DeleteOnchainAddressGroupBadRequestSubcode: + description: GetCandlesBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetCandlesBadRequestSubcode: type: string enum: - - ONCHAIN_ADDRESS_GROUP_REQUEST_INVALID - coinbase.public_rest_api.DeleteOnchainAddressGroupForbiddenErrorResponse: + - CANDLE_REQUEST_INVALID + - CANDLE_TIME_RANGE_INVALID + coinbase.public_rest_api.GetCandlesForbiddenErrorResponse: type: object properties: code: @@ -17561,19 +20179,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.DeleteOnchainAddressGroupForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCandlesForbiddenSubcode' trace_id: type: string - description: DeleteOnchainAddressGroupForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.DeleteOnchainAddressGroupForbiddenSubcode: + description: GetCandlesForbiddenErrorResponse documents the HTTP 403 error body. + coinbase.public_rest_api.GetCandlesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.DeleteOnchainAddressGroupNotFoundErrorResponse: + coinbase.public_rest_api.GetCandlesNotFoundErrorResponse: type: object properties: code: @@ -17581,16 +20198,37 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.DeleteOnchainAddressGroupNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCandlesNotFoundSubcode' trace_id: type: string - description: DeleteOnchainAddressGroupNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.DeleteOnchainAddressGroupNotFoundSubcode: + description: GetCandlesNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetCandlesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.EditOrderBadRequestErrorResponse: + coinbase.public_rest_api.GetConversionFeesForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetConversionFeesForbiddenSubcode' + trace_id: + type: string + description: GetConversionFeesForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetConversionFeesForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - CONVERSION_FEE_FEATURE_DISABLED + - CONVERSION_FEE_NOT_ENABLED_FOR_ORG + coinbase.public_rest_api.GetCrossMarginOverviewBadRequestErrorResponse: type: object properties: code: @@ -17598,25 +20236,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.EditOrderBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginOverviewBadRequestSubcode' trace_id: type: string - description: EditOrderBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.EditOrderBadRequestSubcode: + description: GetCrossMarginOverviewBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetCrossMarginOverviewBadRequestSubcode: type: string enum: + - ENTITY_ID_REQUIRED - ENTITY_ID_INVALID - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - BUYING_POWER_CURRENCY_INVALID - - BUYING_POWER_FAILED_PRECONDITION - - ORDER_REQUEST_INVALID - - ORDER_DUPLICATE_CLIENT_ORDER_ID - - ORDER_REJECTED - - ORDER_PRODUCT_ID_INVALID - - ORDER_RESOURCE_NOT_FOUND - - ORDER_SIDE_INVALID - coinbase.public_rest_api.EditOrderForbiddenErrorResponse: + - CROSS_MARGIN_INVALID_ARGUMENT + - CROSS_MARGIN_FAILED_PRECONDITION + coinbase.public_rest_api.GetCrossMarginOverviewForbiddenErrorResponse: type: object properties: code: @@ -17624,19 +20256,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.EditOrderForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginOverviewForbiddenSubcode' trace_id: type: string - description: EditOrderForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.EditOrderForbiddenSubcode: + description: GetCrossMarginOverviewForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetCrossMarginOverviewForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - BUYING_POWER_PERMISSION_DENIED - coinbase.public_rest_api.EditOrderNotFoundErrorResponse: + - CROSS_MARGIN_NOT_ENABLED + coinbase.public_rest_api.GetCrossMarginOverviewNotFoundErrorResponse: type: object properties: code: @@ -17644,21 +20277,37 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.EditOrderNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginOverviewNotFoundSubcode' trace_id: type: string - description: EditOrderNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.EditOrderNotFoundSubcode: + description: GetCrossMarginOverviewNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetCrossMarginOverviewNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - ENTITY_NOT_FOUND - - BUYING_POWER_NOT_FOUND - coinbase.public_rest_api.ForbiddenErrorCode: + coinbase.public_rest_api.GetCrossMarginPrimeOverviewBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewBadRequestSubcode' + trace_id: + type: string + description: GetCrossMarginPrimeOverviewBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetCrossMarginPrimeOverviewBadRequestSubcode: type: string enum: - - PERMISSION_DENIED - coinbase.public_rest_api.GetActivityForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - ENTITY_ID_INVALID + - CROSS_MARGIN_INVALID_ARGUMENT + - CROSS_MARGIN_FAILED_PRECONDITION + coinbase.public_rest_api.GetCrossMarginPrimeOverviewForbiddenErrorResponse: type: object properties: code: @@ -17666,19 +20315,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetActivityForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewForbiddenSubcode' trace_id: type: string - description: GetActivityForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetActivityForbiddenSubcode: + description: GetCrossMarginPrimeOverviewForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetCrossMarginPrimeOverviewForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetActivityNotFoundErrorResponse: + - CROSS_MARGIN_NOT_ENABLED + coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundErrorResponse: type: object properties: code: @@ -17686,16 +20336,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetActivityNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundSubcode' trace_id: type: string - description: GetActivityNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetActivityNotFoundSubcode: + description: GetCrossMarginPrimeOverviewNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ACTIVITY_NOT_FOUND - coinbase.public_rest_api.GetAllocationBadRequestErrorResponse: + - ENTITY_NOT_FOUND + coinbase.public_rest_api.GetCrossMarginRiskParametersBadRequestErrorResponse: type: object properties: code: @@ -17703,22 +20354,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginRiskParametersBadRequestSubcode' trace_id: type: string - description: GetAllocationBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetAllocationBadRequestSubcode: + description: GetCrossMarginRiskParametersBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetCrossMarginRiskParametersBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - ALLOCATION_ID_REQUIRED - - ALLOCATION_ID_INVALID - - ALLOCATION_NETTING_ID_REQUIRED - - ALLOCATION_NETTING_ID_INVALID - - ALLOCATION_REQUEST_INVALID - coinbase.public_rest_api.GetAllocationForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - ENTITY_ID_INVALID + - CROSS_MARGIN_INVALID_ARGUMENT + - CROSS_MARGIN_FAILED_PRECONDITION + coinbase.public_rest_api.GetCrossMarginRiskParametersForbiddenErrorResponse: type: object properties: code: @@ -17726,19 +20374,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginRiskParametersForbiddenSubcode' trace_id: type: string - description: GetAllocationForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetAllocationForbiddenSubcode: + description: GetCrossMarginRiskParametersForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetCrossMarginRiskParametersForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetAllocationNotFoundErrorResponse: + - CROSS_MARGIN_NOT_ENABLED + coinbase.public_rest_api.GetCrossMarginRiskParametersNotFoundErrorResponse: type: object properties: code: @@ -17746,17 +20395,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginRiskParametersNotFoundSubcode' trace_id: type: string - description: GetAllocationNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetAllocationNotFoundSubcode: + description: GetCrossMarginRiskParametersNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetCrossMarginRiskParametersNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ALLOCATION_NOT_FOUND - coinbase.public_rest_api.GetAllocationsByClientNettingIdBadRequestErrorResponse: + - ENTITY_NOT_FOUND + coinbase.public_rest_api.GetDerivativePositionsBadRequestErrorResponse: type: object properties: code: @@ -17764,22 +20413,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationsByClientNettingIdBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativePositionsBadRequestSubcode' trace_id: type: string - description: GetAllocationsByClientNettingIdBadRequestErrorResponse documents - the HTTP 400 error body. - coinbase.public_rest_api.GetAllocationsByClientNettingIdBadRequestSubcode: + description: GetDerivativePositionsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetDerivativePositionsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - ALLOCATION_ID_REQUIRED - - ALLOCATION_ID_INVALID - - ALLOCATION_NETTING_ID_REQUIRED - - ALLOCATION_NETTING_ID_INVALID - - ALLOCATION_REQUEST_INVALID - coinbase.public_rest_api.GetAllocationsByClientNettingIdForbiddenErrorResponse: + coinbase.public_rest_api.GetDerivativePositionsForbiddenErrorResponse: type: object properties: code: @@ -17787,19 +20430,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationsByClientNettingIdForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativePositionsForbiddenSubcode' trace_id: type: string - description: GetAllocationsByClientNettingIdForbiddenErrorResponse documents - the HTTP 403 error body. - coinbase.public_rest_api.GetAllocationsByClientNettingIdForbiddenSubcode: + description: GetDerivativePositionsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetDerivativePositionsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetAllocationsByClientNettingIdNotFoundErrorResponse: + coinbase.public_rest_api.GetDerivativePositionsNotFoundErrorResponse: type: object properties: code: @@ -17807,17 +20450,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetAllocationsByClientNettingIdNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativePositionsNotFoundSubcode' trace_id: type: string - description: GetAllocationsByClientNettingIdNotFoundErrorResponse documents - the HTTP 404 error body. - coinbase.public_rest_api.GetAllocationsByClientNettingIdNotFoundSubcode: + description: GetDerivativePositionsNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetDerivativePositionsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ALLOCATION_NOT_FOUND - coinbase.public_rest_api.GetBuyingPowerBadRequestErrorResponse: + - ENTITY_POSITION_NOT_FOUND + coinbase.public_rest_api.GetDerivativesCurrencySummaryBadRequestErrorResponse: type: object properties: code: @@ -17825,21 +20468,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetBuyingPowerBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativesCurrencySummaryBadRequestSubcode' trace_id: type: string - description: GetBuyingPowerBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetBuyingPowerBadRequestSubcode: + description: GetDerivativesCurrencySummaryBadRequestErrorResponse documents + the HTTP 400 error body. + coinbase.public_rest_api.GetDerivativesCurrencySummaryBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - BUYING_POWER_BASE_CURRENCY_REQUIRED - - BUYING_POWER_QUOTE_CURRENCY_REQUIRED - - BUYING_POWER_CURRENCY_INVALID - - BUYING_POWER_FAILED_PRECONDITION - coinbase.public_rest_api.GetBuyingPowerForbiddenErrorResponse: + coinbase.public_rest_api.GetDerivativesCurrencySummaryForbiddenErrorResponse: type: object properties: code: @@ -17847,20 +20485,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetBuyingPowerForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativesCurrencySummaryForbiddenSubcode' trace_id: type: string - description: GetBuyingPowerForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetBuyingPowerForbiddenSubcode: + description: GetDerivativesCurrencySummaryForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetDerivativesCurrencySummaryForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - BUYING_POWER_PERMISSION_DENIED - coinbase.public_rest_api.GetBuyingPowerNotFoundErrorResponse: + coinbase.public_rest_api.GetDerivativesCurrencySummaryNotFoundErrorResponse: type: object properties: code: @@ -17868,17 +20505,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetBuyingPowerNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativesCurrencySummaryNotFoundSubcode' trace_id: type: string - description: GetBuyingPowerNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetBuyingPowerNotFoundSubcode: + description: GetDerivativesCurrencySummaryNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetDerivativesCurrencySummaryNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - BUYING_POWER_NOT_FOUND - coinbase.public_rest_api.GetCandlesBadRequestErrorResponse: + - FCM_BALANCE_NOT_FOUND + coinbase.public_rest_api.GetEntityActivitiesBadRequestErrorResponse: type: object properties: code: @@ -17886,17 +20523,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCandlesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityActivitiesBadRequestSubcode' trace_id: type: string - description: GetCandlesBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetCandlesBadRequestSubcode: + description: GetEntityActivitiesBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetEntityActivitiesBadRequestSubcode: type: string enum: - - CANDLE_REQUEST_INVALID - - CANDLE_TIME_RANGE_INVALID - coinbase.public_rest_api.GetCandlesForbiddenErrorResponse: + - ENTITY_ID_INVALID + - ACTIVITY_REQUEST_INVALID + - ACTIVITY_CATEGORY_INVALID + - ACTIVITY_TIME_RANGE_INVALID + - ACTIVITY_STATUS_INVALID + coinbase.public_rest_api.GetEntityActivitiesForbiddenErrorResponse: type: object properties: code: @@ -17904,18 +20544,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCandlesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityActivitiesForbiddenSubcode' trace_id: type: string - description: GetCandlesForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetCandlesForbiddenSubcode: + description: GetEntityActivitiesForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetEntityActivitiesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetCandlesNotFoundErrorResponse: + - ACTIVITY_ACCESS_DENIED + coinbase.public_rest_api.GetEntityActivitiesNotFoundErrorResponse: type: object properties: code: @@ -17923,37 +20565,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCandlesNotFoundSubcode' - trace_id: - type: string - description: GetCandlesNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetCandlesNotFoundSubcode: - type: string - enum: - - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetConversionFeesForbiddenErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetConversionFeesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityActivitiesNotFoundSubcode' trace_id: type: string - description: GetConversionFeesForbiddenErrorResponse documents the HTTP 403 + description: GetEntityActivitiesNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetConversionFeesForbiddenSubcode: + coinbase.public_rest_api.GetEntityActivitiesNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_ACCESS_DENIED - - MTLS_CERTIFICATE_REQUIRED - - MTLS_CERTIFICATE_REVOKED - - MTLS_CERTIFICATE_INVALID - - CONVERSION_FEE_FEATURE_DISABLED - - CONVERSION_FEE_NOT_ENABLED_FOR_ORG - coinbase.public_rest_api.GetCrossMarginOverviewBadRequestErrorResponse: + - AUTH_RESOURCE_NOT_FOUND + coinbase.public_rest_api.GetEntityAssetsBadRequestErrorResponse: type: object properties: code: @@ -17961,19 +20582,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginOverviewBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityAssetsBadRequestSubcode' trace_id: type: string - description: GetCrossMarginOverviewBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetCrossMarginOverviewBadRequestSubcode: + description: GetEntityAssetsBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetEntityAssetsBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - CROSS_MARGIN_INVALID_ARGUMENT - - CROSS_MARGIN_FAILED_PRECONDITION - coinbase.public_rest_api.GetCrossMarginOverviewForbiddenErrorResponse: + - ASSET_REQUEST_INVALID + coinbase.public_rest_api.GetEntityAssetsForbiddenErrorResponse: type: object properties: code: @@ -17981,20 +20599,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginOverviewForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityAssetsForbiddenSubcode' trace_id: type: string - description: GetCrossMarginOverviewForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetCrossMarginOverviewForbiddenSubcode: + description: GetEntityAssetsForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetEntityAssetsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - CROSS_MARGIN_NOT_ENABLED - coinbase.public_rest_api.GetCrossMarginOverviewNotFoundErrorResponse: + coinbase.public_rest_api.GetEntityAssetsNotFoundErrorResponse: type: object properties: code: @@ -18002,17 +20619,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginOverviewNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityAssetsNotFoundSubcode' trace_id: type: string - description: GetCrossMarginOverviewNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetCrossMarginOverviewNotFoundSubcode: + description: GetEntityAssetsNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetEntityAssetsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - coinbase.public_rest_api.GetCrossMarginPrimeOverviewBadRequestErrorResponse: + - ASSET_NOT_FOUND + coinbase.public_rest_api.GetEntityPaymentMethodDetailsBadRequestErrorResponse: type: object properties: code: @@ -18020,19 +20637,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodDetailsBadRequestSubcode' trace_id: type: string - description: GetCrossMarginPrimeOverviewBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.GetCrossMarginPrimeOverviewBadRequestSubcode: + description: GetEntityPaymentMethodDetailsBadRequestErrorResponse documents + the HTTP 400 error body. + coinbase.public_rest_api.GetEntityPaymentMethodDetailsBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - ENTITY_ID_INVALID - - CROSS_MARGIN_INVALID_ARGUMENT - - CROSS_MARGIN_FAILED_PRECONDITION - coinbase.public_rest_api.GetCrossMarginPrimeOverviewForbiddenErrorResponse: + - PAYMENT_METHOD_ID_REQUIRED + - PAYMENT_METHOD_ID_INVALID + - PAYMENT_METHOD_REQUEST_INVALID + coinbase.public_rest_api.GetEntityPaymentMethodDetailsForbiddenErrorResponse: type: object properties: code: @@ -18040,20 +20658,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodDetailsForbiddenSubcode' trace_id: type: string - description: GetCrossMarginPrimeOverviewForbiddenErrorResponse documents the + description: GetEntityPaymentMethodDetailsForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetCrossMarginPrimeOverviewForbiddenSubcode: + coinbase.public_rest_api.GetEntityPaymentMethodDetailsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - CROSS_MARGIN_NOT_ENABLED - coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundErrorResponse: + coinbase.public_rest_api.GetEntityPaymentMethodDetailsNotFoundErrorResponse: type: object properties: code: @@ -18061,17 +20678,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodDetailsNotFoundSubcode' trace_id: type: string - description: GetCrossMarginPrimeOverviewNotFoundErrorResponse documents the + description: GetEntityPaymentMethodDetailsNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundSubcode: + coinbase.public_rest_api.GetEntityPaymentMethodDetailsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - coinbase.public_rest_api.GetCrossMarginRiskParametersBadRequestErrorResponse: + - PAYMENT_METHOD_NOT_FOUND + coinbase.public_rest_api.GetEntityPaymentMethodsBadRequestErrorResponse: type: object properties: code: @@ -18079,19 +20696,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginRiskParametersBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodsBadRequestSubcode' trace_id: type: string - description: GetCrossMarginRiskParametersBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.GetCrossMarginRiskParametersBadRequestSubcode: + description: GetEntityPaymentMethodsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetEntityPaymentMethodsBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - ENTITY_ID_INVALID - - CROSS_MARGIN_INVALID_ARGUMENT - - CROSS_MARGIN_FAILED_PRECONDITION - coinbase.public_rest_api.GetCrossMarginRiskParametersForbiddenErrorResponse: + - PAYMENT_METHOD_REQUEST_INVALID + coinbase.public_rest_api.GetEntityPaymentMethodsForbiddenErrorResponse: type: object properties: code: @@ -18099,20 +20715,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginRiskParametersForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodsForbiddenSubcode' trace_id: type: string - description: GetCrossMarginRiskParametersForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetCrossMarginRiskParametersForbiddenSubcode: + description: GetEntityPaymentMethodsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetEntityPaymentMethodsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - CROSS_MARGIN_NOT_ENABLED - coinbase.public_rest_api.GetCrossMarginRiskParametersNotFoundErrorResponse: + coinbase.public_rest_api.GetEntityPaymentMethodsNotFoundErrorResponse: type: object properties: code: @@ -18120,17 +20735,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginRiskParametersNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodsNotFoundSubcode' trace_id: type: string - description: GetCrossMarginRiskParametersNotFoundErrorResponse documents the - HTTP 404 error body. - coinbase.public_rest_api.GetCrossMarginRiskParametersNotFoundSubcode: + description: GetEntityPaymentMethodsNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetEntityPaymentMethodsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - coinbase.public_rest_api.GetDerivativePositionsBadRequestErrorResponse: + - PAYMENT_METHOD_NOT_FOUND + coinbase.public_rest_api.GetEntityRewardsRateBadRequestErrorResponse: type: object properties: code: @@ -18138,16 +20753,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativePositionsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateBadRequestSubcode' trace_id: type: string - description: GetDerivativePositionsBadRequestErrorResponse documents the HTTP + description: GetEntityRewardsRateBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetDerivativePositionsBadRequestSubcode: + coinbase.public_rest_api.GetEntityRewardsRateBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - coinbase.public_rest_api.GetDerivativePositionsForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - ENTITY_ID_INVALID + - REWARDS_REQUEST_INVALID + - REWARDS_ENTITY_NOT_ENROLLED + coinbase.public_rest_api.GetEntityRewardsRateForbiddenErrorResponse: type: object properties: code: @@ -18155,19 +20773,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativePositionsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateForbiddenSubcode' trace_id: type: string - description: GetDerivativePositionsForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetDerivativePositionsForbiddenSubcode: + description: GetEntityRewardsRateForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetEntityRewardsRateForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetDerivativePositionsNotFoundErrorResponse: + - REWARDS_API_FEATURE_DISABLED + coinbase.public_rest_api.GetEntityRewardsRateNotFoundErrorResponse: type: object properties: code: @@ -18175,17 +20794,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativePositionsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateNotFoundSubcode' trace_id: type: string - description: GetDerivativePositionsNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetDerivativePositionsNotFoundSubcode: + description: GetEntityRewardsRateNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetEntityRewardsRateNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_POSITION_NOT_FOUND - coinbase.public_rest_api.GetDerivativesCurrencySummaryBadRequestErrorResponse: + coinbase.public_rest_api.GetEntityUsersBadRequestErrorResponse: type: object properties: code: @@ -18193,16 +20811,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativesCurrencySummaryBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityUsersBadRequestSubcode' trace_id: type: string - description: GetDerivativesCurrencySummaryBadRequestErrorResponse documents - the HTTP 400 error body. - coinbase.public_rest_api.GetDerivativesCurrencySummaryBadRequestSubcode: + description: GetEntityUsersBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetEntityUsersBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - coinbase.public_rest_api.GetDerivativesCurrencySummaryForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - ENTITY_ID_INVALID + coinbase.public_rest_api.GetEntityUsersForbiddenErrorResponse: type: object properties: code: @@ -18210,19 +20829,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativesCurrencySummaryForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityUsersForbiddenSubcode' trace_id: type: string - description: GetDerivativesCurrencySummaryForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetDerivativesCurrencySummaryForbiddenSubcode: + description: GetEntityUsersForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetEntityUsersForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetDerivativesCurrencySummaryNotFoundErrorResponse: + coinbase.public_rest_api.GetEntityUsersNotFoundErrorResponse: type: object properties: code: @@ -18230,17 +20849,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetDerivativesCurrencySummaryNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityUsersNotFoundSubcode' trace_id: type: string - description: GetDerivativesCurrencySummaryNotFoundErrorResponse documents the - HTTP 404 error body. - coinbase.public_rest_api.GetDerivativesCurrencySummaryNotFoundSubcode: + description: GetEntityUsersNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetEntityUsersNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_BALANCE_NOT_FOUND - coinbase.public_rest_api.GetEntityActivitiesBadRequestErrorResponse: + coinbase.public_rest_api.GetExistingLocatesBadRequestErrorResponse: type: object properties: code: @@ -18248,20 +20866,21 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityActivitiesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetExistingLocatesBadRequestSubcode' trace_id: type: string - description: GetEntityActivitiesBadRequestErrorResponse documents the HTTP 400 + description: GetExistingLocatesBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetEntityActivitiesBadRequestSubcode: + coinbase.public_rest_api.GetExistingLocatesBadRequestSubcode: type: string enum: - - ENTITY_ID_INVALID - - ACTIVITY_REQUEST_INVALID - - ACTIVITY_CATEGORY_INVALID - - ACTIVITY_TIME_RANGE_INVALID - - ACTIVITY_STATUS_INVALID - coinbase.public_rest_api.GetEntityActivitiesForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - LOCATE_DATE_INVALID + - LOCATE_REQUEST_INVALID + - LOCATE_IDS_INVALID + - LOCATE_FAILED_PRECONDITION + coinbase.public_rest_api.GetExistingLocatesForbiddenErrorResponse: type: object properties: code: @@ -18269,20 +20888,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityActivitiesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetExistingLocatesForbiddenSubcode' trace_id: type: string - description: GetEntityActivitiesForbiddenErrorResponse documents the HTTP 403 + description: GetExistingLocatesForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetEntityActivitiesForbiddenSubcode: + coinbase.public_rest_api.GetExistingLocatesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - ACTIVITY_ACCESS_DENIED - coinbase.public_rest_api.GetEntityActivitiesNotFoundErrorResponse: + coinbase.public_rest_api.GetExistingLocatesNotFoundErrorResponse: type: object properties: code: @@ -18290,16 +20908,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityActivitiesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetExistingLocatesNotFoundSubcode' trace_id: type: string - description: GetEntityActivitiesNotFoundErrorResponse documents the HTTP 404 + description: GetExistingLocatesNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetEntityActivitiesNotFoundSubcode: + coinbase.public_rest_api.GetExistingLocatesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetEntityAssetsBadRequestErrorResponse: + coinbase.public_rest_api.GetFcmBalanceBadRequestErrorResponse: type: object properties: code: @@ -18307,16 +20925,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityAssetsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmBalanceBadRequestSubcode' trace_id: type: string - description: GetEntityAssetsBadRequestErrorResponse documents the HTTP 400 error + description: GetFcmBalanceBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetEntityAssetsBadRequestSubcode: + coinbase.public_rest_api.GetFcmBalanceBadRequestSubcode: type: string enum: - - ASSET_REQUEST_INVALID - coinbase.public_rest_api.GetEntityAssetsForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - FCM_INVALID_ARGUMENT + coinbase.public_rest_api.GetFcmBalanceForbiddenErrorResponse: type: object properties: code: @@ -18324,19 +20943,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityAssetsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmBalanceForbiddenSubcode' trace_id: type: string - description: GetEntityAssetsForbiddenErrorResponse documents the HTTP 403 error + description: GetFcmBalanceForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetEntityAssetsForbiddenSubcode: + coinbase.public_rest_api.GetFcmBalanceForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetEntityAssetsNotFoundErrorResponse: + coinbase.public_rest_api.GetFcmBalanceNotFoundErrorResponse: type: object properties: code: @@ -18344,17 +20963,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityAssetsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmBalanceNotFoundSubcode' trace_id: type: string - description: GetEntityAssetsNotFoundErrorResponse documents the HTTP 404 error + description: GetFcmBalanceNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetEntityAssetsNotFoundSubcode: + coinbase.public_rest_api.GetFcmBalanceNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ASSET_NOT_FOUND - coinbase.public_rest_api.GetEntityPaymentMethodDetailsBadRequestErrorResponse: + - FCM_BALANCE_NOT_FOUND + coinbase.public_rest_api.GetFcmEquityBadRequestErrorResponse: type: object properties: code: @@ -18362,20 +20981,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodDetailsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmEquityBadRequestSubcode' trace_id: type: string - description: GetEntityPaymentMethodDetailsBadRequestErrorResponse documents - the HTTP 400 error body. - coinbase.public_rest_api.GetEntityPaymentMethodDetailsBadRequestSubcode: + description: GetFcmEquityBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetFcmEquityBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - PAYMENT_METHOD_ID_REQUIRED - - PAYMENT_METHOD_ID_INVALID - - PAYMENT_METHOD_REQUEST_INVALID - coinbase.public_rest_api.GetEntityPaymentMethodDetailsForbiddenErrorResponse: + coinbase.public_rest_api.GetFcmEquityForbiddenErrorResponse: type: object properties: code: @@ -18383,19 +20998,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodDetailsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmEquityForbiddenSubcode' trace_id: type: string - description: GetEntityPaymentMethodDetailsForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetEntityPaymentMethodDetailsForbiddenSubcode: + description: GetFcmEquityForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetFcmEquityForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetEntityPaymentMethodDetailsNotFoundErrorResponse: + coinbase.public_rest_api.GetFcmEquityNotFoundErrorResponse: type: object properties: code: @@ -18403,17 +21018,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodDetailsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmEquityNotFoundSubcode' trace_id: type: string - description: GetEntityPaymentMethodDetailsNotFoundErrorResponse documents the - HTTP 404 error body. - coinbase.public_rest_api.GetEntityPaymentMethodDetailsNotFoundSubcode: + description: GetFcmEquityNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetFcmEquityNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - PAYMENT_METHOD_NOT_FOUND - coinbase.public_rest_api.GetEntityPaymentMethodsBadRequestErrorResponse: + - FCM_EQUITY_NOT_FOUND + coinbase.public_rest_api.GetFcmMarginCallDetailsBadRequestErrorResponse: type: object properties: code: @@ -18421,18 +21036,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmMarginCallDetailsBadRequestSubcode' trace_id: type: string - description: GetEntityPaymentMethodsBadRequestErrorResponse documents the HTTP + description: GetFcmMarginCallDetailsBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetEntityPaymentMethodsBadRequestSubcode: + coinbase.public_rest_api.GetFcmMarginCallDetailsBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - PAYMENT_METHOD_REQUEST_INVALID - coinbase.public_rest_api.GetEntityPaymentMethodsForbiddenErrorResponse: + - FCM_INVALID_ARGUMENT + coinbase.public_rest_api.GetFcmMarginCallDetailsForbiddenErrorResponse: type: object properties: code: @@ -18440,19 +21054,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmMarginCallDetailsForbiddenSubcode' trace_id: type: string - description: GetEntityPaymentMethodsForbiddenErrorResponse documents the HTTP + description: GetFcmMarginCallDetailsForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetEntityPaymentMethodsForbiddenSubcode: + coinbase.public_rest_api.GetFcmMarginCallDetailsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetEntityPaymentMethodsNotFoundErrorResponse: + coinbase.public_rest_api.GetFcmMarginCallDetailsNotFoundErrorResponse: type: object properties: code: @@ -18460,17 +21074,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityPaymentMethodsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmMarginCallDetailsNotFoundSubcode' trace_id: type: string - description: GetEntityPaymentMethodsNotFoundErrorResponse documents the HTTP + description: GetFcmMarginCallDetailsNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetEntityPaymentMethodsNotFoundSubcode: + coinbase.public_rest_api.GetFcmMarginCallDetailsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - PAYMENT_METHOD_NOT_FOUND - coinbase.public_rest_api.GetEntityRewardsRateBadRequestErrorResponse: + coinbase.public_rest_api.GetFcmRiskLimitsBadRequestErrorResponse: type: object properties: code: @@ -18478,19 +21091,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmRiskLimitsBadRequestSubcode' trace_id: type: string - description: GetEntityRewardsRateBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetEntityRewardsRateBadRequestSubcode: + description: GetFcmRiskLimitsBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetFcmRiskLimitsBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - REWARDS_REQUEST_INVALID - - REWARDS_ENTITY_NOT_ENROLLED - coinbase.public_rest_api.GetEntityRewardsRateForbiddenErrorResponse: + coinbase.public_rest_api.GetFcmRiskLimitsForbiddenErrorResponse: type: object properties: code: @@ -18498,20 +21108,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmRiskLimitsForbiddenSubcode' trace_id: type: string - description: GetEntityRewardsRateForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetEntityRewardsRateForbiddenSubcode: + description: GetFcmRiskLimitsForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetFcmRiskLimitsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - REWARDS_API_FEATURE_DISABLED - coinbase.public_rest_api.GetEntityRewardsRateNotFoundErrorResponse: + coinbase.public_rest_api.GetFcmRiskLimitsNotFoundErrorResponse: type: object properties: code: @@ -18519,16 +21128,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityRewardsRateNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmRiskLimitsNotFoundSubcode' trace_id: type: string - description: GetEntityRewardsRateNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetEntityRewardsRateNotFoundSubcode: + description: GetFcmRiskLimitsNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetFcmRiskLimitsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetEntityUsersBadRequestErrorResponse: + - FCM_RISK_LIMITS_NOT_FOUND + coinbase.public_rest_api.GetFcmSettingsBadRequestErrorResponse: type: object properties: code: @@ -18536,17 +21146,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityUsersBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmSettingsBadRequestSubcode' trace_id: type: string - description: GetEntityUsersBadRequestErrorResponse documents the HTTP 400 error + description: GetFcmSettingsBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetEntityUsersBadRequestSubcode: + coinbase.public_rest_api.GetFcmSettingsBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - coinbase.public_rest_api.GetEntityUsersForbiddenErrorResponse: + coinbase.public_rest_api.GetFcmSettingsForbiddenErrorResponse: type: object properties: code: @@ -18554,19 +21163,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityUsersForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmSettingsForbiddenSubcode' trace_id: type: string - description: GetEntityUsersForbiddenErrorResponse documents the HTTP 403 error + description: GetFcmSettingsForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetEntityUsersForbiddenSubcode: + coinbase.public_rest_api.GetFcmSettingsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetEntityUsersNotFoundErrorResponse: + coinbase.public_rest_api.GetFcmSettingsNotFoundErrorResponse: type: object properties: code: @@ -18574,16 +21183,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetEntityUsersNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmSettingsNotFoundSubcode' trace_id: type: string - description: GetEntityUsersNotFoundErrorResponse documents the HTTP 404 error + description: GetFcmSettingsNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetEntityUsersNotFoundSubcode: + coinbase.public_rest_api.GetFcmSettingsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetExistingLocatesBadRequestErrorResponse: + - FCM_ACCOUNT_NOT_FOUND + coinbase.public_rest_api.GetFuturesSweepsBadRequestErrorResponse: type: object properties: code: @@ -18591,21 +21201,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetExistingLocatesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFuturesSweepsBadRequestSubcode' trace_id: type: string - description: GetExistingLocatesBadRequestErrorResponse documents the HTTP 400 + description: GetFuturesSweepsBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetExistingLocatesBadRequestSubcode: + coinbase.public_rest_api.GetFuturesSweepsBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - LOCATE_DATE_INVALID - - LOCATE_REQUEST_INVALID - - LOCATE_IDS_INVALID - - LOCATE_FAILED_PRECONDITION - coinbase.public_rest_api.GetExistingLocatesForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - FCM_INVALID_ARGUMENT + coinbase.public_rest_api.GetFuturesSweepsForbiddenErrorResponse: type: object properties: code: @@ -18613,19 +21219,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetExistingLocatesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFuturesSweepsForbiddenSubcode' trace_id: type: string - description: GetExistingLocatesForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetExistingLocatesForbiddenSubcode: + description: GetFuturesSweepsForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetFuturesSweepsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetExistingLocatesNotFoundErrorResponse: + coinbase.public_rest_api.GetFuturesSweepsNotFoundErrorResponse: type: object properties: code: @@ -18633,16 +21239,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetExistingLocatesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetFuturesSweepsNotFoundSubcode' trace_id: type: string - description: GetExistingLocatesNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetExistingLocatesNotFoundSubcode: + description: GetFuturesSweepsNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetFuturesSweepsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetFcmBalanceBadRequestErrorResponse: + - FCM_SWEEP_NOT_FOUND + coinbase.public_rest_api.GetInterestAccrualsBadRequestErrorResponse: type: object properties: code: @@ -18650,17 +21257,25 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmBalanceBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetInterestAccrualsBadRequestSubcode' trace_id: type: string - description: GetFcmBalanceBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetFcmBalanceBadRequestSubcode: + description: GetInterestAccrualsBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetInterestAccrualsBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - FCM_INVALID_ARGUMENT - coinbase.public_rest_api.GetFcmBalanceForbiddenErrorResponse: + - ENTITY_ID_INVALID + - PORTFOLIO_ID_INVALID + - FINANCING_START_DATE_REQUIRED + - FINANCING_END_DATE_REQUIRED + - FINANCING_START_DATE_INVALID + - FINANCING_END_DATE_INVALID + - FINANCING_ACCRUALS_INVALID_ARGUMENT + - FINANCING_FAILED_PRECONDITION + - FINANCING_ACCRUALS_RANGE_EXCEEDED + coinbase.public_rest_api.GetInterestAccrualsForbiddenErrorResponse: type: object properties: code: @@ -18668,19 +21283,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmBalanceForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetInterestAccrualsForbiddenSubcode' trace_id: type: string - description: GetFcmBalanceForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetFcmBalanceForbiddenSubcode: + description: GetInterestAccrualsForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetInterestAccrualsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetFcmBalanceNotFoundErrorResponse: + coinbase.public_rest_api.GetInterestAccrualsNotFoundErrorResponse: type: object properties: code: @@ -18688,17 +21303,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmBalanceNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetInterestAccrualsNotFoundSubcode' trace_id: type: string - description: GetFcmBalanceNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetFcmBalanceNotFoundSubcode: + description: GetInterestAccrualsNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetInterestAccrualsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_BALANCE_NOT_FOUND - coinbase.public_rest_api.GetFcmEquityBadRequestErrorResponse: + coinbase.public_rest_api.GetInvoicesBadRequestErrorResponse: type: object properties: code: @@ -18706,16 +21320,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmEquityBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetInvoicesBadRequestSubcode' trace_id: type: string - description: GetFcmEquityBadRequestErrorResponse documents the HTTP 400 error + description: GetInvoicesBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetFcmEquityBadRequestSubcode: + coinbase.public_rest_api.GetInvoicesBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - coinbase.public_rest_api.GetFcmEquityForbiddenErrorResponse: + - ENTITY_ID_INVALID + coinbase.public_rest_api.GetInvoicesForbiddenErrorResponse: type: object properties: code: @@ -18723,19 +21338,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmEquityForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetInvoicesForbiddenSubcode' trace_id: type: string - description: GetFcmEquityForbiddenErrorResponse documents the HTTP 403 error + description: GetInvoicesForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetFcmEquityForbiddenSubcode: + coinbase.public_rest_api.GetInvoicesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetFcmEquityNotFoundErrorResponse: + coinbase.public_rest_api.GetInvoicesNotFoundErrorResponse: type: object properties: code: @@ -18743,17 +21358,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmEquityNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetInvoicesNotFoundSubcode' trace_id: type: string - description: GetFcmEquityNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetFcmEquityNotFoundSubcode: + description: GetInvoicesNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetInvoicesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_EQUITY_NOT_FOUND - coinbase.public_rest_api.GetFcmMarginCallDetailsBadRequestErrorResponse: + - ENTITY_NOT_FOUND + coinbase.public_rest_api.GetLocateAvailabilitiesBadRequestErrorResponse: type: object properties: code: @@ -18761,17 +21375,21 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmMarginCallDetailsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetLocateAvailabilitiesBadRequestSubcode' trace_id: type: string - description: GetFcmMarginCallDetailsBadRequestErrorResponse documents the HTTP + description: GetLocateAvailabilitiesBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetFcmMarginCallDetailsBadRequestSubcode: + coinbase.public_rest_api.GetLocateAvailabilitiesBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - FCM_INVALID_ARGUMENT - coinbase.public_rest_api.GetFcmMarginCallDetailsForbiddenErrorResponse: + - ENTITY_ID_INVALID + - LOCATE_DATE_INVALID + - LOCATE_REQUEST_INVALID + - LOCATE_FAILED_PRECONDITION + - LOCATE_DATE_REQUIRED + coinbase.public_rest_api.GetLocateAvailabilitiesForbiddenErrorResponse: type: object properties: code: @@ -18779,19 +21397,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmMarginCallDetailsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetLocateAvailabilitiesForbiddenSubcode' trace_id: type: string - description: GetFcmMarginCallDetailsForbiddenErrorResponse documents the HTTP + description: GetLocateAvailabilitiesForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetFcmMarginCallDetailsForbiddenSubcode: + coinbase.public_rest_api.GetLocateAvailabilitiesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetFcmMarginCallDetailsNotFoundErrorResponse: + coinbase.public_rest_api.GetLocateAvailabilitiesNotFoundErrorResponse: type: object properties: code: @@ -18799,16 +21417,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmMarginCallDetailsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetLocateAvailabilitiesNotFoundSubcode' trace_id: type: string - description: GetFcmMarginCallDetailsNotFoundErrorResponse documents the HTTP + description: GetLocateAvailabilitiesNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetFcmMarginCallDetailsNotFoundSubcode: + coinbase.public_rest_api.GetLocateAvailabilitiesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetFcmRiskLimitsBadRequestErrorResponse: + - LOCATE_AVAILABILITY_NOT_FOUND + coinbase.public_rest_api.GetMarginConversionsBadRequestErrorResponse: type: object properties: code: @@ -18816,16 +21435,23 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmRiskLimitsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginConversionsBadRequestSubcode' trace_id: type: string - description: GetFcmRiskLimitsBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetFcmRiskLimitsBadRequestSubcode: + description: GetMarginConversionsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetMarginConversionsBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - coinbase.public_rest_api.GetFcmRiskLimitsForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - FINANCING_START_DATE_REQUIRED + - FINANCING_END_DATE_REQUIRED + - FINANCING_START_DATE_INVALID + - FINANCING_END_DATE_INVALID + - MARGIN_CONVERSION_REQUEST_INVALID + - MARGIN_CONVERSION_FAILED_PRECONDITION + coinbase.public_rest_api.GetMarginConversionsForbiddenErrorResponse: type: object properties: code: @@ -18833,19 +21459,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmRiskLimitsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginConversionsForbiddenSubcode' trace_id: type: string - description: GetFcmRiskLimitsForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetFcmRiskLimitsForbiddenSubcode: + description: GetMarginConversionsForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetMarginConversionsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetFcmRiskLimitsNotFoundErrorResponse: + coinbase.public_rest_api.GetMarginConversionsNotFoundErrorResponse: type: object properties: code: @@ -18853,17 +21479,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmRiskLimitsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginConversionsNotFoundSubcode' trace_id: type: string - description: GetFcmRiskLimitsNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetFcmRiskLimitsNotFoundSubcode: + description: GetMarginConversionsNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetMarginConversionsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_RISK_LIMITS_NOT_FOUND - coinbase.public_rest_api.GetFcmSettingsBadRequestErrorResponse: + coinbase.public_rest_api.GetMarginInformationBadRequestErrorResponse: type: object properties: code: @@ -18871,16 +21496,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmSettingsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginInformationBadRequestSubcode' trace_id: type: string - description: GetFcmSettingsBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetFcmSettingsBadRequestSubcode: + description: GetMarginInformationBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetMarginInformationBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - coinbase.public_rest_api.GetFcmSettingsForbiddenErrorResponse: + - ENTITY_ID_INVALID + - MARGIN_INFORMATION_REQUEST_INVALID + coinbase.public_rest_api.GetMarginInformationForbiddenErrorResponse: type: object properties: code: @@ -18888,19 +21515,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmSettingsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginInformationForbiddenSubcode' trace_id: type: string - description: GetFcmSettingsForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetFcmSettingsForbiddenSubcode: + description: GetMarginInformationForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetMarginInformationForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetFcmSettingsNotFoundErrorResponse: + coinbase.public_rest_api.GetMarginInformationNotFoundErrorResponse: type: object properties: code: @@ -18908,17 +21535,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFcmSettingsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginInformationNotFoundSubcode' trace_id: type: string - description: GetFcmSettingsNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetFcmSettingsNotFoundSubcode: + description: GetMarginInformationNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetMarginInformationNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_ACCOUNT_NOT_FOUND - coinbase.public_rest_api.GetFuturesSweepsBadRequestErrorResponse: + coinbase.public_rest_api.GetMarginSummariesBadRequestErrorResponse: type: object properties: code: @@ -18926,17 +21552,21 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFuturesSweepsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginSummariesBadRequestSubcode' trace_id: type: string - description: GetFuturesSweepsBadRequestErrorResponse documents the HTTP 400 + description: GetMarginSummariesBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetFuturesSweepsBadRequestSubcode: + coinbase.public_rest_api.GetMarginSummariesBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - - FCM_INVALID_ARGUMENT - coinbase.public_rest_api.GetFuturesSweepsForbiddenErrorResponse: + - ENTITY_ID_INVALID + - FINANCING_START_DATE_INVALID + - FINANCING_END_DATE_INVALID + - MARGIN_SUMMARY_RANGE_INVALID + - MARGIN_SUMMARY_FAILED_PRECONDITION + coinbase.public_rest_api.GetMarginSummariesForbiddenErrorResponse: type: object properties: code: @@ -18944,19 +21574,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFuturesSweepsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginSummariesForbiddenSubcode' trace_id: type: string - description: GetFuturesSweepsForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetFuturesSweepsForbiddenSubcode: + description: GetMarginSummariesForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetMarginSummariesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetFuturesSweepsNotFoundErrorResponse: + coinbase.public_rest_api.GetMarginSummariesNotFoundErrorResponse: type: object properties: code: @@ -18964,17 +21594,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetFuturesSweepsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginSummariesNotFoundSubcode' trace_id: type: string - description: GetFuturesSweepsNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetFuturesSweepsNotFoundSubcode: + description: GetMarginSummariesNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetMarginSummariesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - FCM_SWEEP_NOT_FOUND - coinbase.public_rest_api.GetInterestAccrualsBadRequestErrorResponse: + coinbase.public_rest_api.GetMarketDataBadRequestErrorResponse: type: object properties: code: @@ -18982,25 +21611,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetInterestAccrualsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarketDataBadRequestSubcode' trace_id: type: string - description: GetInterestAccrualsBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetInterestAccrualsBadRequestSubcode: + description: GetMarketDataBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetMarketDataBadRequestSubcode: type: string enum: - ENTITY_ID_REQUIRED - ENTITY_ID_INVALID - - PORTFOLIO_ID_INVALID - - FINANCING_START_DATE_REQUIRED - - FINANCING_END_DATE_REQUIRED - - FINANCING_START_DATE_INVALID - - FINANCING_END_DATE_INVALID - - FINANCING_ACCRUALS_INVALID_ARGUMENT - - FINANCING_FAILED_PRECONDITION - - FINANCING_ACCRUALS_RANGE_EXCEEDED - coinbase.public_rest_api.GetInterestAccrualsForbiddenErrorResponse: + - MARKET_DATA_INVALID_ARGUMENT + coinbase.public_rest_api.GetMarketDataForbiddenErrorResponse: type: object properties: code: @@ -19008,19 +21630,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetInterestAccrualsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarketDataForbiddenSubcode' trace_id: type: string - description: GetInterestAccrualsForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetInterestAccrualsForbiddenSubcode: + description: GetMarketDataForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetMarketDataForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetInterestAccrualsNotFoundErrorResponse: + coinbase.public_rest_api.GetMarketDataNotFoundErrorResponse: type: object properties: code: @@ -19028,16 +21650,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetInterestAccrualsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetMarketDataNotFoundSubcode' trace_id: type: string - description: GetInterestAccrualsNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetInterestAccrualsNotFoundSubcode: + description: GetMarketDataNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetMarketDataNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetInvoicesBadRequestErrorResponse: + - MARKET_DATA_NOT_FOUND + coinbase.public_rest_api.GetOpenOrdersBadRequestErrorResponse: type: object properties: code: @@ -19045,17 +21668,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetInvoicesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOpenOrdersBadRequestSubcode' trace_id: type: string - description: GetInvoicesBadRequestErrorResponse documents the HTTP 400 error + description: GetOpenOrdersBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetInvoicesBadRequestSubcode: + coinbase.public_rest_api.GetOpenOrdersBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - coinbase.public_rest_api.GetInvoicesForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ORDER_LIMIT_EXCEEDED + coinbase.public_rest_api.GetOpenOrdersForbiddenErrorResponse: type: object properties: code: @@ -19063,19 +21687,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetInvoicesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOpenOrdersForbiddenSubcode' trace_id: type: string - description: GetInvoicesForbiddenErrorResponse documents the HTTP 403 error + description: GetOpenOrdersForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetInvoicesForbiddenSubcode: + coinbase.public_rest_api.GetOpenOrdersForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetInvoicesNotFoundErrorResponse: + coinbase.public_rest_api.GetOpenOrdersNotFoundErrorResponse: type: object properties: code: @@ -19083,16 +21707,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetInvoicesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOpenOrdersNotFoundSubcode' trace_id: type: string - description: GetInvoicesNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetInvoicesNotFoundSubcode: + description: GetOpenOrdersNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetOpenOrdersNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - coinbase.public_rest_api.GetLocateAvailabilitiesBadRequestErrorResponse: + coinbase.public_rest_api.GetOrderBadRequestErrorResponse: type: object properties: code: @@ -19100,21 +21724,40 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetLocateAvailabilitiesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderBadRequestSubcode' trace_id: type: string - description: GetLocateAvailabilitiesBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetLocateAvailabilitiesBadRequestSubcode: + description: GetOrderBadRequestErrorResponse documents the HTTP 400 error body. + coinbase.public_rest_api.GetOrderBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ORDER_ID_REQUIRED + - ORDER_ID_INVALID + - ORDER_RESOURCE_NOT_FOUND + coinbase.public_rest_api.GetOrderEditHistoryBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderEditHistoryBadRequestSubcode' + trace_id: + type: string + description: GetOrderEditHistoryBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetOrderEditHistoryBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - LOCATE_DATE_INVALID - - LOCATE_REQUEST_INVALID - - LOCATE_FAILED_PRECONDITION - - LOCATE_DATE_REQUIRED - coinbase.public_rest_api.GetLocateAvailabilitiesForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ORDER_ID_REQUIRED + - ORDER_ID_INVALID + - ORDER_RESOURCE_NOT_FOUND + coinbase.public_rest_api.GetOrderEditHistoryForbiddenErrorResponse: type: object properties: code: @@ -19122,19 +21765,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetLocateAvailabilitiesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderEditHistoryForbiddenSubcode' trace_id: type: string - description: GetLocateAvailabilitiesForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetLocateAvailabilitiesForbiddenSubcode: + description: GetOrderEditHistoryForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetOrderEditHistoryForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetLocateAvailabilitiesNotFoundErrorResponse: + coinbase.public_rest_api.GetOrderEditHistoryNotFoundErrorResponse: type: object properties: code: @@ -19142,17 +21785,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetLocateAvailabilitiesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderEditHistoryNotFoundSubcode' trace_id: type: string - description: GetLocateAvailabilitiesNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetLocateAvailabilitiesNotFoundSubcode: + description: GetOrderEditHistoryNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetOrderEditHistoryNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - LOCATE_AVAILABILITY_NOT_FOUND - coinbase.public_rest_api.GetMarginConversionsBadRequestErrorResponse: + coinbase.public_rest_api.GetOrderFillsBadRequestErrorResponse: type: object properties: code: @@ -19160,23 +21802,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginConversionsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderFillsBadRequestSubcode' trace_id: type: string - description: GetMarginConversionsBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetMarginConversionsBadRequestSubcode: + description: GetOrderFillsBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetOrderFillsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - FINANCING_START_DATE_REQUIRED - - FINANCING_END_DATE_REQUIRED - - FINANCING_START_DATE_INVALID - - FINANCING_END_DATE_INVALID - - MARGIN_CONVERSION_REQUEST_INVALID - - MARGIN_CONVERSION_FAILED_PRECONDITION - coinbase.public_rest_api.GetMarginConversionsForbiddenErrorResponse: + - ORDER_REQUEST_INVALID + - ORDER_LIMIT_EXCEEDED + - ORDER_FILLS_LIMIT_INVALID + coinbase.public_rest_api.GetOrderFillsForbiddenErrorResponse: type: object properties: code: @@ -19184,19 +21823,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginConversionsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderFillsForbiddenSubcode' trace_id: type: string - description: GetMarginConversionsForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetMarginConversionsForbiddenSubcode: + description: GetOrderFillsForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetOrderFillsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetMarginConversionsNotFoundErrorResponse: + coinbase.public_rest_api.GetOrderFillsNotFoundErrorResponse: type: object properties: code: @@ -19204,35 +21843,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginConversionsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderFillsNotFoundSubcode' trace_id: type: string - description: GetMarginConversionsNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetMarginConversionsNotFoundSubcode: + description: GetOrderFillsNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetOrderFillsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetMarginInformationBadRequestErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginInformationBadRequestSubcode' - trace_id: - type: string - description: GetMarginInformationBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetMarginInformationBadRequestSubcode: - type: string - enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - MARGIN_INFORMATION_REQUEST_INVALID - coinbase.public_rest_api.GetMarginInformationForbiddenErrorResponse: + coinbase.public_rest_api.GetOrderForbiddenErrorResponse: type: object properties: code: @@ -19240,19 +21860,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginInformationForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderForbiddenSubcode' trace_id: type: string - description: GetMarginInformationForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetMarginInformationForbiddenSubcode: + description: GetOrderForbiddenErrorResponse documents the HTTP 403 error body. + coinbase.public_rest_api.GetOrderForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetMarginInformationNotFoundErrorResponse: + coinbase.public_rest_api.GetOrderNotFoundErrorResponse: type: object properties: code: @@ -19260,16 +21879,15 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginInformationNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderNotFoundSubcode' trace_id: type: string - description: GetMarginInformationNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetMarginInformationNotFoundSubcode: + description: GetOrderNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetOrderNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetMarginSummariesBadRequestErrorResponse: + coinbase.public_rest_api.GetOrdersBadRequestErrorResponse: type: object properties: code: @@ -19277,21 +21895,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginSummariesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrdersBadRequestSubcode' trace_id: type: string - description: GetMarginSummariesBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetMarginSummariesBadRequestSubcode: + description: GetOrdersBadRequestErrorResponse documents the HTTP 400 error body. + coinbase.public_rest_api.GetOrdersBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - FINANCING_START_DATE_INVALID - - FINANCING_END_DATE_INVALID - - MARGIN_SUMMARY_RANGE_INVALID - - MARGIN_SUMMARY_FAILED_PRECONDITION - coinbase.public_rest_api.GetMarginSummariesForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ORDER_STATUS_INVALID + coinbase.public_rest_api.GetOrdersForbiddenErrorResponse: type: object properties: code: @@ -19299,19 +21913,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginSummariesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrdersForbiddenSubcode' trace_id: type: string - description: GetMarginSummariesForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetMarginSummariesForbiddenSubcode: + description: GetOrdersForbiddenErrorResponse documents the HTTP 403 error body. + coinbase.public_rest_api.GetOrdersForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetMarginSummariesNotFoundErrorResponse: + coinbase.public_rest_api.GetOrdersNotFoundErrorResponse: type: object properties: code: @@ -19319,16 +21932,15 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarginSummariesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetOrdersNotFoundSubcode' trace_id: type: string - description: GetMarginSummariesNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetMarginSummariesNotFoundSubcode: + description: GetOrdersNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetOrdersNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetMarketDataBadRequestErrorResponse: + coinbase.public_rest_api.GetPortfolioActivitiesBadRequestErrorResponse: type: object properties: code: @@ -19336,18 +21948,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarketDataBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivitiesBadRequestSubcode' trace_id: type: string - description: GetMarketDataBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetMarketDataBadRequestSubcode: + description: GetPortfolioActivitiesBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetPortfolioActivitiesBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - MARKET_DATA_INVALID_ARGUMENT - coinbase.public_rest_api.GetMarketDataForbiddenErrorResponse: + - PORTFOLIO_ID_INVALID + - ACTIVITY_REQUEST_INVALID + - ACTIVITY_CATEGORY_INVALID + - ACTIVITY_TIME_RANGE_INVALID + - ACTIVITY_STATUS_INVALID + coinbase.public_rest_api.GetPortfolioActivitiesForbiddenErrorResponse: type: object properties: code: @@ -19355,19 +21969,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarketDataForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivitiesForbiddenSubcode' trace_id: type: string - description: GetMarketDataForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetMarketDataForbiddenSubcode: + description: GetPortfolioActivitiesForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetPortfolioActivitiesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetMarketDataNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioActivitiesNotFoundErrorResponse: type: object properties: code: @@ -19375,17 +21989,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetMarketDataNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivitiesNotFoundSubcode' trace_id: type: string - description: GetMarketDataNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetMarketDataNotFoundSubcode: + description: GetPortfolioActivitiesNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetPortfolioActivitiesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - MARKET_DATA_NOT_FOUND - coinbase.public_rest_api.GetOpenOrdersBadRequestErrorResponse: + coinbase.public_rest_api.GetPortfolioActivityBadRequestErrorResponse: type: object properties: code: @@ -19393,18 +22006,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOpenOrdersBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivityBadRequestSubcode' trace_id: type: string - description: GetOpenOrdersBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetOpenOrdersBadRequestSubcode: + description: GetPortfolioActivityBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetPortfolioActivityBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ORDER_LIMIT_EXCEEDED - coinbase.public_rest_api.GetOpenOrdersForbiddenErrorResponse: + - ACTIVITY_PORTFOLIO_ID_MISMATCH + coinbase.public_rest_api.GetPortfolioActivityForbiddenErrorResponse: type: object properties: code: @@ -19412,19 +22024,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOpenOrdersForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivityForbiddenSubcode' trace_id: type: string - description: GetOpenOrdersForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetOpenOrdersForbiddenSubcode: + description: GetPortfolioActivityForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetPortfolioActivityForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetOpenOrdersNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioActivityNotFoundErrorResponse: type: object properties: code: @@ -19432,36 +22044,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOpenOrdersNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivityNotFoundSubcode' trace_id: type: string - description: GetOpenOrdersNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetOpenOrdersNotFoundSubcode: + description: GetPortfolioActivityNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetPortfolioActivityNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetOrderBadRequestErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderBadRequestSubcode' - trace_id: - type: string - description: GetOrderBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetOrderBadRequestSubcode: - type: string - enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - ORDER_ID_REQUIRED - - ORDER_ID_INVALID - - ORDER_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetOrderEditHistoryBadRequestErrorResponse: + - ACTIVITY_NOT_FOUND + coinbase.public_rest_api.GetPortfolioAddressBookBadRequestErrorResponse: type: object properties: code: @@ -19469,20 +22062,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderEditHistoryBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookBadRequestSubcode' trace_id: type: string - description: GetOrderEditHistoryBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetOrderEditHistoryBadRequestSubcode: + description: GetPortfolioAddressBookBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetPortfolioAddressBookBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ORDER_ID_REQUIRED - - ORDER_ID_INVALID - - ORDER_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetOrderEditHistoryForbiddenErrorResponse: + - ADDRESS_BOOK_INVALID_ARGUMENT + - ADDRESS_BOOK_FAILED_PRECONDITION + coinbase.public_rest_api.GetPortfolioAddressBookForbiddenErrorResponse: type: object properties: code: @@ -19490,19 +22082,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderEditHistoryForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookForbiddenSubcode' trace_id: type: string - description: GetOrderEditHistoryForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetOrderEditHistoryForbiddenSubcode: + description: GetPortfolioAddressBookForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetPortfolioAddressBookForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetOrderEditHistoryNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioAddressBookNotFoundErrorResponse: type: object properties: code: @@ -19510,16 +22102,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderEditHistoryNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookNotFoundSubcode' trace_id: type: string - description: GetOrderEditHistoryNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetOrderEditHistoryNotFoundSubcode: + description: GetPortfolioAddressBookNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetPortfolioAddressBookNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetOrderFillsBadRequestErrorResponse: + - ADDRESS_BOOK_NOT_FOUND + coinbase.public_rest_api.GetPortfolioAllocationsBadRequestErrorResponse: type: object properties: code: @@ -19527,20 +22120,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderFillsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAllocationsBadRequestSubcode' trace_id: type: string - description: GetOrderFillsBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetOrderFillsBadRequestSubcode: + description: GetPortfolioAllocationsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetPortfolioAllocationsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - ORDER_REQUEST_INVALID - - ORDER_LIMIT_EXCEEDED - - ORDER_FILLS_LIMIT_INVALID - coinbase.public_rest_api.GetOrderFillsForbiddenErrorResponse: + - ALLOCATION_REQUEST_INVALID + - ALLOCATION_START_DATE_REQUIRED + - ALLOCATION_LIMIT_EXCEEDED + coinbase.public_rest_api.GetPortfolioAllocationsForbiddenErrorResponse: type: object properties: code: @@ -19548,19 +22140,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderFillsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAllocationsForbiddenSubcode' trace_id: type: string - description: GetOrderFillsForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetOrderFillsForbiddenSubcode: + description: GetPortfolioAllocationsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetPortfolioAllocationsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetOrderFillsNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioAllocationsNotFoundErrorResponse: type: object properties: code: @@ -19568,51 +22160,35 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderFillsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAllocationsNotFoundSubcode' trace_id: type: string - description: GetOrderFillsNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetOrderFillsNotFoundSubcode: + description: GetPortfolioAllocationsNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetPortfolioAllocationsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetOrderForbiddenErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderForbiddenSubcode' - trace_id: - type: string - description: GetOrderForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetOrderForbiddenSubcode: - type: string - enum: - - AUTH_RESOURCE_ACCESS_DENIED - - MTLS_CERTIFICATE_REQUIRED - - MTLS_CERTIFICATE_REVOKED - - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetOrderNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioBadRequestErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrderNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBadRequestSubcode' trace_id: type: string - description: GetOrderNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetOrderNotFoundSubcode: + description: GetPortfolioBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetPortfolioBadRequestSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetOrdersBadRequestErrorResponse: + - ENTITY_ID_INVALID + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + coinbase.public_rest_api.GetPortfolioBalancesBadRequestErrorResponse: type: object properties: code: @@ -19620,17 +22196,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrdersBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBalancesBadRequestSubcode' trace_id: type: string - description: GetOrdersBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetOrdersBadRequestSubcode: + description: GetPortfolioBalancesBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetPortfolioBalancesBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ORDER_STATUS_INVALID - coinbase.public_rest_api.GetOrdersForbiddenErrorResponse: + - PORTFOLIO_BALANCES_INVALID_ARGUMENT + - ASSET_REQUEST_INVALID + coinbase.public_rest_api.GetPortfolioBalancesForbiddenErrorResponse: type: object properties: code: @@ -19638,18 +22216,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrdersForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBalancesForbiddenSubcode' trace_id: type: string - description: GetOrdersForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetOrdersForbiddenSubcode: + description: GetPortfolioBalancesForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetPortfolioBalancesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetOrdersNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioBalancesNotFoundErrorResponse: type: object properties: code: @@ -19657,15 +22236,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetOrdersNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBalancesNotFoundSubcode' trace_id: type: string - description: GetOrdersNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetOrdersNotFoundSubcode: + description: GetPortfolioBalancesNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetPortfolioBalancesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetPortfolioActivitiesBadRequestErrorResponse: + - PORTFOLIO_BALANCES_NOT_FOUND + - ASSET_NOT_FOUND + coinbase.public_rest_api.GetPortfolioCommissionBadRequestErrorResponse: type: object properties: code: @@ -19673,20 +22255,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivitiesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCommissionBadRequestSubcode' trace_id: type: string - description: GetPortfolioActivitiesBadRequestErrorResponse documents the HTTP + description: GetPortfolioCommissionBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetPortfolioActivitiesBadRequestSubcode: + coinbase.public_rest_api.GetPortfolioCommissionBadRequestSubcode: type: string enum: + - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ACTIVITY_REQUEST_INVALID - - ACTIVITY_CATEGORY_INVALID - - ACTIVITY_TIME_RANGE_INVALID - - ACTIVITY_STATUS_INVALID - coinbase.public_rest_api.GetPortfolioActivitiesForbiddenErrorResponse: + - COMMISSION_PRODUCT_ID_INVALID + - COMMISSION_TRADING_NOT_ENABLED + coinbase.public_rest_api.GetPortfolioCommissionForbiddenErrorResponse: type: object properties: code: @@ -19694,19 +22275,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivitiesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCommissionForbiddenSubcode' trace_id: type: string - description: GetPortfolioActivitiesForbiddenErrorResponse documents the HTTP + description: GetPortfolioCommissionForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetPortfolioActivitiesForbiddenSubcode: + coinbase.public_rest_api.GetPortfolioCommissionForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioActivitiesNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioCommissionNotFoundErrorResponse: type: object properties: code: @@ -19714,16 +22295,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivitiesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCommissionNotFoundSubcode' trace_id: type: string - description: GetPortfolioActivitiesNotFoundErrorResponse documents the HTTP + description: GetPortfolioCommissionNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioActivitiesNotFoundSubcode: + coinbase.public_rest_api.GetPortfolioCommissionNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetPortfolioActivityBadRequestErrorResponse: + coinbase.public_rest_api.GetPortfolioCounterpartyIDBadRequestErrorResponse: type: object properties: code: @@ -19731,17 +22312,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivityBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCounterpartyIDBadRequestSubcode' trace_id: type: string - description: GetPortfolioActivityBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetPortfolioActivityBadRequestSubcode: + description: GetPortfolioCounterpartyIDBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetPortfolioCounterpartyIDBadRequestSubcode: type: string enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_TYPE_UNSUPPORTED - PORTFOLIO_ID_INVALID - - ACTIVITY_PORTFOLIO_ID_MISMATCH - coinbase.public_rest_api.GetPortfolioActivityForbiddenErrorResponse: + coinbase.public_rest_api.GetPortfolioCounterpartyIDForbiddenErrorResponse: type: object properties: code: @@ -19749,19 +22331,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivityForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCounterpartyIDForbiddenSubcode' trace_id: type: string - description: GetPortfolioActivityForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetPortfolioActivityForbiddenSubcode: + description: GetPortfolioCounterpartyIDForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetPortfolioCounterpartyIDForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioActivityNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioCounterpartyIDNotFoundErrorResponse: type: object properties: code: @@ -19769,17 +22351,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioActivityNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCounterpartyIDNotFoundSubcode' trace_id: type: string - description: GetPortfolioActivityNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetPortfolioActivityNotFoundSubcode: + description: GetPortfolioCounterpartyIDNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetPortfolioCounterpartyIDNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ACTIVITY_NOT_FOUND - coinbase.public_rest_api.GetPortfolioAddressBookBadRequestErrorResponse: + - PORTFOLIO_NOT_FOUND + coinbase.public_rest_api.GetPortfolioFillsBadRequestErrorResponse: type: object properties: code: @@ -19787,19 +22369,23 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioFillsBadRequestSubcode' trace_id: type: string - description: GetPortfolioAddressBookBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetPortfolioAddressBookBadRequestSubcode: + description: GetPortfolioFillsBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetPortfolioFillsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ADDRESS_BOOK_INVALID_ARGUMENT - - ADDRESS_BOOK_FAILED_PRECONDITION - coinbase.public_rest_api.GetPortfolioAddressBookForbiddenErrorResponse: + - ORDER_REQUEST_INVALID + - ORDER_LIMIT_EXCEEDED + - ORDER_FILLS_LIMIT_INVALID + - ORDER_FILLS_START_DATE_REQUIRED + - ORDER_FILLS_START_DATE_INVALID + - ORDER_FILLS_END_DATE_INVALID + coinbase.public_rest_api.GetPortfolioFillsForbiddenErrorResponse: type: object properties: code: @@ -19807,19 +22393,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioFillsForbiddenSubcode' trace_id: type: string - description: GetPortfolioAddressBookForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetPortfolioAddressBookForbiddenSubcode: + description: GetPortfolioFillsForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetPortfolioFillsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioAddressBookNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioFillsNotFoundErrorResponse: type: object properties: code: @@ -19827,37 +22413,60 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAddressBookNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioFillsNotFoundSubcode' trace_id: type: string - description: GetPortfolioAddressBookNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetPortfolioAddressBookNotFoundSubcode: + description: GetPortfolioFillsNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetPortfolioFillsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ADDRESS_BOOK_NOT_FOUND - coinbase.public_rest_api.GetPortfolioAllocationsBadRequestErrorResponse: + coinbase.public_rest_api.GetPortfolioForbiddenErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAllocationsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioForbiddenSubcode' trace_id: type: string - description: GetPortfolioAllocationsBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetPortfolioAllocationsBadRequestSubcode: + description: GetPortfolioForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetPortfolioForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.GetPortfolioInterestAccrualsBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioInterestAccrualsBadRequestSubcode' + trace_id: + type: string + description: GetPortfolioInterestAccrualsBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetPortfolioInterestAccrualsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - - ALLOCATION_REQUEST_INVALID - - ALLOCATION_START_DATE_REQUIRED - - ALLOCATION_LIMIT_EXCEEDED - coinbase.public_rest_api.GetPortfolioAllocationsForbiddenErrorResponse: + - PORTFOLIO_ID_INVALID + - FINANCING_START_DATE_REQUIRED + - FINANCING_END_DATE_REQUIRED + - FINANCING_START_DATE_INVALID + - FINANCING_END_DATE_INVALID + - FINANCING_ACCRUALS_INVALID_ARGUMENT + - FINANCING_ACCRUALS_DATE_INVALID + coinbase.public_rest_api.GetPortfolioInterestAccrualsForbiddenErrorResponse: type: object properties: code: @@ -19865,19 +22474,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAllocationsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioInterestAccrualsForbiddenSubcode' trace_id: type: string - description: GetPortfolioAllocationsForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetPortfolioAllocationsForbiddenSubcode: + description: GetPortfolioInterestAccrualsForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetPortfolioInterestAccrualsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioAllocationsNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioInterestAccrualsNotFoundErrorResponse: type: object properties: code: @@ -19885,35 +22494,36 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioAllocationsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioInterestAccrualsNotFoundSubcode' trace_id: type: string - description: GetPortfolioAllocationsNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetPortfolioAllocationsNotFoundSubcode: + description: GetPortfolioInterestAccrualsNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetPortfolioInterestAccrualsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetPortfolioBadRequestErrorResponse: + - PORTFOLIO_NOT_FOUND + coinbase.public_rest_api.GetPortfolioNotFoundErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioNotFoundSubcode' trace_id: type: string - description: GetPortfolioBadRequestErrorResponse documents the HTTP 400 error + description: GetPortfolioNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioBadRequestSubcode: + coinbase.public_rest_api.GetPortfolioNotFoundSubcode: type: string enum: - - ENTITY_ID_INVALID - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - coinbase.public_rest_api.GetPortfolioBalancesBadRequestErrorResponse: + - AUTH_RESOURCE_NOT_FOUND + - ENTITY_NOT_FOUND + - PORTFOLIO_NOT_FOUND + coinbase.public_rest_api.GetPortfolioProductsBadRequestErrorResponse: type: object properties: code: @@ -19921,19 +22531,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBalancesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioProductsBadRequestSubcode' trace_id: type: string - description: GetPortfolioBalancesBadRequestErrorResponse documents the HTTP + description: GetPortfolioProductsBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetPortfolioBalancesBadRequestSubcode: + coinbase.public_rest_api.GetPortfolioProductsBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED + - ENTITY_ID_INVALID - PORTFOLIO_ID_INVALID - - PORTFOLIO_BALANCES_INVALID_ARGUMENT - - ASSET_REQUEST_INVALID - coinbase.public_rest_api.GetPortfolioBalancesForbiddenErrorResponse: + - PRODUCT_FUTURES_NOT_ENABLED + - PRODUCT_LIMIT_INVALID + - PRODUCT_OPTIONS_NOT_ENABLED + coinbase.public_rest_api.GetPortfolioProductsForbiddenErrorResponse: type: object properties: code: @@ -19941,19 +22552,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBalancesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioProductsForbiddenSubcode' trace_id: type: string - description: GetPortfolioBalancesForbiddenErrorResponse documents the HTTP 403 + description: GetPortfolioProductsForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetPortfolioBalancesForbiddenSubcode: + coinbase.public_rest_api.GetPortfolioProductsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioBalancesNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioProductsNotFoundErrorResponse: type: object properties: code: @@ -19961,18 +22572,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioBalancesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioProductsNotFoundSubcode' trace_id: type: string - description: GetPortfolioBalancesNotFoundErrorResponse documents the HTTP 404 + description: GetPortfolioProductsNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioBalancesNotFoundSubcode: + coinbase.public_rest_api.GetPortfolioProductsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - PORTFOLIO_BALANCES_NOT_FOUND - - ASSET_NOT_FOUND - coinbase.public_rest_api.GetPortfolioCommissionBadRequestErrorResponse: + - ENTITY_NOT_FOUND + - PORTFOLIO_NOT_FOUND + - PRODUCT_NOT_FOUND + coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestErrorResponse: type: object properties: code: @@ -19980,19 +22592,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCommissionBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestSubcode' trace_id: type: string - description: GetPortfolioCommissionBadRequestErrorResponse documents the HTTP + description: GetPortfolioRewardsRateBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetPortfolioCommissionBadRequestSubcode: + coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - COMMISSION_PRODUCT_ID_INVALID - - COMMISSION_TRADING_NOT_ENABLED - coinbase.public_rest_api.GetPortfolioCommissionForbiddenErrorResponse: + - REWARDS_REQUEST_INVALID + - REWARDS_ENTITY_NOT_ENROLLED + coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenErrorResponse: type: object properties: code: @@ -20000,19 +22612,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCommissionForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenSubcode' trace_id: type: string - description: GetPortfolioCommissionForbiddenErrorResponse documents the HTTP + description: GetPortfolioRewardsRateForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetPortfolioCommissionForbiddenSubcode: + coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioCommissionNotFoundErrorResponse: + - REWARDS_API_FEATURE_DISABLED + coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundErrorResponse: type: object properties: code: @@ -20020,16 +22633,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCommissionNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundSubcode' trace_id: type: string - description: GetPortfolioCommissionNotFoundErrorResponse documents the HTTP + description: GetPortfolioRewardsRateNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioCommissionNotFoundSubcode: + coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetPortfolioCounterpartyIDBadRequestErrorResponse: + coinbase.public_rest_api.GetPortfolioTransactionsBadRequestErrorResponse: type: object properties: code: @@ -20037,18 +22650,22 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCounterpartyIDBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioTransactionsBadRequestSubcode' trace_id: type: string - description: GetPortfolioCounterpartyIDBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.GetPortfolioCounterpartyIDBadRequestSubcode: + description: GetPortfolioTransactionsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetPortfolioTransactionsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_TYPE_UNSUPPORTED - PORTFOLIO_ID_INVALID - coinbase.public_rest_api.GetPortfolioCounterpartyIDForbiddenErrorResponse: + - TRANSACTION_LIMIT_EXCEEDED + - TRANSACTION_CURSOR_INVALID + - TRANSACTION_TRAVEL_RULE_STATUS_INVALID + - TRANSACTION_FILTER_INVALID + - TRANSACTION_PARAMS_INVALID + coinbase.public_rest_api.GetPortfolioTransactionsForbiddenErrorResponse: type: object properties: code: @@ -20056,19 +22673,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCounterpartyIDForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioTransactionsForbiddenSubcode' trace_id: type: string - description: GetPortfolioCounterpartyIDForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetPortfolioCounterpartyIDForbiddenSubcode: + description: GetPortfolioTransactionsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetPortfolioTransactionsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioCounterpartyIDNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioTransactionsNotFoundErrorResponse: type: object properties: code: @@ -20076,17 +22693,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioCounterpartyIDNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioTransactionsNotFoundSubcode' trace_id: type: string - description: GetPortfolioCounterpartyIDNotFoundErrorResponse documents the HTTP + description: GetPortfolioTransactionsNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioCounterpartyIDNotFoundSubcode: + coinbase.public_rest_api.GetPortfolioTransactionsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - PORTFOLIO_NOT_FOUND - coinbase.public_rest_api.GetPortfolioFillsBadRequestErrorResponse: + - ASSET_NOT_FOUND + coinbase.public_rest_api.GetPortfolioUsersBadRequestErrorResponse: type: object properties: code: @@ -20094,23 +22711,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioFillsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioUsersBadRequestSubcode' trace_id: type: string - description: GetPortfolioFillsBadRequestErrorResponse documents the HTTP 400 + description: GetPortfolioUsersBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetPortfolioFillsBadRequestSubcode: + coinbase.public_rest_api.GetPortfolioUsersBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ORDER_REQUEST_INVALID - - ORDER_LIMIT_EXCEEDED - - ORDER_FILLS_LIMIT_INVALID - - ORDER_FILLS_START_DATE_REQUIRED - - ORDER_FILLS_START_DATE_INVALID - - ORDER_FILLS_END_DATE_INVALID - coinbase.public_rest_api.GetPortfolioFillsForbiddenErrorResponse: + - PORTFOLIO_USERS_CURSOR_INVALID + - PORTFOLIO_USERS_LIMIT_INVALID + coinbase.public_rest_api.GetPortfolioUsersForbiddenErrorResponse: type: object properties: code: @@ -20118,19 +22731,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioFillsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioUsersForbiddenSubcode' trace_id: type: string - description: GetPortfolioFillsForbiddenErrorResponse documents the HTTP 403 + description: GetPortfolioUsersForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetPortfolioFillsForbiddenSubcode: + coinbase.public_rest_api.GetPortfolioUsersForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioFillsNotFoundErrorResponse: + coinbase.public_rest_api.GetPortfolioUsersNotFoundErrorResponse: type: object properties: code: @@ -20138,60 +22751,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioFillsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioUsersNotFoundSubcode' trace_id: type: string - description: GetPortfolioFillsNotFoundErrorResponse documents the HTTP 404 error + description: GetPortfolioUsersNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioFillsNotFoundSubcode: + coinbase.public_rest_api.GetPortfolioUsersNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetPortfolioForbiddenErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioForbiddenSubcode' - trace_id: - type: string - description: GetPortfolioForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetPortfolioForbiddenSubcode: - type: string - enum: - - AUTH_RESOURCE_ACCESS_DENIED - - MTLS_CERTIFICATE_REQUIRED - - MTLS_CERTIFICATE_REVOKED - - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioInterestAccrualsBadRequestErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioInterestAccrualsBadRequestSubcode' - trace_id: - type: string - description: GetPortfolioInterestAccrualsBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.GetPortfolioInterestAccrualsBadRequestSubcode: - type: string - enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - FINANCING_START_DATE_REQUIRED - - FINANCING_END_DATE_REQUIRED - - FINANCING_START_DATE_INVALID - - FINANCING_END_DATE_INVALID - - FINANCING_ACCRUALS_INVALID_ARGUMENT - - FINANCING_ACCRUALS_DATE_INVALID - coinbase.public_rest_api.GetPortfolioInterestAccrualsForbiddenErrorResponse: + - PORTFOLIO_NOT_FOUND + coinbase.public_rest_api.GetPortfoliosForbiddenErrorResponse: type: object properties: code: @@ -20199,37 +22769,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioInterestAccrualsForbiddenSubcode' - trace_id: - type: string - description: GetPortfolioInterestAccrualsForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetPortfolioInterestAccrualsForbiddenSubcode: - type: string - enum: - - AUTH_RESOURCE_ACCESS_DENIED - - MTLS_CERTIFICATE_REQUIRED - - MTLS_CERTIFICATE_REVOKED - - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioInterestAccrualsNotFoundErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioInterestAccrualsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfoliosForbiddenSubcode' trace_id: type: string - description: GetPortfolioInterestAccrualsNotFoundErrorResponse documents the - HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioInterestAccrualsNotFoundSubcode: + description: GetPortfoliosForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetPortfoliosForbiddenSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - PORTFOLIO_NOT_FOUND - coinbase.public_rest_api.GetPortfolioNotFoundErrorResponse: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.GetPortfoliosNotFoundErrorResponse: type: object properties: code: @@ -20237,18 +22789,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfoliosNotFoundSubcode' trace_id: type: string - description: GetPortfolioNotFoundErrorResponse documents the HTTP 404 error + description: GetPortfoliosNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfolioNotFoundSubcode: + coinbase.public_rest_api.GetPortfoliosNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - ENTITY_NOT_FOUND - - PORTFOLIO_NOT_FOUND - coinbase.public_rest_api.GetPortfolioProductsBadRequestErrorResponse: + coinbase.public_rest_api.GetPositionsBadRequestErrorResponse: type: object properties: code: @@ -20256,20 +22807,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioProductsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPositionsBadRequestSubcode' trace_id: type: string - description: GetPortfolioProductsBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetPortfolioProductsBadRequestSubcode: + description: GetPositionsBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetPositionsBadRequestSubcode: type: string enum: - - ENTITY_ID_INVALID - - PORTFOLIO_ID_INVALID - - PRODUCT_FUTURES_NOT_ENABLED - - PRODUCT_LIMIT_INVALID - - PRODUCT_OPTIONS_NOT_ENABLED - coinbase.public_rest_api.GetPortfolioProductsForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - ENTITY_POSITION_INVALID_ARGUMENT + coinbase.public_rest_api.GetPositionsForbiddenErrorResponse: type: object properties: code: @@ -20277,19 +22825,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioProductsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPositionsForbiddenSubcode' trace_id: type: string - description: GetPortfolioProductsForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetPortfolioProductsForbiddenSubcode: + description: GetPositionsForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetPositionsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioProductsNotFoundErrorResponse: + coinbase.public_rest_api.GetPositionsNotFoundErrorResponse: type: object properties: code: @@ -20297,19 +22845,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioProductsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPositionsNotFoundSubcode' trace_id: type: string - description: GetPortfolioProductsNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetPortfolioProductsNotFoundSubcode: + description: GetPositionsNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetPositionsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - ENTITY_NOT_FOUND - - PORTFOLIO_NOT_FOUND - - PRODUCT_NOT_FOUND - coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestErrorResponse: + - ENTITY_POSITION_NOT_FOUND + - FCM_ACCOUNT_NOT_FOUND + coinbase.public_rest_api.GetPostTradeCreditBadRequestErrorResponse: type: object properties: code: @@ -20317,19 +22865,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPostTradeCreditBadRequestSubcode' trace_id: type: string - description: GetPortfolioRewardsRateBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetPortfolioRewardsRateBadRequestSubcode: + description: GetPostTradeCreditBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetPostTradeCreditBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - REWARDS_REQUEST_INVALID - - REWARDS_ENTITY_NOT_ENROLLED - coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenErrorResponse: + coinbase.public_rest_api.GetPostTradeCreditForbiddenErrorResponse: type: object properties: code: @@ -20337,20 +22882,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPostTradeCreditForbiddenSubcode' trace_id: type: string - description: GetPortfolioRewardsRateForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetPortfolioRewardsRateForbiddenSubcode: + description: GetPostTradeCreditForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetPostTradeCreditForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - - REWARDS_API_FEATURE_DISABLED - coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundErrorResponse: + coinbase.public_rest_api.GetPostTradeCreditNotFoundErrorResponse: type: object properties: code: @@ -20358,16 +22902,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetPostTradeCreditNotFoundSubcode' trace_id: type: string - description: GetPortfolioRewardsRateNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetPortfolioRewardsRateNotFoundSubcode: + description: GetPostTradeCreditNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetPostTradeCreditNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetPortfolioTransactionsBadRequestErrorResponse: + - FINANCING_PTC_DISABLED_FOR_PM_ENTITY + coinbase.public_rest_api.GetStakingStatusBadRequestErrorResponse: type: object properties: code: @@ -20375,22 +22920,22 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioTransactionsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetStakingStatusBadRequestSubcode' trace_id: type: string - description: GetPortfolioTransactionsBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetPortfolioTransactionsBadRequestSubcode: + description: GetStakingStatusBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.GetStakingStatusBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - TRANSACTION_LIMIT_EXCEEDED - - TRANSACTION_CURSOR_INVALID - - TRANSACTION_TRAVEL_RULE_STATUS_INVALID - - TRANSACTION_FILTER_INVALID - - TRANSACTION_PARAMS_INVALID - coinbase.public_rest_api.GetPortfolioTransactionsForbiddenErrorResponse: + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_TYPE_NOT_SUPPORTED + - STAKING_REQUEST_INVALID + - STAKING_CURRENCY_UNSUPPORTED + coinbase.public_rest_api.GetStakingStatusForbiddenErrorResponse: type: object properties: code: @@ -20398,19 +22943,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioTransactionsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetStakingStatusForbiddenSubcode' trace_id: type: string - description: GetPortfolioTransactionsForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetPortfolioTransactionsForbiddenSubcode: + description: GetStakingStatusForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.GetStakingStatusForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioTransactionsNotFoundErrorResponse: + coinbase.public_rest_api.GetStakingStatusNotFoundErrorResponse: type: object properties: code: @@ -20418,17 +22963,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioTransactionsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetStakingStatusNotFoundSubcode' trace_id: type: string - description: GetPortfolioTransactionsNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetPortfolioTransactionsNotFoundSubcode: + description: GetStakingStatusNotFoundErrorResponse documents the HTTP 404 error + body. + coinbase.public_rest_api.GetStakingStatusNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - ASSET_NOT_FOUND - coinbase.public_rest_api.GetPortfolioUsersBadRequestErrorResponse: + - WALLET_NOT_FOUND + coinbase.public_rest_api.GetTFTieredPricingFeesBadRequestErrorResponse: type: object properties: code: @@ -20436,19 +22980,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioUsersBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTFTieredPricingFeesBadRequestSubcode' trace_id: type: string - description: GetPortfolioUsersBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetPortfolioUsersBadRequestSubcode: + description: GetTFTieredPricingFeesBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetTFTieredPricingFeesBadRequestSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - PORTFOLIO_USERS_CURSOR_INVALID - - PORTFOLIO_USERS_LIMIT_INVALID - coinbase.public_rest_api.GetPortfolioUsersForbiddenErrorResponse: + - ENTITY_ID_REQUIRED + - ENTITY_ID_INVALID + - TIERED_PRICING_EFFECTIVE_AT_INVALID + - TIERED_PRICING_REQUEST_INVALID + - TIERED_PRICING_FAILED_PRECONDITION + coinbase.public_rest_api.GetTFTieredPricingFeesForbiddenErrorResponse: type: object properties: code: @@ -20456,19 +23001,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioUsersForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTFTieredPricingFeesForbiddenSubcode' trace_id: type: string - description: GetPortfolioUsersForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetPortfolioUsersForbiddenSubcode: + description: GetTFTieredPricingFeesForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetTFTieredPricingFeesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfolioUsersNotFoundErrorResponse: + coinbase.public_rest_api.GetTFTieredPricingFeesNotFoundErrorResponse: type: object properties: code: @@ -20476,17 +23021,36 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfolioUsersNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTFTieredPricingFeesNotFoundSubcode' trace_id: type: string - description: GetPortfolioUsersNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetPortfolioUsersNotFoundSubcode: + description: GetTFTieredPricingFeesNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetTFTieredPricingFeesNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - PORTFOLIO_NOT_FOUND - coinbase.public_rest_api.GetPortfoliosForbiddenErrorResponse: + coinbase.public_rest_api.GetTransactionBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionBadRequestSubcode' + trace_id: + type: string + description: GetTransactionBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetTransactionBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - TRANSACTION_ID_REQUIRED + - TRANSACTION_ID_INVALID + coinbase.public_rest_api.GetTransactionForbiddenErrorResponse: type: object properties: code: @@ -20494,19 +23058,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfoliosForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionForbiddenSubcode' trace_id: type: string - description: GetPortfoliosForbiddenErrorResponse documents the HTTP 403 error + description: GetTransactionForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetPortfoliosForbiddenSubcode: + coinbase.public_rest_api.GetTransactionForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPortfoliosNotFoundErrorResponse: + coinbase.public_rest_api.GetTransactionNotFoundErrorResponse: type: object properties: code: @@ -20514,17 +23078,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPortfoliosNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionNotFoundSubcode' trace_id: type: string - description: GetPortfoliosNotFoundErrorResponse documents the HTTP 404 error + description: GetTransactionNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPortfoliosNotFoundSubcode: + coinbase.public_rest_api.GetTransactionNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - coinbase.public_rest_api.GetPositionsBadRequestErrorResponse: + - TRANSACTION_NOT_FOUND + coinbase.public_rest_api.GetTransactionTravelRuleDataBadRequestErrorResponse: type: object properties: code: @@ -20532,17 +23096,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPositionsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionTravelRuleDataBadRequestSubcode' trace_id: type: string - description: GetPositionsBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetPositionsBadRequestSubcode: + description: GetTransactionTravelRuleDataBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetTransactionTravelRuleDataBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_POSITION_INVALID_ARGUMENT - coinbase.public_rest_api.GetPositionsForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - TRANSACTION_ID_REQUIRED + - TRANSACTION_ID_INVALID + coinbase.public_rest_api.GetTransactionTravelRuleDataForbiddenErrorResponse: type: object properties: code: @@ -20550,19 +23116,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPositionsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionTravelRuleDataForbiddenSubcode' trace_id: type: string - description: GetPositionsForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetPositionsForbiddenSubcode: + description: GetTransactionTravelRuleDataForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetTransactionTravelRuleDataForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPositionsNotFoundErrorResponse: + coinbase.public_rest_api.GetTransactionTravelRuleDataNotFoundErrorResponse: type: object properties: code: @@ -20570,19 +23136,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPositionsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionTravelRuleDataNotFoundSubcode' trace_id: type: string - description: GetPositionsNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetPositionsNotFoundSubcode: + description: GetTransactionTravelRuleDataNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetTransactionTravelRuleDataNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - ENTITY_NOT_FOUND - - ENTITY_POSITION_NOT_FOUND - - FCM_ACCOUNT_NOT_FOUND - coinbase.public_rest_api.GetPostTradeCreditBadRequestErrorResponse: + - AUTH_RESOURCE_NOT_FOUND + - TRANSACTION_NOT_FOUND + - TRANSACTION_TRAVEL_RULE_DATA_NOT_FOUND + coinbase.public_rest_api.GetUnstakingStatusBadRequestErrorResponse: type: object properties: code: @@ -20590,16 +23155,22 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPostTradeCreditBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetUnstakingStatusBadRequestSubcode' trace_id: type: string - description: GetPostTradeCreditBadRequestErrorResponse documents the HTTP 400 + description: GetUnstakingStatusBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetPostTradeCreditBadRequestSubcode: + coinbase.public_rest_api.GetUnstakingStatusBadRequestSubcode: type: string enum: + - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - coinbase.public_rest_api.GetPostTradeCreditForbiddenErrorResponse: + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_TYPE_NOT_SUPPORTED + - STAKING_REQUEST_INVALID + - STAKING_CURRENCY_UNSUPPORTED + coinbase.public_rest_api.GetUnstakingStatusForbiddenErrorResponse: type: object properties: code: @@ -20607,19 +23178,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPostTradeCreditForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetUnstakingStatusForbiddenSubcode' trace_id: type: string - description: GetPostTradeCreditForbiddenErrorResponse documents the HTTP 403 + description: GetUnstakingStatusForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetPostTradeCreditForbiddenSubcode: + coinbase.public_rest_api.GetUnstakingStatusForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetPostTradeCreditNotFoundErrorResponse: + coinbase.public_rest_api.GetUnstakingStatusNotFoundErrorResponse: type: object properties: code: @@ -20627,17 +23198,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetPostTradeCreditNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetUnstakingStatusNotFoundSubcode' trace_id: type: string - description: GetPostTradeCreditNotFoundErrorResponse documents the HTTP 404 + description: GetUnstakingStatusNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetPostTradeCreditNotFoundSubcode: + coinbase.public_rest_api.GetUnstakingStatusNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - FINANCING_PTC_DISABLED_FOR_PM_ENTITY - coinbase.public_rest_api.GetStakingStatusBadRequestErrorResponse: + - WALLET_NOT_FOUND + coinbase.public_rest_api.GetWalletBadRequestErrorResponse: type: object properties: code: @@ -20645,12 +23215,31 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetStakingStatusBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBadRequestSubcode' trace_id: type: string - description: GetStakingStatusBadRequestErrorResponse documents the HTTP 400 + description: GetWalletBadRequestErrorResponse documents the HTTP 400 error body. + coinbase.public_rest_api.GetWalletBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + coinbase.public_rest_api.GetWalletBalanceBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBalanceBadRequestSubcode' + trace_id: + type: string + description: GetWalletBalanceBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetStakingStatusBadRequestSubcode: + coinbase.public_rest_api.GetWalletBalanceBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED @@ -20658,9 +23247,7 @@ components: - WALLET_ID_REQUIRED - WALLET_ID_INVALID - WALLET_TYPE_NOT_SUPPORTED - - STAKING_REQUEST_INVALID - - STAKING_CURRENCY_UNSUPPORTED - coinbase.public_rest_api.GetStakingStatusForbiddenErrorResponse: + coinbase.public_rest_api.GetWalletBalanceForbiddenErrorResponse: type: object properties: code: @@ -20668,19 +23255,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetStakingStatusForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBalanceForbiddenSubcode' trace_id: type: string - description: GetStakingStatusForbiddenErrorResponse documents the HTTP 403 error + description: GetWalletBalanceForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetStakingStatusForbiddenSubcode: + coinbase.public_rest_api.GetWalletBalanceForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetStakingStatusNotFoundErrorResponse: + coinbase.public_rest_api.GetWalletBalanceNotFoundErrorResponse: type: object properties: code: @@ -20688,16 +23275,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetStakingStatusNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBalanceNotFoundSubcode' trace_id: type: string - description: GetStakingStatusNotFoundErrorResponse documents the HTTP 404 error + description: GetWalletBalanceNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetStakingStatusNotFoundSubcode: + coinbase.public_rest_api.GetWalletBalanceNotFoundSubcode: type: string enum: + - AUTH_RESOURCE_NOT_FOUND - WALLET_NOT_FOUND - coinbase.public_rest_api.GetTFTieredPricingFeesBadRequestErrorResponse: + coinbase.public_rest_api.GetWalletDepositInstructionsBadRequestErrorResponse: type: object properties: code: @@ -20705,20 +23293,26 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTFTieredPricingFeesBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletDepositInstructionsBadRequestSubcode' trace_id: type: string - description: GetTFTieredPricingFeesBadRequestErrorResponse documents the HTTP - 400 error body. - coinbase.public_rest_api.GetTFTieredPricingFeesBadRequestSubcode: + description: GetWalletDepositInstructionsBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetWalletDepositInstructionsBadRequestSubcode: type: string enum: - - ENTITY_ID_REQUIRED - - ENTITY_ID_INVALID - - TIERED_PRICING_EFFECTIVE_AT_INVALID - - TIERED_PRICING_REQUEST_INVALID - - TIERED_PRICING_FAILED_PRECONDITION - coinbase.public_rest_api.GetTFTieredPricingFeesForbiddenErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - ASSET_REQUEST_INVALID + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + - WALLET_DEPOSIT_TYPE_REQUIRED + - WALLET_METADATA_INVALID + - WALLET_NETWORK_REQUIRED + - WALLET_NOT_DEPOSITABLE + - WALLET_DEPOSIT_REQUEST_INVALID + - WALLET_FAILED_PRECONDITION + coinbase.public_rest_api.GetWalletDepositInstructionsForbiddenErrorResponse: type: object properties: code: @@ -20726,19 +23320,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTFTieredPricingFeesForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletDepositInstructionsForbiddenSubcode' trace_id: type: string - description: GetTFTieredPricingFeesForbiddenErrorResponse documents the HTTP - 403 error body. - coinbase.public_rest_api.GetTFTieredPricingFeesForbiddenSubcode: + description: GetWalletDepositInstructionsForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetWalletDepositInstructionsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetTFTieredPricingFeesNotFoundErrorResponse: + coinbase.public_rest_api.GetWalletDepositInstructionsNotFoundErrorResponse: type: object properties: code: @@ -20746,36 +23340,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTFTieredPricingFeesNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletDepositInstructionsNotFoundSubcode' trace_id: type: string - description: GetTFTieredPricingFeesNotFoundErrorResponse documents the HTTP - 404 error body. - coinbase.public_rest_api.GetTFTieredPricingFeesNotFoundSubcode: + description: GetWalletDepositInstructionsNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetWalletDepositInstructionsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - coinbase.public_rest_api.GetTransactionBadRequestErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionBadRequestSubcode' - trace_id: - type: string - description: GetTransactionBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetTransactionBadRequestSubcode: - type: string - enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - TRANSACTION_ID_REQUIRED - - TRANSACTION_ID_INVALID - coinbase.public_rest_api.GetTransactionForbiddenErrorResponse: + - PORTFOLIO_NOT_FOUND + - ASSET_NOT_FOUND + - WALLET_NOT_FOUND + coinbase.public_rest_api.GetWalletForbiddenErrorResponse: type: object properties: code: @@ -20783,19 +23360,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletForbiddenSubcode' trace_id: type: string - description: GetTransactionForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetTransactionForbiddenSubcode: + description: GetWalletForbiddenErrorResponse documents the HTTP 403 error body. + coinbase.public_rest_api.GetWalletForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetTransactionNotFoundErrorResponse: + coinbase.public_rest_api.GetWalletNotFoundErrorResponse: type: object properties: code: @@ -20803,17 +23379,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletNotFoundSubcode' trace_id: type: string - description: GetTransactionNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetTransactionNotFoundSubcode: + description: GetWalletNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetWalletNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - TRANSACTION_NOT_FOUND - coinbase.public_rest_api.GetTransactionTravelRuleDataBadRequestErrorResponse: + - WALLET_NOT_FOUND + coinbase.public_rest_api.GetWalletTransactionsBadRequestErrorResponse: type: object properties: code: @@ -20821,19 +23396,22 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionTravelRuleDataBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletTransactionsBadRequestSubcode' trace_id: type: string - description: GetTransactionTravelRuleDataBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.GetTransactionTravelRuleDataBadRequestSubcode: + description: GetWalletTransactionsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetWalletTransactionsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - TRANSACTION_ID_REQUIRED - - TRANSACTION_ID_INVALID - coinbase.public_rest_api.GetTransactionTravelRuleDataForbiddenErrorResponse: + - TRANSACTION_CURSOR_INVALID + - TRANSACTION_FILTER_INVALID + - TRANSACTION_PARAMS_INVALID + - WALLET_ID_REQUIRED + - WALLET_ID_INVALID + coinbase.public_rest_api.GetWalletTransactionsForbiddenErrorResponse: type: object properties: code: @@ -20841,19 +23419,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionTravelRuleDataForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletTransactionsForbiddenSubcode' trace_id: type: string - description: GetTransactionTravelRuleDataForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetTransactionTravelRuleDataForbiddenSubcode: + description: GetWalletTransactionsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetWalletTransactionsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetTransactionTravelRuleDataNotFoundErrorResponse: + coinbase.public_rest_api.GetWalletTransactionsNotFoundErrorResponse: type: object properties: code: @@ -20861,18 +23439,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetTransactionTravelRuleDataNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletTransactionsNotFoundSubcode' trace_id: type: string - description: GetTransactionTravelRuleDataNotFoundErrorResponse documents the - HTTP 404 error body. - coinbase.public_rest_api.GetTransactionTravelRuleDataNotFoundSubcode: + description: GetWalletTransactionsNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.GetWalletTransactionsNotFoundSubcode: type: string enum: - AUTH_RESOURCE_NOT_FOUND - - TRANSACTION_NOT_FOUND - - TRANSACTION_TRAVEL_RULE_DATA_NOT_FOUND - coinbase.public_rest_api.GetUnstakingStatusBadRequestErrorResponse: + - WALLET_NOT_FOUND + coinbase.public_rest_api.GetWalletsBadRequestErrorResponse: type: object properties: code: @@ -20880,22 +23457,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetUnstakingStatusBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletsBadRequestSubcode' trace_id: type: string - description: GetUnstakingStatusBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetUnstakingStatusBadRequestSubcode: + description: GetWalletsBadRequestErrorResponse documents the HTTP 400 error + body. + coinbase.public_rest_api.GetWalletsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_TYPE_NOT_SUPPORTED - - STAKING_REQUEST_INVALID - - STAKING_CURRENCY_UNSUPPORTED - coinbase.public_rest_api.GetUnstakingStatusForbiddenErrorResponse: + - WALLET_REQUEST_INVALID + - WALLET_ONCHAIN_SYMBOLS_NOT_ALLOWED + coinbase.public_rest_api.GetWalletsForbiddenErrorResponse: type: object properties: code: @@ -20903,19 +23477,18 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetUnstakingStatusForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletsForbiddenSubcode' trace_id: type: string - description: GetUnstakingStatusForbiddenErrorResponse documents the HTTP 403 - error body. - coinbase.public_rest_api.GetUnstakingStatusForbiddenSubcode: + description: GetWalletsForbiddenErrorResponse documents the HTTP 403 error body. + coinbase.public_rest_api.GetWalletsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetUnstakingStatusNotFoundErrorResponse: + coinbase.public_rest_api.GetWalletsNotFoundErrorResponse: type: object properties: code: @@ -20923,35 +23496,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetUnstakingStatusNotFoundSubcode' - trace_id: - type: string - description: GetUnstakingStatusNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetUnstakingStatusNotFoundSubcode: - type: string - enum: - - WALLET_NOT_FOUND - coinbase.public_rest_api.GetWalletBadRequestErrorResponse: - type: object - properties: - code: - $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' - message: - type: string - subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletsNotFoundSubcode' trace_id: type: string - description: GetWalletBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetWalletBadRequestSubcode: + description: GetWalletsNotFoundErrorResponse documents the HTTP 404 error body. + coinbase.public_rest_api.GetWalletsNotFoundSubcode: type: string enum: - - PORTFOLIO_ID_REQUIRED - - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - coinbase.public_rest_api.GetWalletBalanceBadRequestErrorResponse: + - ASSET_NOT_FOUND + - WALLET_NOT_FOUND + coinbase.public_rest_api.GetWebhookDeliveryAttemptsBadRequestErrorResponse: type: object properties: code: @@ -20959,20 +23513,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBalanceBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsBadRequestSubcode' trace_id: type: string - description: GetWalletBalanceBadRequestErrorResponse documents the HTTP 400 - error body. - coinbase.public_rest_api.GetWalletBalanceBadRequestSubcode: + description: GetWebhookDeliveryAttemptsBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetWebhookDeliveryAttemptsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_TYPE_NOT_SUPPORTED - coinbase.public_rest_api.GetWalletBalanceForbiddenErrorResponse: + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + coinbase.public_rest_api.GetWebhookDeliveryAttemptsForbiddenErrorResponse: type: object properties: code: @@ -20980,19 +23533,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBalanceForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsForbiddenSubcode' trace_id: type: string - description: GetWalletBalanceForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.GetWalletBalanceForbiddenSubcode: + description: GetWebhookDeliveryAttemptsForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetWebhookDeliveryAttemptsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetWalletBalanceNotFoundErrorResponse: + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.GetWebhookDeliveryAttemptsNotFoundErrorResponse: type: object properties: code: @@ -21000,17 +23554,17 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletBalanceNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsNotFoundSubcode' trace_id: type: string - description: GetWalletBalanceNotFoundErrorResponse documents the HTTP 404 error - body. - coinbase.public_rest_api.GetWalletBalanceNotFoundSubcode: + description: GetWebhookDeliveryAttemptsNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetWebhookDeliveryAttemptsNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.GetWalletDepositInstructionsBadRequestErrorResponse: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND + - WEBHOOK_EVENT_NOT_FOUND + coinbase.public_rest_api.GetWebhookDeliveryLogsBadRequestErrorResponse: type: object properties: code: @@ -21018,26 +23572,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletDepositInstructionsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsBadRequestSubcode' trace_id: type: string - description: GetWalletDepositInstructionsBadRequestErrorResponse documents the - HTTP 400 error body. - coinbase.public_rest_api.GetWalletDepositInstructionsBadRequestSubcode: + description: GetWebhookDeliveryLogsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetWebhookDeliveryLogsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - ASSET_REQUEST_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - - WALLET_DEPOSIT_TYPE_REQUIRED - - WALLET_METADATA_INVALID - - WALLET_NETWORK_REQUIRED - - WALLET_NOT_DEPOSITABLE - - WALLET_DEPOSIT_REQUEST_INVALID - - WALLET_FAILED_PRECONDITION - coinbase.public_rest_api.GetWalletDepositInstructionsForbiddenErrorResponse: + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + coinbase.public_rest_api.GetWebhookDeliveryLogsForbiddenErrorResponse: type: object properties: code: @@ -21045,19 +23592,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletDepositInstructionsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsForbiddenSubcode' trace_id: type: string - description: GetWalletDepositInstructionsForbiddenErrorResponse documents the - HTTP 403 error body. - coinbase.public_rest_api.GetWalletDepositInstructionsForbiddenSubcode: + description: GetWebhookDeliveryLogsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.GetWebhookDeliveryLogsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetWalletDepositInstructionsNotFoundErrorResponse: + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.GetWebhookDeliveryLogsNotFoundErrorResponse: type: object properties: code: @@ -21065,19 +23613,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletDepositInstructionsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsNotFoundSubcode' trace_id: type: string - description: GetWalletDepositInstructionsNotFoundErrorResponse documents the - HTTP 404 error body. - coinbase.public_rest_api.GetWalletDepositInstructionsNotFoundSubcode: + description: GetWebhookDeliveryLogsNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetWebhookDeliveryLogsNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - PORTFOLIO_NOT_FOUND - - ASSET_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.GetWalletForbiddenErrorResponse: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND + coinbase.public_rest_api.GetWebhookEventTypesForbiddenErrorResponse: type: object properties: code: @@ -21085,35 +23630,58 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookEventTypesForbiddenSubcode' trace_id: type: string - description: GetWalletForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetWalletForbiddenSubcode: + description: GetWebhookEventTypesForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetWebhookEventTypesForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetWalletNotFoundErrorResponse: + coinbase.public_rest_api.GetWebhookOwnerStatsBadRequestErrorResponse: type: object properties: code: - $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookOwnerStatsBadRequestSubcode' trace_id: type: string - description: GetWalletNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetWalletNotFoundSubcode: + description: GetWebhookOwnerStatsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.GetWebhookOwnerStatsBadRequestSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.GetWalletTransactionsBadRequestErrorResponse: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + coinbase.public_rest_api.GetWebhookOwnerStatsForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookOwnerStatsForbiddenSubcode' + trace_id: + type: string + description: GetWebhookOwnerStatsForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.GetWebhookOwnerStatsForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.GetWebhookSubscriptionBadRequestErrorResponse: type: object properties: code: @@ -21121,21 +23689,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletTransactionsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionBadRequestSubcode' trace_id: type: string - description: GetWalletTransactionsBadRequestErrorResponse documents the HTTP + description: GetWebhookSubscriptionBadRequestErrorResponse documents the HTTP 400 error body. - coinbase.public_rest_api.GetWalletTransactionsBadRequestSubcode: + coinbase.public_rest_api.GetWebhookSubscriptionBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - TRANSACTION_CURSOR_INVALID - - TRANSACTION_PARAMS_INVALID - - WALLET_ID_REQUIRED - - WALLET_ID_INVALID - coinbase.public_rest_api.GetWalletTransactionsForbiddenErrorResponse: + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + coinbase.public_rest_api.GetWebhookSubscriptionForbiddenErrorResponse: type: object properties: code: @@ -21143,19 +23709,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletTransactionsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionForbiddenSubcode' trace_id: type: string - description: GetWalletTransactionsForbiddenErrorResponse documents the HTTP + description: GetWebhookSubscriptionForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetWalletTransactionsForbiddenSubcode: + coinbase.public_rest_api.GetWebhookSubscriptionForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetWalletTransactionsNotFoundErrorResponse: + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.GetWebhookSubscriptionNotFoundErrorResponse: type: object properties: code: @@ -21163,17 +23730,16 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletTransactionsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionNotFoundSubcode' trace_id: type: string - description: GetWalletTransactionsNotFoundErrorResponse documents the HTTP 404 - error body. - coinbase.public_rest_api.GetWalletTransactionsNotFoundSubcode: + description: GetWebhookSubscriptionNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.GetWebhookSubscriptionNotFoundSubcode: type: string enum: - - AUTH_RESOURCE_NOT_FOUND - - WALLET_NOT_FOUND - coinbase.public_rest_api.GetWalletsBadRequestErrorResponse: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND + coinbase.public_rest_api.GetWebhookSubscriptionStatsBadRequestErrorResponse: type: object properties: code: @@ -21181,19 +23747,19 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletsBadRequestSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsBadRequestSubcode' trace_id: type: string - description: GetWalletsBadRequestErrorResponse documents the HTTP 400 error - body. - coinbase.public_rest_api.GetWalletsBadRequestSubcode: + description: GetWebhookSubscriptionStatsBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.GetWebhookSubscriptionStatsBadRequestSubcode: type: string enum: - PORTFOLIO_ID_REQUIRED - PORTFOLIO_ID_INVALID - - WALLET_REQUEST_INVALID - - WALLET_ONCHAIN_SYMBOLS_NOT_ALLOWED - coinbase.public_rest_api.GetWalletsForbiddenErrorResponse: + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + coinbase.public_rest_api.GetWebhookSubscriptionStatsForbiddenErrorResponse: type: object properties: code: @@ -21201,18 +23767,20 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletsForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsForbiddenSubcode' trace_id: type: string - description: GetWalletsForbiddenErrorResponse documents the HTTP 403 error body. - coinbase.public_rest_api.GetWalletsForbiddenSubcode: + description: GetWebhookSubscriptionStatsForbiddenErrorResponse documents the + HTTP 403 error body. + coinbase.public_rest_api.GetWebhookSubscriptionStatsForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID - coinbase.public_rest_api.GetWalletsNotFoundErrorResponse: + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.GetWebhookSubscriptionStatsNotFoundErrorResponse: type: object properties: code: @@ -21220,15 +23788,15 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.GetWalletsNotFoundSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsNotFoundSubcode' trace_id: type: string - description: GetWalletsNotFoundErrorResponse documents the HTTP 404 error body. - coinbase.public_rest_api.GetWalletsNotFoundSubcode: + description: GetWebhookSubscriptionStatsNotFoundErrorResponse documents the + HTTP 404 error body. + coinbase.public_rest_api.GetWebhookSubscriptionStatsNotFoundSubcode: type: string enum: - - ASSET_NOT_FOUND - - WALLET_NOT_FOUND + - WEBHOOK_SUBSCRIPTION_NOT_FOUND coinbase.public_rest_api.GetWithdrawalPowerBadRequestErrorResponse: type: object properties: @@ -21365,6 +23933,23 @@ components: type: string enum: - AUTH_AUTHORIZATION_FAILED + coinbase.public_rest_api.ListAdvancedTransferTransactionsBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.ListAdvancedTransferTransactionsBadRequestSubcode' + trace_id: + type: string + description: ListAdvancedTransferTransactionsBadRequestErrorResponse documents + the HTTP 400 error body. + coinbase.public_rest_api.ListAdvancedTransferTransactionsBadRequestSubcode: + type: string + enum: + - ADVANCED_TRANSFER_REQUEST_INVALID coinbase.public_rest_api.ListAdvancedTransferTransactionsForbiddenErrorResponse: type: object properties: @@ -21650,6 +24235,7 @@ components: type: string enum: - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID coinbase.public_rest_api.ListOnchainAddressGroupsForbiddenErrorResponse: type: object properties: @@ -21923,6 +24509,45 @@ components: enum: - AUTH_RESOURCE_NOT_FOUND - WALLET_NOT_FOUND + coinbase.public_rest_api.ListWebhookSubscriptionsBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.ListWebhookSubscriptionsBadRequestSubcode' + trace_id: + type: string + description: ListWebhookSubscriptionsBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.ListWebhookSubscriptionsBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + coinbase.public_rest_api.ListWebhookSubscriptionsForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.ListWebhookSubscriptionsForbiddenSubcode' + trace_id: + type: string + description: ListWebhookSubscriptionsForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.ListWebhookSubscriptionsForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - WEBHOOK_FEATURE_DISABLED coinbase.public_rest_api.ListXMLiquidationsBadRequestErrorResponse: type: object properties: @@ -22046,6 +24671,7 @@ components: - ORDER_TIME_IN_FORCE_INVALID - ORDER_TIME_RANGE_INVALID - ORDER_PEG_OFFSET_TYPE_INVALID + - ORDER_SPREAD_NOT_ENABLED coinbase.public_rest_api.OrderPreviewForbiddenErrorResponse: type: object properties: @@ -22267,6 +24893,66 @@ components: - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.ReplayWebhookEventBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventBadRequestSubcode' + trace_id: + type: string + description: ReplayWebhookEventBadRequestErrorResponse documents the HTTP 400 + error body. + coinbase.public_rest_api.ReplayWebhookEventBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WEBHOOK_SUBSCRIPTION_ID_INVALID + - WEBHOOK_IDEMPOTENCY_CONFLICT + - WEBHOOK_INVALID_ARGUMENT + coinbase.public_rest_api.ReplayWebhookEventForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventForbiddenSubcode' + trace_id: + type: string + description: ReplayWebhookEventForbiddenErrorResponse documents the HTTP 403 + error body. + coinbase.public_rest_api.ReplayWebhookEventForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.ReplayWebhookEventNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventNotFoundSubcode' + trace_id: + type: string + description: ReplayWebhookEventNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.ReplayWebhookEventNotFoundSubcode: + type: string + enum: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND + - WEBHOOK_EVENT_NOT_FOUND coinbase.public_rest_api.RotateAPIKeyBadRequestErrorResponse: type: object properties: @@ -22293,18 +24979,78 @@ components: message: type: string subcode: - $ref: '#/components/schemas/coinbase.public_rest_api.RotateAPIKeyForbiddenSubcode' + $ref: '#/components/schemas/coinbase.public_rest_api.RotateAPIKeyForbiddenSubcode' + trace_id: + type: string + description: RotateAPIKeyForbiddenErrorResponse documents the HTTP 403 error + body. + coinbase.public_rest_api.RotateAPIKeyForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + coinbase.public_rest_api.RotateWebhookHMACSecretBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretBadRequestSubcode' + trace_id: + type: string + description: RotateWebhookHMACSecretBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.RotateWebhookHMACSecretBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + - WEBHOOK_VERSION_CONFLICT + - WEBHOOK_INVALID_ARGUMENT + coinbase.public_rest_api.RotateWebhookHMACSecretForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretForbiddenSubcode' trace_id: type: string - description: RotateAPIKeyForbiddenErrorResponse documents the HTTP 403 error - body. - coinbase.public_rest_api.RotateAPIKeyForbiddenSubcode: + description: RotateWebhookHMACSecretForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.RotateWebhookHMACSecretForbiddenSubcode: type: string enum: - AUTH_RESOURCE_ACCESS_DENIED - MTLS_CERTIFICATE_REQUIRED - MTLS_CERTIFICATE_REVOKED - MTLS_CERTIFICATE_INVALID + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.RotateWebhookHMACSecretNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretNotFoundSubcode' + trace_id: + type: string + description: RotateWebhookHMACSecretNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.RotateWebhookHMACSecretNotFoundSubcode: + type: string + enum: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND coinbase.public_rest_api.ScheduleFuturesSweepBadRequestErrorResponse: type: object properties: @@ -22361,6 +25107,65 @@ components: type: string enum: - AUTH_RESOURCE_NOT_FOUND + coinbase.public_rest_api.SendWebhookSimulationBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationBadRequestSubcode' + trace_id: + type: string + description: SendWebhookSimulationBadRequestErrorResponse documents the HTTP + 400 error body. + coinbase.public_rest_api.SendWebhookSimulationBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + - WEBHOOK_EVENT_TYPE_INVALID + coinbase.public_rest_api.SendWebhookSimulationForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationForbiddenSubcode' + trace_id: + type: string + description: SendWebhookSimulationForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.SendWebhookSimulationForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.SendWebhookSimulationNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationNotFoundSubcode' + trace_id: + type: string + description: SendWebhookSimulationNotFoundErrorResponse documents the HTTP 404 + error body. + coinbase.public_rest_api.SendWebhookSimulationNotFoundSubcode: + type: string + enum: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND coinbase.public_rest_api.ServiceUnavailableErrorCode: type: string enum: @@ -22918,6 +25723,8 @@ components: coinbase.public_rest_api.UpdateOnchainAddressGroupBadRequestSubcode: type: string enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID - ONCHAIN_ADDRESS_GROUP_REQUEST_INVALID coinbase.public_rest_api.UpdateOnchainAddressGroupForbiddenErrorResponse: type: object @@ -22956,6 +25763,68 @@ components: type: string enum: - AUTH_RESOURCE_NOT_FOUND + coinbase.public_rest_api.UpdateWebhookSubscriptionBadRequestErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.BadRequestErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionBadRequestSubcode' + trace_id: + type: string + description: UpdateWebhookSubscriptionBadRequestErrorResponse documents the + HTTP 400 error body. + coinbase.public_rest_api.UpdateWebhookSubscriptionBadRequestSubcode: + type: string + enum: + - PORTFOLIO_ID_REQUIRED + - PORTFOLIO_ID_INVALID + - WEBHOOK_SUBSCRIPTION_ID_REQUIRED + - WEBHOOK_SUBSCRIPTION_ID_INVALID + - WEBHOOK_TARGET_URL_INVALID + - WEBHOOK_EVENT_TYPE_INVALID + - WEBHOOK_VERSION_CONFLICT + - WEBHOOK_INVALID_ARGUMENT + coinbase.public_rest_api.UpdateWebhookSubscriptionForbiddenErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.ForbiddenErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionForbiddenSubcode' + trace_id: + type: string + description: UpdateWebhookSubscriptionForbiddenErrorResponse documents the HTTP + 403 error body. + coinbase.public_rest_api.UpdateWebhookSubscriptionForbiddenSubcode: + type: string + enum: + - AUTH_RESOURCE_ACCESS_DENIED + - MTLS_CERTIFICATE_REQUIRED + - MTLS_CERTIFICATE_REVOKED + - MTLS_CERTIFICATE_INVALID + - WEBHOOK_FEATURE_DISABLED + coinbase.public_rest_api.UpdateWebhookSubscriptionNotFoundErrorResponse: + type: object + properties: + code: + $ref: '#/components/schemas/coinbase.public_rest_api.NotFoundErrorCode' + message: + type: string + subcode: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionNotFoundSubcode' + trace_id: + type: string + description: UpdateWebhookSubscriptionNotFoundErrorResponse documents the HTTP + 404 error body. + coinbase.public_rest_api.UpdateWebhookSubscriptionNotFoundSubcode: + type: string + enum: + - WEBHOOK_SUBSCRIPTION_NOT_FOUND public_rest_apiCreateAllocationRequest: type: object properties: @@ -23918,6 +26787,12 @@ components: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.CancelAdvancedTransferNotFoundErrorResponse' + ListAdvancedTransferTransactionsBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ListAdvancedTransferTransactionsBadRequestErrorResponse' ListAdvancedTransferTransactionsForbidden: description: Permission denied. The API key lacks the required scope for this resource. @@ -25047,6 +27922,223 @@ components: application/json: schema: $ref: '#/components/schemas/coinbase.public_rest_api.GetCrossMarginPrimeOverviewNotFoundErrorResponse' + ListWebhookSubscriptionsBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ListWebhookSubscriptionsBadRequestErrorResponse' + ListWebhookSubscriptionsForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ListWebhookSubscriptionsForbiddenErrorResponse' + CreateWebhookSubscriptionBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWebhookSubscriptionBadRequestErrorResponse' + CreateWebhookSubscriptionForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.CreateWebhookSubscriptionForbiddenErrorResponse' + GetWebhookSubscriptionBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionBadRequestErrorResponse' + GetWebhookSubscriptionForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionForbiddenErrorResponse' + GetWebhookSubscriptionNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionNotFoundErrorResponse' + DeleteWebhookSubscriptionBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionBadRequestErrorResponse' + DeleteWebhookSubscriptionForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionForbiddenErrorResponse' + DeleteWebhookSubscriptionNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.DeleteWebhookSubscriptionNotFoundErrorResponse' + UpdateWebhookSubscriptionBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionBadRequestErrorResponse' + UpdateWebhookSubscriptionForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionForbiddenErrorResponse' + UpdateWebhookSubscriptionNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.UpdateWebhookSubscriptionNotFoundErrorResponse' + RotateWebhookHMACSecretBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretBadRequestErrorResponse' + RotateWebhookHMACSecretForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretForbiddenErrorResponse' + RotateWebhookHMACSecretNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.RotateWebhookHMACSecretNotFoundErrorResponse' + SendWebhookSimulationBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationBadRequestErrorResponse' + SendWebhookSimulationForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationForbiddenErrorResponse' + SendWebhookSimulationNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.SendWebhookSimulationNotFoundErrorResponse' + GetWebhookEventTypesForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookEventTypesForbiddenErrorResponse' + GetWebhookDeliveryLogsBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsBadRequestErrorResponse' + GetWebhookDeliveryLogsForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsForbiddenErrorResponse' + GetWebhookDeliveryLogsNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryLogsNotFoundErrorResponse' + GetWebhookDeliveryAttemptsBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsBadRequestErrorResponse' + GetWebhookDeliveryAttemptsForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsForbiddenErrorResponse' + GetWebhookDeliveryAttemptsNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookDeliveryAttemptsNotFoundErrorResponse' + GetWebhookSubscriptionStatsBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsBadRequestErrorResponse' + GetWebhookSubscriptionStatsForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsForbiddenErrorResponse' + GetWebhookSubscriptionStatsNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookSubscriptionStatsNotFoundErrorResponse' + GetWebhookOwnerStatsBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookOwnerStatsBadRequestErrorResponse' + GetWebhookOwnerStatsForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.GetWebhookOwnerStatsForbiddenErrorResponse' + ReplayWebhookEventBadRequest: + description: Bad request. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventBadRequestErrorResponse' + ReplayWebhookEventForbidden: + description: Permission denied. The API key lacks the required scope for this + resource. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventForbiddenErrorResponse' + ReplayWebhookEventNotFound: + description: The requested resource was not found. + content: + application/json: + schema: + $ref: '#/components/schemas/coinbase.public_rest_api.ReplayWebhookEventNotFoundErrorResponse' GetEntityRewardsRateBadRequest: description: Bad request. content: diff --git a/src/main/java/com/coinbase/prime/activities/ActivitiesService.java b/src/main/java/com/coinbase/prime/activities/ActivitiesService.java index 50e3cf1e..a4241478 100644 --- a/src/main/java/com/coinbase/prime/activities/ActivitiesService.java +++ b/src/main/java/com/coinbase/prime/activities/ActivitiesService.java @@ -30,6 +30,21 @@ public interface ActivitiesService { * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + ListActivitiesResponse listActivities(ListActivitiesRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Activities. + * + *

List all activities associated with a given portfolio + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use listActivities instead. + */ + @Deprecated ListPortfolioActivitiesResponse listPortfolioActivities(ListPortfolioActivitiesRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/activities/ActivitiesServiceImpl.java b/src/main/java/com/coinbase/prime/activities/ActivitiesServiceImpl.java index 3f94b8c5..d63b4d84 100644 --- a/src/main/java/com/coinbase/prime/activities/ActivitiesServiceImpl.java +++ b/src/main/java/com/coinbase/prime/activities/ActivitiesServiceImpl.java @@ -28,6 +28,18 @@ public ActivitiesServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public ListActivitiesResponse listActivities(ListActivitiesRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/activities", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListPortfolioActivitiesResponse listPortfolioActivities( ListPortfolioActivitiesRequest request) throws CoinbasePrimeException { diff --git a/src/main/java/com/coinbase/prime/activities/ListActivitiesRequest.java b/src/main/java/com/coinbase/prime/activities/ListActivitiesRequest.java new file mode 100644 index 00000000..78872332 --- /dev/null +++ b/src/main/java/com/coinbase/prime/activities/ListActivitiesRequest.java @@ -0,0 +1,194 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.activities; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.common.PrimeListRequest; +import com.coinbase.prime.model.enums.ActivityCategory; +import com.coinbase.prime.model.enums.ActivityStatus; +import com.coinbase.prime.model.enums.SortDirection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Activities */ +public class ListActivitiesRequest extends PrimeListRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("symbols") + private String[] symbols; + + @JsonProperty("categories") + private ActivityCategory[] categories; + + @JsonProperty("statuses") + private ActivityStatus[] statuses; + + @JsonProperty("start_time") + private String startTime; + + @JsonProperty("end_time") + private String endTime; + + @JsonProperty("get_network_unified_activities") + private Boolean getNetworkUnifiedActivities; + + public ListActivitiesRequest() {} + + public ListActivitiesRequest(Builder builder) { + super(builder.cursor, builder.sortDirection, builder.limit); + this.portfolioId = builder.portfolioId; + this.symbols = builder.symbols; + this.categories = builder.categories; + this.statuses = builder.statuses; + this.startTime = builder.startTime; + this.endTime = builder.endTime; + this.getNetworkUnifiedActivities = builder.getNetworkUnifiedActivities; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String[] getSymbols() { + return symbols; + } + + public void setSymbols(String[] symbols) { + this.symbols = symbols; + } + + public ActivityCategory[] getCategories() { + return categories; + } + + public void setCategories(ActivityCategory[] categories) { + this.categories = categories; + } + + public ActivityStatus[] getStatuses() { + return statuses; + } + + public void setStatuses(ActivityStatus[] statuses) { + this.statuses = statuses; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public Boolean getGetNetworkUnifiedActivities() { + return getNetworkUnifiedActivities; + } + + public void setGetNetworkUnifiedActivities(Boolean getNetworkUnifiedActivities) { + this.getNetworkUnifiedActivities = getNetworkUnifiedActivities; + } + + public static class Builder { + private String portfolioId; + private String[] symbols; + private ActivityCategory[] categories; + private ActivityStatus[] statuses; + private String startTime; + private String endTime; + private Boolean getNetworkUnifiedActivities; + private String cursor; + private SortDirection sortDirection; + private Integer limit; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder symbols(String[] symbols) { + this.symbols = symbols; + return this; + } + + public Builder categories(ActivityCategory[] categories) { + this.categories = categories; + return this; + } + + public Builder statuses(ActivityStatus[] statuses) { + this.statuses = statuses; + return this; + } + + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + public Builder endTime(String endTime) { + this.endTime = endTime; + return this; + } + + public Builder getNetworkUnifiedActivities(Boolean getNetworkUnifiedActivities) { + this.getNetworkUnifiedActivities = getNetworkUnifiedActivities; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder pagination(Pagination pagination) { + this.cursor = pagination.getNextCursor(); + this.sortDirection = pagination.getSortDirection(); + return this; + } + + public ListActivitiesRequest build() throws CoinbaseClientException { + validate(); + return new ListActivitiesRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/activities/ListActivitiesResponse.java b/src/main/java/com/coinbase/prime/activities/ListActivitiesResponse.java new file mode 100644 index 00000000..074e754b --- /dev/null +++ b/src/main/java/com/coinbase/prime/activities/ListActivitiesResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.activities; + +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.model.Activity; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Activities */ +public class ListActivitiesResponse { + @JsonProperty("activities") + private Activity[] activities; + + @JsonProperty("pagination") + private Pagination pagination; + + public ListActivitiesResponse() {} + + public Activity[] getActivities() { + return activities; + } + + public void setActivities(Activity[] activities) { + this.activities = activities; + } + + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } +} diff --git a/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesRequest.java b/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesRequest.java index aa8c8cfc..1b78385d 100644 --- a/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesRequest.java +++ b/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesRequest.java @@ -16,179 +16,87 @@ package com.coinbase.prime.activities; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.common.PrimeListRequest; import com.coinbase.prime.model.enums.ActivityCategory; import com.coinbase.prime.model.enums.ActivityStatus; -import com.coinbase.prime.model.enums.SortDirection; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Activities */ -public class ListPortfolioActivitiesRequest extends PrimeListRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty("symbols") - private String[] symbols; - - @JsonProperty("categories") - private ActivityCategory[] categories; - - @JsonProperty("statuses") - private ActivityStatus[] statuses; - - @JsonProperty("start_time") - private String startTime; - - @JsonProperty("end_time") - private String endTime; - - @JsonProperty("get_network_unified_activities") - private Boolean getNetworkUnifiedActivities; +/** + * List Activities + * + * @deprecated Use listActivities instead. + */ +@Deprecated +public class ListPortfolioActivitiesRequest extends ListActivitiesRequest { public ListPortfolioActivitiesRequest() {} - public ListPortfolioActivitiesRequest(Builder builder) { - super(builder.cursor, builder.sortDirection, builder.limit); - this.portfolioId = builder.portfolioId; - this.symbols = builder.symbols; - this.categories = builder.categories; - this.statuses = builder.statuses; - this.startTime = builder.startTime; - this.endTime = builder.endTime; - this.getNetworkUnifiedActivities = builder.getNetworkUnifiedActivities; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String[] getSymbols() { - return symbols; - } - - public void setSymbols(String[] symbols) { - this.symbols = symbols; - } - - public ActivityCategory[] getCategories() { - return categories; - } - - public void setCategories(ActivityCategory[] categories) { - this.categories = categories; - } - - public ActivityStatus[] getStatuses() { - return statuses; - } - - public void setStatuses(ActivityStatus[] statuses) { - this.statuses = statuses; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; + public ListPortfolioActivitiesRequest(ListActivitiesRequest.Builder builder) { + super(builder); } - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public Boolean getGetNetworkUnifiedActivities() { - return getNetworkUnifiedActivities; - } - - public void setGetNetworkUnifiedActivities(Boolean getNetworkUnifiedActivities) { - this.getNetworkUnifiedActivities = getNetworkUnifiedActivities; - } - - public static class Builder { - private String portfolioId; - private String[] symbols; - private ActivityCategory[] categories; - private ActivityStatus[] statuses; - private String startTime; - private String endTime; - private Boolean getNetworkUnifiedActivities; - private String cursor; - private SortDirection sortDirection; - private Integer limit; - - public Builder() {} - + /** + * @deprecated Use listActivities instead. + */ + @Deprecated + public static class Builder extends ListActivitiesRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder symbols(String[] symbols) { - this.symbols = symbols; + super.symbols(symbols); return this; } + @Override public Builder categories(ActivityCategory[] categories) { - this.categories = categories; + super.categories(categories); return this; } + @Override public Builder statuses(ActivityStatus[] statuses) { - this.statuses = statuses; + super.statuses(statuses); return this; } + @Override public Builder startTime(String startTime) { - this.startTime = startTime; + super.startTime(startTime); return this; } + @Override public Builder endTime(String endTime) { - this.endTime = endTime; + super.endTime(endTime); return this; } + @Override public Builder getNetworkUnifiedActivities(Boolean getNetworkUnifiedActivities) { - this.getNetworkUnifiedActivities = getNetworkUnifiedActivities; + super.getNetworkUnifiedActivities(getNetworkUnifiedActivities); return this; } + @Override public Builder limit(Integer limit) { - this.limit = limit; + super.limit(limit); return this; } + @Override public Builder pagination(Pagination pagination) { - this.cursor = pagination.getNextCursor(); - this.sortDirection = pagination.getSortDirection(); + super.pagination(pagination); return this; } + @Override public ListPortfolioActivitiesRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListPortfolioActivitiesRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesResponse.java b/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesResponse.java index d2e6504b..4737e16b 100644 --- a/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesResponse.java +++ b/src/main/java/com/coinbase/prime/activities/ListPortfolioActivitiesResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.activities; -import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.model.Activity; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Activities */ -public class ListPortfolioActivitiesResponse { - @JsonProperty("activities") - private Activity[] activities; - - @JsonProperty("pagination") - private Pagination pagination; - +/** + * List Activities + * + * @deprecated Use listActivities instead. + */ +@Deprecated +public class ListPortfolioActivitiesResponse extends ListActivitiesResponse { public ListPortfolioActivitiesResponse() {} - - public Activity[] getActivities() { - return activities; - } - - public void setActivities(Activity[] activities) { - this.activities = activities; - } - - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } } diff --git a/src/main/java/com/coinbase/prime/addressbook/AddressBookService.java b/src/main/java/com/coinbase/prime/addressbook/AddressBookService.java index 9c4f7a0c..b4479d93 100644 --- a/src/main/java/com/coinbase/prime/addressbook/AddressBookService.java +++ b/src/main/java/com/coinbase/prime/addressbook/AddressBookService.java @@ -30,6 +30,21 @@ public interface AddressBookService { * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetAddressBookResponse getAddressBook(GetAddressBookRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Address Book. + * + *

Gets a list of address book addresses + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getAddressBook instead. + */ + @Deprecated ListAddressBookResponse listAddressBook(ListAddressBookRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/addressbook/AddressBookServiceImpl.java b/src/main/java/com/coinbase/prime/addressbook/AddressBookServiceImpl.java index 8a5c2329..4faa033a 100644 --- a/src/main/java/com/coinbase/prime/addressbook/AddressBookServiceImpl.java +++ b/src/main/java/com/coinbase/prime/addressbook/AddressBookServiceImpl.java @@ -28,6 +28,18 @@ public AddressBookServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public GetAddressBookResponse getAddressBook(GetAddressBookRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/address_book", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListAddressBookResponse listAddressBook(ListAddressBookRequest request) throws CoinbasePrimeException { @@ -46,7 +58,7 @@ public CreateAddressBookEntryResponse createAddressBookEntry( HttpMethod.POST, String.format("/portfolios/%s/address_book", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } } diff --git a/src/main/java/com/coinbase/prime/addressbook/GetAddressBookRequest.java b/src/main/java/com/coinbase/prime/addressbook/GetAddressBookRequest.java new file mode 100644 index 00000000..9a76237a --- /dev/null +++ b/src/main/java/com/coinbase/prime/addressbook/GetAddressBookRequest.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.addressbook; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.common.PrimeListRequest; +import com.coinbase.prime.model.enums.SortDirection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Address Book */ +public class GetAddressBookRequest extends PrimeListRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("currency_symbol") + private String currencySymbol; + + @JsonProperty("search") + private String search; + + public GetAddressBookRequest() {} + + public GetAddressBookRequest(Builder builder) { + super(builder.cursor, builder.sortDirection, builder.limit); + this.portfolioId = builder.portfolioId; + this.currencySymbol = builder.currencySymbol; + this.search = builder.search; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getCurrencySymbol() { + return currencySymbol; + } + + public void setCurrencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + } + + public String getSearch() { + return search; + } + + public void setSearch(String search) { + this.search = search; + } + + public static class Builder { + private String portfolioId; + private String currencySymbol; + private String search; + private String cursor; + private SortDirection sortDirection; + private Integer limit; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder currencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + return this; + } + + public Builder search(String search) { + this.search = search; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder pagination(Pagination pagination) { + this.cursor = pagination.getNextCursor(); + this.sortDirection = pagination.getSortDirection(); + return this; + } + + public GetAddressBookRequest build() throws CoinbaseClientException { + validate(); + return new GetAddressBookRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/addressbook/GetAddressBookResponse.java b/src/main/java/com/coinbase/prime/addressbook/GetAddressBookResponse.java new file mode 100644 index 00000000..7525ec3e --- /dev/null +++ b/src/main/java/com/coinbase/prime/addressbook/GetAddressBookResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.addressbook; + +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.model.AddressBookEntry; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Address Book */ +public class GetAddressBookResponse { + @JsonProperty("addresses") + private AddressBookEntry[] addresses; + + @JsonProperty("pagination") + private Pagination pagination; + + public GetAddressBookResponse() {} + + public AddressBookEntry[] getAddresses() { + return addresses; + } + + public void setAddresses(AddressBookEntry[] addresses) { + this.addresses = addresses; + } + + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } +} diff --git a/src/main/java/com/coinbase/prime/addressbook/ListAddressBookRequest.java b/src/main/java/com/coinbase/prime/addressbook/ListAddressBookRequest.java index 8fec9172..26ea7b4b 100644 --- a/src/main/java/com/coinbase/prime/addressbook/ListAddressBookRequest.java +++ b/src/main/java/com/coinbase/prime/addressbook/ListAddressBookRequest.java @@ -16,105 +16,61 @@ package com.coinbase.prime.addressbook; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.common.PrimeListRequest; -import com.coinbase.prime.model.enums.SortDirection; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Address Book */ -public class ListAddressBookRequest extends PrimeListRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty("currency_symbol") - private String currencySymbol; - - @JsonProperty("search") - private String search; +/** + * Get Address Book + * + * @deprecated Use getAddressBook instead. + */ +@Deprecated +public class ListAddressBookRequest extends GetAddressBookRequest { public ListAddressBookRequest() {} - public ListAddressBookRequest(Builder builder) { - super(builder.cursor, builder.sortDirection, builder.limit); - this.portfolioId = builder.portfolioId; - this.currencySymbol = builder.currencySymbol; - this.search = builder.search; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getCurrencySymbol() { - return currencySymbol; - } - - public void setCurrencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; + public ListAddressBookRequest(GetAddressBookRequest.Builder builder) { + super(builder); } - public String getSearch() { - return search; - } - - public void setSearch(String search) { - this.search = search; - } - - public static class Builder { - private String portfolioId; - private String currencySymbol; - private String search; - private String cursor; - private SortDirection sortDirection; - private Integer limit; - - public Builder() {} - + /** + * @deprecated Use getAddressBook instead. + */ + @Deprecated + public static class Builder extends GetAddressBookRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder currencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; + super.currencySymbol(currencySymbol); return this; } + @Override public Builder search(String search) { - this.search = search; + super.search(search); return this; } + @Override public Builder limit(Integer limit) { - this.limit = limit; + super.limit(limit); return this; } + @Override public Builder pagination(Pagination pagination) { - this.cursor = pagination.getNextCursor(); - this.sortDirection = pagination.getSortDirection(); + super.pagination(pagination); return this; } + @Override public ListAddressBookRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListAddressBookRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/addressbook/ListAddressBookResponse.java b/src/main/java/com/coinbase/prime/addressbook/ListAddressBookResponse.java index be773c9b..24d98a75 100644 --- a/src/main/java/com/coinbase/prime/addressbook/ListAddressBookResponse.java +++ b/src/main/java/com/coinbase/prime/addressbook/ListAddressBookResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.addressbook; -import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.model.AddressBookEntry; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Address Book */ -public class ListAddressBookResponse { - @JsonProperty("addresses") - private AddressBookEntry[] addresses; - - @JsonProperty("pagination") - private Pagination pagination; - +/** + * Get Address Book + * + * @deprecated Use getAddressBook instead. + */ +@Deprecated +public class ListAddressBookResponse extends GetAddressBookResponse { public ListAddressBookResponse() {} - - public AddressBookEntry[] getAddresses() { - return addresses; - } - - public void setAddresses(AddressBookEntry[] addresses) { - this.addresses = addresses; - } - - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } } diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferService.java b/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferService.java index 591fc2b6..996a1a45 100644 --- a/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferService.java +++ b/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferService.java @@ -88,6 +88,21 @@ ListAdvancedTransferTransactionsResponse listAdvancedTransferTransactions( * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetCounterpartyIdResponse getCounterpartyId(GetCounterpartyIdRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Portfolio Counterparty ID. + * + *

Retrieve the counterparty ID for a given portfolio + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getCounterpartyId instead. + */ + @Deprecated GetPortfolioCounterpartyIdResponse getPortfolioCounterpartyId( GetPortfolioCounterpartyIdRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferServiceImpl.java b/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferServiceImpl.java index 039ee712..82568afd 100644 --- a/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferServiceImpl.java +++ b/src/main/java/com/coinbase/prime/advancedtransfer/AdvancedTransferServiceImpl.java @@ -47,7 +47,7 @@ public CreateAdvancedTransferResponse createAdvancedTransfer( HttpMethod.POST, String.format("/portfolios/%s/advanced_transfers", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -77,6 +77,18 @@ public ListAdvancedTransferTransactionsResponse listAdvancedTransferTransactions new TypeReference() {}); } + @Override + public GetCounterpartyIdResponse getCounterpartyId(GetCounterpartyIdRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/counterparty", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetPortfolioCounterpartyIdResponse getPortfolioCounterpartyId( GetPortfolioCounterpartyIdRequest request) throws CoinbasePrimeException { diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/CreateAdvancedTransferRequest.java b/src/main/java/com/coinbase/prime/advancedtransfer/CreateAdvancedTransferRequest.java index a0d237f8..1b0aee6f 100644 --- a/src/main/java/com/coinbase/prime/advancedtransfer/CreateAdvancedTransferRequest.java +++ b/src/main/java/com/coinbase/prime/advancedtransfer/CreateAdvancedTransferRequest.java @@ -34,11 +34,20 @@ public class CreateAdvancedTransferRequest { @JsonProperty("advanced_transfer") private AdvancedTransfer advancedTransfer; + /** + * Optional client-generated idempotency key. When set, it must be a UUID. A request with the same + * key returns the stored transfer (id, legs, and state); the request body is not compared. Omit + * the field to create a new transfer. + */ + @JsonProperty("idempotency_key") + private String idempotencyKey; + public CreateAdvancedTransferRequest() {} public CreateAdvancedTransferRequest(Builder builder) { this.portfolioId = builder.portfolioId; this.advancedTransfer = builder.advancedTransfer; + this.idempotencyKey = builder.idempotencyKey; } public String getPortfolioId() { @@ -57,9 +66,18 @@ public void setAdvancedTransfer(AdvancedTransfer advancedTransfer) { this.advancedTransfer = advancedTransfer; } + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + public static class Builder { private String portfolioId; private AdvancedTransfer advancedTransfer; + private String idempotencyKey; public Builder() {} @@ -73,6 +91,11 @@ public Builder advancedTransfer(AdvancedTransfer advancedTransfer) { return this; } + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + public CreateAdvancedTransferRequest build() throws CoinbaseClientException { validate(); return new CreateAdvancedTransferRequest(this); diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdRequest.java b/src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdRequest.java new file mode 100644 index 00000000..25ba9599 --- /dev/null +++ b/src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdRequest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.advancedtransfer; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Portfolio Counterparty ID */ +public class GetCounterpartyIdRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + public GetCounterpartyIdRequest() {} + + public GetCounterpartyIdRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public static class Builder { + private String portfolioId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public GetCounterpartyIdRequest build() throws CoinbaseClientException { + validate(); + return new GetCounterpartyIdRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdResponse.java b/src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdResponse.java new file mode 100644 index 00000000..cfa52513 --- /dev/null +++ b/src/main/java/com/coinbase/prime/advancedtransfer/GetCounterpartyIdResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.advancedtransfer; + +import com.coinbase.prime.model.Counterparty; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Portfolio Counterparty ID */ +public class GetCounterpartyIdResponse { + @JsonProperty("counterparty") + private Counterparty counterparty; + + public GetCounterpartyIdResponse() {} + + public Counterparty getCounterparty() { + return counterparty; + } + + public void setCounterparty(Counterparty counterparty) { + this.counterparty = counterparty; + } +} diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdRequest.java b/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdRequest.java index 91d7d16f..7d618257 100644 --- a/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdRequest.java +++ b/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdRequest.java @@ -16,51 +16,36 @@ package com.coinbase.prime.advancedtransfer; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Portfolio Counterparty ID */ -public class GetPortfolioCounterpartyIdRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; +/** + * Get Portfolio Counterparty ID + * + * @deprecated Use getCounterpartyId instead. + */ +@Deprecated +public class GetPortfolioCounterpartyIdRequest extends GetCounterpartyIdRequest { public GetPortfolioCounterpartyIdRequest() {} - public GetPortfolioCounterpartyIdRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - } - - public String getPortfolioId() { - return portfolioId; + public GetPortfolioCounterpartyIdRequest(GetCounterpartyIdRequest.Builder builder) { + super(builder); } - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public static class Builder { - private String portfolioId; - - public Builder() {} - + /** + * @deprecated Use getCounterpartyId instead. + */ + @Deprecated + public static class Builder extends GetCounterpartyIdRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public GetPortfolioCounterpartyIdRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetPortfolioCounterpartyIdRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdResponse.java b/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdResponse.java index 814479fa..aa6ac509 100644 --- a/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdResponse.java +++ b/src/main/java/com/coinbase/prime/advancedtransfer/GetPortfolioCounterpartyIdResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.advancedtransfer; -import com.coinbase.prime.model.Counterparty; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Portfolio Counterparty ID */ -public class GetPortfolioCounterpartyIdResponse { - @JsonProperty("counterparty") - private Counterparty counterparty; - +/** + * Get Portfolio Counterparty ID + * + * @deprecated Use getCounterpartyId instead. + */ +@Deprecated +public class GetPortfolioCounterpartyIdResponse extends GetCounterpartyIdResponse { public GetPortfolioCounterpartyIdResponse() {} - - public Counterparty getCounterparty() { - return counterparty; - } - - public void setCounterparty(Counterparty counterparty) { - this.counterparty = counterparty; - } } diff --git a/src/main/java/com/coinbase/prime/allocations/AllocationsService.java b/src/main/java/com/coinbase/prime/allocations/AllocationsService.java index 869ac924..0910b721 100644 --- a/src/main/java/com/coinbase/prime/allocations/AllocationsService.java +++ b/src/main/java/com/coinbase/prime/allocations/AllocationsService.java @@ -31,6 +31,22 @@ public interface AllocationsService { * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreatePortfolioAllocationsResponse createPortfolioAllocations( + CreatePortfolioAllocationsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Create Portfolio Allocations. + * + *

Create allocation for a given portfolio + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createPortfolioAllocations instead. + */ + @Deprecated CreateAllocationResponse createAllocation(CreateAllocationRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -44,6 +60,22 @@ CreateAllocationResponse createAllocation(CreateAllocationRequest request) * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreatePortfolioNetAllocationsResponse createPortfolioNetAllocations( + CreatePortfolioNetAllocationsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Create Portfolio Net Allocations. + * + *

Create net allocation for a given portfolio + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createPortfolioNetAllocations instead. + */ + @Deprecated CreateNetAllocationResponse createNetAllocation(CreateNetAllocationRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -70,6 +102,22 @@ ListPortfolioAllocationsResponse listPortfolioAllocations(ListPortfolioAllocatio * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetAllocationsByClientNettingIdResponse getAllocationsByClientNettingId( + GetAllocationsByClientNettingIdRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Net Allocations by Netting ID. + * + *

Retrieve an allocation by netting ID + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getAllocationsByClientNettingId instead. + */ + @Deprecated ListAllocationsByNettingIdResponse listAllocationsByNettingId( ListAllocationsByNettingIdRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/allocations/AllocationsServiceImpl.java b/src/main/java/com/coinbase/prime/allocations/AllocationsServiceImpl.java index 85f9d7a7..7bbc1a7c 100644 --- a/src/main/java/com/coinbase/prime/allocations/AllocationsServiceImpl.java +++ b/src/main/java/com/coinbase/prime/allocations/AllocationsServiceImpl.java @@ -28,6 +28,18 @@ public AllocationsServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public CreatePortfolioAllocationsResponse createPortfolioAllocations( + CreatePortfolioAllocationsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + "/allocations", + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public CreateAllocationResponse createAllocation(CreateAllocationRequest request) throws CoinbasePrimeException { @@ -35,10 +47,22 @@ public CreateAllocationResponse createAllocation(CreateAllocationRequest request HttpMethod.POST, "/allocations", request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } + @Override + public CreatePortfolioNetAllocationsResponse createPortfolioNetAllocations( + CreatePortfolioNetAllocationsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + "/allocations/net", + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public CreateNetAllocationResponse createNetAllocation(CreateNetAllocationRequest request) throws CoinbasePrimeException { @@ -46,7 +70,7 @@ public CreateNetAllocationResponse createNetAllocation(CreateNetAllocationReques HttpMethod.POST, "/allocations/net", request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -61,6 +85,19 @@ public ListPortfolioAllocationsResponse listPortfolioAllocations( new TypeReference() {}); } + @Override + public GetAllocationsByClientNettingIdResponse getAllocationsByClientNettingId( + GetAllocationsByClientNettingIdRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format( + "/portfolios/%s/allocations/net/%s", request.getPortfolioId(), request.getNettingId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListAllocationsByNettingIdResponse listAllocationsByNettingId( ListAllocationsByNettingIdRequest request) throws CoinbasePrimeException { diff --git a/src/main/java/com/coinbase/prime/allocations/CreateAllocationRequest.java b/src/main/java/com/coinbase/prime/allocations/CreateAllocationRequest.java index 8fed361c..3a71e849 100644 --- a/src/main/java/com/coinbase/prime/allocations/CreateAllocationRequest.java +++ b/src/main/java/com/coinbase/prime/allocations/CreateAllocationRequest.java @@ -19,156 +19,71 @@ import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.AllocationLeg; import com.coinbase.prime.model.enums.AllocationSizeType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Portfolio Allocations */ -public class CreateAllocationRequest { - /** The ID of the allocation */ - @JsonProperty("allocation_id") - private String allocationId; - - /** The source portfolio id for the allocation */ - @JsonProperty("source_portfolio_id") - private String sourcePortfolioId; - - /** The product for the allocation */ - @JsonProperty("product_id") - private String productId; - - /** The list of order ids in the allocation */ - @JsonProperty("order_ids") - private String[] orderIds; - - /** The list of allocation_legs for the allocation */ - @JsonProperty("allocation_legs") - private AllocationLeg[] allocationLegs; - - @JsonProperty("size_type") - private AllocationSizeType sizeType; - - /** The portfolio where to allocate the remainder of the size */ - @JsonProperty("remainder_destination_portfolio") - private String remainderDestinationPortfolio; +/** + * Create Portfolio Allocations + * + * @deprecated Use createPortfolioAllocations instead. + */ +@Deprecated +public class CreateAllocationRequest extends CreatePortfolioAllocationsRequest { public CreateAllocationRequest() {} - public CreateAllocationRequest(Builder builder) { - this.allocationId = builder.allocationId; - this.sourcePortfolioId = builder.sourcePortfolioId; - this.productId = builder.productId; - this.orderIds = builder.orderIds; - this.allocationLegs = builder.allocationLegs; - this.sizeType = builder.sizeType; - this.remainderDestinationPortfolio = builder.remainderDestinationPortfolio; - } - - public String getAllocationId() { - return allocationId; - } - - public void setAllocationId(String allocationId) { - this.allocationId = allocationId; - } - - public String getSourcePortfolioId() { - return sourcePortfolioId; - } - - public void setSourcePortfolioId(String sourcePortfolioId) { - this.sourcePortfolioId = sourcePortfolioId; - } - - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; - } - - public String[] getOrderIds() { - return orderIds; - } - - public void setOrderIds(String[] orderIds) { - this.orderIds = orderIds; - } - - public AllocationLeg[] getAllocationLegs() { - return allocationLegs; - } - - public void setAllocationLegs(AllocationLeg[] allocationLegs) { - this.allocationLegs = allocationLegs; - } - - public AllocationSizeType getSizeType() { - return sizeType; - } - - public void setSizeType(AllocationSizeType sizeType) { - this.sizeType = sizeType; - } - - public String getRemainderDestinationPortfolio() { - return remainderDestinationPortfolio; + public CreateAllocationRequest(CreatePortfolioAllocationsRequest.Builder builder) { + super(builder); } - public void setRemainderDestinationPortfolio(String remainderDestinationPortfolio) { - this.remainderDestinationPortfolio = remainderDestinationPortfolio; - } - - public static class Builder { - private String allocationId; - private String sourcePortfolioId; - private String productId; - private String[] orderIds; - private AllocationLeg[] allocationLegs; - private AllocationSizeType sizeType; - private String remainderDestinationPortfolio; - - public Builder() {} - + /** + * @deprecated Use createPortfolioAllocations instead. + */ + @Deprecated + public static class Builder extends CreatePortfolioAllocationsRequest.Builder { + @Override public Builder allocationId(String allocationId) { - this.allocationId = allocationId; + super.allocationId(allocationId); return this; } + @Override public Builder sourcePortfolioId(String sourcePortfolioId) { - this.sourcePortfolioId = sourcePortfolioId; + super.sourcePortfolioId(sourcePortfolioId); return this; } + @Override public Builder productId(String productId) { - this.productId = productId; + super.productId(productId); return this; } + @Override public Builder orderIds(String[] orderIds) { - this.orderIds = orderIds; + super.orderIds(orderIds); return this; } + @Override public Builder allocationLegs(AllocationLeg[] allocationLegs) { - this.allocationLegs = allocationLegs; + super.allocationLegs(allocationLegs); return this; } + @Override public Builder sizeType(AllocationSizeType sizeType) { - this.sizeType = sizeType; + super.sizeType(sizeType); return this; } + @Override public Builder remainderDestinationPortfolio(String remainderDestinationPortfolio) { - this.remainderDestinationPortfolio = remainderDestinationPortfolio; + super.remainderDestinationPortfolio(remainderDestinationPortfolio); return this; } + @Override public CreateAllocationRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new CreateAllocationRequest(this); } - - private void validate() throws CoinbaseClientException {} } } diff --git a/src/main/java/com/coinbase/prime/allocations/CreateAllocationResponse.java b/src/main/java/com/coinbase/prime/allocations/CreateAllocationResponse.java index 2ce83408..c2a5842a 100644 --- a/src/main/java/com/coinbase/prime/allocations/CreateAllocationResponse.java +++ b/src/main/java/com/coinbase/prime/allocations/CreateAllocationResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.allocations; -import com.coinbase.prime.model.CreateAllocationResponseBody; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Portfolio Allocations */ -public class CreateAllocationResponse { - @JsonProperty("body") - private CreateAllocationResponseBody body; - +/** + * Create Portfolio Allocations + * + * @deprecated Use createPortfolioAllocations instead. + */ +@Deprecated +public class CreateAllocationResponse extends CreatePortfolioAllocationsResponse { public CreateAllocationResponse() {} - - public CreateAllocationResponseBody getBody() { - return body; - } - - public void setBody(CreateAllocationResponseBody body) { - this.body = body; - } } diff --git a/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationRequest.java b/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationRequest.java index d22ad6e9..e335dce6 100644 --- a/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationRequest.java +++ b/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationRequest.java @@ -19,150 +19,71 @@ import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.AllocationLeg; import com.coinbase.prime.model.enums.AllocationSizeType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Portfolio Net Allocations */ -public class CreateNetAllocationRequest { - @JsonProperty("source_portfolio_id") - private String sourcePortfolioId; - - @JsonProperty("product_id") - private String productId; - - @JsonProperty("order_ids") - private String[] orderIds; - - @JsonProperty("allocation_legs") - private AllocationLeg[] allocationLegs; - - @JsonProperty("size_type") - private AllocationSizeType sizeType; - - @JsonProperty("remainder_destination_portfolio") - private String remainderDestinationPortfolio; - - @JsonProperty("netting_id") - private String nettingId; +/** + * Create Portfolio Net Allocations + * + * @deprecated Use createPortfolioNetAllocations instead. + */ +@Deprecated +public class CreateNetAllocationRequest extends CreatePortfolioNetAllocationsRequest { public CreateNetAllocationRequest() {} - public CreateNetAllocationRequest(Builder builder) { - this.sourcePortfolioId = builder.sourcePortfolioId; - this.productId = builder.productId; - this.orderIds = builder.orderIds; - this.allocationLegs = builder.allocationLegs; - this.sizeType = builder.sizeType; - this.remainderDestinationPortfolio = builder.remainderDestinationPortfolio; - this.nettingId = builder.nettingId; - } - - public String getSourcePortfolioId() { - return sourcePortfolioId; - } - - public void setSourcePortfolioId(String sourcePortfolioId) { - this.sourcePortfolioId = sourcePortfolioId; - } - - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; - } - - public String[] getOrderIds() { - return orderIds; - } - - public void setOrderIds(String[] orderIds) { - this.orderIds = orderIds; - } - - public AllocationLeg[] getAllocationLegs() { - return allocationLegs; - } - - public void setAllocationLegs(AllocationLeg[] allocationLegs) { - this.allocationLegs = allocationLegs; - } - - public AllocationSizeType getSizeType() { - return sizeType; - } - - public void setSizeType(AllocationSizeType sizeType) { - this.sizeType = sizeType; - } - - public String getRemainderDestinationPortfolio() { - return remainderDestinationPortfolio; - } - - public void setRemainderDestinationPortfolio(String remainderDestinationPortfolio) { - this.remainderDestinationPortfolio = remainderDestinationPortfolio; - } - - public String getNettingId() { - return nettingId; + public CreateNetAllocationRequest(CreatePortfolioNetAllocationsRequest.Builder builder) { + super(builder); } - public void setNettingId(String nettingId) { - this.nettingId = nettingId; - } - - public static class Builder { - private String sourcePortfolioId; - private String productId; - private String[] orderIds; - private AllocationLeg[] allocationLegs; - private AllocationSizeType sizeType; - private String remainderDestinationPortfolio; - private String nettingId; - - public Builder() {} - + /** + * @deprecated Use createPortfolioNetAllocations instead. + */ + @Deprecated + public static class Builder extends CreatePortfolioNetAllocationsRequest.Builder { + @Override public Builder sourcePortfolioId(String sourcePortfolioId) { - this.sourcePortfolioId = sourcePortfolioId; + super.sourcePortfolioId(sourcePortfolioId); return this; } + @Override public Builder productId(String productId) { - this.productId = productId; + super.productId(productId); return this; } + @Override public Builder orderIds(String[] orderIds) { - this.orderIds = orderIds; + super.orderIds(orderIds); return this; } + @Override public Builder allocationLegs(AllocationLeg[] allocationLegs) { - this.allocationLegs = allocationLegs; + super.allocationLegs(allocationLegs); return this; } + @Override public Builder sizeType(AllocationSizeType sizeType) { - this.sizeType = sizeType; + super.sizeType(sizeType); return this; } + @Override public Builder remainderDestinationPortfolio(String remainderDestinationPortfolio) { - this.remainderDestinationPortfolio = remainderDestinationPortfolio; + super.remainderDestinationPortfolio(remainderDestinationPortfolio); return this; } + @Override public Builder nettingId(String nettingId) { - this.nettingId = nettingId; + super.nettingId(nettingId); return this; } + @Override public CreateNetAllocationRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new CreateNetAllocationRequest(this); } - - private void validate() throws CoinbaseClientException {} } } diff --git a/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationResponse.java b/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationResponse.java index 542d2a1a..eb44c4d6 100644 --- a/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationResponse.java +++ b/src/main/java/com/coinbase/prime/allocations/CreateNetAllocationResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.allocations; -import com.coinbase.prime.model.CreateNetAllocationResponseBody; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Portfolio Net Allocations */ -public class CreateNetAllocationResponse { - @JsonProperty("body") - private CreateNetAllocationResponseBody body; - +/** + * Create Portfolio Net Allocations + * + * @deprecated Use createPortfolioNetAllocations instead. + */ +@Deprecated +public class CreateNetAllocationResponse extends CreatePortfolioNetAllocationsResponse { public CreateNetAllocationResponse() {} - - public CreateNetAllocationResponseBody getBody() { - return body; - } - - public void setBody(CreateNetAllocationResponseBody body) { - this.body = body; - } } diff --git a/src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsRequest.java b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsRequest.java new file mode 100644 index 00000000..d49f413e --- /dev/null +++ b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsRequest.java @@ -0,0 +1,174 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.allocations; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.AllocationLeg; +import com.coinbase.prime.model.enums.AllocationSizeType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Portfolio Allocations */ +public class CreatePortfolioAllocationsRequest { + /** The ID of the allocation */ + @JsonProperty("allocation_id") + private String allocationId; + + /** The source portfolio id for the allocation */ + @JsonProperty("source_portfolio_id") + private String sourcePortfolioId; + + /** The product for the allocation */ + @JsonProperty("product_id") + private String productId; + + /** The list of order ids in the allocation */ + @JsonProperty("order_ids") + private String[] orderIds; + + /** The list of allocation_legs for the allocation */ + @JsonProperty("allocation_legs") + private AllocationLeg[] allocationLegs; + + @JsonProperty("size_type") + private AllocationSizeType sizeType; + + /** The portfolio where to allocate the remainder of the size */ + @JsonProperty("remainder_destination_portfolio") + private String remainderDestinationPortfolio; + + public CreatePortfolioAllocationsRequest() {} + + public CreatePortfolioAllocationsRequest(Builder builder) { + this.allocationId = builder.allocationId; + this.sourcePortfolioId = builder.sourcePortfolioId; + this.productId = builder.productId; + this.orderIds = builder.orderIds; + this.allocationLegs = builder.allocationLegs; + this.sizeType = builder.sizeType; + this.remainderDestinationPortfolio = builder.remainderDestinationPortfolio; + } + + public String getAllocationId() { + return allocationId; + } + + public void setAllocationId(String allocationId) { + this.allocationId = allocationId; + } + + public String getSourcePortfolioId() { + return sourcePortfolioId; + } + + public void setSourcePortfolioId(String sourcePortfolioId) { + this.sourcePortfolioId = sourcePortfolioId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String[] getOrderIds() { + return orderIds; + } + + public void setOrderIds(String[] orderIds) { + this.orderIds = orderIds; + } + + public AllocationLeg[] getAllocationLegs() { + return allocationLegs; + } + + public void setAllocationLegs(AllocationLeg[] allocationLegs) { + this.allocationLegs = allocationLegs; + } + + public AllocationSizeType getSizeType() { + return sizeType; + } + + public void setSizeType(AllocationSizeType sizeType) { + this.sizeType = sizeType; + } + + public String getRemainderDestinationPortfolio() { + return remainderDestinationPortfolio; + } + + public void setRemainderDestinationPortfolio(String remainderDestinationPortfolio) { + this.remainderDestinationPortfolio = remainderDestinationPortfolio; + } + + public static class Builder { + private String allocationId; + private String sourcePortfolioId; + private String productId; + private String[] orderIds; + private AllocationLeg[] allocationLegs; + private AllocationSizeType sizeType; + private String remainderDestinationPortfolio; + + public Builder() {} + + public Builder allocationId(String allocationId) { + this.allocationId = allocationId; + return this; + } + + public Builder sourcePortfolioId(String sourcePortfolioId) { + this.sourcePortfolioId = sourcePortfolioId; + return this; + } + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder orderIds(String[] orderIds) { + this.orderIds = orderIds; + return this; + } + + public Builder allocationLegs(AllocationLeg[] allocationLegs) { + this.allocationLegs = allocationLegs; + return this; + } + + public Builder sizeType(AllocationSizeType sizeType) { + this.sizeType = sizeType; + return this; + } + + public Builder remainderDestinationPortfolio(String remainderDestinationPortfolio) { + this.remainderDestinationPortfolio = remainderDestinationPortfolio; + return this; + } + + public CreatePortfolioAllocationsRequest build() throws CoinbaseClientException { + validate(); + return new CreatePortfolioAllocationsRequest(this); + } + + protected void validate() throws CoinbaseClientException {} + } +} diff --git a/src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsResponse.java b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsResponse.java new file mode 100644 index 00000000..6bfe0d11 --- /dev/null +++ b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioAllocationsResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.allocations; + +import com.coinbase.prime.model.CreateAllocationResponseBody; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Portfolio Allocations */ +public class CreatePortfolioAllocationsResponse { + @JsonProperty("body") + private CreateAllocationResponseBody body; + + public CreatePortfolioAllocationsResponse() {} + + public CreateAllocationResponseBody getBody() { + return body; + } + + public void setBody(CreateAllocationResponseBody body) { + this.body = body; + } +} diff --git a/src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsRequest.java b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsRequest.java new file mode 100644 index 00000000..9bdfd862 --- /dev/null +++ b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsRequest.java @@ -0,0 +1,168 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.allocations; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.AllocationLeg; +import com.coinbase.prime.model.enums.AllocationSizeType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Portfolio Net Allocations */ +public class CreatePortfolioNetAllocationsRequest { + @JsonProperty("source_portfolio_id") + private String sourcePortfolioId; + + @JsonProperty("product_id") + private String productId; + + @JsonProperty("order_ids") + private String[] orderIds; + + @JsonProperty("allocation_legs") + private AllocationLeg[] allocationLegs; + + @JsonProperty("size_type") + private AllocationSizeType sizeType; + + @JsonProperty("remainder_destination_portfolio") + private String remainderDestinationPortfolio; + + @JsonProperty("netting_id") + private String nettingId; + + public CreatePortfolioNetAllocationsRequest() {} + + public CreatePortfolioNetAllocationsRequest(Builder builder) { + this.sourcePortfolioId = builder.sourcePortfolioId; + this.productId = builder.productId; + this.orderIds = builder.orderIds; + this.allocationLegs = builder.allocationLegs; + this.sizeType = builder.sizeType; + this.remainderDestinationPortfolio = builder.remainderDestinationPortfolio; + this.nettingId = builder.nettingId; + } + + public String getSourcePortfolioId() { + return sourcePortfolioId; + } + + public void setSourcePortfolioId(String sourcePortfolioId) { + this.sourcePortfolioId = sourcePortfolioId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String[] getOrderIds() { + return orderIds; + } + + public void setOrderIds(String[] orderIds) { + this.orderIds = orderIds; + } + + public AllocationLeg[] getAllocationLegs() { + return allocationLegs; + } + + public void setAllocationLegs(AllocationLeg[] allocationLegs) { + this.allocationLegs = allocationLegs; + } + + public AllocationSizeType getSizeType() { + return sizeType; + } + + public void setSizeType(AllocationSizeType sizeType) { + this.sizeType = sizeType; + } + + public String getRemainderDestinationPortfolio() { + return remainderDestinationPortfolio; + } + + public void setRemainderDestinationPortfolio(String remainderDestinationPortfolio) { + this.remainderDestinationPortfolio = remainderDestinationPortfolio; + } + + public String getNettingId() { + return nettingId; + } + + public void setNettingId(String nettingId) { + this.nettingId = nettingId; + } + + public static class Builder { + private String sourcePortfolioId; + private String productId; + private String[] orderIds; + private AllocationLeg[] allocationLegs; + private AllocationSizeType sizeType; + private String remainderDestinationPortfolio; + private String nettingId; + + public Builder() {} + + public Builder sourcePortfolioId(String sourcePortfolioId) { + this.sourcePortfolioId = sourcePortfolioId; + return this; + } + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder orderIds(String[] orderIds) { + this.orderIds = orderIds; + return this; + } + + public Builder allocationLegs(AllocationLeg[] allocationLegs) { + this.allocationLegs = allocationLegs; + return this; + } + + public Builder sizeType(AllocationSizeType sizeType) { + this.sizeType = sizeType; + return this; + } + + public Builder remainderDestinationPortfolio(String remainderDestinationPortfolio) { + this.remainderDestinationPortfolio = remainderDestinationPortfolio; + return this; + } + + public Builder nettingId(String nettingId) { + this.nettingId = nettingId; + return this; + } + + public CreatePortfolioNetAllocationsRequest build() throws CoinbaseClientException { + validate(); + return new CreatePortfolioNetAllocationsRequest(this); + } + + protected void validate() throws CoinbaseClientException {} + } +} diff --git a/src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsResponse.java b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsResponse.java new file mode 100644 index 00000000..b2f72019 --- /dev/null +++ b/src/main/java/com/coinbase/prime/allocations/CreatePortfolioNetAllocationsResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.allocations; + +import com.coinbase.prime.model.CreateNetAllocationResponseBody; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Portfolio Net Allocations */ +public class CreatePortfolioNetAllocationsResponse { + @JsonProperty("body") + private CreateNetAllocationResponseBody body; + + public CreatePortfolioNetAllocationsResponse() {} + + public CreateNetAllocationResponseBody getBody() { + return body; + } + + public void setBody(CreateNetAllocationResponseBody body) { + this.body = body; + } +} diff --git a/src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdRequest.java b/src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdRequest.java new file mode 100644 index 00000000..235b5921 --- /dev/null +++ b/src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdRequest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.allocations; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Net Allocations by Netting ID */ +public class GetAllocationsByClientNettingIdRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "netting_id") + @JsonIgnore + private String nettingId; + + public GetAllocationsByClientNettingIdRequest() {} + + public GetAllocationsByClientNettingIdRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.nettingId = builder.nettingId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getNettingId() { + return nettingId; + } + + public void setNettingId(String nettingId) { + this.nettingId = nettingId; + } + + public static class Builder { + private String portfolioId; + private String nettingId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder nettingId(String nettingId) { + this.nettingId = nettingId; + return this; + } + + public GetAllocationsByClientNettingIdRequest build() throws CoinbaseClientException { + validate(); + return new GetAllocationsByClientNettingIdRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.nettingId)) { + throw new CoinbaseClientException("NettingId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdResponse.java b/src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdResponse.java new file mode 100644 index 00000000..6bd82132 --- /dev/null +++ b/src/main/java/com/coinbase/prime/allocations/GetAllocationsByClientNettingIdResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.allocations; + +import com.coinbase.prime.model.Allocation; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Net Allocations by Netting ID */ +public class GetAllocationsByClientNettingIdResponse { + @JsonProperty("allocations") + private Allocation[] allocations; + + public GetAllocationsByClientNettingIdResponse() {} + + public Allocation[] getAllocations() { + return allocations; + } + + public void setAllocations(Allocation[] allocations) { + this.allocations = allocations; + } +} diff --git a/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdRequest.java b/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdRequest.java index 2375ae01..a704fc48 100644 --- a/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdRequest.java +++ b/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdRequest.java @@ -16,73 +16,42 @@ package com.coinbase.prime.allocations; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Net Allocations by Netting ID */ -public class ListAllocationsByNettingIdRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty(required = true, value = "netting_id") - @JsonIgnore - private String nettingId; +/** + * Get Net Allocations by Netting ID + * + * @deprecated Use getAllocationsByClientNettingId instead. + */ +@Deprecated +public class ListAllocationsByNettingIdRequest extends GetAllocationsByClientNettingIdRequest { public ListAllocationsByNettingIdRequest() {} - public ListAllocationsByNettingIdRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.nettingId = builder.nettingId; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; + public ListAllocationsByNettingIdRequest(GetAllocationsByClientNettingIdRequest.Builder builder) { + super(builder); } - public String getNettingId() { - return nettingId; - } - - public void setNettingId(String nettingId) { - this.nettingId = nettingId; - } - - public static class Builder { - private String portfolioId; - private String nettingId; - - public Builder() {} - + /** + * @deprecated Use getAllocationsByClientNettingId instead. + */ + @Deprecated + public static class Builder extends GetAllocationsByClientNettingIdRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder nettingId(String nettingId) { - this.nettingId = nettingId; + super.nettingId(nettingId); return this; } + @Override public ListAllocationsByNettingIdRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListAllocationsByNettingIdRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - if (isNullOrEmpty(this.nettingId)) { - throw new CoinbaseClientException("NettingId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdResponse.java b/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdResponse.java index 1f17c582..b56ef03b 100644 --- a/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdResponse.java +++ b/src/main/java/com/coinbase/prime/allocations/ListAllocationsByNettingIdResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.allocations; -import com.coinbase.prime.model.Allocation; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Net Allocations by Netting ID */ -public class ListAllocationsByNettingIdResponse { - @JsonProperty("allocations") - private Allocation[] allocations; - +/** + * Get Net Allocations by Netting ID + * + * @deprecated Use getAllocationsByClientNettingId instead. + */ +@Deprecated +public class ListAllocationsByNettingIdResponse extends GetAllocationsByClientNettingIdResponse { public ListAllocationsByNettingIdResponse() {} - - public Allocation[] getAllocations() { - return allocations; - } - - public void setAllocations(Allocation[] allocations) { - this.allocations = allocations; - } } diff --git a/src/main/java/com/coinbase/prime/factory/PrimeServiceFactory.java b/src/main/java/com/coinbase/prime/factory/PrimeServiceFactory.java index bd36b279..cafc6416 100644 --- a/src/main/java/com/coinbase/prime/factory/PrimeServiceFactory.java +++ b/src/main/java/com/coinbase/prime/factory/PrimeServiceFactory.java @@ -59,6 +59,8 @@ import com.coinbase.prime.users.UsersServiceImpl; import com.coinbase.prime.wallets.WalletsService; import com.coinbase.prime.wallets.WalletsServiceImpl; +import com.coinbase.prime.webhooks.WebhooksService; +import com.coinbase.prime.webhooks.WebhooksServiceImpl; public class PrimeServiceFactory { public static ActivitiesService createActivitiesService(CoinbasePrimeClient client) { @@ -145,4 +147,8 @@ public static UsersService createUsersService(CoinbasePrimeClient client) { public static WalletsService createWalletsService(CoinbasePrimeClient client) { return new WalletsServiceImpl(client); } + + public static WebhooksService createWebhooksService(CoinbasePrimeClient client) { + return new WebhooksServiceImpl(client); + } } diff --git a/src/main/java/com/coinbase/prime/financing/FinancingService.java b/src/main/java/com/coinbase/prime/financing/FinancingService.java index 4a3a212d..32f55a8a 100644 --- a/src/main/java/com/coinbase/prime/financing/FinancingService.java +++ b/src/main/java/com/coinbase/prime/financing/FinancingService.java @@ -111,6 +111,22 @@ ListTradeFinanceObligationsResponse listTradeFinanceObligations( * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetTieredPricingFeesResponse getTieredPricingFees(GetTieredPricingFeesRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Trade Finance Tiered Pricing Fees. + * + *

Get trade finance tiered pricing fees for a given entity at a specific time, default to + * current time + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getTieredPricingFees instead. + */ + @Deprecated GetTradeFinanceTieredPricingFeesResponse getTradeFinanceTieredPricingFees( GetTradeFinanceTieredPricingFeesRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -137,6 +153,22 @@ ListFinancingEligibleAssetsResponse listFinancingEligibleAssets() * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + ListPortfolioInterestAccrualsResponse listPortfolioInterestAccruals( + ListPortfolioInterestAccrualsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Interest Accruals For Portfolio. + * + *

Lists interest accruals between the specified date range for a specific portfolio ID + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use listPortfolioInterestAccruals instead. + */ + @Deprecated ListInterestAccrualsForPortfolioResponse listInterestAccrualsForPortfolio( ListInterestAccrualsForPortfolioRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -167,6 +199,21 @@ GetPortfolioBuyingPowerResponse getPortfolioBuyingPower(GetPortfolioBuyingPowerR * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetPortfolioCreditResponse getPortfolioCredit(GetPortfolioCreditRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Portfolio Credit Information. + * + *

Retrieve a portfolio's post-trade credit information + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getPortfolioCredit instead. + */ + @Deprecated GetPortfolioCreditInformationResponse getPortfolioCreditInformation( GetPortfolioCreditInformationRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -235,6 +282,19 @@ GetPortfolioWithdrawalPowerResponse getPortfolioWithdrawalPower( * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + SetFundingSettingsResponse setFundingSettings(SetFundingSettingsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Update Funding Settings. + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use setFundingSettings instead. + */ + @Deprecated UpdateFundingSettingsResponse updateFundingSettings(UpdateFundingSettingsRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/financing/FinancingServiceImpl.java b/src/main/java/com/coinbase/prime/financing/FinancingServiceImpl.java index cf6900b8..6f7ee119 100644 --- a/src/main/java/com/coinbase/prime/financing/FinancingServiceImpl.java +++ b/src/main/java/com/coinbase/prime/financing/FinancingServiceImpl.java @@ -98,6 +98,18 @@ public ListTradeFinanceObligationsResponse listTradeFinanceObligations( new TypeReference() {}); } + @Override + public GetTieredPricingFeesResponse getTieredPricingFees(GetTieredPricingFeesRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/entities/%s/tf_tiered_fees", request.getEntityId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetTradeFinanceTieredPricingFeesResponse getTradeFinanceTieredPricingFees( GetTradeFinanceTieredPricingFeesRequest request) throws CoinbasePrimeException { @@ -120,6 +132,18 @@ public ListFinancingEligibleAssetsResponse listFinancingEligibleAssets() new TypeReference() {}); } + @Override + public ListPortfolioInterestAccrualsResponse listPortfolioInterestAccruals( + ListPortfolioInterestAccrualsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/accruals", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListInterestAccrualsForPortfolioResponse listInterestAccrualsForPortfolio( ListInterestAccrualsForPortfolioRequest request) throws CoinbasePrimeException { @@ -142,6 +166,18 @@ public GetPortfolioBuyingPowerResponse getPortfolioBuyingPower( new TypeReference() {}); } + @Override + public GetPortfolioCreditResponse getPortfolioCredit(GetPortfolioCreditRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/credit", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetPortfolioCreditInformationResponse getPortfolioCreditInformation( GetPortfolioCreditInformationRequest request) throws CoinbasePrimeException { @@ -171,7 +207,7 @@ public CreateNewLocatesResponse createNewLocates(CreateNewLocatesRequest request HttpMethod.POST, String.format("/portfolios/%s/locates", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -197,6 +233,18 @@ public GetPortfolioWithdrawalPowerResponse getPortfolioWithdrawalPower( new TypeReference() {}); } + @Override + public SetFundingSettingsResponse setFundingSettings(SetFundingSettingsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format("/entities/%s/funding_settings", request.getEntityId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public UpdateFundingSettingsResponse updateFundingSettings(UpdateFundingSettingsRequest request) throws CoinbasePrimeException { @@ -219,22 +267,17 @@ public GetCrossMarginRiskParametersResponse getCrossMarginRiskParameters( new TypeReference() {}); } - /** - * This endpoint is served from {@code /v2}; we swap the version on the base URL for this call - * only without mutating the shared client (same pattern as prime-sdk-go {@code - * WithBaseUrl}/{@code VersionedBaseUrl}). - */ @Override public GetCrossMarginPrimeOverviewResponse getCrossMarginPrimeOverview( GetCrossMarginPrimeOverviewRequest request) throws CoinbasePrimeException { - CoinbasePrimeClient v2Client = - primeClient.withBaseUrl(Constants.versionedBaseUrl(Constants.CB_PRIME_BASE_URL, "v2")); - return new CoinbaseServiceImpl(v2Client) {}.request( - HttpMethod.GET, - String.format("/entities/%s/cross_margin/prime", request.getEntityId()), - request, - List.of(200), - new TypeReference() {}); + return this.primeClient + .withBaseUrl(Constants.versionedBaseUrl(this.primeClient.getBaseUrl(), "v2")) + .sendRequest( + HttpMethod.GET, + String.format("/entities/%s/cross_margin/prime", request.getEntityId()), + List.of(200), + request, + new TypeReference() {}); } @Override diff --git a/src/main/java/com/coinbase/prime/financing/GetEntityRewardsRateResponse.java b/src/main/java/com/coinbase/prime/financing/GetEntityRewardsRateResponse.java index 36b1080b..99bdef43 100644 --- a/src/main/java/com/coinbase/prime/financing/GetEntityRewardsRateResponse.java +++ b/src/main/java/com/coinbase/prime/financing/GetEntityRewardsRateResponse.java @@ -16,7 +16,7 @@ package com.coinbase.prime.financing; -import com.coinbase.prime.model.BetaRewardsRateTier; +import com.coinbase.prime.model.RewardsRateTier; import com.fasterxml.jackson.annotation.JsonProperty; /** Get Entity Rewards Rate (Beta) */ @@ -25,7 +25,7 @@ public class GetEntityRewardsRateResponse { private String currentRate; @JsonProperty("available_rates") - private BetaRewardsRateTier[] availableRates; + private RewardsRateTier[] availableRates; public GetEntityRewardsRateResponse() {} @@ -37,11 +37,11 @@ public void setCurrentRate(String currentRate) { this.currentRate = currentRate; } - public BetaRewardsRateTier[] getAvailableRates() { + public RewardsRateTier[] getAvailableRates() { return availableRates; } - public void setAvailableRates(BetaRewardsRateTier[] availableRates) { + public void setAvailableRates(RewardsRateTier[] availableRates) { this.availableRates = availableRates; } } diff --git a/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationRequest.java b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationRequest.java index 73ee3e2f..699b42e1 100644 --- a/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationRequest.java +++ b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationRequest.java @@ -16,51 +16,36 @@ package com.coinbase.prime.financing; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Portfolio Credit Information */ -public class GetPortfolioCreditInformationRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; +/** + * Get Portfolio Credit Information + * + * @deprecated Use getPortfolioCredit instead. + */ +@Deprecated +public class GetPortfolioCreditInformationRequest extends GetPortfolioCreditRequest { public GetPortfolioCreditInformationRequest() {} - public GetPortfolioCreditInformationRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - } - - public String getPortfolioId() { - return portfolioId; + public GetPortfolioCreditInformationRequest(GetPortfolioCreditRequest.Builder builder) { + super(builder); } - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public static class Builder { - private String portfolioId; - - public Builder() {} - + /** + * @deprecated Use getPortfolioCredit instead. + */ + @Deprecated + public static class Builder extends GetPortfolioCreditRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public GetPortfolioCreditInformationRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetPortfolioCreditInformationRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationResponse.java b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationResponse.java index 8f0fc1a6..69e4f7e8 100644 --- a/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationResponse.java +++ b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditInformationResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.financing; -import com.coinbase.prime.model.PostTradeCreditInformation; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Portfolio Credit Information */ -public class GetPortfolioCreditInformationResponse { - @JsonProperty("post_trade_credit") - private PostTradeCreditInformation postTradeCredit; - +/** + * Get Portfolio Credit Information + * + * @deprecated Use getPortfolioCredit instead. + */ +@Deprecated +public class GetPortfolioCreditInformationResponse extends GetPortfolioCreditResponse { public GetPortfolioCreditInformationResponse() {} - - public PostTradeCreditInformation getPostTradeCredit() { - return postTradeCredit; - } - - public void setPostTradeCredit(PostTradeCreditInformation postTradeCredit) { - this.postTradeCredit = postTradeCredit; - } } diff --git a/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditRequest.java b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditRequest.java new file mode 100644 index 00000000..4555d838 --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditRequest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Portfolio Credit Information */ +public class GetPortfolioCreditRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + public GetPortfolioCreditRequest() {} + + public GetPortfolioCreditRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public static class Builder { + private String portfolioId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public GetPortfolioCreditRequest build() throws CoinbaseClientException { + validate(); + return new GetPortfolioCreditRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditResponse.java b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditResponse.java new file mode 100644 index 00000000..1ef7049b --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/GetPortfolioCreditResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import com.coinbase.prime.model.PostTradeCreditInformation; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Portfolio Credit Information */ +public class GetPortfolioCreditResponse { + @JsonProperty("post_trade_credit") + private PostTradeCreditInformation postTradeCredit; + + public GetPortfolioCreditResponse() {} + + public PostTradeCreditInformation getPostTradeCredit() { + return postTradeCredit; + } + + public void setPostTradeCredit(PostTradeCreditInformation postTradeCredit) { + this.postTradeCredit = postTradeCredit; + } +} diff --git a/src/main/java/com/coinbase/prime/financing/GetPortfolioRewardsRateResponse.java b/src/main/java/com/coinbase/prime/financing/GetPortfolioRewardsRateResponse.java index 50fe3a38..ee9ca05b 100644 --- a/src/main/java/com/coinbase/prime/financing/GetPortfolioRewardsRateResponse.java +++ b/src/main/java/com/coinbase/prime/financing/GetPortfolioRewardsRateResponse.java @@ -16,7 +16,7 @@ package com.coinbase.prime.financing; -import com.coinbase.prime.model.BetaRewardsRateTier; +import com.coinbase.prime.model.RewardsRateTier; import com.fasterxml.jackson.annotation.JsonProperty; /** Get Portfolio Rewards Rate (Beta) */ @@ -25,7 +25,7 @@ public class GetPortfolioRewardsRateResponse { private String currentRate; @JsonProperty("available_rates") - private BetaRewardsRateTier[] availableRates; + private RewardsRateTier[] availableRates; public GetPortfolioRewardsRateResponse() {} @@ -37,11 +37,11 @@ public void setCurrentRate(String currentRate) { this.currentRate = currentRate; } - public BetaRewardsRateTier[] getAvailableRates() { + public RewardsRateTier[] getAvailableRates() { return availableRates; } - public void setAvailableRates(BetaRewardsRateTier[] availableRates) { + public void setAvailableRates(RewardsRateTier[] availableRates) { this.availableRates = availableRates; } } diff --git a/src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesRequest.java b/src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesRequest.java new file mode 100644 index 00000000..ce7cd62b --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesRequest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Trade Finance Tiered Pricing Fees */ +public class GetTieredPricingFeesRequest { + @JsonProperty(required = true, value = "entity_id") + @JsonIgnore + private String entityId; + + @JsonProperty("effective_at") + private String effectiveAt; + + public GetTieredPricingFeesRequest() {} + + public GetTieredPricingFeesRequest(Builder builder) { + this.entityId = builder.entityId; + this.effectiveAt = builder.effectiveAt; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public String getEffectiveAt() { + return effectiveAt; + } + + public void setEffectiveAt(String effectiveAt) { + this.effectiveAt = effectiveAt; + } + + public static class Builder { + private String entityId; + private String effectiveAt; + + public Builder() {} + + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + public Builder effectiveAt(String effectiveAt) { + this.effectiveAt = effectiveAt; + return this; + } + + public GetTieredPricingFeesRequest build() throws CoinbaseClientException { + validate(); + return new GetTieredPricingFeesRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.entityId)) { + throw new CoinbaseClientException("EntityId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesResponse.java b/src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesResponse.java new file mode 100644 index 00000000..000ccc3e --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/GetTieredPricingFeesResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import com.coinbase.prime.model.TieredPricingFee; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Trade Finance Tiered Pricing Fees */ +public class GetTieredPricingFeesResponse { + @JsonProperty("fees") + private TieredPricingFee[] fees; + + public GetTieredPricingFeesResponse() {} + + public TieredPricingFee[] getFees() { + return fees; + } + + public void setFees(TieredPricingFee[] fees) { + this.fees = fees; + } +} diff --git a/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesRequest.java b/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesRequest.java index da9fe8dc..0372bea6 100644 --- a/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesRequest.java +++ b/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesRequest.java @@ -16,69 +16,42 @@ package com.coinbase.prime.financing; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Trade Finance Tiered Pricing Fees */ -public class GetTradeFinanceTieredPricingFeesRequest { - @JsonProperty(required = true, value = "entity_id") - @JsonIgnore - private String entityId; - - @JsonProperty("effective_at") - private String effectiveAt; +/** + * Get Trade Finance Tiered Pricing Fees + * + * @deprecated Use getTieredPricingFees instead. + */ +@Deprecated +public class GetTradeFinanceTieredPricingFeesRequest extends GetTieredPricingFeesRequest { public GetTradeFinanceTieredPricingFeesRequest() {} - public GetTradeFinanceTieredPricingFeesRequest(Builder builder) { - this.entityId = builder.entityId; - this.effectiveAt = builder.effectiveAt; - } - - public String getEntityId() { - return entityId; - } - - public void setEntityId(String entityId) { - this.entityId = entityId; + public GetTradeFinanceTieredPricingFeesRequest(GetTieredPricingFeesRequest.Builder builder) { + super(builder); } - public String getEffectiveAt() { - return effectiveAt; - } - - public void setEffectiveAt(String effectiveAt) { - this.effectiveAt = effectiveAt; - } - - public static class Builder { - private String entityId; - private String effectiveAt; - - public Builder() {} - + /** + * @deprecated Use getTieredPricingFees instead. + */ + @Deprecated + public static class Builder extends GetTieredPricingFeesRequest.Builder { + @Override public Builder entityId(String entityId) { - this.entityId = entityId; + super.entityId(entityId); return this; } + @Override public Builder effectiveAt(String effectiveAt) { - this.effectiveAt = effectiveAt; + super.effectiveAt(effectiveAt); return this; } + @Override public GetTradeFinanceTieredPricingFeesRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetTradeFinanceTieredPricingFeesRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.entityId)) { - throw new CoinbaseClientException("EntityId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesResponse.java b/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesResponse.java index a377c5f2..5fa98998 100644 --- a/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesResponse.java +++ b/src/main/java/com/coinbase/prime/financing/GetTradeFinanceTieredPricingFeesResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.financing; -import com.coinbase.prime.model.TieredPricingFee; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Trade Finance Tiered Pricing Fees */ -public class GetTradeFinanceTieredPricingFeesResponse { - @JsonProperty("fees") - private TieredPricingFee[] fees; - +/** + * Get Trade Finance Tiered Pricing Fees + * + * @deprecated Use getTieredPricingFees instead. + */ +@Deprecated +public class GetTradeFinanceTieredPricingFeesResponse extends GetTieredPricingFeesResponse { public GetTradeFinanceTieredPricingFeesResponse() {} - - public TieredPricingFee[] getFees() { - return fees; - } - - public void setFees(TieredPricingFee[] fees) { - this.fees = fees; - } } diff --git a/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioRequest.java b/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioRequest.java index cda99b06..062ac97a 100644 --- a/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioRequest.java +++ b/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioRequest.java @@ -16,87 +16,49 @@ package com.coinbase.prime.financing; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Interest Accruals For Portfolio */ -public class ListInterestAccrualsForPortfolioRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty("start_date") - private String startDate; - - @JsonProperty("end_date") - private String endDate; +/** + * List Interest Accruals For Portfolio + * + * @deprecated Use listPortfolioInterestAccruals instead. + */ +@Deprecated +public class ListInterestAccrualsForPortfolioRequest extends ListPortfolioInterestAccrualsRequest { public ListInterestAccrualsForPortfolioRequest() {} - public ListInterestAccrualsForPortfolioRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.startDate = builder.startDate; - this.endDate = builder.endDate; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getStartDate() { - return startDate; - } - - public void setStartDate(String startDate) { - this.startDate = startDate; + public ListInterestAccrualsForPortfolioRequest( + ListPortfolioInterestAccrualsRequest.Builder builder) { + super(builder); } - public String getEndDate() { - return endDate; - } - - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - public static class Builder { - private String portfolioId; - private String startDate; - private String endDate; - - public Builder() {} - + /** + * @deprecated Use listPortfolioInterestAccruals instead. + */ + @Deprecated + public static class Builder extends ListPortfolioInterestAccrualsRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder startDate(String startDate) { - this.startDate = startDate; + super.startDate(startDate); return this; } + @Override public Builder endDate(String endDate) { - this.endDate = endDate; + super.endDate(endDate); return this; } + @Override public ListInterestAccrualsForPortfolioRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListInterestAccrualsForPortfolioRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioResponse.java b/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioResponse.java index bde5750d..65b21ece 100644 --- a/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioResponse.java +++ b/src/main/java/com/coinbase/prime/financing/ListInterestAccrualsForPortfolioResponse.java @@ -16,32 +16,13 @@ package com.coinbase.prime.financing; -import com.coinbase.prime.model.Accrual; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Interest Accruals For Portfolio */ -public class ListInterestAccrualsForPortfolioResponse { - @JsonProperty("total_notional_accrual") - private String totalNotionalAccrual; - - @JsonProperty("accruals") - private Accrual[] accruals; - +/** + * List Interest Accruals For Portfolio + * + * @deprecated Use listPortfolioInterestAccruals instead. + */ +@Deprecated +public class ListInterestAccrualsForPortfolioResponse + extends ListPortfolioInterestAccrualsResponse { public ListInterestAccrualsForPortfolioResponse() {} - - public String getTotalNotionalAccrual() { - return totalNotionalAccrual; - } - - public void setTotalNotionalAccrual(String totalNotionalAccrual) { - this.totalNotionalAccrual = totalNotionalAccrual; - } - - public Accrual[] getAccruals() { - return accruals; - } - - public void setAccruals(Accrual[] accruals) { - this.accruals = accruals; - } } diff --git a/src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsRequest.java b/src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsRequest.java new file mode 100644 index 00000000..c779983d --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsRequest.java @@ -0,0 +1,102 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Interest Accruals For Portfolio */ +public class ListPortfolioInterestAccrualsRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("start_date") + private String startDate; + + @JsonProperty("end_date") + private String endDate; + + public ListPortfolioInterestAccrualsRequest() {} + + public ListPortfolioInterestAccrualsRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.startDate = builder.startDate; + this.endDate = builder.endDate; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public static class Builder { + private String portfolioId; + private String startDate; + private String endDate; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + public ListPortfolioInterestAccrualsRequest build() throws CoinbaseClientException { + validate(); + return new ListPortfolioInterestAccrualsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsResponse.java b/src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsResponse.java new file mode 100644 index 00000000..1922cfa1 --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/ListPortfolioInterestAccrualsResponse.java @@ -0,0 +1,47 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import com.coinbase.prime.model.Accrual; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Interest Accruals For Portfolio */ +public class ListPortfolioInterestAccrualsResponse { + @JsonProperty("total_notional_accrual") + private String totalNotionalAccrual; + + @JsonProperty("accruals") + private Accrual[] accruals; + + public ListPortfolioInterestAccrualsResponse() {} + + public String getTotalNotionalAccrual() { + return totalNotionalAccrual; + } + + public void setTotalNotionalAccrual(String totalNotionalAccrual) { + this.totalNotionalAccrual = totalNotionalAccrual; + } + + public Accrual[] getAccruals() { + return accruals; + } + + public void setAccruals(Accrual[] accruals) { + this.accruals = accruals; + } +} diff --git a/src/main/java/com/coinbase/prime/financing/SetFundingSettingsRequest.java b/src/main/java/com/coinbase/prime/financing/SetFundingSettingsRequest.java new file mode 100644 index 00000000..0eeb0f0c --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/SetFundingSettingsRequest.java @@ -0,0 +1,178 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update Funding Settings */ +public class SetFundingSettingsRequest { + /** Prime Entity ID */ + @JsonProperty(required = true, value = "entity_id") + @JsonIgnore + private String entityId; + + /** + * Set the Derivatives Funding Portfolio that will be used to fund FCM margin calls and receive + * excess margin sweeps. Only one portfolio per entity. + */ + @JsonProperty("designated_funding_portfolio_id") + private String designatedFundingPortfolioId; + + /** + * When true, USDC in your Derivatives Funding Portfolio will be converted to USD to meet FCM + * margin calls (Auto-Convert USDC). + */ + @JsonProperty("automatic_conversion_enabled") + private Boolean automaticConversionEnabled; + + /** + * When true, Coinbase affiliates may initiate loans on your behalf to meet FCM margin calls, per + * your Lending agreement. Available to Portfolio Margin or Cross Margin clients only. + * (Auto-Initiate Loans) + */ + @JsonProperty("automatic_loan_enabled") + private Boolean automaticLoanEnabled; + + /** + * When true, any FCM account balance above your margin requirements will be automatically swept + * back to your Derivatives funding portfolio. (Auto-Return Excess Margin) + */ + @JsonProperty("automatic_excess_return_enabled") + private Boolean automaticExcessReturnEnabled; + + /** + * Weekend Buying Power: Setting a target amount to maintain in your Futures account above margin + * requirements. You can only withdraw funds in excess of this amount. + */ + @JsonProperty("excess_funds_target_amount") + private String excessFundsTargetAmount; + + public SetFundingSettingsRequest() {} + + public SetFundingSettingsRequest(Builder builder) { + this.entityId = builder.entityId; + this.designatedFundingPortfolioId = builder.designatedFundingPortfolioId; + this.automaticConversionEnabled = builder.automaticConversionEnabled; + this.automaticLoanEnabled = builder.automaticLoanEnabled; + this.automaticExcessReturnEnabled = builder.automaticExcessReturnEnabled; + this.excessFundsTargetAmount = builder.excessFundsTargetAmount; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public String getDesignatedFundingPortfolioId() { + return designatedFundingPortfolioId; + } + + public void setDesignatedFundingPortfolioId(String designatedFundingPortfolioId) { + this.designatedFundingPortfolioId = designatedFundingPortfolioId; + } + + public Boolean getAutomaticConversionEnabled() { + return automaticConversionEnabled; + } + + public void setAutomaticConversionEnabled(Boolean automaticConversionEnabled) { + this.automaticConversionEnabled = automaticConversionEnabled; + } + + public Boolean getAutomaticLoanEnabled() { + return automaticLoanEnabled; + } + + public void setAutomaticLoanEnabled(Boolean automaticLoanEnabled) { + this.automaticLoanEnabled = automaticLoanEnabled; + } + + public Boolean getAutomaticExcessReturnEnabled() { + return automaticExcessReturnEnabled; + } + + public void setAutomaticExcessReturnEnabled(Boolean automaticExcessReturnEnabled) { + this.automaticExcessReturnEnabled = automaticExcessReturnEnabled; + } + + public String getExcessFundsTargetAmount() { + return excessFundsTargetAmount; + } + + public void setExcessFundsTargetAmount(String excessFundsTargetAmount) { + this.excessFundsTargetAmount = excessFundsTargetAmount; + } + + public static class Builder { + private String entityId; + private String designatedFundingPortfolioId; + private Boolean automaticConversionEnabled; + private Boolean automaticLoanEnabled; + private Boolean automaticExcessReturnEnabled; + private String excessFundsTargetAmount; + + public Builder() {} + + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + public Builder designatedFundingPortfolioId(String designatedFundingPortfolioId) { + this.designatedFundingPortfolioId = designatedFundingPortfolioId; + return this; + } + + public Builder automaticConversionEnabled(Boolean automaticConversionEnabled) { + this.automaticConversionEnabled = automaticConversionEnabled; + return this; + } + + public Builder automaticLoanEnabled(Boolean automaticLoanEnabled) { + this.automaticLoanEnabled = automaticLoanEnabled; + return this; + } + + public Builder automaticExcessReturnEnabled(Boolean automaticExcessReturnEnabled) { + this.automaticExcessReturnEnabled = automaticExcessReturnEnabled; + return this; + } + + public Builder excessFundsTargetAmount(String excessFundsTargetAmount) { + this.excessFundsTargetAmount = excessFundsTargetAmount; + return this; + } + + public SetFundingSettingsRequest build() throws CoinbaseClientException { + validate(); + return new SetFundingSettingsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.entityId)) { + throw new CoinbaseClientException("EntityId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/financing/SetFundingSettingsResponse.java b/src/main/java/com/coinbase/prime/financing/SetFundingSettingsResponse.java new file mode 100644 index 00000000..1f2d4029 --- /dev/null +++ b/src/main/java/com/coinbase/prime/financing/SetFundingSettingsResponse.java @@ -0,0 +1,60 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.financing; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update Funding Settings */ +public class SetFundingSettingsResponse { + /** Identifier for the created activity / proposal */ + @JsonProperty("activity_id") + private String activityId; + + /** Type of the activity (e.g. PCS proposal type) */ + @JsonProperty("activity_type") + private String activityType; + + /** Number of approvals still required before the change applies */ + @JsonProperty("num_approvals_remaining") + private Integer numApprovalsRemaining; + + public SetFundingSettingsResponse() {} + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } + + public String getActivityType() { + return activityType; + } + + public void setActivityType(String activityType) { + this.activityType = activityType; + } + + public Integer getNumApprovalsRemaining() { + return numApprovalsRemaining; + } + + public void setNumApprovalsRemaining(Integer numApprovalsRemaining) { + this.numApprovalsRemaining = numApprovalsRemaining; + } +} diff --git a/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsRequest.java b/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsRequest.java index 5f2f3042..b8e78608 100644 --- a/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsRequest.java +++ b/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsRequest.java @@ -16,163 +16,66 @@ package com.coinbase.prime.financing; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Update Funding Settings */ -public class UpdateFundingSettingsRequest { - /** Prime Entity ID */ - @JsonProperty(required = true, value = "entity_id") - @JsonIgnore - private String entityId; - - /** - * Set the Derivatives Funding Portfolio that will be used to fund FCM margin calls and receive - * excess margin sweeps. Only one portfolio per entity. - */ - @JsonProperty("designated_funding_portfolio_id") - private String designatedFundingPortfolioId; - - /** - * When true, USDC in your Derivatives Funding Portfolio will be converted to USD to meet FCM - * margin calls (Auto-Convert USDC). - */ - @JsonProperty("automatic_conversion_enabled") - private Boolean automaticConversionEnabled; - - /** - * When true, Coinbase affiliates may initiate loans on your behalf to meet FCM margin calls, per - * your Lending agreement. Available to Portfolio Margin or Cross Margin clients only. - * (Auto-Initiate Loans) - */ - @JsonProperty("automatic_loan_enabled") - private Boolean automaticLoanEnabled; - - /** - * When true, any FCM account balance above your margin requirements will be automatically swept - * back to your Derivatives funding portfolio. (Auto-Return Excess Margin) - */ - @JsonProperty("automatic_excess_return_enabled") - private Boolean automaticExcessReturnEnabled; - - /** - * Weekend Buying Power: Setting a target amount to maintain in your Futures account above margin - * requirements. You can only withdraw funds in excess of this amount. - */ - @JsonProperty("excess_funds_target_amount") - private String excessFundsTargetAmount; +/** + * Update Funding Settings + * + * @deprecated Use setFundingSettings instead. + */ +@Deprecated +public class UpdateFundingSettingsRequest extends SetFundingSettingsRequest { public UpdateFundingSettingsRequest() {} - public UpdateFundingSettingsRequest(Builder builder) { - this.entityId = builder.entityId; - this.designatedFundingPortfolioId = builder.designatedFundingPortfolioId; - this.automaticConversionEnabled = builder.automaticConversionEnabled; - this.automaticLoanEnabled = builder.automaticLoanEnabled; - this.automaticExcessReturnEnabled = builder.automaticExcessReturnEnabled; - this.excessFundsTargetAmount = builder.excessFundsTargetAmount; - } - - public String getEntityId() { - return entityId; - } - - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - public String getDesignatedFundingPortfolioId() { - return designatedFundingPortfolioId; + public UpdateFundingSettingsRequest(SetFundingSettingsRequest.Builder builder) { + super(builder); } - public void setDesignatedFundingPortfolioId(String designatedFundingPortfolioId) { - this.designatedFundingPortfolioId = designatedFundingPortfolioId; - } - - public Boolean getAutomaticConversionEnabled() { - return automaticConversionEnabled; - } - - public void setAutomaticConversionEnabled(Boolean automaticConversionEnabled) { - this.automaticConversionEnabled = automaticConversionEnabled; - } - - public Boolean getAutomaticLoanEnabled() { - return automaticLoanEnabled; - } - - public void setAutomaticLoanEnabled(Boolean automaticLoanEnabled) { - this.automaticLoanEnabled = automaticLoanEnabled; - } - - public Boolean getAutomaticExcessReturnEnabled() { - return automaticExcessReturnEnabled; - } - - public void setAutomaticExcessReturnEnabled(Boolean automaticExcessReturnEnabled) { - this.automaticExcessReturnEnabled = automaticExcessReturnEnabled; - } - - public String getExcessFundsTargetAmount() { - return excessFundsTargetAmount; - } - - public void setExcessFundsTargetAmount(String excessFundsTargetAmount) { - this.excessFundsTargetAmount = excessFundsTargetAmount; - } - - public static class Builder { - private String entityId; - private String designatedFundingPortfolioId; - private Boolean automaticConversionEnabled; - private Boolean automaticLoanEnabled; - private Boolean automaticExcessReturnEnabled; - private String excessFundsTargetAmount; - - public Builder() {} - + /** + * @deprecated Use setFundingSettings instead. + */ + @Deprecated + public static class Builder extends SetFundingSettingsRequest.Builder { + @Override public Builder entityId(String entityId) { - this.entityId = entityId; + super.entityId(entityId); return this; } + @Override public Builder designatedFundingPortfolioId(String designatedFundingPortfolioId) { - this.designatedFundingPortfolioId = designatedFundingPortfolioId; + super.designatedFundingPortfolioId(designatedFundingPortfolioId); return this; } + @Override public Builder automaticConversionEnabled(Boolean automaticConversionEnabled) { - this.automaticConversionEnabled = automaticConversionEnabled; + super.automaticConversionEnabled(automaticConversionEnabled); return this; } + @Override public Builder automaticLoanEnabled(Boolean automaticLoanEnabled) { - this.automaticLoanEnabled = automaticLoanEnabled; + super.automaticLoanEnabled(automaticLoanEnabled); return this; } + @Override public Builder automaticExcessReturnEnabled(Boolean automaticExcessReturnEnabled) { - this.automaticExcessReturnEnabled = automaticExcessReturnEnabled; + super.automaticExcessReturnEnabled(automaticExcessReturnEnabled); return this; } + @Override public Builder excessFundsTargetAmount(String excessFundsTargetAmount) { - this.excessFundsTargetAmount = excessFundsTargetAmount; + super.excessFundsTargetAmount(excessFundsTargetAmount); return this; } + @Override public UpdateFundingSettingsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new UpdateFundingSettingsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.entityId)) { - throw new CoinbaseClientException("EntityId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsResponse.java b/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsResponse.java index aa45a5f5..23753105 100644 --- a/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsResponse.java +++ b/src/main/java/com/coinbase/prime/financing/UpdateFundingSettingsResponse.java @@ -16,45 +16,12 @@ package com.coinbase.prime.financing; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Update Funding Settings */ -public class UpdateFundingSettingsResponse { - /** Identifier for the created activity / proposal */ - @JsonProperty("activity_id") - private String activityId; - - /** Type of the activity (e.g. PCS proposal type) */ - @JsonProperty("activity_type") - private String activityType; - - /** Number of approvals still required before the change applies */ - @JsonProperty("num_approvals_remaining") - private Integer numApprovalsRemaining; - +/** + * Update Funding Settings + * + * @deprecated Use setFundingSettings instead. + */ +@Deprecated +public class UpdateFundingSettingsResponse extends SetFundingSettingsResponse { public UpdateFundingSettingsResponse() {} - - public String getActivityId() { - return activityId; - } - - public void setActivityId(String activityId) { - this.activityId = activityId; - } - - public String getActivityType() { - return activityType; - } - - public void setActivityType(String activityType) { - this.activityType = activityType; - } - - public Integer getNumApprovalsRemaining() { - return numApprovalsRemaining; - } - - public void setNumApprovalsRemaining(Integer numApprovalsRemaining) { - this.numApprovalsRemaining = numApprovalsRemaining; - } } diff --git a/src/main/java/com/coinbase/prime/futures/FuturesService.java b/src/main/java/com/coinbase/prime/futures/FuturesService.java index a9fef98c..0e63d647 100644 --- a/src/main/java/com/coinbase/prime/futures/FuturesService.java +++ b/src/main/java/com/coinbase/prime/futures/FuturesService.java @@ -70,6 +70,21 @@ GetFcmMarginCallDetailsResponse getFcmMarginCallDetails(GetFcmMarginCallDetailsR * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetEntityPositionsResponse getEntityPositions(GetEntityPositionsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Entity Positions. + * + *

Retrieve all active fcm positions for a given entity + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getEntityPositions instead. + */ + @Deprecated GetPositionsResponse getPositions(GetPositionsRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/futures/FuturesServiceImpl.java b/src/main/java/com/coinbase/prime/futures/FuturesServiceImpl.java index c63580a4..f6b956bc 100644 --- a/src/main/java/com/coinbase/prime/futures/FuturesServiceImpl.java +++ b/src/main/java/com/coinbase/prime/futures/FuturesServiceImpl.java @@ -61,6 +61,18 @@ public GetFcmMarginCallDetailsResponse getFcmMarginCallDetails( new TypeReference() {}); } + @Override + public GetEntityPositionsResponse getEntityPositions(GetEntityPositionsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/entities/%s/futures/positions", request.getEntityId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetPositionsResponse getPositions(GetPositionsRequest request) throws CoinbasePrimeException { diff --git a/src/main/java/com/coinbase/prime/futures/GetEntityPositionsRequest.java b/src/main/java/com/coinbase/prime/futures/GetEntityPositionsRequest.java new file mode 100644 index 00000000..5b12cf00 --- /dev/null +++ b/src/main/java/com/coinbase/prime/futures/GetEntityPositionsRequest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.futures; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Entity Positions */ +public class GetEntityPositionsRequest { + /** Entity ID */ + @JsonProperty(required = true, value = "entity_id") + @JsonIgnore + private String entityId; + + /** Product ID. Optional */ + @JsonProperty("product_id") + private String productId; + + public GetEntityPositionsRequest() {} + + public GetEntityPositionsRequest(Builder builder) { + this.entityId = builder.entityId; + this.productId = builder.productId; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public static class Builder { + private String entityId; + private String productId; + + public Builder() {} + + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public GetEntityPositionsRequest build() throws CoinbaseClientException { + validate(); + return new GetEntityPositionsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.entityId)) { + throw new CoinbaseClientException("EntityId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/futures/GetEntityPositionsResponse.java b/src/main/java/com/coinbase/prime/futures/GetEntityPositionsResponse.java new file mode 100644 index 00000000..2187af58 --- /dev/null +++ b/src/main/java/com/coinbase/prime/futures/GetEntityPositionsResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.futures; + +import com.coinbase.prime.model.FcmPosition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Entity Positions */ +public class GetEntityPositionsResponse { + @JsonProperty("positions") + private FcmPosition[] positions; + + /** Clearing account ID */ + @JsonProperty("clearing_account_id") + private String clearingAccountId; + + public GetEntityPositionsResponse() {} + + public FcmPosition[] getPositions() { + return positions; + } + + public void setPositions(FcmPosition[] positions) { + this.positions = positions; + } + + public String getClearingAccountId() { + return clearingAccountId; + } + + public void setClearingAccountId(String clearingAccountId) { + this.clearingAccountId = clearingAccountId; + } +} diff --git a/src/main/java/com/coinbase/prime/futures/GetPositionsRequest.java b/src/main/java/com/coinbase/prime/futures/GetPositionsRequest.java index 944c7396..05b08901 100644 --- a/src/main/java/com/coinbase/prime/futures/GetPositionsRequest.java +++ b/src/main/java/com/coinbase/prime/futures/GetPositionsRequest.java @@ -16,71 +16,42 @@ package com.coinbase.prime.futures; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Entity Positions */ -public class GetPositionsRequest { - /** Entity ID */ - @JsonProperty(required = true, value = "entity_id") - @JsonIgnore - private String entityId; - - /** Product ID. Optional */ - @JsonProperty("product_id") - private String productId; +/** + * Get Entity Positions + * + * @deprecated Use getEntityPositions instead. + */ +@Deprecated +public class GetPositionsRequest extends GetEntityPositionsRequest { public GetPositionsRequest() {} - public GetPositionsRequest(Builder builder) { - this.entityId = builder.entityId; - this.productId = builder.productId; - } - - public String getEntityId() { - return entityId; - } - - public void setEntityId(String entityId) { - this.entityId = entityId; + public GetPositionsRequest(GetEntityPositionsRequest.Builder builder) { + super(builder); } - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; - } - - public static class Builder { - private String entityId; - private String productId; - - public Builder() {} - + /** + * @deprecated Use getEntityPositions instead. + */ + @Deprecated + public static class Builder extends GetEntityPositionsRequest.Builder { + @Override public Builder entityId(String entityId) { - this.entityId = entityId; + super.entityId(entityId); return this; } + @Override public Builder productId(String productId) { - this.productId = productId; + super.productId(productId); return this; } + @Override public GetPositionsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetPositionsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.entityId)) { - throw new CoinbaseClientException("EntityId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/futures/GetPositionsResponse.java b/src/main/java/com/coinbase/prime/futures/GetPositionsResponse.java index 86be69f1..908dad73 100644 --- a/src/main/java/com/coinbase/prime/futures/GetPositionsResponse.java +++ b/src/main/java/com/coinbase/prime/futures/GetPositionsResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.futures; -import com.coinbase.prime.model.FcmPosition; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Entity Positions */ -public class GetPositionsResponse { - @JsonProperty("positions") - private FcmPosition[] positions; - - /** Clearing account ID */ - @JsonProperty("clearing_account_id") - private String clearingAccountId; - +/** + * Get Entity Positions + * + * @deprecated Use getEntityPositions instead. + */ +@Deprecated +public class GetPositionsResponse extends GetEntityPositionsResponse { public GetPositionsResponse() {} - - public FcmPosition[] getPositions() { - return positions; - } - - public void setPositions(FcmPosition[] positions) { - this.positions = positions; - } - - public String getClearingAccountId() { - return clearingAccountId; - } - - public void setClearingAccountId(String clearingAccountId) { - this.clearingAccountId = clearingAccountId; - } } diff --git a/src/main/java/com/coinbase/prime/model/AdvancedTransfer.java b/src/main/java/com/coinbase/prime/model/AdvancedTransfer.java index fcad19e2..78a0b97e 100644 --- a/src/main/java/com/coinbase/prime/model/AdvancedTransfer.java +++ b/src/main/java/com/coinbase/prime/model/AdvancedTransfer.java @@ -30,7 +30,11 @@ public class AdvancedTransfer { /** AdvancedTransferType specifies the type of advanced transfer. */ private AdvancedTransferType type; - /** AdvancedTransferState represents the lifecycle state of an advanced transfer. */ + /** + * AdvancedTransferState represents the lifecycle state of an advanced transfer. - + * ADVANCED_TRANSFER_STATE_MATCHED: The counterparties have matched. Settlement has not started. + * Happy path is CREATED, MATCHED, PROCESSING, DONE. + */ private AdvancedTransferState state; @JsonProperty("fund_movements") @@ -40,6 +44,13 @@ public class AdvancedTransfer { @JsonProperty("blind_match_metadata") private BlindMatchMetadata blindMatchMetadata; + /** + * Coinbase fees charged to this portfolio's wallets on this Advanced Transfer. Empty on create + * and when no fee applies. + */ + @JsonProperty("coinbase_fees") + private List coinbaseFees; + public AdvancedTransfer() {} public AdvancedTransfer(Builder builder) { @@ -48,6 +59,7 @@ public AdvancedTransfer(Builder builder) { this.state = builder.state; this.fundMovements = builder.fundMovements; this.blindMatchMetadata = builder.blindMatchMetadata; + this.coinbaseFees = builder.coinbaseFees; } public String getId() { @@ -90,6 +102,14 @@ public void setBlindMatchMetadata(BlindMatchMetadata blindMatchMetadata) { this.blindMatchMetadata = blindMatchMetadata; } + public List getCoinbaseFees() { + return coinbaseFees; + } + + public void setCoinbaseFees(List coinbaseFees) { + this.coinbaseFees = coinbaseFees; + } + public static class Builder { private String id; @@ -101,6 +121,8 @@ public static class Builder { private BlindMatchMetadata blindMatchMetadata; + private List coinbaseFees; + public Builder id(String id) { this.id = id; return this; @@ -126,6 +148,11 @@ public Builder blindMatchMetadata(BlindMatchMetadata blindMatchMetadata) { return this; } + public Builder coinbaseFees(List coinbaseFees) { + this.coinbaseFees = coinbaseFees; + return this; + } + public AdvancedTransfer build() { return new AdvancedTransfer(this); } diff --git a/src/main/java/com/coinbase/prime/model/Allocation.java b/src/main/java/com/coinbase/prime/model/Allocation.java index 3d8f2a50..848ffe7f 100644 --- a/src/main/java/com/coinbase/prime/model/Allocation.java +++ b/src/main/java/com/coinbase/prime/model/Allocation.java @@ -48,7 +48,11 @@ public class Allocation { @JsonProperty("product_id") private String productId; - /** - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order */ + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ private OrderSide side; /** Price the allocation was done at. */ diff --git a/src/main/java/com/coinbase/prime/model/CoinbaseFee.java b/src/main/java/com/coinbase/prime/model/CoinbaseFee.java new file mode 100644 index 00000000..6adb90c8 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/CoinbaseFee.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A Coinbase fee charged on an Advanced Transfer. */ +public class CoinbaseFee { + /** The fee amount in whole units of the fee symbol */ + private String amount; + + /** The asset symbol in which the fee was charged */ + private String symbol; + + /** The wallet that paid the fee */ + @JsonProperty("wallet_id") + private String walletId; + + public CoinbaseFee() {} + + public CoinbaseFee(Builder builder) { + this.amount = builder.amount; + this.symbol = builder.symbol; + this.walletId = builder.walletId; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public String getWalletId() { + return walletId; + } + + public void setWalletId(String walletId) { + this.walletId = walletId; + } + + public static class Builder { + private String amount; + + private String symbol; + + private String walletId; + + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + public Builder symbol(String symbol) { + this.symbol = symbol; + return this; + } + + public Builder walletId(String walletId) { + this.walletId = walletId; + return this; + } + + public CoinbaseFee build() { + return new CoinbaseFee(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/ComboLeg.java b/src/main/java/com/coinbase/prime/model/ComboLeg.java index 7c323a66..e42c40e6 100644 --- a/src/main/java/com/coinbase/prime/model/ComboLeg.java +++ b/src/main/java/com/coinbase/prime/model/ComboLeg.java @@ -29,7 +29,11 @@ public class ComboLeg { private String quantity; - /** - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order */ + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ private OrderSide side; public ComboLeg() {} diff --git a/src/main/java/com/coinbase/prime/model/CrossMarginPositionBreakdown.java b/src/main/java/com/coinbase/prime/model/CrossMarginPositionBreakdown.java new file mode 100644 index 00000000..85d03e35 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/CrossMarginPositionBreakdown.java @@ -0,0 +1,107 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.XMPositionType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A single typed position leg of a per-asset XM row. */ +public class CrossMarginPositionBreakdown { + /** + * Type of a position leg within a per-asset XM row. New values may be added as more legs are + * broken out. - XM_POSITION_TYPE_UNSPECIFIED: The position type is unavailable, or is not + * recognized by this API version. - XM_POSITION_TYPE_SPOT_TRADING: Spot balance held outside + * Prime Vault (trading balance, including Prime Loans). - XM_POSITION_TYPE_SPOT_VAULT: Spot + * balance held in Prime Vault. + */ + @JsonProperty("position_type") + private XMPositionType positionType; + + /** + * Signed balance of this leg in the position currency, after pending withdrawals and before + * collateral caps and haircuts. + */ + private String balance; + + /** + * Signed USD notional of this leg, after pending withdrawals and before collateral caps and + * haircuts. + */ + @JsonProperty("notional_balance") + private String notionalBalance; + + public CrossMarginPositionBreakdown() {} + + public CrossMarginPositionBreakdown(Builder builder) { + this.positionType = builder.positionType; + this.balance = builder.balance; + this.notionalBalance = builder.notionalBalance; + } + + public XMPositionType getPositionType() { + return positionType; + } + + public void setPositionType(XMPositionType positionType) { + this.positionType = positionType; + } + + public String getBalance() { + return balance; + } + + public void setBalance(String balance) { + this.balance = balance; + } + + public String getNotionalBalance() { + return notionalBalance; + } + + public void setNotionalBalance(String notionalBalance) { + this.notionalBalance = notionalBalance; + } + + public static class Builder { + private XMPositionType positionType; + + private String balance; + + private String notionalBalance; + + public Builder positionType(XMPositionType positionType) { + this.positionType = positionType; + return this; + } + + public Builder balance(String balance) { + this.balance = balance; + return this; + } + + public Builder notionalBalance(String notionalBalance) { + this.notionalBalance = notionalBalance; + return this; + } + + public CrossMarginPositionBreakdown build() { + return new CrossMarginPositionBreakdown(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeMarginSummary.java b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeMarginSummary.java index 4a7487fd..a92f6bcc 100644 --- a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeMarginSummary.java +++ b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeMarginSummary.java @@ -131,6 +131,20 @@ public class CrossMarginPrimeMarginSummary { @JsonProperty("fcm_excess_available_to_return") private String fcmExcessAvailableToReturn; + /** + * Total account equity in USD after pending withdrawals, before collateral caps and + * cash-equivalent haircuts. + */ + @JsonProperty("raw_account_equity") + private String rawAccountEquity; + + /** + * Total account equity in USD after pending withdrawals and collateral caps, before + * cash-equivalent haircuts. + */ + @JsonProperty("pre_haircut_account_equity") + private String preHaircutAccountEquity; + public CrossMarginPrimeMarginSummary() {} public CrossMarginPrimeMarginSummary(Builder builder) { @@ -156,6 +170,8 @@ public CrossMarginPrimeMarginSummary(Builder builder) { this.deficitRatio = builder.deficitRatio; this.marginThresholds = builder.marginThresholds; this.fcmExcessAvailableToReturn = builder.fcmExcessAvailableToReturn; + this.rawAccountEquity = builder.rawAccountEquity; + this.preHaircutAccountEquity = builder.preHaircutAccountEquity; } public String getMarginRequirement() { @@ -335,6 +351,22 @@ public void setFcmExcessAvailableToReturn(String fcmExcessAvailableToReturn) { this.fcmExcessAvailableToReturn = fcmExcessAvailableToReturn; } + public String getRawAccountEquity() { + return rawAccountEquity; + } + + public void setRawAccountEquity(String rawAccountEquity) { + this.rawAccountEquity = rawAccountEquity; + } + + public String getPreHaircutAccountEquity() { + return preHaircutAccountEquity; + } + + public void setPreHaircutAccountEquity(String preHaircutAccountEquity) { + this.preHaircutAccountEquity = preHaircutAccountEquity; + } + public static class Builder { private String marginRequirement; @@ -380,6 +412,10 @@ public static class Builder { private String fcmExcessAvailableToReturn; + private String rawAccountEquity; + + private String preHaircutAccountEquity; + public Builder marginRequirement(String marginRequirement) { this.marginRequirement = marginRequirement; return this; @@ -491,6 +527,16 @@ public Builder fcmExcessAvailableToReturn(String fcmExcessAvailableToReturn) { return this; } + public Builder rawAccountEquity(String rawAccountEquity) { + this.rawAccountEquity = rawAccountEquity; + return this; + } + + public Builder preHaircutAccountEquity(String preHaircutAccountEquity) { + this.preHaircutAccountEquity = preHaircutAccountEquity; + return this; + } + public CrossMarginPrimeMarginSummary build() { return new CrossMarginPrimeMarginSummary(this); } diff --git a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotEquityBreakdown.java b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotEquityBreakdown.java index f29a85ef..8cd9cf15 100644 --- a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotEquityBreakdown.java +++ b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotEquityBreakdown.java @@ -42,6 +42,14 @@ public class CrossMarginPrimeSpotEquityBreakdown { @JsonProperty("pending_transfers") private String pendingTransfers; + /** Equity contribution from FX positions. */ + @JsonProperty("fx_balance") + private String fxBalance; + + /** Equity contribution from non-USDC stablecoins. USDC is included in cash_balance. */ + @JsonProperty("stablecoin_balance") + private String stablecoinBalance; + public CrossMarginPrimeSpotEquityBreakdown() {} public CrossMarginPrimeSpotEquityBreakdown(Builder builder) { @@ -50,6 +58,8 @@ public CrossMarginPrimeSpotEquityBreakdown(Builder builder) { this.shortMarketValue = builder.shortMarketValue; this.shortCollateral = builder.shortCollateral; this.pendingTransfers = builder.pendingTransfers; + this.fxBalance = builder.fxBalance; + this.stablecoinBalance = builder.stablecoinBalance; } public String getCashBalance() { @@ -92,6 +102,22 @@ public void setPendingTransfers(String pendingTransfers) { this.pendingTransfers = pendingTransfers; } + public String getFxBalance() { + return fxBalance; + } + + public void setFxBalance(String fxBalance) { + this.fxBalance = fxBalance; + } + + public String getStablecoinBalance() { + return stablecoinBalance; + } + + public void setStablecoinBalance(String stablecoinBalance) { + this.stablecoinBalance = stablecoinBalance; + } + public static class Builder { private String cashBalance; @@ -103,6 +129,10 @@ public static class Builder { private String pendingTransfers; + private String fxBalance; + + private String stablecoinBalance; + public Builder cashBalance(String cashBalance) { this.cashBalance = cashBalance; return this; @@ -128,6 +158,16 @@ public Builder pendingTransfers(String pendingTransfers) { return this; } + public Builder fxBalance(String fxBalance) { + this.fxBalance = fxBalance; + return this; + } + + public Builder stablecoinBalance(String stablecoinBalance) { + this.stablecoinBalance = stablecoinBalance; + return this; + } + public CrossMarginPrimeSpotEquityBreakdown build() { return new CrossMarginPrimeSpotEquityBreakdown(this); } diff --git a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotMarginContribution.java b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotMarginContribution.java new file mode 100644 index 00000000..277409fd --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeSpotMarginContribution.java @@ -0,0 +1,124 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Breakdown of a position row's spot equity contribution. All values are zero when no contribution + * data is available. If the asset class is unknown, the contribution amounts are still returned. + */ +public class CrossMarginPrimeSpotMarginContribution { + /** + * Signed spot value in USD after pending withdrawals, before collateral caps and cash-equivalent + * haircuts. + */ + @JsonProperty("raw_notional") + private String rawNotional; + + /** Long notional excluded above the collateral cap. */ + @JsonProperty("ineligible_notional") + private String ineligibleNotional; + + /** Amount removed by the cash-equivalent long haircut. */ + @JsonProperty("haircut_notional") + private String haircutNotional; + + /** + * Final spot equity contribution. Positive values are eligible collateral; negative values are + * liabilities. + */ + @JsonProperty("equity_contribution") + private String equityContribution; + + public CrossMarginPrimeSpotMarginContribution() {} + + public CrossMarginPrimeSpotMarginContribution(Builder builder) { + this.rawNotional = builder.rawNotional; + this.ineligibleNotional = builder.ineligibleNotional; + this.haircutNotional = builder.haircutNotional; + this.equityContribution = builder.equityContribution; + } + + public String getRawNotional() { + return rawNotional; + } + + public void setRawNotional(String rawNotional) { + this.rawNotional = rawNotional; + } + + public String getIneligibleNotional() { + return ineligibleNotional; + } + + public void setIneligibleNotional(String ineligibleNotional) { + this.ineligibleNotional = ineligibleNotional; + } + + public String getHaircutNotional() { + return haircutNotional; + } + + public void setHaircutNotional(String haircutNotional) { + this.haircutNotional = haircutNotional; + } + + public String getEquityContribution() { + return equityContribution; + } + + public void setEquityContribution(String equityContribution) { + this.equityContribution = equityContribution; + } + + public static class Builder { + private String rawNotional; + + private String ineligibleNotional; + + private String haircutNotional; + + private String equityContribution; + + public Builder rawNotional(String rawNotional) { + this.rawNotional = rawNotional; + return this; + } + + public Builder ineligibleNotional(String ineligibleNotional) { + this.ineligibleNotional = ineligibleNotional; + return this; + } + + public Builder haircutNotional(String haircutNotional) { + this.haircutNotional = haircutNotional; + return this; + } + + public Builder equityContribution(String equityContribution) { + this.equityContribution = equityContribution; + return this; + } + + public CrossMarginPrimeSpotMarginContribution build() { + return new CrossMarginPrimeSpotMarginContribution(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeXMPosition.java b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeXMPosition.java index 69870079..9e41b56f 100644 --- a/src/main/java/com/coinbase/prime/model/CrossMarginPrimeXMPosition.java +++ b/src/main/java/com/coinbase/prime/model/CrossMarginPrimeXMPosition.java @@ -18,7 +18,9 @@ package com.coinbase.prime.model; +import com.coinbase.prime.model.enums.PrimeXMAssetClass; import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; /** * CrossMarginPrimeXMPosition is a single per-asset XM row (proto-backed fields from @@ -84,6 +86,33 @@ public class CrossMarginPrimeXMPosition { @JsonProperty("liquidity_addon") private String liquidityAddon; + /** + * Asset class of the XM position underlier. - PRIME_XM_ASSET_CLASS_UNSPECIFIED: The asset class + * is unavailable for this position, or is not recognized by this API version. - + * PRIME_XM_ASSET_CLASS_CASH: USD and USDC. - PRIME_XM_ASSET_CLASS_FX: Non-USD fiat currencies + * recognized as FX in the margin model, such as EUR, GBP, and CHF. - + * PRIME_XM_ASSET_CLASS_STABLECOIN: Non-USDC stablecoins recognized as cash equivalents in the + * margin model, such as EURC and USDT. - PRIME_XM_ASSET_CLASS_CRYPTO: Crypto assets (e.g. BTC, + * ETH). + */ + @JsonProperty("asset_class") + private PrimeXMAssetClass assetClass; + + /** + * Breakdown of a position row's spot equity contribution. All values are zero when no + * contribution data is available. If the asset class is unknown, the contribution amounts are + * still returned. + */ + @JsonProperty("spot_margin_contribution") + private CrossMarginPrimeSpotMarginContribution spotMarginContribution; + + /** + * Spot balance of this asset by position type. Contains SPOT_TRADING and SPOT_VAULT legs, which + * sum to spot_balance and spot_balance_notional. + */ + @JsonProperty("spot_position_breakdown") + private List spotPositionBreakdown; + public CrossMarginPrimeXMPosition() {} public CrossMarginPrimeXMPosition(Builder builder) { @@ -102,6 +131,9 @@ public CrossMarginPrimeXMPosition(Builder builder) { this.shortAmount = builder.shortAmount; this.volatilityAddon = builder.volatilityAddon; this.liquidityAddon = builder.liquidityAddon; + this.assetClass = builder.assetClass; + this.spotMarginContribution = builder.spotMarginContribution; + this.spotPositionBreakdown = builder.spotPositionBreakdown; } public String getCurrency() { @@ -224,6 +256,31 @@ public void setLiquidityAddon(String liquidityAddon) { this.liquidityAddon = liquidityAddon; } + public PrimeXMAssetClass getAssetClass() { + return assetClass; + } + + public void setAssetClass(PrimeXMAssetClass assetClass) { + this.assetClass = assetClass; + } + + public CrossMarginPrimeSpotMarginContribution getSpotMarginContribution() { + return spotMarginContribution; + } + + public void setSpotMarginContribution( + CrossMarginPrimeSpotMarginContribution spotMarginContribution) { + this.spotMarginContribution = spotMarginContribution; + } + + public List getSpotPositionBreakdown() { + return spotPositionBreakdown; + } + + public void setSpotPositionBreakdown(List spotPositionBreakdown) { + this.spotPositionBreakdown = spotPositionBreakdown; + } + public static class Builder { private String currency; @@ -255,6 +312,12 @@ public static class Builder { private String liquidityAddon; + private PrimeXMAssetClass assetClass; + + private CrossMarginPrimeSpotMarginContribution spotMarginContribution; + + private List spotPositionBreakdown; + public Builder currency(String currency) { this.currency = currency; return this; @@ -330,6 +393,22 @@ public Builder liquidityAddon(String liquidityAddon) { return this; } + public Builder assetClass(PrimeXMAssetClass assetClass) { + this.assetClass = assetClass; + return this; + } + + public Builder spotMarginContribution( + CrossMarginPrimeSpotMarginContribution spotMarginContribution) { + this.spotMarginContribution = spotMarginContribution; + return this; + } + + public Builder spotPositionBreakdown(List spotPositionBreakdown) { + this.spotPositionBreakdown = spotPositionBreakdown; + return this; + } + public CrossMarginPrimeXMPosition build() { return new CrossMarginPrimeXMPosition(this); } diff --git a/src/main/java/com/coinbase/prime/model/DerivativePosition.java b/src/main/java/com/coinbase/prime/model/DerivativePosition.java index 7cec3a20..1b7da523 100644 --- a/src/main/java/com/coinbase/prime/model/DerivativePosition.java +++ b/src/main/java/com/coinbase/prime/model/DerivativePosition.java @@ -79,6 +79,10 @@ public class DerivativePosition { @JsonProperty("venue_id") private String venueId; + /** Funding PNL, populated only for perpetual futures positions */ + @JsonProperty("funding_pnl") + private String fundingPnl; + public DerivativePosition() {} public DerivativePosition(Builder builder) { @@ -94,6 +98,7 @@ public DerivativePosition(Builder builder) { this.currency = builder.currency; this.optionsDetails = builder.optionsDetails; this.venueId = builder.venueId; + this.fundingPnl = builder.fundingPnl; } public String getProductId() { @@ -192,6 +197,14 @@ public void setVenueId(String venueId) { this.venueId = venueId; } + public String getFundingPnl() { + return fundingPnl; + } + + public void setFundingPnl(String fundingPnl) { + this.fundingPnl = fundingPnl; + } + public static class Builder { private String productId; @@ -217,6 +230,8 @@ public static class Builder { private String venueId; + private String fundingPnl; + public Builder productId(String productId) { this.productId = productId; return this; @@ -277,6 +292,11 @@ public Builder venueId(String venueId) { return this; } + public Builder fundingPnl(String fundingPnl) { + this.fundingPnl = fundingPnl; + return this; + } + public DerivativePosition build() { return new DerivativePosition(this); } diff --git a/src/main/java/com/coinbase/prime/model/FcmPosition.java b/src/main/java/com/coinbase/prime/model/FcmPosition.java index f3ea0a3a..cfb37982 100644 --- a/src/main/java/com/coinbase/prime/model/FcmPosition.java +++ b/src/main/java/com/coinbase/prime/model/FcmPosition.java @@ -53,6 +53,10 @@ public class FcmPosition { @JsonProperty("expiration_time") private OffsetDateTime expirationTime; + /** Funding PNL, populated only for perpetual futures positions */ + @JsonProperty("funding_pnl") + private String fundingPnl; + public FcmPosition() {} public FcmPosition(Builder builder) { @@ -64,6 +68,7 @@ public FcmPosition(Builder builder) { this.currentPrice = builder.currentPrice; this.avgEntryPrice = builder.avgEntryPrice; this.expirationTime = builder.expirationTime; + this.fundingPnl = builder.fundingPnl; } public String getProductId() { @@ -130,6 +135,14 @@ public void setExpirationTime(OffsetDateTime expirationTime) { this.expirationTime = expirationTime; } + public String getFundingPnl() { + return fundingPnl; + } + + public void setFundingPnl(String fundingPnl) { + this.fundingPnl = fundingPnl; + } + public static class Builder { private String productId; @@ -147,6 +160,8 @@ public static class Builder { private OffsetDateTime expirationTime; + private String fundingPnl; + public Builder productId(String productId) { this.productId = productId; return this; @@ -187,6 +202,11 @@ public Builder expirationTime(OffsetDateTime expirationTime) { return this; } + public Builder fundingPnl(String fundingPnl) { + this.fundingPnl = fundingPnl; + return this; + } + public FcmPosition build() { return new FcmPosition(this); } diff --git a/src/main/java/com/coinbase/prime/model/Fill.java b/src/main/java/com/coinbase/prime/model/Fill.java index 72118ead..00339e9a 100644 --- a/src/main/java/com/coinbase/prime/model/Fill.java +++ b/src/main/java/com/coinbase/prime/model/Fill.java @@ -39,7 +39,11 @@ public class Fill { @JsonProperty("client_product_id") private String clientProductId; - /** - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order */ + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ private OrderSide side; /** Filled size (in base asset units) */ @@ -72,7 +76,9 @@ public class Fill { /** * - UNKNOWN_PRODUCT_TYPE: Unknown product type - SPOT: Spot product - FUTURE: Future product - - * OPTION: Option product + * OPTION: Option product - BASIS: Basis product: a futures contract traded against its spot + * underlying, or against another futures contract of the same underlying (calendar spread); the + * product of SPREAD orders */ @JsonProperty("product_type") private ProductType productType; diff --git a/src/main/java/com/coinbase/prime/model/Leg.java b/src/main/java/com/coinbase/prime/model/Leg.java new file mode 100644 index 00000000..b98966f2 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/Leg.java @@ -0,0 +1,99 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.OrderSide; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** One leg of a SPREAD order */ +public class Leg { + /** Product ID of the leg, e.g. BTC-USD for spot or BIP-20DEC30-CDE for futures */ + @JsonProperty("product_id") + private String productId; + + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ + private OrderSide side; + + /** Whether this leg may rest passively on the book. At least one leg must be true. */ + @JsonProperty("support_passive_order") + private boolean supportPassiveOrder; + + public Leg() {} + + public Leg(Builder builder) { + this.productId = builder.productId; + this.side = builder.side; + this.supportPassiveOrder = builder.supportPassiveOrder; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public OrderSide getSide() { + return side; + } + + public void setSide(OrderSide side) { + this.side = side; + } + + public boolean getSupportPassiveOrder() { + return supportPassiveOrder; + } + + public void setSupportPassiveOrder(boolean supportPassiveOrder) { + this.supportPassiveOrder = supportPassiveOrder; + } + + public static class Builder { + private String productId; + + private OrderSide side; + + private boolean supportPassiveOrder; + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder side(OrderSide side) { + this.side = side; + return this; + } + + public Builder supportPassiveOrder(boolean supportPassiveOrder) { + this.supportPassiveOrder = supportPassiveOrder; + return this; + } + + public Leg build() { + return new Leg(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/LegPreview.java b/src/main/java/com/coinbase/prime/model/LegPreview.java new file mode 100644 index 00000000..bd05533a --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/LegPreview.java @@ -0,0 +1,216 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.OrderSide; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Preview values for one leg of a SPREAD order */ +public class LegPreview { + @JsonProperty("product_id") + private String productId; + + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ + private OrderSide side; + + @JsonProperty("support_passive_order") + private boolean supportPassiveOrder; + + /** Estimated commission for this leg */ + @JsonProperty("leg_commission") + private String legCommission; + + /** Estimated notional of this leg in quote currency */ + @JsonProperty("quote_value") + private String quoteValue; + + /** Current best bid for this leg's order book */ + @JsonProperty("best_bid") + private String bestBid; + + /** Current best ask for this leg's order book */ + @JsonProperty("best_ask") + private String bestAsk; + + /** Estimated average fill price for this leg */ + @JsonProperty("average_filled_price") + private String averageFilledPrice; + + /** Expected slippage for this leg */ + private String slippage; + + public LegPreview() {} + + public LegPreview(Builder builder) { + this.productId = builder.productId; + this.side = builder.side; + this.supportPassiveOrder = builder.supportPassiveOrder; + this.legCommission = builder.legCommission; + this.quoteValue = builder.quoteValue; + this.bestBid = builder.bestBid; + this.bestAsk = builder.bestAsk; + this.averageFilledPrice = builder.averageFilledPrice; + this.slippage = builder.slippage; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public OrderSide getSide() { + return side; + } + + public void setSide(OrderSide side) { + this.side = side; + } + + public boolean getSupportPassiveOrder() { + return supportPassiveOrder; + } + + public void setSupportPassiveOrder(boolean supportPassiveOrder) { + this.supportPassiveOrder = supportPassiveOrder; + } + + public String getLegCommission() { + return legCommission; + } + + public void setLegCommission(String legCommission) { + this.legCommission = legCommission; + } + + public String getQuoteValue() { + return quoteValue; + } + + public void setQuoteValue(String quoteValue) { + this.quoteValue = quoteValue; + } + + public String getBestBid() { + return bestBid; + } + + public void setBestBid(String bestBid) { + this.bestBid = bestBid; + } + + public String getBestAsk() { + return bestAsk; + } + + public void setBestAsk(String bestAsk) { + this.bestAsk = bestAsk; + } + + public String getAverageFilledPrice() { + return averageFilledPrice; + } + + public void setAverageFilledPrice(String averageFilledPrice) { + this.averageFilledPrice = averageFilledPrice; + } + + public String getSlippage() { + return slippage; + } + + public void setSlippage(String slippage) { + this.slippage = slippage; + } + + public static class Builder { + private String productId; + + private OrderSide side; + + private boolean supportPassiveOrder; + + private String legCommission; + + private String quoteValue; + + private String bestBid; + + private String bestAsk; + + private String averageFilledPrice; + + private String slippage; + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder side(OrderSide side) { + this.side = side; + return this; + } + + public Builder supportPassiveOrder(boolean supportPassiveOrder) { + this.supportPassiveOrder = supportPassiveOrder; + return this; + } + + public Builder legCommission(String legCommission) { + this.legCommission = legCommission; + return this; + } + + public Builder quoteValue(String quoteValue) { + this.quoteValue = quoteValue; + return this; + } + + public Builder bestBid(String bestBid) { + this.bestBid = bestBid; + return this; + } + + public Builder bestAsk(String bestAsk) { + this.bestAsk = bestAsk; + return this; + } + + public Builder averageFilledPrice(String averageFilledPrice) { + this.averageFilledPrice = averageFilledPrice; + return this; + } + + public Builder slippage(String slippage) { + this.slippage = slippage; + return this; + } + + public LegPreview build() { + return new LegPreview(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/MarginCallThresholds.java b/src/main/java/com/coinbase/prime/model/MarginCallThresholds.java new file mode 100644 index 00000000..fb329755 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/MarginCallThresholds.java @@ -0,0 +1,63 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Configured thresholds used to determine `margin_level`. Each entry identifies a margin level, the + * ratio used to evaluate it, and its threshold value. Historical responses contain the thresholds + * recorded with the historical health evaluation. Equity at or above the margin requirement + * produces a healthy margin level. Otherwise, the evaluator selects the first matching rule in the + * configured order. A threshold comparison identifies a matching level; it doesn't by itself issue + * a margin call or change account permissions. + */ +public class MarginCallThresholds { + /** Ordered thresholds used to select a margin level. */ + @JsonProperty("margin_thresholds") + private List marginThresholds; + + public MarginCallThresholds() {} + + public MarginCallThresholds(Builder builder) { + this.marginThresholds = builder.marginThresholds; + } + + public List getMarginThresholds() { + return marginThresholds; + } + + public void setMarginThresholds(List marginThresholds) { + this.marginThresholds = marginThresholds; + } + + public static class Builder { + private List marginThresholds; + + public Builder marginThresholds(List marginThresholds) { + this.marginThresholds = marginThresholds; + return this; + } + + public MarginCallThresholds build() { + return new MarginCallThresholds(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/MarginSummary.java b/src/main/java/com/coinbase/prime/model/MarginSummary.java index 7da17538..90d6ff8d 100644 --- a/src/main/java/com/coinbase/prime/model/MarginSummary.java +++ b/src/main/java/com/coinbase/prime/model/MarginSummary.java @@ -18,6 +18,10 @@ package com.coinbase.prime.model; +import com.coinbase.prime.model.enums.MarginControlStatus; +import com.coinbase.prime.model.enums.MarginEntityCallStatus; +import com.coinbase.prime.model.enums.MarginHealthStatus; +import com.coinbase.prime.model.enums.MarginLevel; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -166,6 +170,117 @@ public class MarginSummary { @JsonProperty("pm_margin_consumed") private String pmMarginConsumed; + /** + * Signed cash adjustment associated with the short collateral balance in a historical margin + * summary. Negative amounts move cash into short collateral; positive amounts return cash from + * short collateral. Add this signed amount to the snapshot's cash balance to calculate cash after + * the transfer. Live margin responses return an empty string for this field. For example, a cash + * balance of 60000000 and a short collateral transfer of -20000000 produce a cash balance of + * 40000000 after the transfer. This calculation doesn't determine the amount available to + * withdraw. + */ + @JsonProperty("short_collateral_transfer") + private String shortCollateralTransfer; + + /** + * Recorded account health state maintained by the margin-management process. Persistence rules + * filter out short-lived threshold changes. Margin-call and liquidation events also affect this + * state. A change in the calculated `margin_level` may not immediately change this status. Use + * `control_status` for trading and withdrawal permissions in live responses. Historical responses + * contain the recorded health state at the historical evaluation. - + * MARGIN_HEALTH_STATUS_UNSPECIFIED: No account health state is provided. Don't interpret this + * value as healthy or as permission to trade or withdraw. - MARGIN_HEALTH_STATUS_HEALTHY: The + * account's recorded health state is healthy. - MARGIN_HEALTH_STATUS_WARNING: The account's + * recorded health state is warning. Margin-call issuance follows the applicable margin + * methodology. - MARGIN_HEALTH_STATUS_CRITICAL: The account's recorded health state is critical, + * corresponding to an urgent margin-call condition under the applicable margin methodology. - + * MARGIN_HEALTH_STATUS_SUSPENDED: The account is recorded as suspended under the applicable + * margin methodology. - MARGIN_HEALTH_STATUS_RESTRICTED: The account is recorded as restricted + * under the applicable margin methodology. - MARGIN_HEALTH_STATUS_PRE_LIQUIDATION: The account is + * in a pre-liquidation state. Liquidation may commence under the applicable margin methodology. - + * MARGIN_HEALTH_STATUS_LIQUIDATING: Liquidation has commenced. - MARGIN_HEALTH_STATUS_IN_DEFICIT: + * The account's recorded health state is in deficit. Margin-call issuance follows the applicable + * margin methodology. + */ + @JsonProperty("health_status") + private MarginHealthStatus healthStatus; + + /** + * Calculated margin level based on the account's equity, margin requirement, margin limit, and + * configured thresholds. This reflects the current calculation for live responses or the recorded + * calculation for historical responses. It can differ from `health_status`, which is maintained + * by the margin-management process. The level alone doesn't determine whether a margin call is + * open or whether trading and withdrawals are allowed. - MARGIN_LEVEL_UNSPECIFIED: No calculated + * margin level is provided. - MARGIN_LEVEL_HEALTHY: Account equity is at or above the margin + * requirement. - MARGIN_LEVEL_DEFICIT: The calculation places the account in the deficit band. + * Margin-call issuance follows the applicable margin methodology. - MARGIN_LEVEL_WARNING: The + * calculation places the account in the warning band, approaching the critical threshold. - + * MARGIN_LEVEL_CRITICAL: The calculation places the account in the critical band. - + * MARGIN_LEVEL_LIQUIDATION: The calculation places the account in the liquidation band. This + * value alone doesn't indicate that liquidation has commenced. + */ + @JsonProperty("margin_level") + private MarginLevel marginLevel; + + /** + * Configured thresholds used to determine `margin_level`. Each entry identifies a margin level, + * the ratio used to evaluate it, and its threshold value. Historical responses contain the + * thresholds recorded with the historical health evaluation. Equity at or above the margin + * requirement produces a healthy margin level. Otherwise, the evaluator selects the first + * matching rule in the configured order. A threshold comparison identifies a matching level; it + * doesn't by itself issue a margin call or change account permissions. + */ + @JsonProperty("margin_thresholds") + private MarginCallThresholds marginThresholds; + + /** + * Trading and withdrawal permissions derived from the account's recorded health state, + * outstanding margin calls, and account restrictions. These permissions can remain restricted + * even when the calculated `margin_level` improves. Returns `MARGIN_CONTROL_STATUS_UNSPECIFIED` + * when the margin service doesn't provide a control status. - MARGIN_CONTROL_STATUS_UNSPECIFIED: + * No control status is provided. Don't infer permission to trade or withdraw from this value. - + * MARGIN_CONTROL_STATUS_TRADES_AND_WITHDRAWALS: Allowed to trade and withdraw under the + * applicable margin methodology. - MARGIN_CONTROL_STATUS_TRADES_ONLY: Allowed to trade but not + * withdraw under the applicable margin methodology. - MARGIN_CONTROL_STATUS_SESSION_LOCKED: Not + * allowed to trade or withdraw. + */ + @JsonProperty("control_status") + private MarginControlStatus controlStatus; + + /** + * Account equity divided by margin requirement, expressed as a decimal ratio. For example, + * \"1.2\" represents equity equal to 120% of the margin requirement. Returns an empty string when + * either input is unavailable or the margin requirement is zero. + */ + @JsonProperty("equity_ratio") + private String equityRatio; + + /** + * Margin deficit divided by the account's margin limit, calculated as `max(0, (margin requirement + * - account equity) / pm_margin_limit)`. Expressed as a decimal ratio, not a percentage. Returns + * an empty string when an input is unavailable or the margin limit is zero. + */ + @JsonProperty("deficit_ratio") + private String deficitRatio; + + /** + * MarginEntityCallStatus summarizes the entity's open margin calls. When several calls are open, + * it reflects the highest-priority one: aged, then urgent, then standard, then debit. + * `call_status` describes outstanding calls. Use `margin_level` for calculated margin condition + * and `control_status` for trading and withdrawal permissions. - + * MARGIN_ENTITY_CALL_STATUS_UNSPECIFIED: No call status is provided. Don't infer that the entity + * has no margin calls from this value. - MARGIN_ENTITY_CALL_STATUS_NO_CALL: The entity has no + * open margin calls. - MARGIN_ENTITY_CALL_STATUS_OPEN_STANDARD_CALL: The entity has an open + * standard margin call and no urgent or aged calls. - MARGIN_ENTITY_CALL_STATUS_OPEN_URGENT_CALL: + * The entity has an open urgent margin call and no aged calls. - + * MARGIN_ENTITY_CALL_STATUS_AGED_CALL: At least one open margin call is past its due time. This + * status alone does not indicate a contractual Event of Default or that liquidation has begun. - + * MARGIN_ENTITY_CALL_STATUS_OPEN_DEBIT_CALL: The entity has an open debit call and no standard, + * urgent, or aged calls. + */ + @JsonProperty("call_status") + private MarginEntityCallStatus callStatus; + public MarginSummary() {} public MarginSummary(Builder builder) { @@ -201,6 +316,14 @@ public MarginSummary(Builder builder) { this.pmCreditLimit = builder.pmCreditLimit; this.pmMarginLimit = builder.pmMarginLimit; this.pmMarginConsumed = builder.pmMarginConsumed; + this.shortCollateralTransfer = builder.shortCollateralTransfer; + this.healthStatus = builder.healthStatus; + this.marginLevel = builder.marginLevel; + this.marginThresholds = builder.marginThresholds; + this.controlStatus = builder.controlStatus; + this.equityRatio = builder.equityRatio; + this.deficitRatio = builder.deficitRatio; + this.callStatus = builder.callStatus; } public String getEntityId() { @@ -459,6 +582,70 @@ public void setPmMarginConsumed(String pmMarginConsumed) { this.pmMarginConsumed = pmMarginConsumed; } + public String getShortCollateralTransfer() { + return shortCollateralTransfer; + } + + public void setShortCollateralTransfer(String shortCollateralTransfer) { + this.shortCollateralTransfer = shortCollateralTransfer; + } + + public MarginHealthStatus getHealthStatus() { + return healthStatus; + } + + public void setHealthStatus(MarginHealthStatus healthStatus) { + this.healthStatus = healthStatus; + } + + public MarginLevel getMarginLevel() { + return marginLevel; + } + + public void setMarginLevel(MarginLevel marginLevel) { + this.marginLevel = marginLevel; + } + + public MarginCallThresholds getMarginThresholds() { + return marginThresholds; + } + + public void setMarginThresholds(MarginCallThresholds marginThresholds) { + this.marginThresholds = marginThresholds; + } + + public MarginControlStatus getControlStatus() { + return controlStatus; + } + + public void setControlStatus(MarginControlStatus controlStatus) { + this.controlStatus = controlStatus; + } + + public String getEquityRatio() { + return equityRatio; + } + + public void setEquityRatio(String equityRatio) { + this.equityRatio = equityRatio; + } + + public String getDeficitRatio() { + return deficitRatio; + } + + public void setDeficitRatio(String deficitRatio) { + this.deficitRatio = deficitRatio; + } + + public MarginEntityCallStatus getCallStatus() { + return callStatus; + } + + public void setCallStatus(MarginEntityCallStatus callStatus) { + this.callStatus = callStatus; + } + public static class Builder { private String entityId; @@ -524,6 +711,22 @@ public static class Builder { private String pmMarginConsumed; + private String shortCollateralTransfer; + + private MarginHealthStatus healthStatus; + + private MarginLevel marginLevel; + + private MarginCallThresholds marginThresholds; + + private MarginControlStatus controlStatus; + + private String equityRatio; + + private String deficitRatio; + + private MarginEntityCallStatus callStatus; + public Builder entityId(String entityId) { this.entityId = entityId; return this; @@ -684,6 +887,46 @@ public Builder pmMarginConsumed(String pmMarginConsumed) { return this; } + public Builder shortCollateralTransfer(String shortCollateralTransfer) { + this.shortCollateralTransfer = shortCollateralTransfer; + return this; + } + + public Builder healthStatus(MarginHealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + public Builder marginLevel(MarginLevel marginLevel) { + this.marginLevel = marginLevel; + return this; + } + + public Builder marginThresholds(MarginCallThresholds marginThresholds) { + this.marginThresholds = marginThresholds; + return this; + } + + public Builder controlStatus(MarginControlStatus controlStatus) { + this.controlStatus = controlStatus; + return this; + } + + public Builder equityRatio(String equityRatio) { + this.equityRatio = equityRatio; + return this; + } + + public Builder deficitRatio(String deficitRatio) { + this.deficitRatio = deficitRatio; + return this; + } + + public Builder callStatus(MarginEntityCallStatus callStatus) { + this.callStatus = callStatus; + return this; + } + public MarginSummary build() { return new MarginSummary(this); } diff --git a/src/main/java/com/coinbase/prime/model/MarginThreshold.java b/src/main/java/com/coinbase/prime/model/MarginThreshold.java new file mode 100644 index 00000000..cb9e5731 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/MarginThreshold.java @@ -0,0 +1,125 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.MarginLevel; +import com.coinbase.prime.model.enums.MarginThresholdMarginThresholdType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** A single margin level, the ratio used to evaluate its threshold, and the threshold value. */ +public class MarginThreshold { + /** + * Calculated margin level based on the account's equity, margin requirement, margin limit, and + * configured thresholds. This reflects the current calculation for live responses or the recorded + * calculation for historical responses. It can differ from `health_status`, which is maintained + * by the margin-management process. The level alone doesn't determine whether a margin call is + * open or whether trading and withdrawals are allowed. - MARGIN_LEVEL_UNSPECIFIED: No calculated + * margin level is provided. - MARGIN_LEVEL_HEALTHY: Account equity is at or above the margin + * requirement. - MARGIN_LEVEL_DEFICIT: The calculation places the account in the deficit band. + * Margin-call issuance follows the applicable margin methodology. - MARGIN_LEVEL_WARNING: The + * calculation places the account in the warning band, approaching the critical threshold. - + * MARGIN_LEVEL_CRITICAL: The calculation places the account in the critical band. - + * MARGIN_LEVEL_LIQUIDATION: The calculation places the account in the liquidation band. This + * value alone doesn't indicate that liquidation has commenced. + */ + @JsonProperty("margin_level") + private MarginLevel marginLevel; + + /** + * Ratio used to evaluate a threshold. Rules are evaluated in configured order; the first matching + * rule determines the margin level when equity is below the margin requirement. A zero threshold + * imposes no constraint for that ratio. If the denominator is zero, the evaluator skips the + * division and checks the numerator condition: nonnegative equity for an equity-ratio rule, or a + * positive deficit for a deficit-ratio rule. - MARGIN_THRESHOLD_TYPE_UNSPECIFIED: No threshold + * type is provided. - MARGIN_THRESHOLD_TYPE_EQUITY_RATIO: For a nonzero threshold and positive + * margin requirement, the rule matches when equity is nonnegative and equity / margin requirement + * is greater than or equal to threshold_value. - MARGIN_THRESHOLD_TYPE_DEFICIT_RATIO: For a + * nonzero threshold and positive margin limit, the rule matches when the deficit is positive and + * (margin requirement - equity) / margin limit is greater than threshold_value. - + * MARGIN_THRESHOLD_TYPE_NONE: Fallback rule with no numeric ratio threshold. + */ + @JsonProperty("threshold_type") + private MarginThresholdMarginThresholdType thresholdType; + + /** + * Threshold expressed as a decimal ratio, not a percentage. For example, \"0.8\" represents 80%. + * Interpret this value together with threshold_type. + */ + @JsonProperty("threshold_value") + private String thresholdValue; + + public MarginThreshold() {} + + public MarginThreshold(Builder builder) { + this.marginLevel = builder.marginLevel; + this.thresholdType = builder.thresholdType; + this.thresholdValue = builder.thresholdValue; + } + + public MarginLevel getMarginLevel() { + return marginLevel; + } + + public void setMarginLevel(MarginLevel marginLevel) { + this.marginLevel = marginLevel; + } + + public MarginThresholdMarginThresholdType getThresholdType() { + return thresholdType; + } + + public void setThresholdType(MarginThresholdMarginThresholdType thresholdType) { + this.thresholdType = thresholdType; + } + + public String getThresholdValue() { + return thresholdValue; + } + + public void setThresholdValue(String thresholdValue) { + this.thresholdValue = thresholdValue; + } + + public static class Builder { + private MarginLevel marginLevel; + + private MarginThresholdMarginThresholdType thresholdType; + + private String thresholdValue; + + public Builder marginLevel(MarginLevel marginLevel) { + this.marginLevel = marginLevel; + return this; + } + + public Builder thresholdType(MarginThresholdMarginThresholdType thresholdType) { + this.thresholdType = thresholdType; + return this; + } + + public Builder thresholdValue(String thresholdValue) { + this.thresholdValue = thresholdValue; + return this; + } + + public MarginThreshold build() { + return new MarginThreshold(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/OnchainTransactionDetails.java b/src/main/java/com/coinbase/prime/model/OnchainTransactionDetails.java index c3896a83..5528aaf8 100644 --- a/src/main/java/com/coinbase/prime/model/OnchainTransactionDetails.java +++ b/src/main/java/com/coinbase/prime/model/OnchainTransactionDetails.java @@ -22,7 +22,11 @@ import com.fasterxml.jackson.annotation.JsonProperty; public class OnchainTransactionDetails { - /** The signed transaction data */ + /** + * The hex-encoded signed transaction. Only returned for transactions created with skip_broadcast + * set to true; empty for all other transactions, including broadcast transactions that have been + * signed. + */ @JsonProperty("signed_transaction") private String signedTransaction; @@ -64,6 +68,18 @@ public class OnchainTransactionDetails { @JsonProperty("signing_status") private SigningStatus signingStatus; + /** + * The hex-encoded unsigned transaction exactly as submitted when the transaction was created. + * This value is never updated. Before signing, Prime may set the nonce, network fees, or gas + * limit on EVM transactions, or refresh the recent blockhash on Solana transactions, so the + * transaction that is signed and broadcast can differ from this payload. The transfer amount is + * only changed for EVM transactions initiated as a maximum transfer of the network's native + * asset, where Prime lowers it so that the amount plus network fees does not exceed the wallet's + * current balance. + */ + @JsonProperty("original_unsigned_transaction") + private String originalUnsignedTransaction; + public OnchainTransactionDetails() {} public OnchainTransactionDetails(Builder builder) { @@ -76,6 +92,7 @@ public OnchainTransactionDetails(Builder builder) { this.skipBroadcast = builder.skipBroadcast; this.failureReason = builder.failureReason; this.signingStatus = builder.signingStatus; + this.originalUnsignedTransaction = builder.originalUnsignedTransaction; } public String getSignedTransaction() { @@ -150,6 +167,14 @@ public void setSigningStatus(SigningStatus signingStatus) { this.signingStatus = signingStatus; } + public String getOriginalUnsignedTransaction() { + return originalUnsignedTransaction; + } + + public void setOriginalUnsignedTransaction(String originalUnsignedTransaction) { + this.originalUnsignedTransaction = originalUnsignedTransaction; + } + public static class Builder { private String signedTransaction; @@ -169,6 +194,8 @@ public static class Builder { private SigningStatus signingStatus; + private String originalUnsignedTransaction; + public Builder signedTransaction(String signedTransaction) { this.signedTransaction = signedTransaction; return this; @@ -214,6 +241,11 @@ public Builder signingStatus(SigningStatus signingStatus) { return this; } + public Builder originalUnsignedTransaction(String originalUnsignedTransaction) { + this.originalUnsignedTransaction = originalUnsignedTransaction; + return this; + } + public OnchainTransactionDetails build() { return new OnchainTransactionDetails(this); } diff --git a/src/main/java/com/coinbase/prime/model/OptionGreeks.java b/src/main/java/com/coinbase/prime/model/OptionGreeks.java new file mode 100644 index 00000000..259063f3 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/OptionGreeks.java @@ -0,0 +1,109 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +/** Greeks of one option contract as quoted by the venue, not scaled by order size or side. */ +public class OptionGreeks { + /** Delta greek, in units of the underlying */ + private String delta; + + /** Gamma greek */ + private String gamma; + + /** Theta greek, in USD per day */ + private String theta; + + /** Vega greek, in USD per 1% change in implied volatility */ + private String vega; + + public OptionGreeks() {} + + public OptionGreeks(Builder builder) { + this.delta = builder.delta; + this.gamma = builder.gamma; + this.theta = builder.theta; + this.vega = builder.vega; + } + + public String getDelta() { + return delta; + } + + public void setDelta(String delta) { + this.delta = delta; + } + + public String getGamma() { + return gamma; + } + + public void setGamma(String gamma) { + this.gamma = gamma; + } + + public String getTheta() { + return theta; + } + + public void setTheta(String theta) { + this.theta = theta; + } + + public String getVega() { + return vega; + } + + public void setVega(String vega) { + this.vega = vega; + } + + public static class Builder { + private String delta; + + private String gamma; + + private String theta; + + private String vega; + + public Builder delta(String delta) { + this.delta = delta; + return this; + } + + public Builder gamma(String gamma) { + this.gamma = gamma; + return this; + } + + public Builder theta(String theta) { + this.theta = theta; + return this; + } + + public Builder vega(String vega) { + this.vega = vega; + return this; + } + + public OptionGreeks build() { + return new OptionGreeks(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/Order.java b/src/main/java/com/coinbase/prime/model/Order.java index f0907902..36e9ee80 100644 --- a/src/main/java/com/coinbase/prime/model/Order.java +++ b/src/main/java/com/coinbase/prime/model/Order.java @@ -18,6 +18,7 @@ package com.coinbase.prime.model; +import com.coinbase.prime.model.enums.LimitPriceType; import com.coinbase.prime.model.enums.OrderSide; import com.coinbase.prime.model.enums.OrderStatus; import com.coinbase.prime.model.enums.OrderType; @@ -43,7 +44,11 @@ public class Order { @JsonProperty("product_id") private String productId; - /** - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order */ + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ private OrderSide side; /** @@ -64,23 +69,33 @@ public class Order { * order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - RFQ: A [request for * quote](https://en.wikipedia.org/wiki/Request_for_quote) - PEG: A pegged order that dynamically * adjust based on market conditions while maintaining execution discretion and avoiding adverse - * selection + * selection - SPREAD: A spread order that trades a futures contract against its spot underlying, + * or against another futures contract of the same underlying (calendar spread), to capture a + * target spread (futures price - spot price, or back month - front month) */ private OrderType type; - /** Order size in base asset units (either `base_quantity` or `quote_value` is required) */ + /** + * Order size in base asset units (either `base_quantity` or `quote_value` is required). For + * SPREAD orders, in the primary leg's units: a whole number of contracts when it is a futures + * product + */ @JsonProperty("base_quantity") private String baseQuantity; /** * Order size in quote asset units, i.e. the amount the user wants to spend (when buying) or * receive (when selling); the quantity in base units will be determined based on the market - * liquidity and indicated `quote_value`. Either `base_quantity` or `quote_value` is required + * liquidity and indicated `quote_value`. Either `base_quantity` or `quote_value` is required. Not + * supported for SPREAD orders */ @JsonProperty("quote_value") private String quoteValue; - /** The limit price (required for TWAP, VWAP, LIMIT and STOP_LIMIT orders) */ + /** + * The limit price (required for TWAP, VWAP, LIMIT and STOP_LIMIT orders). Empty for SPREAD + * orders, which carry a spread limit in `spread_details` instead + */ @JsonProperty("limit_price") private String limitPrice; @@ -115,27 +130,38 @@ public class Order { @JsonProperty("created_at") private OffsetDateTime createdAt; - /** Size filled (in base asset units) */ + /** + * Size filled (in base asset units). Empty for SPREAD orders, whose legs fill in different units; + * see `spread_details` for each leg's value + */ @JsonProperty("filled_quantity") private String filledQuantity; - /** Market value filled (in quote asset units) */ + /** + * Market value filled (in quote asset units). For SPREAD orders, the sum of both legs' filled + * values + */ @JsonProperty("filled_value") private String filledValue; - /** Indicates the average `filled_price` */ + /** + * Indicates the average `filled_price`. Empty for SPREAD orders; see `spread_details` for each + * leg's value + */ @JsonProperty("average_filled_price") private String averageFilledPrice; /** * Total commission paid on this order (in quote asset units) -- only applicable for partially- or - * fully-filled orders + * fully-filled orders. For SPREAD orders, the sum of both legs' commissions; + * `commission_detail_total` is empty and each leg's breakdown is in `spread_details` */ private String commission; /** * Fee charged by the exchange for Cost Plus commission configurations. Exchange fee will be 0 for - * All In commission configurations. + * All In commission configurations. For SPREAD orders, the sum of both legs' exchange fees + * (`spread_details.primary_leg.exchange_fee` and `spread_details.secondary_leg.exchange_fee`). */ @JsonProperty("exchange_fee") private String exchangeFee; @@ -151,7 +177,10 @@ public class Order { @JsonProperty("stop_price") private String stopPrice; - /** Indicates the average `filled_price` net of commissions and fees */ + /** + * Indicates the average `filled_price` net of commissions and fees. Empty for SPREAD orders; see + * `spread_details` for each leg's value + */ @JsonProperty("net_average_filled_price") private String netAverageFilledPrice; @@ -207,7 +236,9 @@ public class Order { /** * - UNKNOWN_PRODUCT_TYPE: Unknown product type - SPOT: Spot product - FUTURE: Future product - - * OPTION: Option product + * OPTION: Option product - BASIS: Basis product: a futures contract traded against its spot + * underlying, or against another futures contract of the same underlying (calendar spread); the + * product of SPREAD orders */ @JsonProperty("product_type") private ProductType productType; @@ -222,6 +253,27 @@ public class Order { @JsonProperty("is_buy_exact") private boolean isBuyExact; + /** + * LimitPriceType indicates the unit `limit_price` is denominated in. Only meaningful for Deribit + * options - leave unspecified for every other order type and product, which are always priced in + * the quote currency. - UNKNOWN_LIMIT_PRICE_TYPE: nil value - `limit_price` is interpreted in the + * product's default/native unit - LIMIT_PRICE_TYPE_BASE_ASSET: `limit_price` is denominated in + * the underlying base asset (e.g. BTC for a BTC option). Only valid for Deribit options settled + * in the base asset. - LIMIT_PRICE_TYPE_QUOTE_ASSET: `limit_price` is denominated in the quote + * asset (e.g. USD/USDC). - LIMIT_PRICE_TYPE_IMPLIED_VOLATILITY: `limit_price` is an implied + * volatility percentage rather than a monetary amount (e.g. "65.5" means 65.5% implied + * volatility). + */ + @JsonProperty("limit_price_type") + private LimitPriceType limitPriceType; + + /** + * A SPREAD order as placed and executed: the spread configuration, the spread product and each + * leg's fills + */ + @JsonProperty("spread_details") + private SpreadDetails spreadDetails; + public Order() {} public Order(Builder builder) { @@ -263,6 +315,8 @@ public Order(Builder builder) { this.productType = builder.productType; this.commissionDetailTotal = builder.commissionDetailTotal; this.isBuyExact = builder.isBuyExact; + this.limitPriceType = builder.limitPriceType; + this.spreadDetails = builder.spreadDetails; } public String getId() { @@ -569,6 +623,22 @@ public void setIsBuyExact(boolean isBuyExact) { this.isBuyExact = isBuyExact; } + public LimitPriceType getLimitPriceType() { + return limitPriceType; + } + + public void setLimitPriceType(LimitPriceType limitPriceType) { + this.limitPriceType = limitPriceType; + } + + public SpreadDetails getSpreadDetails() { + return spreadDetails; + } + + public void setSpreadDetails(SpreadDetails spreadDetails) { + this.spreadDetails = spreadDetails; + } + public static class Builder { private String id; @@ -646,6 +716,10 @@ public static class Builder { private boolean isBuyExact; + private LimitPriceType limitPriceType; + + private SpreadDetails spreadDetails; + public Builder id(String id) { this.id = id; return this; @@ -836,6 +910,16 @@ public Builder isBuyExact(boolean isBuyExact) { return this; } + public Builder limitPriceType(LimitPriceType limitPriceType) { + this.limitPriceType = limitPriceType; + return this; + } + + public Builder spreadDetails(SpreadDetails spreadDetails) { + this.spreadDetails = spreadDetails; + return this; + } + public Order build() { return new Order(this); } diff --git a/src/main/java/com/coinbase/prime/model/PaymentMethodDetails.java b/src/main/java/com/coinbase/prime/model/PaymentMethodDetails.java index 7c12fac8..8bb9e0b6 100644 --- a/src/main/java/com/coinbase/prime/model/PaymentMethodDetails.java +++ b/src/main/java/com/coinbase/prime/model/PaymentMethodDetails.java @@ -27,8 +27,10 @@ public class PaymentMethodDetails { private String symbol; /** - * - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - METHOD_WIRE: Wire transfer - METHOD_SEN: Silvergate - * exchange network - METHOD_SWIFT: Swift + * - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - METHOD_WIRE: Wire transfer - METHOD_SEN: DEPRECATED. + * Silvergate exchange network - METHOD_SWIFT: Swift - METHOD_SEPA: Single Euro Payments Area - + * METHOD_CBIT: Customers Bank Instant Token - METHOD_PIX: Brazilian instant payment system - + * METHOD_JPM_KINEXYS: JPMorgan Kinexys */ @JsonProperty("payment_method_type") private PaymentMethodType paymentMethodType; diff --git a/src/main/java/com/coinbase/prime/model/PaymentMethodSummary.java b/src/main/java/com/coinbase/prime/model/PaymentMethodSummary.java index 1e76f859..b8ef9602 100644 --- a/src/main/java/com/coinbase/prime/model/PaymentMethodSummary.java +++ b/src/main/java/com/coinbase/prime/model/PaymentMethodSummary.java @@ -27,8 +27,10 @@ public class PaymentMethodSummary { private String symbol; /** - * - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - METHOD_WIRE: Wire transfer - METHOD_SEN: Silvergate - * exchange network - METHOD_SWIFT: Swift + * - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - METHOD_WIRE: Wire transfer - METHOD_SEN: DEPRECATED. + * Silvergate exchange network - METHOD_SWIFT: Swift - METHOD_SEPA: Single Euro Payments Area - + * METHOD_CBIT: Customers Bank Instant Token - METHOD_PIX: Brazilian instant payment system - + * METHOD_JPM_KINEXYS: JPMorgan Kinexys */ @JsonProperty("payment_method_type") private PaymentMethodType paymentMethodType; diff --git a/src/main/java/com/coinbase/prime/model/PortfolioStakingMetadata.java b/src/main/java/com/coinbase/prime/model/PortfolioStakingMetadata.java index 44c43eb0..e6a99172 100644 --- a/src/main/java/com/coinbase/prime/model/PortfolioStakingMetadata.java +++ b/src/main/java/com/coinbase/prime/model/PortfolioStakingMetadata.java @@ -22,8 +22,8 @@ public class PortfolioStakingMetadata { /** - * An optional custom identifier (up to 255 characters) to attach to the transaction. This is not - * a searchable transaction field. + * An optional custom identifier (up to 255 bytes) to attach to the transaction. This is not a + * searchable transaction field. */ @JsonProperty("external_id") private String externalId; diff --git a/src/main/java/com/coinbase/prime/model/Product.java b/src/main/java/com/coinbase/prime/model/Product.java index 58e0ca85..62f1499f 100644 --- a/src/main/java/com/coinbase/prime/model/Product.java +++ b/src/main/java/com/coinbase/prime/model/Product.java @@ -63,7 +63,9 @@ public class Product { /** * - UNKNOWN_PRODUCT_TYPE: Unknown product type - SPOT: Spot product - FUTURE: Future product - - * OPTION: Option product + * OPTION: Option product - BASIS: Basis product: a futures contract traded against its spot + * underlying, or against another futures contract of the same underlying (calendar spread); the + * product of SPREAD orders */ @JsonProperty("product_type") private ProductType productType; diff --git a/src/main/java/com/coinbase/prime/model/RewardMetadata.java b/src/main/java/com/coinbase/prime/model/RewardMetadata.java index c5dc33a9..9d9b1559 100644 --- a/src/main/java/com/coinbase/prime/model/RewardMetadata.java +++ b/src/main/java/com/coinbase/prime/model/RewardMetadata.java @@ -31,7 +31,8 @@ public class RewardMetadata { * transaction (execution layer) rewards - STAKING_FEE_REBATE_REWARD: A staking fee rebate reward * i.e. coinbase pays rebates for staking fees to eligible delegators - BUIDL_DIVIDEND: A BUIDL * dividend reward i.e. dividends from BUIDL fund holdings - CUSTOM_STABLECOIN_REWARD: A custom - * stablecoin reward i.e. USDC reward payouts + * stablecoin reward i.e. USDC reward payouts - TRADING_FEE_REBATE_REWARD: A trading fee rebate + * reward i.e. USDC trading-fee rebates paid by Coinbase */ private RewardSubtype subtype; diff --git a/src/main/java/com/coinbase/prime/model/BetaRewardsRateTier.java b/src/main/java/com/coinbase/prime/model/RewardsRateTier.java similarity index 77% rename from src/main/java/com/coinbase/prime/model/BetaRewardsRateTier.java rename to src/main/java/com/coinbase/prime/model/RewardsRateTier.java index 2c85a3dc..2ccf222e 100644 --- a/src/main/java/com/coinbase/prime/model/BetaRewardsRateTier.java +++ b/src/main/java/com/coinbase/prime/model/RewardsRateTier.java @@ -18,10 +18,11 @@ package com.coinbase.prime.model; -import com.coinbase.prime.model.enums.BetaRewardsRateTierType; +import com.coinbase.prime.model.enums.RewardsRateTierType; import com.fasterxml.jackson.annotation.JsonProperty; -public class BetaRewardsRateTier { +/** RewardsRateTier is a single tier in the rewards rate card. */ +public class RewardsRateTier { /** Rate for this tier. */ private String rate; @@ -33,12 +34,13 @@ public class BetaRewardsRateTier { @JsonProperty("upper_limit") private String upperLimit; + /** RewardsRateTierType describes what a rewards rate tier is scoped by. */ @JsonProperty("criteria_type") - private BetaRewardsRateTierType criteriaType; + private RewardsRateTierType criteriaType; - public BetaRewardsRateTier() {} + public RewardsRateTier() {} - public BetaRewardsRateTier(Builder builder) { + public RewardsRateTier(Builder builder) { this.rate = builder.rate; this.lowerLimit = builder.lowerLimit; this.upperLimit = builder.upperLimit; @@ -69,11 +71,11 @@ public void setUpperLimit(String upperLimit) { this.upperLimit = upperLimit; } - public BetaRewardsRateTierType getCriteriaType() { + public RewardsRateTierType getCriteriaType() { return criteriaType; } - public void setCriteriaType(BetaRewardsRateTierType criteriaType) { + public void setCriteriaType(RewardsRateTierType criteriaType) { this.criteriaType = criteriaType; } @@ -84,7 +86,7 @@ public static class Builder { private String upperLimit; - private BetaRewardsRateTierType criteriaType; + private RewardsRateTierType criteriaType; public Builder rate(String rate) { this.rate = rate; @@ -101,13 +103,13 @@ public Builder upperLimit(String upperLimit) { return this; } - public Builder criteriaType(BetaRewardsRateTierType criteriaType) { + public Builder criteriaType(RewardsRateTierType criteriaType) { this.criteriaType = criteriaType; return this; } - public BetaRewardsRateTier build() { - return new BetaRewardsRateTier(this); + public RewardsRateTier build() { + return new RewardsRateTier(this); } } } diff --git a/src/main/java/com/coinbase/prime/model/SpreadConfig.java b/src/main/java/com/coinbase/prime/model/SpreadConfig.java new file mode 100644 index 00000000..d0450ce9 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/SpreadConfig.java @@ -0,0 +1,172 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.MaxDeltaType; +import com.coinbase.prime.model.enums.SpreadLimitType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * `primary_leg`: its product_id must equal the order's `product_id`, and `base_quantity` is in its + * units. For a calendar spread (two futures) it must be the back month. + */ +public class SpreadConfig { + /** + * Worst acceptable spread (futures - spot), signed decimal. A buy-futures spread executes when + * the spread is at or below the limit, a sell-futures spread when it is at or above. + */ + private String limit; + + /** + * - UNKNOWN_SPREAD_LIMIT_TYPE: nil value - SPREAD_LIMIT_TYPE_BPS: Limit in basis points of the + * spot price - SPREAD_LIMIT_TYPE_USD: Limit in USD + */ + @JsonProperty("limit_type") + private SpreadLimitType limitType; + + /** + * Maximum allowed difference between the filled sizes of the two legs, in the unit given by + * `max_delta_type` + */ + @JsonProperty("max_delta_size") + private String maxDeltaSize; + + /** + * - UNKNOWN_MAX_DELTA_TYPE: nil value - MAX_DELTA_TYPE_SPOT: Absolute size in spot base units. + * Not accepted for a calendar spread (two futures). - MAX_DELTA_TYPE_PERCENT: Percentage of the + * order size - MAX_DELTA_TYPE_CONTRACT: Absolute number of futures contracts + */ + @JsonProperty("max_delta_type") + private MaxDeltaType maxDeltaType; + + /** One leg of a SPREAD order */ + @JsonProperty("primary_leg") + private Leg primaryLeg; + + /** One leg of a SPREAD order */ + @JsonProperty("secondary_leg") + private Leg secondaryLeg; + + public SpreadConfig() {} + + public SpreadConfig(Builder builder) { + this.limit = builder.limit; + this.limitType = builder.limitType; + this.maxDeltaSize = builder.maxDeltaSize; + this.maxDeltaType = builder.maxDeltaType; + this.primaryLeg = builder.primaryLeg; + this.secondaryLeg = builder.secondaryLeg; + } + + public String getLimit() { + return limit; + } + + public void setLimit(String limit) { + this.limit = limit; + } + + public SpreadLimitType getLimitType() { + return limitType; + } + + public void setLimitType(SpreadLimitType limitType) { + this.limitType = limitType; + } + + public String getMaxDeltaSize() { + return maxDeltaSize; + } + + public void setMaxDeltaSize(String maxDeltaSize) { + this.maxDeltaSize = maxDeltaSize; + } + + public MaxDeltaType getMaxDeltaType() { + return maxDeltaType; + } + + public void setMaxDeltaType(MaxDeltaType maxDeltaType) { + this.maxDeltaType = maxDeltaType; + } + + public Leg getPrimaryLeg() { + return primaryLeg; + } + + public void setPrimaryLeg(Leg primaryLeg) { + this.primaryLeg = primaryLeg; + } + + public Leg getSecondaryLeg() { + return secondaryLeg; + } + + public void setSecondaryLeg(Leg secondaryLeg) { + this.secondaryLeg = secondaryLeg; + } + + public static class Builder { + private String limit; + + private SpreadLimitType limitType; + + private String maxDeltaSize; + + private MaxDeltaType maxDeltaType; + + private Leg primaryLeg; + + private Leg secondaryLeg; + + public Builder limit(String limit) { + this.limit = limit; + return this; + } + + public Builder limitType(SpreadLimitType limitType) { + this.limitType = limitType; + return this; + } + + public Builder maxDeltaSize(String maxDeltaSize) { + this.maxDeltaSize = maxDeltaSize; + return this; + } + + public Builder maxDeltaType(MaxDeltaType maxDeltaType) { + this.maxDeltaType = maxDeltaType; + return this; + } + + public Builder primaryLeg(Leg primaryLeg) { + this.primaryLeg = primaryLeg; + return this; + } + + public Builder secondaryLeg(Leg secondaryLeg) { + this.secondaryLeg = secondaryLeg; + return this; + } + + public SpreadConfig build() { + return new SpreadConfig(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/SpreadDetails.java b/src/main/java/com/coinbase/prime/model/SpreadDetails.java new file mode 100644 index 00000000..01a72264 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/SpreadDetails.java @@ -0,0 +1,215 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.MaxDeltaType; +import com.coinbase.prime.model.enums.SpreadLimitType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A SPREAD order as placed and executed: the spread configuration, the spread product and each + * leg's fills + */ +public class SpreadDetails { + /** The spread limit the order was placed with, see `SpreadConfig.limit` */ + private String limit; + + /** + * - UNKNOWN_SPREAD_LIMIT_TYPE: nil value - SPREAD_LIMIT_TYPE_BPS: Limit in basis points of the + * spot price - SPREAD_LIMIT_TYPE_USD: Limit in USD + */ + @JsonProperty("limit_type") + private SpreadLimitType limitType; + + /** The max delta size the order was placed with, see `SpreadConfig.max_delta_size` */ + @JsonProperty("max_delta_size") + private String maxDeltaSize; + + /** + * - UNKNOWN_MAX_DELTA_TYPE: nil value - MAX_DELTA_TYPE_SPOT: Absolute size in spot base units. + * Not accepted for a calendar spread (two futures). - MAX_DELTA_TYPE_PERCENT: Percentage of the + * order size - MAX_DELTA_TYPE_CONTRACT: Absolute number of futures contracts + */ + @JsonProperty("max_delta_type") + private MaxDeltaType maxDeltaType; + + /** + * Product ID of the spread product the order is placed on, in the form : (back month:front month for a futures-futures spread), e.g. BIP-20DEC30-CDE:BTC-USD + */ + @JsonProperty("group_product_id") + private String groupProductId; + + /** + * Realized spread of the fills so far, in the unit of `limit_type`: for SPREAD_LIMIT_TYPE_USD the + * futures leg's average filled price minus the spot leg's, in the quote currency; for + * SPREAD_LIMIT_TYPE_BPS that difference in basis points of the spot leg's average filled price + * ((futures / spot - 1) x 10000). For a futures-futures spread, back month in place of futures + * and front month in place of spot. Empty until both legs have fills + */ + @JsonProperty("realized_spread") + private String realizedSpread; + + /** One leg of a SPREAD order as placed and executed */ + @JsonProperty("primary_leg") + private SpreadLegDetails primaryLeg; + + /** One leg of a SPREAD order as placed and executed */ + @JsonProperty("secondary_leg") + private SpreadLegDetails secondaryLeg; + + public SpreadDetails() {} + + public SpreadDetails(Builder builder) { + this.limit = builder.limit; + this.limitType = builder.limitType; + this.maxDeltaSize = builder.maxDeltaSize; + this.maxDeltaType = builder.maxDeltaType; + this.groupProductId = builder.groupProductId; + this.realizedSpread = builder.realizedSpread; + this.primaryLeg = builder.primaryLeg; + this.secondaryLeg = builder.secondaryLeg; + } + + public String getLimit() { + return limit; + } + + public void setLimit(String limit) { + this.limit = limit; + } + + public SpreadLimitType getLimitType() { + return limitType; + } + + public void setLimitType(SpreadLimitType limitType) { + this.limitType = limitType; + } + + public String getMaxDeltaSize() { + return maxDeltaSize; + } + + public void setMaxDeltaSize(String maxDeltaSize) { + this.maxDeltaSize = maxDeltaSize; + } + + public MaxDeltaType getMaxDeltaType() { + return maxDeltaType; + } + + public void setMaxDeltaType(MaxDeltaType maxDeltaType) { + this.maxDeltaType = maxDeltaType; + } + + public String getGroupProductId() { + return groupProductId; + } + + public void setGroupProductId(String groupProductId) { + this.groupProductId = groupProductId; + } + + public String getRealizedSpread() { + return realizedSpread; + } + + public void setRealizedSpread(String realizedSpread) { + this.realizedSpread = realizedSpread; + } + + public SpreadLegDetails getPrimaryLeg() { + return primaryLeg; + } + + public void setPrimaryLeg(SpreadLegDetails primaryLeg) { + this.primaryLeg = primaryLeg; + } + + public SpreadLegDetails getSecondaryLeg() { + return secondaryLeg; + } + + public void setSecondaryLeg(SpreadLegDetails secondaryLeg) { + this.secondaryLeg = secondaryLeg; + } + + public static class Builder { + private String limit; + + private SpreadLimitType limitType; + + private String maxDeltaSize; + + private MaxDeltaType maxDeltaType; + + private String groupProductId; + + private String realizedSpread; + + private SpreadLegDetails primaryLeg; + + private SpreadLegDetails secondaryLeg; + + public Builder limit(String limit) { + this.limit = limit; + return this; + } + + public Builder limitType(SpreadLimitType limitType) { + this.limitType = limitType; + return this; + } + + public Builder maxDeltaSize(String maxDeltaSize) { + this.maxDeltaSize = maxDeltaSize; + return this; + } + + public Builder maxDeltaType(MaxDeltaType maxDeltaType) { + this.maxDeltaType = maxDeltaType; + return this; + } + + public Builder groupProductId(String groupProductId) { + this.groupProductId = groupProductId; + return this; + } + + public Builder realizedSpread(String realizedSpread) { + this.realizedSpread = realizedSpread; + return this; + } + + public Builder primaryLeg(SpreadLegDetails primaryLeg) { + this.primaryLeg = primaryLeg; + return this; + } + + public Builder secondaryLeg(SpreadLegDetails secondaryLeg) { + this.secondaryLeg = secondaryLeg; + return this; + } + + public SpreadDetails build() { + return new SpreadDetails(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/SpreadLegDetails.java b/src/main/java/com/coinbase/prime/model/SpreadLegDetails.java new file mode 100644 index 00000000..5ebda2b8 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/SpreadLegDetails.java @@ -0,0 +1,221 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.OrderSide; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** One leg of a SPREAD order as placed and executed */ +public class SpreadLegDetails { + /** Product ID of the leg, e.g. BTC-USD or BIP-20DEC30-CDE */ + @JsonProperty("product_id") + private String productId; + + /** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: + * a SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in + * requests + */ + private OrderSide side; + + /** Whether this leg may rest passively on the book */ + @JsonProperty("support_passive_order") + private boolean supportPassiveOrder; + + /** + * Quantity filled on this leg, in its units: contracts for a futures product, base units for spot + */ + @JsonProperty("filled_quantity") + private String filledQuantity; + + /** Average price of this leg's fills, per unit of the underlying */ + @JsonProperty("average_filled_price") + private String averageFilledPrice; + + /** Commission charged on this leg so far */ + private String commission; + + @JsonProperty("commission_detail_total") + private CommissionDetailTotal commissionDetailTotal; + + /** + * Fee charged by the exchange on this leg for Cost Plus commission configurations; 0 for All In + */ + @JsonProperty("exchange_fee") + private String exchangeFee; + + /** Notional value of this leg's fills so far, in the quote currency */ + @JsonProperty("filled_value") + private String filledValue; + + public SpreadLegDetails() {} + + public SpreadLegDetails(Builder builder) { + this.productId = builder.productId; + this.side = builder.side; + this.supportPassiveOrder = builder.supportPassiveOrder; + this.filledQuantity = builder.filledQuantity; + this.averageFilledPrice = builder.averageFilledPrice; + this.commission = builder.commission; + this.commissionDetailTotal = builder.commissionDetailTotal; + this.exchangeFee = builder.exchangeFee; + this.filledValue = builder.filledValue; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public OrderSide getSide() { + return side; + } + + public void setSide(OrderSide side) { + this.side = side; + } + + public boolean getSupportPassiveOrder() { + return supportPassiveOrder; + } + + public void setSupportPassiveOrder(boolean supportPassiveOrder) { + this.supportPassiveOrder = supportPassiveOrder; + } + + public String getFilledQuantity() { + return filledQuantity; + } + + public void setFilledQuantity(String filledQuantity) { + this.filledQuantity = filledQuantity; + } + + public String getAverageFilledPrice() { + return averageFilledPrice; + } + + public void setAverageFilledPrice(String averageFilledPrice) { + this.averageFilledPrice = averageFilledPrice; + } + + public String getCommission() { + return commission; + } + + public void setCommission(String commission) { + this.commission = commission; + } + + public CommissionDetailTotal getCommissionDetailTotal() { + return commissionDetailTotal; + } + + public void setCommissionDetailTotal(CommissionDetailTotal commissionDetailTotal) { + this.commissionDetailTotal = commissionDetailTotal; + } + + public String getExchangeFee() { + return exchangeFee; + } + + public void setExchangeFee(String exchangeFee) { + this.exchangeFee = exchangeFee; + } + + public String getFilledValue() { + return filledValue; + } + + public void setFilledValue(String filledValue) { + this.filledValue = filledValue; + } + + public static class Builder { + private String productId; + + private OrderSide side; + + private boolean supportPassiveOrder; + + private String filledQuantity; + + private String averageFilledPrice; + + private String commission; + + private CommissionDetailTotal commissionDetailTotal; + + private String exchangeFee; + + private String filledValue; + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder side(OrderSide side) { + this.side = side; + return this; + } + + public Builder supportPassiveOrder(boolean supportPassiveOrder) { + this.supportPassiveOrder = supportPassiveOrder; + return this; + } + + public Builder filledQuantity(String filledQuantity) { + this.filledQuantity = filledQuantity; + return this; + } + + public Builder averageFilledPrice(String averageFilledPrice) { + this.averageFilledPrice = averageFilledPrice; + return this; + } + + public Builder commission(String commission) { + this.commission = commission; + return this; + } + + public Builder commissionDetailTotal(CommissionDetailTotal commissionDetailTotal) { + this.commissionDetailTotal = commissionDetailTotal; + return this; + } + + public Builder exchangeFee(String exchangeFee) { + this.exchangeFee = exchangeFee; + return this; + } + + public Builder filledValue(String filledValue) { + this.filledValue = filledValue; + return this; + } + + public SpreadLegDetails build() { + return new SpreadLegDetails(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/SpreadPreview.java b/src/main/java/com/coinbase/prime/model/SpreadPreview.java new file mode 100644 index 00000000..c320c390 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/SpreadPreview.java @@ -0,0 +1,181 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.MaxDeltaType; +import com.coinbase.prime.model.enums.SpreadLimitType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SPREAD order preview: the submitted configuration plus per-leg values */ +public class SpreadPreview { + private String limit; + + /** + * - UNKNOWN_SPREAD_LIMIT_TYPE: nil value - SPREAD_LIMIT_TYPE_BPS: Limit in basis points of the + * spot price - SPREAD_LIMIT_TYPE_USD: Limit in USD + */ + @JsonProperty("limit_type") + private SpreadLimitType limitType; + + @JsonProperty("max_delta_size") + private String maxDeltaSize; + + /** + * - UNKNOWN_MAX_DELTA_TYPE: nil value - MAX_DELTA_TYPE_SPOT: Absolute size in spot base units. + * Not accepted for a calendar spread (two futures). - MAX_DELTA_TYPE_PERCENT: Percentage of the + * order size - MAX_DELTA_TYPE_CONTRACT: Absolute number of futures contracts + */ + @JsonProperty("max_delta_type") + private MaxDeltaType maxDeltaType; + + /** Product ID of the spread product, in the form : */ + @JsonProperty("group_product_id") + private String groupProductId; + + /** Preview values for one leg of a SPREAD order */ + @JsonProperty("primary_leg") + private LegPreview primaryLeg; + + /** Preview values for one leg of a SPREAD order */ + @JsonProperty("secondary_leg") + private LegPreview secondaryLeg; + + public SpreadPreview() {} + + public SpreadPreview(Builder builder) { + this.limit = builder.limit; + this.limitType = builder.limitType; + this.maxDeltaSize = builder.maxDeltaSize; + this.maxDeltaType = builder.maxDeltaType; + this.groupProductId = builder.groupProductId; + this.primaryLeg = builder.primaryLeg; + this.secondaryLeg = builder.secondaryLeg; + } + + public String getLimit() { + return limit; + } + + public void setLimit(String limit) { + this.limit = limit; + } + + public SpreadLimitType getLimitType() { + return limitType; + } + + public void setLimitType(SpreadLimitType limitType) { + this.limitType = limitType; + } + + public String getMaxDeltaSize() { + return maxDeltaSize; + } + + public void setMaxDeltaSize(String maxDeltaSize) { + this.maxDeltaSize = maxDeltaSize; + } + + public MaxDeltaType getMaxDeltaType() { + return maxDeltaType; + } + + public void setMaxDeltaType(MaxDeltaType maxDeltaType) { + this.maxDeltaType = maxDeltaType; + } + + public String getGroupProductId() { + return groupProductId; + } + + public void setGroupProductId(String groupProductId) { + this.groupProductId = groupProductId; + } + + public LegPreview getPrimaryLeg() { + return primaryLeg; + } + + public void setPrimaryLeg(LegPreview primaryLeg) { + this.primaryLeg = primaryLeg; + } + + public LegPreview getSecondaryLeg() { + return secondaryLeg; + } + + public void setSecondaryLeg(LegPreview secondaryLeg) { + this.secondaryLeg = secondaryLeg; + } + + public static class Builder { + private String limit; + + private SpreadLimitType limitType; + + private String maxDeltaSize; + + private MaxDeltaType maxDeltaType; + + private String groupProductId; + + private LegPreview primaryLeg; + + private LegPreview secondaryLeg; + + public Builder limit(String limit) { + this.limit = limit; + return this; + } + + public Builder limitType(SpreadLimitType limitType) { + this.limitType = limitType; + return this; + } + + public Builder maxDeltaSize(String maxDeltaSize) { + this.maxDeltaSize = maxDeltaSize; + return this; + } + + public Builder maxDeltaType(MaxDeltaType maxDeltaType) { + this.maxDeltaType = maxDeltaType; + return this; + } + + public Builder groupProductId(String groupProductId) { + this.groupProductId = groupProductId; + return this; + } + + public Builder primaryLeg(LegPreview primaryLeg) { + this.primaryLeg = primaryLeg; + return this; + } + + public Builder secondaryLeg(LegPreview secondaryLeg) { + this.secondaryLeg = secondaryLeg; + return this; + } + + public SpreadPreview build() { + return new SpreadPreview(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/Transaction.java b/src/main/java/com/coinbase/prime/model/Transaction.java index 08651a2d..6c51db9e 100644 --- a/src/main/java/com/coinbase/prime/model/Transaction.java +++ b/src/main/java/com/coinbase/prime/model/Transaction.java @@ -66,6 +66,9 @@ public class Transaction { * On-chain transaction initiated with Prime Onchain Wallet - PORTFOLIO_STAKE: Portfolio-level * staking operation - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation - MERGE_STAKE: * On-chain transaction consolidating funds from different addresses belonging to the same wallet. + * - ONCHAIN_DEPOSIT: On-chain deposit detected into a Prime Onchain Wallet - ONCHAIN_REWARD: + * Automated on-chain reward payout to a blockchain address - ONCHAIN_MESSAGE: Message signing + * initiated with Prime Onchain Wallet; no funds move on-chain. */ private TransactionType type; @@ -113,7 +116,11 @@ public class Transaction { @JsonProperty("completed_at") private OffsetDateTime completedAt; - /** The transaction amount in whole units */ + /** + * The transaction amount (in whole units). For example, \"1.50\" represents 1.5 of the associated + * symbol. Examples: - \"100\" - \"1.123456\" (precision varies by asset; USDC, for example, + * supports up to 6 decimal places) - \"0.50\" + */ private String amount; @JsonProperty("transfer_from") @@ -122,14 +129,25 @@ public class Transaction { @JsonProperty("transfer_to") private TransferLocation transferTo; - /** The blockchain network fees (in whole units) required in order to broadcast the transaction */ + /** + * The blockchain network fees (in whole units) required in order to broadcast the transaction. + * Does not carry the Advanced Transfer Coinbase fee. + */ @JsonProperty("network_fees") private String networkFees; - /** The fees that the customer paid for the transaction (in whole units) */ + /** + * The charged fee (in whole units). On the transfer, coinbase_fees is set and fees is 0. On the + * send, the same charge is on fees and fee_symbol, and coinbase_fees is omitted. Crypto and fiat + * sends that belong to the transfer use those transfer and send fields. A bank withdrawal that is + * not part of the transfer is unchanged. + */ private String fees; - /** The asset in which fees will be paid */ + /** + * The asset in which fees is denominated. On the send, the same charge is on fees and fee_symbol, + * and coinbase_fees is omitted. On the transfer, fee_symbol is empty. + */ @JsonProperty("fee_symbol") private String feeSymbol; @@ -151,7 +169,7 @@ public class Transaction { /** The network name specific to onchain/onchain wallet transactions */ private String network; - /** The estimated asset changes (onchain) */ + /** The estimated asset changes (onchain/onchain) */ @JsonProperty("estimated_asset_changes") private List estimatedAssetChanges; @@ -171,6 +189,17 @@ public class Transaction { @JsonProperty("process_requirements") private ProcessRequirements processRequirements; + /** + * Coinbase fees on the transfer (amount, symbol, wallet_id), where fees is 0. On the send, the + * same charge is on fees and fee_symbol, and coinbase_fees is omitted. When you total fees, do + * not add coinbase_fees from the transfer to the send's fees, or you will count the charge twice. + * A wallet transaction list includes the fees paid by that wallet. Get Transaction and the + * portfolio transaction list include every fee paid in the requesting portfolio. Fees paid in the + * counterparty's portfolio are omitted. + */ + @JsonProperty("coinbase_fees") + private List coinbaseFees; + public Transaction() {} public Transaction(Builder builder) { @@ -199,6 +228,7 @@ public Transaction(Builder builder) { this.onchainDetails = builder.onchainDetails; this.networkInfo = builder.networkInfo; this.processRequirements = builder.processRequirements; + this.coinbaseFees = builder.coinbaseFees; } public String getId() { @@ -401,6 +431,14 @@ public void setProcessRequirements(ProcessRequirements processRequirements) { this.processRequirements = processRequirements; } + public List getCoinbaseFees() { + return coinbaseFees; + } + + public void setCoinbaseFees(List coinbaseFees) { + this.coinbaseFees = coinbaseFees; + } + public static class Builder { private String id; @@ -452,6 +490,8 @@ public static class Builder { private ProcessRequirements processRequirements; + private List coinbaseFees; + public Builder id(String id) { this.id = id; return this; @@ -577,6 +617,11 @@ public Builder processRequirements(ProcessRequirements processRequirements) { return this; } + public Builder coinbaseFees(List coinbaseFees) { + this.coinbaseFees = coinbaseFees; + return this; + } + public Transaction build() { return new Transaction(this); } diff --git a/src/main/java/com/coinbase/prime/model/TransferLocation.java b/src/main/java/com/coinbase/prime/model/TransferLocation.java index 5bcea1a2..74bf4431 100644 --- a/src/main/java/com/coinbase/prime/model/TransferLocation.java +++ b/src/main/java/com/coinbase/prime/model/TransferLocation.java @@ -25,8 +25,9 @@ public class TransferLocation { /** * - TRANSFER_LOCATION_TYPE_UNKNOWN: The nil value - PAYMENT_METHOD: The ID of a fiat payment * method - WALLET: The ID of a wallet - ADDRESS: A cryptocurrency address - OTHER: Another type - * of transfer location: Blockchain Network, Coinbase - MULTIPLE_ADDRESSES: Multiple - * cryptocurrency addresses - COUNTERPARTY_ID: Counterparty ID + * of transfer location: Blockchain Network, Coinbase - MULTIPLE_ADDRESSES: More than one + * cryptocurrency address. value and address are empty; the addresses are not listed. A single + * address uses ADDRESS. - COUNTERPARTY_ID: Counterparty ID */ private TransferLocationType type; diff --git a/src/main/java/com/coinbase/prime/model/WalletCryptoDepositInstructions.java b/src/main/java/com/coinbase/prime/model/WalletCryptoDepositInstructions.java index 59916531..b68a8aa9 100644 --- a/src/main/java/com/coinbase/prime/model/WalletCryptoDepositInstructions.java +++ b/src/main/java/com/coinbase/prime/model/WalletCryptoDepositInstructions.java @@ -31,7 +31,7 @@ public class WalletCryptoDepositInstructions { /** * - UNKNOWN_WALLET_DEPOSIT_TYPE: nil value - CRYPTO: A cryptocurrency deposit - WIRE: A wire * deposit - SEN: DEPRECATED. A Silvergate Exchange Network deposit - SWIFT: A SWIFT deposit - - * SEPA: A SEPA deposit (Single Euro Payments Area) + * SEPA: A SEPA deposit (Single Euro Payments Area) - KINEXYS: A JPM Kinexys deposit */ private WalletDepositInstructionType type; diff --git a/src/main/java/com/coinbase/prime/model/WalletFiatDepositInstructions.java b/src/main/java/com/coinbase/prime/model/WalletFiatDepositInstructions.java index 5b8e011f..e648b6cb 100644 --- a/src/main/java/com/coinbase/prime/model/WalletFiatDepositInstructions.java +++ b/src/main/java/com/coinbase/prime/model/WalletFiatDepositInstructions.java @@ -31,7 +31,7 @@ public class WalletFiatDepositInstructions { /** * - UNKNOWN_WALLET_DEPOSIT_TYPE: nil value - CRYPTO: A cryptocurrency deposit - WIRE: A wire * deposit - SEN: DEPRECATED. A Silvergate Exchange Network deposit - SWIFT: A SWIFT deposit - - * SEPA: A SEPA deposit (Single Euro Payments Area) + * SEPA: A SEPA deposit (Single Euro Payments Area) - KINEXYS: A JPM Kinexys deposit */ private WalletDepositInstructionType type; diff --git a/src/main/java/com/coinbase/prime/model/WalletStakingMetadata.java b/src/main/java/com/coinbase/prime/model/WalletStakingMetadata.java index f7037786..c7cfa712 100644 --- a/src/main/java/com/coinbase/prime/model/WalletStakingMetadata.java +++ b/src/main/java/com/coinbase/prime/model/WalletStakingMetadata.java @@ -21,11 +21,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * WalletStakingMetadata contains optional metadata for wallet staking requests. external_id tags - * the discrete TWS transaction stake/unstake create; automatic reward crediting (e.g. SOL - * inflation) does not produce one. StakingClaimRewardsRequest intentionally omits this field; add - * metadata to claim rewards only if a supported network's claim flow creates a discrete TWS - * transaction clients need to tag. + * WalletStakingMetadata contains optional metadata for wallet staking requests. Optional metadata + * to attach to this staking or delegation request. Automatic reward crediting (such as SOL + * inflation) does not produce a taggable transaction and therefore does not support metadata; see + * the field descriptions below for details. */ public class WalletStakingMetadata { /** diff --git a/src/main/java/com/coinbase/prime/model/WebhookDeliveryAttempt.java b/src/main/java/com/coinbase/prime/model/WebhookDeliveryAttempt.java new file mode 100644 index 00000000..93be5bd9 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookDeliveryAttempt.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.WebhookErrorType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** WebhookDeliveryAttempt records the outcome and timing of an individual delivery attempt. */ +public class WebhookDeliveryAttempt { + @JsonProperty("delivery_attempt_id") + private String deliveryAttemptId; + + @JsonProperty("delivery_id") + private String deliveryId; + + @JsonProperty("attempt_number") + private Integer attemptNumber; + + @JsonProperty("status_code") + private Integer statusCode; + + @JsonProperty("latency_ms") + private Integer latencyMs; + + /** WebhookErrorType classifies the outcome of a webhook delivery attempt. */ + @JsonProperty("error_type") + private WebhookErrorType errorType; + + @JsonProperty("error_message") + private String errorMessage; + + @JsonProperty("attempted_at") + private OffsetDateTime attemptedAt; + + public WebhookDeliveryAttempt() {} + + public WebhookDeliveryAttempt(Builder builder) { + this.deliveryAttemptId = builder.deliveryAttemptId; + this.deliveryId = builder.deliveryId; + this.attemptNumber = builder.attemptNumber; + this.statusCode = builder.statusCode; + this.latencyMs = builder.latencyMs; + this.errorType = builder.errorType; + this.errorMessage = builder.errorMessage; + this.attemptedAt = builder.attemptedAt; + } + + public String getDeliveryAttemptId() { + return deliveryAttemptId; + } + + public void setDeliveryAttemptId(String deliveryAttemptId) { + this.deliveryAttemptId = deliveryAttemptId; + } + + public String getDeliveryId() { + return deliveryId; + } + + public void setDeliveryId(String deliveryId) { + this.deliveryId = deliveryId; + } + + public Integer getAttemptNumber() { + return attemptNumber; + } + + public void setAttemptNumber(Integer attemptNumber) { + this.attemptNumber = attemptNumber; + } + + public Integer getStatusCode() { + return statusCode; + } + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public Integer getLatencyMs() { + return latencyMs; + } + + public void setLatencyMs(Integer latencyMs) { + this.latencyMs = latencyMs; + } + + public WebhookErrorType getErrorType() { + return errorType; + } + + public void setErrorType(WebhookErrorType errorType) { + this.errorType = errorType; + } + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public OffsetDateTime getAttemptedAt() { + return attemptedAt; + } + + public void setAttemptedAt(OffsetDateTime attemptedAt) { + this.attemptedAt = attemptedAt; + } + + public static class Builder { + private String deliveryAttemptId; + + private String deliveryId; + + private Integer attemptNumber; + + private Integer statusCode; + + private Integer latencyMs; + + private WebhookErrorType errorType; + + private String errorMessage; + + private OffsetDateTime attemptedAt; + + public Builder deliveryAttemptId(String deliveryAttemptId) { + this.deliveryAttemptId = deliveryAttemptId; + return this; + } + + public Builder deliveryId(String deliveryId) { + this.deliveryId = deliveryId; + return this; + } + + public Builder attemptNumber(Integer attemptNumber) { + this.attemptNumber = attemptNumber; + return this; + } + + public Builder statusCode(Integer statusCode) { + this.statusCode = statusCode; + return this; + } + + public Builder latencyMs(Integer latencyMs) { + this.latencyMs = latencyMs; + return this; + } + + public Builder errorType(WebhookErrorType errorType) { + this.errorType = errorType; + return this; + } + + public Builder errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + public Builder attemptedAt(OffsetDateTime attemptedAt) { + this.attemptedAt = attemptedAt; + return this; + } + + public WebhookDeliveryAttempt build() { + return new WebhookDeliveryAttempt(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookDeliveryLogEntry.java b/src/main/java/com/coinbase/prime/model/WebhookDeliveryLogEntry.java new file mode 100644 index 00000000..88ee88e8 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookDeliveryLogEntry.java @@ -0,0 +1,306 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.WebhookDeliveryStatus; +import com.coinbase.prime.model.enums.WebhookErrorType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** WebhookDeliveryLogEntry summarizes a webhook event delivery and its latest attempt. */ +public class WebhookDeliveryLogEntry { + @JsonProperty("delivery_id") + private String deliveryId; + + @JsonProperty("event_id") + private String eventId; + + @JsonProperty("event_type") + private String eventType; + + /** WebhookDeliveryStatus describes the delivery state of a webhook event. */ + @JsonProperty("delivery_status") + private WebhookDeliveryStatus deliveryStatus; + + @JsonProperty("status_code") + private Integer statusCode; + + @JsonProperty("latency_ms") + private Integer latencyMs; + + @JsonProperty("attempt_number") + private Integer attemptNumber; + + @JsonProperty("max_retries") + private Integer maxRetries; + + /** WebhookErrorType classifies the outcome of a webhook delivery attempt. */ + @JsonProperty("error_type") + private WebhookErrorType errorType; + + @JsonProperty("error_message") + private String errorMessage; + + @JsonProperty("is_test") + private boolean isTest; + + @JsonProperty("is_replay") + private boolean isReplay; + + @JsonProperty("occurred_at") + private OffsetDateTime occurredAt; + + @JsonProperty("attempted_at") + private OffsetDateTime attemptedAt; + + public WebhookDeliveryLogEntry() {} + + public WebhookDeliveryLogEntry(Builder builder) { + this.deliveryId = builder.deliveryId; + this.eventId = builder.eventId; + this.eventType = builder.eventType; + this.deliveryStatus = builder.deliveryStatus; + this.statusCode = builder.statusCode; + this.latencyMs = builder.latencyMs; + this.attemptNumber = builder.attemptNumber; + this.maxRetries = builder.maxRetries; + this.errorType = builder.errorType; + this.errorMessage = builder.errorMessage; + this.isTest = builder.isTest; + this.isReplay = builder.isReplay; + this.occurredAt = builder.occurredAt; + this.attemptedAt = builder.attemptedAt; + } + + public String getDeliveryId() { + return deliveryId; + } + + public void setDeliveryId(String deliveryId) { + this.deliveryId = deliveryId; + } + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public WebhookDeliveryStatus getDeliveryStatus() { + return deliveryStatus; + } + + public void setDeliveryStatus(WebhookDeliveryStatus deliveryStatus) { + this.deliveryStatus = deliveryStatus; + } + + public Integer getStatusCode() { + return statusCode; + } + + public void setStatusCode(Integer statusCode) { + this.statusCode = statusCode; + } + + public Integer getLatencyMs() { + return latencyMs; + } + + public void setLatencyMs(Integer latencyMs) { + this.latencyMs = latencyMs; + } + + public Integer getAttemptNumber() { + return attemptNumber; + } + + public void setAttemptNumber(Integer attemptNumber) { + this.attemptNumber = attemptNumber; + } + + public Integer getMaxRetries() { + return maxRetries; + } + + public void setMaxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + } + + public WebhookErrorType getErrorType() { + return errorType; + } + + public void setErrorType(WebhookErrorType errorType) { + this.errorType = errorType; + } + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public boolean getIsTest() { + return isTest; + } + + public void setIsTest(boolean isTest) { + this.isTest = isTest; + } + + public boolean getIsReplay() { + return isReplay; + } + + public void setIsReplay(boolean isReplay) { + this.isReplay = isReplay; + } + + public OffsetDateTime getOccurredAt() { + return occurredAt; + } + + public void setOccurredAt(OffsetDateTime occurredAt) { + this.occurredAt = occurredAt; + } + + public OffsetDateTime getAttemptedAt() { + return attemptedAt; + } + + public void setAttemptedAt(OffsetDateTime attemptedAt) { + this.attemptedAt = attemptedAt; + } + + public static class Builder { + private String deliveryId; + + private String eventId; + + private String eventType; + + private WebhookDeliveryStatus deliveryStatus; + + private Integer statusCode; + + private Integer latencyMs; + + private Integer attemptNumber; + + private Integer maxRetries; + + private WebhookErrorType errorType; + + private String errorMessage; + + private boolean isTest; + + private boolean isReplay; + + private OffsetDateTime occurredAt; + + private OffsetDateTime attemptedAt; + + public Builder deliveryId(String deliveryId) { + this.deliveryId = deliveryId; + return this; + } + + public Builder eventId(String eventId) { + this.eventId = eventId; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = eventType; + return this; + } + + public Builder deliveryStatus(WebhookDeliveryStatus deliveryStatus) { + this.deliveryStatus = deliveryStatus; + return this; + } + + public Builder statusCode(Integer statusCode) { + this.statusCode = statusCode; + return this; + } + + public Builder latencyMs(Integer latencyMs) { + this.latencyMs = latencyMs; + return this; + } + + public Builder attemptNumber(Integer attemptNumber) { + this.attemptNumber = attemptNumber; + return this; + } + + public Builder maxRetries(Integer maxRetries) { + this.maxRetries = maxRetries; + return this; + } + + public Builder errorType(WebhookErrorType errorType) { + this.errorType = errorType; + return this; + } + + public Builder errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + public Builder isTest(boolean isTest) { + this.isTest = isTest; + return this; + } + + public Builder isReplay(boolean isReplay) { + this.isReplay = isReplay; + return this; + } + + public Builder occurredAt(OffsetDateTime occurredAt) { + this.occurredAt = occurredAt; + return this; + } + + public Builder attemptedAt(OffsetDateTime attemptedAt) { + this.attemptedAt = attemptedAt; + return this; + } + + public WebhookDeliveryLogEntry build() { + return new WebhookDeliveryLogEntry(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookEventType.java b/src/main/java/com/coinbase/prime/model/WebhookEventType.java new file mode 100644 index 00000000..772be33a --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookEventType.java @@ -0,0 +1,90 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** WebhookEventType describes a registered webhook event customers can subscribe to. */ +public class WebhookEventType { + private String name; + + @JsonProperty("domain_object") + private String domainObject; + + private String description; + + public WebhookEventType() {} + + public WebhookEventType(Builder builder) { + this.name = builder.name; + this.domainObject = builder.domainObject; + this.description = builder.description; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDomainObject() { + return domainObject; + } + + public void setDomainObject(String domainObject) { + this.domainObject = domainObject; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public static class Builder { + private String name; + + private String domainObject; + + private String description; + + public Builder name(String name) { + this.name = name; + return this; + } + + public Builder domainObject(String domainObject) { + this.domainObject = domainObject; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public WebhookEventType build() { + return new WebhookEventType(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookEventTypeStats.java b/src/main/java/com/coinbase/prime/model/WebhookEventTypeStats.java new file mode 100644 index 00000000..90d1de23 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookEventTypeStats.java @@ -0,0 +1,165 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** WebhookEventTypeStats contains aggregated delivery statistics for one event type. */ +public class WebhookEventTypeStats { + @JsonProperty("event_type") + private String eventType; + + private String total; + + private String successful; + + @JsonProperty("success_rate") + private Double successRate; + + @JsonProperty("avg_latency_ms") + private String avgLatencyMs; + + private String failed; + + @JsonProperty("in_progress") + private String inProgress; + + public WebhookEventTypeStats() {} + + public WebhookEventTypeStats(Builder builder) { + this.eventType = builder.eventType; + this.total = builder.total; + this.successful = builder.successful; + this.successRate = builder.successRate; + this.avgLatencyMs = builder.avgLatencyMs; + this.failed = builder.failed; + this.inProgress = builder.inProgress; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public String getTotal() { + return total; + } + + public void setTotal(String total) { + this.total = total; + } + + public String getSuccessful() { + return successful; + } + + public void setSuccessful(String successful) { + this.successful = successful; + } + + public Double getSuccessRate() { + return successRate; + } + + public void setSuccessRate(Double successRate) { + this.successRate = successRate; + } + + public String getAvgLatencyMs() { + return avgLatencyMs; + } + + public void setAvgLatencyMs(String avgLatencyMs) { + this.avgLatencyMs = avgLatencyMs; + } + + public String getFailed() { + return failed; + } + + public void setFailed(String failed) { + this.failed = failed; + } + + public String getInProgress() { + return inProgress; + } + + public void setInProgress(String inProgress) { + this.inProgress = inProgress; + } + + public static class Builder { + private String eventType; + + private String total; + + private String successful; + + private Double successRate; + + private String avgLatencyMs; + + private String failed; + + private String inProgress; + + public Builder eventType(String eventType) { + this.eventType = eventType; + return this; + } + + public Builder total(String total) { + this.total = total; + return this; + } + + public Builder successful(String successful) { + this.successful = successful; + return this; + } + + public Builder successRate(Double successRate) { + this.successRate = successRate; + return this; + } + + public Builder avgLatencyMs(String avgLatencyMs) { + this.avgLatencyMs = avgLatencyMs; + return this; + } + + public Builder failed(String failed) { + this.failed = failed; + return this; + } + + public Builder inProgress(String inProgress) { + this.inProgress = inProgress; + return this; + } + + public WebhookEventTypeStats build() { + return new WebhookEventTypeStats(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookOAuthConfig.java b/src/main/java/com/coinbase/prime/model/WebhookOAuthConfig.java new file mode 100644 index 00000000..02e1d544 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookOAuthConfig.java @@ -0,0 +1,92 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** WebhookOAuthConfig describes a subscription's OAuth configuration without its client secret. */ +public class WebhookOAuthConfig { + @JsonProperty("token_url") + private String tokenUrl; + + @JsonProperty("client_id") + private String clientId; + + private List scopes; + + public WebhookOAuthConfig() {} + + public WebhookOAuthConfig(Builder builder) { + this.tokenUrl = builder.tokenUrl; + this.clientId = builder.clientId; + this.scopes = builder.scopes; + } + + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public List getScopes() { + return scopes; + } + + public void setScopes(List scopes) { + this.scopes = scopes; + } + + public static class Builder { + private String tokenUrl; + + private String clientId; + + private List scopes; + + public Builder tokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = scopes; + return this; + } + + public WebhookOAuthConfig build() { + return new WebhookOAuthConfig(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookOAuthConfigInput.java b/src/main/java/com/coinbase/prime/model/WebhookOAuthConfigInput.java new file mode 100644 index 00000000..dabf72a2 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookOAuthConfigInput.java @@ -0,0 +1,111 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** WebhookOAuthConfigInput supplies OAuth credentials and scopes for a subscription. */ +public class WebhookOAuthConfigInput { + @JsonProperty("token_url") + private String tokenUrl; + + @JsonProperty("client_id") + private String clientId; + + @JsonProperty("client_secret") + private String clientSecret; + + private List scopes; + + public WebhookOAuthConfigInput() {} + + public WebhookOAuthConfigInput(Builder builder) { + this.tokenUrl = builder.tokenUrl; + this.clientId = builder.clientId; + this.clientSecret = builder.clientSecret; + this.scopes = builder.scopes; + } + + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + public String getClientId() { + return clientId; + } + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + } + + public List getScopes() { + return scopes; + } + + public void setScopes(List scopes) { + this.scopes = scopes; + } + + public static class Builder { + private String tokenUrl; + + private String clientId; + + private String clientSecret; + + private List scopes; + + public Builder tokenUrl(String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + public Builder clientId(String clientId) { + this.clientId = clientId; + return this; + } + + public Builder clientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + public Builder scopes(List scopes) { + this.scopes = scopes; + return this; + } + + public WebhookOAuthConfigInput build() { + return new WebhookOAuthConfigInput(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookRecentFailure.java b/src/main/java/com/coinbase/prime/model/WebhookRecentFailure.java new file mode 100644 index 00000000..5c73911f --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookRecentFailure.java @@ -0,0 +1,171 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.WebhookErrorType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** WebhookRecentFailure identifies a recent failed delivery attempt. */ +public class WebhookRecentFailure { + @JsonProperty("delivery_id") + private String deliveryId; + + @JsonProperty("subscription_id") + private String subscriptionId; + + @JsonProperty("event_id") + private String eventId; + + @JsonProperty("event_type") + private String eventType; + + /** WebhookErrorType classifies the outcome of a webhook delivery attempt. */ + @JsonProperty("error_type") + private WebhookErrorType errorType; + + @JsonProperty("attempt_number") + private Integer attemptNumber; + + @JsonProperty("attempted_at") + private OffsetDateTime attemptedAt; + + public WebhookRecentFailure() {} + + public WebhookRecentFailure(Builder builder) { + this.deliveryId = builder.deliveryId; + this.subscriptionId = builder.subscriptionId; + this.eventId = builder.eventId; + this.eventType = builder.eventType; + this.errorType = builder.errorType; + this.attemptNumber = builder.attemptNumber; + this.attemptedAt = builder.attemptedAt; + } + + public String getDeliveryId() { + return deliveryId; + } + + public void setDeliveryId(String deliveryId) { + this.deliveryId = deliveryId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public WebhookErrorType getErrorType() { + return errorType; + } + + public void setErrorType(WebhookErrorType errorType) { + this.errorType = errorType; + } + + public Integer getAttemptNumber() { + return attemptNumber; + } + + public void setAttemptNumber(Integer attemptNumber) { + this.attemptNumber = attemptNumber; + } + + public OffsetDateTime getAttemptedAt() { + return attemptedAt; + } + + public void setAttemptedAt(OffsetDateTime attemptedAt) { + this.attemptedAt = attemptedAt; + } + + public static class Builder { + private String deliveryId; + + private String subscriptionId; + + private String eventId; + + private String eventType; + + private WebhookErrorType errorType; + + private Integer attemptNumber; + + private OffsetDateTime attemptedAt; + + public Builder deliveryId(String deliveryId) { + this.deliveryId = deliveryId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder eventId(String eventId) { + this.eventId = eventId; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = eventType; + return this; + } + + public Builder errorType(WebhookErrorType errorType) { + this.errorType = errorType; + return this; + } + + public Builder attemptNumber(Integer attemptNumber) { + this.attemptNumber = attemptNumber; + return this; + } + + public Builder attemptedAt(OffsetDateTime attemptedAt) { + this.attemptedAt = attemptedAt; + return this; + } + + public WebhookRecentFailure build() { + return new WebhookRecentFailure(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookSubscription.java b/src/main/java/com/coinbase/prime/model/WebhookSubscription.java new file mode 100644 index 00000000..7212a626 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookSubscription.java @@ -0,0 +1,324 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.WebhookAuthType; +import com.coinbase.prime.model.enums.WebhookHealthStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; + +/** + * WebhookSubscription is the customer-facing representation of a webhook subscription. auth secrets + * (hmac_secret, oauth client_secret) are never included; hmac_secret is returned exactly once in + * CreateWebhookSubscriptionResponse. + */ +public class WebhookSubscription { + @JsonProperty("subscription_id") + private String subscriptionId; + + @JsonProperty("event_types") + private List eventTypes; + + @JsonProperty("target_url") + private String targetUrl; + + /** + * WebhookAuthType is how Prime authenticates to your endpoint, on top of the signatures. Every + * delivery is signed twice, whatever the auth type: with HMAC-SHA256 in X-Coinbase-Signature, + * keyed by the subscription's hmac_secret, and with Ed25519 in X-Coinbase-Signature-Ed25519, + * verifiable with the public key named by X-Coinbase-Signature-Key-Id at /.well-known/jwks.json. + * Verify either one. - WEBHOOK_AUTH_TYPE_SIGNATURE_ONLY: Signatures only. Used when a + * subscription is created without auth_type. - WEBHOOK_AUTH_TYPE_OAUTH: Signatures plus an OAuth + * 2.0 bearer token, fetched with oauth_config, in the Authorization header. - + * WEBHOOK_AUTH_TYPE_MTLS: Signatures plus a Coinbase client certificate (mutual TLS). - + * WEBHOOK_AUTH_TYPE_OAUTH_MTLS: Signatures plus both an OAuth 2.0 bearer token and a client + * certificate. + */ + @JsonProperty("auth_type") + private WebhookAuthType authType; + + /** + * WebhookOAuthConfig describes a subscription's OAuth configuration without its client secret. + */ + @JsonProperty("oauth_config") + private WebhookOAuthConfig oauthConfig; + + @JsonProperty("custom_headers") + private Map customHeaders; + + @JsonProperty("is_enabled") + private boolean isEnabled; + + private String description; + + @JsonProperty("created_by") + private String createdBy; + + @JsonProperty("updated_by") + private String updatedBy; + + @JsonProperty("created_at") + private OffsetDateTime createdAt; + + @JsonProperty("updated_at") + private OffsetDateTime updatedAt; + + /** WebhookHealthStatus describes the current delivery health of a subscription. */ + @JsonProperty("health_status") + private WebhookHealthStatus healthStatus; + + private String version; + + public WebhookSubscription() {} + + public WebhookSubscription(Builder builder) { + this.subscriptionId = builder.subscriptionId; + this.eventTypes = builder.eventTypes; + this.targetUrl = builder.targetUrl; + this.authType = builder.authType; + this.oauthConfig = builder.oauthConfig; + this.customHeaders = builder.customHeaders; + this.isEnabled = builder.isEnabled; + this.description = builder.description; + this.createdBy = builder.createdBy; + this.updatedBy = builder.updatedBy; + this.createdAt = builder.createdAt; + this.updatedAt = builder.updatedAt; + this.healthStatus = builder.healthStatus; + this.version = builder.version; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public List getEventTypes() { + return eventTypes; + } + + public void setEventTypes(List eventTypes) { + this.eventTypes = eventTypes; + } + + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } + + public WebhookAuthType getAuthType() { + return authType; + } + + public void setAuthType(WebhookAuthType authType) { + this.authType = authType; + } + + public WebhookOAuthConfig getOauthConfig() { + return oauthConfig; + } + + public void setOauthConfig(WebhookOAuthConfig oauthConfig) { + this.oauthConfig = oauthConfig; + } + + public Map getCustomHeaders() { + return customHeaders; + } + + public void setCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + } + + public boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + public WebhookHealthStatus getHealthStatus() { + return healthStatus; + } + + public void setHealthStatus(WebhookHealthStatus healthStatus) { + this.healthStatus = healthStatus; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public static class Builder { + private String subscriptionId; + + private List eventTypes; + + private String targetUrl; + + private WebhookAuthType authType; + + private WebhookOAuthConfig oauthConfig; + + private Map customHeaders; + + private boolean isEnabled; + + private String description; + + private String createdBy; + + private String updatedBy; + + private OffsetDateTime createdAt; + + private OffsetDateTime updatedAt; + + private WebhookHealthStatus healthStatus; + + private String version; + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder eventTypes(List eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder targetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + public Builder authType(WebhookAuthType authType) { + this.authType = authType; + return this; + } + + public Builder oauthConfig(WebhookOAuthConfig oauthConfig) { + this.oauthConfig = oauthConfig; + return this; + } + + public Builder customHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public Builder isEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + public Builder updatedBy(String updatedBy) { + this.updatedBy = updatedBy; + return this; + } + + public Builder createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + public Builder updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + public Builder healthStatus(WebhookHealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + public Builder version(String version) { + this.version = version; + return this; + } + + public WebhookSubscription build() { + return new WebhookSubscription(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/WebhookSubscriptionSummary.java b/src/main/java/com/coinbase/prime/model/WebhookSubscriptionSummary.java new file mode 100644 index 00000000..59f5ca79 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/WebhookSubscriptionSummary.java @@ -0,0 +1,131 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model; + +import com.coinbase.prime.model.enums.WebhookHealthStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** WebhookSubscriptionSummary summarizes a subscription's health and delivery statistics. */ +public class WebhookSubscriptionSummary { + @JsonProperty("subscription_id") + private String subscriptionId; + + private String description; + + /** WebhookHealthStatus describes the current delivery health of a subscription. */ + @JsonProperty("health_status") + private WebhookHealthStatus healthStatus; + + @JsonProperty("events_in_period") + private String eventsInPeriod; + + @JsonProperty("success_rate") + private Double successRate; + + public WebhookSubscriptionSummary() {} + + public WebhookSubscriptionSummary(Builder builder) { + this.subscriptionId = builder.subscriptionId; + this.description = builder.description; + this.healthStatus = builder.healthStatus; + this.eventsInPeriod = builder.eventsInPeriod; + this.successRate = builder.successRate; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public WebhookHealthStatus getHealthStatus() { + return healthStatus; + } + + public void setHealthStatus(WebhookHealthStatus healthStatus) { + this.healthStatus = healthStatus; + } + + public String getEventsInPeriod() { + return eventsInPeriod; + } + + public void setEventsInPeriod(String eventsInPeriod) { + this.eventsInPeriod = eventsInPeriod; + } + + public Double getSuccessRate() { + return successRate; + } + + public void setSuccessRate(Double successRate) { + this.successRate = successRate; + } + + public static class Builder { + private String subscriptionId; + + private String description; + + private WebhookHealthStatus healthStatus; + + private String eventsInPeriod; + + private Double successRate; + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder healthStatus(WebhookHealthStatus healthStatus) { + this.healthStatus = healthStatus; + return this; + } + + public Builder eventsInPeriod(String eventsInPeriod) { + this.eventsInPeriod = eventsInPeriod; + return this; + } + + public Builder successRate(Double successRate) { + this.successRate = successRate; + return this; + } + + public WebhookSubscriptionSummary build() { + return new WebhookSubscriptionSummary(this); + } + } +} diff --git a/src/main/java/com/coinbase/prime/model/enums/AdvancedTransferState.java b/src/main/java/com/coinbase/prime/model/enums/AdvancedTransferState.java index f1240a21..0da9e33b 100644 --- a/src/main/java/com/coinbase/prime/model/enums/AdvancedTransferState.java +++ b/src/main/java/com/coinbase/prime/model/enums/AdvancedTransferState.java @@ -18,12 +18,22 @@ package com.coinbase.prime.model.enums; -/** AdvancedTransferState represents the lifecycle state of an advanced transfer. */ +/** + * AdvancedTransferState represents the lifecycle state of an advanced transfer. - + * ADVANCED_TRANSFER_STATE_MATCHED: The counterparties have matched. Settlement has not started. + * Happy path is CREATED, MATCHED, PROCESSING, DONE. + */ public enum AdvancedTransferState { ADVANCED_TRANSFER_STATE_CREATED, ADVANCED_TRANSFER_STATE_PROCESSING, ADVANCED_TRANSFER_STATE_DONE, ADVANCED_TRANSFER_STATE_CANCELLED, ADVANCED_TRANSFER_STATE_FAILED, - ADVANCED_TRANSFER_STATE_EXPIRED + ADVANCED_TRANSFER_STATE_EXPIRED, + ADVANCED_TRANSFER_STATE_REJECTED, + /** + * The counterparties have matched. Settlement has not started. Happy path is CREATED, MATCHED, + * PROCESSING, DONE. + */ + ADVANCED_TRANSFER_STATE_MATCHED } diff --git a/src/main/java/com/coinbase/prime/model/enums/LimitPriceType.java b/src/main/java/com/coinbase/prime/model/enums/LimitPriceType.java new file mode 100644 index 00000000..0a2d0050 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/LimitPriceType.java @@ -0,0 +1,38 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * LimitPriceType indicates the unit `limit_price` is denominated in. Only meaningful for Deribit + * options - leave unspecified for every other order type and product, which are always priced in + * the quote currency. - UNKNOWN_LIMIT_PRICE_TYPE: nil value - `limit_price` is interpreted in the + * product's default/native unit - LIMIT_PRICE_TYPE_BASE_ASSET: `limit_price` is denominated in the + * underlying base asset (e.g. BTC for a BTC option). Only valid for Deribit options settled in the + * base asset. - LIMIT_PRICE_TYPE_QUOTE_ASSET: `limit_price` is denominated in the quote asset (e.g. + * USD/USDC). - LIMIT_PRICE_TYPE_IMPLIED_VOLATILITY: `limit_price` is an implied volatility + * percentage rather than a monetary amount (e.g. "65.5" means 65.5% implied volatility). + */ +public enum LimitPriceType { + /** `limit_price` is denominated in the underlying base asset (e.g. BTC for a BTC option). */ + LIMIT_PRICE_TYPE_BASE_ASSET, + /** `limit_price` is denominated in the quote asset (e.g. USD/USDC). */ + LIMIT_PRICE_TYPE_QUOTE_ASSET, + /** `limit_price` is an implied volatility percentage rather than a monetary amount */ + LIMIT_PRICE_TYPE_IMPLIED_VOLATILITY +} diff --git a/src/main/java/com/coinbase/prime/model/enums/MarginControlStatus.java b/src/main/java/com/coinbase/prime/model/enums/MarginControlStatus.java new file mode 100644 index 00000000..340f316a --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/MarginControlStatus.java @@ -0,0 +1,39 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * Trading and withdrawal permissions derived from the account's recorded health state, outstanding + * margin calls, and account restrictions. These permissions can remain restricted even when the + * calculated `margin_level` improves. Returns `MARGIN_CONTROL_STATUS_UNSPECIFIED` when the margin + * service doesn't provide a control status. - MARGIN_CONTROL_STATUS_UNSPECIFIED: No control status + * is provided. Don't infer permission to trade or withdraw from this value. - + * MARGIN_CONTROL_STATUS_TRADES_AND_WITHDRAWALS: Allowed to trade and withdraw under the applicable + * margin methodology. - MARGIN_CONTROL_STATUS_TRADES_ONLY: Allowed to trade but not withdraw under + * the applicable margin methodology. - MARGIN_CONTROL_STATUS_SESSION_LOCKED: Not allowed to trade + * or withdraw. + */ +public enum MarginControlStatus { + /** Allowed to trade and withdraw under the applicable margin methodology. */ + MARGIN_CONTROL_STATUS_TRADES_AND_WITHDRAWALS, + /** Allowed to trade but not withdraw under the applicable margin methodology. */ + MARGIN_CONTROL_STATUS_TRADES_ONLY, + /** Not allowed to trade or withdraw. */ + MARGIN_CONTROL_STATUS_SESSION_LOCKED +} diff --git a/src/main/java/com/coinbase/prime/model/enums/MarginEntityCallStatus.java b/src/main/java/com/coinbase/prime/model/enums/MarginEntityCallStatus.java new file mode 100644 index 00000000..c37245fc --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/MarginEntityCallStatus.java @@ -0,0 +1,49 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * MarginEntityCallStatus summarizes the entity's open margin calls. When several calls are open, it + * reflects the highest-priority one: aged, then urgent, then standard, then debit. `call_status` + * describes outstanding calls. Use `margin_level` for calculated margin condition and + * `control_status` for trading and withdrawal permissions. - MARGIN_ENTITY_CALL_STATUS_UNSPECIFIED: + * No call status is provided. Don't infer that the entity has no margin calls from this value. - + * MARGIN_ENTITY_CALL_STATUS_NO_CALL: The entity has no open margin calls. - + * MARGIN_ENTITY_CALL_STATUS_OPEN_STANDARD_CALL: The entity has an open standard margin call and no + * urgent or aged calls. - MARGIN_ENTITY_CALL_STATUS_OPEN_URGENT_CALL: The entity has an open urgent + * margin call and no aged calls. - MARGIN_ENTITY_CALL_STATUS_AGED_CALL: At least one open margin + * call is past its due time. This status alone does not indicate a contractual Event of Default or + * that liquidation has begun. - MARGIN_ENTITY_CALL_STATUS_OPEN_DEBIT_CALL: The entity has an open + * debit call and no standard, urgent, or aged calls. + */ +public enum MarginEntityCallStatus { + /** The entity has no open margin calls. */ + MARGIN_ENTITY_CALL_STATUS_NO_CALL, + /** The entity has an open standard margin call and no urgent or aged calls. */ + MARGIN_ENTITY_CALL_STATUS_OPEN_STANDARD_CALL, + /** The entity has an open urgent margin call and no aged calls. */ + MARGIN_ENTITY_CALL_STATUS_OPEN_URGENT_CALL, + /** + * At least one open margin call is past its due time. This status alone does not indicate a + * contractual Event of Default or that liquidation has begun. + */ + MARGIN_ENTITY_CALL_STATUS_AGED_CALL, + /** The entity has an open debit call and no standard, urgent, or aged calls. */ + MARGIN_ENTITY_CALL_STATUS_OPEN_DEBIT_CALL +} diff --git a/src/main/java/com/coinbase/prime/model/enums/MarginHealthStatus.java b/src/main/java/com/coinbase/prime/model/enums/MarginHealthStatus.java new file mode 100644 index 00000000..931bdd43 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/MarginHealthStatus.java @@ -0,0 +1,70 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * Recorded account health state maintained by the margin-management process. Persistence rules + * filter out short-lived threshold changes. Margin-call and liquidation events also affect this + * state. A change in the calculated `margin_level` may not immediately change this status. Use + * `control_status` for trading and withdrawal permissions in live responses. Historical responses + * contain the recorded health state at the historical evaluation. - + * MARGIN_HEALTH_STATUS_UNSPECIFIED: No account health state is provided. Don't interpret this value + * as healthy or as permission to trade or withdraw. - MARGIN_HEALTH_STATUS_HEALTHY: The account's + * recorded health state is healthy. - MARGIN_HEALTH_STATUS_WARNING: The account's recorded health + * state is warning. Margin-call issuance follows the applicable margin methodology. - + * MARGIN_HEALTH_STATUS_CRITICAL: The account's recorded health state is critical, corresponding to + * an urgent margin-call condition under the applicable margin methodology. - + * MARGIN_HEALTH_STATUS_SUSPENDED: The account is recorded as suspended under the applicable margin + * methodology. - MARGIN_HEALTH_STATUS_RESTRICTED: The account is recorded as restricted under the + * applicable margin methodology. - MARGIN_HEALTH_STATUS_PRE_LIQUIDATION: The account is in a + * pre-liquidation state. Liquidation may commence under the applicable margin methodology. - + * MARGIN_HEALTH_STATUS_LIQUIDATING: Liquidation has commenced. - MARGIN_HEALTH_STATUS_IN_DEFICIT: + * The account's recorded health state is in deficit. Margin-call issuance follows the applicable + * margin methodology. + */ +public enum MarginHealthStatus { + /** The account's recorded health state is healthy. */ + MARGIN_HEALTH_STATUS_HEALTHY, + /** + * The account's recorded health state is warning. Margin-call issuance follows the applicable + * margin methodology. + */ + MARGIN_HEALTH_STATUS_WARNING, + /** + * The account's recorded health state is critical, corresponding to an urgent margin-call + * condition under the applicable margin methodology. + */ + MARGIN_HEALTH_STATUS_CRITICAL, + /** The account is recorded as suspended under the applicable margin methodology. */ + MARGIN_HEALTH_STATUS_SUSPENDED, + /** The account is recorded as restricted under the applicable margin methodology. */ + MARGIN_HEALTH_STATUS_RESTRICTED, + /** + * The account is in a pre-liquidation state. Liquidation may commence under the applicable margin + * methodology. + */ + MARGIN_HEALTH_STATUS_PRE_LIQUIDATION, + /** Liquidation has commenced. */ + MARGIN_HEALTH_STATUS_LIQUIDATING, + /** + * The account's recorded health state is in deficit. Margin-call issuance follows the applicable + * margin methodology. + */ + MARGIN_HEALTH_STATUS_IN_DEFICIT +} diff --git a/src/main/java/com/coinbase/prime/model/enums/MarginLevel.java b/src/main/java/com/coinbase/prime/model/enums/MarginLevel.java new file mode 100644 index 00000000..8bb33750 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/MarginLevel.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * Calculated margin level based on the account's equity, margin requirement, margin limit, and + * configured thresholds. This reflects the current calculation for live responses or the recorded + * calculation for historical responses. It can differ from `health_status`, which is maintained by + * the margin-management process. The level alone doesn't determine whether a margin call is open or + * whether trading and withdrawals are allowed. - MARGIN_LEVEL_UNSPECIFIED: No calculated margin + * level is provided. - MARGIN_LEVEL_HEALTHY: Account equity is at or above the margin requirement. + * - MARGIN_LEVEL_DEFICIT: The calculation places the account in the deficit band. Margin-call + * issuance follows the applicable margin methodology. - MARGIN_LEVEL_WARNING: The calculation + * places the account in the warning band, approaching the critical threshold. - + * MARGIN_LEVEL_CRITICAL: The calculation places the account in the critical band. - + * MARGIN_LEVEL_LIQUIDATION: The calculation places the account in the liquidation band. This value + * alone doesn't indicate that liquidation has commenced. + */ +public enum MarginLevel { + /** Account equity is at or above the margin requirement. */ + MARGIN_LEVEL_HEALTHY, + /** + * The calculation places the account in the deficit band. Margin-call issuance follows the + * applicable margin methodology. + */ + MARGIN_LEVEL_DEFICIT, + /** The calculation places the account in the warning band, approaching the critical threshold. */ + MARGIN_LEVEL_WARNING, + /** The calculation places the account in the critical band. */ + MARGIN_LEVEL_CRITICAL, + /** + * The calculation places the account in the liquidation band. This value alone doesn't indicate + * that liquidation has commenced. + */ + MARGIN_LEVEL_LIQUIDATION +} diff --git a/src/main/java/com/coinbase/prime/model/enums/MarginThresholdMarginThresholdType.java b/src/main/java/com/coinbase/prime/model/enums/MarginThresholdMarginThresholdType.java new file mode 100644 index 00000000..8a62ead7 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/MarginThresholdMarginThresholdType.java @@ -0,0 +1,25 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +public enum MarginThresholdMarginThresholdType { + MARGIN_THRESHOLD_TYPE_EQUITY_RATIO, + MARGIN_THRESHOLD_TYPE_DEFICIT_RATIO, + MARGIN_THRESHOLD_TYPE_NONE +} diff --git a/src/main/java/com/coinbase/prime/model/enums/MaxDeltaType.java b/src/main/java/com/coinbase/prime/model/enums/MaxDeltaType.java new file mode 100644 index 00000000..8ec322f6 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/MaxDeltaType.java @@ -0,0 +1,33 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * - UNKNOWN_MAX_DELTA_TYPE: nil value - MAX_DELTA_TYPE_SPOT: Absolute size in spot base units. Not + * accepted for a calendar spread (two futures). - MAX_DELTA_TYPE_PERCENT: Percentage of the order + * size - MAX_DELTA_TYPE_CONTRACT: Absolute number of futures contracts + */ +public enum MaxDeltaType { + /** Absolute size in spot base units. Not accepted for a calendar spread (two futures). */ + MAX_DELTA_TYPE_SPOT, + /** Percentage of the order size */ + MAX_DELTA_TYPE_PERCENT, + /** Absolute number of futures contracts */ + MAX_DELTA_TYPE_CONTRACT +} diff --git a/src/main/java/com/coinbase/prime/model/enums/OrderSide.java b/src/main/java/com/coinbase/prime/model/enums/OrderSide.java index 54b98914..10950cc7 100644 --- a/src/main/java/com/coinbase/prime/model/enums/OrderSide.java +++ b/src/main/java/com/coinbase/prime/model/enums/OrderSide.java @@ -18,10 +18,18 @@ package com.coinbase.prime.model.enums; -/** - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order */ +/** + * - UNKNOWN_ORDER_SIDE: nil value - BUY: Buy order - SELL: Sell order - MULTIPLE: Response only: a + * SPREAD order, whose legs carry their own sides (see `spread_details`); not accepted in requests + */ public enum OrderSide { /** Buy order */ BUY, /** Sell order */ - SELL + SELL, + /** + * Response only: a SPREAD order, whose legs carry their own sides (see `spread_details`); not + * accepted in requests + */ + MULTIPLE } diff --git a/src/main/java/com/coinbase/prime/model/enums/OrderType.java b/src/main/java/com/coinbase/prime/model/enums/OrderType.java index 2550fa9e..64ba4249 100644 --- a/src/main/java/com/coinbase/prime/model/enums/OrderType.java +++ b/src/main/java/com/coinbase/prime/model/enums/OrderType.java @@ -29,7 +29,9 @@ * order](https://en.wikipedia.org/wiki/Order_(exchange)#Stop-limit_order) - RFQ: A [request for * quote](https://en.wikipedia.org/wiki/Request_for_quote) - PEG: A pegged order that dynamically * adjust based on market conditions while maintaining execution discretion and avoiding adverse - * selection + * selection - SPREAD: A spread order that trades a futures contract against its spot underlying, or + * against another futures contract of the same underlying (calendar spread), to capture a target + * spread (futures price - spot price, or back month - front month) */ public enum OrderType { /** A [market order](https://en.wikipedia.org/wiki/Order_(exchange)#Market_order) */ @@ -59,5 +61,11 @@ public enum OrderType { * A pegged order that dynamically adjust based on market conditions while maintaining execution * discretion and avoiding adverse selection */ - PEG + PEG, + /** + * A spread order that trades a futures contract against its spot underlying, or against another + * futures contract of the same underlying (calendar spread), to capture a target spread (futures + * price - spot price, or back month - front month) + */ + SPREAD } diff --git a/src/main/java/com/coinbase/prime/model/enums/PaymentMethodType.java b/src/main/java/com/coinbase/prime/model/enums/PaymentMethodType.java index 2e558cdd..79dd6d34 100644 --- a/src/main/java/com/coinbase/prime/model/enums/PaymentMethodType.java +++ b/src/main/java/com/coinbase/prime/model/enums/PaymentMethodType.java @@ -19,14 +19,24 @@ package com.coinbase.prime.model.enums; /** - * - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - METHOD_WIRE: Wire transfer - METHOD_SEN: Silvergate - * exchange network - METHOD_SWIFT: Swift + * - UNKNOWN_PAYMENT_METHOD_TYPE: nil value - METHOD_WIRE: Wire transfer - METHOD_SEN: DEPRECATED. + * Silvergate exchange network - METHOD_SWIFT: Swift - METHOD_SEPA: Single Euro Payments Area - + * METHOD_CBIT: Customers Bank Instant Token - METHOD_PIX: Brazilian instant payment system - + * METHOD_JPM_KINEXYS: JPMorgan Kinexys */ public enum PaymentMethodType { /** Wire transfer */ METHOD_WIRE, - /** Silvergate exchange network */ + /** DEPRECATED. Silvergate exchange network */ METHOD_SEN, /** Swift */ - METHOD_SWIFT + METHOD_SWIFT, + /** Single Euro Payments Area */ + METHOD_SEPA, + /** Customers Bank Instant Token */ + METHOD_CBIT, + /** Brazilian instant payment system */ + METHOD_PIX, + /** JPMorgan Kinexys */ + METHOD_JPM_KINEXYS } diff --git a/src/main/java/com/coinbase/prime/model/enums/PrimeXMAssetClass.java b/src/main/java/com/coinbase/prime/model/enums/PrimeXMAssetClass.java new file mode 100644 index 00000000..0c2564c8 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/PrimeXMAssetClass.java @@ -0,0 +1,43 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * Asset class of the XM position underlier. - PRIME_XM_ASSET_CLASS_UNSPECIFIED: The asset class is + * unavailable for this position, or is not recognized by this API version. - + * PRIME_XM_ASSET_CLASS_CASH: USD and USDC. - PRIME_XM_ASSET_CLASS_FX: Non-USD fiat currencies + * recognized as FX in the margin model, such as EUR, GBP, and CHF. - + * PRIME_XM_ASSET_CLASS_STABLECOIN: Non-USDC stablecoins recognized as cash equivalents in the + * margin model, such as EURC and USDT. - PRIME_XM_ASSET_CLASS_CRYPTO: Crypto assets (e.g. BTC, + * ETH). + */ +public enum PrimeXMAssetClass { + /** The asset class is unavailable for this position, or is not recognized by this API version. */ + PRIME_XM_ASSET_CLASS_UNSPECIFIED, + /** USD and USDC. */ + PRIME_XM_ASSET_CLASS_CASH, + /** Non-USD fiat currencies recognized as FX in the margin model, such as EUR, GBP, and CHF. */ + PRIME_XM_ASSET_CLASS_FX, + /** + * Non-USDC stablecoins recognized as cash equivalents in the margin model, such as EURC and USDT. + */ + PRIME_XM_ASSET_CLASS_STABLECOIN, + /** Crypto assets (e.g. BTC, ETH). */ + PRIME_XM_ASSET_CLASS_CRYPTO +} diff --git a/src/main/java/com/coinbase/prime/model/enums/ProductType.java b/src/main/java/com/coinbase/prime/model/enums/ProductType.java index 8d487c22..d48b5cac 100644 --- a/src/main/java/com/coinbase/prime/model/enums/ProductType.java +++ b/src/main/java/com/coinbase/prime/model/enums/ProductType.java @@ -20,7 +20,9 @@ /** * - UNKNOWN_PRODUCT_TYPE: Unknown product type - SPOT: Spot product - FUTURE: Future product - - * OPTION: Option product + * OPTION: Option product - BASIS: Basis product: a futures contract traded against its spot + * underlying, or against another futures contract of the same underlying (calendar spread); the + * product of SPREAD orders */ public enum ProductType { /** Spot product */ @@ -28,5 +30,10 @@ public enum ProductType { /** Future product */ FUTURE, /** Option product */ - OPTION + OPTION, + /** + * Basis product: a futures contract traded against its spot underlying, or against another + * futures contract of the same underlying (calendar spread); the product of SPREAD orders + */ + BASIS } diff --git a/src/main/java/com/coinbase/prime/model/enums/RewardSubtype.java b/src/main/java/com/coinbase/prime/model/enums/RewardSubtype.java index 40e21765..f9b7787f 100644 --- a/src/main/java/com/coinbase/prime/model/enums/RewardSubtype.java +++ b/src/main/java/com/coinbase/prime/model/enums/RewardSubtype.java @@ -27,7 +27,8 @@ * (execution layer) rewards - STAKING_FEE_REBATE_REWARD: A staking fee rebate reward i.e. coinbase * pays rebates for staking fees to eligible delegators - BUIDL_DIVIDEND: A BUIDL dividend reward * i.e. dividends from BUIDL fund holdings - CUSTOM_STABLECOIN_REWARD: A custom stablecoin reward - * i.e. USDC reward payouts + * i.e. USDC reward payouts - TRADING_FEE_REBATE_REWARD: A trading fee rebate reward i.e. USDC + * trading-fee rebates paid by Coinbase */ public enum RewardSubtype { /** A maximal extractable value reward */ @@ -45,5 +46,7 @@ public enum RewardSubtype { /** A BUIDL dividend reward */ BUIDL_DIVIDEND, /** A custom stablecoin reward */ - CUSTOM_STABLECOIN_REWARD + CUSTOM_STABLECOIN_REWARD, + /** A trading fee rebate reward */ + TRADING_FEE_REBATE_REWARD } diff --git a/src/main/java/com/coinbase/prime/model/enums/BetaRewardsRateTierType.java b/src/main/java/com/coinbase/prime/model/enums/RewardsRateTierType.java similarity index 88% rename from src/main/java/com/coinbase/prime/model/enums/BetaRewardsRateTierType.java rename to src/main/java/com/coinbase/prime/model/enums/RewardsRateTierType.java index 3044d3c9..769989e2 100644 --- a/src/main/java/com/coinbase/prime/model/enums/BetaRewardsRateTierType.java +++ b/src/main/java/com/coinbase/prime/model/enums/RewardsRateTierType.java @@ -18,7 +18,8 @@ package com.coinbase.prime.model.enums; -public enum BetaRewardsRateTierType { +/** RewardsRateTierType describes what a rewards rate tier is scoped by. */ +public enum RewardsRateTierType { REWARDS_RATE_TIER_TYPE_BALANCE, REWARDS_RATE_TIER_TYPE_OPEN_INTEREST, REWARDS_RATE_TIER_TYPE_PERCENT_VOLUME diff --git a/src/main/java/com/coinbase/prime/model/enums/SecondaryPermission.java b/src/main/java/com/coinbase/prime/model/enums/SecondaryPermission.java index 5eb5ca0e..f01c45ae 100644 --- a/src/main/java/com/coinbase/prime/model/enums/SecondaryPermission.java +++ b/src/main/java/com/coinbase/prime/model/enums/SecondaryPermission.java @@ -20,13 +20,13 @@ /** * - SECONDARY_PERMISSION_UNKNOWN: nil value - VIDEO_APPROVER: A video approver - TEAM_APPROVER: A - * team approver - WEB3_SIGNER: A web3 signer + * team approver - WEB3_SIGNER: A web3/onchain signer */ public enum SecondaryPermission { /** A video approver */ VIDEO_APPROVER, /** A team approver */ TEAM_APPROVER, - /** A web3 signer */ + /** A web3/onchain signer */ WEB3_SIGNER } diff --git a/src/main/java/com/coinbase/prime/model/enums/SpreadLimitType.java b/src/main/java/com/coinbase/prime/model/enums/SpreadLimitType.java new file mode 100644 index 00000000..9c458947 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/SpreadLimitType.java @@ -0,0 +1,30 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * - UNKNOWN_SPREAD_LIMIT_TYPE: nil value - SPREAD_LIMIT_TYPE_BPS: Limit in basis points of the spot + * price - SPREAD_LIMIT_TYPE_USD: Limit in USD + */ +public enum SpreadLimitType { + /** Limit in basis points of the spot price */ + SPREAD_LIMIT_TYPE_BPS, + /** Limit in USD */ + SPREAD_LIMIT_TYPE_USD +} diff --git a/src/main/java/com/coinbase/prime/model/enums/TransactionType.java b/src/main/java/com/coinbase/prime/model/enums/TransactionType.java index 3ec80f1c..8561d02c 100644 --- a/src/main/java/com/coinbase/prime/model/enums/TransactionType.java +++ b/src/main/java/com/coinbase/prime/model/enums/TransactionType.java @@ -47,7 +47,9 @@ * ONCHAIN_TRANSACTION: On-chain transaction initiated with Prime Onchain Wallet - PORTFOLIO_STAKE: * Portfolio-level staking operation - PORTFOLIO_UNSTAKE: Portfolio-level unstaking operation - * MERGE_STAKE: On-chain transaction consolidating funds from different addresses belonging to the - * same wallet. + * same wallet. - ONCHAIN_DEPOSIT: On-chain deposit detected into a Prime Onchain Wallet - + * ONCHAIN_REWARD: Automated on-chain reward payout to a blockchain address - ONCHAIN_MESSAGE: + * Message signing initiated with Prime Onchain Wallet; no funds move on-chain. */ public enum TransactionType { /** A fiat or crypto deposit */ @@ -125,5 +127,11 @@ public enum TransactionType { /** * On-chain transaction consolidating funds from different addresses belonging to the same wallet. */ - MERGE_STAKE + MERGE_STAKE, + /** On-chain deposit detected into a Prime Onchain Wallet */ + ONCHAIN_DEPOSIT, + /** Automated on-chain reward payout to a blockchain address */ + ONCHAIN_REWARD, + /** Message signing initiated with Prime Onchain Wallet; no funds move on-chain. */ + ONCHAIN_MESSAGE } diff --git a/src/main/java/com/coinbase/prime/model/enums/TransferLocationType.java b/src/main/java/com/coinbase/prime/model/enums/TransferLocationType.java index 7dfe4c14..ec0f13ea 100644 --- a/src/main/java/com/coinbase/prime/model/enums/TransferLocationType.java +++ b/src/main/java/com/coinbase/prime/model/enums/TransferLocationType.java @@ -21,8 +21,9 @@ /** * - TRANSFER_LOCATION_TYPE_UNKNOWN: The nil value - PAYMENT_METHOD: The ID of a fiat payment method * - WALLET: The ID of a wallet - ADDRESS: A cryptocurrency address - OTHER: Another type of - * transfer location: Blockchain Network, Coinbase - MULTIPLE_ADDRESSES: Multiple cryptocurrency - * addresses - COUNTERPARTY_ID: Counterparty ID + * transfer location: Blockchain Network, Coinbase - MULTIPLE_ADDRESSES: More than one + * cryptocurrency address. value and address are empty; the addresses are not listed. A single + * address uses ADDRESS. - COUNTERPARTY_ID: Counterparty ID */ public enum TransferLocationType { /** The ID of a fiat payment method */ @@ -33,7 +34,10 @@ public enum TransferLocationType { ADDRESS, /** Another type of transfer location: Blockchain Network, Coinbase */ OTHER, - /** Multiple cryptocurrency addresses */ + /** + * More than one cryptocurrency address. value and address are empty; the addresses are not + * listed. A single address uses ADDRESS. + */ MULTIPLE_ADDRESSES, /** Counterparty ID */ COUNTERPARTY_ID diff --git a/src/main/java/com/coinbase/prime/model/enums/WalletDepositInstructionType.java b/src/main/java/com/coinbase/prime/model/enums/WalletDepositInstructionType.java index 04d77491..b98900e2 100644 --- a/src/main/java/com/coinbase/prime/model/enums/WalletDepositInstructionType.java +++ b/src/main/java/com/coinbase/prime/model/enums/WalletDepositInstructionType.java @@ -21,7 +21,7 @@ /** * - UNKNOWN_WALLET_DEPOSIT_TYPE: nil value - CRYPTO: A cryptocurrency deposit - WIRE: A wire * deposit - SEN: DEPRECATED. A Silvergate Exchange Network deposit - SWIFT: A SWIFT deposit - SEPA: - * A SEPA deposit (Single Euro Payments Area) + * A SEPA deposit (Single Euro Payments Area) - KINEXYS: A JPM Kinexys deposit */ public enum WalletDepositInstructionType { /** A cryptocurrency deposit */ @@ -33,5 +33,7 @@ public enum WalletDepositInstructionType { /** A SWIFT deposit */ SWIFT, /** A SEPA deposit (Single Euro Payments Area) */ - SEPA + SEPA, + /** A JPM Kinexys deposit */ + KINEXYS } diff --git a/src/main/java/com/coinbase/prime/model/enums/WalletType.java b/src/main/java/com/coinbase/prime/model/enums/WalletType.java index 71f277a4..4bc08fb9 100644 --- a/src/main/java/com/coinbase/prime/model/enums/WalletType.java +++ b/src/main/java/com/coinbase/prime/model/enums/WalletType.java @@ -32,5 +32,6 @@ public enum WalletType { /** A QC Wallet */ QC, /** An Onchain wallet */ - ONCHAIN + ONCHAIN, + INTERNATIONAL_DERIVATIVES } diff --git a/src/main/java/com/coinbase/prime/model/enums/WebhookAuthType.java b/src/main/java/com/coinbase/prime/model/enums/WebhookAuthType.java new file mode 100644 index 00000000..fb6de126 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/WebhookAuthType.java @@ -0,0 +1,41 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * WebhookAuthType is how Prime authenticates to your endpoint, on top of the signatures. Every + * delivery is signed twice, whatever the auth type: with HMAC-SHA256 in X-Coinbase-Signature, keyed + * by the subscription's hmac_secret, and with Ed25519 in X-Coinbase-Signature-Ed25519, verifiable + * with the public key named by X-Coinbase-Signature-Key-Id at /.well-known/jwks.json. Verify either + * one. - WEBHOOK_AUTH_TYPE_SIGNATURE_ONLY: Signatures only. Used when a subscription is created + * without auth_type. - WEBHOOK_AUTH_TYPE_OAUTH: Signatures plus an OAuth 2.0 bearer token, fetched + * with oauth_config, in the Authorization header. - WEBHOOK_AUTH_TYPE_MTLS: Signatures plus a + * Coinbase client certificate (mutual TLS). - WEBHOOK_AUTH_TYPE_OAUTH_MTLS: Signatures plus both an + * OAuth 2.0 bearer token and a client certificate. + */ +public enum WebhookAuthType { + /** Signatures only. Used when a subscription is created without auth_type. */ + WEBHOOK_AUTH_TYPE_SIGNATURE_ONLY, + /** Signatures plus an OAuth 2.0 bearer token, fetched with oauth_config, in */ + WEBHOOK_AUTH_TYPE_OAUTH, + /** Signatures plus a Coinbase client certificate (mutual TLS). */ + WEBHOOK_AUTH_TYPE_MTLS, + /** Signatures plus both an OAuth 2.0 bearer token and a client certificate. */ + WEBHOOK_AUTH_TYPE_OAUTH_MTLS +} diff --git a/src/main/java/com/coinbase/prime/model/enums/WebhookDeliveryStatus.java b/src/main/java/com/coinbase/prime/model/enums/WebhookDeliveryStatus.java new file mode 100644 index 00000000..3f5c9637 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/WebhookDeliveryStatus.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** WebhookDeliveryStatus describes the delivery state of a webhook event. */ +public enum WebhookDeliveryStatus { + WEBHOOK_DELIVERY_STATUS_DELIVERED, + WEBHOOK_DELIVERY_STATUS_RETRYING, + WEBHOOK_DELIVERY_STATUS_FAILED, + WEBHOOK_DELIVERY_STATUS_PENDING +} diff --git a/src/main/java/com/coinbase/prime/model/enums/WebhookErrorType.java b/src/main/java/com/coinbase/prime/model/enums/WebhookErrorType.java new file mode 100644 index 00000000..b3b63353 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/WebhookErrorType.java @@ -0,0 +1,31 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** WebhookErrorType classifies the outcome of a webhook delivery attempt. */ +public enum WebhookErrorType { + WEBHOOK_ERROR_TYPE_SUCCESS, + WEBHOOK_ERROR_TYPE_HTTP_4_XX, + WEBHOOK_ERROR_TYPE_HTTP_5_XX, + WEBHOOK_ERROR_TYPE_TIMEOUT, + WEBHOOK_ERROR_TYPE_CONNECTION_ERROR, + WEBHOOK_ERROR_TYPE_HTTP_3_XX, + WEBHOOK_ERROR_TYPE_INVALID_EVENT, + WEBHOOK_ERROR_TYPE_CANCELED +} diff --git a/src/main/java/com/coinbase/prime/model/enums/WebhookHealthStatus.java b/src/main/java/com/coinbase/prime/model/enums/WebhookHealthStatus.java new file mode 100644 index 00000000..d72f424c --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/WebhookHealthStatus.java @@ -0,0 +1,27 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** WebhookHealthStatus describes the current delivery health of a subscription. */ +public enum WebhookHealthStatus { + WEBHOOK_HEALTH_STATUS_HEALTHY, + WEBHOOK_HEALTH_STATUS_DEGRADED, + WEBHOOK_HEALTH_STATUS_FAILING, + WEBHOOK_HEALTH_STATUS_DISABLED +} diff --git a/src/main/java/com/coinbase/prime/model/enums/XMPositionType.java b/src/main/java/com/coinbase/prime/model/enums/XMPositionType.java new file mode 100644 index 00000000..f94cdb81 --- /dev/null +++ b/src/main/java/com/coinbase/prime/model/enums/XMPositionType.java @@ -0,0 +1,32 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Do not edit the class manually. + */ + +package com.coinbase.prime.model.enums; + +/** + * Type of a position leg within a per-asset XM row. New values may be added as more legs are broken + * out. - XM_POSITION_TYPE_UNSPECIFIED: The position type is unavailable, or is not recognized by + * this API version. - XM_POSITION_TYPE_SPOT_TRADING: Spot balance held outside Prime Vault (trading + * balance, including Prime Loans). - XM_POSITION_TYPE_SPOT_VAULT: Spot balance held in Prime Vault. + */ +public enum XMPositionType { + /** Spot balance held outside Prime Vault (trading balance, including Prime Loans). */ + XM_POSITION_TYPE_SPOT_TRADING, + /** Spot balance held in Prime Vault. */ + XM_POSITION_TYPE_SPOT_VAULT +} diff --git a/src/main/java/com/coinbase/prime/onchainaddressbook/OnchainAddressBookServiceImpl.java b/src/main/java/com/coinbase/prime/onchainaddressbook/OnchainAddressBookServiceImpl.java index bf8edb20..833fa208 100644 --- a/src/main/java/com/coinbase/prime/onchainaddressbook/OnchainAddressBookServiceImpl.java +++ b/src/main/java/com/coinbase/prime/onchainaddressbook/OnchainAddressBookServiceImpl.java @@ -47,7 +47,7 @@ public CreateOnchainAddressBookEntryResponse createOnchainAddressBookEntry( HttpMethod.POST, String.format("/portfolios/%s/onchain_address_group", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } diff --git a/src/main/java/com/coinbase/prime/orders/CreateOrderPreviewRequest.java b/src/main/java/com/coinbase/prime/orders/CreateOrderPreviewRequest.java new file mode 100644 index 00000000..4041d3b7 --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/CreateOrderPreviewRequest.java @@ -0,0 +1,469 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.SpreadConfig; +import com.coinbase.prime.model.enums.LimitPriceType; +import com.coinbase.prime.model.enums.OrderSide; +import com.coinbase.prime.model.enums.OrderType; +import com.coinbase.prime.model.enums.PegOffsetType; +import com.coinbase.prime.model.enums.TimeInForceType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Order Preview */ +public class CreateOrderPreviewRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("product_id") + private String productId; + + @JsonProperty("side") + private OrderSide side; + + @JsonProperty("type") + private OrderType type; + + @JsonProperty("base_quantity") + private String baseQuantity; + + @JsonProperty("quote_value") + private String quoteValue; + + @JsonProperty("limit_price") + private String limitPrice; + + @JsonProperty("start_time") + private String startTime; + + @JsonProperty("expiry_time") + private String expiryTime; + + @JsonProperty("time_in_force") + private TimeInForceType timeInForce; + + @JsonProperty("is_raise_exact") + private Boolean isRaiseExact; + + /** Buy Exact order flag */ + @JsonProperty("is_buy_exact") + private Boolean isBuyExact; + + @JsonProperty("historical_pov") + private String historicalPov; + + @JsonProperty("stop_price") + private String stopPrice; + + @JsonProperty("settl_currency") + private String settlCurrency; + + @JsonProperty("postOnly") + private Boolean postOnly; + + @JsonProperty("display_quote_size") + private String displayQuoteSize; + + @JsonProperty("display_base_size") + private String displayBaseSize; + + @JsonProperty("peg_offset_type") + private PegOffsetType pegOffsetType; + + @JsonProperty("offset") + private String offset; + + @JsonProperty("wig_level") + private String wigLevel; + + @JsonProperty("limit_price_type") + private LimitPriceType limitPriceType; + + @JsonProperty("spread_config") + private SpreadConfig spreadConfig; + + public CreateOrderPreviewRequest() {} + + public CreateOrderPreviewRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.productId = builder.productId; + this.side = builder.side; + this.type = builder.type; + this.baseQuantity = builder.baseQuantity; + this.quoteValue = builder.quoteValue; + this.limitPrice = builder.limitPrice; + this.startTime = builder.startTime; + this.expiryTime = builder.expiryTime; + this.timeInForce = builder.timeInForce; + this.isRaiseExact = builder.isRaiseExact; + this.isBuyExact = builder.isBuyExact; + this.historicalPov = builder.historicalPov; + this.stopPrice = builder.stopPrice; + this.settlCurrency = builder.settlCurrency; + this.postOnly = builder.postOnly; + this.displayQuoteSize = builder.displayQuoteSize; + this.displayBaseSize = builder.displayBaseSize; + this.pegOffsetType = builder.pegOffsetType; + this.offset = builder.offset; + this.wigLevel = builder.wigLevel; + this.limitPriceType = builder.limitPriceType; + this.spreadConfig = builder.spreadConfig; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public OrderSide getSide() { + return side; + } + + public void setSide(OrderSide side) { + this.side = side; + } + + public OrderType getType() { + return type; + } + + public void setType(OrderType type) { + this.type = type; + } + + public String getBaseQuantity() { + return baseQuantity; + } + + public void setBaseQuantity(String baseQuantity) { + this.baseQuantity = baseQuantity; + } + + public String getQuoteValue() { + return quoteValue; + } + + public void setQuoteValue(String quoteValue) { + this.quoteValue = quoteValue; + } + + public String getLimitPrice() { + return limitPrice; + } + + public void setLimitPrice(String limitPrice) { + this.limitPrice = limitPrice; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getExpiryTime() { + return expiryTime; + } + + public void setExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + } + + public TimeInForceType getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(TimeInForceType timeInForce) { + this.timeInForce = timeInForce; + } + + public Boolean getIsRaiseExact() { + return isRaiseExact; + } + + public void setIsRaiseExact(Boolean isRaiseExact) { + this.isRaiseExact = isRaiseExact; + } + + public Boolean getIsBuyExact() { + return isBuyExact; + } + + public void setIsBuyExact(Boolean isBuyExact) { + this.isBuyExact = isBuyExact; + } + + public String getHistoricalPov() { + return historicalPov; + } + + public void setHistoricalPov(String historicalPov) { + this.historicalPov = historicalPov; + } + + public String getStopPrice() { + return stopPrice; + } + + public void setStopPrice(String stopPrice) { + this.stopPrice = stopPrice; + } + + public String getSettlCurrency() { + return settlCurrency; + } + + public void setSettlCurrency(String settlCurrency) { + this.settlCurrency = settlCurrency; + } + + public Boolean getPostOnly() { + return postOnly; + } + + public void setPostOnly(Boolean postOnly) { + this.postOnly = postOnly; + } + + public String getDisplayQuoteSize() { + return displayQuoteSize; + } + + public void setDisplayQuoteSize(String displayQuoteSize) { + this.displayQuoteSize = displayQuoteSize; + } + + public String getDisplayBaseSize() { + return displayBaseSize; + } + + public void setDisplayBaseSize(String displayBaseSize) { + this.displayBaseSize = displayBaseSize; + } + + public PegOffsetType getPegOffsetType() { + return pegOffsetType; + } + + public void setPegOffsetType(PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + } + + public String getOffset() { + return offset; + } + + public void setOffset(String offset) { + this.offset = offset; + } + + public String getWigLevel() { + return wigLevel; + } + + public void setWigLevel(String wigLevel) { + this.wigLevel = wigLevel; + } + + public LimitPriceType getLimitPriceType() { + return limitPriceType; + } + + public void setLimitPriceType(LimitPriceType limitPriceType) { + this.limitPriceType = limitPriceType; + } + + public SpreadConfig getSpreadConfig() { + return spreadConfig; + } + + public void setSpreadConfig(SpreadConfig spreadConfig) { + this.spreadConfig = spreadConfig; + } + + public static class Builder { + private String portfolioId; + private String productId; + private OrderSide side; + private OrderType type; + private String baseQuantity; + private String quoteValue; + private String limitPrice; + private String startTime; + private String expiryTime; + private TimeInForceType timeInForce; + private Boolean isRaiseExact; + private Boolean isBuyExact; + private String historicalPov; + private String stopPrice; + private String settlCurrency; + private Boolean postOnly; + private String displayQuoteSize; + private String displayBaseSize; + private PegOffsetType pegOffsetType; + private String offset; + private String wigLevel; + private LimitPriceType limitPriceType; + private SpreadConfig spreadConfig; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder side(OrderSide side) { + this.side = side; + return this; + } + + public Builder type(OrderType type) { + this.type = type; + return this; + } + + public Builder baseQuantity(String baseQuantity) { + this.baseQuantity = baseQuantity; + return this; + } + + public Builder quoteValue(String quoteValue) { + this.quoteValue = quoteValue; + return this; + } + + public Builder limitPrice(String limitPrice) { + this.limitPrice = limitPrice; + return this; + } + + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + public Builder expiryTime(String expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + public Builder timeInForce(TimeInForceType timeInForce) { + this.timeInForce = timeInForce; + return this; + } + + public Builder isRaiseExact(Boolean isRaiseExact) { + this.isRaiseExact = isRaiseExact; + return this; + } + + public Builder isBuyExact(Boolean isBuyExact) { + this.isBuyExact = isBuyExact; + return this; + } + + public Builder historicalPov(String historicalPov) { + this.historicalPov = historicalPov; + return this; + } + + public Builder stopPrice(String stopPrice) { + this.stopPrice = stopPrice; + return this; + } + + public Builder settlCurrency(String settlCurrency) { + this.settlCurrency = settlCurrency; + return this; + } + + public Builder postOnly(Boolean postOnly) { + this.postOnly = postOnly; + return this; + } + + public Builder displayQuoteSize(String displayQuoteSize) { + this.displayQuoteSize = displayQuoteSize; + return this; + } + + public Builder displayBaseSize(String displayBaseSize) { + this.displayBaseSize = displayBaseSize; + return this; + } + + public Builder pegOffsetType(PegOffsetType pegOffsetType) { + this.pegOffsetType = pegOffsetType; + return this; + } + + public Builder offset(String offset) { + this.offset = offset; + return this; + } + + public Builder wigLevel(String wigLevel) { + this.wigLevel = wigLevel; + return this; + } + + public Builder limitPriceType(LimitPriceType limitPriceType) { + this.limitPriceType = limitPriceType; + return this; + } + + public Builder spreadConfig(SpreadConfig spreadConfig) { + this.spreadConfig = spreadConfig; + return this; + } + + public CreateOrderPreviewRequest build() throws CoinbaseClientException { + validate(); + return new CreateOrderPreviewRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/orders/CreateOrderPreviewResponse.java b/src/main/java/com/coinbase/prime/orders/CreateOrderPreviewResponse.java new file mode 100644 index 00000000..a638c465 --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/CreateOrderPreviewResponse.java @@ -0,0 +1,377 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import com.coinbase.prime.model.OptionGreeks; +import com.coinbase.prime.model.SpreadPreview; +import com.coinbase.prime.model.enums.OrderSide; +import com.coinbase.prime.model.enums.OrderType; +import com.coinbase.prime.model.enums.TimeInForceType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Order Preview */ +public class CreateOrderPreviewResponse { + @JsonProperty("portfolio_id") + private String portfolioId; + + @JsonProperty("product_id") + private String productId; + + @JsonProperty("side") + private OrderSide side; + + @JsonProperty("type") + private OrderType type; + + @JsonProperty("base_quantity") + private String baseQuantity; + + @JsonProperty("quote_value") + private String quoteValue; + + @JsonProperty("limit_price") + private String limitPrice; + + @JsonProperty("start_time") + private String startTime; + + @JsonProperty("expiry_time") + private String expiryTime; + + @JsonProperty("time_in_force") + private TimeInForceType timeInForce; + + @JsonProperty("commission") + private String commission; + + @JsonProperty("slippage") + private String slippage; + + @JsonProperty("best_bid") + private String bestBid; + + @JsonProperty("best_ask") + private String bestAsk; + + @JsonProperty("average_filled_price") + private String averageFilledPrice; + + @JsonProperty("order_total") + private String orderTotal; + + @JsonProperty("historical_pov") + private String historicalPov; + + @JsonProperty("is_raise_exact") + private Boolean isRaiseExact; + + /** Buy Exact order flag */ + @JsonProperty("is_buy_exact") + private Boolean isBuyExact; + + @JsonProperty("stop_price") + private String stopPrice; + + @JsonProperty("display_size") + private String displaySize; + + @JsonProperty("display_quote_size") + private String displayQuoteSize; + + @JsonProperty("display_base_size") + private String displayBaseSize; + + @JsonProperty("option_greeks") + private OptionGreeks optionGreeks; + + @JsonProperty("spread_preview") + private SpreadPreview spreadPreview; + + /** + * Futures and SPREAD orders only: amount of the portfolio's derivatives margin limit used before + * this order. For cross-margin portfolios, the cross-margin limit consumed. + */ + @JsonProperty("current_margin_utilization") + private String currentMarginUtilization; + + /** + * Futures and SPREAD orders only: `current_margin_utilization` as a percentage of the margin + * limit (0-100, e.g. "1.2" means 1.2%, not a 0-1 decimal) + */ + @JsonProperty("current_margin_utilization_ratio") + private String currentMarginUtilizationRatio; + + /** + * Futures and SPREAD orders only: amount of the portfolio's derivatives margin limit used if this + * order fills. For cross-margin portfolios, the cross-margin limit consumed. + */ + @JsonProperty("projected_margin_utilization") + private String projectedMarginUtilization; + + /** + * Futures and SPREAD orders only: `projected_margin_utilization` as a percentage of the margin + * limit (0-100, e.g. "3.6" means 3.6%, not a 0-1 decimal) + */ + @JsonProperty("projected_margin_utilization_ratio") + private String projectedMarginUtilizationRatio; + + /** The requested `settl_currency`, echoed */ + @JsonProperty("settl_currency") + private String settlCurrency; + + public CreateOrderPreviewResponse() {} + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public OrderSide getSide() { + return side; + } + + public void setSide(OrderSide side) { + this.side = side; + } + + public OrderType getType() { + return type; + } + + public void setType(OrderType type) { + this.type = type; + } + + public String getBaseQuantity() { + return baseQuantity; + } + + public void setBaseQuantity(String baseQuantity) { + this.baseQuantity = baseQuantity; + } + + public String getQuoteValue() { + return quoteValue; + } + + public void setQuoteValue(String quoteValue) { + this.quoteValue = quoteValue; + } + + public String getLimitPrice() { + return limitPrice; + } + + public void setLimitPrice(String limitPrice) { + this.limitPrice = limitPrice; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getExpiryTime() { + return expiryTime; + } + + public void setExpiryTime(String expiryTime) { + this.expiryTime = expiryTime; + } + + public TimeInForceType getTimeInForce() { + return timeInForce; + } + + public void setTimeInForce(TimeInForceType timeInForce) { + this.timeInForce = timeInForce; + } + + public String getCommission() { + return commission; + } + + public void setCommission(String commission) { + this.commission = commission; + } + + public String getSlippage() { + return slippage; + } + + public void setSlippage(String slippage) { + this.slippage = slippage; + } + + public String getBestBid() { + return bestBid; + } + + public void setBestBid(String bestBid) { + this.bestBid = bestBid; + } + + public String getBestAsk() { + return bestAsk; + } + + public void setBestAsk(String bestAsk) { + this.bestAsk = bestAsk; + } + + public String getAverageFilledPrice() { + return averageFilledPrice; + } + + public void setAverageFilledPrice(String averageFilledPrice) { + this.averageFilledPrice = averageFilledPrice; + } + + public String getOrderTotal() { + return orderTotal; + } + + public void setOrderTotal(String orderTotal) { + this.orderTotal = orderTotal; + } + + public String getHistoricalPov() { + return historicalPov; + } + + public void setHistoricalPov(String historicalPov) { + this.historicalPov = historicalPov; + } + + public Boolean getIsRaiseExact() { + return isRaiseExact; + } + + public void setIsRaiseExact(Boolean isRaiseExact) { + this.isRaiseExact = isRaiseExact; + } + + public Boolean getIsBuyExact() { + return isBuyExact; + } + + public void setIsBuyExact(Boolean isBuyExact) { + this.isBuyExact = isBuyExact; + } + + public String getStopPrice() { + return stopPrice; + } + + public void setStopPrice(String stopPrice) { + this.stopPrice = stopPrice; + } + + public String getDisplaySize() { + return displaySize; + } + + public void setDisplaySize(String displaySize) { + this.displaySize = displaySize; + } + + public String getDisplayQuoteSize() { + return displayQuoteSize; + } + + public void setDisplayQuoteSize(String displayQuoteSize) { + this.displayQuoteSize = displayQuoteSize; + } + + public String getDisplayBaseSize() { + return displayBaseSize; + } + + public void setDisplayBaseSize(String displayBaseSize) { + this.displayBaseSize = displayBaseSize; + } + + public OptionGreeks getOptionGreeks() { + return optionGreeks; + } + + public void setOptionGreeks(OptionGreeks optionGreeks) { + this.optionGreeks = optionGreeks; + } + + public SpreadPreview getSpreadPreview() { + return spreadPreview; + } + + public void setSpreadPreview(SpreadPreview spreadPreview) { + this.spreadPreview = spreadPreview; + } + + public String getCurrentMarginUtilization() { + return currentMarginUtilization; + } + + public void setCurrentMarginUtilization(String currentMarginUtilization) { + this.currentMarginUtilization = currentMarginUtilization; + } + + public String getCurrentMarginUtilizationRatio() { + return currentMarginUtilizationRatio; + } + + public void setCurrentMarginUtilizationRatio(String currentMarginUtilizationRatio) { + this.currentMarginUtilizationRatio = currentMarginUtilizationRatio; + } + + public String getProjectedMarginUtilization() { + return projectedMarginUtilization; + } + + public void setProjectedMarginUtilization(String projectedMarginUtilization) { + this.projectedMarginUtilization = projectedMarginUtilization; + } + + public String getProjectedMarginUtilizationRatio() { + return projectedMarginUtilizationRatio; + } + + public void setProjectedMarginUtilizationRatio(String projectedMarginUtilizationRatio) { + this.projectedMarginUtilizationRatio = projectedMarginUtilizationRatio; + } + + public String getSettlCurrency() { + return settlCurrency; + } + + public void setSettlCurrency(String settlCurrency) { + this.settlCurrency = settlCurrency; + } +} diff --git a/src/main/java/com/coinbase/prime/orders/CreateOrderRequest.java b/src/main/java/com/coinbase/prime/orders/CreateOrderRequest.java index 0b12374f..dea66d01 100644 --- a/src/main/java/com/coinbase/prime/orders/CreateOrderRequest.java +++ b/src/main/java/com/coinbase/prime/orders/CreateOrderRequest.java @@ -19,6 +19,8 @@ import static com.coinbase.core.utils.Utils.isNullOrEmpty; import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.SpreadConfig; +import com.coinbase.prime.model.enums.LimitPriceType; import com.coinbase.prime.model.enums.OrderSide; import com.coinbase.prime.model.enums.OrderType; import com.coinbase.prime.model.enums.PegOffsetType; @@ -160,6 +162,12 @@ public class CreateOrderRequest { @JsonProperty("wig_level") private String wigLevel; + @JsonProperty("limit_price_type") + private LimitPriceType limitPriceType; + + @JsonProperty("spread_config") + private SpreadConfig spreadConfig; + public CreateOrderRequest() {} public CreateOrderRequest(Builder builder) { @@ -186,6 +194,8 @@ public CreateOrderRequest(Builder builder) { this.pegOffsetType = builder.pegOffsetType; this.offset = builder.offset; this.wigLevel = builder.wigLevel; + this.limitPriceType = builder.limitPriceType; + this.spreadConfig = builder.spreadConfig; } public String getPortfolioId() { @@ -372,6 +382,22 @@ public void setWigLevel(String wigLevel) { this.wigLevel = wigLevel; } + public LimitPriceType getLimitPriceType() { + return limitPriceType; + } + + public void setLimitPriceType(LimitPriceType limitPriceType) { + this.limitPriceType = limitPriceType; + } + + public SpreadConfig getSpreadConfig() { + return spreadConfig; + } + + public void setSpreadConfig(SpreadConfig spreadConfig) { + this.spreadConfig = spreadConfig; + } + public static class Builder { private String portfolioId; private String productId; @@ -396,6 +422,8 @@ public static class Builder { private PegOffsetType pegOffsetType; private String offset; private String wigLevel; + private LimitPriceType limitPriceType; + private SpreadConfig spreadConfig; public Builder() {} @@ -514,6 +542,16 @@ public Builder wigLevel(String wigLevel) { return this; } + public Builder limitPriceType(LimitPriceType limitPriceType) { + this.limitPriceType = limitPriceType; + return this; + } + + public Builder spreadConfig(SpreadConfig spreadConfig) { + this.spreadConfig = spreadConfig; + return this; + } + public CreateOrderRequest build() throws CoinbaseClientException { validate(); return new CreateOrderRequest(this); diff --git a/src/main/java/com/coinbase/prime/orders/CreateQuoteRequest.java b/src/main/java/com/coinbase/prime/orders/CreateQuoteRequest.java index 8b815182..6e7e5541 100644 --- a/src/main/java/com/coinbase/prime/orders/CreateQuoteRequest.java +++ b/src/main/java/com/coinbase/prime/orders/CreateQuoteRequest.java @@ -50,6 +50,22 @@ public class CreateQuoteRequest { @JsonProperty("settl_currency") private String settlCurrency; + /** + * Optional quote timeout in milliseconds. Defaults to 3000 ms (3 seconds) if not specified. + * Maximum allowed value is 30000 ms (30 seconds); requests with a larger value are rejected. + * Mirrors FIX tag 8090 (QuoteRequestGoodForMs). + */ + @JsonProperty("quote_duration_ms") + private String quoteDurationMs; + + /** + * Buy Exact order flag. When true, fees for a BUY RFQ sized in quote_value are charged on top of + * the requested quote_value instead of being carved out of it. Only valid for BUY RFQs sized in + * quote_value on SPOT products. + */ + @JsonProperty("is_buy_exact") + private Boolean isBuyExact; + public CreateQuoteRequest() {} public CreateQuoteRequest(Builder builder) { @@ -61,6 +77,8 @@ public CreateQuoteRequest(Builder builder) { this.quoteValue = builder.quoteValue; this.limitPrice = builder.limitPrice; this.settlCurrency = builder.settlCurrency; + this.quoteDurationMs = builder.quoteDurationMs; + this.isBuyExact = builder.isBuyExact; } public String getPortfolioId() { @@ -127,6 +145,22 @@ public void setSettlCurrency(String settlCurrency) { this.settlCurrency = settlCurrency; } + public String getQuoteDurationMs() { + return quoteDurationMs; + } + + public void setQuoteDurationMs(String quoteDurationMs) { + this.quoteDurationMs = quoteDurationMs; + } + + public Boolean getIsBuyExact() { + return isBuyExact; + } + + public void setIsBuyExact(Boolean isBuyExact) { + this.isBuyExact = isBuyExact; + } + public static class Builder { private String portfolioId; private String productId; @@ -136,6 +170,8 @@ public static class Builder { private String quoteValue; private String limitPrice; private String settlCurrency; + private String quoteDurationMs; + private Boolean isBuyExact; public Builder() {} @@ -179,6 +215,16 @@ public Builder settlCurrency(String settlCurrency) { return this; } + public Builder quoteDurationMs(String quoteDurationMs) { + this.quoteDurationMs = quoteDurationMs; + return this; + } + + public Builder isBuyExact(Boolean isBuyExact) { + this.isBuyExact = isBuyExact; + return this; + } + public CreateQuoteRequest build() throws CoinbaseClientException { validate(); return new CreateQuoteRequest(this); diff --git a/src/main/java/com/coinbase/prime/orders/CreateQuoteResponse.java b/src/main/java/com/coinbase/prime/orders/CreateQuoteResponse.java index 684856fc..ba784ee1 100644 --- a/src/main/java/com/coinbase/prime/orders/CreateQuoteResponse.java +++ b/src/main/java/com/coinbase/prime/orders/CreateQuoteResponse.java @@ -35,6 +35,17 @@ public class CreateQuoteResponse { @JsonProperty("price_inclusive_of_fees") private String priceInclusiveOfFees; + /** + * Echo of the quote_duration_ms supplied in the request. 0 if the client did not supply a value, + * in which case the server applies the default of 3000 ms (3 seconds). + */ + @JsonProperty("quote_duration_ms") + private String quoteDurationMs; + + /** Buy Exact order flag */ + @JsonProperty("is_buy_exact") + private Boolean isBuyExact; + public CreateQuoteResponse() {} public String getQuoteId() { @@ -76,4 +87,20 @@ public String getPriceInclusiveOfFees() { public void setPriceInclusiveOfFees(String priceInclusiveOfFees) { this.priceInclusiveOfFees = priceInclusiveOfFees; } + + public String getQuoteDurationMs() { + return quoteDurationMs; + } + + public void setQuoteDurationMs(String quoteDurationMs) { + this.quoteDurationMs = quoteDurationMs; + } + + public Boolean getIsBuyExact() { + return isBuyExact; + } + + public void setIsBuyExact(Boolean isBuyExact) { + this.isBuyExact = isBuyExact; + } } diff --git a/src/main/java/com/coinbase/prime/orders/EditOrderRequest.java b/src/main/java/com/coinbase/prime/orders/EditOrderRequest.java index 52d1815d..5aa8b3b4 100644 --- a/src/main/java/com/coinbase/prime/orders/EditOrderRequest.java +++ b/src/main/java/com/coinbase/prime/orders/EditOrderRequest.java @@ -87,6 +87,21 @@ public class EditOrderRequest { @JsonProperty("stop_price") private String stopPrice; + /** + * New peg offset value for PEG orders. 0 means peg to BBO. Only non-negative values are allowed. + * The order's peg_offset_type is immutable and is reused server-side to interpret this value (PEG + * orders only) + */ + @JsonProperty("offset") + private String offset; + + /** + * New WIG (Would if Good) level for PEG orders - the best price a pegged order would be placed on + * venues, opposite to limit_price. Cannot be added or removed post-placement (PEG orders only) + */ + @JsonProperty("wig_level") + private String wigLevel; + public EditOrderRequest() {} public EditOrderRequest(Builder builder) { @@ -102,6 +117,8 @@ public EditOrderRequest(Builder builder) { this.displayQuoteSize = builder.displayQuoteSize; this.displayBaseSize = builder.displayBaseSize; this.stopPrice = builder.stopPrice; + this.offset = builder.offset; + this.wigLevel = builder.wigLevel; } public String getPortfolioId() { @@ -200,6 +217,22 @@ public void setStopPrice(String stopPrice) { this.stopPrice = stopPrice; } + public String getOffset() { + return offset; + } + + public void setOffset(String offset) { + this.offset = offset; + } + + public String getWigLevel() { + return wigLevel; + } + + public void setWigLevel(String wigLevel) { + this.wigLevel = wigLevel; + } + public static class Builder { private String portfolioId; private String orderId; @@ -213,6 +246,8 @@ public static class Builder { private String displayQuoteSize; private String displayBaseSize; private String stopPrice; + private String offset; + private String wigLevel; public Builder() {} @@ -276,6 +311,16 @@ public Builder stopPrice(String stopPrice) { return this; } + public Builder offset(String offset) { + this.offset = offset; + return this; + } + + public Builder wigLevel(String wigLevel) { + this.wigLevel = wigLevel; + return this; + } + public EditOrderRequest build() throws CoinbaseClientException { validate(); return new EditOrderRequest(this); diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdRequest.java b/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdRequest.java index f00b947e..b4b0af4d 100644 --- a/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdRequest.java +++ b/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdRequest.java @@ -16,73 +16,42 @@ package com.coinbase.prime.orders; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Order by Order ID */ -public class GetOrderByOrderIdRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty(required = true, value = "order_id") - @JsonIgnore - private String orderId; +/** + * Get Order by Order ID + * + * @deprecated Use getOrder instead. + */ +@Deprecated +public class GetOrderByOrderIdRequest extends GetOrderRequest { public GetOrderByOrderIdRequest() {} - public GetOrderByOrderIdRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.orderId = builder.orderId; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; + public GetOrderByOrderIdRequest(GetOrderRequest.Builder builder) { + super(builder); } - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } - - public static class Builder { - private String portfolioId; - private String orderId; - - public Builder() {} - + /** + * @deprecated Use getOrder instead. + */ + @Deprecated + public static class Builder extends GetOrderRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder orderId(String orderId) { - this.orderId = orderId; + super.orderId(orderId); return this; } + @Override public GetOrderByOrderIdRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetOrderByOrderIdRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - if (isNullOrEmpty(this.orderId)) { - throw new CoinbaseClientException("OrderId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdResponse.java b/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdResponse.java index 160b3bb7..512bb0d3 100644 --- a/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdResponse.java +++ b/src/main/java/com/coinbase/prime/orders/GetOrderByOrderIdResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.orders; -import com.coinbase.prime.model.Order; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Order by Order ID */ -public class GetOrderByOrderIdResponse { - @JsonProperty("order") - private Order order; - +/** + * Get Order by Order ID + * + * @deprecated Use getOrder instead. + */ +@Deprecated +public class GetOrderByOrderIdResponse extends GetOrderResponse { public GetOrderByOrderIdResponse() {} - - public Order getOrder() { - return order; - } - - public void setOrder(Order order) { - this.order = order; - } } diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryRequest.java b/src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryRequest.java new file mode 100644 index 00000000..8546444d --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryRequest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Order Edit History */ +public class GetOrderEditHistoryRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "order_id") + @JsonIgnore + private String orderId; + + public GetOrderEditHistoryRequest() {} + + public GetOrderEditHistoryRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.orderId = builder.orderId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public static class Builder { + private String portfolioId; + private String orderId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder orderId(String orderId) { + this.orderId = orderId; + return this; + } + + public GetOrderEditHistoryRequest build() throws CoinbaseClientException { + validate(); + return new GetOrderEditHistoryRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.orderId)) { + throw new CoinbaseClientException("OrderId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryResponse.java b/src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryResponse.java new file mode 100644 index 00000000..16eda44b --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/GetOrderEditHistoryResponse.java @@ -0,0 +1,59 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import com.coinbase.prime.model.LimitOrderEdit; +import com.coinbase.prime.model.OrderEdit; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Order Edit History */ +public class GetOrderEditHistoryResponse { + @JsonProperty("order_id") + private String orderId; + + @JsonProperty("order_edit_history") + private LimitOrderEdit[] orderEditHistory; + + @JsonProperty("edit_history") + private OrderEdit[] editHistory; + + public GetOrderEditHistoryResponse() {} + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public LimitOrderEdit[] getOrderEditHistory() { + return orderEditHistory; + } + + public void setOrderEditHistory(LimitOrderEdit[] orderEditHistory) { + this.orderEditHistory = orderEditHistory; + } + + public OrderEdit[] getEditHistory() { + return editHistory; + } + + public void setEditHistory(OrderEdit[] editHistory) { + this.editHistory = editHistory; + } +} diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderPreviewRequest.java b/src/main/java/com/coinbase/prime/orders/GetOrderPreviewRequest.java index d2397609..dd89e968 100644 --- a/src/main/java/com/coinbase/prime/orders/GetOrderPreviewRequest.java +++ b/src/main/java/com/coinbase/prime/orders/GetOrderPreviewRequest.java @@ -16,416 +16,174 @@ package com.coinbase.prime.orders; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.SpreadConfig; +import com.coinbase.prime.model.enums.LimitPriceType; import com.coinbase.prime.model.enums.OrderSide; import com.coinbase.prime.model.enums.OrderType; import com.coinbase.prime.model.enums.PegOffsetType; import com.coinbase.prime.model.enums.TimeInForceType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Order Preview */ -public class GetOrderPreviewRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty("product_id") - private String productId; - - @JsonProperty("side") - private OrderSide side; - - @JsonProperty("type") - private OrderType type; - - @JsonProperty("base_quantity") - private String baseQuantity; - - @JsonProperty("quote_value") - private String quoteValue; - - @JsonProperty("limit_price") - private String limitPrice; - - @JsonProperty("start_time") - private String startTime; - - @JsonProperty("expiry_time") - private String expiryTime; - - @JsonProperty("time_in_force") - private TimeInForceType timeInForce; - - @JsonProperty("is_raise_exact") - private Boolean isRaiseExact; - - /** Buy Exact order flag */ - @JsonProperty("is_buy_exact") - private Boolean isBuyExact; - - @JsonProperty("historical_pov") - private String historicalPov; - - @JsonProperty("stop_price") - private String stopPrice; - - @JsonProperty("settl_currency") - private String settlCurrency; - - @JsonProperty("postOnly") - private Boolean postOnly; - - @JsonProperty("display_quote_size") - private String displayQuoteSize; - - @JsonProperty("display_base_size") - private String displayBaseSize; - - @JsonProperty("peg_offset_type") - private PegOffsetType pegOffsetType; - - @JsonProperty("offset") - private String offset; - - @JsonProperty("wig_level") - private String wigLevel; +/** + * Get Order Preview + * + * @deprecated Use createOrderPreview instead. + */ +@Deprecated +public class GetOrderPreviewRequest extends CreateOrderPreviewRequest { public GetOrderPreviewRequest() {} - public GetOrderPreviewRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.productId = builder.productId; - this.side = builder.side; - this.type = builder.type; - this.baseQuantity = builder.baseQuantity; - this.quoteValue = builder.quoteValue; - this.limitPrice = builder.limitPrice; - this.startTime = builder.startTime; - this.expiryTime = builder.expiryTime; - this.timeInForce = builder.timeInForce; - this.isRaiseExact = builder.isRaiseExact; - this.isBuyExact = builder.isBuyExact; - this.historicalPov = builder.historicalPov; - this.stopPrice = builder.stopPrice; - this.settlCurrency = builder.settlCurrency; - this.postOnly = builder.postOnly; - this.displayQuoteSize = builder.displayQuoteSize; - this.displayBaseSize = builder.displayBaseSize; - this.pegOffsetType = builder.pegOffsetType; - this.offset = builder.offset; - this.wigLevel = builder.wigLevel; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; - } - - public OrderSide getSide() { - return side; - } - - public void setSide(OrderSide side) { - this.side = side; - } - - public OrderType getType() { - return type; - } - - public void setType(OrderType type) { - this.type = type; - } - - public String getBaseQuantity() { - return baseQuantity; - } - - public void setBaseQuantity(String baseQuantity) { - this.baseQuantity = baseQuantity; - } - - public String getQuoteValue() { - return quoteValue; - } - - public void setQuoteValue(String quoteValue) { - this.quoteValue = quoteValue; - } - - public String getLimitPrice() { - return limitPrice; - } - - public void setLimitPrice(String limitPrice) { - this.limitPrice = limitPrice; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getExpiryTime() { - return expiryTime; - } - - public void setExpiryTime(String expiryTime) { - this.expiryTime = expiryTime; - } - - public TimeInForceType getTimeInForce() { - return timeInForce; - } - - public void setTimeInForce(TimeInForceType timeInForce) { - this.timeInForce = timeInForce; - } - - public Boolean getIsRaiseExact() { - return isRaiseExact; - } - - public void setIsRaiseExact(Boolean isRaiseExact) { - this.isRaiseExact = isRaiseExact; - } - - public Boolean getIsBuyExact() { - return isBuyExact; - } - - public void setIsBuyExact(Boolean isBuyExact) { - this.isBuyExact = isBuyExact; - } - - public String getHistoricalPov() { - return historicalPov; + public GetOrderPreviewRequest(CreateOrderPreviewRequest.Builder builder) { + super(builder); } - public void setHistoricalPov(String historicalPov) { - this.historicalPov = historicalPov; - } - - public String getStopPrice() { - return stopPrice; - } - - public void setStopPrice(String stopPrice) { - this.stopPrice = stopPrice; - } - - public String getSettlCurrency() { - return settlCurrency; - } - - public void setSettlCurrency(String settlCurrency) { - this.settlCurrency = settlCurrency; - } - - public Boolean getPostOnly() { - return postOnly; - } - - public void setPostOnly(Boolean postOnly) { - this.postOnly = postOnly; - } - - public String getDisplayQuoteSize() { - return displayQuoteSize; - } - - public void setDisplayQuoteSize(String displayQuoteSize) { - this.displayQuoteSize = displayQuoteSize; - } - - public String getDisplayBaseSize() { - return displayBaseSize; - } - - public void setDisplayBaseSize(String displayBaseSize) { - this.displayBaseSize = displayBaseSize; - } - - public PegOffsetType getPegOffsetType() { - return pegOffsetType; - } - - public void setPegOffsetType(PegOffsetType pegOffsetType) { - this.pegOffsetType = pegOffsetType; - } - - public String getOffset() { - return offset; - } - - public void setOffset(String offset) { - this.offset = offset; - } - - public String getWigLevel() { - return wigLevel; - } - - public void setWigLevel(String wigLevel) { - this.wigLevel = wigLevel; - } - - public static class Builder { - private String portfolioId; - private String productId; - private OrderSide side; - private OrderType type; - private String baseQuantity; - private String quoteValue; - private String limitPrice; - private String startTime; - private String expiryTime; - private TimeInForceType timeInForce; - private Boolean isRaiseExact; - private Boolean isBuyExact; - private String historicalPov; - private String stopPrice; - private String settlCurrency; - private Boolean postOnly; - private String displayQuoteSize; - private String displayBaseSize; - private PegOffsetType pegOffsetType; - private String offset; - private String wigLevel; - - public Builder() {} - + /** + * @deprecated Use createOrderPreview instead. + */ + @Deprecated + public static class Builder extends CreateOrderPreviewRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder productId(String productId) { - this.productId = productId; + super.productId(productId); return this; } + @Override public Builder side(OrderSide side) { - this.side = side; + super.side(side); return this; } + @Override public Builder type(OrderType type) { - this.type = type; + super.type(type); return this; } + @Override public Builder baseQuantity(String baseQuantity) { - this.baseQuantity = baseQuantity; + super.baseQuantity(baseQuantity); return this; } + @Override public Builder quoteValue(String quoteValue) { - this.quoteValue = quoteValue; + super.quoteValue(quoteValue); return this; } + @Override public Builder limitPrice(String limitPrice) { - this.limitPrice = limitPrice; + super.limitPrice(limitPrice); return this; } + @Override public Builder startTime(String startTime) { - this.startTime = startTime; + super.startTime(startTime); return this; } + @Override public Builder expiryTime(String expiryTime) { - this.expiryTime = expiryTime; + super.expiryTime(expiryTime); return this; } + @Override public Builder timeInForce(TimeInForceType timeInForce) { - this.timeInForce = timeInForce; + super.timeInForce(timeInForce); return this; } + @Override public Builder isRaiseExact(Boolean isRaiseExact) { - this.isRaiseExact = isRaiseExact; + super.isRaiseExact(isRaiseExact); return this; } + @Override public Builder isBuyExact(Boolean isBuyExact) { - this.isBuyExact = isBuyExact; + super.isBuyExact(isBuyExact); return this; } + @Override public Builder historicalPov(String historicalPov) { - this.historicalPov = historicalPov; + super.historicalPov(historicalPov); return this; } + @Override public Builder stopPrice(String stopPrice) { - this.stopPrice = stopPrice; + super.stopPrice(stopPrice); return this; } + @Override public Builder settlCurrency(String settlCurrency) { - this.settlCurrency = settlCurrency; + super.settlCurrency(settlCurrency); return this; } + @Override public Builder postOnly(Boolean postOnly) { - this.postOnly = postOnly; + super.postOnly(postOnly); return this; } + @Override public Builder displayQuoteSize(String displayQuoteSize) { - this.displayQuoteSize = displayQuoteSize; + super.displayQuoteSize(displayQuoteSize); return this; } + @Override public Builder displayBaseSize(String displayBaseSize) { - this.displayBaseSize = displayBaseSize; + super.displayBaseSize(displayBaseSize); return this; } + @Override public Builder pegOffsetType(PegOffsetType pegOffsetType) { - this.pegOffsetType = pegOffsetType; + super.pegOffsetType(pegOffsetType); return this; } + @Override public Builder offset(String offset) { - this.offset = offset; + super.offset(offset); return this; } + @Override public Builder wigLevel(String wigLevel) { - this.wigLevel = wigLevel; + super.wigLevel(wigLevel); return this; } - public GetOrderPreviewRequest build() throws CoinbaseClientException { - validate(); - return new GetOrderPreviewRequest(this); + @Override + public Builder limitPriceType(LimitPriceType limitPriceType) { + super.limitPriceType(limitPriceType); + return this; } - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } + @Override + public Builder spreadConfig(SpreadConfig spreadConfig) { + super.spreadConfig(spreadConfig); + return this; + } + + @Override + public GetOrderPreviewRequest build() throws CoinbaseClientException { + super.validate(); + return new GetOrderPreviewRequest(this); } } } diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderPreviewResponse.java b/src/main/java/com/coinbase/prime/orders/GetOrderPreviewResponse.java index d84ef210..013cc6ee 100644 --- a/src/main/java/com/coinbase/prime/orders/GetOrderPreviewResponse.java +++ b/src/main/java/com/coinbase/prime/orders/GetOrderPreviewResponse.java @@ -16,266 +16,12 @@ package com.coinbase.prime.orders; -import com.coinbase.prime.model.enums.OrderSide; -import com.coinbase.prime.model.enums.OrderType; -import com.coinbase.prime.model.enums.TimeInForceType; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Order Preview */ -public class GetOrderPreviewResponse { - @JsonProperty("portfolio_id") - private String portfolioId; - - @JsonProperty("product_id") - private String productId; - - @JsonProperty("side") - private OrderSide side; - - @JsonProperty("type") - private OrderType type; - - @JsonProperty("base_quantity") - private String baseQuantity; - - @JsonProperty("quote_value") - private String quoteValue; - - @JsonProperty("limit_price") - private String limitPrice; - - @JsonProperty("start_time") - private String startTime; - - @JsonProperty("expiry_time") - private String expiryTime; - - @JsonProperty("time_in_force") - private TimeInForceType timeInForce; - - @JsonProperty("commission") - private String commission; - - @JsonProperty("slippage") - private String slippage; - - @JsonProperty("best_bid") - private String bestBid; - - @JsonProperty("best_ask") - private String bestAsk; - - @JsonProperty("average_filled_price") - private String averageFilledPrice; - - @JsonProperty("order_total") - private String orderTotal; - - @JsonProperty("historical_pov") - private String historicalPov; - - @JsonProperty("is_raise_exact") - private Boolean isRaiseExact; - - /** Buy Exact order flag */ - @JsonProperty("is_buy_exact") - private Boolean isBuyExact; - - @JsonProperty("stop_price") - private String stopPrice; - - @JsonProperty("display_size") - private String displaySize; - - @JsonProperty("display_quote_size") - private String displayQuoteSize; - - @JsonProperty("display_base_size") - private String displayBaseSize; - +/** + * Get Order Preview + * + * @deprecated Use createOrderPreview instead. + */ +@Deprecated +public class GetOrderPreviewResponse extends CreateOrderPreviewResponse { public GetOrderPreviewResponse() {} - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; - } - - public OrderSide getSide() { - return side; - } - - public void setSide(OrderSide side) { - this.side = side; - } - - public OrderType getType() { - return type; - } - - public void setType(OrderType type) { - this.type = type; - } - - public String getBaseQuantity() { - return baseQuantity; - } - - public void setBaseQuantity(String baseQuantity) { - this.baseQuantity = baseQuantity; - } - - public String getQuoteValue() { - return quoteValue; - } - - public void setQuoteValue(String quoteValue) { - this.quoteValue = quoteValue; - } - - public String getLimitPrice() { - return limitPrice; - } - - public void setLimitPrice(String limitPrice) { - this.limitPrice = limitPrice; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getExpiryTime() { - return expiryTime; - } - - public void setExpiryTime(String expiryTime) { - this.expiryTime = expiryTime; - } - - public TimeInForceType getTimeInForce() { - return timeInForce; - } - - public void setTimeInForce(TimeInForceType timeInForce) { - this.timeInForce = timeInForce; - } - - public String getCommission() { - return commission; - } - - public void setCommission(String commission) { - this.commission = commission; - } - - public String getSlippage() { - return slippage; - } - - public void setSlippage(String slippage) { - this.slippage = slippage; - } - - public String getBestBid() { - return bestBid; - } - - public void setBestBid(String bestBid) { - this.bestBid = bestBid; - } - - public String getBestAsk() { - return bestAsk; - } - - public void setBestAsk(String bestAsk) { - this.bestAsk = bestAsk; - } - - public String getAverageFilledPrice() { - return averageFilledPrice; - } - - public void setAverageFilledPrice(String averageFilledPrice) { - this.averageFilledPrice = averageFilledPrice; - } - - public String getOrderTotal() { - return orderTotal; - } - - public void setOrderTotal(String orderTotal) { - this.orderTotal = orderTotal; - } - - public String getHistoricalPov() { - return historicalPov; - } - - public void setHistoricalPov(String historicalPov) { - this.historicalPov = historicalPov; - } - - public Boolean getIsRaiseExact() { - return isRaiseExact; - } - - public void setIsRaiseExact(Boolean isRaiseExact) { - this.isRaiseExact = isRaiseExact; - } - - public Boolean getIsBuyExact() { - return isBuyExact; - } - - public void setIsBuyExact(Boolean isBuyExact) { - this.isBuyExact = isBuyExact; - } - - public String getStopPrice() { - return stopPrice; - } - - public void setStopPrice(String stopPrice) { - this.stopPrice = stopPrice; - } - - public String getDisplaySize() { - return displaySize; - } - - public void setDisplaySize(String displaySize) { - this.displaySize = displaySize; - } - - public String getDisplayQuoteSize() { - return displayQuoteSize; - } - - public void setDisplayQuoteSize(String displayQuoteSize) { - this.displayQuoteSize = displayQuoteSize; - } - - public String getDisplayBaseSize() { - return displayBaseSize; - } - - public void setDisplayBaseSize(String displayBaseSize) { - this.displayBaseSize = displayBaseSize; - } } diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderRequest.java b/src/main/java/com/coinbase/prime/orders/GetOrderRequest.java new file mode 100644 index 00000000..fdefaa17 --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/GetOrderRequest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Order by Order ID */ +public class GetOrderRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "order_id") + @JsonIgnore + private String orderId; + + public GetOrderRequest() {} + + public GetOrderRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.orderId = builder.orderId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId; + } + + public static class Builder { + private String portfolioId; + private String orderId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder orderId(String orderId) { + this.orderId = orderId; + return this; + } + + public GetOrderRequest build() throws CoinbaseClientException { + validate(); + return new GetOrderRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.orderId)) { + throw new CoinbaseClientException("OrderId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/orders/GetOrderResponse.java b/src/main/java/com/coinbase/prime/orders/GetOrderResponse.java new file mode 100644 index 00000000..ea547961 --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/GetOrderResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import com.coinbase.prime.model.Order; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Order by Order ID */ +public class GetOrderResponse { + @JsonProperty("order") + private Order order; + + public GetOrderResponse() {} + + public Order getOrder() { + return order; + } + + public void setOrder(Order order) { + this.order = order; + } +} diff --git a/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryRequest.java b/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryRequest.java index 954d37e3..9af63257 100644 --- a/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryRequest.java +++ b/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryRequest.java @@ -16,73 +16,42 @@ package com.coinbase.prime.orders; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Order Edit History */ -public class ListOrderEditHistoryRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty(required = true, value = "order_id") - @JsonIgnore - private String orderId; +/** + * List Order Edit History + * + * @deprecated Use getOrderEditHistory instead. + */ +@Deprecated +public class ListOrderEditHistoryRequest extends GetOrderEditHistoryRequest { public ListOrderEditHistoryRequest() {} - public ListOrderEditHistoryRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.orderId = builder.orderId; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; + public ListOrderEditHistoryRequest(GetOrderEditHistoryRequest.Builder builder) { + super(builder); } - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } - - public static class Builder { - private String portfolioId; - private String orderId; - - public Builder() {} - + /** + * @deprecated Use getOrderEditHistory instead. + */ + @Deprecated + public static class Builder extends GetOrderEditHistoryRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder orderId(String orderId) { - this.orderId = orderId; + super.orderId(orderId); return this; } + @Override public ListOrderEditHistoryRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListOrderEditHistoryRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - if (isNullOrEmpty(this.orderId)) { - throw new CoinbaseClientException("OrderId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryResponse.java b/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryResponse.java index 6f630a9f..31f41e0b 100644 --- a/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryResponse.java +++ b/src/main/java/com/coinbase/prime/orders/ListOrderEditHistoryResponse.java @@ -16,44 +16,12 @@ package com.coinbase.prime.orders; -import com.coinbase.prime.model.LimitOrderEdit; -import com.coinbase.prime.model.OrderEdit; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Order Edit History */ -public class ListOrderEditHistoryResponse { - @JsonProperty("order_id") - private String orderId; - - @JsonProperty("order_edit_history") - private LimitOrderEdit[] orderEditHistory; - - @JsonProperty("edit_history") - private OrderEdit[] editHistory; - +/** + * List Order Edit History + * + * @deprecated Use getOrderEditHistory instead. + */ +@Deprecated +public class ListOrderEditHistoryResponse extends GetOrderEditHistoryResponse { public ListOrderEditHistoryResponse() {} - - public String getOrderId() { - return orderId; - } - - public void setOrderId(String orderId) { - this.orderId = orderId; - } - - public LimitOrderEdit[] getOrderEditHistory() { - return orderEditHistory; - } - - public void setOrderEditHistory(LimitOrderEdit[] orderEditHistory) { - this.orderEditHistory = orderEditHistory; - } - - public OrderEdit[] getEditHistory() { - return editHistory; - } - - public void setEditHistory(OrderEdit[] editHistory) { - this.editHistory = editHistory; - } } diff --git a/src/main/java/com/coinbase/prime/orders/ListOrdersRequest.java b/src/main/java/com/coinbase/prime/orders/ListOrdersRequest.java new file mode 100644 index 00000000..c5558516 --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/ListOrdersRequest.java @@ -0,0 +1,195 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.common.PrimeListRequest; +import com.coinbase.prime.model.enums.OrderSide; +import com.coinbase.prime.model.enums.OrderStatus; +import com.coinbase.prime.model.enums.OrderType; +import com.coinbase.prime.model.enums.SortDirection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Portfolio Orders */ +public class ListOrdersRequest extends PrimeListRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("order_statuses") + private OrderStatus[] orderStatuses; + + @JsonProperty("product_ids") + private String[] productIds; + + @JsonProperty("order_type") + private OrderType orderType; + + @JsonProperty("order_side") + private OrderSide orderSide; + + @JsonProperty("start_date") + private String startDate; + + @JsonProperty("end_date") + private String endDate; + + public ListOrdersRequest() {} + + public ListOrdersRequest(Builder builder) { + super(builder.cursor, builder.sortDirection, builder.limit); + this.portfolioId = builder.portfolioId; + this.orderStatuses = builder.orderStatuses; + this.productIds = builder.productIds; + this.orderType = builder.orderType; + this.orderSide = builder.orderSide; + this.startDate = builder.startDate; + this.endDate = builder.endDate; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public OrderStatus[] getOrderStatuses() { + return orderStatuses; + } + + public void setOrderStatuses(OrderStatus[] orderStatuses) { + this.orderStatuses = orderStatuses; + } + + public String[] getProductIds() { + return productIds; + } + + public void setProductIds(String[] productIds) { + this.productIds = productIds; + } + + public OrderType getOrderType() { + return orderType; + } + + public void setOrderType(OrderType orderType) { + this.orderType = orderType; + } + + public OrderSide getOrderSide() { + return orderSide; + } + + public void setOrderSide(OrderSide orderSide) { + this.orderSide = orderSide; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public static class Builder { + private String portfolioId; + private OrderStatus[] orderStatuses; + private String[] productIds; + private OrderType orderType; + private OrderSide orderSide; + private String startDate; + private String endDate; + private String cursor; + private SortDirection sortDirection; + private Integer limit; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder orderStatuses(OrderStatus[] orderStatuses) { + this.orderStatuses = orderStatuses; + return this; + } + + public Builder productIds(String[] productIds) { + this.productIds = productIds; + return this; + } + + public Builder orderType(OrderType orderType) { + this.orderType = orderType; + return this; + } + + public Builder orderSide(OrderSide orderSide) { + this.orderSide = orderSide; + return this; + } + + public Builder startDate(String startDate) { + this.startDate = startDate; + return this; + } + + public Builder endDate(String endDate) { + this.endDate = endDate; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder pagination(Pagination pagination) { + this.cursor = pagination.getNextCursor(); + this.sortDirection = pagination.getSortDirection(); + return this; + } + + public ListOrdersRequest build() throws CoinbaseClientException { + validate(); + return new ListOrdersRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/orders/ListOrdersResponse.java b/src/main/java/com/coinbase/prime/orders/ListOrdersResponse.java new file mode 100644 index 00000000..557afea4 --- /dev/null +++ b/src/main/java/com/coinbase/prime/orders/ListOrdersResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.orders; + +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.model.Order; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Portfolio Orders */ +public class ListOrdersResponse { + @JsonProperty("orders") + private Order[] orders; + + @JsonProperty("pagination") + private Pagination pagination; + + public ListOrdersResponse() {} + + public Order[] getOrders() { + return orders; + } + + public void setOrders(Order[] orders) { + this.orders = orders; + } + + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } +} diff --git a/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersRequest.java b/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersRequest.java index f44d8d68..0999fef9 100644 --- a/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersRequest.java +++ b/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersRequest.java @@ -16,180 +16,88 @@ package com.coinbase.prime.orders; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.common.PrimeListRequest; import com.coinbase.prime.model.enums.OrderSide; import com.coinbase.prime.model.enums.OrderStatus; import com.coinbase.prime.model.enums.OrderType; -import com.coinbase.prime.model.enums.SortDirection; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Portfolio Orders */ -public class ListPortfolioOrdersRequest extends PrimeListRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty("order_statuses") - private OrderStatus[] orderStatuses; - - @JsonProperty("product_ids") - private String[] productIds; - - @JsonProperty("order_type") - private OrderType orderType; - - @JsonProperty("order_side") - private OrderSide orderSide; - - @JsonProperty("start_date") - private String startDate; - - @JsonProperty("end_date") - private String endDate; +/** + * List Portfolio Orders + * + * @deprecated Use listOrders instead. + */ +@Deprecated +public class ListPortfolioOrdersRequest extends ListOrdersRequest { public ListPortfolioOrdersRequest() {} - public ListPortfolioOrdersRequest(Builder builder) { - super(builder.cursor, builder.sortDirection, builder.limit); - this.portfolioId = builder.portfolioId; - this.orderStatuses = builder.orderStatuses; - this.productIds = builder.productIds; - this.orderType = builder.orderType; - this.orderSide = builder.orderSide; - this.startDate = builder.startDate; - this.endDate = builder.endDate; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public OrderStatus[] getOrderStatuses() { - return orderStatuses; - } - - public void setOrderStatuses(OrderStatus[] orderStatuses) { - this.orderStatuses = orderStatuses; - } - - public String[] getProductIds() { - return productIds; - } - - public void setProductIds(String[] productIds) { - this.productIds = productIds; - } - - public OrderType getOrderType() { - return orderType; - } - - public void setOrderType(OrderType orderType) { - this.orderType = orderType; - } - - public OrderSide getOrderSide() { - return orderSide; - } - - public void setOrderSide(OrderSide orderSide) { - this.orderSide = orderSide; - } - - public String getStartDate() { - return startDate; + public ListPortfolioOrdersRequest(ListOrdersRequest.Builder builder) { + super(builder); } - public void setStartDate(String startDate) { - this.startDate = startDate; - } - - public String getEndDate() { - return endDate; - } - - public void setEndDate(String endDate) { - this.endDate = endDate; - } - - public static class Builder { - private String portfolioId; - private OrderStatus[] orderStatuses; - private String[] productIds; - private OrderType orderType; - private OrderSide orderSide; - private String startDate; - private String endDate; - private String cursor; - private SortDirection sortDirection; - private Integer limit; - - public Builder() {} - + /** + * @deprecated Use listOrders instead. + */ + @Deprecated + public static class Builder extends ListOrdersRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder orderStatuses(OrderStatus[] orderStatuses) { - this.orderStatuses = orderStatuses; + super.orderStatuses(orderStatuses); return this; } + @Override public Builder productIds(String[] productIds) { - this.productIds = productIds; + super.productIds(productIds); return this; } + @Override public Builder orderType(OrderType orderType) { - this.orderType = orderType; + super.orderType(orderType); return this; } + @Override public Builder orderSide(OrderSide orderSide) { - this.orderSide = orderSide; + super.orderSide(orderSide); return this; } + @Override public Builder startDate(String startDate) { - this.startDate = startDate; + super.startDate(startDate); return this; } + @Override public Builder endDate(String endDate) { - this.endDate = endDate; + super.endDate(endDate); return this; } + @Override public Builder limit(Integer limit) { - this.limit = limit; + super.limit(limit); return this; } + @Override public Builder pagination(Pagination pagination) { - this.cursor = pagination.getNextCursor(); - this.sortDirection = pagination.getSortDirection(); + super.pagination(pagination); return this; } + @Override public ListPortfolioOrdersRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListPortfolioOrdersRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersResponse.java b/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersResponse.java index 17a54019..349db345 100644 --- a/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersResponse.java +++ b/src/main/java/com/coinbase/prime/orders/ListPortfolioOrdersResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.orders; -import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.model.Order; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Portfolio Orders */ -public class ListPortfolioOrdersResponse { - @JsonProperty("orders") - private Order[] orders; - - @JsonProperty("pagination") - private Pagination pagination; - +/** + * List Portfolio Orders + * + * @deprecated Use listOrders instead. + */ +@Deprecated +public class ListPortfolioOrdersResponse extends ListOrdersResponse { public ListPortfolioOrdersResponse() {} - - public Order[] getOrders() { - return orders; - } - - public void setOrders(Order[] orders) { - this.orders = orders; - } - - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } } diff --git a/src/main/java/com/coinbase/prime/orders/OrdersService.java b/src/main/java/com/coinbase/prime/orders/OrdersService.java index 5af30b2c..e96b75b0 100644 --- a/src/main/java/com/coinbase/prime/orders/OrdersService.java +++ b/src/main/java/com/coinbase/prime/orders/OrdersService.java @@ -90,6 +90,21 @@ CreateOrderResponse createOrder(CreateOrderRequest request) * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreateOrderPreviewResponse createOrderPreview(CreateOrderPreviewRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Order Preview. + * + *

Retrieve an order preview + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createOrderPreview instead. + */ + @Deprecated GetOrderPreviewResponse getOrderPreview(GetOrderPreviewRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -108,6 +123,26 @@ GetOrderPreviewResponse getOrderPreview(GetOrderPreviewRequest request) * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + ListOrdersResponse listOrders(ListOrdersRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Portfolio Orders. + * + *

List historical orders for a given portfolio. This endpoint returns a payload with a default + * limit of 100 if not specified by the user. The maximum allowed limit is 3000.
+ *
+ * **Caution:** Currently, you cannot query open orders with this endpoint: use List Open Orders + * if you have less than 1000 open orders, otherwise use Websocket API, or FIX API to stream open + * orders + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use listOrders instead. + */ + @Deprecated ListPortfolioOrdersResponse listPortfolioOrders(ListPortfolioOrdersRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -121,6 +156,21 @@ ListPortfolioOrdersResponse listPortfolioOrders(ListPortfolioOrdersRequest reque * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetOrderResponse getOrder(GetOrderRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Order by Order ID. + * + *

Retrieve an order by order ID + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getOrder instead. + */ + @Deprecated GetOrderByOrderIdResponse getOrderByOrderId(GetOrderByOrderIdRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -161,6 +211,21 @@ EditOrderResponse editOrder(EditOrderRequest request) * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetOrderEditHistoryResponse getOrderEditHistory(GetOrderEditHistoryRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Order Edit History. + * + *

List edit history for a specific order + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getOrderEditHistory instead. + */ + @Deprecated ListOrderEditHistoryResponse listOrderEditHistory(ListOrderEditHistoryRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/orders/OrdersServiceImpl.java b/src/main/java/com/coinbase/prime/orders/OrdersServiceImpl.java index 1f0775c8..ab9c05e6 100644 --- a/src/main/java/com/coinbase/prime/orders/OrdersServiceImpl.java +++ b/src/main/java/com/coinbase/prime/orders/OrdersServiceImpl.java @@ -28,6 +28,27 @@ public OrdersServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public AcceptQuoteResponse acceptQuote(AcceptQuoteRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format("/portfolios/%s/accept_quote", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public ListPortfolioFillsResponse listPortfolioFills(ListPortfolioFillsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/fills", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + @Override public ListOpenOrdersResponse listOpenOrders(ListOpenOrdersRequest request) throws CoinbasePrimeException { @@ -45,10 +66,22 @@ public CreateOrderResponse createOrder(CreateOrderRequest request) throws Coinba HttpMethod.POST, String.format("/portfolios/%s/order", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } + @Override + public CreateOrderPreviewResponse createOrderPreview(CreateOrderPreviewRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format("/portfolios/%s/order_preview", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetOrderPreviewResponse getOrderPreview(GetOrderPreviewRequest request) throws CoinbasePrimeException { @@ -60,6 +93,17 @@ public GetOrderPreviewResponse getOrderPreview(GetOrderPreviewRequest request) new TypeReference() {}); } + @Override + public ListOrdersResponse listOrders(ListOrdersRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/orders", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListPortfolioOrdersResponse listPortfolioOrders(ListPortfolioOrdersRequest request) throws CoinbasePrimeException { @@ -71,6 +115,17 @@ public ListPortfolioOrdersResponse listPortfolioOrders(ListPortfolioOrdersReques new TypeReference() {}); } + @Override + public GetOrderResponse getOrder(GetOrderRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/orders/%s", request.getPortfolioId(), request.getOrderId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetOrderByOrderIdResponse getOrderByOrderId(GetOrderByOrderIdRequest request) throws CoinbasePrimeException { @@ -94,69 +149,62 @@ public CancelOrderResponse cancelOrder(CancelOrderRequest request) throws Coinba } @Override - public ListOrderFillsResponse listOrderFills(ListOrderFillsRequest request) - throws CoinbasePrimeException { + public EditOrderResponse editOrder(EditOrderRequest request) throws CoinbasePrimeException { return this.request( - HttpMethod.GET, + HttpMethod.PUT, String.format( - "/portfolios/%s/orders/%s/fills", request.getPortfolioId(), request.getOrderId()), + "/portfolios/%s/orders/%s/edit", request.getPortfolioId(), request.getOrderId()), request, List.of(200), - new TypeReference() {}); + new TypeReference() {}); } @Override - public ListPortfolioFillsResponse listPortfolioFills(ListPortfolioFillsRequest request) + public GetOrderEditHistoryResponse getOrderEditHistory(GetOrderEditHistoryRequest request) throws CoinbasePrimeException { return this.request( HttpMethod.GET, - String.format("/portfolios/%s/fills", request.getPortfolioId()), + String.format( + "/portfolios/%s/orders/%s/edit_history", + request.getPortfolioId(), request.getOrderId()), request, List.of(200), - new TypeReference() {}); + new TypeReference() {}); } + @Deprecated @Override - public CreateQuoteResponse createQuote(CreateQuoteRequest request) throws CoinbasePrimeException { - return this.request( - HttpMethod.POST, - String.format("/portfolios/%s/rfq", request.getPortfolioId()), - request, - List.of(201, 200), - new TypeReference() {}); - } - - @Override - public AcceptQuoteResponse acceptQuote(AcceptQuoteRequest request) throws CoinbasePrimeException { + public ListOrderEditHistoryResponse listOrderEditHistory(ListOrderEditHistoryRequest request) + throws CoinbasePrimeException { return this.request( - HttpMethod.POST, - String.format("/portfolios/%s/accept_quote", request.getPortfolioId()), + HttpMethod.GET, + String.format( + "/portfolios/%s/orders/%s/edit_history", + request.getPortfolioId(), request.getOrderId()), request, List.of(200), - new TypeReference() {}); + new TypeReference() {}); } @Override - public ListOrderEditHistoryResponse listOrderEditHistory(ListOrderEditHistoryRequest request) + public ListOrderFillsResponse listOrderFills(ListOrderFillsRequest request) throws CoinbasePrimeException { return this.request( HttpMethod.GET, String.format( - "/portfolios/%s/orders/%s/edit_history", - request.getPortfolioId(), request.getOrderId()), + "/portfolios/%s/orders/%s/fills", request.getPortfolioId(), request.getOrderId()), request, List.of(200), - new TypeReference() {}); + new TypeReference() {}); } @Override - public EditOrderResponse editOrder(EditOrderRequest request) throws CoinbasePrimeException { + public CreateQuoteResponse createQuote(CreateQuoteRequest request) throws CoinbasePrimeException { return this.request( - HttpMethod.PUT, - String.format( - "/portfolios/%s/orders/%s/edit", request.getPortfolioId(), request.getOrderId()), + HttpMethod.POST, + String.format("/portfolios/%s/rfq", request.getPortfolioId()), request, List.of(200), - new TypeReference() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodRequest.java b/src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodRequest.java new file mode 100644 index 00000000..6694c358 --- /dev/null +++ b/src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodRequest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.paymentmethods; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Entity Payment Method */ +public class GetEntityPaymentMethodRequest { + @JsonProperty(required = true, value = "entity_id") + @JsonIgnore + private String entityId; + + @JsonProperty(required = true, value = "payment_method_id") + @JsonIgnore + private String paymentMethodId; + + public GetEntityPaymentMethodRequest() {} + + public GetEntityPaymentMethodRequest(Builder builder) { + this.entityId = builder.entityId; + this.paymentMethodId = builder.paymentMethodId; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public String getPaymentMethodId() { + return paymentMethodId; + } + + public void setPaymentMethodId(String paymentMethodId) { + this.paymentMethodId = paymentMethodId; + } + + public static class Builder { + private String entityId; + private String paymentMethodId; + + public Builder() {} + + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + public Builder paymentMethodId(String paymentMethodId) { + this.paymentMethodId = paymentMethodId; + return this; + } + + public GetEntityPaymentMethodRequest build() throws CoinbaseClientException { + validate(); + return new GetEntityPaymentMethodRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.entityId)) { + throw new CoinbaseClientException("EntityId is required"); + } + if (isNullOrEmpty(this.paymentMethodId)) { + throw new CoinbaseClientException("PaymentMethodId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodResponse.java b/src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodResponse.java new file mode 100644 index 00000000..755d2957 --- /dev/null +++ b/src/main/java/com/coinbase/prime/paymentmethods/GetEntityPaymentMethodResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.paymentmethods; + +import com.coinbase.prime.model.PaymentMethodDetails; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Entity Payment Method */ +public class GetEntityPaymentMethodResponse { + @JsonProperty("details") + private PaymentMethodDetails details; + + public GetEntityPaymentMethodResponse() {} + + public PaymentMethodDetails getDetails() { + return details; + } + + public void setDetails(PaymentMethodDetails details) { + this.details = details; + } +} diff --git a/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsRequest.java b/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsRequest.java index e3276b42..0794b011 100644 --- a/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsRequest.java +++ b/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsRequest.java @@ -16,73 +16,42 @@ package com.coinbase.prime.paymentmethods; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Entity Payment Method */ -public class GetPaymentMethodDetailsRequest { - @JsonProperty(required = true, value = "entity_id") - @JsonIgnore - private String entityId; - - @JsonProperty(required = true, value = "payment_method_id") - @JsonIgnore - private String paymentMethodId; +/** + * Get Entity Payment Method + * + * @deprecated Use getEntityPaymentMethod instead. + */ +@Deprecated +public class GetPaymentMethodDetailsRequest extends GetEntityPaymentMethodRequest { public GetPaymentMethodDetailsRequest() {} - public GetPaymentMethodDetailsRequest(Builder builder) { - this.entityId = builder.entityId; - this.paymentMethodId = builder.paymentMethodId; - } - - public String getEntityId() { - return entityId; - } - - public void setEntityId(String entityId) { - this.entityId = entityId; + public GetPaymentMethodDetailsRequest(GetEntityPaymentMethodRequest.Builder builder) { + super(builder); } - public String getPaymentMethodId() { - return paymentMethodId; - } - - public void setPaymentMethodId(String paymentMethodId) { - this.paymentMethodId = paymentMethodId; - } - - public static class Builder { - private String entityId; - private String paymentMethodId; - - public Builder() {} - + /** + * @deprecated Use getEntityPaymentMethod instead. + */ + @Deprecated + public static class Builder extends GetEntityPaymentMethodRequest.Builder { + @Override public Builder entityId(String entityId) { - this.entityId = entityId; + super.entityId(entityId); return this; } + @Override public Builder paymentMethodId(String paymentMethodId) { - this.paymentMethodId = paymentMethodId; + super.paymentMethodId(paymentMethodId); return this; } + @Override public GetPaymentMethodDetailsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetPaymentMethodDetailsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.entityId)) { - throw new CoinbaseClientException("EntityId is required"); - } - if (isNullOrEmpty(this.paymentMethodId)) { - throw new CoinbaseClientException("PaymentMethodId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsResponse.java b/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsResponse.java index 2fe3309d..61484c5d 100644 --- a/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsResponse.java +++ b/src/main/java/com/coinbase/prime/paymentmethods/GetPaymentMethodDetailsResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.paymentmethods; -import com.coinbase.prime.model.PaymentMethodDetails; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Entity Payment Method */ -public class GetPaymentMethodDetailsResponse { - @JsonProperty("details") - private PaymentMethodDetails details; - +/** + * Get Entity Payment Method + * + * @deprecated Use getEntityPaymentMethod instead. + */ +@Deprecated +public class GetPaymentMethodDetailsResponse extends GetEntityPaymentMethodResponse { public GetPaymentMethodDetailsResponse() {} - - public PaymentMethodDetails getDetails() { - return details; - } - - public void setDetails(PaymentMethodDetails details) { - this.details = details; - } } diff --git a/src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsRequest.java b/src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsRequest.java new file mode 100644 index 00000000..f5e14daa --- /dev/null +++ b/src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsRequest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.paymentmethods; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Entity Payment Methods */ +public class ListEntityPaymentMethodsRequest { + @JsonProperty(required = true, value = "entity_id") + @JsonIgnore + private String entityId; + + public ListEntityPaymentMethodsRequest() {} + + public ListEntityPaymentMethodsRequest(Builder builder) { + this.entityId = builder.entityId; + } + + public String getEntityId() { + return entityId; + } + + public void setEntityId(String entityId) { + this.entityId = entityId; + } + + public static class Builder { + private String entityId; + + public Builder() {} + + public Builder entityId(String entityId) { + this.entityId = entityId; + return this; + } + + public ListEntityPaymentMethodsRequest build() throws CoinbaseClientException { + validate(); + return new ListEntityPaymentMethodsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.entityId)) { + throw new CoinbaseClientException("EntityId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsResponse.java b/src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsResponse.java new file mode 100644 index 00000000..65328649 --- /dev/null +++ b/src/main/java/com/coinbase/prime/paymentmethods/ListEntityPaymentMethodsResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.paymentmethods; + +import com.coinbase.prime.model.PaymentMethodSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Entity Payment Methods */ +public class ListEntityPaymentMethodsResponse { + @JsonProperty("payment_methods") + private PaymentMethodSummary[] paymentMethods; + + public ListEntityPaymentMethodsResponse() {} + + public PaymentMethodSummary[] getPaymentMethods() { + return paymentMethods; + } + + public void setPaymentMethods(PaymentMethodSummary[] paymentMethods) { + this.paymentMethods = paymentMethods; + } +} diff --git a/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsRequest.java b/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsRequest.java index 198e2fca..e0f55b3c 100644 --- a/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsRequest.java +++ b/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsRequest.java @@ -16,51 +16,36 @@ package com.coinbase.prime.paymentmethods; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Entity Payment Methods */ -public class ListPaymentMethodsRequest { - @JsonProperty(required = true, value = "entity_id") - @JsonIgnore - private String entityId; +/** + * List Entity Payment Methods + * + * @deprecated Use listEntityPaymentMethods instead. + */ +@Deprecated +public class ListPaymentMethodsRequest extends ListEntityPaymentMethodsRequest { public ListPaymentMethodsRequest() {} - public ListPaymentMethodsRequest(Builder builder) { - this.entityId = builder.entityId; - } - - public String getEntityId() { - return entityId; + public ListPaymentMethodsRequest(ListEntityPaymentMethodsRequest.Builder builder) { + super(builder); } - public void setEntityId(String entityId) { - this.entityId = entityId; - } - - public static class Builder { - private String entityId; - - public Builder() {} - + /** + * @deprecated Use listEntityPaymentMethods instead. + */ + @Deprecated + public static class Builder extends ListEntityPaymentMethodsRequest.Builder { + @Override public Builder entityId(String entityId) { - this.entityId = entityId; + super.entityId(entityId); return this; } + @Override public ListPaymentMethodsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListPaymentMethodsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.entityId)) { - throw new CoinbaseClientException("EntityId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsResponse.java b/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsResponse.java index 628cd9b1..a5280c37 100644 --- a/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsResponse.java +++ b/src/main/java/com/coinbase/prime/paymentmethods/ListPaymentMethodsResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.paymentmethods; -import com.coinbase.prime.model.PaymentMethodSummary; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Entity Payment Methods */ -public class ListPaymentMethodsResponse { - @JsonProperty("payment_methods") - private PaymentMethodSummary[] paymentMethods; - +/** + * List Entity Payment Methods + * + * @deprecated Use listEntityPaymentMethods instead. + */ +@Deprecated +public class ListPaymentMethodsResponse extends ListEntityPaymentMethodsResponse { public ListPaymentMethodsResponse() {} - - public PaymentMethodSummary[] getPaymentMethods() { - return paymentMethods; - } - - public void setPaymentMethods(PaymentMethodSummary[] paymentMethods) { - this.paymentMethods = paymentMethods; - } } diff --git a/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsService.java b/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsService.java index b54fbd0c..0b896c4e 100644 --- a/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsService.java +++ b/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsService.java @@ -30,6 +30,21 @@ public interface PaymentMethodsService { * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + ListEntityPaymentMethodsResponse listEntityPaymentMethods(ListEntityPaymentMethodsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Entity Payment Methods. + * + *

Retrieve all payment methods for a given entity + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use listEntityPaymentMethods instead. + */ + @Deprecated ListPaymentMethodsResponse listPaymentMethods(ListPaymentMethodsRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -43,6 +58,21 @@ ListPaymentMethodsResponse listPaymentMethods(ListPaymentMethodsRequest request) * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetEntityPaymentMethodResponse getEntityPaymentMethod(GetEntityPaymentMethodRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Entity Payment Method. + * + *

Get payment method details by id for a given entity + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getEntityPaymentMethod instead. + */ + @Deprecated GetPaymentMethodDetailsResponse getPaymentMethodDetails(GetPaymentMethodDetailsRequest request) throws CoinbaseClientException, CoinbasePrimeException; } diff --git a/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsServiceImpl.java b/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsServiceImpl.java index 37b4ffb0..aa79c07e 100644 --- a/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsServiceImpl.java +++ b/src/main/java/com/coinbase/prime/paymentmethods/PaymentMethodsServiceImpl.java @@ -29,6 +29,18 @@ public PaymentMethodsServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public ListEntityPaymentMethodsResponse listEntityPaymentMethods( + ListEntityPaymentMethodsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/entities/%s/payment-methods", request.getEntityId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListPaymentMethodsResponse listPaymentMethods(ListPaymentMethodsRequest request) throws CoinbasePrimeException { @@ -40,6 +52,19 @@ public ListPaymentMethodsResponse listPaymentMethods(ListPaymentMethodsRequest r new TypeReference() {}); } + @Override + public GetEntityPaymentMethodResponse getEntityPaymentMethod( + GetEntityPaymentMethodRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format( + "/entities/%s/payment-methods/%s", request.getEntityId(), request.getPaymentMethodId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetPaymentMethodDetailsResponse getPaymentMethodDetails( GetPaymentMethodDetailsRequest request) throws CoinbasePrimeException { diff --git a/src/main/java/com/coinbase/prime/products/GetCandlesRequest.java b/src/main/java/com/coinbase/prime/products/GetCandlesRequest.java index fb5e921a..7fd8ebda 100644 --- a/src/main/java/com/coinbase/prime/products/GetCandlesRequest.java +++ b/src/main/java/com/coinbase/prime/products/GetCandlesRequest.java @@ -16,129 +16,61 @@ package com.coinbase.prime.products; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.enums.CandlesGranularity; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Get Public Product Candles (Beta) */ -public class GetCandlesRequest { - /** The portfolio id requesting market data. */ - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - /** The trading pair. */ - @JsonProperty("product_id") - private String productId; - - /** Timestamp for starting range of aggregations */ - @JsonProperty("start_time") - private String startTime; - - /** Timestamp for ending range of aggregations */ - @JsonProperty("end_time") - private String endTime; - - /** The timeframe each candle represents. */ - @JsonProperty("granularity") - private CandlesGranularity granularity; +/** + * Get Public Product Candles + * + * @deprecated Use getProductCandles instead. + */ +@Deprecated +public class GetCandlesRequest extends GetProductCandlesRequest { public GetCandlesRequest() {} - public GetCandlesRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.productId = builder.productId; - this.startTime = builder.startTime; - this.endTime = builder.endTime; - this.granularity = builder.granularity; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getProductId() { - return productId; - } - - public void setProductId(String productId) { - this.productId = productId; + public GetCandlesRequest(GetProductCandlesRequest.Builder builder) { + super(builder); } - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - public CandlesGranularity getGranularity() { - return granularity; - } - - public void setGranularity(CandlesGranularity granularity) { - this.granularity = granularity; - } - - public static class Builder { - private String portfolioId; - private String productId; - private String startTime; - private String endTime; - private CandlesGranularity granularity; - - public Builder() {} - + /** + * @deprecated Use getProductCandles instead. + */ + @Deprecated + public static class Builder extends GetProductCandlesRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder productId(String productId) { - this.productId = productId; + super.productId(productId); return this; } + @Override public Builder startTime(String startTime) { - this.startTime = startTime; + super.startTime(startTime); return this; } + @Override public Builder endTime(String endTime) { - this.endTime = endTime; + super.endTime(endTime); return this; } + @Override public Builder granularity(CandlesGranularity granularity) { - this.granularity = granularity; + super.granularity(granularity); return this; } + @Override public GetCandlesRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new GetCandlesRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/products/GetCandlesResponse.java b/src/main/java/com/coinbase/prime/products/GetCandlesResponse.java index 529f2426..565be1e9 100644 --- a/src/main/java/com/coinbase/prime/products/GetCandlesResponse.java +++ b/src/main/java/com/coinbase/prime/products/GetCandlesResponse.java @@ -16,21 +16,12 @@ package com.coinbase.prime.products; -import com.coinbase.prime.model.Candle; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Candle response structure */ -public class GetCandlesResponse { - @JsonProperty("candles") - private Candle[] candles; - +/** + * Get Public Product Candles + * + * @deprecated Use getProductCandles instead. + */ +@Deprecated +public class GetCandlesResponse extends GetProductCandlesResponse { public GetCandlesResponse() {} - - public Candle[] getCandles() { - return candles; - } - - public void setCandles(Candle[] candles) { - this.candles = candles; - } } diff --git a/src/main/java/com/coinbase/prime/products/GetProductCandlesRequest.java b/src/main/java/com/coinbase/prime/products/GetProductCandlesRequest.java new file mode 100644 index 00000000..bf24421c --- /dev/null +++ b/src/main/java/com/coinbase/prime/products/GetProductCandlesRequest.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.products; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.enums.CandlesGranularity; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Public Product Candles (Beta) */ +public class GetProductCandlesRequest { + /** The portfolio id requesting market data. */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + /** The trading pair. */ + @JsonProperty("product_id") + private String productId; + + /** Timestamp for starting range of aggregations */ + @JsonProperty("start_time") + private String startTime; + + /** Timestamp for ending range of aggregations */ + @JsonProperty("end_time") + private String endTime; + + /** The timeframe each candle represents. */ + @JsonProperty("granularity") + private CandlesGranularity granularity; + + public GetProductCandlesRequest() {} + + public GetProductCandlesRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.productId = builder.productId; + this.startTime = builder.startTime; + this.endTime = builder.endTime; + this.granularity = builder.granularity; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public CandlesGranularity getGranularity() { + return granularity; + } + + public void setGranularity(CandlesGranularity granularity) { + this.granularity = granularity; + } + + public static class Builder { + private String portfolioId; + private String productId; + private String startTime; + private String endTime; + private CandlesGranularity granularity; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder productId(String productId) { + this.productId = productId; + return this; + } + + public Builder startTime(String startTime) { + this.startTime = startTime; + return this; + } + + public Builder endTime(String endTime) { + this.endTime = endTime; + return this; + } + + public Builder granularity(CandlesGranularity granularity) { + this.granularity = granularity; + return this; + } + + public GetProductCandlesRequest build() throws CoinbaseClientException { + validate(); + return new GetProductCandlesRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/products/GetProductCandlesResponse.java b/src/main/java/com/coinbase/prime/products/GetProductCandlesResponse.java new file mode 100644 index 00000000..e55b0633 --- /dev/null +++ b/src/main/java/com/coinbase/prime/products/GetProductCandlesResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.products; + +import com.coinbase.prime.model.Candle; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Candle response structure */ +public class GetProductCandlesResponse { + @JsonProperty("candles") + private Candle[] candles; + + public GetProductCandlesResponse() {} + + public Candle[] getCandles() { + return candles; + } + + public void setCandles(Candle[] candles) { + this.candles = candles; + } +} diff --git a/src/main/java/com/coinbase/prime/products/ListPortfolioProductsRequest.java b/src/main/java/com/coinbase/prime/products/ListPortfolioProductsRequest.java index 79b04449..65bde552 100644 --- a/src/main/java/com/coinbase/prime/products/ListPortfolioProductsRequest.java +++ b/src/main/java/com/coinbase/prime/products/ListPortfolioProductsRequest.java @@ -16,126 +16,70 @@ package com.coinbase.prime.products; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.common.PrimeListRequest; import com.coinbase.prime.model.enums.ContractExpiryType; import com.coinbase.prime.model.enums.ExpiringContractStatus; import com.coinbase.prime.model.enums.ProductType; -import com.coinbase.prime.model.enums.SortDirection; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Portfolio Products */ -public class ListPortfolioProductsRequest extends PrimeListRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty("product_type") - private ProductType productType; - - @JsonProperty("contract_expiry_type") - private ContractExpiryType contractExpiryType; - - @JsonProperty("expiring_contract_status") - private ExpiringContractStatus expiringContractStatus; +/** + * List Portfolio Products + * + * @deprecated Use listProducts instead. + */ +@Deprecated +public class ListPortfolioProductsRequest extends ListProductsRequest { public ListPortfolioProductsRequest() {} - public ListPortfolioProductsRequest(Builder builder) { - super(builder.cursor, builder.sortDirection, builder.limit); - this.portfolioId = builder.portfolioId; - this.productType = builder.productType; - this.contractExpiryType = builder.contractExpiryType; - this.expiringContractStatus = builder.expiringContractStatus; + public ListPortfolioProductsRequest(ListProductsRequest.Builder builder) { + super(builder); } - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public ProductType getProductType() { - return productType; - } - - public void setProductType(ProductType productType) { - this.productType = productType; - } - - public ContractExpiryType getContractExpiryType() { - return contractExpiryType; - } - - public void setContractExpiryType(ContractExpiryType contractExpiryType) { - this.contractExpiryType = contractExpiryType; - } - - public ExpiringContractStatus getExpiringContractStatus() { - return expiringContractStatus; - } - - public void setExpiringContractStatus(ExpiringContractStatus expiringContractStatus) { - this.expiringContractStatus = expiringContractStatus; - } - - public static class Builder { - private String portfolioId; - private ProductType productType; - private ContractExpiryType contractExpiryType; - private ExpiringContractStatus expiringContractStatus; - private String cursor; - private SortDirection sortDirection; - private Integer limit; - - public Builder() {} - + /** + * @deprecated Use listProducts instead. + */ + @Deprecated + public static class Builder extends ListProductsRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder productType(ProductType productType) { - this.productType = productType; + super.productType(productType); return this; } + @Override public Builder contractExpiryType(ContractExpiryType contractExpiryType) { - this.contractExpiryType = contractExpiryType; + super.contractExpiryType(contractExpiryType); return this; } + @Override public Builder expiringContractStatus(ExpiringContractStatus expiringContractStatus) { - this.expiringContractStatus = expiringContractStatus; + super.expiringContractStatus(expiringContractStatus); return this; } + @Override public Builder limit(Integer limit) { - this.limit = limit; + super.limit(limit); return this; } + @Override public Builder pagination(Pagination pagination) { - this.cursor = pagination.getNextCursor(); - this.sortDirection = pagination.getSortDirection(); + super.pagination(pagination); return this; } + @Override public ListPortfolioProductsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListPortfolioProductsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/products/ListPortfolioProductsResponse.java b/src/main/java/com/coinbase/prime/products/ListPortfolioProductsResponse.java index 15441d63..e79a0d33 100644 --- a/src/main/java/com/coinbase/prime/products/ListPortfolioProductsResponse.java +++ b/src/main/java/com/coinbase/prime/products/ListPortfolioProductsResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.products; -import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.model.Product; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Portfolio Products */ -public class ListPortfolioProductsResponse { - @JsonProperty("products") - private Product[] products; - - @JsonProperty("pagination") - private Pagination pagination; - +/** + * List Portfolio Products + * + * @deprecated Use listProducts instead. + */ +@Deprecated +public class ListPortfolioProductsResponse extends ListProductsResponse { public ListPortfolioProductsResponse() {} - - public Product[] getProducts() { - return products; - } - - public void setProducts(Product[] products) { - this.products = products; - } - - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } } diff --git a/src/main/java/com/coinbase/prime/products/ListProductsRequest.java b/src/main/java/com/coinbase/prime/products/ListProductsRequest.java new file mode 100644 index 00000000..be7642f2 --- /dev/null +++ b/src/main/java/com/coinbase/prime/products/ListProductsRequest.java @@ -0,0 +1,141 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.products; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.common.PrimeListRequest; +import com.coinbase.prime.model.enums.ContractExpiryType; +import com.coinbase.prime.model.enums.ExpiringContractStatus; +import com.coinbase.prime.model.enums.ProductType; +import com.coinbase.prime.model.enums.SortDirection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Portfolio Products */ +public class ListProductsRequest extends PrimeListRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("product_type") + private ProductType productType; + + @JsonProperty("contract_expiry_type") + private ContractExpiryType contractExpiryType; + + @JsonProperty("expiring_contract_status") + private ExpiringContractStatus expiringContractStatus; + + public ListProductsRequest() {} + + public ListProductsRequest(Builder builder) { + super(builder.cursor, builder.sortDirection, builder.limit); + this.portfolioId = builder.portfolioId; + this.productType = builder.productType; + this.contractExpiryType = builder.contractExpiryType; + this.expiringContractStatus = builder.expiringContractStatus; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public ProductType getProductType() { + return productType; + } + + public void setProductType(ProductType productType) { + this.productType = productType; + } + + public ContractExpiryType getContractExpiryType() { + return contractExpiryType; + } + + public void setContractExpiryType(ContractExpiryType contractExpiryType) { + this.contractExpiryType = contractExpiryType; + } + + public ExpiringContractStatus getExpiringContractStatus() { + return expiringContractStatus; + } + + public void setExpiringContractStatus(ExpiringContractStatus expiringContractStatus) { + this.expiringContractStatus = expiringContractStatus; + } + + public static class Builder { + private String portfolioId; + private ProductType productType; + private ContractExpiryType contractExpiryType; + private ExpiringContractStatus expiringContractStatus; + private String cursor; + private SortDirection sortDirection; + private Integer limit; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder productType(ProductType productType) { + this.productType = productType; + return this; + } + + public Builder contractExpiryType(ContractExpiryType contractExpiryType) { + this.contractExpiryType = contractExpiryType; + return this; + } + + public Builder expiringContractStatus(ExpiringContractStatus expiringContractStatus) { + this.expiringContractStatus = expiringContractStatus; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder pagination(Pagination pagination) { + this.cursor = pagination.getNextCursor(); + this.sortDirection = pagination.getSortDirection(); + return this; + } + + public ListProductsRequest build() throws CoinbaseClientException { + validate(); + return new ListProductsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/products/ListProductsResponse.java b/src/main/java/com/coinbase/prime/products/ListProductsResponse.java new file mode 100644 index 00000000..5ce2fee3 --- /dev/null +++ b/src/main/java/com/coinbase/prime/products/ListProductsResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.products; + +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.model.Product; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Portfolio Products */ +public class ListProductsResponse { + @JsonProperty("products") + private Product[] products; + + @JsonProperty("pagination") + private Pagination pagination; + + public ListProductsResponse() {} + + public Product[] getProducts() { + return products; + } + + public void setProducts(Product[] products) { + this.products = products; + } + + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } +} diff --git a/src/main/java/com/coinbase/prime/products/ProductsService.java b/src/main/java/com/coinbase/prime/products/ProductsService.java index ffc6dd2e..36259ee8 100644 --- a/src/main/java/com/coinbase/prime/products/ProductsService.java +++ b/src/main/java/com/coinbase/prime/products/ProductsService.java @@ -30,6 +30,21 @@ public interface ProductsService { * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + ListProductsResponse listProducts(ListProductsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Portfolio Products. + * + *

List tradable products for a given portfolio + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use listProducts instead. + */ + @Deprecated ListPortfolioProductsResponse listPortfolioProducts(ListPortfolioProductsRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -44,6 +59,22 @@ ListPortfolioProductsResponse listPortfolioProducts(ListPortfolioProductsRequest * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + GetProductCandlesResponse getProductCandles(GetProductCandlesRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Public Product Candles (Beta). + * + *

Get rates for a single product by product ID, grouped in buckets. This feature is in beta + * please reach out to your Coinbase Prime account manager for more information + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use getProductCandles instead. + */ + @Deprecated GetCandlesResponse getCandles(GetCandlesRequest request) throws CoinbaseClientException, CoinbasePrimeException; } diff --git a/src/main/java/com/coinbase/prime/products/ProductsServiceImpl.java b/src/main/java/com/coinbase/prime/products/ProductsServiceImpl.java index fad165b1..1f4cf503 100644 --- a/src/main/java/com/coinbase/prime/products/ProductsServiceImpl.java +++ b/src/main/java/com/coinbase/prime/products/ProductsServiceImpl.java @@ -28,6 +28,18 @@ public ProductsServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public ListProductsResponse listProducts(ListProductsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/products", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListPortfolioProductsResponse listPortfolioProducts(ListPortfolioProductsRequest request) throws CoinbasePrimeException { @@ -39,6 +51,18 @@ public ListPortfolioProductsResponse listPortfolioProducts(ListPortfolioProducts new TypeReference() {}); } + @Override + public GetProductCandlesResponse getProductCandles(GetProductCandlesRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/candles", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public GetCandlesResponse getCandles(GetCandlesRequest request) throws CoinbasePrimeException { return this.request( diff --git a/src/main/java/com/coinbase/prime/staking/ClaimRewardsRequest.java b/src/main/java/com/coinbase/prime/staking/ClaimRewardsRequest.java index 433f31c4..f7f94dfe 100644 --- a/src/main/java/com/coinbase/prime/staking/ClaimRewardsRequest.java +++ b/src/main/java/com/coinbase/prime/staking/ClaimRewardsRequest.java @@ -16,110 +16,55 @@ package com.coinbase.prime.staking; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.WalletClaimRewardsInputs; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Claim Wallet Staking Rewards (Alpha) */ -public class ClaimRewardsRequest { - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - @JsonProperty(required = true, value = "wallet_id") - @JsonIgnore - private String walletId; - - @JsonProperty("idempotency_key") - private String idempotencyKey; - - @JsonProperty("inputs") - private WalletClaimRewardsInputs inputs; +/** + * Claim Wallet Staking Rewards (Alpha) + * + * @deprecated Use claimStakingRewards instead. + */ +@Deprecated +public class ClaimRewardsRequest extends ClaimStakingRewardsRequest { public ClaimRewardsRequest() {} - public ClaimRewardsRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.walletId = builder.walletId; - this.idempotencyKey = builder.idempotencyKey; - this.inputs = builder.inputs; + public ClaimRewardsRequest(ClaimStakingRewardsRequest.Builder builder) { + super(builder); } - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getWalletId() { - return walletId; - } - - public void setWalletId(String walletId) { - this.walletId = walletId; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public void setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - } - - public WalletClaimRewardsInputs getInputs() { - return inputs; - } - - public void setInputs(WalletClaimRewardsInputs inputs) { - this.inputs = inputs; - } - - public static class Builder { - private String portfolioId; - private String walletId; - private String idempotencyKey; - private WalletClaimRewardsInputs inputs; - - public Builder() {} - + /** + * @deprecated Use claimStakingRewards instead. + */ + @Deprecated + public static class Builder extends ClaimStakingRewardsRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder walletId(String walletId) { - this.walletId = walletId; + super.walletId(walletId); return this; } + @Override public Builder idempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + super.idempotencyKey(idempotencyKey); return this; } + @Override public Builder inputs(WalletClaimRewardsInputs inputs) { - this.inputs = inputs; + super.inputs(inputs); return this; } + @Override public ClaimRewardsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ClaimRewardsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - if (isNullOrEmpty(this.walletId)) { - throw new CoinbaseClientException("WalletId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/staking/ClaimRewardsResponse.java b/src/main/java/com/coinbase/prime/staking/ClaimRewardsResponse.java index 9d534beb..5ccb2773 100644 --- a/src/main/java/com/coinbase/prime/staking/ClaimRewardsResponse.java +++ b/src/main/java/com/coinbase/prime/staking/ClaimRewardsResponse.java @@ -16,42 +16,12 @@ package com.coinbase.prime.staking; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Claim Wallet Staking Rewards (Alpha) */ -public class ClaimRewardsResponse { - @JsonProperty("wallet_id") - private String walletId; - - @JsonProperty("transaction_id") - private String transactionId; - - @JsonProperty("activity_id") - private String activityId; - +/** + * Claim Wallet Staking Rewards (Alpha) + * + * @deprecated Use claimStakingRewards instead. + */ +@Deprecated +public class ClaimRewardsResponse extends ClaimStakingRewardsResponse { public ClaimRewardsResponse() {} - - public String getWalletId() { - return walletId; - } - - public void setWalletId(String walletId) { - this.walletId = walletId; - } - - public String getTransactionId() { - return transactionId; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } - - public String getActivityId() { - return activityId; - } - - public void setActivityId(String activityId) { - this.activityId = activityId; - } } diff --git a/src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsRequest.java b/src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsRequest.java new file mode 100644 index 00000000..1e7bf327 --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsRequest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.WalletClaimRewardsInputs; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Claim Wallet Staking Rewards (Alpha) */ +public class ClaimStakingRewardsRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "wallet_id") + @JsonIgnore + private String walletId; + + @JsonProperty("idempotency_key") + private String idempotencyKey; + + @JsonProperty("inputs") + private WalletClaimRewardsInputs inputs; + + public ClaimStakingRewardsRequest() {} + + public ClaimStakingRewardsRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.walletId = builder.walletId; + this.idempotencyKey = builder.idempotencyKey; + this.inputs = builder.inputs; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getWalletId() { + return walletId; + } + + public void setWalletId(String walletId) { + this.walletId = walletId; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + public WalletClaimRewardsInputs getInputs() { + return inputs; + } + + public void setInputs(WalletClaimRewardsInputs inputs) { + this.inputs = inputs; + } + + public static class Builder { + private String portfolioId; + private String walletId; + private String idempotencyKey; + private WalletClaimRewardsInputs inputs; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder walletId(String walletId) { + this.walletId = walletId; + return this; + } + + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public Builder inputs(WalletClaimRewardsInputs inputs) { + this.inputs = inputs; + return this; + } + + public ClaimStakingRewardsRequest build() throws CoinbaseClientException { + validate(); + return new ClaimStakingRewardsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.walletId)) { + throw new CoinbaseClientException("WalletId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsResponse.java b/src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsResponse.java new file mode 100644 index 00000000..2026fd7a --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/ClaimStakingRewardsResponse.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Claim Wallet Staking Rewards (Alpha) */ +public class ClaimStakingRewardsResponse { + @JsonProperty("wallet_id") + private String walletId; + + @JsonProperty("transaction_id") + private String transactionId; + + @JsonProperty("activity_id") + private String activityId; + + public ClaimStakingRewardsResponse() {} + + public String getWalletId() { + return walletId; + } + + public void setWalletId(String walletId) { + this.walletId = walletId; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } +} diff --git a/src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeRequest.java b/src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeRequest.java new file mode 100644 index 00000000..40e25452 --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeRequest.java @@ -0,0 +1,146 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.PortfolioStakingMetadata; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to stake currency in a portfolio */ +public class CreatePortfolioStakeRequest { + /** The portfolio ID */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + /** + * The client generated idempotency key (uuid required) for requested execution. Subsequent + * requests using the same key will not create new transactions. + */ + @JsonProperty("idempotency_key") + private String idempotencyKey; + + /** The currency symbol to stake */ + @JsonProperty("currency_symbol") + private String currencySymbol; + + /** The quantity of the chosen currency to stake */ + @JsonProperty("amount") + private String amount; + + @JsonProperty("metadata") + private PortfolioStakingMetadata metadata; + + public CreatePortfolioStakeRequest() {} + + public CreatePortfolioStakeRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.idempotencyKey = builder.idempotencyKey; + this.currencySymbol = builder.currencySymbol; + this.amount = builder.amount; + this.metadata = builder.metadata; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + public String getCurrencySymbol() { + return currencySymbol; + } + + public void setCurrencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public PortfolioStakingMetadata getMetadata() { + return metadata; + } + + public void setMetadata(PortfolioStakingMetadata metadata) { + this.metadata = metadata; + } + + public static class Builder { + private String portfolioId; + private String idempotencyKey; + private String currencySymbol; + private String amount; + private PortfolioStakingMetadata metadata; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public Builder currencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + return this; + } + + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + public Builder metadata(PortfolioStakingMetadata metadata) { + this.metadata = metadata; + return this; + } + + public CreatePortfolioStakeRequest build() throws CoinbaseClientException { + validate(); + return new CreatePortfolioStakeRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeResponse.java b/src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeResponse.java new file mode 100644 index 00000000..3fe9648f --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/CreatePortfolioStakeResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to stake currency in a portfolio */ +public class CreatePortfolioStakeResponse { + /** The ID for the created activity */ + @JsonProperty("activity_id") + private String activityId; + + /** The ID for the created transaction */ + @JsonProperty("transaction_id") + private String transactionId; + + public CreatePortfolioStakeResponse() {} + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } +} diff --git a/src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeRequest.java b/src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeRequest.java new file mode 100644 index 00000000..e4b762fa --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeRequest.java @@ -0,0 +1,165 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.PortfolioStakingMetadata; +import com.coinbase.prime.model.enums.ValidatorProvider; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to unstake currency across a portfolio */ +public class CreatePortfolioUnstakeRequest { + /** The portfolio ID */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + /** + * The client generated idempotency key (uuid required) for requested execution. Subsequent + * requests using the same key will not create new transactions. + */ + @JsonProperty("idempotency_key") + private String idempotencyKey; + + /** The currency symbol to unstake */ + @JsonProperty("currency_symbol") + private String currencySymbol; + + /** The quantity of the chosen currency to unstake */ + @JsonProperty("amount") + private String amount; + + @JsonProperty("metadata") + private PortfolioStakingMetadata metadata; + + @JsonProperty("validator_provider") + private ValidatorProvider validatorProvider; + + public CreatePortfolioUnstakeRequest() {} + + public CreatePortfolioUnstakeRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.idempotencyKey = builder.idempotencyKey; + this.currencySymbol = builder.currencySymbol; + this.amount = builder.amount; + this.metadata = builder.metadata; + this.validatorProvider = builder.validatorProvider; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + public String getCurrencySymbol() { + return currencySymbol; + } + + public void setCurrencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public PortfolioStakingMetadata getMetadata() { + return metadata; + } + + public void setMetadata(PortfolioStakingMetadata metadata) { + this.metadata = metadata; + } + + public ValidatorProvider getValidatorProvider() { + return validatorProvider; + } + + public void setValidatorProvider(ValidatorProvider validatorProvider) { + this.validatorProvider = validatorProvider; + } + + public static class Builder { + private String portfolioId; + private String idempotencyKey; + private String currencySymbol; + private String amount; + private PortfolioStakingMetadata metadata; + private ValidatorProvider validatorProvider; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public Builder currencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + return this; + } + + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + public Builder metadata(PortfolioStakingMetadata metadata) { + this.metadata = metadata; + return this; + } + + public Builder validatorProvider(ValidatorProvider validatorProvider) { + this.validatorProvider = validatorProvider; + return this; + } + + public CreatePortfolioUnstakeRequest build() throws CoinbaseClientException { + validate(); + return new CreatePortfolioUnstakeRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeResponse.java b/src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeResponse.java new file mode 100644 index 00000000..3c313eb9 --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/CreatePortfolioUnstakeResponse.java @@ -0,0 +1,48 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Request to unstake currency across a portfolio */ +public class CreatePortfolioUnstakeResponse { + /** The ID for the created activity */ + @JsonProperty("activity_id") + private String activityId; + + /** The ID for the created transaction */ + @JsonProperty("transaction_id") + private String transactionId; + + public CreatePortfolioUnstakeResponse() {} + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } +} diff --git a/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsRequest.java b/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsRequest.java index 653ef55c..e4f56e67 100644 --- a/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsRequest.java +++ b/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsRequest.java @@ -16,134 +16,61 @@ package com.coinbase.prime.staking; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.enums.SortDirection; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Transaction Validators */ -public class ListTransactionValidatorsRequest { - /** The portfolio ID */ - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - /** - * List of transaction IDs to filter validators by. Maximum of 100 transaction IDs allowed per - * request. - */ - @JsonProperty("transaction_ids") - private String[] transactionIds; - - /** Cursor for pagination */ - @JsonProperty("cursor") - private String cursor; - - /** - * Maximum number of transaction-validator associations to return per page. Default is 100, - * maximum is 1000. - */ - @JsonProperty("limit") - private Integer limit; - - @JsonProperty("sort_direction") - private SortDirection sortDirection; +/** + * List Transaction Validators + * + * @deprecated Use queryTransactionValidators instead. + */ +@Deprecated +public class ListTransactionValidatorsRequest extends QueryTransactionValidatorsRequest { public ListTransactionValidatorsRequest() {} - public ListTransactionValidatorsRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.transactionIds = builder.transactionIds; - this.cursor = builder.cursor; - this.limit = builder.limit; - this.sortDirection = builder.sortDirection; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String[] getTransactionIds() { - return transactionIds; - } - - public void setTransactionIds(String[] transactionIds) { - this.transactionIds = transactionIds; - } - - public String getCursor() { - return cursor; - } - - public void setCursor(String cursor) { - this.cursor = cursor; + public ListTransactionValidatorsRequest(QueryTransactionValidatorsRequest.Builder builder) { + super(builder); } - public Integer getLimit() { - return limit; - } - - public void setLimit(Integer limit) { - this.limit = limit; - } - - public SortDirection getSortDirection() { - return sortDirection; - } - - public void setSortDirection(SortDirection sortDirection) { - this.sortDirection = sortDirection; - } - - public static class Builder { - private String portfolioId; - private String[] transactionIds; - private String cursor; - private Integer limit; - private SortDirection sortDirection; - - public Builder() {} - + /** + * @deprecated Use queryTransactionValidators instead. + */ + @Deprecated + public static class Builder extends QueryTransactionValidatorsRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder transactionIds(String[] transactionIds) { - this.transactionIds = transactionIds; + super.transactionIds(transactionIds); return this; } + @Override public Builder cursor(String cursor) { - this.cursor = cursor; + super.cursor(cursor); return this; } + @Override public Builder limit(Integer limit) { - this.limit = limit; + super.limit(limit); return this; } + @Override public Builder sortDirection(SortDirection sortDirection) { - this.sortDirection = sortDirection; + super.sortDirection(sortDirection); return this; } + @Override public ListTransactionValidatorsRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new ListTransactionValidatorsRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsResponse.java b/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsResponse.java index 4650a4ff..1fe22114 100644 --- a/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsResponse.java +++ b/src/main/java/com/coinbase/prime/staking/ListTransactionValidatorsResponse.java @@ -16,37 +16,12 @@ package com.coinbase.prime.staking; -import com.coinbase.prime.common.Pagination; -import com.coinbase.prime.model.TransactionValidator; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** List Transaction Validators */ -public class ListTransactionValidatorsResponse { - /** - * List of transaction-to-validator associations. Each entry represents one transaction staking to - * one validator. - */ - @JsonProperty("transaction_validators") - private TransactionValidator[] transactionValidators; - - @JsonProperty("pagination") - private Pagination pagination; - +/** + * List Transaction Validators + * + * @deprecated Use queryTransactionValidators instead. + */ +@Deprecated +public class ListTransactionValidatorsResponse extends QueryTransactionValidatorsResponse { public ListTransactionValidatorsResponse() {} - - public TransactionValidator[] getTransactionValidators() { - return transactionValidators; - } - - public void setTransactionValidators(TransactionValidator[] transactionValidators) { - this.transactionValidators = transactionValidators; - } - - public Pagination getPagination() { - return pagination; - } - - public void setPagination(Pagination pagination) { - this.pagination = pagination; - } } diff --git a/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateRequest.java b/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateRequest.java index 5d845462..7a13446c 100644 --- a/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateRequest.java +++ b/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateRequest.java @@ -16,131 +16,61 @@ package com.coinbase.prime.staking; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.PortfolioStakingMetadata; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request to stake currency in a portfolio */ -public class PortfolioStakingInitiateRequest { - /** The portfolio ID */ - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - /** - * The client generated idempotency key (uuid required) for requested execution. Subsequent - * requests using the same key will not create new transactions. - */ - @JsonProperty("idempotency_key") - private String idempotencyKey; - - /** The currency symbol to stake */ - @JsonProperty("currency_symbol") - private String currencySymbol; - - /** The quantity of the chosen currency to stake */ - @JsonProperty("amount") - private String amount; - - @JsonProperty("metadata") - private PortfolioStakingMetadata metadata; +/** + * Request to stake currency in a portfolio + * + * @deprecated Use createPortfolioStake instead. + */ +@Deprecated +public class PortfolioStakingInitiateRequest extends CreatePortfolioStakeRequest { public PortfolioStakingInitiateRequest() {} - public PortfolioStakingInitiateRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.idempotencyKey = builder.idempotencyKey; - this.currencySymbol = builder.currencySymbol; - this.amount = builder.amount; - this.metadata = builder.metadata; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public void setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + public PortfolioStakingInitiateRequest(CreatePortfolioStakeRequest.Builder builder) { + super(builder); } - public String getCurrencySymbol() { - return currencySymbol; - } - - public void setCurrencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public PortfolioStakingMetadata getMetadata() { - return metadata; - } - - public void setMetadata(PortfolioStakingMetadata metadata) { - this.metadata = metadata; - } - - public static class Builder { - private String portfolioId; - private String idempotencyKey; - private String currencySymbol; - private String amount; - private PortfolioStakingMetadata metadata; - - public Builder() {} - + /** + * @deprecated Use createPortfolioStake instead. + */ + @Deprecated + public static class Builder extends CreatePortfolioStakeRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder idempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + super.idempotencyKey(idempotencyKey); return this; } + @Override public Builder currencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; + super.currencySymbol(currencySymbol); return this; } + @Override public Builder amount(String amount) { - this.amount = amount; + super.amount(amount); return this; } + @Override public Builder metadata(PortfolioStakingMetadata metadata) { - this.metadata = metadata; + super.metadata(metadata); return this; } + @Override public PortfolioStakingInitiateRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new PortfolioStakingInitiateRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateResponse.java b/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateResponse.java index cc353913..2823bd0f 100644 --- a/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateResponse.java +++ b/src/main/java/com/coinbase/prime/staking/PortfolioStakingInitiateResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.staking; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request to stake currency in a portfolio */ -public class PortfolioStakingInitiateResponse { - /** The ID for the created activity */ - @JsonProperty("activity_id") - private String activityId; - - /** The ID for the created transaction */ - @JsonProperty("transaction_id") - private String transactionId; - +/** + * Request to stake currency in a portfolio + * + * @deprecated Use createPortfolioStake instead. + */ +@Deprecated +public class PortfolioStakingInitiateResponse extends CreatePortfolioStakeResponse { public PortfolioStakingInitiateResponse() {} - - public String getActivityId() { - return activityId; - } - - public void setActivityId(String activityId) { - this.activityId = activityId; - } - - public String getTransactionId() { - return transactionId; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } } diff --git a/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeRequest.java b/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeRequest.java index 47f02f94..edf1ba43 100644 --- a/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeRequest.java +++ b/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeRequest.java @@ -16,150 +16,68 @@ package com.coinbase.prime.staking; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.PortfolioStakingMetadata; import com.coinbase.prime.model.enums.ValidatorProvider; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request to unstake currency across a portfolio */ -public class PortfolioStakingUnstakeRequest { - /** The portfolio ID */ - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - /** - * The client generated idempotency key (uuid required) for requested execution. Subsequent - * requests using the same key will not create new transactions. - */ - @JsonProperty("idempotency_key") - private String idempotencyKey; - - /** The currency symbol to unstake */ - @JsonProperty("currency_symbol") - private String currencySymbol; - - /** The quantity of the chosen currency to unstake */ - @JsonProperty("amount") - private String amount; - - @JsonProperty("metadata") - private PortfolioStakingMetadata metadata; - - @JsonProperty("validator_provider") - private ValidatorProvider validatorProvider; +/** + * Request to unstake currency across a portfolio + * + * @deprecated Use createPortfolioUnstake instead. + */ +@Deprecated +public class PortfolioStakingUnstakeRequest extends CreatePortfolioUnstakeRequest { public PortfolioStakingUnstakeRequest() {} - public PortfolioStakingUnstakeRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.idempotencyKey = builder.idempotencyKey; - this.currencySymbol = builder.currencySymbol; - this.amount = builder.amount; - this.metadata = builder.metadata; - this.validatorProvider = builder.validatorProvider; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public void setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - } - - public String getCurrencySymbol() { - return currencySymbol; + public PortfolioStakingUnstakeRequest(CreatePortfolioUnstakeRequest.Builder builder) { + super(builder); } - public void setCurrencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public PortfolioStakingMetadata getMetadata() { - return metadata; - } - - public void setMetadata(PortfolioStakingMetadata metadata) { - this.metadata = metadata; - } - - public ValidatorProvider getValidatorProvider() { - return validatorProvider; - } - - public void setValidatorProvider(ValidatorProvider validatorProvider) { - this.validatorProvider = validatorProvider; - } - - public static class Builder { - private String portfolioId; - private String idempotencyKey; - private String currencySymbol; - private String amount; - private PortfolioStakingMetadata metadata; - private ValidatorProvider validatorProvider; - - public Builder() {} - + /** + * @deprecated Use createPortfolioUnstake instead. + */ + @Deprecated + public static class Builder extends CreatePortfolioUnstakeRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder idempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + super.idempotencyKey(idempotencyKey); return this; } + @Override public Builder currencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; + super.currencySymbol(currencySymbol); return this; } + @Override public Builder amount(String amount) { - this.amount = amount; + super.amount(amount); return this; } + @Override public Builder metadata(PortfolioStakingMetadata metadata) { - this.metadata = metadata; + super.metadata(metadata); return this; } + @Override public Builder validatorProvider(ValidatorProvider validatorProvider) { - this.validatorProvider = validatorProvider; + super.validatorProvider(validatorProvider); return this; } + @Override public PortfolioStakingUnstakeRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new PortfolioStakingUnstakeRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeResponse.java b/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeResponse.java index 56f8f88f..93d8315f 100644 --- a/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeResponse.java +++ b/src/main/java/com/coinbase/prime/staking/PortfolioStakingUnstakeResponse.java @@ -16,33 +16,12 @@ package com.coinbase.prime.staking; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Request to unstake currency across a portfolio */ -public class PortfolioStakingUnstakeResponse { - /** The ID for the created activity */ - @JsonProperty("activity_id") - private String activityId; - - /** The ID for the created transaction */ - @JsonProperty("transaction_id") - private String transactionId; - +/** + * Request to unstake currency across a portfolio + * + * @deprecated Use createPortfolioUnstake instead. + */ +@Deprecated +public class PortfolioStakingUnstakeResponse extends CreatePortfolioUnstakeResponse { public PortfolioStakingUnstakeResponse() {} - - public String getActivityId() { - return activityId; - } - - public void setActivityId(String activityId) { - this.activityId = activityId; - } - - public String getTransactionId() { - return transactionId; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } } diff --git a/src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsRequest.java b/src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsRequest.java new file mode 100644 index 00000000..0f469f1b --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsRequest.java @@ -0,0 +1,149 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.enums.SortDirection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Transaction Validators */ +public class QueryTransactionValidatorsRequest { + /** The portfolio ID */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + /** + * List of transaction IDs to filter validators by. Maximum of 100 transaction IDs allowed per + * request. + */ + @JsonProperty("transaction_ids") + private String[] transactionIds; + + /** Cursor for pagination */ + @JsonProperty("cursor") + private String cursor; + + /** + * Maximum number of transaction-validator associations to return per page. Default is 100, + * maximum is 1000. + */ + @JsonProperty("limit") + private Integer limit; + + @JsonProperty("sort_direction") + private SortDirection sortDirection; + + public QueryTransactionValidatorsRequest() {} + + public QueryTransactionValidatorsRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.transactionIds = builder.transactionIds; + this.cursor = builder.cursor; + this.limit = builder.limit; + this.sortDirection = builder.sortDirection; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String[] getTransactionIds() { + return transactionIds; + } + + public void setTransactionIds(String[] transactionIds) { + this.transactionIds = transactionIds; + } + + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public Integer getLimit() { + return limit; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public SortDirection getSortDirection() { + return sortDirection; + } + + public void setSortDirection(SortDirection sortDirection) { + this.sortDirection = sortDirection; + } + + public static class Builder { + private String portfolioId; + private String[] transactionIds; + private String cursor; + private Integer limit; + private SortDirection sortDirection; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder transactionIds(String[] transactionIds) { + this.transactionIds = transactionIds; + return this; + } + + public Builder cursor(String cursor) { + this.cursor = cursor; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder sortDirection(SortDirection sortDirection) { + this.sortDirection = sortDirection; + return this; + } + + public QueryTransactionValidatorsRequest build() throws CoinbaseClientException { + validate(); + return new QueryTransactionValidatorsRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsResponse.java b/src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsResponse.java new file mode 100644 index 00000000..9e758927 --- /dev/null +++ b/src/main/java/com/coinbase/prime/staking/QueryTransactionValidatorsResponse.java @@ -0,0 +1,52 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.staking; + +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.model.TransactionValidator; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Transaction Validators */ +public class QueryTransactionValidatorsResponse { + /** + * List of transaction-to-validator associations. Each entry represents one transaction staking to + * one validator. + */ + @JsonProperty("transaction_validators") + private TransactionValidator[] transactionValidators; + + @JsonProperty("pagination") + private Pagination pagination; + + public QueryTransactionValidatorsResponse() {} + + public TransactionValidator[] getTransactionValidators() { + return transactionValidators; + } + + public void setTransactionValidators(TransactionValidator[] transactionValidators) { + this.transactionValidators = transactionValidators; + } + + public Pagination getPagination() { + return pagination; + } + + public void setPagination(Pagination pagination) { + this.pagination = pagination; + } +} diff --git a/src/main/java/com/coinbase/prime/staking/StakingService.java b/src/main/java/com/coinbase/prime/staking/StakingService.java index ce387910..fe2d88af 100644 --- a/src/main/java/com/coinbase/prime/staking/StakingService.java +++ b/src/main/java/com/coinbase/prime/staking/StakingService.java @@ -31,6 +31,22 @@ public interface StakingService { * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + ClaimStakingRewardsResponse claimStakingRewards(ClaimStakingRewardsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Claim Wallet Staking Rewards (Alpha). + * + *

Request to claim staking rewards. This feature is in alpha. Please reach out to your + * Coinbase Prime account manager for more information + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use claimStakingRewards instead. + */ + @Deprecated ClaimRewardsResponse claimRewards(ClaimRewardsRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -72,6 +88,24 @@ CreateUnstakeResponse createUnstake(CreateUnstakeRequest request) * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + QueryTransactionValidatorsResponse queryTransactionValidators( + QueryTransactionValidatorsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Transaction Validators. + * + *

List ETH 0x02 validators associated with wallet-level stake transactions for a given + * portfolio. It will not return data for unstake transactions, portfolio stake transactions, + * transactions which staked different currencies, or which staked to Ethereum 0x01 validators + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use queryTransactionValidators instead. + */ + @Deprecated ListTransactionValidatorsResponse listTransactionValidators( ListTransactionValidatorsRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -88,6 +122,23 @@ ListTransactionValidatorsResponse listTransactionValidators( * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreatePortfolioStakeResponse createPortfolioStake(CreatePortfolioStakeRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Request to stake currency in a portfolio. + * + *

Creates an execution request to stake funds across a portfolio. This will stake funds in one + * or more wallets in the portfolio, with a total bondable balance up to the requested stake + * amount + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createPortfolioStake instead. + */ + @Deprecated PortfolioStakingInitiateResponse portfolioStakingInitiate(PortfolioStakingInitiateRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -103,6 +154,23 @@ PortfolioStakingInitiateResponse portfolioStakingInitiate(PortfolioStakingInitia * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreatePortfolioUnstakeResponse createPortfolioUnstake(CreatePortfolioUnstakeRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Request to unstake currency across a portfolio. + * + *

Creates an execution request to unstake funds across a portfolio. This will unstake funds in + * one or more wallets in the portfolio, with a total bonded balance up to the requested unstake + * amount + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createPortfolioUnstake instead. + */ + @Deprecated PortfolioStakingUnstakeResponse portfolioStakingUnstake(PortfolioStakingUnstakeRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/staking/StakingServiceImpl.java b/src/main/java/com/coinbase/prime/staking/StakingServiceImpl.java index faf45852..5e1465b5 100644 --- a/src/main/java/com/coinbase/prime/staking/StakingServiceImpl.java +++ b/src/main/java/com/coinbase/prime/staking/StakingServiceImpl.java @@ -28,6 +28,33 @@ public StakingServiceImpl(CoinbasePrimeClient client) { super(client); } + @Override + public ClaimStakingRewardsResponse claimStakingRewards(ClaimStakingRewardsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/wallets/%s/staking/claim_rewards", + request.getPortfolioId(), request.getWalletId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated + @Override + public ClaimRewardsResponse claimRewards(ClaimRewardsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/wallets/%s/staking/claim_rewards", + request.getPortfolioId(), request.getWalletId()), + request, + List.of(200), + new TypeReference() {}); + } + @Override public CreateStakeResponse createStake(CreateStakeRequest request) throws CoinbasePrimeException { return this.request( @@ -36,7 +63,7 @@ public CreateStakeResponse createStake(CreateStakeRequest request) throws Coinba "/portfolios/%s/wallets/%s/staking/initiate", request.getPortfolioId(), request.getWalletId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -49,10 +76,23 @@ public CreateUnstakeResponse createUnstake(CreateUnstakeRequest request) "/portfolios/%s/wallets/%s/staking/unstake", request.getPortfolioId(), request.getWalletId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } + @Override + public QueryTransactionValidatorsResponse queryTransactionValidators( + QueryTransactionValidatorsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/staking/transaction-validators/query", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public ListTransactionValidatorsResponse listTransactionValidators( ListTransactionValidatorsRequest request) throws CoinbasePrimeException { @@ -65,6 +105,18 @@ public ListTransactionValidatorsResponse listTransactionValidators( new TypeReference() {}); } + @Override + public CreatePortfolioStakeResponse createPortfolioStake(CreatePortfolioStakeRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format("/portfolios/%s/staking/initiate", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public PortfolioStakingInitiateResponse portfolioStakingInitiate( PortfolioStakingInitiateRequest request) throws CoinbasePrimeException { @@ -72,45 +124,44 @@ public PortfolioStakingInitiateResponse portfolioStakingInitiate( HttpMethod.POST, String.format("/portfolios/%s/staking/initiate", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @Override - public PortfolioStakingUnstakeResponse portfolioStakingUnstake( - PortfolioStakingUnstakeRequest request) throws CoinbasePrimeException { + public CreatePortfolioUnstakeResponse createPortfolioUnstake( + CreatePortfolioUnstakeRequest request) throws CoinbasePrimeException { return this.request( HttpMethod.POST, String.format("/portfolios/%s/staking/unstake", request.getPortfolioId()), request, - List.of(201, 200), - new TypeReference() {}); + List.of(200), + new TypeReference() {}); } + @Deprecated @Override - public ClaimRewardsResponse claimRewards(ClaimRewardsRequest request) - throws CoinbasePrimeException { + public PortfolioStakingUnstakeResponse portfolioStakingUnstake( + PortfolioStakingUnstakeRequest request) throws CoinbasePrimeException { return this.request( HttpMethod.POST, - String.format( - "/portfolios/%s/wallets/%s/staking/claim_rewards", - request.getPortfolioId(), request.getWalletId()), + String.format("/portfolios/%s/staking/unstake", request.getPortfolioId()), request, - List.of(201, 200), - new TypeReference() {}); + List.of(200), + new TypeReference() {}); } @Override - public PreviewUnstakeResponse previewUnstake(PreviewUnstakeRequest request) + public GetStakingStatusResponse getStakingStatus(GetStakingStatusRequest request) throws CoinbasePrimeException { return this.request( - HttpMethod.POST, + HttpMethod.GET, String.format( - "/portfolios/%s/wallets/%s/staking/unstake/preview", + "/portfolios/%s/wallets/%s/staking/status", request.getPortfolioId(), request.getWalletId()), request, - List.of(201, 200), - new TypeReference() {}); + List.of(200), + new TypeReference() {}); } @Override @@ -127,15 +178,15 @@ public GetUnstakingStatusResponse getUnstakingStatus(GetUnstakingStatusRequest r } @Override - public GetStakingStatusResponse getStakingStatus(GetStakingStatusRequest request) + public PreviewUnstakeResponse previewUnstake(PreviewUnstakeRequest request) throws CoinbasePrimeException { return this.request( - HttpMethod.GET, + HttpMethod.POST, String.format( - "/portfolios/%s/wallets/%s/staking/status", + "/portfolios/%s/wallets/%s/staking/unstake/preview", request.getPortfolioId(), request.getWalletId()), request, List.of(200), - new TypeReference() {}); + new TypeReference() {}); } } diff --git a/src/main/java/com/coinbase/prime/transactions/CreateTransferRequest.java b/src/main/java/com/coinbase/prime/transactions/CreateTransferRequest.java new file mode 100644 index 00000000..4075fe06 --- /dev/null +++ b/src/main/java/com/coinbase/prime/transactions/CreateTransferRequest.java @@ -0,0 +1,166 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.transactions; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Transfer */ +public class CreateTransferRequest { + /** The portfolio ID */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + /** The wallet ID that the transfer will originate from */ + @JsonProperty(required = true, value = "wallet_id") + @JsonIgnore + private String walletId; + + /** The amount in whole units to send */ + @JsonProperty("amount") + private String amount; + + /** The UUID of the destination wallet */ + @JsonProperty("destination") + private String destination; + + /** The idempotency key associated with this transfer */ + @JsonProperty("idempotency_key") + private String idempotencyKey; + + /** The currency symbol to transfer */ + @JsonProperty("currency_symbol") + private String currencySymbol; + + public CreateTransferRequest() {} + + public CreateTransferRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.walletId = builder.walletId; + this.amount = builder.amount; + this.destination = builder.destination; + this.idempotencyKey = builder.idempotencyKey; + this.currencySymbol = builder.currencySymbol; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getWalletId() { + return walletId; + } + + public void setWalletId(String walletId) { + this.walletId = walletId; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getDestination() { + return destination; + } + + public void setDestination(String destination) { + this.destination = destination; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + public String getCurrencySymbol() { + return currencySymbol; + } + + public void setCurrencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + } + + public static class Builder { + private String portfolioId; + private String walletId; + private String amount; + private String destination; + private String idempotencyKey; + private String currencySymbol; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder walletId(String walletId) { + this.walletId = walletId; + return this; + } + + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + public Builder destination(String destination) { + this.destination = destination; + return this; + } + + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public Builder currencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + return this; + } + + public CreateTransferRequest build() throws CoinbaseClientException { + validate(); + return new CreateTransferRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.walletId)) { + throw new CoinbaseClientException("WalletId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/transactions/CreateTransferResponse.java b/src/main/java/com/coinbase/prime/transactions/CreateTransferResponse.java new file mode 100644 index 00000000..d96da47a --- /dev/null +++ b/src/main/java/com/coinbase/prime/transactions/CreateTransferResponse.java @@ -0,0 +1,144 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.transactions; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Transfer */ +public class CreateTransferResponse { + /** The activity ID for the transfer */ + @JsonProperty("activity_id") + private String activityId; + + /** A URL to the activity associated with this transfer for approval */ + @JsonProperty("approval_url") + private String approvalUrl; + + /** The currency symbol of the transfer */ + @JsonProperty("symbol") + private String symbol; + + /** The amount of the transfer */ + @JsonProperty("amount") + private String amount; + + /** The network fee associated with the transfer */ + @JsonProperty("fee") + private String fee; + + /** The destination address of the transfer */ + @JsonProperty("destination_address") + private String destinationAddress; + + /** The destination type of the transfer */ + @JsonProperty("destination_type") + private String destinationType; + + /** The source address used for the transfer */ + @JsonProperty("source_address") + private String sourceAddress; + + /** The source type used for the transfer */ + @JsonProperty("source_type") + private String sourceType; + + /** The id of the just created transaction */ + @JsonProperty("transaction_id") + private String transactionId; + + public CreateTransferResponse() {} + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } + + public String getApprovalUrl() { + return approvalUrl; + } + + public void setApprovalUrl(String approvalUrl) { + this.approvalUrl = approvalUrl; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getFee() { + return fee; + } + + public void setFee(String fee) { + this.fee = fee; + } + + public String getDestinationAddress() { + return destinationAddress; + } + + public void setDestinationAddress(String destinationAddress) { + this.destinationAddress = destinationAddress; + } + + public String getDestinationType() { + return destinationType; + } + + public void setDestinationType(String destinationType) { + this.destinationType = destinationType; + } + + public String getSourceAddress() { + return sourceAddress; + } + + public void setSourceAddress(String sourceAddress) { + this.sourceAddress = sourceAddress; + } + + public String getSourceType() { + return sourceType; + } + + public void setSourceType(String sourceType) { + this.sourceType = sourceType; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } +} diff --git a/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferRequest.java b/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferRequest.java index 50f96239..bc9ca4e5 100644 --- a/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferRequest.java +++ b/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferRequest.java @@ -16,151 +16,66 @@ package com.coinbase.prime.transactions; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Transfer */ -public class CreateWalletTransferRequest { - /** The portfolio ID */ - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - /** The wallet ID that the transfer will originate from */ - @JsonProperty(required = true, value = "wallet_id") - @JsonIgnore - private String walletId; - - /** The amount in whole units to send */ - @JsonProperty("amount") - private String amount; - - /** The UUID of the destination wallet */ - @JsonProperty("destination") - private String destination; - - /** The idempotency key associated with this transfer */ - @JsonProperty("idempotency_key") - private String idempotencyKey; - - /** The currency symbol to transfer */ - @JsonProperty("currency_symbol") - private String currencySymbol; +/** + * Create Transfer + * + * @deprecated Use createTransfer instead. + */ +@Deprecated +public class CreateWalletTransferRequest extends CreateTransferRequest { public CreateWalletTransferRequest() {} - public CreateWalletTransferRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.walletId = builder.walletId; - this.amount = builder.amount; - this.destination = builder.destination; - this.idempotencyKey = builder.idempotencyKey; - this.currencySymbol = builder.currencySymbol; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getWalletId() { - return walletId; - } - - public void setWalletId(String walletId) { - this.walletId = walletId; - } - - public String getAmount() { - return amount; + public CreateWalletTransferRequest(CreateTransferRequest.Builder builder) { + super(builder); } - public void setAmount(String amount) { - this.amount = amount; - } - - public String getDestination() { - return destination; - } - - public void setDestination(String destination) { - this.destination = destination; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public void setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - } - - public String getCurrencySymbol() { - return currencySymbol; - } - - public void setCurrencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; - } - - public static class Builder { - private String portfolioId; - private String walletId; - private String amount; - private String destination; - private String idempotencyKey; - private String currencySymbol; - - public Builder() {} - + /** + * @deprecated Use createTransfer instead. + */ + @Deprecated + public static class Builder extends CreateTransferRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder walletId(String walletId) { - this.walletId = walletId; + super.walletId(walletId); return this; } + @Override public Builder amount(String amount) { - this.amount = amount; + super.amount(amount); return this; } + @Override public Builder destination(String destination) { - this.destination = destination; + super.destination(destination); return this; } + @Override public Builder idempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + super.idempotencyKey(idempotencyKey); return this; } + @Override public Builder currencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; + super.currencySymbol(currencySymbol); return this; } + @Override public CreateWalletTransferRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new CreateWalletTransferRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - if (isNullOrEmpty(this.walletId)) { - throw new CoinbaseClientException("WalletId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferResponse.java b/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferResponse.java index f45ede5b..72291f4d 100644 --- a/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferResponse.java +++ b/src/main/java/com/coinbase/prime/transactions/CreateWalletTransferResponse.java @@ -16,129 +16,12 @@ package com.coinbase.prime.transactions; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Transfer */ -public class CreateWalletTransferResponse { - /** The activity ID for the transfer */ - @JsonProperty("activity_id") - private String activityId; - - /** A URL to the activity associated with this transfer for approval */ - @JsonProperty("approval_url") - private String approvalUrl; - - /** The currency symbol of the transfer */ - @JsonProperty("symbol") - private String symbol; - - /** The amount of the transfer */ - @JsonProperty("amount") - private String amount; - - /** The network fee associated with the transfer */ - @JsonProperty("fee") - private String fee; - - /** The destination address of the transfer */ - @JsonProperty("destination_address") - private String destinationAddress; - - /** The destination type of the transfer */ - @JsonProperty("destination_type") - private String destinationType; - - /** The source address used for the transfer */ - @JsonProperty("source_address") - private String sourceAddress; - - /** The source type used for the transfer */ - @JsonProperty("source_type") - private String sourceType; - - /** The id of the just created transaction */ - @JsonProperty("transaction_id") - private String transactionId; - +/** + * Create Transfer + * + * @deprecated Use createTransfer instead. + */ +@Deprecated +public class CreateWalletTransferResponse extends CreateTransferResponse { public CreateWalletTransferResponse() {} - - public String getActivityId() { - return activityId; - } - - public void setActivityId(String activityId) { - this.activityId = activityId; - } - - public String getApprovalUrl() { - return approvalUrl; - } - - public void setApprovalUrl(String approvalUrl) { - this.approvalUrl = approvalUrl; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public String getFee() { - return fee; - } - - public void setFee(String fee) { - this.fee = fee; - } - - public String getDestinationAddress() { - return destinationAddress; - } - - public void setDestinationAddress(String destinationAddress) { - this.destinationAddress = destinationAddress; - } - - public String getDestinationType() { - return destinationType; - } - - public void setDestinationType(String destinationType) { - this.destinationType = destinationType; - } - - public String getSourceAddress() { - return sourceAddress; - } - - public void setSourceAddress(String sourceAddress) { - this.sourceAddress = sourceAddress; - } - - public String getSourceType() { - return sourceType; - } - - public void setSourceType(String sourceType) { - this.sourceType = sourceType; - } - - public String getTransactionId() { - return transactionId; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } } diff --git a/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalRequest.java b/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalRequest.java index 714455cd..cc74fb2f 100644 --- a/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalRequest.java +++ b/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalRequest.java @@ -16,235 +16,95 @@ package com.coinbase.prime.transactions; -import static com.coinbase.core.utils.Utils.isNullOrEmpty; - import com.coinbase.core.errors.CoinbaseClientException; import com.coinbase.prime.model.BlockchainAddress; import com.coinbase.prime.model.CounterpartyDestination; import com.coinbase.prime.model.PaymentMethodDestination; import com.coinbase.prime.model.TravelRuleData; import com.coinbase.prime.model.enums.DestinationType; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Withdrawal */ -public class CreateWalletWithdrawalRequest { - /** The portfolio ID */ - @JsonProperty(required = true, value = "portfolio_id") - @JsonIgnore - private String portfolioId; - - /** The wallet ID */ - @JsonProperty(required = true, value = "wallet_id") - @JsonIgnore - private String walletId; - - /** The amount in whole units of the withdrawal */ - @JsonProperty("amount") - private String amount; - - /** - * - UNKNOWN_DESTINATION: nil value - DESTINATION_PAYMENT_METHOD: A fiat bank account linked to a - * payment method id via Payment Method Service - DESTINATION_BLOCKCHAIN: A blockchain network - * address - DESTINATION_WALLET: An on platform wallet UUID NOTE: this is not usable in the - * withdrawals endpoint only transfers - DESTINATION_COUNTERPARTY: Counterparty ID - */ - @JsonProperty("destination_type") - private DestinationType destinationType; - - /** The idempotency key associated with the withdrawal */ - @JsonProperty("idempotency_key") - private String idempotencyKey; - - /** The currency symbol for the withdrawal */ - @JsonProperty("currency_symbol") - private String currencySymbol; - - @JsonProperty("payment_method") - private PaymentMethodDestination paymentMethod; - - @JsonProperty("blockchain_address") - private BlockchainAddress blockchainAddress; - - /** Represents a destination for a counterparty payment */ - @JsonProperty("counterparty") - private CounterpartyDestination counterparty; - - /** Data object used for withdrawals. */ - @JsonProperty("travel_rule_data") - private TravelRuleData travelRuleData; +/** + * Create Withdrawal + * + * @deprecated Use createWithdrawal instead. + */ +@Deprecated +public class CreateWalletWithdrawalRequest extends CreateWithdrawalRequest { public CreateWalletWithdrawalRequest() {} - public CreateWalletWithdrawalRequest(Builder builder) { - this.portfolioId = builder.portfolioId; - this.walletId = builder.walletId; - this.amount = builder.amount; - this.destinationType = builder.destinationType; - this.idempotencyKey = builder.idempotencyKey; - this.currencySymbol = builder.currencySymbol; - this.paymentMethod = builder.paymentMethod; - this.blockchainAddress = builder.blockchainAddress; - this.counterparty = builder.counterparty; - this.travelRuleData = builder.travelRuleData; - } - - public String getPortfolioId() { - return portfolioId; - } - - public void setPortfolioId(String portfolioId) { - this.portfolioId = portfolioId; - } - - public String getWalletId() { - return walletId; - } - - public void setWalletId(String walletId) { - this.walletId = walletId; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public DestinationType getDestinationType() { - return destinationType; - } - - public void setDestinationType(DestinationType destinationType) { - this.destinationType = destinationType; + public CreateWalletWithdrawalRequest(CreateWithdrawalRequest.Builder builder) { + super(builder); } - public String getIdempotencyKey() { - return idempotencyKey; - } - - public void setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - } - - public String getCurrencySymbol() { - return currencySymbol; - } - - public void setCurrencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; - } - - public PaymentMethodDestination getPaymentMethod() { - return paymentMethod; - } - - public void setPaymentMethod(PaymentMethodDestination paymentMethod) { - this.paymentMethod = paymentMethod; - } - - public BlockchainAddress getBlockchainAddress() { - return blockchainAddress; - } - - public void setBlockchainAddress(BlockchainAddress blockchainAddress) { - this.blockchainAddress = blockchainAddress; - } - - public CounterpartyDestination getCounterparty() { - return counterparty; - } - - public void setCounterparty(CounterpartyDestination counterparty) { - this.counterparty = counterparty; - } - - public TravelRuleData getTravelRuleData() { - return travelRuleData; - } - - public void setTravelRuleData(TravelRuleData travelRuleData) { - this.travelRuleData = travelRuleData; - } - - public static class Builder { - private String portfolioId; - private String walletId; - private String amount; - private DestinationType destinationType; - private String idempotencyKey; - private String currencySymbol; - private PaymentMethodDestination paymentMethod; - private BlockchainAddress blockchainAddress; - private CounterpartyDestination counterparty; - private TravelRuleData travelRuleData; - - public Builder() {} - + /** + * @deprecated Use createWithdrawal instead. + */ + @Deprecated + public static class Builder extends CreateWithdrawalRequest.Builder { + @Override public Builder portfolioId(String portfolioId) { - this.portfolioId = portfolioId; + super.portfolioId(portfolioId); return this; } + @Override public Builder walletId(String walletId) { - this.walletId = walletId; + super.walletId(walletId); return this; } + @Override public Builder amount(String amount) { - this.amount = amount; + super.amount(amount); return this; } + @Override public Builder destinationType(DestinationType destinationType) { - this.destinationType = destinationType; + super.destinationType(destinationType); return this; } + @Override public Builder idempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + super.idempotencyKey(idempotencyKey); return this; } + @Override public Builder currencySymbol(String currencySymbol) { - this.currencySymbol = currencySymbol; + super.currencySymbol(currencySymbol); return this; } + @Override public Builder paymentMethod(PaymentMethodDestination paymentMethod) { - this.paymentMethod = paymentMethod; + super.paymentMethod(paymentMethod); return this; } + @Override public Builder blockchainAddress(BlockchainAddress blockchainAddress) { - this.blockchainAddress = blockchainAddress; + super.blockchainAddress(blockchainAddress); return this; } + @Override public Builder counterparty(CounterpartyDestination counterparty) { - this.counterparty = counterparty; + super.counterparty(counterparty); return this; } + @Override public Builder travelRuleData(TravelRuleData travelRuleData) { - this.travelRuleData = travelRuleData; + super.travelRuleData(travelRuleData); return this; } + @Override public CreateWalletWithdrawalRequest build() throws CoinbaseClientException { - validate(); + super.validate(); return new CreateWalletWithdrawalRequest(this); } - - private void validate() throws CoinbaseClientException { - if (isNullOrEmpty(this.portfolioId)) { - throw new CoinbaseClientException("PortfolioId is required"); - } - if (isNullOrEmpty(this.walletId)) { - throw new CoinbaseClientException("WalletId is required"); - } - } } } diff --git a/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalResponse.java b/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalResponse.java index 1ea5f965..494425c3 100644 --- a/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalResponse.java +++ b/src/main/java/com/coinbase/prime/transactions/CreateWalletWithdrawalResponse.java @@ -16,141 +16,12 @@ package com.coinbase.prime.transactions; -import com.coinbase.prime.model.BlockchainAddress; -import com.coinbase.prime.model.CounterpartyDestination; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Create Withdrawal */ -public class CreateWalletWithdrawalResponse { - /** The activity ID associated with the withdrawal */ - @JsonProperty("activity_id") - private String activityId; - - /** A URL to the activity in the Prime application */ - @JsonProperty("approval_url") - private String approvalUrl; - - /** The currency symbol associated with the withdrawal */ - @JsonProperty("symbol") - private String symbol; - - /** The amount of the withdrawal */ - @JsonProperty("amount") - private String amount; - - /** The network fee associated with the withdrawal */ - @JsonProperty("fee") - private String fee; - - /** The destination type used for the withdrawal */ - @JsonProperty("destination_type") - private String destinationType; - - /** The source type used for the withdrawal */ - @JsonProperty("source_type") - private String sourceType; - - @JsonProperty("blockchain_destination") - private BlockchainAddress blockchainDestination; - - /** Represents a destination for a counterparty payment */ - @JsonProperty("counterparty_destination") - private CounterpartyDestination counterpartyDestination; - - @JsonProperty("blockchain_source") - private BlockchainAddress blockchainSource; - - /** The id of the just created transaction */ - @JsonProperty("transaction_id") - private String transactionId; - +/** + * Create Withdrawal + * + * @deprecated Use createWithdrawal instead. + */ +@Deprecated +public class CreateWalletWithdrawalResponse extends CreateWithdrawalResponse { public CreateWalletWithdrawalResponse() {} - - public String getActivityId() { - return activityId; - } - - public void setActivityId(String activityId) { - this.activityId = activityId; - } - - public String getApprovalUrl() { - return approvalUrl; - } - - public void setApprovalUrl(String approvalUrl) { - this.approvalUrl = approvalUrl; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public String getAmount() { - return amount; - } - - public void setAmount(String amount) { - this.amount = amount; - } - - public String getFee() { - return fee; - } - - public void setFee(String fee) { - this.fee = fee; - } - - public String getDestinationType() { - return destinationType; - } - - public void setDestinationType(String destinationType) { - this.destinationType = destinationType; - } - - public String getSourceType() { - return sourceType; - } - - public void setSourceType(String sourceType) { - this.sourceType = sourceType; - } - - public BlockchainAddress getBlockchainDestination() { - return blockchainDestination; - } - - public void setBlockchainDestination(BlockchainAddress blockchainDestination) { - this.blockchainDestination = blockchainDestination; - } - - public CounterpartyDestination getCounterpartyDestination() { - return counterpartyDestination; - } - - public void setCounterpartyDestination(CounterpartyDestination counterpartyDestination) { - this.counterpartyDestination = counterpartyDestination; - } - - public BlockchainAddress getBlockchainSource() { - return blockchainSource; - } - - public void setBlockchainSource(BlockchainAddress blockchainSource) { - this.blockchainSource = blockchainSource; - } - - public String getTransactionId() { - return transactionId; - } - - public void setTransactionId(String transactionId) { - this.transactionId = transactionId; - } } diff --git a/src/main/java/com/coinbase/prime/transactions/CreateWithdrawalRequest.java b/src/main/java/com/coinbase/prime/transactions/CreateWithdrawalRequest.java new file mode 100644 index 00000000..627ca002 --- /dev/null +++ b/src/main/java/com/coinbase/prime/transactions/CreateWithdrawalRequest.java @@ -0,0 +1,250 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.transactions; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.BlockchainAddress; +import com.coinbase.prime.model.CounterpartyDestination; +import com.coinbase.prime.model.PaymentMethodDestination; +import com.coinbase.prime.model.TravelRuleData; +import com.coinbase.prime.model.enums.DestinationType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Withdrawal */ +public class CreateWithdrawalRequest { + /** The portfolio ID */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + /** The wallet ID */ + @JsonProperty(required = true, value = "wallet_id") + @JsonIgnore + private String walletId; + + /** The amount in whole units of the withdrawal */ + @JsonProperty("amount") + private String amount; + + /** + * - UNKNOWN_DESTINATION: nil value - DESTINATION_PAYMENT_METHOD: A fiat bank account linked to a + * payment method id via Payment Method Service - DESTINATION_BLOCKCHAIN: A blockchain network + * address - DESTINATION_WALLET: An on platform wallet UUID NOTE: this is not usable in the + * withdrawals endpoint only transfers - DESTINATION_COUNTERPARTY: Counterparty ID + */ + @JsonProperty("destination_type") + private DestinationType destinationType; + + /** The idempotency key associated with the withdrawal */ + @JsonProperty("idempotency_key") + private String idempotencyKey; + + /** The currency symbol for the withdrawal */ + @JsonProperty("currency_symbol") + private String currencySymbol; + + @JsonProperty("payment_method") + private PaymentMethodDestination paymentMethod; + + @JsonProperty("blockchain_address") + private BlockchainAddress blockchainAddress; + + /** Represents a destination for a counterparty payment */ + @JsonProperty("counterparty") + private CounterpartyDestination counterparty; + + /** Data object used for withdrawals. */ + @JsonProperty("travel_rule_data") + private TravelRuleData travelRuleData; + + public CreateWithdrawalRequest() {} + + public CreateWithdrawalRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.walletId = builder.walletId; + this.amount = builder.amount; + this.destinationType = builder.destinationType; + this.idempotencyKey = builder.idempotencyKey; + this.currencySymbol = builder.currencySymbol; + this.paymentMethod = builder.paymentMethod; + this.blockchainAddress = builder.blockchainAddress; + this.counterparty = builder.counterparty; + this.travelRuleData = builder.travelRuleData; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getWalletId() { + return walletId; + } + + public void setWalletId(String walletId) { + this.walletId = walletId; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public DestinationType getDestinationType() { + return destinationType; + } + + public void setDestinationType(DestinationType destinationType) { + this.destinationType = destinationType; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + public String getCurrencySymbol() { + return currencySymbol; + } + + public void setCurrencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + } + + public PaymentMethodDestination getPaymentMethod() { + return paymentMethod; + } + + public void setPaymentMethod(PaymentMethodDestination paymentMethod) { + this.paymentMethod = paymentMethod; + } + + public BlockchainAddress getBlockchainAddress() { + return blockchainAddress; + } + + public void setBlockchainAddress(BlockchainAddress blockchainAddress) { + this.blockchainAddress = blockchainAddress; + } + + public CounterpartyDestination getCounterparty() { + return counterparty; + } + + public void setCounterparty(CounterpartyDestination counterparty) { + this.counterparty = counterparty; + } + + public TravelRuleData getTravelRuleData() { + return travelRuleData; + } + + public void setTravelRuleData(TravelRuleData travelRuleData) { + this.travelRuleData = travelRuleData; + } + + public static class Builder { + private String portfolioId; + private String walletId; + private String amount; + private DestinationType destinationType; + private String idempotencyKey; + private String currencySymbol; + private PaymentMethodDestination paymentMethod; + private BlockchainAddress blockchainAddress; + private CounterpartyDestination counterparty; + private TravelRuleData travelRuleData; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder walletId(String walletId) { + this.walletId = walletId; + return this; + } + + public Builder amount(String amount) { + this.amount = amount; + return this; + } + + public Builder destinationType(DestinationType destinationType) { + this.destinationType = destinationType; + return this; + } + + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public Builder currencySymbol(String currencySymbol) { + this.currencySymbol = currencySymbol; + return this; + } + + public Builder paymentMethod(PaymentMethodDestination paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + public Builder blockchainAddress(BlockchainAddress blockchainAddress) { + this.blockchainAddress = blockchainAddress; + return this; + } + + public Builder counterparty(CounterpartyDestination counterparty) { + this.counterparty = counterparty; + return this; + } + + public Builder travelRuleData(TravelRuleData travelRuleData) { + this.travelRuleData = travelRuleData; + return this; + } + + public CreateWithdrawalRequest build() throws CoinbaseClientException { + validate(); + return new CreateWithdrawalRequest(this); + } + + protected void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.walletId)) { + throw new CoinbaseClientException("WalletId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/transactions/CreateWithdrawalResponse.java b/src/main/java/com/coinbase/prime/transactions/CreateWithdrawalResponse.java new file mode 100644 index 00000000..26d792f7 --- /dev/null +++ b/src/main/java/com/coinbase/prime/transactions/CreateWithdrawalResponse.java @@ -0,0 +1,156 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.transactions; + +import com.coinbase.prime.model.BlockchainAddress; +import com.coinbase.prime.model.CounterpartyDestination; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Withdrawal */ +public class CreateWithdrawalResponse { + /** The activity ID associated with the withdrawal */ + @JsonProperty("activity_id") + private String activityId; + + /** A URL to the activity in the Prime application */ + @JsonProperty("approval_url") + private String approvalUrl; + + /** The currency symbol associated with the withdrawal */ + @JsonProperty("symbol") + private String symbol; + + /** The amount of the withdrawal */ + @JsonProperty("amount") + private String amount; + + /** The network fee associated with the withdrawal */ + @JsonProperty("fee") + private String fee; + + /** The destination type used for the withdrawal */ + @JsonProperty("destination_type") + private String destinationType; + + /** The source type used for the withdrawal */ + @JsonProperty("source_type") + private String sourceType; + + @JsonProperty("blockchain_destination") + private BlockchainAddress blockchainDestination; + + /** Represents a destination for a counterparty payment */ + @JsonProperty("counterparty_destination") + private CounterpartyDestination counterpartyDestination; + + @JsonProperty("blockchain_source") + private BlockchainAddress blockchainSource; + + /** The id of the just created transaction */ + @JsonProperty("transaction_id") + private String transactionId; + + public CreateWithdrawalResponse() {} + + public String getActivityId() { + return activityId; + } + + public void setActivityId(String activityId) { + this.activityId = activityId; + } + + public String getApprovalUrl() { + return approvalUrl; + } + + public void setApprovalUrl(String approvalUrl) { + this.approvalUrl = approvalUrl; + } + + public String getSymbol() { + return symbol; + } + + public void setSymbol(String symbol) { + this.symbol = symbol; + } + + public String getAmount() { + return amount; + } + + public void setAmount(String amount) { + this.amount = amount; + } + + public String getFee() { + return fee; + } + + public void setFee(String fee) { + this.fee = fee; + } + + public String getDestinationType() { + return destinationType; + } + + public void setDestinationType(String destinationType) { + this.destinationType = destinationType; + } + + public String getSourceType() { + return sourceType; + } + + public void setSourceType(String sourceType) { + this.sourceType = sourceType; + } + + public BlockchainAddress getBlockchainDestination() { + return blockchainDestination; + } + + public void setBlockchainDestination(BlockchainAddress blockchainDestination) { + this.blockchainDestination = blockchainDestination; + } + + public CounterpartyDestination getCounterpartyDestination() { + return counterpartyDestination; + } + + public void setCounterpartyDestination(CounterpartyDestination counterpartyDestination) { + this.counterpartyDestination = counterpartyDestination; + } + + public BlockchainAddress getBlockchainSource() { + return blockchainSource; + } + + public void setBlockchainSource(BlockchainAddress blockchainSource) { + this.blockchainSource = blockchainSource; + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId; + } +} diff --git a/src/main/java/com/coinbase/prime/transactions/TransactionsService.java b/src/main/java/com/coinbase/prime/transactions/TransactionsService.java index dd114501..00c5d078 100644 --- a/src/main/java/com/coinbase/prime/transactions/TransactionsService.java +++ b/src/main/java/com/coinbase/prime/transactions/TransactionsService.java @@ -96,6 +96,21 @@ ListWalletTransactionsResponse listWalletTransactions(ListWalletTransactionsRequ * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreateTransferResponse createTransfer(CreateTransferRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Create Transfer. + * + *

Create a wallet transfer + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createTransfer instead. + */ + @Deprecated CreateWalletTransferResponse createWalletTransfer(CreateWalletTransferRequest request) throws CoinbaseClientException, CoinbasePrimeException; @@ -109,6 +124,21 @@ CreateWalletTransferResponse createWalletTransfer(CreateWalletTransferRequest re * @throws CoinbaseClientException if the request fails client-side validation * @throws CoinbasePrimeException if the Prime API returns an error response */ + CreateWithdrawalResponse createWithdrawal(CreateWithdrawalRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Create Withdrawal. + * + *

Create a withdrawal + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + * @deprecated Use createWithdrawal instead. + */ + @Deprecated CreateWalletWithdrawalResponse createWalletWithdrawal(CreateWalletWithdrawalRequest request) throws CoinbaseClientException, CoinbasePrimeException; diff --git a/src/main/java/com/coinbase/prime/transactions/TransactionsServiceImpl.java b/src/main/java/com/coinbase/prime/transactions/TransactionsServiceImpl.java index 681c07db..f78845b5 100644 --- a/src/main/java/com/coinbase/prime/transactions/TransactionsServiceImpl.java +++ b/src/main/java/com/coinbase/prime/transactions/TransactionsServiceImpl.java @@ -60,7 +60,7 @@ public CreateConversionResponse createConversion(CreateConversionRequest request "/portfolios/%s/wallets/%s/conversion", request.getPortfolioId(), request.getWalletId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -73,7 +73,7 @@ public CreateOnchainTransactionResponse createOnchainTransaction( "/portfolios/%s/wallets/%s/onchain_transaction", request.getPortfolioId(), request.getWalletId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -90,6 +90,19 @@ public ListWalletTransactionsResponse listWalletTransactions( new TypeReference() {}); } + @Override + public CreateTransferResponse createTransfer(CreateTransferRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/wallets/%s/transfers", request.getPortfolioId(), request.getWalletId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public CreateWalletTransferResponse createWalletTransfer(CreateWalletTransferRequest request) throws CoinbasePrimeException { @@ -102,6 +115,20 @@ public CreateWalletTransferResponse createWalletTransfer(CreateWalletTransferReq new TypeReference() {}); } + @Override + public CreateWithdrawalResponse createWithdrawal(CreateWithdrawalRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/wallets/%s/withdrawals", + request.getPortfolioId(), request.getWalletId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Deprecated @Override public CreateWalletWithdrawalResponse createWalletWithdrawal( CreateWalletWithdrawalRequest request) throws CoinbasePrimeException { @@ -137,7 +164,7 @@ public SubmitDepositTravelRuleDataResponse submitDepositTravelRuleData( "/portfolios/%s/transactions/%s/travel_rule/deposit", request.getPortfolioId(), request.getTransactionId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } } diff --git a/src/main/java/com/coinbase/prime/utils/Constants.java b/src/main/java/com/coinbase/prime/utils/Constants.java index 3d0784e7..e66dd404 100644 --- a/src/main/java/com/coinbase/prime/utils/Constants.java +++ b/src/main/java/com/coinbase/prime/utils/Constants.java @@ -23,7 +23,7 @@ public class Constants { public static final String CB_ACCESS_TIMESTAMP_HEADER = "X-CB-ACCESS-TIMESTAMP"; public static final String CB_USER_AGENT_HEADER = "User-Agent"; public static final String CB_PRIME_BASE_URL = "https://api.prime.coinbase.com/v1"; - public static final String SDK_VERSION = "1.11.0"; + public static final String SDK_VERSION = "1.12.0"; /** * Replaces a trailing {@code /vN} segment with {@code /}{@code version}. Used when an endpoint is diff --git a/src/main/java/com/coinbase/prime/wallets/WalletsServiceImpl.java b/src/main/java/com/coinbase/prime/wallets/WalletsServiceImpl.java index 169672ee..a767d057 100644 --- a/src/main/java/com/coinbase/prime/wallets/WalletsServiceImpl.java +++ b/src/main/java/com/coinbase/prime/wallets/WalletsServiceImpl.java @@ -45,7 +45,7 @@ public CreateWalletResponse createWallet(CreateWalletRequest request) HttpMethod.POST, String.format("/portfolios/%s/wallets", request.getPortfolioId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } @@ -79,7 +79,7 @@ public CreateWalletDepositAddressResponse createWalletDepositAddress( String.format( "/portfolios/%s/wallets/%s/addresses", request.getPortfolioId(), request.getWalletId()), request, - List.of(201, 200), + List.of(200), new TypeReference() {}); } diff --git a/src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionRequest.java b/src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionRequest.java new file mode 100644 index 00000000..2755ef45 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionRequest.java @@ -0,0 +1,196 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.WebhookOAuthConfigInput; +import com.coinbase.prime.model.enums.WebhookAuthType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Create Webhook Subscription */ +public class CreateWebhookSubscriptionRequest { + /** Populated from the URL path. */ + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("event_types") + private String[] eventTypes; + + @JsonProperty("target_url") + private String targetUrl; + + @JsonProperty("auth_type") + private WebhookAuthType authType; + + @JsonProperty("oauth_config") + private WebhookOAuthConfigInput oauthConfig; + + @JsonProperty("custom_headers") + private Map customHeaders; + + @JsonProperty("description") + private String description; + + @JsonProperty("idempotency_key") + private String idempotencyKey; + + public CreateWebhookSubscriptionRequest() {} + + public CreateWebhookSubscriptionRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.eventTypes = builder.eventTypes; + this.targetUrl = builder.targetUrl; + this.authType = builder.authType; + this.oauthConfig = builder.oauthConfig; + this.customHeaders = builder.customHeaders; + this.description = builder.description; + this.idempotencyKey = builder.idempotencyKey; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String[] getEventTypes() { + return eventTypes; + } + + public void setEventTypes(String[] eventTypes) { + this.eventTypes = eventTypes; + } + + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } + + public WebhookAuthType getAuthType() { + return authType; + } + + public void setAuthType(WebhookAuthType authType) { + this.authType = authType; + } + + public WebhookOAuthConfigInput getOauthConfig() { + return oauthConfig; + } + + public void setOauthConfig(WebhookOAuthConfigInput oauthConfig) { + this.oauthConfig = oauthConfig; + } + + public Map getCustomHeaders() { + return customHeaders; + } + + public void setCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public void setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + } + + public static class Builder { + private String portfolioId; + private String[] eventTypes; + private String targetUrl; + private WebhookAuthType authType; + private WebhookOAuthConfigInput oauthConfig; + private Map customHeaders; + private String description; + private String idempotencyKey; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder eventTypes(String[] eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder targetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + public Builder authType(WebhookAuthType authType) { + this.authType = authType; + return this; + } + + public Builder oauthConfig(WebhookOAuthConfigInput oauthConfig) { + this.oauthConfig = oauthConfig; + return this; + } + + public Builder customHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder idempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public CreateWebhookSubscriptionRequest build() throws CoinbaseClientException { + validate(); + return new CreateWebhookSubscriptionRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionResponse.java b/src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionResponse.java new file mode 100644 index 00000000..6e1e5f63 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/CreateWebhookSubscriptionResponse.java @@ -0,0 +1,51 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookSubscription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Create Webhook Subscription */ +public class CreateWebhookSubscriptionResponse { + @JsonProperty("subscription") + private WebhookSubscription subscription; + + /** + * hmac_secret is the plaintext HMAC signing secret. Returned exactly once on creation; store it + * securely — it is never surfaced again. + */ + @JsonProperty("hmac_secret") + private String hmacSecret; + + public CreateWebhookSubscriptionResponse() {} + + public WebhookSubscription getSubscription() { + return subscription; + } + + public void setSubscription(WebhookSubscription subscription) { + this.subscription = subscription; + } + + public String getHmacSecret() { + return hmacSecret; + } + + public void setHmacSecret(String hmacSecret) { + this.hmacSecret = hmacSecret; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionRequest.java b/src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionRequest.java new file mode 100644 index 00000000..b9b09ff4 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionRequest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Delete Webhook Subscription */ +public class DeleteWebhookSubscriptionRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + public DeleteWebhookSubscriptionRequest() {} + + public DeleteWebhookSubscriptionRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public DeleteWebhookSubscriptionRequest build() throws CoinbaseClientException { + validate(); + return new DeleteWebhookSubscriptionRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionResponse.java b/src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionResponse.java new file mode 100644 index 00000000..3a19ad01 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/DeleteWebhookSubscriptionResponse.java @@ -0,0 +1,22 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +/** Delete Webhook Subscription */ +public class DeleteWebhookSubscriptionResponse { + public DeleteWebhookSubscriptionResponse() {} +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsRequest.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsRequest.java new file mode 100644 index 00000000..1909649f --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsRequest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Delivery Attempts */ +public class GetWebhookDeliveryAttemptsRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + @JsonProperty(required = true, value = "event_id") + @JsonIgnore + private String eventId; + + public GetWebhookDeliveryAttemptsRequest() {} + + public GetWebhookDeliveryAttemptsRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + this.eventId = builder.eventId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + private String eventId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder eventId(String eventId) { + this.eventId = eventId; + return this; + } + + public GetWebhookDeliveryAttemptsRequest build() throws CoinbaseClientException { + validate(); + return new GetWebhookDeliveryAttemptsRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + if (isNullOrEmpty(this.eventId)) { + throw new CoinbaseClientException("EventId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsResponse.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsResponse.java new file mode 100644 index 00000000..8f8d6c6f --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryAttemptsResponse.java @@ -0,0 +1,93 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookDeliveryAttempt; +import com.coinbase.prime.model.enums.WebhookDeliveryStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Delivery Attempts */ +public class GetWebhookDeliveryAttemptsResponse { + @JsonProperty("event_id") + private String eventId; + + @JsonProperty("event_type") + private String eventType; + + @JsonProperty("subscription_id") + private String subscriptionId; + + @JsonProperty("delivery_status") + private WebhookDeliveryStatus deliveryStatus; + + @JsonProperty("attempts") + private WebhookDeliveryAttempt[] attempts; + + /** event_payload is the raw JSON bytes delivered to the subscriber. */ + @JsonProperty("event_payload") + private String eventPayload; + + public GetWebhookDeliveryAttemptsResponse() {} + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public WebhookDeliveryStatus getDeliveryStatus() { + return deliveryStatus; + } + + public void setDeliveryStatus(WebhookDeliveryStatus deliveryStatus) { + this.deliveryStatus = deliveryStatus; + } + + public WebhookDeliveryAttempt[] getAttempts() { + return attempts; + } + + public void setAttempts(WebhookDeliveryAttempt[] attempts) { + this.attempts = attempts; + } + + public String getEventPayload() { + return eventPayload; + } + + public void setEventPayload(String eventPayload) { + this.eventPayload = eventPayload; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsRequest.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsRequest.java new file mode 100644 index 00000000..0e038aa7 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsRequest.java @@ -0,0 +1,143 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.common.PrimeListRequest; +import com.coinbase.prime.model.enums.SortDirection; +import com.coinbase.prime.model.enums.WebhookDeliveryStatus; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Delivery Logs */ +public class GetWebhookDeliveryLogsRequest extends PrimeListRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + @JsonProperty("status_filter") + private WebhookDeliveryStatus statusFilter; + + @JsonProperty("event_type_filter") + private String eventTypeFilter; + + public GetWebhookDeliveryLogsRequest() {} + + public GetWebhookDeliveryLogsRequest(Builder builder) { + super(builder.cursor, builder.sortDirection, builder.limit); + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + this.statusFilter = builder.statusFilter; + this.eventTypeFilter = builder.eventTypeFilter; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public WebhookDeliveryStatus getStatusFilter() { + return statusFilter; + } + + public void setStatusFilter(WebhookDeliveryStatus statusFilter) { + this.statusFilter = statusFilter; + } + + public String getEventTypeFilter() { + return eventTypeFilter; + } + + public void setEventTypeFilter(String eventTypeFilter) { + this.eventTypeFilter = eventTypeFilter; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + private WebhookDeliveryStatus statusFilter; + private String eventTypeFilter; + private String cursor; + private SortDirection sortDirection; + private Integer limit; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder statusFilter(WebhookDeliveryStatus statusFilter) { + this.statusFilter = statusFilter; + return this; + } + + public Builder eventTypeFilter(String eventTypeFilter) { + this.eventTypeFilter = eventTypeFilter; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder pagination(Pagination pagination) { + this.cursor = pagination.getNextCursor(); + this.sortDirection = pagination.getSortDirection(); + return this; + } + + public GetWebhookDeliveryLogsRequest build() throws CoinbaseClientException { + validate(); + return new GetWebhookDeliveryLogsRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsResponse.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsResponse.java new file mode 100644 index 00000000..8c6ee7a2 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookDeliveryLogsResponse.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookDeliveryLogEntry; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Delivery Logs */ +public class GetWebhookDeliveryLogsResponse { + @JsonProperty("entries") + private WebhookDeliveryLogEntry[] entries; + + @JsonProperty("next_cursor") + private String nextCursor; + + @JsonProperty("has_next") + private Boolean hasNext; + + public GetWebhookDeliveryLogsResponse() {} + + public WebhookDeliveryLogEntry[] getEntries() { + return entries; + } + + public void setEntries(WebhookDeliveryLogEntry[] entries) { + this.entries = entries; + } + + public String getNextCursor() { + return nextCursor; + } + + public void setNextCursor(String nextCursor) { + this.nextCursor = nextCursor; + } + + public Boolean getHasNext() { + return hasNext; + } + + public void setHasNext(Boolean hasNext) { + this.hasNext = hasNext; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookEventTypesResponse.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookEventTypesResponse.java new file mode 100644 index 00000000..3e0af9c3 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookEventTypesResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookEventType; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Event Types */ +public class GetWebhookEventTypesResponse { + @JsonProperty("event_types") + private WebhookEventType[] eventTypes; + + public GetWebhookEventTypesResponse() {} + + public WebhookEventType[] getEventTypes() { + return eventTypes; + } + + public void setEventTypes(WebhookEventType[] eventTypes) { + this.eventTypes = eventTypes; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsRequest.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsRequest.java new file mode 100644 index 00000000..968ccf32 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsRequest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Owner Stats */ +public class GetWebhookOwnerStatsRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("period") + private String period; + + public GetWebhookOwnerStatsRequest() {} + + public GetWebhookOwnerStatsRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.period = builder.period; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getPeriod() { + return period; + } + + public void setPeriod(String period) { + this.period = period; + } + + public static class Builder { + private String portfolioId; + private String period; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder period(String period) { + this.period = period; + return this; + } + + public GetWebhookOwnerStatsRequest build() throws CoinbaseClientException { + validate(); + return new GetWebhookOwnerStatsRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsResponse.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsResponse.java new file mode 100644 index 00000000..03521482 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookOwnerStatsResponse.java @@ -0,0 +1,103 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookRecentFailure; +import com.coinbase.prime.model.WebhookSubscriptionSummary; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Owner Stats */ +public class GetWebhookOwnerStatsResponse { + @JsonProperty("total_subscriptions") + private String totalSubscriptions; + + @JsonProperty("active_subscriptions") + private String activeSubscriptions; + + @JsonProperty("total_events") + private String totalEvents; + + @JsonProperty("overall_success_rate") + private Double overallSuccessRate; + + @JsonProperty("avg_latency_ms") + private String avgLatencyMs; + + @JsonProperty("subscriptions") + private WebhookSubscriptionSummary[] subscriptions; + + @JsonProperty("recent_failures") + private WebhookRecentFailure[] recentFailures; + + public GetWebhookOwnerStatsResponse() {} + + public String getTotalSubscriptions() { + return totalSubscriptions; + } + + public void setTotalSubscriptions(String totalSubscriptions) { + this.totalSubscriptions = totalSubscriptions; + } + + public String getActiveSubscriptions() { + return activeSubscriptions; + } + + public void setActiveSubscriptions(String activeSubscriptions) { + this.activeSubscriptions = activeSubscriptions; + } + + public String getTotalEvents() { + return totalEvents; + } + + public void setTotalEvents(String totalEvents) { + this.totalEvents = totalEvents; + } + + public Double getOverallSuccessRate() { + return overallSuccessRate; + } + + public void setOverallSuccessRate(Double overallSuccessRate) { + this.overallSuccessRate = overallSuccessRate; + } + + public String getAvgLatencyMs() { + return avgLatencyMs; + } + + public void setAvgLatencyMs(String avgLatencyMs) { + this.avgLatencyMs = avgLatencyMs; + } + + public WebhookSubscriptionSummary[] getSubscriptions() { + return subscriptions; + } + + public void setSubscriptions(WebhookSubscriptionSummary[] subscriptions) { + this.subscriptions = subscriptions; + } + + public WebhookRecentFailure[] getRecentFailures() { + return recentFailures; + } + + public void setRecentFailures(WebhookRecentFailure[] recentFailures) { + this.recentFailures = recentFailures; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionRequest.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionRequest.java new file mode 100644 index 00000000..60f98350 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionRequest.java @@ -0,0 +1,88 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Subscription */ +public class GetWebhookSubscriptionRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + public GetWebhookSubscriptionRequest() {} + + public GetWebhookSubscriptionRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public GetWebhookSubscriptionRequest build() throws CoinbaseClientException { + validate(); + return new GetWebhookSubscriptionRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionResponse.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionResponse.java new file mode 100644 index 00000000..60092e3c --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookSubscription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Subscription */ +public class GetWebhookSubscriptionResponse { + @JsonProperty("subscription") + private WebhookSubscription subscription; + + public GetWebhookSubscriptionResponse() {} + + public WebhookSubscription getSubscription() { + return subscription; + } + + public void setSubscription(WebhookSubscription subscription) { + this.subscription = subscription; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsRequest.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsRequest.java new file mode 100644 index 00000000..981fc24f --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsRequest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Subscription Stats */ +public class GetWebhookSubscriptionStatsRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + @JsonProperty("period") + private String period; + + public GetWebhookSubscriptionStatsRequest() {} + + public GetWebhookSubscriptionStatsRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + this.period = builder.period; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public String getPeriod() { + return period; + } + + public void setPeriod(String period) { + this.period = period; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + private String period; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder period(String period) { + this.period = period; + return this; + } + + public GetWebhookSubscriptionStatsRequest build() throws CoinbaseClientException { + validate(); + return new GetWebhookSubscriptionStatsRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsResponse.java b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsResponse.java new file mode 100644 index 00000000..8d1d3ca8 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/GetWebhookSubscriptionStatsResponse.java @@ -0,0 +1,159 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookEventTypeStats; +import com.coinbase.prime.model.WebhookRecentFailure; +import com.coinbase.prime.model.enums.WebhookHealthStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Get Webhook Subscription Stats */ +public class GetWebhookSubscriptionStatsResponse { + @JsonProperty("subscription_id") + private String subscriptionId; + + @JsonProperty("health_status") + private WebhookHealthStatus healthStatus; + + @JsonProperty("total_events") + private String totalEvents; + + @JsonProperty("successful") + private String successful; + + @JsonProperty("failed") + private String failed; + + @JsonProperty("success_rate") + private Double successRate; + + @JsonProperty("avg_latency_ms") + private String avgLatencyMs; + + @JsonProperty("p95_latency_ms") + private String p95LatencyMs; + + @JsonProperty("p99_latency_ms") + private String p99LatencyMs; + + @JsonProperty("event_type_breakdown") + private WebhookEventTypeStats[] eventTypeBreakdown; + + @JsonProperty("recent_failures") + private WebhookRecentFailure[] recentFailures; + + @JsonProperty("in_progress") + private String inProgress; + + public GetWebhookSubscriptionStatsResponse() {} + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public WebhookHealthStatus getHealthStatus() { + return healthStatus; + } + + public void setHealthStatus(WebhookHealthStatus healthStatus) { + this.healthStatus = healthStatus; + } + + public String getTotalEvents() { + return totalEvents; + } + + public void setTotalEvents(String totalEvents) { + this.totalEvents = totalEvents; + } + + public String getSuccessful() { + return successful; + } + + public void setSuccessful(String successful) { + this.successful = successful; + } + + public String getFailed() { + return failed; + } + + public void setFailed(String failed) { + this.failed = failed; + } + + public Double getSuccessRate() { + return successRate; + } + + public void setSuccessRate(Double successRate) { + this.successRate = successRate; + } + + public String getAvgLatencyMs() { + return avgLatencyMs; + } + + public void setAvgLatencyMs(String avgLatencyMs) { + this.avgLatencyMs = avgLatencyMs; + } + + public String getP95LatencyMs() { + return p95LatencyMs; + } + + public void setP95LatencyMs(String p95LatencyMs) { + this.p95LatencyMs = p95LatencyMs; + } + + public String getP99LatencyMs() { + return p99LatencyMs; + } + + public void setP99LatencyMs(String p99LatencyMs) { + this.p99LatencyMs = p99LatencyMs; + } + + public WebhookEventTypeStats[] getEventTypeBreakdown() { + return eventTypeBreakdown; + } + + public void setEventTypeBreakdown(WebhookEventTypeStats[] eventTypeBreakdown) { + this.eventTypeBreakdown = eventTypeBreakdown; + } + + public WebhookRecentFailure[] getRecentFailures() { + return recentFailures; + } + + public void setRecentFailures(WebhookRecentFailure[] recentFailures) { + this.recentFailures = recentFailures; + } + + public String getInProgress() { + return inProgress; + } + + public void setInProgress(String inProgress) { + this.inProgress = inProgress; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsRequest.java b/src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsRequest.java new file mode 100644 index 00000000..425b9a67 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsRequest.java @@ -0,0 +1,120 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.common.Pagination; +import com.coinbase.prime.common.PrimeListRequest; +import com.coinbase.prime.model.enums.SortDirection; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Webhook Subscriptions */ +public class ListWebhookSubscriptionsRequest extends PrimeListRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty("include_disabled") + private Boolean includeDisabled; + + @JsonProperty("event_type_filter") + private String eventTypeFilter; + + public ListWebhookSubscriptionsRequest() {} + + public ListWebhookSubscriptionsRequest(Builder builder) { + super(builder.cursor, builder.sortDirection, builder.limit); + this.portfolioId = builder.portfolioId; + this.includeDisabled = builder.includeDisabled; + this.eventTypeFilter = builder.eventTypeFilter; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public Boolean getIncludeDisabled() { + return includeDisabled; + } + + public void setIncludeDisabled(Boolean includeDisabled) { + this.includeDisabled = includeDisabled; + } + + public String getEventTypeFilter() { + return eventTypeFilter; + } + + public void setEventTypeFilter(String eventTypeFilter) { + this.eventTypeFilter = eventTypeFilter; + } + + public static class Builder { + private String portfolioId; + private Boolean includeDisabled; + private String eventTypeFilter; + private String cursor; + private SortDirection sortDirection; + private Integer limit; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder includeDisabled(Boolean includeDisabled) { + this.includeDisabled = includeDisabled; + return this; + } + + public Builder eventTypeFilter(String eventTypeFilter) { + this.eventTypeFilter = eventTypeFilter; + return this; + } + + public Builder limit(Integer limit) { + this.limit = limit; + return this; + } + + public Builder pagination(Pagination pagination) { + this.cursor = pagination.getNextCursor(); + this.sortDirection = pagination.getSortDirection(); + return this; + } + + public ListWebhookSubscriptionsRequest build() throws CoinbaseClientException { + validate(); + return new ListWebhookSubscriptionsRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsResponse.java b/src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsResponse.java new file mode 100644 index 00000000..ad5ecea5 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/ListWebhookSubscriptionsResponse.java @@ -0,0 +1,58 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookSubscription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** List Webhook Subscriptions */ +public class ListWebhookSubscriptionsResponse { + @JsonProperty("subscriptions") + private WebhookSubscription[] subscriptions; + + @JsonProperty("next_cursor") + private String nextCursor; + + @JsonProperty("has_next") + private Boolean hasNext; + + public ListWebhookSubscriptionsResponse() {} + + public WebhookSubscription[] getSubscriptions() { + return subscriptions; + } + + public void setSubscriptions(WebhookSubscription[] subscriptions) { + this.subscriptions = subscriptions; + } + + public String getNextCursor() { + return nextCursor; + } + + public void setNextCursor(String nextCursor) { + this.nextCursor = nextCursor; + } + + public Boolean getHasNext() { + return hasNext; + } + + public void setHasNext(Boolean hasNext) { + this.hasNext = hasNext; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventRequest.java b/src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventRequest.java new file mode 100644 index 00000000..f6f36b0c --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventRequest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replay Webhook Event */ +public class ReplayWebhookEventRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "event_id") + @JsonIgnore + private String eventId; + + @JsonProperty("subscription_id") + private String subscriptionId; + + public ReplayWebhookEventRequest() {} + + public ReplayWebhookEventRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.eventId = builder.eventId; + this.subscriptionId = builder.subscriptionId; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public static class Builder { + private String portfolioId; + private String eventId; + private String subscriptionId; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder eventId(String eventId) { + this.eventId = eventId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public ReplayWebhookEventRequest build() throws CoinbaseClientException { + validate(); + return new ReplayWebhookEventRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.eventId)) { + throw new CoinbaseClientException("EventId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventResponse.java b/src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventResponse.java new file mode 100644 index 00000000..c82708a2 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/ReplayWebhookEventResponse.java @@ -0,0 +1,57 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Replay Webhook Event */ +public class ReplayWebhookEventResponse { + @JsonProperty("deliveries_queued") + private Integer deliveriesQueued; + + @JsonProperty("delivery_ids") + private String[] deliveryIds; + + @JsonProperty("delivery_ids_truncated") + private Boolean deliveryIdsTruncated; + + public ReplayWebhookEventResponse() {} + + public Integer getDeliveriesQueued() { + return deliveriesQueued; + } + + public void setDeliveriesQueued(Integer deliveriesQueued) { + this.deliveriesQueued = deliveriesQueued; + } + + public String[] getDeliveryIds() { + return deliveryIds; + } + + public void setDeliveryIds(String[] deliveryIds) { + this.deliveryIds = deliveryIds; + } + + public Boolean getDeliveryIdsTruncated() { + return deliveryIdsTruncated; + } + + public void setDeliveryIdsTruncated(Boolean deliveryIdsTruncated) { + this.deliveryIdsTruncated = deliveryIdsTruncated; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretRequest.java b/src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretRequest.java new file mode 100644 index 00000000..1a82020f --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretRequest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Rotate Webhook HMAC Secret */ +public class RotateWebhookHmacSecretRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + /** + * revoke_previous_immediately invalidates the old secret immediately instead of keeping it valid + * for the server grace window. Use when the secret may be compromised. + */ + @JsonProperty("revoke_previous_immediately") + private Boolean revokePreviousImmediately; + + public RotateWebhookHmacSecretRequest() {} + + public RotateWebhookHmacSecretRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + this.revokePreviousImmediately = builder.revokePreviousImmediately; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public Boolean getRevokePreviousImmediately() { + return revokePreviousImmediately; + } + + public void setRevokePreviousImmediately(Boolean revokePreviousImmediately) { + this.revokePreviousImmediately = revokePreviousImmediately; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + private Boolean revokePreviousImmediately; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder revokePreviousImmediately(Boolean revokePreviousImmediately) { + this.revokePreviousImmediately = revokePreviousImmediately; + return this; + } + + public RotateWebhookHmacSecretRequest build() throws CoinbaseClientException { + validate(); + return new RotateWebhookHmacSecretRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretResponse.java b/src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretResponse.java new file mode 100644 index 00000000..049a3993 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/RotateWebhookHmacSecretResponse.java @@ -0,0 +1,66 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookSubscription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Rotate Webhook HMAC Secret */ +public class RotateWebhookHmacSecretResponse { + @JsonProperty("subscription") + private WebhookSubscription subscription; + + /** + * hmac_secret is the new plaintext HMAC signing secret. Returned exactly once; store it securely + * — it is never surfaced again. + */ + @JsonProperty("hmac_secret") + private String hmacSecret; + + /** + * previous_secret_expires_at is when the prior secret stops being accepted. Unset when + * revoke_previous_immediately was true. + */ + @JsonProperty("previous_secret_expires_at") + private String previousSecretExpiresAt; + + public RotateWebhookHmacSecretResponse() {} + + public WebhookSubscription getSubscription() { + return subscription; + } + + public void setSubscription(WebhookSubscription subscription) { + this.subscription = subscription; + } + + public String getHmacSecret() { + return hmacSecret; + } + + public void setHmacSecret(String hmacSecret) { + this.hmacSecret = hmacSecret; + } + + public String getPreviousSecretExpiresAt() { + return previousSecretExpiresAt; + } + + public void setPreviousSecretExpiresAt(String previousSecretExpiresAt) { + this.previousSecretExpiresAt = previousSecretExpiresAt; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationRequest.java b/src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationRequest.java new file mode 100644 index 00000000..ab0efaa7 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationRequest.java @@ -0,0 +1,106 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Send Webhook Simulation */ +public class SendWebhookSimulationRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + @JsonProperty("event_type") + private String eventType; + + public SendWebhookSimulationRequest() {} + + public SendWebhookSimulationRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + this.eventType = builder.eventType; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public String getEventType() { + return eventType; + } + + public void setEventType(String eventType) { + this.eventType = eventType; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + private String eventType; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder eventType(String eventType) { + this.eventType = eventType; + return this; + } + + public SendWebhookSimulationRequest build() throws CoinbaseClientException { + validate(); + return new SendWebhookSimulationRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationResponse.java b/src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationResponse.java new file mode 100644 index 00000000..9fa05ad6 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/SendWebhookSimulationResponse.java @@ -0,0 +1,35 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Send Webhook Simulation */ +public class SendWebhookSimulationResponse { + @JsonProperty("event_id") + private String eventId; + + public SendWebhookSimulationResponse() {} + + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionRequest.java b/src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionRequest.java new file mode 100644 index 00000000..78bf164a --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionRequest.java @@ -0,0 +1,253 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import static com.coinbase.core.utils.Utils.isNullOrEmpty; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.model.WebhookOAuthConfigInput; +import com.coinbase.prime.model.enums.WebhookAuthType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Update Webhook Subscription */ +public class UpdateWebhookSubscriptionRequest { + @JsonProperty(required = true, value = "portfolio_id") + @JsonIgnore + private String portfolioId; + + @JsonProperty(required = true, value = "subscription_id") + @JsonIgnore + private String subscriptionId; + + @JsonProperty("event_types") + private String[] eventTypes; + + @JsonProperty("target_url") + private String targetUrl; + + @JsonProperty("auth_type") + private WebhookAuthType authType; + + @JsonProperty("oauth_config") + private WebhookOAuthConfigInput oauthConfig; + + @JsonProperty("custom_headers") + private Map customHeaders; + + @JsonProperty("description") + private String description; + + @JsonProperty("is_enabled") + private Boolean isEnabled; + + @JsonProperty("update_mask") + private String updateMask; + + @JsonProperty("expected_version") + private String expectedVersion; + + public UpdateWebhookSubscriptionRequest() {} + + public UpdateWebhookSubscriptionRequest(Builder builder) { + this.portfolioId = builder.portfolioId; + this.subscriptionId = builder.subscriptionId; + this.eventTypes = builder.eventTypes; + this.targetUrl = builder.targetUrl; + this.authType = builder.authType; + this.oauthConfig = builder.oauthConfig; + this.customHeaders = builder.customHeaders; + this.description = builder.description; + this.isEnabled = builder.isEnabled; + this.updateMask = builder.updateMask; + this.expectedVersion = builder.expectedVersion; + } + + public String getPortfolioId() { + return portfolioId; + } + + public void setPortfolioId(String portfolioId) { + this.portfolioId = portfolioId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public void setSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + } + + public String[] getEventTypes() { + return eventTypes; + } + + public void setEventTypes(String[] eventTypes) { + this.eventTypes = eventTypes; + } + + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(String targetUrl) { + this.targetUrl = targetUrl; + } + + public WebhookAuthType getAuthType() { + return authType; + } + + public void setAuthType(WebhookAuthType authType) { + this.authType = authType; + } + + public WebhookOAuthConfigInput getOauthConfig() { + return oauthConfig; + } + + public void setOauthConfig(WebhookOAuthConfigInput oauthConfig) { + this.oauthConfig = oauthConfig; + } + + public Map getCustomHeaders() { + return customHeaders; + } + + public void setCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public String getUpdateMask() { + return updateMask; + } + + public void setUpdateMask(String updateMask) { + this.updateMask = updateMask; + } + + public String getExpectedVersion() { + return expectedVersion; + } + + public void setExpectedVersion(String expectedVersion) { + this.expectedVersion = expectedVersion; + } + + public static class Builder { + private String portfolioId; + private String subscriptionId; + private String[] eventTypes; + private String targetUrl; + private WebhookAuthType authType; + private WebhookOAuthConfigInput oauthConfig; + private Map customHeaders; + private String description; + private Boolean isEnabled; + private String updateMask; + private String expectedVersion; + + public Builder() {} + + public Builder portfolioId(String portfolioId) { + this.portfolioId = portfolioId; + return this; + } + + public Builder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + public Builder eventTypes(String[] eventTypes) { + this.eventTypes = eventTypes; + return this; + } + + public Builder targetUrl(String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + public Builder authType(WebhookAuthType authType) { + this.authType = authType; + return this; + } + + public Builder oauthConfig(WebhookOAuthConfigInput oauthConfig) { + this.oauthConfig = oauthConfig; + return this; + } + + public Builder customHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + public Builder description(String description) { + this.description = description; + return this; + } + + public Builder isEnabled(Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + public Builder updateMask(String updateMask) { + this.updateMask = updateMask; + return this; + } + + public Builder expectedVersion(String expectedVersion) { + this.expectedVersion = expectedVersion; + return this; + } + + public UpdateWebhookSubscriptionRequest build() throws CoinbaseClientException { + validate(); + return new UpdateWebhookSubscriptionRequest(this); + } + + private void validate() throws CoinbaseClientException { + if (isNullOrEmpty(this.portfolioId)) { + throw new CoinbaseClientException("PortfolioId is required"); + } + if (isNullOrEmpty(this.subscriptionId)) { + throw new CoinbaseClientException("SubscriptionId is required"); + } + } + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionResponse.java b/src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionResponse.java new file mode 100644 index 00000000..662123bc --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/UpdateWebhookSubscriptionResponse.java @@ -0,0 +1,36 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.prime.model.WebhookSubscription; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Update Webhook Subscription */ +public class UpdateWebhookSubscriptionResponse { + @JsonProperty("subscription") + private WebhookSubscription subscription; + + public UpdateWebhookSubscriptionResponse() {} + + public WebhookSubscription getSubscription() { + return subscription; + } + + public void setSubscription(WebhookSubscription subscription) { + this.subscription = subscription; + } +} diff --git a/src/main/java/com/coinbase/prime/webhooks/WebhooksService.java b/src/main/java/com/coinbase/prime/webhooks/WebhooksService.java new file mode 100644 index 00000000..94d746e8 --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/WebhooksService.java @@ -0,0 +1,207 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.core.errors.CoinbaseClientException; +import com.coinbase.prime.errors.CoinbasePrimeException; + +public interface WebhooksService { + /** + * Get Webhook Event Types. + * + *

Returns the registered webhook event types available to subscribe to + * + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + GetWebhookEventTypesResponse getWebhookEventTypes() + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Webhook Owner Stats. + * + *

Returns a dashboard-level rollup of delivery statistics across all subscriptions for the + * portfolio in the URL path + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + GetWebhookOwnerStatsResponse getWebhookOwnerStats(GetWebhookOwnerStatsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * List Webhook Subscriptions. + * + *

Returns cursor-paginated webhook subscriptions for the portfolio in the URL path + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + ListWebhookSubscriptionsResponse listWebhookSubscriptions(ListWebhookSubscriptionsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Webhook Subscription. + * + *

Returns a single webhook subscription by ID. Auth secrets are never returned + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + GetWebhookSubscriptionResponse getWebhookSubscription(GetWebhookSubscriptionRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Webhook Delivery Logs. + * + *

Returns cursor-paginated delivery logs for a single subscription. Delivery history is + * retained for up to 30 days from each attempt's `attempted_at` timestamp; older entries may be + * unavailable + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + GetWebhookDeliveryLogsResponse getWebhookDeliveryLogs(GetWebhookDeliveryLogsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Webhook Subscription Stats. + * + *

Returns pre-aggregated delivery statistics for a single subscription over a fixed time + * window + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + GetWebhookSubscriptionStatsResponse getWebhookSubscriptionStats( + GetWebhookSubscriptionStatsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Get Webhook Delivery Attempts. + * + *

Returns all HTTP POST attempts for a specific (event_id, subscription_id) pair. Attempt + * history is retained for up to 30 days from each attempt's `attempted_at` timestamp; older + * records may be unavailable + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + GetWebhookDeliveryAttemptsResponse getWebhookDeliveryAttempts( + GetWebhookDeliveryAttemptsRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Create Webhook Subscription. + * + *

Creates a new webhook subscription for the portfolio in the URL path. Returns the HMAC + * signing secret exactly once; store it securely + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + CreateWebhookSubscriptionResponse createWebhookSubscription( + CreateWebhookSubscriptionRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Replay Webhook Event. + * + *

Replays a previously published event for the portfolio in the URL path. When subscription_id + * is set the event is re-delivered to that single subscription; otherwise it is re-delivered to + * every matching subscription owned by the path owner + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + ReplayWebhookEventResponse replayWebhookEvent(ReplayWebhookEventRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Send Webhook Simulation. + * + *

Fires a synthetic simulation event to the subscription's endpoint for integration testing + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + SendWebhookSimulationResponse sendWebhookSimulation(SendWebhookSimulationRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Update Webhook Subscription. + * + *

Applies a partial patch to a webhook subscription using FieldMask semantics + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + UpdateWebhookSubscriptionResponse updateWebhookSubscription( + UpdateWebhookSubscriptionRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Delete Webhook Subscription. + * + *

Soft-deletes a webhook subscription. The subscription stops matching events immediately but + * audit history is retained + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + DeleteWebhookSubscriptionResponse deleteWebhookSubscription( + DeleteWebhookSubscriptionRequest request) + throws CoinbaseClientException, CoinbasePrimeException; + + /** + * Rotate Webhook HMAC Secret. + * + *

Issues a new HMAC signing secret for the subscription and returns the plaintext exactly + * once. By default the previous secret remains valid for a server-configured grace window; set + * revoke_previous_immediately to invalidate it at once + * + * @param request the request parameters for this operation + * @return the response payload for this operation + * @throws CoinbaseClientException if the request fails client-side validation + * @throws CoinbasePrimeException if the Prime API returns an error response + */ + RotateWebhookHmacSecretResponse rotateWebhookHmacSecret(RotateWebhookHmacSecretRequest request) + throws CoinbaseClientException, CoinbasePrimeException; +} diff --git a/src/main/java/com/coinbase/prime/webhooks/WebhooksServiceImpl.java b/src/main/java/com/coinbase/prime/webhooks/WebhooksServiceImpl.java new file mode 100644 index 00000000..f647e00c --- /dev/null +++ b/src/main/java/com/coinbase/prime/webhooks/WebhooksServiceImpl.java @@ -0,0 +1,190 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.prime.webhooks; + +import com.coinbase.core.common.HttpMethod; +import com.coinbase.core.service.CoinbaseServiceImpl; +import com.coinbase.prime.client.CoinbasePrimeClient; +import com.coinbase.prime.errors.CoinbasePrimeException; +import com.fasterxml.jackson.core.type.TypeReference; +import java.util.List; + +public class WebhooksServiceImpl extends CoinbaseServiceImpl implements WebhooksService { + public WebhooksServiceImpl(CoinbasePrimeClient client) { + super(client); + } + + @Override + public GetWebhookEventTypesResponse getWebhookEventTypes() throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + "/webhooks/event-types", + null, + List.of(200), + new TypeReference() {}); + } + + @Override + public GetWebhookOwnerStatsResponse getWebhookOwnerStats(GetWebhookOwnerStatsRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/webhooks/stats", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public ListWebhookSubscriptionsResponse listWebhookSubscriptions( + ListWebhookSubscriptionsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format("/portfolios/%s/webhooks/subscriptions", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public GetWebhookSubscriptionResponse getWebhookSubscription( + GetWebhookSubscriptionRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public GetWebhookDeliveryLogsResponse getWebhookDeliveryLogs( + GetWebhookDeliveryLogsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s/deliveries", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public GetWebhookSubscriptionStatsResponse getWebhookSubscriptionStats( + GetWebhookSubscriptionStatsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s/stats", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public GetWebhookDeliveryAttemptsResponse getWebhookDeliveryAttempts( + GetWebhookDeliveryAttemptsRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.GET, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s/deliveries/%s/attempts", + request.getPortfolioId(), request.getSubscriptionId(), request.getEventId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public CreateWebhookSubscriptionResponse createWebhookSubscription( + CreateWebhookSubscriptionRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format("/portfolios/%s/webhooks/subscriptions", request.getPortfolioId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public ReplayWebhookEventResponse replayWebhookEvent(ReplayWebhookEventRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/webhooks/events/%s/replay", + request.getPortfolioId(), request.getEventId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public SendWebhookSimulationResponse sendWebhookSimulation(SendWebhookSimulationRequest request) + throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s/simulate", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public UpdateWebhookSubscriptionResponse updateWebhookSubscription( + UpdateWebhookSubscriptionRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.PATCH, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public DeleteWebhookSubscriptionResponse deleteWebhookSubscription( + DeleteWebhookSubscriptionRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.DELETE, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } + + @Override + public RotateWebhookHmacSecretResponse rotateWebhookHmacSecret( + RotateWebhookHmacSecretRequest request) throws CoinbasePrimeException { + return this.request( + HttpMethod.POST, + String.format( + "/portfolios/%s/webhooks/subscriptions/%s/rotate-hmac-secret", + request.getPortfolioId(), request.getSubscriptionId()), + request, + List.of(200), + new TypeReference() {}); + } +} From 3fe3ddea02cab6fc501faf3e37efa46633fb08bd Mon Sep 17 00:00:00 2001 From: Nick Morgan Date: Wed, 25 Nov 2026 11:21:10 -0800 Subject: [PATCH 3/4] chore(release): bump SDK version to 1.12.0 and update CHANGELOG --- CHANGELOG.md | 49 +++++++++++++++++++ pom.xml | 2 +- .../VersionHeaderIntegrationTest.java | 10 ++-- .../coinbase/prime/utils/ConstantsTest.java | 2 +- 4 files changed, 56 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b3668a..8a08cfea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,54 @@ # Changelog +## [1.12.0] - 2026-NOV-24 + +### Added + +#### New API Endpoints + +**Webhooks Service** +- **`listWebhookSubscriptions()`**: List webhook subscriptions for a portfolio (`GET /v1/portfolios/{portfolio_id}/webhooks/subscriptions`) +- **`createWebhookSubscription()`**: Create a webhook subscription (`POST /v1/portfolios/{portfolio_id}/webhooks/subscriptions`) +- **`getWebhookSubscription()`**: Get a webhook subscription (`GET /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}`) +- **`updateWebhookSubscription()`**: Update a webhook subscription (`PATCH /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}`) +- **`deleteWebhookSubscription()`**: Soft-delete a webhook subscription (`DELETE /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}`) +- **`rotateWebhookHmacSecret()`**: Rotate a webhook subscription HMAC secret (`POST /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/rotate-hmac-secret`) +- **`sendWebhookSimulation()`**: Send a simulated webhook event (`POST /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/simulate`) +- **`getWebhookEventTypes()`**: List available webhook event types (`GET /v1/webhooks/event-types`) +- **`getWebhookDeliveryLogs()`**: List webhook delivery logs (`GET /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/deliveries`) +- **`getWebhookDeliveryAttempts()`**: List delivery attempts for a webhook event (`GET /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/deliveries/{event_id}/attempts`) +- **`getWebhookSubscriptionStats()`**: Get delivery stats for a webhook subscription (`GET /v1/portfolios/{portfolio_id}/webhooks/subscriptions/{subscription_id}/stats`) +- **`getWebhookOwnerStats()`**: Get aggregate webhook delivery stats (`GET /v1/portfolios/{portfolio_id}/webhooks/stats`) +- **`replayWebhookEvent()`**: Replay a webhook event (`POST /v1/portfolios/{portfolio_id}/webhooks/events/{event_id}/replay`) + +#### Canonical Service Methods & Tooling +- **Cross-SDK canonical naming**: Added 25 canonical service methods and request/response DTOs aligned with the Go, Python, and TypeScript SDKs (`listOrders`, `getOrder`, `getOrderEditHistory`, `createOrderPreview`, `listActivities`, `getAddressBook`, `createPortfolioAllocations`, `createPortfolioNetAllocations`, `getAllocationsByClientNettingId`, `getCounterpartyId`, `listEntityPaymentMethods`, `getEntityPaymentMethod`, `listProducts`, `getProductCandles`, `getEntityPositions`, `listPortfolioInterestAccruals`, `getPortfolioCredit`, `getTieredPricingFees`, `setFundingSettings`, `createStake`, `createUnstake`, `claimStakingRewards`, `createPortfolioStake`, `createPortfolioUnstake`, `queryTransactionValidators`, `createTransfer`, `createWithdrawal`) +- **`CoinbasePrimeClient.withBaseUrl()`**: Added helper to reuse the underlying `HttpClient` across API versions +- **`make update`**: Added Makefile target to fetch the latest OpenAPI spec and regenerate the SDK in one step + +#### New & Updated Models +- **`WebhookSubscription`**, **`WebhookSubscriptionSummary`**, **`WebhookEventType`**, **`WebhookDeliveryLogEntry`**, **`WebhookDeliveryAttempt`**, **`WebhookEventTypeStats`**, **`WebhookRecentFailure`**, **`WebhookOAuthConfig`**, **`WebhookOAuthConfigInput`**: Webhook management and delivery models +- **`SpreadConfig`**, **`SpreadDetails`**, **`SpreadLegDetails`**, **`SpreadPreview`**, **`Leg`**, **`LegPreview`**, **`OptionGreeks`**, **`CoinbaseFee`**: Spread order and options pricing models +- **`CrossMarginPositionBreakdown`**, **`CrossMarginPrimeSpotMarginContribution`**, **`MarginCallThresholds`**, **`MarginThreshold`**: Cross-margin breakdown and threshold models +- **`CreateQuoteRequest`** / **`CreateQuoteResponse`**: Added `quoteDurationMs` +- **`EditOrderRequest`**: Added `offset` and `wigLevel` +- **Updated existing models**: Synced fields across `AdvancedTransfer`, `Allocation`, `ComboLeg`, `DerivativePosition`, `FcmPosition`, `Fill`, `MarginSummary`, `OnchainTransactionDetails`, `Order`, `PaymentMethodDetails`, `PaymentMethodSummary`, `PortfolioStakingMetadata`, `Product`, `RewardMetadata`, `Transaction`, `TransferLocation`, `WalletCryptoDepositInstructions`, `WalletFiatDepositInstructions`, `WalletStakingMetadata`, and cross-margin summary models + +#### New & Updated Enums +- **`WebhookAuthType`**, **`WebhookDeliveryStatus`**, **`WebhookErrorType`**, **`WebhookHealthStatus`**: Webhook enums +- **`LimitPriceType`**, **`SpreadLimitType`**, **`MaxDeltaType`**: Spread and limit order enums +- **`MarginControlStatus`**, **`MarginEntityCallStatus`**, **`MarginHealthStatus`**, **`MarginLevel`**, **`MarginThresholdMarginThresholdType`**, **`PrimeXMAssetClass`**, **`XMPositionType`**: Cross-margin enums +- **Updated existing enums**: Synced values across `AdvancedTransferState`, `OrderSide`, `OrderType`, `PaymentMethodType`, `ProductType`, `RewardSubtype`, `SecondaryPermission`, `TransactionType`, `TransferLocationType`, `WalletDepositInstructionType`, and `WalletType` + +### Changed +- Synced `apiSpec/prime-public-spec.yaml` to the latest OpenAPI spec and regenerated models, enums, DTOs, services, and `PrimeServiceFactory` +- **Breaking**: Renamed `BetaRewardsRateTier` → **`RewardsRateTier`** and `BetaRewardsRateTierType` → **`RewardsRateTierType`** to align with TypeScript (update imports and `GetEntityRewardsRateResponse` / `GetPortfolioRewardsRateResponse` references) +- Deprecated legacy method and DTO names as `@Deprecated` subclass/method aliases so existing callers continue compiling +- Service implementations now accept HTTP `200` directly from the OpenAPI spec instead of synthetic `201` entries + +### Fixed +- **`FinancingServiceImpl`**: `/v2` endpoints (`getEntityRewardsRate()`, `getPortfolioRewardsRate()`, `getCrossMarginPrimeOverview()`) now derive from `primeClient.getBaseUrl()` instead of hardcoding the production host + ## [1.11.0] - 2026-SEP-01 ### Added diff --git a/pom.xml b/pom.xml index b89f595f..97b1b99d 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ Java SDK for the Coinbase Prime REST APIs com.coinbase.prime https://github.com/coinbase/prime-sdk-java - 1.11.0 + 1.12.0 Apache License, Version 2.0 diff --git a/src/test/java/com/coinbase/prime/integration/VersionHeaderIntegrationTest.java b/src/test/java/com/coinbase/prime/integration/VersionHeaderIntegrationTest.java index 87adaf4d..434ec218 100644 --- a/src/test/java/com/coinbase/prime/integration/VersionHeaderIntegrationTest.java +++ b/src/test/java/com/coinbase/prime/integration/VersionHeaderIntegrationTest.java @@ -47,9 +47,9 @@ public void testVersionHeaderMatchesPomVersion() throws CoinbaseClientException assertNotNull(userAgent, "User-Agent header should be present"); assertEquals( - "prime-sdk-java/1.11.0", + "prime-sdk-java/1.12.0", userAgent, - "User-Agent should contain 'prime-sdk-java/1.11.0' to match pom.xml version"); + "User-Agent should contain 'prime-sdk-java/1.12.0' to match pom.xml version"); // Additional verification: Ensure the SDK_VERSION constant is used correctly String expectedUserAgent = String.format("prime-sdk-java/%s", Constants.SDK_VERSION); @@ -63,9 +63,9 @@ public void testVersionHeaderMatchesPomVersion() throws CoinbaseClientException public void testSdkVersionConstantMatches() { // Verify that the SDK_VERSION constant has been updated correctly assertEquals( - "1.11.0", + "1.12.0", Constants.SDK_VERSION, - "SDK_VERSION constant should be '1.11.0' to match pom.xml version"); + "SDK_VERSION constant should be '1.12.0' to match pom.xml version"); } @Test @@ -84,7 +84,7 @@ public void testAllApiCallsWillIncludeVersionHeader() throws CoinbaseClientExcep String userAgent = headers.get(Constants.CB_USER_AGENT_HEADER); assertEquals( - "prime-sdk-java/1.11.0", + "prime-sdk-java/1.12.0", userAgent, "All API calls should include the correct version header, failed for path: " + path); } diff --git a/src/test/java/com/coinbase/prime/utils/ConstantsTest.java b/src/test/java/com/coinbase/prime/utils/ConstantsTest.java index 99dd4943..fa45be04 100644 --- a/src/test/java/com/coinbase/prime/utils/ConstantsTest.java +++ b/src/test/java/com/coinbase/prime/utils/ConstantsTest.java @@ -25,7 +25,7 @@ public class ConstantsTest { @Test public void testSdkVersionIsCorrect() { assertEquals( - "1.11.0", Constants.SDK_VERSION, "SDK_VERSION should match the version in pom.xml"); + "1.12.0", Constants.SDK_VERSION, "SDK_VERSION should match the version in pom.xml"); } @Test From 52e14618ac8677eabdd4f50db2984dea42439bdc Mon Sep 17 00:00:00 2001 From: Nick Morgan Date: Wed, 25 Nov 2026 11:21:10 -0800 Subject: [PATCH 4/4] feat(examples): add advanced transfer examples --- .../CancelAdvancedTransfer.java | 61 ++++++++ .../CreateAdvancedTransfer.java | 130 ++++++++++++++++++ .../ListAdvancedTransferTransactions.java | 61 ++++++++ .../ListAdvancedTransfers.java | 61 ++++++++ 4 files changed, 313 insertions(+) create mode 100644 src/main/java/com/coinbase/examples/advancedtransfer/CancelAdvancedTransfer.java create mode 100644 src/main/java/com/coinbase/examples/advancedtransfer/CreateAdvancedTransfer.java create mode 100644 src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransferTransactions.java create mode 100644 src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransfers.java diff --git a/src/main/java/com/coinbase/examples/advancedtransfer/CancelAdvancedTransfer.java b/src/main/java/com/coinbase/examples/advancedtransfer/CancelAdvancedTransfer.java new file mode 100644 index 00000000..7c3cbf1a --- /dev/null +++ b/src/main/java/com/coinbase/examples/advancedtransfer/CancelAdvancedTransfer.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.examples.advancedtransfer; + +import com.coinbase.prime.advancedtransfer.AdvancedTransferService; +import com.coinbase.prime.advancedtransfer.CancelAdvancedTransferRequest; +import com.coinbase.prime.advancedtransfer.CancelAdvancedTransferResponse; +import com.coinbase.prime.client.CoinbasePrimeClient; +import com.coinbase.prime.credentials.CoinbasePrimeCredentials; +import com.coinbase.prime.factory.PrimeServiceFactory; +import com.coinbase.prime.utils.Utils; + +public class CancelAdvancedTransfer { + public static void main(String[] args) { + try { + if (args.length < 1) { + System.err.println("Usage: CancelAdvancedTransfer "); + System.exit(1); + } + + CoinbasePrimeCredentials credentials = + new CoinbasePrimeCredentials(System.getenv("COINBASE_PRIME_CREDENTIALS")); + CoinbasePrimeClient client = new CoinbasePrimeClient(credentials); + String portfolioId = System.getenv("COINBASE_PRIME_PORTFOLIO_ID"); + String advancedTransferId = args[0]; + + System.out.println( + "Using IDs: Portfolio ID: " + + portfolioId + + ", Advanced Transfer ID: " + + advancedTransferId); + + AdvancedTransferService service = PrimeServiceFactory.createAdvancedTransferService(client); + CancelAdvancedTransferResponse response = + service.cancelAdvancedTransfer( + new CancelAdvancedTransferRequest.Builder() + .portfolioId(portfolioId) + .advancedTransferId(advancedTransferId) + .build()); + + System.out.println( + Utils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(response)); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/coinbase/examples/advancedtransfer/CreateAdvancedTransfer.java b/src/main/java/com/coinbase/examples/advancedtransfer/CreateAdvancedTransfer.java new file mode 100644 index 00000000..9a479294 --- /dev/null +++ b/src/main/java/com/coinbase/examples/advancedtransfer/CreateAdvancedTransfer.java @@ -0,0 +1,130 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.examples.advancedtransfer; + +import com.coinbase.prime.advancedtransfer.AdvancedTransferService; +import com.coinbase.prime.advancedtransfer.CreateAdvancedTransferRequest; +import com.coinbase.prime.advancedtransfer.CreateAdvancedTransferResponse; +import com.coinbase.prime.client.CoinbasePrimeClient; +import com.coinbase.prime.credentials.CoinbasePrimeCredentials; +import com.coinbase.prime.factory.PrimeServiceFactory; +import com.coinbase.prime.model.AdvancedTransfer; +import com.coinbase.prime.model.BlindMatchMetadata; +import com.coinbase.prime.model.FundMovement; +import com.coinbase.prime.model.TransferLocation; +import com.coinbase.prime.model.enums.AdvancedTransferType; +import com.coinbase.prime.model.enums.TransferLocationType; +import com.coinbase.prime.utils.Utils; +import java.time.LocalDate; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; +import java.util.List; +import java.util.UUID; + +public class CreateAdvancedTransfer { + public static void main(String[] args) { + try { + if (args.length < 2) { + System.err.println( + "Usage: CreateAdvancedTransfer [reference_id]"); + System.err.println("Example: CreateAdvancedTransfer CBNHP73AV3 CBPSKN6P2F SE2611240000001"); + System.exit(1); + } + + CoinbasePrimeCredentials credentials = + new CoinbasePrimeCredentials(System.getenv("COINBASE_PRIME_CREDENTIALS")); + CoinbasePrimeClient client = new CoinbasePrimeClient(credentials); + String portfolioId = System.getenv("COINBASE_PRIME_PORTFOLIO_ID"); + + String sourceCounterpartyId = args[0]; + String targetCounterpartyId = args[1]; + String today = LocalDate.now(ZoneOffset.UTC).format(DateTimeFormatter.BASIC_ISO_DATE); + String referenceId = args.length > 2 ? args[2] : "SE" + today.substring(2) + "0000001"; + + System.out.println( + "Using IDs: Portfolio ID: " + + portfolioId + + ", Source: " + + sourceCounterpartyId + + ", Target: " + + targetCounterpartyId + + ", Reference ID: " + + referenceId); + + FundMovement btcLeg = + new FundMovement.Builder() + .source( + new TransferLocation.Builder() + .type(TransferLocationType.COUNTERPARTY_ID) + .value(sourceCounterpartyId) + .build()) + .target( + new TransferLocation.Builder() + .type(TransferLocationType.COUNTERPARTY_ID) + .value(targetCounterpartyId) + .build()) + .currency("BTC") + .amount("0.0002") + .build(); + + FundMovement usdcLeg = + new FundMovement.Builder() + .source( + new TransferLocation.Builder() + .type(TransferLocationType.COUNTERPARTY_ID) + .value(targetCounterpartyId) + .build()) + .target( + new TransferLocation.Builder() + .type(TransferLocationType.COUNTERPARTY_ID) + .value(sourceCounterpartyId) + .build()) + .currency("USDC") + .amount("18.56") + .build(); + + BlindMatchMetadata metadata = + new BlindMatchMetadata.Builder() + .referenceId(referenceId) + .settlementDate(today) + .tradeDate(today) + .settlementTime("1000") + .build(); + + AdvancedTransfer transfer = + new AdvancedTransfer.Builder() + .type(AdvancedTransferType.ADVANCED_TRANSFER_TYPE_BLIND_MATCH) + .fundMovements(List.of(btcLeg, usdcLeg)) + .blindMatchMetadata(metadata) + .build(); + + AdvancedTransferService service = PrimeServiceFactory.createAdvancedTransferService(client); + CreateAdvancedTransferResponse response = + service.createAdvancedTransfer( + new CreateAdvancedTransferRequest.Builder() + .portfolioId(portfolioId) + .advancedTransfer(transfer) + .idempotencyKey(UUID.randomUUID().toString()) + .build()); + + System.out.println( + Utils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(response)); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransferTransactions.java b/src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransferTransactions.java new file mode 100644 index 00000000..55d91005 --- /dev/null +++ b/src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransferTransactions.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.examples.advancedtransfer; + +import com.coinbase.prime.advancedtransfer.AdvancedTransferService; +import com.coinbase.prime.advancedtransfer.ListAdvancedTransferTransactionsRequest; +import com.coinbase.prime.advancedtransfer.ListAdvancedTransferTransactionsResponse; +import com.coinbase.prime.client.CoinbasePrimeClient; +import com.coinbase.prime.credentials.CoinbasePrimeCredentials; +import com.coinbase.prime.factory.PrimeServiceFactory; +import com.coinbase.prime.utils.Utils; + +public class ListAdvancedTransferTransactions { + public static void main(String[] args) { + try { + if (args.length < 1) { + System.err.println("Usage: ListAdvancedTransferTransactions "); + System.exit(1); + } + + CoinbasePrimeCredentials credentials = + new CoinbasePrimeCredentials(System.getenv("COINBASE_PRIME_CREDENTIALS")); + CoinbasePrimeClient client = new CoinbasePrimeClient(credentials); + String portfolioId = System.getenv("COINBASE_PRIME_PORTFOLIO_ID"); + String advancedTransferId = args[0]; + + System.out.println( + "Using IDs: Portfolio ID: " + + portfolioId + + ", Advanced Transfer ID: " + + advancedTransferId); + + AdvancedTransferService service = PrimeServiceFactory.createAdvancedTransferService(client); + ListAdvancedTransferTransactionsResponse response = + service.listAdvancedTransferTransactions( + new ListAdvancedTransferTransactionsRequest.Builder() + .portfolioId(portfolioId) + .advancedTransferId(advancedTransferId) + .build()); + + System.out.println( + Utils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(response)); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransfers.java b/src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransfers.java new file mode 100644 index 00000000..8a07490d --- /dev/null +++ b/src/main/java/com/coinbase/examples/advancedtransfer/ListAdvancedTransfers.java @@ -0,0 +1,61 @@ +/* + * Copyright 2026-present Coinbase Global, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.coinbase.examples.advancedtransfer; + +import com.coinbase.prime.advancedtransfer.AdvancedTransferService; +import com.coinbase.prime.advancedtransfer.ListAdvancedTransfersRequest; +import com.coinbase.prime.advancedtransfer.ListAdvancedTransfersResponse; +import com.coinbase.prime.client.CoinbasePrimeClient; +import com.coinbase.prime.credentials.CoinbasePrimeCredentials; +import com.coinbase.prime.factory.PrimeServiceFactory; +import com.coinbase.prime.model.enums.AdvancedTransferState; +import com.coinbase.prime.model.enums.AdvancedTransferType; +import com.coinbase.prime.utils.Utils; + +public class ListAdvancedTransfers { + public static void main(String[] args) { + try { + CoinbasePrimeCredentials credentials = + new CoinbasePrimeCredentials(System.getenv("COINBASE_PRIME_CREDENTIALS")); + CoinbasePrimeClient client = new CoinbasePrimeClient(credentials); + String portfolioId = System.getenv("COINBASE_PRIME_PORTFOLIO_ID"); + + System.out.println("Using IDs: Portfolio ID: " + portfolioId); + + ListAdvancedTransfersRequest.Builder builder = + new ListAdvancedTransfersRequest.Builder().portfolioId(portfolioId); + + if (args.length > 0 && !args[0].isEmpty()) { + builder.state(AdvancedTransferState.valueOf(args[0].toUpperCase())); + } + if (args.length > 1 && !args[1].isEmpty()) { + builder.type(AdvancedTransferType.valueOf(args[1].toUpperCase())); + } + if (args.length > 2 && !args[2].isEmpty()) { + builder.referenceId(args[2]); + } + + AdvancedTransferService service = PrimeServiceFactory.createAdvancedTransferService(client); + ListAdvancedTransfersResponse response = service.listAdvancedTransfers(builder.build()); + + System.out.println( + Utils.getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(response)); + } catch (Exception e) { + e.printStackTrace(); + } + } +}