openapi: 3.0.0
info:
  title: EVM Blockchain Adapter
  contact: info@dsphere.io
  version: 1.0.0
servers:
  - description: Production
    url: https://server.dsphere.io/api
tags:
  - name: Introduction
    description: >-
      The EVM Blockchain Adapter purpose is to provide an API so we can interact
      with our EVM smart contracts.


      Currently it supports the following functionality:

      - **Collection**: Interact with a collection smart contract

      - **Sale**: Interact with a sale smart contract

      - **Marketplace**: Interact with a marketplace 
  - name: Collection
    description: API to interact with a collection smart contract
  - name: Sale
    description: API to nteract with a sale smart contract
  - name: Marketplace
    description: API to nteract with a marketplace
  - name: Generic
    description: API for generic functionality
paths:
  /collection/ownerOf/{contractAddress}/{tokenId}:
    get:
      tags:
        - Collection
      summary: Owner Of
      description: >-
        Get the owner of the `tokenId` token of collection contract
        `contractAddress`.
      operationId: OwnerOf
      parameters:
        - name: contractAddress
          description: A collection contract address
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        - name: tokenId
          description: The token id
          in: path
          required: true
          style: simple
          schema:
            type: number
            example: 1
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  owner:
                    type: string
                example:
                  owner: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
      deprecated: false
  /collection/tokenURI/{contractAddress}/{tokenId}:
    get:
      tags:
        - Collection
      summary: Token URI
      description: >-
        Get the token URI of the `tokenId` token of collection contract
        `contractAddress`.
      operationId: TokenURI
      parameters:
        - name: contractAddress
          description: A collection contract address
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        - name: tokenId
          description: The token id
          in: path
          required: true
          style: simple
          schema:
            type: number
            example: 1
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  tokenURI:
                    type: string
                example:
                  tokenURI: 'https://api.example.com/v1/1 '
      deprecated: false
  /collection/isApprovedForAll/{contractAddress}/{owner}/{operator}:
    get:
      tags:
        - Collection
      summary: Approved For All
      description: >-
        Get if the `operator` is allowed to manage all of the assets of `owner`
        for collection contract `contractAddress`.
      operationId: ApprovedForAll
      parameters:
        - name: contractAddress
          description: A collection contract address
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        - name: owner
          description: The tokens owner
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        - name: operator
          description: The operator of the tokens
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b '
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  tokenURI:
                    type: boolean
                example:
                  isApprovedForAll: true
      deprecated: false
  /collection/paused/{contractAddress}:
    get:
      tags:
        - Collection
      summary: Paused
      description: Get if the collection contract is paused or not.
      operationId: Paused
      parameters:
        - name: contractAddress
          description: A collection contract
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  paused:
                    type: boolean
                example:
                  paused: false
      deprecated: false
  /collection/approveEncoded/{contractAddress}:
    post:
      tags:
        - Collection
      summary: Approve Encoded
      description: |-
        Get a transaction encoded data to approve: 

         Give permission to `to` to transfer `tokenId` token of `contractAddress` contract to another account. The approval is cleared when the token is transferred. Only a single account can be approved at a time, so approving the zero address clears previous approvals. The `caller` should be the token owner or approved for all.  

         The end-user `caller` is required to sign the transaction and submit it via his wallet.
      operationId: ApproveEncoded
      parameters:
        - name: contractAddress
          in: path
          description: A collection contract
          required: true
          style: simple
          schema:
            type: string
            example: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApproveEncodedRequest'
            example:
              caller: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0 '
              to: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b '
              tokenId: 0
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
                  maxFeePerGas: '0x80be6278'
                  maxPriorityFeePerGas: '0x7b1b1304'
                  to: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
                  data: >-
                    0x095ea7b30000000000000000000000009b1f7f645351af3631a656421ed2e40f2802e6c00000000000000000000000000000000000000000000000000000000000000002
                  type: '0x2'
                  gas: '0xb8db'
      deprecated: false
  /collection/setApprovalForAllEncoded/{contractAddress}:
    post:
      tags:
        - Collection
      summary: Set Approval For All Encoded
      description: |-
        Get a transaction encoded data to set approval for all: 

         Approve or remove `operator` as an operator for `contractAddress` contract for the `owner`. Operators can call {transferFrom} or {safeTransferFrom} for any token of `contractAddress` collection contract owned by the `owner`. 
         

         A use case is to approve the marketplace (operator) to move the owner's tokens only for the collection specified in `contractAddress`. 

         The end-user `owner` is required to sign the transaction and submit it via his wallet.
      operationId: ApprovalForAllEncoded
      parameters:
        - name: contractAddress
          in: path
          description: A collection contract
          required: true
          style: simple
          schema:
            type: string
            example: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetApprovalForAllRequest'
            example:
              owner: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0 '
              operator: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b '
              approved: true
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
                  maxFeePerGas: '0x7f9d5683'
                  maxPriorityFeePerGas: '0x7c024daf'
                  to: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
                  data: >-
                    0xa22cb4650000000000000000000000009b1f7f645351af3631a656421ed2e40f2802e6c00000000000000000000000000000000000000000000000000000000000000001
                  type: '0x2'
                  gas: '0xb154'
      deprecated: false
  /collection/royaltyInfo:
    post:
      tags:
        - Collection
      summary: Get royalty info
      description: Gets royalty info for the given token id and sale price
      operationId: royaltyInfo
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetRoyaltyInfoRequest'
            example:
              contractAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
              tokenId: 2
              salePrice: 3
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  receiver:
                    type: string
                    description: The royalty receiver account
                  amount:
                    type: string
                    description: The royalty amount in eth
                example:
                  receiver: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
                  amount: '0.1'
      deprecated: false
  /sale/buyToken:
    post:
      tags:
        - Sale
      summary: Buy Token
      description: >-
        Create a transaction encoded data to buy a token from the market. The
        end-user is required to sign the transaction and submit it via his
        wallet.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuyTokenRequest'
            example:
              saleContractAddress: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B'
              tokenId: '1'
              wallet: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
              price: '2'
              network: polygon
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  value:
                    type: string
                    description: >-
                      The value transferred for the transaction in wei, also the
                      endowment if it’s a contract-creation transaction.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
                  gas: '0x14743'
                  maxFeePerGas: '0x9ea854d3'
                  maxPriorityFeePerGas: '0x83fa4e0d'
                  value: '0x1bc16d674ec80000'
                  data: >-
                    0xb1fd32e60000000000000000000000000000000000000000000000000000000000000020000000000000000000000000ffcf8fdee72ac11b5c542428b35eef5769c409f00000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000041068fdfc4324999962211794caacca5a55c801d753c7dee3d3d7a95f8b5a4632b4a245ebfd1e55b2a8d7993a8f5dd50b7176016ea14d0ae0dfd47b7984c17650a1c00000000000000000000000000000000000000000000000000000000000000
                  type: '0x2'
                  to: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B'
  /sale/paused/{contractAddress}:
    get:
      tags:
        - Sale
      summary: Paused
      description: Get if the sale contract is paused or not.
      operationId: SalePaused
      parameters:
        - name: contractAddress
          description: A sale contract
          in: path
          required: true
          style: simple
          schema:
            type: string
            example: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B'
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  paused:
                    type: boolean
                example:
                  paused: false
      deprecated: false
  /marketplace/createListing:
    post:
      tags:
        - Marketplace
      summary: Create Listing
      description: >-
        Get a transaction encoded data to create a listing for the given token.
        The end-user is required to sign the transaction and submit it via his
        wallet.
      operationId: createListing
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateListingRequest'
            example:
              listingId: 1
              listingOwner: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
              startDate: 1664446541
              endDate: 1664446541
              price: 2
              collection:
                address: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
              metadata:
                tokenIds:
                  - 1
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                description: The transaction encoded data to use with metamask
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
                  to: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0'
                  maxFeePerGas: '0x87b2eb51'
                  maxPriorityFeePerGas: '0x82cc690a'
                  data: >-
                    0x9975dffe0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000cfeb869f69431e42cdb54a4f4f105c19c080a60100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000001bc16d674ec800000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000006320ec3e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
                  type: '0x2'
                  gas: '0x3d9b5'
      deprecated: false
  /marketplace/updateListing:
    post:
      tags:
        - Marketplace
      summary: Update Listing
      description: >-
        Get a transaction encoded data to update the price of a listing. The
        end-user is required to sign the transaction and submit it via his
        wallet.
      operationId: updateListing
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateListingRequest'
            example:
              listingOwner: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
              contractListingId: 1
              price: 5
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                description: The transaction encoded data to use with metamask
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
                  to: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0'
                  maxFeePerGas: '0x84977032'
                  maxPriorityFeePerGas: '0x80c128e5'
                  data: >-
                    0x0179ea8800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000004563918244f40000
                  type: '0x2'
                  gas: '0x9bdb'
      deprecated: false
  /marketplace/cancelListing:
    post:
      tags:
        - Marketplace
      summary: Cancel Listing
      description: >-
        Get a transaction encoded data to cancel a listing. The end-user is
        required to sign the transaction and submit it via his wallet.
      operationId: cancelListing
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelListingRequest'
            example:
              listingOwner: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
              contractListingId: 1
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                description: The transaction encoded data to use with metamask
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
                  to: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0'
                  maxFeePerGas: '0x87dd30f8'
                  maxPriorityFeePerGas: '0x846b893b'
                  data: >-
                    0x305a67a80000000000000000000000000000000000000000000000000000000000000001
                  type: '0x2'
                  gas: '0x9ae8'
      deprecated: false
  /marketplace/purchaseListing:
    post:
      tags:
        - Marketplace
      summary: Fullfill Listing (purchase)
      description: >-
        Get a transaction encoded data to fullfil a listing, that is to purchase
        the listing's token. The end-user is required to sign the transaction
        and submit it via his wallet.
      operationId: purchaseListing
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchaseListingRequest'
            example:
              listingBuyer: '0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1'
              contractListingId: 1
              price: 2
        required: true
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                description: The transaction encoded data to use with metamask
                properties:
                  from:
                    type: string
                    description: The address for the sending account.
                  gas:
                    type: string
                    description: >-
                      The amount of gas to use for the transaction (unused gas
                      is refunded) in hex format.
                  maxFeePerGas:
                    type: string
                    description: >-
                      The maximum amount of gas fee a user is willing to pay for
                      the transaction.
                  maxPriorityFeePerGas:
                    type: string
                    description: The gas that goes to miners.
                  value:
                    type: string
                    description: >-
                      The value transferred for the transaction in wei, also the
                      endowment if it’s a contract-creation transaction.
                  data:
                    type: string
                    description: >-
                      The encoded ABI byte code to send via a transaction or
                      call.
                  type:
                    type: string
                    description: Indicates the type of the EIP-1559 Transaction.
                  to:
                    type: string
                    description: >-
                      The destination address of the message, left undefined for
                      a contract-creation transaction.
                example:
                  from: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b'
                  to: '0x9b1f7F645351AF3631a656421eD2e40f2802E6c0'
                  maxFeePerGas: '0x7e3d6e5a'
                  maxPriorityFeePerGas: '0x7b6e16e3'
                  data: >-
                    0xefef39a10000000000000000000000000000000000000000000000000000000000000002
                  value: '0x1bc16d674ec80000'
                  type: '0x2'
                  gas: '0x1dc63'
      deprecated: false
  /version:
    get:
      tags:
        - Generic
      summary: Version
      description: Returns the version of the EVM Blockchain Adapter service.
      operationId: Version
      parameters: []
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  version:
                    type: string
                  git_version:
                    type: string
                  branch:
                    type: string
                  wappier/xanadu-lib:
                    type: string
                  env:
                    type: string
                  hostname:
                    type: string
                  ips:
                    type: string
                example:
                  version: 1.0.0
                  git_revision: 36a5a67
                  branch: btc-70_collection-controller
                  '@wappier/xanadu-lib': 1.3.3
                  env: local_test
                  hostname: LP-AP
                  ips:
                    - 172.21.192.1
                    - 192.168.56.1
                    - 10.32.1.193
                    - 172.20.10.2
      deprecated: false
  /health:
    get:
      tags:
        - Generic
      summary: Health Check
      description: Health check of the EVM Blockchain Adapter service.
      operationId: HealthCheck
      parameters: []
      responses:
        '200':
          description: Success
          headers: {}
          content:
            application/json:
              schema:
                type: object
                properties:
                  service:
                    type: string
                  info:
                    type: object
                  status:
                    type: string
                example:
                  service: Dappier
                  info:
                    version: 1.0.0
                    git_revision: 36a5a67
                    branch: btc-70_collection-controller
                  status: UP
      deprecated: false
components:
  schemas:
    DeployCollectionRequest:
      title: DeployCollectionRequest
      required:
        - collectionId
        - collectionName
        - collectionSymbol
        - baseURI
        - chainId
      type: object
      properties:
        collectionId:
          type: integer
          format: int32
        collectionName:
          type: string
        collectionSymbol:
          type: string
        baseURI:
          type: string
        chainId:
          type: string
      example:
        collectionId: 1
        collectionName: WPToken
        collectionSymbol: WPT
        baseURI: https://api.example.com/v1/
        chainId: '1337'
    DeploySaleContractRequest:
      title: DeploySaleContractRequest
      required:
        - saleId
        - args
        - chainId
      type: object
      properties:
        saleId:
          type: integer
          format: int32
        args:
          type: array
          items:
            oneOf:
              - type: string
              - type: integer
                format: int32
          description: ''
        chainId:
          type: string
      example:
        saleId: 1
        args:
          - 1.1452969712670544e+48
          - 1
          - 10
          - '1656930350'
          - '1670153150'
          - 8.276419304196141e+47
        chainId: '1337'
    GetRoyaltyInfoRequest:
      title: GetRoyaltyInfoRequest
      required:
        - contractAddress
        - tokenId
        - salePrice
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the collection.
        tokenId:
          type: integer
          format: int32
          description: The token id.
        salePrice:
          type: integer
          format: int32
          description: The sale price.
      example:
        contractAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        tokenId: 1
        salePrice: 1
    SetDefaultRoyaltyRequest:
      title: SetDefaultRoyaltyRequest
      required:
        - contractAddress
        - receiver
        - feeNumerator
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the collection.
        receiver:
          type: string
          description: The royalty receiver.
        feeNumerator:
          type: integer
          format: int32
          description: >-
            The fee of the token expressed in basis points.  One basis point is
            equivalent to 0.01% (1/100th of a percent) or 0.0001 in decimal
            form.
      example:
        contractAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        receiver: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        feeNumerator: 10
    SetBaseURIRequest:
      title: SetBaseURIRequest
      required:
        - contractAddress
        - baseURI
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the collection.
        baseURI:
          type: string
          description: The new base URI.
      example:
        contractAddress: '0x3a5B35E3143FCC353F36a29B2cc3641624a03C42'
        baseURI: >-
          https://tt-stg.infura-ipfs.io/ipfs/QmaHD2NWkMbxgTLfac14XGdQAdxcLCdHfcujaa795KqTsA/
    GrantRevokeRoleRequest:
      title: GrantRevokeRoleRequest
      required:
        - contractAddress
        - account
        - role
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the collection.
        account:
          type: string
          description: The account to grant/revoke the role.
        role:
          type: string
          enum:
            - DEFAULT_ADMIN_ROLE
            - OPERATOR_ROLE
            - MINTER_ROLE
          description: The role to be granted/revoked.
      example:
        contractAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        account: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        role: OPERATOR_ROLE
    ApproveEncodedRequest:
      title: ApproveEncodedRequest
      required:
        - caller
        - to
        - tokenId
      type: object
      properties:
        caller:
          type: string
        to:
          type: string
        tokenId:
          type: integer
          format: int32
      example:
        caller: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0 '
        to: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b '
        tokenId: 0
    SetApprovalForAllRequest:
      title: SetApprovalForAllRequest
      required:
        - owner
        - operator
        - approved
      type: object
      properties:
        owner:
          type: string
        operator:
          type: string
        approved:
          type: boolean
      example:
        owner: 1.4604214337230223e+48
        operator: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b '
        approved: true
    BuyTokenRequest:
      title: BuyTokenRequest
      required:
        - saleContractAddress
        - tokenId
        - wallet
        - price
        - network
      type: object
      properties:
        saleContractAddress:
          type: string
          description: The contract address of the sale.
        tokenId:
          type: integer
          format: int32
        wallet:
          type: string
          description: The address of the buyer.
        price:
          type: string
          description: The token's price to pay.
        network:
          type: string
          description: The network the transaction will be executed.
      example:
        saleContractAddress: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B'
        tokenId: 1
        wallet: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        price: '1'
        network: polygon
    SaleGrantRevokeRoleRequest:
      title: SaleGrantRevokeRoleRequest
      required:
        - contractAddress
        - account
        - role
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the collection.
        account:
          type: string
          description: The account to grant/revoke the role.
        role:
          type: string
          enum:
            - DEFAULT_ADMIN_ROLE
            - OPERATOR_ROLE
            - RELEASER_ROLE
          description: The role to be granted/revoked.
      example:
        contractAddress: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        account: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        role: OPERATOR_ROLE
    SaleRelease:
      title: SaleRelease
      required:
        - contractAddress
        - caller
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the sale.
        caller:
          type: string
          description: The account to release the balance to.
      example:
        contractAddress: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B'
        caller: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
    SaleEmergencyTransfer:
      title: SaleEmergencyTransfer
      required:
        - contractAddress
        - caller
        - tokenId
      type: object
      properties:
        contractAddress:
          type: string
          description: The contract address of the sale.
        caller:
          type: string
          description: The account to release the balance to.
        tokenId:
          type: integer
          format: int32
      example:
        contractAddress: '0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B'
        caller: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        tokenId: 1
    CreateListingRequest:
      title: CreateListingRequest
      required:
        - listingId
        - listingOwner
        - startDate
        - endDate
        - price
        - collection
        - metadata
      type: object
      properties:
        listingId:
          type: number
          description: The listing id.
        listingOwner:
          type: string
          description: The listing owner.
        startDate:
          type: number
          description: The start date of the listing.
        endDate:
          type: number
          description: The end date of the listing.
        price:
          type: number
          description: The price of the listing in eth.
        collection:
          type: object
          properties:
            address:
              type: string
              description: The address of the colection contract.
        royaltyFee:
          type: number
          description: The royalty fee of the listing.
        royaltyRecipient:
          type: string
          description: The royalty recipient address.
        metadata:
          type: object
          properties:
            tokenIds:
              description: The token id of the listing.
              type: array
              items:
                type: number
      example:
        listingId: 1
        listingOwner: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        startDate: 1
        endDate: 1663102014
        price: 2
        collection:
          address: '0xCfEB869F69431e42cdB54A4F4f105C19C080A601'
        metadata:
          tokenIds:
            - 1
    UpdateListingRequest:
      title: UpdateListingRequest
      required:
        - contractListingId
        - listingOwner
        - price
      type: object
      properties:
        listingOwner:
          type: string
          description: The listing owner.
        contractListingId:
          type: number
          description: The contract listing id.
        price:
          type: number
          description: The new price of the listing in eth.
      example:
        listingOwner: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
        contractListingId: 1
        price: 5
    CancelListingRequest:
      title: CancelListingRequest
      required:
        - contractListingId
        - listingOwner
      type: object
      properties:
        contractListingId:
          type: number
          description: The contract listing id.
        listingOwner:
          type: string
          description: The listing owner.
      example:
        contractListingId: 1
        listingOwner: '0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
    PurchaseListingRequest:
      title: PurchaseListingRequest
      required:
        - contractListingId
        - listingBuyer
        - price
      type: object
      properties:
        listingBuyer:
          type: string
          description: The listing buyer.
        contractListingId:
          type: number
          description: The contract listing id.
        price:
          type: number
          description: The price of the listing.
      example:
        listingBuyer: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b'
        price: 2,
        contractListingId: 2
  securitySchemes:
    httpBearer:
      type: http
      scheme: bearer
security:
  - httpBearer: []
