> ## Documentation Index
> Fetch the complete documentation index at: https://docs.echo.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# read-commitment-data


> Read data derived from the commitments to a sale contract. This includes the 100 latest commitments for a given sale, the total commitment amount, and the number of unique commitments. For auction sales, the current clearing price is also returned.




## OpenAPI

````yaml /openapi/sonar.json post /sonar/v1/public/read-commitment-data
openapi: 3.0.0
info:
  description: Generated by encore
  title: API for sunrise-98ti
  version: '1'
  x-logo:
    altText: Encore logo
    backgroundColor: '#EEEEE1'
    url: https://encore.dev/assets/branding/logo/logo-black.png
servers:
  - description: Echo API
    url: https://api.echo.xyz
security: []
paths:
  /sonar/v1/public/read-commitment-data:
    post:
      summary: |
        read-commitment-data
      description: >
        Read data derived from the commitments to a sale contract. This includes
        the 100 latest commitments for a given sale, the total commitment
        amount, and the number of unique commitments. For auction sales, the
        current clearing price is also returned.
      operationId: POST:sales.ReadCommitmentDataV2
      requestBody:
        content:
          application/json:
            schema:
              properties:
                SaleUUID:
                  format: uuid
                  type: string
              required:
                - SaleUUID
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  ClearingPriceDenominator:
                    description: >
                      Set if the sale is using an auction pricing strategy. The
                      current clearing price \_denominator\_ as a number string.
                    title: |
                      ClearingPriceDenominator
                    type: string
                  ClearingPriceMicroUSD:
                    description: >
                      Set if the sale is using an auction pricing strategy and
                      the payment token is a USD stablecoin and the offered
                      token decimals are configured. It contains the current
                      clearing price in micro-USD (1 USD = 1,000,000 micro-USD)
                      for one human-readable offered token (1 human-readable
                      token = 10^OfferedTokenDecimals smallest units). Warning:
                      this could lose precision, so ClearingPriceNumerator and
                      ClearingPriceDenominator should be used as the
                      machine-readable value.
                    title: |
                      ClearingPriceMicroUSD
                    type: string
                  ClearingPriceNumerator:
                    description: >
                      Set if the sale is using an auction pricing strategy. The
                      current clearing price \_numerator\_ as a number string.
                      You can divide this by the ClearingPriceDenominator to get
                      the current price, but you might lose precision. The
                      clearing price is in smallest units of the payment token
                      per smallest unit of the offered token.
                    title: |
                      ClearingPriceNumerator
                    type: string
                  Commitments:
                    description: |
                      A list of commitments.
                    items:
                      $ref: '#/components/schemas/types.Commitment'
                    title: |
                      Commitments
                    type: array
                  OfferedTokenDecimals:
                    description: >
                      The number of decimals of the offered token, if
                      configured. For example, a token with 18 decimals has 18
                      decimal places.
                    format: int64
                    minimum: 0
                    title: |
                      OfferedTokenDecimals
                    type: integer
                  PaymentTokenDecimals:
                    description: >
                      The number of decimals of the payment token. For example,
                      USDC has 6 decimals. If your sale supports multiple
                      payment tokens with different decimals, this will return
                      the "normalized payment token decimals" configured for the
                      sale.
                    format: int64
                    minimum: 0
                    title: |
                      PaymentTokenDecimals
                    type: integer
                  TotalCommitmentAmount:
                    description: >
                      The total commitment amount in the smallest payment token
                      units as a number string.
                    title: |
                      TotalCommitmentAmount
                    type: string
                  UniqueCommitmentCount:
                    description: |
                      The number of unique commitment count.
                    format: int64
                    minimum: 0
                    title: |
                      UniqueCommitmentCount
                    type: integer
                required:
                  - TotalCommitmentAmount
                  - PaymentTokenDecimals
                  - UniqueCommitmentCount
                  - Commitments
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    types.Commitment:
      description: |
        Represents a commitment to a sale.
      properties:
        Amounts:
          description: |
            The committed amounts by wallet and payment token.
          items:
            $ref: '#/components/schemas/types.WalletTokenAmount'
          title: |
            Amounts
          type: array
        CommitmentID:
          description: |
            The unique commitment ID.
          title: |
            CommitmentID
          type: string
        CreatedAt:
          description: |
            The timestamp of the commitment creation.
          format: date-time
          title: |
            CreatedAt
          type: string
        ExtraDataParsed:
          description: >
            Populated if our backend knows how to parse the extraData field. It
            contains the parsed extraData field from the ICommitmentDataReader
            interface:
            [https://github.com/sunrisedotdev/sonar/blob/main/contracts/src/interfaces/ICommitmentDataReader.sol](https://github.com/sunrisedotdev/sonar/blob/main/contracts/src/interfaces/ICommitmentDataReader.sol).
          title: |
            ExtraDataParsed
          type: object
        ExtraDataRaw:
          description: >
            Hex-encoded raw extraData field from the ICommitmentDataReader
            interface:
            [https://github.com/sunrisedotdev/sonar/blob/main/contracts/src/interfaces/ICommitmentDataReader.sol](https://github.com/sunrisedotdev/sonar/blob/main/contracts/src/interfaces/ICommitmentDataReader.sol).
          title: |
            ExtraDataRaw
          type: string
        PriceDenominator:
          description: |
            The price \_denominator\_ as a number string.
          title: |
            PriceDenominator
          type: string
        PriceMicroUSD:
          description: >
            Set if the payment token is a USD stablecoin and the offered token
            decimals are configured. It contains the price in micro-USD (1 USD =
            1,000,000 micro-USD) for one offered token (i.e.
            OfferedTokenDecimals). Warning: this could lose precision, so
            PriceNumerator and PriceDenominator should be used as the
            machine-readable value.
          title: |
            PriceMicroUSD
          type: string
        PriceNumerator:
          description: >
            The price \_numerator\_ as a number string. You can divide this by
            the PriceDenominator to get the price, but you might lose precision.
            The price is in smallest units of the payment token per smallest
            unit of the offered token.
          title: |
            PriceNumerator
          type: string
        SaleSpecificEntityID:
          description: |
            The unique sale-specific entity ID.
          title: |
            SaleSpecificEntityID
          type: string
      required:
        - CommitmentID
        - SaleSpecificEntityID
        - PriceNumerator
        - PriceDenominator
        - Amounts
        - CreatedAt
        - ExtraDataRaw
        - ExtraDataParsed
      title: |
        Commitment
      type: object
    types.WalletTokenAmount:
      description: |
        Represents an amount of a specific token related to a specific wallet.
      properties:
        Amount:
          description: |
            The commitment amount in payment token units as a number string.
          title: |
            Amount
          type: string
        TokenAddress:
          description: |
            Hex-encoded EVM address or base58-encoded SVM address.
          title: |
            TokenAddress.
          type: string
        Wallet:
          description: |
            Hex-encoded EVM address or base58-encoded SVM address.
          title: |
            Wallet
          type: string
      required:
        - Wallet
        - TokenAddress
        - Amount
      title: |
        WalletTokenAmount
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response

````