Unlock Protocol Merkle Tree API

The Merkle Tree API from Unlock Protocol — 1 operation(s) for merkle tree.

OpenAPI Specification

unlock-protocol-merkle-tree-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Unlock Locksmith Applications Merkle Tree API
  version: '2'
  description: Locksmith provides backend functionality for enabling ticketing, metadata storage, and notification hooks.
  license:
    name: MIT
servers:
- url: https://locksmith.unlock-protocol.com
  description: Production Server
- url: https://staging-locksmith.unlock-protocol.com
  description: Staging Server
tags:
- name: Merkle Tree
paths:
  /v2/merkle-tree:
    post:
      operationId: saveMerkleTree
      description: Saves a merkle tree from either a list of addresses or a list of [address, amount] tuples.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              description: Array must contain either all strings (addresses) or all [address, amount] tuples, no mixing allowed
              items:
                type: object
                oneOf:
                - type: string
                  description: Recipient address (will be assigned amount "1")
                - type: array
                  description: Address and amount tuple
                  minItems: 2
                  maxItems: 2
                  items:
                    oneOf:
                    - type: string
                      description: Recipient address
                    - type: object
                      properties:
                        amount:
                          oneOf:
                          - type: string
                            description: Amount as string
                          - type: number
                            description: Amount as number
      responses:
        200:
          description: Successfully saved the Merkle Tree
          content:
            application/json:
              schema:
                type: object
                required:
                - root
                properties:
                  root:
                    type: string
                    description: The merkle tree root hash
        400:
          description: Invalid request (empty array, mixed types, or invalid addresses)
          content:
            application/json:
              schema:
                type: object
                required:
                - error
                properties:
                  error:
                    type: object
                    required:
                    - issues
                    properties:
                      issues:
                        type: array
                        items:
                          type: object
                          properties:
                            code:
                              type: string
                            message:
                              type: string
                            path:
                              type: array
                              items:
                                type: string
        500:
          $ref: '#/components/responses/500.InternalError'
      tags:
      - Merkle Tree
components:
  schemas:
    GenericServerError:
      type: object
      nullable: false
      properties:
        message:
          type: string
          default: There was an error in fullfiling the request.
          nullable: false
  responses:
    500.InternalError:
      description: Unable to fullfil request due to internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericServerError'
  securitySchemes:
    User:
      type: http
      scheme: bearer
      bearerFormat: JWT
    Application:
      type: apiKey
      name: api-key
      in: query