Skip to content
Snippets Groups Projects
api.yaml 10.37 KiB
openapi: 3.0.0
info:
  title: GoShimmer API
  description: "Get transactions from the Tangle, get a node's neighbors, or send new transactions."
  version: 0.1.0
servers:
  - url: http://localhost:8080
tags:
  - name: "transactions"
  - name: "neighbors"

paths:
  /broadcastData:
    post:
      tags:
        - transactions
      summary: Creates a zero-value transaction and attaches it to the Tangle.
      description: Creates a zero-value transaction that includes the given data in the `signatureMessageFragment` field and the given address in the `address` field.<br></br>This endpoint also does tip selection and proof of work before attaching the transaction to the Tangle.
      requestBody:
        description: Data and address to add to the transaction.<br></br>The data must be no larger than 2187 bytes, and the address must contain only trytes and be either 81 trytes long or 90 trytes long, including a checksum.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                address:
                  type: string
                data:
                  type: string
      responses:
        200:
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  hash:
                    type: string
                    example: "99IJMBGYVUAYAFAZFGAIVCFWMXP9WTDPX9JDFJLFKNUBLGRRHBERVTTJUZPRRTKKKNMMVX9PYGBKA9999"
                description: The transaction's hash on the Tangle.
        400:
          description: Error response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: "invalid address"
                description: The error message.
  /findTransactionHashes:
    post:
      tags:
        - transactions
      summary: Gets any transaction hashes that were sent to the given addresses.
      description: Searches the Tangle for transactions that contain the given addresses and returns an array of the transactions hashes that were found. The transaction hashes are returned in the same order as the given addresses. For example, if the node doesn't have any transaction hashes for a given address, the value at that index in the returned array is empty.
      requestBody:
        description: Addresses to search for in transactions.<br></br>Addresses must contain only trytes and be either 81 trytes long or 90 trytes long, including a checksum.
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                addresses:
                  type: array
                  items: