Skip to content

Update CLI to match updated schema#149

Merged
shreyav merged 1 commit intomainfrom
origin/02-04-update_cli_to_match_schema_change
Feb 4, 2026
Merged

Update CLI to match updated schema#149
shreyav merged 1 commit intomainfrom
origin/02-04-update_cli_to_match_schema_change

Conversation

@shreyav
Copy link
Contributor

@shreyav shreyav commented Feb 4, 2026

No description provided.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 4, 2026

Greptile Overview

Greptile Summary

Updated CLI quote creation command to align with the updated OpenAPI schema by adding discriminator fields to source and destination objects. The changes include:

  • Added sourceType: "ACCOUNT" for account-based quote sources
  • Added sourceType: "REALTIME_FUNDING" for customer-funded quote sources
  • Added destinationType: "ACCOUNT" for account-based destinations
  • Added destinationType: "UMA_ADDRESS" for UMA address destinations
  • Removed incorrect currency field from account destination objects (currency is not part of the AccountDestination schema)

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are straightforward schema alignment updates that correctly match the OpenAPI specification. All discriminator fields are properly added, and the incorrect currency field is correctly removed from account destinations. The changes are backward-compatible API updates with no logical errors.
  • No files require special attention

Important Files Changed

Filename Overview
cli/src/commands/quotes.ts Added discriminator fields (sourceType, destinationType) to quote source/destination objects and removed incorrect currency field from account destinations

Sequence Diagram

sequenceDiagram
    participant CLI as CLI User
    participant QuotesCmd as quotes.ts
    participant GridClient as Grid API
    participant Schema as OpenAPI Schema

    Note over CLI,Schema: Quote Creation Flow

    CLI->>QuotesCmd: quotes create --amount 1000 --lock-side SENDING --source-account InternalAccount:123
    QuotesCmd->>QuotesCmd: Validate amount & lock side
    QuotesCmd->>QuotesCmd: Build request body with sourceType discriminator
    Note over QuotesCmd: NEW: Adds sourceType: "ACCOUNT"
    QuotesCmd->>GridClient: POST /quotes with {source: {sourceType: "ACCOUNT", accountId: "..."}}
    GridClient->>Schema: Validate against AccountQuoteSource schema
    Schema-->>GridClient: ✓ Schema validation passes
    GridClient-->>QuotesCmd: Return Quote object
    QuotesCmd-->>CLI: Display quote details

    Note over CLI,Schema: Alternative: UMA Destination

    CLI->>QuotesCmd: quotes create --dest-uma $user@domain.com --dest-currency USD
    QuotesCmd->>QuotesCmd: Build destination with destinationType discriminator
    Note over QuotesCmd: NEW: Adds destinationType: "UMA_ADDRESS"
    QuotesCmd->>GridClient: POST /quotes with {destination: {destinationType: "UMA_ADDRESS", umaAddress: "...", currency: "USD"}}
    GridClient->>Schema: Validate against UmaAddressDestination schema
    Schema-->>GridClient: ✓ Schema validation passes
    GridClient-->>QuotesCmd: Return Quote object
    QuotesCmd-->>CLI: Display quote details
Loading

@shreyav shreyav merged commit 2258493 into main Feb 4, 2026
4 checks passed
@shreyav shreyav deleted the origin/02-04-update_cli_to_match_schema_change branch February 4, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants