TransactionSchema:
  description: The object schema for a transaction
  type: object
  properties:
    object:
      type: string
    id:
      type: string
    from:
      type: object
      properties:
        object:
          type: string
        address:
          type: string
        amount:
          type: number
        token:
          type: object
          $ref: '../token/schemas.yaml#/TokenSchema'
    to:
      type: object
      properties:
        object:
          type: string
        address:
          type: string
        amount:
          type: number
        token:
          type: object
          $ref: '../token/schemas.yaml#/TokenSchema'
    exchange:
      type: object
      properties:
        object:
          type: string
        rate:
          type: number
    metadata:
      type: object
    encrypted_metadata:
      type: object
    status:
      type: string
      enum:
        - comfirmed
        - pending
        - failed
    created_at:
      type: string
      format: date-time
    updated_at:
      type: string
      format: date-time
  required:
    - object
    - id
    - idempotency_token
    - from
    - to
    - exchange
    - status
    - created_at
    - updated_at

TransactionCalculationSchema:
  description: The object schema for a transaction calculation
  type: object
  properties:
    object:
      type: string
    from_amount:
      type: integer
    from_token_id:
      type: string
    to_amount:
      type: integer
    to_token_id:
      type: string
    exchange_pair:
      $ref: '../exchange_pair/schemas.yaml#/ExchangePairSchema'
    calculated_at:
      type: string
      format: date-time
  required:
    - object
    - from_amount
    - from_token_id
    - to_amount
    - to_token_id
    - exchange_pair
    - calculated_at
