openapi: 3.0.3
info:
  title: XFT API
  description: >-
    These are the API references for the beta version of XFT API v2. If you are
    looking for API v1 references, [see
    here](/XFT-swap-api/api-references/overview).
  version: next
servers:
  - url: http://api.XFT.org
paths:
  /swap/permit2/price:
    get:
      operationId: swap::permit2::getPrice
      summary: getPrice (Permit2)
      description: Get the indicative price for a swap using Permit2 to set allowances
      tags:
        - Swap
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
        - name: buyToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to buy
          example: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
        - name: sellToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to sell
          example: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: sellAmount
          in: query
          required: true
          schema:
            type: string
          description: The amount of `sellToken` in `sellToken` base units to sell
          example: '100000000'
        - name: taker
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address which holds the `sellToken` balance and has the
            allowance set for the swap
          example: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
        - name: txOrigin
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the external account that started the
            transaction. This is only needed if `taker` is a smart contract.
        - name: swapFeeRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The wallet address to receive the specified trading fees. You must
            also specify the `swapFeeToken` and `swapFeeBps` in the request to
            use this feature. Learn more about setting up a trading
            fee/commission in the FAQs
        - name: swapFeeBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 1000
          description: >-
            The amount in Bps of the `swapFeeToken` to charge and deliver to the
            `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and
            `swapFeeToken` in the request to use this feature. For security,
            this field has a default limit of 1000 Bps. If your application
            requires a higher value, please reach out to us.
        - name: swapFeeToken
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to receive trading fees in. This
            must be set to the value of either the `buyToken` or the
            `sellToken`. You must also specify the `swapFeeRecipient` and
            `swapFeeBps` in the request to use this feature
        - name: tradeSurplusRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address to receive any trade surplus. If specified, this address
            will receive trade surplus when applicable. Otherwise, the `taker`
            will receive the surplus
        - name: gasPrice
          in: query
          required: false
          schema:
            type: string
          description: >-
            The target gas price (in wei) for the swap transaction. If not
            provided, the default value is based on the XFT gas price oracle
        - name: slippageBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 10000
            default: 100
          description: >-
            The maximum acceptable slippage of the `buyToken` in Bps. If this
            parameter is set to 0, no slippage will be tolerated. If not
            provided, the default slippage tolerance is 100Bps
        - name: excludedSources
          in: query
          required: false
          schema:
            type: string
          description: >-
            Liquidity sources e.g. Uniswap_V3, SushiSwap, XFT_RFQ to exclude from
            the provided quote. See
            https://api.XFT.org/sources?chainId=<chain_id> with the desired
            chain's ID for a full list of sources. Separate multiple sources
            with a comma
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      blockNumber:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The block number at which the liquidity sources were
                          sampled to generate the quote. This indicates the
                          freshness of the quote
                      buyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `buyToken` (in `buyToken` units) that
                          will be bought in the swap
                      buyToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to buy in the swap
                      fees:
                        type: object
                        properties:
                          integratorFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The amount of token charged as the integrator
                                  fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the
                                  integrator fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The specified fee to charge and deliver to the
                              `swapFeeRecipient`.
                          zeroExFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the XFT fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address of the token charged as the XFT fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: The fee charged by XFT for the trade.
                          gasFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the gas fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the gas
                                  fee
                              type:
                                type: string
                                enum:
                                  - gas
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The gas fee to be used in submitting the
                              transaction.
                        required:
                          - integratorFee
                          - zeroExFee
                          - gasFee
                        additionalProperties: false
                        description: >-
                          Fees to be deducted in this transaction. It contains
                          the `integratorFee`, `zeroExFee` and `gasFee`
                      gas:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        nullable: true
                        description: >-
                          The estimated gas limit that should be used to send
                          the transaction to guarantee settlement
                      gasPrice:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The gas price (in wei) that should be used to send the
                          transaction. The transaction needs to be sent with
                          this `gasPrice` for the transaction to be successful
                      issues:
                        type: object
                        properties:
                          allowance:
                            type: object
                            properties:
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The `taker`'s current allowance of the
                                  `spender`
                              spender:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address to set the allowance on
                            required:
                              - actual
                              - spender
                            additionalProperties: false
                            description: >-
                              Details of allowances that the `taker` must set
                              for in order to execute the swap successfully.
                              Null if no allowance is required
                            nullable: true
                          balance:
                            type: object
                            properties:
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The contract address of the `sellToken`
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The current balance of the `sellToken` in the
                                  `taker` address
                              expected:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The balance of the `sellToken` required for
                                  the swap to execute successfully
                            required:
                              - token
                              - actual
                              - expected
                            additionalProperties: false
                            description: >-
                              Details of balance of the `sellToken` that the
                              `taker` must hold. Null if the `taker` has
                              sufficient balance
                            nullable: true
                          simulationIncomplete:
                            type: boolean
                            description: >-
                              This is set to `true` when XFT cannot validate the
                              transaction. This happens when the `taker` has an
                              insufficient balance of the `sellToken` and XFT is
                              unable to peform ehanced quote validation with the
                              low balance. Note that this does not necessarily
                              mean that the trade will revert
                          invalidSourcesPassed:
                            type: array
                            items:
                              type: string
                            description: >-
                              A list of invalid sources present in
                              `excludedSources` request. See
                              https://api.XFT.org/sources?chainId= with the
                              desired chain's ID for the list of valid sources
                        required:
                          - allowance
                          - balance
                          - simulationIncomplete
                          - invalidSourcesPassed
                        additionalProperties: false
                        description: >-
                          An object containing potential issues discovered
                          during XFT validation that can prevent the swap from
                          being executed successfully by the `taker`
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. The rest of the fields will only be
                          returned if `true`
                      minBuyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The price which must be met or else the entire
                          transaction will revert. This price is influenced by
                          the `slippageBps` parameter. On-chain sources may
                          encounter price movements from quote to settlement
                      route:
                        type: object
                        properties:
                          fills:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the input token
                                to:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the output token
                                source:
                                  type: string
                                  description: The liquidity source used in the route
                                proportionBps:
                                  allOf:
                                    - {}
                                    - type: string
                                      pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                  description: >-
                                    The proportion of the trade to be filled by
                                    the `source`
                              required:
                                - from
                                - to
                                - source
                                - proportionBps
                              additionalProperties: false
                            description: >-
                              Details of each segment that XFT routes the swap
                              through
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: >-
                                    The token address. This is the unique
                                    identifier of the token
                                symbol:
                                  type: string
                                  description: >-
                                    The token symbol. This is not guaranteed to
                                    be unique, as multiple tokens can have the
                                    same symbol
                              required:
                                - address
                                - symbol
                              additionalProperties: false
                              description: Properties of the tokens involved in the swap
                            description: Properties of the tokens involved in the swap
                        required:
                          - fills
                          - tokens
                        additionalProperties: false
                        description: >-
                          The path of liquidity sources to be used in executing
                          this swap
                      sellAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `sellToken` (in `sellToken` units) that
                          will be sold in this swap
                      sellToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to sell in the swap
                      tokenMetadata:
                        type: object
                        properties:
                          buyToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the buy token
                          sellToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the sell token
                        required:
                          - buyToken
                          - sellToken
                        additionalProperties: false
                        description: >-
                          Swap-related metadata for the buy and sell token in
                          the swap
                      totalNetworkFee:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        nullable: true
                        description: >-
                          The estimated total network cost of the swap. On
                          chains where there is no L1 data cost, it is
                          calculated as `gas` * `gasPrice. On chains where there
                          is an L1 data cost, it is calculated as `gas` *
                          `gasPrice + L1 data
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - blockNumber
                      - buyAmount
                      - buyToken
                      - fees
                      - gas
                      - gasPrice
                      - issues
                      - liquidityAvailable
                      - minBuyAmount
                      - route
                      - sellAmount
                      - sellToken
                      - tokenMetadata
                      - totalNetworkFee
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - false
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. No other fields will be returned if
                          it is `false`
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - liquidityAvailable
                      - zid
                    additionalProperties: false
              example:
                blockNumber: '20114676'
                buyAmount: '100032748'
                buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                fees:
                  integratorFee: null
                  zeroExFee: null
                  gasFee: null
                gas: '288095'
                gasPrice: '7062490000'
                issues:
                  allowance:
                    actual: '0'
                    spender: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                  balance:
                    token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    actual: '0'
                    expected: '100000000'
                  simulationIncomplete: false
                  invalidSourcesPassed: []
                liquidityAvailable: true
                minBuyAmount: '99032421'
                route:
                  fills:
                    - from: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      to: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      source: SolidlyV3
                      proportionBps: '10000'
                  tokens:
                    - address: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      symbol: USDC
                    - address: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      symbol: USDT
                sellAmount: '100000000'
                sellToken: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                tokenMetadata:
                  buyToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                  sellToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                totalNetworkFee: '2034668056550000'
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED'
                  - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED'
        '403':
          description: 403 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE'
        '422':
          description: 422 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
                  - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /swap/permit2/quote:
    get:
      operationId: swap::permit2::getQuote
      summary: getQuote (Permit2)
      description: Get the firm quote for a swap using Permit2 to set allowances
      tags:
        - Swap
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
        - name: buyToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to buy
          example: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
        - name: sellToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to sell
          example: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: sellAmount
          in: query
          required: true
          schema:
            type: string
          description: The amount of `sellToken` in `sellToken` base units to sell
          example: '100000000'
        - name: taker
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address which holds the `sellToken` balance and has the
            allowance set for the swap
          example: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
        - name: txOrigin
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the external account that started the
            transaction. This is only needed if `taker` is a smart contract.
        - name: swapFeeRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The wallet address to receive the specified trading fees. You must
            also specify the `swapFeeToken` and `swapFeeBps` in the request to
            use this feature. Learn more about setting up a trading
            fee/commission in the FAQs
        - name: swapFeeBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 1000
          description: >-
            The amount in Bps of the `swapFeeToken` to charge and deliver to the
            `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and
            `swapFeeToken` in the request to use this feature. For security,
            this field has a default limit of 1000 Bps. If your application
            requires a higher value, please reach out to us.
        - name: swapFeeToken
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to receive trading fees in. This
            must be set to the value of either the `buyToken` or the
            `sellToken`. You must also specify the `swapFeeRecipient` and
            `swapFeeBps` in the request to use this feature
        - name: tradeSurplusRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address to receive any trade surplus. If specified, this address
            will receive trade surplus when applicable. Otherwise, the `taker`
            will receive the surplus
        - name: gasPrice
          in: query
          required: false
          schema:
            type: string
          description: >-
            The target gas price (in wei) for the swap transaction. If not
            provided, the default value is based on the XFT gas price oracle
        - name: slippageBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 10000
            default: 100
          description: >-
            The maximum acceptable slippage of the `buyToken` in Bps. If this
            parameter is set to 0, no slippage will be tolerated. If not
            provided, the default slippage tolerance is 100Bps
        - name: excludedSources
          in: query
          required: false
          schema:
            type: string
          description: >-
            Liquidity sources e.g. Uniswap_V3, SushiSwap, XFT_RFQ to exclude from
            the provided quote. See
            https://api.XFT.org/sources?chainId=<chain_id> with the desired
            chain's ID for a full list of sources. Separate multiple sources
            with a comma
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      blockNumber:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The block number at which the liquidity sources were
                          sampled to generate the quote. This indicates the
                          freshness of the quote
                      buyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `buyToken` (in `buyToken` units) that
                          will be bought in the swap
                      buyToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to buy in the swap
                      fees:
                        type: object
                        properties:
                          integratorFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The amount of token charged as the integrator
                                  fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the
                                  integrator fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The specified fee to charge and deliver to the
                              `swapFeeRecipient`.
                          zeroExFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the XFT fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address of the token charged as the XFT fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: The fee charged by XFT for the trade.
                          gasFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the gas fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the gas
                                  fee
                              type:
                                type: string
                                enum:
                                  - gas
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The gas fee to be used in submitting the
                              transaction.
                        required:
                          - integratorFee
                          - zeroExFee
                          - gasFee
                        additionalProperties: false
                      issues:
                        type: object
                        properties:
                          allowance:
                            type: object
                            properties:
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The `taker`'s current allowance of the
                                  `spender`
                              spender:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address to set the allowance on
                            required:
                              - actual
                              - spender
                            additionalProperties: false
                            description: >-
                              Details of allowances that the `taker` must set
                              for in order to execute the swap successfully.
                              Null if no allowance is required
                            nullable: true
                          balance:
                            type: object
                            properties:
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The contract address of the `sellToken`
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The current balance of the `sellToken` in the
                                  `taker` address
                              expected:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The balance of the `sellToken` required for
                                  the swap to execute successfully
                            required:
                              - token
                              - actual
                              - expected
                            additionalProperties: false
                            description: >-
                              Details of balance of the `sellToken` that the
                              `taker` must hold. Null if the `taker` has
                              sufficient balance
                            nullable: true
                          simulationIncomplete:
                            type: boolean
                            description: >-
                              This is set to `true` when XFT cannot validate the
                              transaction. This happens when the `taker` has an
                              insufficient balance of the `sellToken` and XFT is
                              unable to peform ehanced quote validation with the
                              low balance. Note that this does not necessarily
                              mean that the trade will revert
                          invalidSourcesPassed:
                            type: array
                            items:
                              type: string
                            description: >-
                              A list of invalid sources present in
                              `excludedSources` request. See
                              https://api.XFT.org/sources?chainId= with the
                              desired chain's ID for the list of valid sources
                        required:
                          - allowance
                          - balance
                          - simulationIncomplete
                          - invalidSourcesPassed
                        additionalProperties: false
                        description: >-
                          An object containing potential issues discovered
                          during XFT validation that can prevent the swap from
                          being executed successfully by the `taker`
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. The rest of the fields will only be
                          returned if `true`
                      minBuyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The price which must be met or else the transaction
                          will revert. This price is influenced by the
                          `slippageBps` parameter. On-chain sources may
                          encounter price movements from quote to settlement
                      permit2:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - Permit2
                            description: '`Permit2`'
                          hash:
                            type: string
                            description: >-
                              The hash for the approval according to
                              [EIP-712](https://eips.ethereum.org/EIPS/eip-712).
                              If you compute the hash from eip712 field, it
                              should match the value of this field
                          eip712:
                            type: object
                            properties:
                              types:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                              domain:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  version:
                                    type: string
                                  chainId:
                                    type: number
                                  verifyingContract:
                                    type: string
                                  salt:
                                    type: string
                                additionalProperties: false
                              message:
                                type: object
                                additionalProperties:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                    - type: number
                                    - type: array
                                      items:
                                        type: number
                                    - type: boolean
                                    - type: array
                                      items:
                                        type: boolean
                                    - {}
                                    - type: array
                                      items: {}
                              primaryType:
                                type: string
                            required:
                              - types
                              - domain
                              - message
                              - primaryType
                            additionalProperties: false
                            description: >-
                              Necessary data for
                              [EIP-712](https://eips.ethereum.org/EIPS/eip-712)
                        required:
                          - type
                          - hash
                          - eip712
                        additionalProperties: false
                        description: >-
                          This is the approval object which contains the
                          necessary fields to submit an approval for this
                          transaction. Null if sell token is the native token or
                          the transaction is a native token wrap / unwrap
                        nullable: true
                      route:
                        type: object
                        properties:
                          fills:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the input token
                                to:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the output token
                                source:
                                  type: string
                                  description: The liquidity source used in the route
                                proportionBps:
                                  allOf:
                                    - {}
                                    - type: string
                                      pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                  description: >-
                                    The proportion of the trade to be filled by
                                    the `source`
                              required:
                                - from
                                - to
                                - source
                                - proportionBps
                              additionalProperties: false
                            description: >-
                              Details of each segment that XFT routes the swap
                              through
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: >-
                                    The token address. This is the unique
                                    identifier of the token
                                symbol:
                                  type: string
                                  description: >-
                                    The token symbol. This is not guaranteed to
                                    be unique, as multiple tokens can have the
                                    same symbol
                              required:
                                - address
                                - symbol
                              additionalProperties: false
                              description: Properties of the tokens involved in the swap
                            description: Properties of the tokens involved in the swap
                        required:
                          - fills
                          - tokens
                        additionalProperties: false
                        description: >-
                          The path of liquidity sources to be used in executing
                          this swap
                      sellAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `sellToken` (in `sellToken` units) that
                          will be sold in this swap
                      sellToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to sell in the swap
                      tokenMetadata:
                        type: object
                        properties:
                          buyToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the buy token
                          sellToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the sell token
                        required:
                          - buyToken
                          - sellToken
                        additionalProperties: false
                        description: >-
                          Swap-related metadata for the buy and sell token in
                          the swap
                      totalNetworkFee:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        nullable: true
                        description: >-
                          The estimated total network cost of the swap. On
                          chains where there is no L1 data cost, it is
                          calculated as `gas` * `gasPrice. On chains where there
                          is an L1 data cost, it is calculated as `gas` *
                          `gasPrice + L1 data
                      transaction:
                        type: object
                        properties:
                          to:
                            type: string
                            pattern: ^XFT[a-fA-F0-9]{40}$
                            description: >-
                              The address of the target contract to send call
                              `data` to
                          data:
                            type: string
                            description: >-
                              The calldata containing transaction execution
                              details to be sent to the `to` address
                          gas:
                            allOf:
                              - {}
                              - type: string
                                pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                            nullable: true
                            description: >-
                              The estimated gas limit that should be used to
                              send the transaction to guarantee settlement
                          gasPrice:
                            allOf:
                              - {}
                              - type: string
                                pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                            description: >-
                              The gas price (in wei) that should be used to send
                              the transaction
                          value:
                            allOf:
                              - {}
                              - type: string
                                pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                            description: >-
                              The amount of ether (in wei) that should be sent
                              with the transaction
                        required:
                          - to
                          - data
                          - gas
                          - gasPrice
                          - value
                        additionalProperties: false
                        description: >-
                          This object contains the details required to submit
                          the transaction
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - blockNumber
                      - buyAmount
                      - buyToken
                      - fees
                      - issues
                      - liquidityAvailable
                      - minBuyAmount
                      - permit2
                      - route
                      - sellAmount
                      - sellToken
                      - tokenMetadata
                      - totalNetworkFee
                      - transaction
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - false
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. No other fields will be returned if
                          it is `false`
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - liquidityAvailable
                      - zid
                    additionalProperties: false
              example:
                blockNumber: '20114692'
                buyAmount: '100037537'
                buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                fees:
                  integratorFee: null
                  zeroExFee: null
                  gasFee: null
                issues:
                  allowance:
                    actual: '0'
                    spender: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                  balance:
                    token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    actual: '0'
                    expected: '100000000'
                  simulationIncomplete: false
                  invalidSourcesPassed: []
                liquidityAvailable: true
                minBuyAmount: '99037162'
                permit2:
                  type: Permit2
                  hash: >-
                    XFTab0c8909f2f8daed2891abb5e93762c65787e0067ef2ab9184bb635ad0f3df51
                  eip712:
                    types:
                      PermitTransferFrom:
                        - name: permitted
                          type: TokenPermissions
                        - name: spender
                          type: address
                        - name: nonce
                          type: uint256
                        - name: deadline
                          type: uint256
                      TokenPermissions:
                        - name: token
                          type: address
                        - name: amount
                          type: uint256
                      EIP712Domain:
                        - name: name
                          type: string
                        - name: chainId
                          type: uint256
                        - name: verifyingContract
                          type: address
                    domain:
                      name: Permit2
                      chainId: 1
                      verifyingContract: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                    message:
                      permitted:
                        token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                        amount: '100000000'
                      spender: 'XFT7f6cee965959295cc64d0e6c00d99d6532d8e86b'
                      nonce: '2241959297937691820908574931991575'
                      deadline: '1718669420'
                    primaryType: PermitTransferFrom
                route:
                  fills:
                    - from: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      to: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      source: SolidlyV3
                      proportionBps: '10000'
                  tokens:
                    - address: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      symbol: USDC
                    - address: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      symbol: USDT
                sellAmount: '100000000'
                sellToken: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                tokenMetadata:
                  buyToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                  sellToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                totalNetworkFee: '1393685870940000'
                transaction:
                  to: 'XFT7f6cee965959295cc64d0e6c00d99d6532d8e86b'
                  data: >-
                    XFT1fff991f00000000000000000000000070a9f34f9b34c64957b9c401a97bfed35b95049e000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000005e72fea00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000144c1fb425e0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000006e898131631616b1779bad70bc17000000000000000000000000000000000000000000000000000000006670d06c00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016438c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000027100000000000000000000000006146be494fee4c73540cb1c5f87536abf1452500000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000001000276a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                  gas: '288079'
                  gasPrice: '4837860000'
                  value: '0'
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED'
                  - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED'
        '403':
          description: 403 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE'
        '422':
          description: 422 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
                  - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /swap/allowance-holder/price:
    get:
      operationId: swap::allowanceHolder::getPrice
      summary: getPrice (Allowance Holder)
      description: >-
        Get the indicative price for a swap using Allowance Holder to set
        allowances
      tags:
        - Swap
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
        - name: buyToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to buy
          example: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
        - name: sellToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to sell
          example: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: sellAmount
          in: query
          required: true
          schema:
            type: string
          description: The amount of `sellToken` in `sellToken` base units to sell
          example: '100000000'
        - name: taker
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address which holds the `sellToken` balance and has the
            allowance set for the swap
          example: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
        - name: txOrigin
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the external account that started the
            transaction. This is only needed if `taker` is a smart contract.
        - name: swapFeeRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The wallet address to receive the specified trading fees. You must
            also specify the `swapFeeToken` and `swapFeeBps` in the request to
            use this feature. Learn more about setting up a trading
            fee/commission in the FAQs
        - name: swapFeeBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 1000
          description: >-
            The amount in Bps of the `swapFeeToken` to charge and deliver to the
            `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and
            `swapFeeToken` in the request to use this feature. For security,
            this field has a default limit of 1000 Bps. If your application
            requires a higher value, please reach out to us.
        - name: swapFeeToken
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to receive trading fees in. This
            must be set to the value of either the `buyToken` or the
            `sellToken`. You must also specify the `swapFeeRecipient` and
            `swapFeeBps` in the request to use this feature
        - name: tradeSurplusRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address to receive any trade surplus. If specified, this address
            will receive trade surplus when applicable. Otherwise, the `taker`
            will receive the surplus
        - name: gasPrice
          in: query
          required: false
          schema:
            type: string
          description: >-
            The target gas price (in wei) for the swap transaction. If not
            provided, the default value is based on the XFT gas price oracle
        - name: slippageBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 10000
            default: 100
          description: >-
            The maximum acceptable slippage of the `buyToken` in Bps. If this
            parameter is set to 0, no slippage will be tolerated. If not
            provided, the default slippage tolerance is 100Bps
        - name: excludedSources
          in: query
          required: false
          schema:
            type: string
          description: >-
            Liquidity sources e.g. Uniswap_V3, SushiSwap, XFT_RFQ to exclude from
            the provided quote. See
            https://api.XFT.org/sources?chainId=<chain_id> with the desired
            chain's ID for a full list of sources. Separate multiple sources
            with a comma
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      blockNumber:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The block number at which the liquidity sources were
                          sampled to generate the quote. This indicates the
                          freshness of the quote
                      buyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `buyToken` (in `buyToken` units) that
                          will be bought in the swap
                      buyToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to buy in the swap
                      fees:
                        type: object
                        properties:
                          integratorFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The amount of token charged as the integrator
                                  fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the
                                  integrator fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The specified fee to charge and deliver to the
                              `swapFeeRecipient`.
                          zeroExFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the XFT fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address of the token charged as the XFT fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: The fee charged by XFT for the trade.
                          gasFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the gas fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the gas
                                  fee
                              type:
                                type: string
                                enum:
                                  - gas
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The gas fee to be used in submitting the
                              transaction.
                        required:
                          - integratorFee
                          - zeroExFee
                          - gasFee
                        additionalProperties: false
                        description: >-
                          Fees to be deducted in this transaction. It contains
                          the `integratorFee`, `zeroExFee` and `gasFee`
                      gas:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        nullable: true
                        description: >-
                          The estimated gas limit that should be used to send
                          the transaction to guarantee settlement
                      gasPrice:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The gas price (in wei) that should be used to send the
                          transaction. The transaction needs to be sent with
                          this `gasPrice` for the transaction to be successful
                      issues:
                        type: object
                        properties:
                          allowance:
                            type: object
                            properties:
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The `taker`'s current allowance of the
                                  `spender`
                              spender:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address to set the allowance on
                            required:
                              - actual
                              - spender
                            additionalProperties: false
                            description: >-
                              Details of allowances that the `taker` must set
                              for in order to execute the swap successfully.
                              Null if no allowance is required
                            nullable: true
                          balance:
                            type: object
                            properties:
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The contract address of the `sellToken`
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The current balance of the `sellToken` in the
                                  `taker` address
                              expected:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The balance of the `sellToken` required for
                                  the swap to execute successfully
                            required:
                              - token
                              - actual
                              - expected
                            additionalProperties: false
                            description: >-
                              Details of balance of the `sellToken` that the
                              `taker` must hold. Null if the `taker` has
                              sufficient balance
                            nullable: true
                          simulationIncomplete:
                            type: boolean
                            description: >-
                              This is set to `true` when XFT cannot validate the
                              transaction. This happens when the `taker` has an
                              insufficient balance of the `sellToken` and XFT is
                              unable to peform ehanced quote validation with the
                              low balance. Note that this does not necessarily
                              mean that the trade will revert
                          invalidSourcesPassed:
                            type: array
                            items:
                              type: string
                            description: >-
                              A list of invalid sources present in
                              `excludedSources` request. See
                              https://api.XFT.org/sources?chainId= with the
                              desired chain's ID for the list of valid sources
                        required:
                          - allowance
                          - balance
                          - simulationIncomplete
                          - invalidSourcesPassed
                        additionalProperties: false
                        description: >-
                          An object containing potential issues discovered
                          during XFT validation that can prevent the swap from
                          being executed successfully by the `taker`
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. The rest of the fields will only be
                          returned if `true`
                      minBuyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The price which must be met or else the entire
                          transaction will revert. This price is influenced by
                          the `slippageBps` parameter. On-chain sources may
                          encounter price movements from quote to settlement
                      route:
                        type: object
                        properties:
                          fills:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the input token
                                to:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the output token
                                source:
                                  type: string
                                  description: The liquidity source used in the route
                                proportionBps:
                                  allOf:
                                    - {}
                                    - type: string
                                      pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                  description: >-
                                    The proportion of the trade to be filled by
                                    the `source`
                              required:
                                - from
                                - to
                                - source
                                - proportionBps
                              additionalProperties: false
                            description: >-
                              Details of each segment that XFT routes the swap
                              through
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: >-
                                    The token address. This is the unique
                                    identifier of the token
                                symbol:
                                  type: string
                                  description: >-
                                    The token symbol. This is not guaranteed to
                                    be unique, as multiple tokens can have the
                                    same symbol
                              required:
                                - address
                                - symbol
                              additionalProperties: false
                              description: Properties of the tokens involved in the swap
                            description: Properties of the tokens involved in the swap
                        required:
                          - fills
                          - tokens
                        additionalProperties: false
                        description: >-
                          The path of liquidity sources to be used in executing
                          this swap
                      sellAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `sellToken` (in `sellToken` units) that
                          will be sold in this swap
                      sellToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to sell in the swap
                      tokenMetadata:
                        type: object
                        properties:
                          buyToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the buy token
                          sellToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the sell token
                        required:
                          - buyToken
                          - sellToken
                        additionalProperties: false
                        description: >-
                          Swap-related metadata for the buy and sell token in
                          the swap
                      totalNetworkFee:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        nullable: true
                        description: >-
                          The estimated total network cost of the swap. On
                          chains where there is no L1 data cost, it is
                          calculated as `gas` * `gasPrice. On chains where there
                          is an L1 data cost, it is calculated as `gas` *
                          `gasPrice + L1 data
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - blockNumber
                      - buyAmount
                      - buyToken
                      - fees
                      - gas
                      - gasPrice
                      - issues
                      - liquidityAvailable
                      - minBuyAmount
                      - route
                      - sellAmount
                      - sellToken
                      - tokenMetadata
                      - totalNetworkFee
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - false
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. No other fields will be returned if
                          it is `false`
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - liquidityAvailable
                      - zid
                    additionalProperties: false
              example:
                blockNumber: '20114676'
                buyAmount: '100032748'
                buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                fees:
                  integratorFee: null
                  zeroExFee: null
                  gasFee: null
                gas: '288095'
                gasPrice: '7062490000'
                issues:
                  allowance:
                    actual: '0'
                    spender: 'XFT0000000000001ff3684f28c67538d4d072c22734'
                  balance:
                    token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    actual: '0'
                    expected: '100000000'
                  simulationIncomplete: false
                  invalidSourcesPassed: []
                liquidityAvailable: true
                minBuyAmount: '99032421'
                route:
                  fills:
                    - from: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      to: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      source: SolidlyV3
                      proportionBps: '10000'
                  tokens:
                    - address: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      symbol: USDC
                    - address: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      symbol: USDT
                sellAmount: '100000000'
                sellToken: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                tokenMetadata:
                  buyToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                  sellToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                totalNetworkFee: '2034668056550000'
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED'
                  - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED'
        '403':
          description: 403 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE'
        '422':
          description: 422 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
                  - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /swap/allowance-holder/quote:
    get:
      operationId: swap::allowanceHolder::getQuote
      summary: getQuote (Allowance Holder)
      description: Get the firm quote for a swap using Allowance Holder to set allowances
      tags:
        - Swap
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
        - name: buyToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to buy
          example: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
        - name: sellToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to sell
          example: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: sellAmount
          in: query
          required: true
          schema:
            type: string
          description: The amount of `sellToken` in `sellToken` base units to sell
          example: '100000000'
        - name: taker
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address which holds the `sellToken` balance and has the
            allowance set for the swap
          example: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
        - name: txOrigin
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the external account that started the
            transaction. This is only needed if `taker` is a smart contract.
        - name: swapFeeRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The wallet address to receive the specified trading fees. You must
            also specify the `swapFeeToken` and `swapFeeBps` in the request to
            use this feature. Learn more about setting up a trading
            fee/commission in the FAQs
        - name: swapFeeBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 1000
          description: >-
            The amount in Bps of the `swapFeeToken` to charge and deliver to the
            `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and
            `swapFeeToken` in the request to use this feature. For security,
            this field has a default limit of 1000 Bps. If your application
            requires a higher value, please reach out to us.
        - name: swapFeeToken
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to receive trading fees in. This
            must be set to the value of either the `buyToken` or the
            `sellToken`. You must also specify the `swapFeeRecipient` and
            `swapFeeBps` in the request to use this feature
        - name: tradeSurplusRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address to receive any trade surplus. If specified, this address
            will receive trade surplus when applicable. Otherwise, the `taker`
            will receive the surplus
        - name: gasPrice
          in: query
          required: false
          schema:
            type: string
          description: >-
            The target gas price (in wei) for the swap transaction. If not
            provided, the default value is based on the XFT gas price oracle
        - name: slippageBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 10000
            default: 100
          description: >-
            The maximum acceptable slippage of the `buyToken` in Bps. If this
            parameter is set to 0, no slippage will be tolerated. If not
            provided, the default slippage tolerance is 100Bps
        - name: excludedSources
          in: query
          required: false
          schema:
            type: string
          description: >-
            Liquidity sources e.g. Uniswap_V3, SushiSwap, XFT_RFQ to exclude from
            the provided quote. See
            https://api.XFT.org/sources?chainId=<chain_id> with the desired
            chain's ID for a full list of sources. Separate multiple sources
            with a comma
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      blockNumber:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The block number at which the liquidity sources were
                          sampled to generate the quote. This indicates the
                          freshness of the quote
                      buyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `buyToken` (in `buyToken` units) that
                          will be bought in the swap
                      buyToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to buy in the swap
                      fees:
                        type: object
                        properties:
                          integratorFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The amount of token charged as the integrator
                                  fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the
                                  integrator fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The specified fee to charge and deliver to the
                              `swapFeeRecipient`.
                          zeroExFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the XFT fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address of the token charged as the XFT fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: The fee charged by XFT for the trade.
                          gasFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the gas fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the gas
                                  fee
                              type:
                                type: string
                                enum:
                                  - gas
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The gas fee to be used in submitting the
                              transaction.
                        required:
                          - integratorFee
                          - zeroExFee
                          - gasFee
                        additionalProperties: false
                      issues:
                        type: object
                        properties:
                          allowance:
                            type: object
                            properties:
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The `taker`'s current allowance of the
                                  `spender`
                              spender:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address to set the allowance on
                            required:
                              - actual
                              - spender
                            additionalProperties: false
                            description: >-
                              Details of allowances that the `taker` must set
                              for in order to execute the swap successfully.
                              Null if no allowance is required
                            nullable: true
                          balance:
                            type: object
                            properties:
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The contract address of the `sellToken`
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The current balance of the `sellToken` in the
                                  `taker` address
                              expected:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The balance of the `sellToken` required for
                                  the swap to execute successfully
                            required:
                              - token
                              - actual
                              - expected
                            additionalProperties: false
                            description: >-
                              Details of balance of the `sellToken` that the
                              `taker` must hold. Null if the `taker` has
                              sufficient balance
                            nullable: true
                          simulationIncomplete:
                            type: boolean
                            description: >-
                              This is set to `true` when XFT cannot validate the
                              transaction. This happens when the `taker` has an
                              insufficient balance of the `sellToken` and XFT is
                              unable to peform ehanced quote validation with the
                              low balance. Note that this does not necessarily
                              mean that the trade will revert
                          invalidSourcesPassed:
                            type: array
                            items:
                              type: string
                            description: >-
                              A list of invalid sources present in
                              `excludedSources` request. See
                              https://api.XFT.org/sources?chainId= with the
                              desired chain's ID for the list of valid sources
                        required:
                          - allowance
                          - balance
                          - simulationIncomplete
                          - invalidSourcesPassed
                        additionalProperties: false
                        description: >-
                          An object containing potential issues discovered
                          during XFT validation that can prevent the swap from
                          being executed successfully by the `taker`
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. The rest of the fields will only be
                          returned if `true`
                      minBuyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The price which must be met or else the transaction
                          will revert. This price is influenced by the
                          `slippageBps` parameter. On-chain sources may
                          encounter price movements from quote to settlement
                      route:
                        type: object
                        properties:
                          fills:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the input token
                                to:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the output token
                                source:
                                  type: string
                                  description: The liquidity source used in the route
                                proportionBps:
                                  allOf:
                                    - {}
                                    - type: string
                                      pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                  description: >-
                                    The proportion of the trade to be filled by
                                    the `source`
                              required:
                                - from
                                - to
                                - source
                                - proportionBps
                              additionalProperties: false
                            description: >-
                              Details of each segment that XFT routes the swap
                              through
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: >-
                                    The token address. This is the unique
                                    identifier of the token
                                symbol:
                                  type: string
                                  description: >-
                                    The token symbol. This is not guaranteed to
                                    be unique, as multiple tokens can have the
                                    same symbol
                              required:
                                - address
                                - symbol
                              additionalProperties: false
                              description: Properties of the tokens involved in the swap
                            description: Properties of the tokens involved in the swap
                        required:
                          - fills
                          - tokens
                        additionalProperties: false
                        description: >-
                          The path of liquidity sources to be used in executing
                          this swap
                      sellAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `sellToken` (in `sellToken` units) that
                          will be sold in this swap
                      sellToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to sell in the swap
                      tokenMetadata:
                        type: object
                        properties:
                          buyToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the buy token
                          sellToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the sell token
                        required:
                          - buyToken
                          - sellToken
                        additionalProperties: false
                        description: >-
                          Swap-related metadata for the buy and sell token in
                          the swap
                      totalNetworkFee:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        nullable: true
                        description: >-
                          The estimated total network cost of the swap. On
                          chains where there is no L1 data cost, it is
                          calculated as `gas` * `gasPrice. On chains where there
                          is an L1 data cost, it is calculated as `gas` *
                          `gasPrice + L1 data
                      transaction:
                        type: object
                        properties:
                          to:
                            type: string
                            pattern: ^XFT[a-fA-F0-9]{40}$
                            description: >-
                              The address of the target contract to send call
                              `data` to
                          data:
                            type: string
                            description: >-
                              The calldata containing transaction execution
                              details to be sent to the `to` address
                          gas:
                            allOf:
                              - {}
                              - type: string
                                pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                            nullable: true
                            description: >-
                              The estimated gas limit that should be used to
                              send the transaction to guarantee settlement
                          gasPrice:
                            allOf:
                              - {}
                              - type: string
                                pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                            description: >-
                              The gas price (in wei) that should be used to send
                              the transaction
                          value:
                            allOf:
                              - {}
                              - type: string
                                pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                            description: >-
                              The amount of ether (in wei) that should be sent
                              with the transaction
                        required:
                          - to
                          - data
                          - gas
                          - gasPrice
                          - value
                        additionalProperties: false
                        description: >-
                          This object contains the details required to submit
                          the transaction
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - blockNumber
                      - buyAmount
                      - buyToken
                      - fees
                      - issues
                      - liquidityAvailable
                      - minBuyAmount
                      - route
                      - sellAmount
                      - sellToken
                      - tokenMetadata
                      - totalNetworkFee
                      - transaction
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - false
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. No other fields will be returned if
                          it is `false`
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - liquidityAvailable
                      - zid
                    additionalProperties: false
              example:
                blockNumber: '20114692'
                buyAmount: '100037537'
                buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                fees:
                  integratorFee: null
                  zeroExFee: null
                  gasFee: null
                issues:
                  allowance:
                    actual: '0'
                    spender: 'XFT0000000000001ff3684f28c67538d4d072c22734'
                  balance:
                    token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    actual: '0'
                    expected: '100000000'
                  simulationIncomplete: false
                  invalidSourcesPassed: []
                liquidityAvailable: true
                minBuyAmount: '99037162'
                route:
                  fills:
                    - from: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      to: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      source: SolidlyV3
                      proportionBps: '10000'
                  tokens:
                    - address: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      symbol: USDC
                    - address: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      symbol: USDT
                sellAmount: '100000000'
                sellToken: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                tokenMetadata:
                  buyToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                  sellToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                totalNetworkFee: '1393685870940000'
                transaction:
                  to: 'XFT7f6cee965959295cc64d0e6c00d99d6532d8e86b'
                  data: >-
                    XFT1fff991f00000000000000000000000070a9f34f9b34c64957b9c401a97bfed35b95049e000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec70000000000000000000000000000000000000000000000000000000005e72fea00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c00000000000000000000000000000000000000000000000000000000000000144c1fb425e0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000006e898131631616b1779bad70bc17000000000000000000000000000000000000000000000000000000006670d06c00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000041ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016438c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000027100000000000000000000000006146be494fee4c73540cb1c5f87536abf1452500000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000007f6cee965959295cc64d0e6c00d99d6532d8e86b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000001000276a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                  gas: '288079'
                  gasPrice: '4837860000'
                  value: '0'
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED'
                  - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED'
        '403':
          description: 403 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE'
        '422':
          description: 422 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
                  - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /gasless/price:
    get:
      operationId: gasless::getPrice
      summary: getPrice
      description: Get the indicative price for a gasless swap
      tags:
        - Gasless
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
        - name: buyToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to buy
          example: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
        - name: sellToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to sell. Native token is not
            supported
          example: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: sellAmount
          in: query
          required: true
          schema:
            type: string
          description: The amount of `sellToken` in `sellToken` base units to sell
          example: '300000000'
        - name: taker
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address which holds the `sellToken` balance and has the
            allowance set for the swap
          example: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
        - name: swapFeeRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The wallet address to receive the specified trading fees. You must
            also specify the `swapFeeToken` and `swapFeeBps` in the request to
            use this feature. Learn more about setting up a trading
            fee/commission in the FAQs
        - name: swapFeeBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 1000
          description: >-
            The amount in Bps of the `swapFeeToken` to charge and deliver to the
            `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and
            `swapFeeToken` in the request to use this feature. For security,
            this field has a default limit of 1000 Bps. If your application
            requires a higher value, please reach out to us.
        - name: swapFeeToken
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to receive trading fees in. This
            must be set to the value of either the `buyToken` or the
            `sellToken`. You must also specify the `swapFeeRecipient` and
            `swapFeeBps` in the request to use this feature
        - name: tradeSurplusRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address to receive any trade surplus. If specified, this address
            will receive trade surplus when applicable. Otherwise, the `taker`
            will receive the surplus
        - name: slippageBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 30
            maximum: 10000
          description: >-
            The maximum acceptable slippage of the `buyToken` in Bps. XFT sets
            the optimal slippage tolerance per trade by default. To mitigate the
            risk of MEV attacks, we recommend adjusting this value only when
            trading low-liquidity tokens.
        - name: excludedSources
          in: query
          required: false
          schema:
            type: string
          description: >-
            Liquidity sources e.g. Uniswap_V3, SushiSwap, XFT_RFQ to exclude from
            the provided quote. See
            https://api.XFT.org/sources?chainId=<chain_id> with the desired
            chain's ID for a full list of sources. Separate multiple sources
            with a comma
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      blockNumber:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The block number at which the liquidity sources were
                          sampled to generate the quote. This indicates the
                          freshness of the quote
                      buyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `buyToken` (in `buyToken` units) that
                          will be bought in the swap
                      buyToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to buy in the swap
                      fees:
                        type: object
                        properties:
                          integratorFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The amount of token charged as the integrator
                                  fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the
                                  integrator fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The specified fee to charge and deliver to the
                              `swapFeeRecipient`.
                          zeroExFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the XFT fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address of the token charged as the XFT fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: The fee charged by XFT for the trade.
                          gasFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the gas fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the gas
                                  fee
                              type:
                                type: string
                                enum:
                                  - gas
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The gas fee to be used in submitting the
                              transaction.
                        required:
                          - integratorFee
                          - zeroExFee
                          - gasFee
                        additionalProperties: false
                        description: >-
                          Fees to be deducted in this transaction. It contains
                          the `integratorFee`, `zeroExFee` and `gasFee`
                      issues:
                        type: object
                        properties:
                          allowance:
                            type: object
                            properties:
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The `taker`'s current allowance of the
                                  `spender`
                              spender:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address to set the allowance on
                            required:
                              - actual
                              - spender
                            additionalProperties: false
                            description: >-
                              Details of allowances that the `taker` must set
                              for in order to execute the swap successfully.
                              Null if no allowance is required
                            nullable: true
                          balance:
                            type: object
                            properties:
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The contract address of the `sellToken`
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The current balance of the `sellToken` in the
                                  `taker` address
                              expected:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The balance of the `sellToken` required for
                                  the swap to execute successfully
                            required:
                              - token
                              - actual
                              - expected
                            additionalProperties: false
                            description: >-
                              Details of balance of the `sellToken` that the
                              `taker` must hold. Null if the `taker` has
                              sufficient balance
                            nullable: true
                          simulationIncomplete:
                            type: boolean
                            description: >-
                              This is set to `true` when XFT cannot validate the
                              transaction. This happens when the `taker` has an
                              insufficient balance of the `sellToken` and XFT is
                              unable to peform ehanced quote validation with the
                              low balance. Note that this does not necessarily
                              mean that the trade will revert
                          invalidSourcesPassed:
                            type: array
                            items:
                              type: string
                            description: >-
                              A list of invalid sources present in
                              `excludedSources` request. See
                              https://api.XFT.org/sources?chainId= with the
                              desired chain's ID for the list of valid sources
                        required:
                          - allowance
                          - balance
                          - simulationIncomplete
                          - invalidSourcesPassed
                        additionalProperties: false
                        description: >-
                          An object containing potential issues discovered
                          during XFT validation that can prevent the swap from
                          being executed successfully by the `taker`
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. The rest of the fields will only be
                          returned if `true`
                      minBuyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The price which must be met or else the entire
                          transaction will revert. This price is influenced by
                          the `slippageBps` parameter. On-chain sources may
                          encounter price movements from quote to settlement
                      route:
                        type: object
                        properties:
                          fills:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the input token
                                to:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the output token
                                source:
                                  type: string
                                  description: The liquidity source used in the route
                                proportionBps:
                                  allOf:
                                    - {}
                                    - type: string
                                      pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                  description: >-
                                    The proportion of the trade to be filled by
                                    the `source`
                              required:
                                - from
                                - to
                                - source
                                - proportionBps
                              additionalProperties: false
                            description: >-
                              Details of each segment that XFT routes the swap
                              through
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: >-
                                    The token address. This is the unique
                                    identifier of the token
                                symbol:
                                  type: string
                                  description: >-
                                    The token symbol. This is not guaranteed to
                                    be unique, as multiple tokens can have the
                                    same symbol
                              required:
                                - address
                                - symbol
                              additionalProperties: false
                              description: Properties of the tokens involved in the swap
                            description: Properties of the tokens involved in the swap
                        required:
                          - fills
                          - tokens
                        additionalProperties: false
                        description: >-
                          The path of liquidity sources to be used in executing
                          this swap
                      sellAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `sellToken` (in `sellToken` units) that
                          will be sold in this swap
                      sellToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to sell in the swap
                      target:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: >-
                          The address of the target contract that the
                          transaction will be submitted to
                      tokenMetadata:
                        type: object
                        properties:
                          buyToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the buy token
                          sellToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the sell token
                        required:
                          - buyToken
                          - sellToken
                        additionalProperties: false
                        description: >-
                          Swap-related metadata for the buy and sell token in
                          the swap
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - blockNumber
                      - buyAmount
                      - buyToken
                      - fees
                      - issues
                      - liquidityAvailable
                      - minBuyAmount
                      - route
                      - sellAmount
                      - sellToken
                      - target
                      - tokenMetadata
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - false
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. No other fields will be returned if
                          it is `false`
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - liquidityAvailable
                      - zid
                    additionalProperties: false
              example:
                blockNumber: '20114764'
                buyAmount: '291527064'
                buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                fees:
                  integratorFee: null
                  zeroExFee:
                    amount: '150053'
                    token: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                    type: volume
                  gasFee:
                    amount: '8430138'
                    token: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                    type: gas
                issues:
                  allowance:
                    actual: '0'
                    spender: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                  balance:
                    token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    actual: '0'
                    expected: '300000000'
                  simulationIncomplete: false
                  invalidSourcesPassed: []
                liquidityAvailable: true
                minBuyAmount: '290652483'
                route:
                  fills:
                    - from: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      to: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      source: SolidlyV3
                      proportionBps: '10000'
                  tokens:
                    - address: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      symbol: USDC
                    - address: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      symbol: USDT
                sellAmount: '300000000'
                sellToken: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                target: 'XFT7c39a136ea20b3483e402ea031c1f3c019bab24b'
                tokenMetadata:
                  buyToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                  sellToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/SELL_AMOUNT_TOO_SMALL'
                  - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED'
                  - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED'
        '403':
          description: 403 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE'
        '422':
          description: 422 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
                  - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /gasless/quote:
    get:
      operationId: gasless::getQuote
      summary: getQuote
      description: Get the firm quote for a gasless swap
      tags:
        - Gasless
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
        - name: buyToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: The contract address of the token to buy
          example: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
        - name: sellToken
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to sell. Native token is not
            supported
          example: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        - name: sellAmount
          in: query
          required: true
          schema:
            type: string
          description: The amount of `sellToken` in `sellToken` base units to sell
          example: '300000000'
        - name: taker
          in: query
          required: true
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address which holds the `sellToken` balance and has the
            allowance set for the swap
          example: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
        - name: swapFeeRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The wallet address to receive the specified trading fees. You must
            also specify the `swapFeeToken` and `swapFeeBps` in the request to
            use this feature. Learn more about setting up a trading
            fee/commission in the FAQs
        - name: swapFeeBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            maximum: 1000
          description: >-
            The amount in Bps of the `swapFeeToken` to charge and deliver to the
            `swapFeeRecipient`. You must also specify the `swapFeeRecipient` and
            `swapFeeToken` in the request to use this feature. For security,
            this field has a default limit of 1000 Bps. If your application
            requires a higher value, please reach out to us.
        - name: swapFeeToken
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The contract address of the token to receive trading fees in. This
            must be set to the value of either the `buyToken` or the
            `sellToken`. You must also specify the `swapFeeRecipient` and
            `swapFeeBps` in the request to use this feature
        - name: tradeSurplusRecipient
          in: query
          required: false
          schema:
            type: string
            pattern: ^XFT[a-fA-F0-9]{40}$
          description: >-
            The address to receive any trade surplus. If specified, this address
            will receive trade surplus when applicable. Otherwise, the `taker`
            will receive the surplus
        - name: slippageBps
          in: query
          required: false
          schema:
            type: integer
            minimum: 30
            maximum: 10000
          description: >-
            The maximum acceptable slippage of the `buyToken` in Bps. XFT sets
            the optimal slippage tolerance per trade by default. To mitigate the
            risk of MEV attacks, we recommend adjusting this value only when
            trading low-liquidity tokens.
        - name: excludedSources
          in: query
          required: false
          schema:
            type: string
          description: >-
            Liquidity sources e.g. Uniswap_V3, SushiSwap, XFT_RFQ to exclude from
            the provided quote. See
            https://api.XFT.org/sources?chainId=<chain_id> with the desired
            chain's ID for a full list of sources. Separate multiple sources
            with a comma
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      approval:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - executeMetaTransaction::approve
                              - permit
                              - daiPermit
                          hash:
                            type: string
                            description: >-
                              The hash for the approval according to
                              [EIP-712](https://eips.ethereum.org/EIPS/eip-712).
                              If you compute the hash from eip712 field, it
                              should match the value of this field
                          eip712:
                            type: object
                            properties:
                              types:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                              domain:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  version:
                                    type: string
                                  chainId:
                                    type: number
                                  verifyingContract:
                                    type: string
                                  salt:
                                    type: string
                                additionalProperties: false
                              message:
                                type: object
                                additionalProperties:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                    - type: number
                                    - type: array
                                      items:
                                        type: number
                                    - type: boolean
                                    - type: array
                                      items:
                                        type: boolean
                                    - {}
                                    - type: array
                                      items: {}
                              primaryType:
                                type: string
                            required:
                              - types
                              - domain
                              - message
                              - primaryType
                            additionalProperties: false
                            description: >-
                              The necessary data for
                              [EIP-712](https://eips.ethereum.org/EIPS/eip-712).
                              Please don't assume static shapes for
                              `approval.eip712.types`, `approval.eip712.domain`,
                              `approval.eip712.primaryType` and
                              `approval.eip712.message` as they will change
                              depending on the `type`
                        required:
                          - type
                          - hash
                          - eip712
                        additionalProperties: false
                        nullable: true
                        description: >-
                          This is the “approval” object which contains the
                          necessary information to process a gasless approval
                      blockNumber:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The block number at which the liquidity sources were
                          sampled to generate the quote. This indicates the
                          freshness of the quote.
                      buyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `buyToken` (in `buyToken` units) that
                          will be bought in the swap
                      buyToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to buy in the swap
                      fees:
                        type: object
                        properties:
                          integratorFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The amount of token charged as the integrator
                                  fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the
                                  integrator fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The specified fee to charge and deliver to the
                              `swapFeeRecipient`.
                          zeroExFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the XFT fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address of the token charged as the XFT fee
                              type:
                                type: string
                                enum:
                                  - volume
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: The fee charged by XFT for the trade.
                          gasFee:
                            type: object
                            properties:
                              amount:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: The amount of token charged as the gas fee
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: >-
                                  The address of the token charged as the gas
                                  fee
                              type:
                                type: string
                                enum:
                                  - gas
                            required:
                              - amount
                              - token
                              - type
                            additionalProperties: false
                            nullable: true
                            description: >-
                              The gas fee to be used in submitting the
                              transaction.
                        required:
                          - integratorFee
                          - zeroExFee
                          - gasFee
                        additionalProperties: false
                      issues:
                        type: object
                        properties:
                          allowance:
                            type: object
                            properties:
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The `taker`'s current allowance of the
                                  `spender`
                              spender:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The address to set the allowance on
                            required:
                              - actual
                              - spender
                            additionalProperties: false
                            description: >-
                              Details of allowances that the `taker` must set
                              for in order to execute the swap successfully.
                              Null if no allowance is required
                            nullable: true
                          balance:
                            type: object
                            properties:
                              token:
                                type: string
                                pattern: ^XFT[a-fA-F0-9]{40}$
                                description: The contract address of the `sellToken`
                              actual:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The current balance of the `sellToken` in the
                                  `taker` address
                              expected:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                description: >-
                                  The balance of the `sellToken` required for
                                  the swap to execute successfully
                            required:
                              - token
                              - actual
                              - expected
                            additionalProperties: false
                            description: >-
                              Details of balance of the `sellToken` that the
                              `taker` must hold. Null if the `taker` has
                              sufficient balance
                            nullable: true
                          simulationIncomplete:
                            type: boolean
                            description: >-
                              This is set to `true` when XFT cannot validate the
                              transaction. This happens when the `taker` has an
                              insufficient balance of the `sellToken` and XFT is
                              unable to peform ehanced quote validation with the
                              low balance. Note that this does not necessarily
                              mean that the trade will revert
                          invalidSourcesPassed:
                            type: array
                            items:
                              type: string
                            description: >-
                              A list of invalid sources present in
                              `excludedSources` request. See
                              https://api.XFT.org/sources?chainId= with the
                              desired chain's ID for the list of valid sources
                        required:
                          - allowance
                          - balance
                          - simulationIncomplete
                          - invalidSourcesPassed
                        additionalProperties: false
                        description: >-
                          An object containing potential issues discovered
                          during XFT validation that can prevent the swap from
                          being executed successfully by the `taker`
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - true
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. The rest of the fields will only be
                          returned if `true`
                      minBuyAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The price which must be met or else the transaction
                          will revert. This price is influenced by the
                          `slippageBps` parameter. On-chain sources may
                          encounter price movements from quote to settlement
                      route:
                        type: object
                        properties:
                          fills:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the input token
                                to:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: The contract address of the output token
                                source:
                                  type: string
                                  description: The liquidity source used in the route
                                proportionBps:
                                  allOf:
                                    - {}
                                    - type: string
                                      pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                  description: >-
                                    The proportion of the trade to be filled by
                                    the `source`
                              required:
                                - from
                                - to
                                - source
                                - proportionBps
                              additionalProperties: false
                            description: >-
                              Details of each segment that XFT routes the swap
                              through
                          tokens:
                            type: array
                            items:
                              type: object
                              properties:
                                address:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                  description: >-
                                    The token address. This is the unique
                                    identifier of the token
                                symbol:
                                  type: string
                                  description: >-
                                    The token symbol. This is not guaranteed to
                                    be unique, as multiple tokens can have the
                                    same symbol
                              required:
                                - address
                                - symbol
                              additionalProperties: false
                              description: Properties of the tokens involved in the swap
                            description: Properties of the tokens involved in the swap
                        required:
                          - fills
                          - tokens
                        additionalProperties: false
                        description: >-
                          The path of liquidity sources to be used in executing
                          this swap
                      sellAmount:
                        allOf:
                          - {}
                          - type: string
                            pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                        description: >-
                          The amount of `sellToken` (in `sellToken` units) that
                          will be sold in this swap
                      sellToken:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: The contract address of the token to sell in the swap
                      target:
                        type: string
                        pattern: ^XFT[a-fA-F0-9]{40}$
                        description: >-
                          The address of the target contract that the
                          transaction will be submitted to
                      tokenMetadata:
                        type: object
                        properties:
                          buyToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the buy token
                          sellToken:
                            type: object
                            properties:
                              buyTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The buy tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                              sellTaxBps:
                                allOf:
                                  - {}
                                  - type: string
                                    pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
                                nullable: true
                                description: >-
                                  The sell tax in bps of the token. Since each
                                  token could have arbitrary implementation,
                                  this field is best effort, meaning it would be
                                  set to `null` if the system is not able to
                                  determine the tax
                            required:
                              - buyTaxBps
                              - sellTaxBps
                            additionalProperties: false
                            description: Swap-related metadata for the sell token
                        required:
                          - buyToken
                          - sellToken
                        additionalProperties: false
                        description: >-
                          Swap-related metadata for the buy and sell token in
                          the swap
                      trade:
                        type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - settler_metatransaction
                            description: >-
                              The transaction type determined by the trade
                              route. This is currently just
                              `settler_metatransaction` and could expand to more
                              types in the future
                          hash:
                            type: string
                            description: >-
                              The hash for the trade according to
                              [EIP-712](https://eips.ethereum.org/EIPS/eip-712).
                              If you compute the hash from eip712 field, it
                              should match the value of this field
                          eip712:
                            type: object
                            properties:
                              types:
                                type: object
                                additionalProperties:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                              domain:
                                type: object
                                properties:
                                  name:
                                    type: string
                                  version:
                                    type: string
                                  chainId:
                                    type: number
                                  verifyingContract:
                                    type: string
                                  salt:
                                    type: string
                                additionalProperties: false
                              message:
                                type: object
                                additionalProperties:
                                  anyOf:
                                    - type: string
                                    - type: array
                                      items:
                                        type: string
                                    - type: number
                                    - type: array
                                      items:
                                        type: number
                                    - type: boolean
                                    - type: array
                                      items:
                                        type: boolean
                                    - {}
                                    - type: array
                                      items: {}
                              primaryType:
                                type: string
                            required:
                              - types
                              - domain
                              - message
                              - primaryType
                            additionalProperties: false
                            description: >-
                              This is the necessary data for
                              [EIP-712](https://eips.ethereum.org/EIPS/eip-712).
                              Please don't assume static shapes for
                              `trade.eip712.types`, `trade.eip712.domain`,
                              `trade.eip712.primaryType` and
                              `trade.eip712.message` as they will change
                              depending on the `type`
                        required:
                          - type
                          - hash
                          - eip712
                        additionalProperties: false
                        description: >-
                          This is the “trade” object which contains the
                          necessary information to process a gasless trade
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - approval
                      - blockNumber
                      - buyAmount
                      - buyToken
                      - fees
                      - issues
                      - liquidityAvailable
                      - minBuyAmount
                      - route
                      - sellAmount
                      - sellToken
                      - target
                      - tokenMetadata
                      - trade
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      liquidityAvailable:
                        type: boolean
                        enum:
                          - false
                        description: >-
                          This validates the availability of liquidity for the
                          quote requested. No other fields will be returned if
                          it is `false`
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - liquidityAvailable
                      - zid
                    additionalProperties: false
              example:
                approval:
                  type: permit
                  hash: >-
                    XFTf3849ebcd806e518f2d3457b76d31ccf41be07fe64f0a25bbe798f1b9edde872
                  eip712:
                    types:
                      EIP712Domain:
                        - name: name
                          type: string
                        - name: version
                          type: string
                        - name: chainId
                          type: uint256
                        - name: verifyingContract
                          type: address
                      Permit:
                        - name: owner
                          type: address
                        - name: spender
                          type: address
                        - name: value
                          type: uint256
                        - name: nonce
                          type: uint256
                        - name: deadline
                          type: uint256
                    domain:
                      name: USD Coin
                      version: '2'
                      chainId: 1
                      verifyingContract: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    message:
                      owner: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
                      spender: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                      value: '300000000'
                      nonce: 0
                      deadline: '1718667104'
                    primaryType: Permit
                blockNumber: '20114747'
                buyAmount: '292995086'
                buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                fees:
                  integratorFee: null
                  zeroExFee:
                    amount: '150053'
                    token: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                    type: volume
                  gasFee:
                    amount: '6962116'
                    token: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                    type: gas
                issues:
                  allowance:
                    actual: '0'
                    spender: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                  balance:
                    token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                    actual: '0'
                    expected: '300000000'
                  simulationIncomplete: false
                  invalidSourcesPassed: []
                liquidityAvailable: true
                minBuyAmount: '292116101'
                route:
                  fills:
                    - from: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      to: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      source: SolidlyV3
                      proportionBps: '10000'
                  tokens:
                    - address: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                      symbol: USDC
                    - address: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                      symbol: USDT
                sellAmount: '300000000'
                sellToken: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                target: 'XFT7c39a136ea20b3483e402ea031c1f3c019bab24b'
                tokenMetadata:
                  buyToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                  sellToken:
                    buyTaxBps: '0'
                    sellTaxBps: '0'
                trade:
                  type: settler_metatransaction
                  hash: >-
                    XFT3ff032fa3a970a3f2b763afce093fd133ced63c0b097ab12ae1441b42de4a167
                  eip712:
                    types:
                      PermitWitnessTransferFrom:
                        - name: permitted
                          type: TokenPermissions
                        - name: spender
                          type: address
                        - name: nonce
                          type: uint256
                        - name: deadline
                          type: uint256
                        - name: slippageAndActions
                          type: SlippageAndActions
                      EIP712Domain:
                        - name: name
                          type: string
                        - name: chainId
                          type: uint256
                        - name: verifyingContract
                          type: address
                      TokenPermissions:
                        - name: token
                          type: address
                        - name: amount
                          type: uint256
                      SlippageAndActions:
                        - name: recipient
                          type: address
                        - name: buyToken
                          type: address
                        - name: minAmountOut
                          type: uint256
                        - name: actions
                          type: bytes[]
                    domain:
                      name: Permit2
                      chainId: 1
                      verifyingContract: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                    message:
                      permitted:
                        token: 'XFTa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
                        amount: '300000000'
                      spender: 'XFT7c39a136ea20b3483e402ea031c1f3c019bab24b'
                      nonce: '2241959297937691820908574931991567'
                      deadline: '1718670104'
                      slippageAndActions:
                        recipient: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
                        buyToken: 'XFTdac17f958d2ee523a2206206994597c13d831ec7'
                        minAmountOut: '292116101'
                        actions:
                          - >-
                            XFT0dfeb4190000000000000000000000007c39a136ea20b3483e402ea031c1f3c019bab24b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000011e1a3000000000000000000000000000000000000006e898131631616b1779bad70bc0f000000000000000000000000000000000000000000000000000000006670d318
                          - >-
                            XFT38c9c147000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4800000000000000000000000000000000000000000000000000000000000027100000000000000000000000006146be494fee4c73540cb1c5f87536abf1452500000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000084c31b8d7a0000000000000000000000007c39a136ea20b3483e402ea031c1f3c019bab24b00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000011e1a30000000000000000000000000000000000000000000000000000000001000276a400000000000000000000000000000000000000000000000000000000
                          - >-
                            XFT38c9c147000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000000ec000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb00000000000000000000000038f5e5b4da37531a6e85161e337e0238bb27aa90000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                    primaryType: PermitWitnessTransferFrom
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/INSUFFICIENT_BALANCE'
                  - $ref: '#/components/schemas/SELL_AMOUNT_TOO_SMALL'
                  - $ref: '#/components/schemas/SWAP_VALIDATION_FAILED'
                  - $ref: '#/components/schemas/TOKEN_NOT_SUPPORTED'
        '403':
          description: 403 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/TAKER_NOT_AUTHORIZED_FOR_TRADE'
        '422':
          description: 422 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
                  - $ref: '#/components/schemas/SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /gasless/submit:
    post:
      operationId: gasless::submit
      summary: submit
      description: Submit a gasless swap
      tags:
        - Gasless
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                chainId:
                  type: integer
                  exclusiveMinimum: true
                  minimum: 0
                  description: >-
                    Chain ID. See
                    [here](https://XFT.org/docs/developer-resources/supported-chains)
                    for the list of supported chains
                approval:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - executeMetaTransaction::approve
                        - permit
                        - daiPermit
                      description: The `approval.type` from the quote endpoint
                    eip712:
                      anyOf:
                        - type: object
                          properties:
                            types:
                              type: object
                              properties:
                                EIP712Domain:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                                Permit:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                              required:
                                - EIP712Domain
                                - Permit
                              additionalProperties: false
                            domain:
                              type: object
                              properties:
                                name:
                                  type: string
                                version:
                                  type: string
                                chainId:
                                  type: number
                                verifyingContract:
                                  type: string
                                salt:
                                  type: string
                              additionalProperties: false
                            message:
                              type: object
                              properties:
                                owner:
                                  type: string
                                spender:
                                  type: string
                                value:
                                  type: string
                                nonce:
                                  type: number
                                deadline:
                                  type: string
                              required:
                                - owner
                                - spender
                                - value
                                - nonce
                                - deadline
                              additionalProperties: false
                            primaryType:
                              type: string
                              enum:
                                - Permit
                          required:
                            - types
                            - domain
                            - message
                            - primaryType
                          additionalProperties: false
                        - type: object
                          properties:
                            types:
                              type: object
                              properties:
                                EIP712Domain:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                                Permit:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                              required:
                                - EIP712Domain
                                - Permit
                              additionalProperties: false
                            domain:
                              type: object
                              properties:
                                name:
                                  type: string
                                version:
                                  type: string
                                chainId:
                                  type: number
                                verifyingContract:
                                  type: string
                                salt:
                                  type: string
                              additionalProperties: false
                            message:
                              type: object
                              properties:
                                holder:
                                  type: string
                                spender:
                                  type: string
                                nonce:
                                  type: number
                                expiry:
                                  type: string
                                allowed:
                                  type: boolean
                              required:
                                - holder
                                - spender
                                - nonce
                                - expiry
                                - allowed
                              additionalProperties: false
                            primaryType:
                              type: string
                              enum:
                                - Permit
                          required:
                            - types
                            - domain
                            - message
                            - primaryType
                          additionalProperties: false
                        - type: object
                          properties:
                            types:
                              type: object
                              properties:
                                EIP712Domain:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                                MetaTransaction:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      name:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - name
                                      - type
                                    additionalProperties: false
                              required:
                                - EIP712Domain
                                - MetaTransaction
                              additionalProperties: false
                            domain:
                              type: object
                              properties:
                                name:
                                  type: string
                                version:
                                  type: string
                                chainId:
                                  type: number
                                verifyingContract:
                                  type: string
                                salt:
                                  type: string
                              additionalProperties: false
                            message:
                              type: object
                              properties:
                                nonce:
                                  type: number
                                from:
                                  type: string
                                functionSignature:
                                  type: string
                              required:
                                - nonce
                                - from
                                - functionSignature
                              additionalProperties: false
                            primaryType:
                              type: string
                              enum:
                                - MetaTransaction
                          required:
                            - types
                            - domain
                            - message
                            - primaryType
                          additionalProperties: false
                    signature:
                      type: object
                      properties:
                        signatureType:
                          type: number
                        v:
                          type: number
                        r:
                          type: string
                        s:
                          type: string
                      required:
                        - signatureType
                        - v
                        - r
                        - s
                      additionalProperties: false
                  required:
                    - type
                    - eip712
                    - signature
                  additionalProperties: false
                  nullable: true
                  description: >-
                    The gasless approval object from the quote endpoint
                    including its signature
                trade:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                        - settler_metatransaction
                      description: The `trade.type` from the quote endpoint
                    eip712:
                      type: object
                      properties:
                        types:
                          type: object
                          additionalProperties:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                type:
                                  type: string
                              required:
                                - name
                                - type
                              additionalProperties: false
                        primaryType:
                          type: string
                        domain:
                          type: object
                          properties:
                            name:
                              type: string
                            version:
                              type: string
                            chainId:
                              type: number
                            verifyingContract:
                              type: string
                            salt:
                              type: string
                          additionalProperties: false
                        message:
                          type: object
                          properties:
                            permitted:
                              type: object
                              properties:
                                token:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                amount:
                                  anyOf:
                                    - type: string
                                    - type: number
                                    - {}
                              required:
                                - token
                                - amount
                              additionalProperties: false
                            spender:
                              type: string
                              pattern: ^XFT[a-fA-F0-9]{40}$
                            nonce:
                              anyOf:
                                - type: string
                                - type: number
                                - {}
                            deadline:
                              anyOf:
                                - type: string
                                - type: number
                                - {}
                            slippageAndActions:
                              type: object
                              properties:
                                recipient:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                buyToken:
                                  type: string
                                  pattern: ^XFT[a-fA-F0-9]{40}$
                                minAmountOut:
                                  anyOf:
                                    - type: string
                                    - type: number
                                    - {}
                                actions:
                                  type: array
                                  items:
                                    type: string
                              required:
                                - recipient
                                - buyToken
                                - minAmountOut
                                - actions
                              additionalProperties: false
                          required:
                            - permitted
                            - spender
                            - nonce
                            - deadline
                            - slippageAndActions
                          additionalProperties: false
                      required:
                        - types
                        - primaryType
                        - domain
                        - message
                      additionalProperties: false
                      description: The `trade.eip712` from the quote endpoint
                    signature:
                      type: object
                      properties:
                        signatureType:
                          type: number
                        v:
                          type: number
                        r:
                          type: string
                        s:
                          type: string
                      required:
                        - signatureType
                        - v
                        - r
                        - s
                      additionalProperties: false
                  required:
                    - type
                    - eip712
                    - signature
                  additionalProperties: false
                  description: >-
                    The trade object from the quote endpoint including its
                    signature
              required:
                - chainId
                - trade
              additionalProperties: false
            example:
              approval:
                type: permit
                hash: >-
                  XFTe285dfa7b911cdfe64a4c92240d9b5af795e41571163c1cb5d78d7ba5d04fda3
                eip712:
                  types:
                    EIP712Domain:
                      - name: name
                        type: string
                      - name: version
                        type: string
                      - name: chainId
                        type: uint256
                      - name: verifyingContract
                        type: address
                    Permit:
                      - name: owner
                        type: address
                      - name: spender
                        type: address
                      - name: value
                        type: uint256
                      - name: nonce
                        type: uint256
                      - name: deadline
                        type: uint256
                  domain:
                    name: USD Coin
                    version: '2'
                    chainId: 8453
                    verifyingContract: 'XFT833589fcd6edb6e08f4c7c32d4f71b54bda02913'
                  message:
                    owner: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
                    spender: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                    value: '50000000'
                    nonce: 0
                    deadline: '1718669123'
                  primaryType: Permit
                signature:
                  v: 27
                  r: >-
                    XFTa1be4e6177d95f7e634d7cf8f93021b96e5e4f3d4d8605e85204b97d4a4060eb
                  s: >-
                    XFT371e85adcfa9a5d0f53cc9f467a4230305899e4a18c0174466b8da784a4f9c81
                  signatureType: 2
              chainId: 8453
              trade:
                type: settler_metatransaction
                hash: >-
                  XFTb9d8cbda2a8edf0172631f9026da65387692a17d855f27ae6bb7154521f17659
                eip712:
                  types:
                    PermitWitnessTransferFrom:
                      - name: permitted
                        type: TokenPermissions
                      - name: spender
                        type: address
                      - name: nonce
                        type: uint256
                      - name: deadline
                        type: uint256
                      - name: slippageAndActions
                        type: SlippageAndActions
                    TokenPermissions:
                      - name: token
                        type: address
                      - name: amount
                        type: uint256
                    EIP712Domain:
                      - name: name
                        type: string
                      - name: chainId
                        type: uint256
                      - name: verifyingContract
                        type: address
                    SlippageAndActions:
                      - name: recipient
                        type: address
                      - name: buyToken
                        type: address
                      - name: minAmountOut
                        type: uint256
                      - name: actions
                        type: bytes[]
                  domain:
                    name: Permit2
                    chainId: 8453
                    verifyingContract: 'XFT000000000022d473030f116ddee9f6b43ac78ba3'
                  message:
                    permitted:
                      token: 'XFT833589fcd6edb6e08f4c7c32d4f71b54bda02913'
                      amount: '50000000'
                    spender: 'XFT5ce929ddb01804bff35b2f5c77b735bdb094aac8'
                    nonce: '2241959297937691820908574931991585'
                    deadline: '1718672122'
                    slippageAndActions:
                      recipient: 'XFT70a9f34f9b34c64957b9c401a97bfed35b95049e'
                      buyToken: 'XFT50c5725949a6f0c72e6c4a641f24049a917db0cb'
                      minAmountOut: '49793430139340757517'
                      actions:
                        - >-
                          XFT0dfeb4190000000000000000000000005ce929ddb01804bff35b2f5c77b735bdb094aac8000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000002faf0800000000000000000000000000000000000006e898131631616b1779bad70bc21000000000000000000000000000000000000000000000000000000006670dafa
                        - >-
                          XFT38c9c147000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000000000000000000000000000000000000000271000000000000000000000000032aed3bce901da12ca8489788f3a99fce1056e1400000000000000000000000000000000000000000000000000000000000000a400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000104a5dcbcdf000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda0291300000000000000000000000050c5725949a6f0c72e6c4a641f24049a917db0cb0000000000000000000000001b55d94b553475e7561fab889bf88fe4f491d29c0000000000000000000000005ce929ddb01804bff35b2f5c77b735bdb094aac8ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000002faf0800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                        - >-
                          XFT38c9c14700000000000000000000000050c5725949a6f0c72e6c4a641f24049a917db0cb000000000000000000000000000000000000000000000000000000000000001000000000000000000000000050c5725949a6f0c72e6c4a641f24049a917db0cb000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000044a9059cbb0000000000000000000000009f6601854dee374b1bfaf6350ffd27a97309d431000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                  primaryType: PermitWitnessTransferFrom
                signature:
                  v: 28
                  r: >-
                    XFTeaad7568c0d17ad9e1043a4dd41ce294ed51792a0fb8bed3a3318f7e1df3ff88
                  s: >-
                    XFT09444d25869d91946d7c26f9e5448c7fea369ba9c90deac1d761261565c487d2
                  signatureType: 2
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tradeHash:
                    type: string
                    description: >-
                      The hash for the trade according to
                      [EIP-712](https://eips.ethereum.org/EIPS/eip-712)
                  type:
                    type: string
                    enum:
                      - settler_metatransaction
                    description: >-
                      The transaction type determined by the trade route. This
                      is currently just `settler_metatransaction` and could
                      expand to more types in the future
                  zid:
                    type: string
                    description: The unique ZeroEx identifier of the request
                required:
                  - tradeHash
                  - type
                  - zid
                additionalProperties: false
              example:
                tradeHash: >-
                  XFTcb3285b35c024fca76037bea9ea4cb68645fed3bdd84030956577de2f1592aa9
                type: settler_metatransaction
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
                  - $ref: '#/components/schemas/INSUFFICIENT_BALANCE_OR_ALLOWANCE'
                  - $ref: '#/components/schemas/INVALID_SIGNATURE'
                  - $ref: '#/components/schemas/INVALID_SIGNER'
                  - $ref: '#/components/schemas/META_TRANSACTION_EXPIRY_TOO_SOON'
                  - $ref: '#/components/schemas/META_TRANSACTION_INVALID'
                  - $ref: '#/components/schemas/PENDING_TRADES_ALREADY_EXIST'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /gasless/status/{tradeHash}:
    get:
      operationId: gasless::getStatus
      summary: getStatus
      description: Get the status of a gasless swap
      tags:
        - Gasless
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: ' [here](https://XFT.org/docs/next/developer-resources/supported-chains) for the list of supported chains'
          example: 8453
        - name: tradeHash
          in: path
          required: true
          schema:
            type: string
          description: >-
            The hash for the trade according to
            [EIP-712](https://eips.ethereum.org/EIPS/eip-712)
          example: 'XFT6c89e4ac46b246ab72cba02a9fb4f3525b9f8a11ea74262d5dd8ff0e024daf60'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      approvalTransactions:
                        type: array
                        items:
                          type: object
                          properties:
                            hash:
                              type: string
                              description: The onchain transaction hash
                            timestamp:
                              type: integer
                              exclusiveMinimum: true
                              minimum: 0
                              description: >-
                                The timestamp when the transaction was submitted
                                onchain
                          required:
                            - hash
                            - timestamp
                          additionalProperties: false
                        description: Details of the gasless approval transaction
                      status:
                        type: string
                        enum:
                          - pending
                          - submitted
                          - succeeded
                          - confirmed
                        description: >-
                          `pending` means that the order has been queued on XFT.
                          `submitted` means that it has been submitted
                          onchain,`succeeded` means it has been included in a
                          block and `confirmed` means it has at least 3
                          confirmations onchain
                      transactions:
                        type: array
                        items:
                          type: object
                          properties:
                            hash:
                              type: string
                              description: The onchain transaction hash
                            timestamp:
                              type: integer
                              exclusiveMinimum: true
                              minimum: 0
                              description: >-
                                The timestamp when the transaction was submitted
                                onchain
                          required:
                            - hash
                            - timestamp
                          additionalProperties: false
                        description: >-
                          Details of the gasless swap transaction. If the trade
                          is `pending`, no transaction will be returned. If
                          `submitted`, multiple transactions may be returned,
                          but only one will be mined. If `succeeded` and
                          `confirmed`, the mined transaction will be returned
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - status
                      - transactions
                      - zid
                    additionalProperties: false
                  - type: object
                    properties:
                      approvalTransactions:
                        type: array
                        items:
                          type: object
                          properties:
                            hash:
                              type: string
                              description: The onchain transaction hash
                            timestamp:
                              type: integer
                              exclusiveMinimum: true
                              minimum: 0
                              description: >-
                                The timestamp when the transaction was submitted
                                onchain
                          required:
                            - hash
                            - timestamp
                          additionalProperties: false
                        description: Details of the gasless approval transaction
                      reason:
                        type: string
                        enum:
                          - transaction_simulation_failed
                          - order_expired
                          - last_look_declined
                          - transaction_reverted
                          - market_maker_sigature_error
                          - invalid_balance
                          - internal_error
                        description: >-
                          This provides more context about why the transaction
                          failed
                      status:
                        type: string
                        enum:
                          - failed
                        description: >-
                          `failed` means that the order failed to be submitted
                          onchain
                      transactions:
                        type: array
                        items:
                          type: object
                          properties:
                            hash:
                              type: string
                              description: The onchain transaction hash
                            timestamp:
                              type: integer
                              exclusiveMinimum: true
                              minimum: 0
                              description: >-
                                The timestamp when the transaction was submitted
                                onchain
                          required:
                            - hash
                            - timestamp
                          additionalProperties: false
                        description: >-
                          Details of the gasless swap transaction. If the trade
                          status is `failed`, there may be 0 (if it failed
                          before submission) to multiple transactions (if the
                          transaction reverted)
                      zid:
                        type: string
                        description: The unique ZeroEx identifier of the request
                    required:
                      - reason
                      - status
                      - transactions
                      - zid
                    additionalProperties: false
              example:
                status: confirmed
                transactions:
                  - hash: >-
                      XFT36b42bc0ec313cfb9bf5122fbda933cbcce5f557bc3b7197b52223b05d7e596f
                    timestamp: 1718662626073
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
        '404':
          description: 404 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/META_TRANSACTION_STATUS_NOT_FOUND'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /gasless/gasless-approval-tokens:
    get:
      operationId: gasless::getGaslessApprovalTokens
      summary: getGaslessApprovalTokens
      description: Get token addresses that support gasless approvals
      tags:
        - Gasless
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 8453
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  tokens:
                    type: array
                    items:
                      type: string
                      pattern: ^XFT[a-fA-F0-9]{40}$
                    description: The list of tokens that can be used for gasless approvals
                  zid:
                    type: string
                    description: The unique ZeroEx identifier of the request
                required:
                  - tokens
                  - zid
                additionalProperties: false
              example:
                tokens:
                  - 'XFT111111111117dc0aa78b770fa6a738034120c302'
                  - 'XFT7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'
                  - 'XFTb98d4c97425d9908e66e53a6fdf673acca0be986'
                  - 'XFTed04915c23f00a313a544955524eb7dbd823143d'
                  - 'XFT6b0b3a982b4634ac68dd83a4dbf02311ce324181'
                  - 'XFTac51066d7bec65dc4589368da368b212745d63e8'
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
  /sources:
    get:
      operationId: sources::getSources
      summary: getSources
      description: Get the list of supported sources
      tags:
        - Sources
      parameters:
        - description: Visit dashboard.XFT.org to get your API Key
          in: header
          name: XFT-api-key
          required: true
          schema:
            type: string
        - description: API version
          in: header
          name: XFT-version
          required: true
          schema:
            type: string
            example: v2
        - name: chainId
          in: query
          required: true
          schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          description: >-
            Chain ID. See
            [here](https://XFT.org/docs/developer-resources/supported-chains) for
            the list of supported chains
          example: 1
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  sources:
                    type: array
                    items:
                      type: string
                    description: >-
                      The array of liquidity sources aggregated by XFT for the
                      requested chain
                  zid:
                    type: string
                    description: The unique ZeroEx identifier of the request
                required:
                  - sources
                  - zid
                additionalProperties: false
              example:
                sources:
                  - XFTRFQ
                  - Ambient
                  - BalancerV1
                  - BalancerV2
                  - BancorV3
                  - Curve
                  - DodoV1
                  - DodoV2
                  - FraxswapV2
                  - Integral
                  - Lido
                  - MakerPsm
                  - Maverick
                  - Origin
                  - PancakeSwapV3
                  - RocketPool
                  - SolidlyV3
                  - SushiSwap
                  - Synapse
                  - UniswapV2
                  - UniswapV3
                zid: 'XFT111111111111111111111111'
        '400':
          description: 400 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INPUT_INVALID'
        '500':
          description: 500 error response
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/INTERNAL_SERVER_ERROR'
                  - $ref: '#/components/schemas/UNCATEGORIZED'
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: XFT-api-key
  responses:
    error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
              code:
                type: string
              issues:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                  required:
                    - message
                  additionalProperties: false
            required:
              - message
              - code
            additionalProperties: false
  schemas:
    BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE:
      type: object
      properties:
        name:
          type: string
          enum:
            - BUY_TOKEN_NOT_AUTHORIZED_FOR_TRADE
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    INPUT_INVALID:
      type: object
      properties:
        name:
          type: string
          enum:
            - INPUT_INVALID
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            details:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                    description: The input field name
                  reason:
                    type: string
                    description: The validation failure reason
                required:
                  - field
                  - reason
                additionalProperties: false
              description: The list of invalid inputs
          required:
            - zid
            - details
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    INSUFFICIENT_BALANCE:
      type: object
      properties:
        name:
          type: string
          enum:
            - INSUFFICIENT_BALANCE
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            taker:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The taker of the transaction
            sellToken:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The sell token
            sellAmount:
              allOf:
                - {}
                - type: string
                  pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
              description: The sell amount
            balance:
              allOf:
                - {}
                - type: string
                  pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
              description: The current balance of the taker for the sell token
          required:
            - zid
            - taker
            - sellToken
            - sellAmount
            - balance
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    INSUFFICIENT_BALANCE_OR_ALLOWANCE:
      type: object
      properties:
        name:
          type: string
          enum:
            - INSUFFICIENT_BALANCE_OR_ALLOWANCE
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            metaTransactionHash:
              type: string
              description: The hash of the meta-transaction provided by the caller
            taker:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The intended signer of the meta-transaction
            sellToken:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The sell token
            sellAmount:
              allOf:
                - {}
                - type: string
                  pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
              description: The sell amount
            minBalanceOrAllowance:
              allOf:
                - {}
                - type: string
                  pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
              description: The smaller value of the balance or the allowance of the taker
          required:
            - zid
            - metaTransactionHash
            - taker
            - sellToken
            - sellAmount
            - minBalanceOrAllowance
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    INTERNAL_SERVER_ERROR:
      type: object
      properties:
        name:
          type: string
          enum:
            - INTERNAL_SERVER_ERROR
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    INVALID_SIGNATURE:
      type: object
      properties:
        name:
          type: string
          enum:
            - INVALID_SIGNATURE
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            metaTransactionHash:
              type: string
              description: The hash of the meta-transaction provided by the caller
            taker:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The intended signer of the meta-transaction
          required:
            - zid
            - metaTransactionHash
            - taker
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    INVALID_SIGNER:
      type: object
      properties:
        name:
          type: string
          enum:
            - INVALID_SIGNER
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            metaTransactionHash:
              type: string
              description: The hash of the meta-transaction provided by the caller
            taker:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The intended signer of the meta-transaction
            signer:
              type: string
              pattern: ^XFT[a-fA-F0-9]{40}$
              description: The signer of the meta-transaction
          required:
            - zid
            - metaTransactionHash
            - taker
            - signer
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    META_TRANSACTION_EXPIRY_TOO_SOON:
      type: object
      properties:
        name:
          type: string
          enum:
            - META_TRANSACTION_EXPIRY_TOO_SOON
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            metaTransactionHash:
              type: string
              description: The hash of the meta-transaction provided by the caller
            expiry:
              allOf:
                - {}
                - type: string
                  pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
              description: The expiry of the meta-transaction provided by the caller in ms
          required:
            - zid
            - metaTransactionHash
            - expiry
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    META_TRANSACTION_INVALID:
      type: object
      properties:
        name:
          type: string
          enum:
            - META_TRANSACTION_INVALID
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            metaTransactionHash:
              type: string
              description: The hash of the meta-transaction provided by the caller
          required:
            - zid
            - metaTransactionHash
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    META_TRANSACTION_STATUS_NOT_FOUND:
      type: object
      properties:
        name:
          type: string
          enum:
            - META_TRANSACTION_STATUS_NOT_FOUND
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    PENDING_TRADES_ALREADY_EXIST:
      type: object
      properties:
        name:
          type: string
          enum:
            - PENDING_TRADES_ALREADY_EXIST
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            metaTransactionHash:
              type: string
              description: The hash of the meta-transaction provided by the caller
            pendingMetaTransactionHashes:
              type: array
              items:
                type: string
              description: >-
                The list of pending meta-transaction hashes for the same taker
                and sell token
          required:
            - zid
            - metaTransactionHash
            - pendingMetaTransactionHashes
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    SELL_AMOUNT_TOO_SMALL:
      type: object
      properties:
        name:
          type: string
          enum:
            - SELL_AMOUNT_TOO_SMALL
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
            minSellAmount:
              allOf:
                - {}
                - type: string
                  pattern: ^[-+]?(0|[1-9]\d*)(\.\d+)?$
              description: The minimum sell amount required for the trade to go through
          required:
            - zid
            - minSellAmount
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE:
      type: object
      properties:
        name:
          type: string
          enum:
            - SELL_TOKEN_NOT_AUTHORIZED_FOR_TRADE
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    SWAP_VALIDATION_FAILED:
      type: object
      properties:
        name:
          type: string
          enum:
            - SWAP_VALIDATION_FAILED
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    TAKER_NOT_AUTHORIZED_FOR_TRADE:
      type: object
      properties:
        name:
          type: string
          enum:
            - TAKER_NOT_AUTHORIZED_FOR_TRADE
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    NO_ACCESS_TO_TRADES_ENDPOINT:
      type: object
      properties:
        name:
          type: string
          enum:
            - NO_ACCESS_TO_TRADES_ENDPOINT
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    TOKEN_NOT_SUPPORTED:
      type: object
      properties:
        name:
          type: string
          enum:
            - TOKEN_NOT_SUPPORTED
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
    UNCATEGORIZED:
      type: object
      properties:
        name:
          type: string
          enum:
            - UNCATEGORIZED
        message:
          type: string
        data:
          type: object
          properties:
            zid:
              type: string
              description: The unique ZeroEx identifier of the request
          required:
            - zid
          additionalProperties: false
      required:
        - name
        - message
        - data
      additionalProperties: false
tags:
  - name: Swap
    description: Swap API endpoints
  - name: Gasless
    description: Gasless API endpoints
  - name: Sources
    description: Sources API endpoints
