Skip to content

Commit ca25a31

Browse files
feat(generator): restore model-generator and regenerate models from OpenAPI (#2)
* feat(generator): restore OpenAPI-driven model generator Reintroduce tools/model-generator with OpenAPI Generator templates, spec fetch, and post-processing for model and enum output under src/main/java. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(spec): refresh prime-public-spec.yaml from live OpenAPI Update the committed Prime REST API spec to match the current public OpenAPI document. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: regenerate models and enums from OpenAPI spec Regenerate model/ and model/enums/ from the refreshed spec, including new cross-margin and staking types and XM naming alignment. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: align service requests with spec and remove legacy APIs Add staking metadata and validator provider fields, remove deprecated service aliases, and delete unused legacy request/response types superseded by canonical names. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(release): bump to v1.10.0 and update CHANGELOG Document customer-facing model, request, and removal changes for the OpenAPI sync release. Co-authored-by: Cursor <cursoragent@cursor.com> * address review: restore getPortfolioCounterpartyId on AdvancedTransferService The OpenAPI spec tags this route under Advanced Transfer. Keep PortfoliosService as a deprecated shim for backward compatibility. Co-authored-by: Cursor <cursoragent@cursor.com> * address review: update generated model headers and DateOfBirth primitives Remove OpenAPI Generator attribution from generated file headers and convert DateOfBirth year/month/day fields to int primitives via post-processor. Co-authored-by: Cursor <cursoragent@cursor.com> * address review: enforce XM acronym casing across generated models Add post-processor normalization so Xm* type and accessor names become XM* for parity with TS/Go SDKs, including case-variant file cleanup on regen. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: regenerate models with updated generator formatting Re-run the OpenAPI model generator to apply consistent 4-space indentation, expanded Javadoc blocks, and enum doc formatting across all 209 model and enum files. Co-authored-by: Cursor <cursoragent@cursor.com> * add make commands for format and run format * update changelog date --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 4d01ad6 commit ca25a31

266 files changed

Lines changed: 5605 additions & 3895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ dependency-reduced-pom.xml
77
.classpath
88
.project
99
.settings
10+
.factorypath
11+
.metadata/
1012
.claude/settings.local.json
1113

1214
.envrc

‎CHANGELOG.md‎

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# Changelog
22

3+
## [1.10.0] - 2026-JUN-17
4+
5+
### Added
6+
7+
#### New & Updated Models
8+
9+
- **`CrossMarginPrimeDerivativesEquityBreakdown`**, **`CrossMarginPrimeRiskNettingInfo`**, **`CrossMarginPrimeSpotEquityBreakdown`**, **`CrossMarginPrimeXMPosition`**: Cross-margin Prime overview breakdown types
10+
- **`CustomStablecoinRewardDetails`**: Custom stablecoin reward metadata
11+
- **`PrimeXMMarginCallThresholds`**, **`PrimeXMMarginRequirementBreakdown`**, **`PrimeXMMarginThreshold`**, **`PrimeXMOffsetCreditBreakdown`**: Prime XM margin detail types
12+
- **`WalletStakingMetadata`**: Wallet staking metadata payload
13+
- **`DateOfBirth`**: Date-of-birth value type
14+
- Regenerated models include class and field Javadoc from OpenAPI `title` / `description`
15+
16+
#### New Enums
17+
18+
- **`PrimeXMHealthStatus`**, **`PrimeXMMarginRequirementType`**, **`PrimeXMMarginThresholdType`**
19+
- **`XMControlStatus`**, **`XMEntityCallStatus`**, **`XMMarginLevel`**
20+
- **`ValidatorProvider`**: ETH validator service providers for staking unstake requests
21+
22+
### Changed
23+
24+
- **Cross-margin model renames** (update imports): `XmLoan` → **`XMLoan`**, `XmMarginCall` → **`XMMarginCall`**, `XmPosition` → **`XMPosition`**, `XmRiskNettingInfo` → **`XMRiskNettingInfo`**, `XmSummary` → **`XMSummary`**
25+
- **Cross-margin enum renames** (update imports): `XmCallStatus` → **`XMCallStatus`**, `XmCallType` → **`XMCallType`**, `XmControlStatus` → **`XMControlStatus`**, `XmEntityCallStatus` → **`XMEntityCallStatus`**, `XmLiquidationStatus` → **`XMLiquidationStatus`**, `XmParty` → **`XMParty`**
26+
- **`CreateStakeRequest`** / **`CreateUnstakeRequest`**: Added `metadata` (`WalletStakingMetadata`) for wallet staking initiate/unstake
27+
- **`PortfolioStakingUnstakeRequest`**: Added `validatorProvider` (`ValidatorProvider`) for portfolio unstake
28+
- Regenerated **`model/`** and **`model/enums/`** from the latest OpenAPI spec via restored **`tools/model-generator`**
29+
30+
### Removed
31+
32+
- **`TravelRuleEntry`**, **`TravelRuleWalletDetails`**, **`Vasp`**: Removed from the public OpenAPI spec
33+
- **`XmMarginLevel`**: Replaced by **`XMMarginLevel`** (wire values unchanged; update imports)
34+
- **`PositionsService.listAggregatePositions()`** / **`listPositions()`**: Use **`listAggregateEntityPositions()`** / **`listEntityPositions()`**
35+
- **`AdvancedTransferService.getPortfolioCounterpartyId()`**: Use **`PortfoliosService.getPortfolioCounterpartyId()`**
36+
- Unused legacy request/response types superseded by canonical names: **`ListUsersRequest`/`Response`** (use **`ListEntityUsersRequest`/`Response`**), **`CreateTransferRequest`/`Response`** (use **`CreateWalletTransferRequest`/`Response`**), **`CreateWithdrawalRequest`/`Response`** (use **`CreateWalletWithdrawalRequest`/`Response`**), **`CreatePortfolioStakeRequest`/`Response`** (use **`PortfolioStakingInitiateRequest`/`Response`**), **`CreatePortfolioUnstakeRequest`/`Response`** (use **`PortfolioStakingUnstakeRequest`/`Response`**), **`ClaimStakingRewardsRequest`/`Response`** (use **`ClaimRewardsRequest`/`Response`**), **`GetOrderRequest`/`Response`** (use **`GetOrderByOrderIdRequest`/`Response`**), **`ListAggregatePositionsRequest`/`Response`**, **`ListPositionsRequest`/`Response`**, **`advancedtransfer.GetPortfolioCounterpartyIdRequest`/`Response`**
37+
38+
### Notes
39+
40+
- Minor release: OpenAPI spec sync, regenerated models/enums, and service-layer request alignment. No new service methods.
41+
- Consumers on deprecated position/counterparty helpers or removed legacy types should migrate to the replacements listed above.
42+
343
## [1.9.0] - 2026-06-03
444

545
### Changed
@@ -69,7 +109,7 @@
69109
- **`PositionsService.listAggregatePositions()`** / **`listPositions()`**: same routes as **`listAggregateEntityPositions()`** / **`listEntityPositions()`**; prefer the spec-aligned entity-named methods.
70110
- **`AdvancedTransferService.getPortfolioCounterpartyId()`**: prefer **`PortfoliosService.getPortfolioCounterpartyId()`** (same HTTP route).
71111

72-
112+
### Removed
73113

74114
- **`tools/model-generator`**: removed; maintain models, requests, responses, and services against `apiSpec/prime-public-spec.yaml`
75115
- **`com.coinbase.prime.advancedtransfers`** package and **`AdvancedTransfersService`**: renamed to **`com.coinbase.prime.advancedtransfer`** and **`AdvancedTransferService`**; **`PrimeServiceFactory.createAdvancedTransfersService()`** replaced by **`createAdvancedTransferService()`**

‎Makefile‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
.PHONY: fetch-spec
1+
.PHONY: fetch-spec compile format
22
fetch-spec:
33
@mkdir -p apiSpec
44
@curl -fsSL -o apiSpec/prime-public-spec.yaml https://api.prime.coinbase.com/v1/openapi.yaml
5+
6+
compile:
7+
mvn -B compile
8+
9+
format:
10+
mvn -B spotless:apply

0 commit comments

Comments
 (0)