THORChain StreamingSwap API

The StreamingSwap API from THORChain — 2 operation(s) for streamingswap.

OpenAPI Specification

thorchain-streamingswap-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Thornode Auth StreamingSwap API
  version: 3.19.1
  contact:
    email: devs@thorchain.org
  description: Thornode REST API.
tags:
- name: StreamingSwap
paths:
  /thorchain/swap/streaming/{hash}:
    parameters:
    - $ref: '#/components/parameters/queryHeight'
    - $ref: '#/components/parameters/hash'
    get:
      description: Returns the state of a streaming swap
      operationId: stream_swap
      tags:
      - StreamingSwap
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamingSwapResponse'
  /thorchain/swaps/streaming:
    parameters:
    - $ref: '#/components/parameters/queryHeight'
    get:
      description: Returns the state of all streaming swaps
      operationId: stream_swaps
      tags:
      - StreamingSwap
      responses:
        200:
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamingSwapsResponse'
components:
  schemas:
    StreamingSwapsResponse:
      type: array
      items:
        $ref: '#/components/schemas/StreamingSwap'
    StreamingSwap:
      type: object
      required:
      - trade_target
      - deposit
      - in
      - out
      properties:
        tx_id:
          type: string
          example: CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7
          description: the hash of a transaction
        interval:
          type: integer
          format: int64
          description: how often each swap is made, in blocks
        quantity:
          type: integer
          format: int64
          description: the total number of swaps in a streaming swaps
        count:
          type: integer
          format: int64
          description: the amount of swap attempts so far
        last_height:
          type: integer
          format: int64
          description: the block height of the latest swap
        initial_height:
          type: integer
          format: int64
          description: the block height when the swap first entered the queue
        trade_target:
          type: string
          example: '100'
          description: the total number of tokens the swapper wants to receive of the output asset
        source_asset:
          type: string
          example: BTC.BTC
          description: the asset to be swapped from
        target_asset:
          type: string
          example: ETH.ETH
          description: the asset to be swapped to
        destination:
          type: string
          example: '0x66fb1cd65b97fa40457b90b7d1ca6b92cb64b32b'
          description: the destination address to receive the swap output
        deposit:
          type: string
          example: '100'
          description: the number of input tokens the swapper has deposited
        in:
          type: string
          example: '100'
          description: the amount of input tokens that have been swapped so far
        out:
          type: string
          example: '100'
          description: the amount of output tokens that have been swapped so far
        failed_swaps:
          type: array
          description: the list of swap indexes that failed
          items:
            type: integer
            format: int64
        failed_swap_reasons:
          type: array
          description: the list of reasons that sub-swaps have failed
          items:
            type: string
    StreamingSwapResponse:
      $ref: '#/components/schemas/StreamingSwap'
  parameters:
    queryHeight:
      name: height
      in: query
      description: optional block height, defaults to current tip
      required: false
      schema:
        type: integer
        format: int64
        minimum: 0
    hash:
      name: hash
      in: path
      required: true
      schema:
        type: string
        example: CF524818D42B63D25BBA0CCC4909F127CAA645C0F9CD07324F2824CC151A64C7