Skip to content
openapi-v1.yaml 87.5 KiB
Newer Older
          format: blockHash
        chainName:
          type: string
          description: The chain's name.
        specName:
          type: string
          description: The chain's spec.
        specVersion:
          type: string
          description: The spec version. Always increased in a runtime upgrade.
        txVersion:
          type: string
          description: The transaction version. Common `txVersion` numbers indicate
            that the transaction encoding format and method indices are the same.
            Needed for decoding in an offline environment. Adding new transactions
            does not change `txVersion`.
        metadata:
          type: string
          description: The chain's metadata in hex format.
      description: >-
        Note: `chainName`, `specName`, and `specVersion` are used to define a type registry with a set
        of signed extensions and types. For Polkadot and Kusama, `chainName` is not used in defining
        this registry, but in other Substrate-based chains that re-launch their network without
        changing the `specName`, the `chainName` would be needed to create the correct registry.
        Substrate Reference:
        - `RuntimeVersion`: https://crates.parity.io/sp_version/struct.RuntimeVersion.html
        - `SignedExtension`: https://crates.parity.io/sp_runtime/traits/trait.SignedExtension.html
        -  FRAME Support: https://crates.parity.io/frame_support/metadata/index.html
    TransactionSuccess:
      type: object
      properties:
          type: string
          description: The hash of the encoded transaction.
    TransactionFailedToParse:
      type: object
      properties:
        code:
          type: number
          type: string
          description: >-
            `Failed to parse a tx.`
        transaction:
          type: string
          format: hex
        cause:
          type: string
        stack:
          type: string
      description: Error message when Sidecar fails to parse the transaction.
    TransactionFailedToSubmit:
      type: object
      properties:
        code:
          type: number
          description: Failed to submit transaction.
        transaction:
          type: string
          format: hex
        cause:
          type: string
        stack:
          type: string
      description: >-
        Error message when the node rejects the submitted transaction.
    TransactionFailure:
      oneOf:
        - $ref: '#/components/schemas/TransactionFailedToSubmit'
        - $ref: '#/components/schemas/TransactionFailedToParse'
    TransactionFeeEstimateFailure:
      type: object
      properties:
        code:
          type: number
        at:
            type: object
            properties:
              hash:
                type: string
        error:
          description:  Error description.
        transaction:
          type: string
          format: hex
        block:
          type: string
          description: Block hash of the block fee estimation was attempted at.
        cause:
          type: string
          description: Error message from the client.
        stack:
          type: string
    TransactionFeeEstimate:
      type: object
      properties:
        weight:
          type: string
          description: Extrinsic weight.
        class:
          type: string
          description: Extrinsic class.
          enum:
          - Normal
          - Operational
          - Mandatory
        partialFee:
          type: string
          description: Expected inclusion fee for the transaction. Note that the fee
            rate changes up to 30% in a 24 hour period and this will not be the exact
            fee.
          format: unsignedInteger
      description: >-
        Note: `partialFee` does not include any tips that you may add to increase a transaction's
        priority. See [compute_fee](https://crates.parity.io/pallet_transaction_payment/struct.Module.html#method.compute_fee).
    TransactionPool:
      type: object
      properties:
        pool:
          type: array
          items:
            type: object
            properties:
                hash:
                  type: string
                  format: hex
                  description: H256 hash of the extrinsic.
                encodedExtrinsic:
                  type: string
                  format: hex
                  description: Scale encoded extrinsic.
    RuntimeCode:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        code:
          type: string
          format: hex
    Error:
      type: object
      properties:
        code:
          type: number
        message:
          type: string
        stack:
          type: string
    PalletStorageType:
      type: object
      description: Info about the data structure used for storage.
      example:
          Map:
              hasher: "Twox64Concat"
              key:
                example: "ReferendumIndex"
              value: "ReferendumInfo"
              linked: false
    PalletStorageItemMetadata:
      type: object
      properties:
        name:
          type: string
          example: "ReferendumInfoOf"
          description: The storage item's name (which is the same as the storage item's ID).
        modifier:
          type: string
          example: "Optional"
        type:
          $ref: '#/components/schemas/PalletStorageType'
        fallback:
          type: string
          example: "0x00"
        documentation:
          type: string
          example: " Information concerning any given referendum.\n\n TWOX-NOTE: SAFE as indexes are not under an attacker’s control."
      description: Metadata of a storage item from a FRAME pallet.
    PalletStorageItem:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        pallet:
          type: string
          description: Name of the pallet.
          example: "democracy"
        palletIndex:
          type: string
          description: Index of the pallet for looking up storage.
          example: "15"
        storageItem:
          type: string
          description: Name of the storage item.
          example: "referendumInfoOf"
        key1:
          type: string
          description: Key1 query param. Will not show up in response unless it was passed as part of the URI.
          example: "2"
        key2:
          type: string
          description: Key2 query param. Will not show up in response if not defined in URI.
          example: ""
        value:
          type: object
          description: Value returned by this storage query.
          example:
            Ongoing:
              end: "1612800"
              proposalHash: "0x7de70fc8be782076d0b5772be77153d172a5381c72dd56d3385e25f62abf507e"
              threshold: "Supermajorityapproval"
              delay: "403200"
              tally:
                ayes: "41925212461400000"
                nays: "214535586500000"
                turnout: "34485320658000000"
        metadata:
          $ref: '#/components/schemas/PalletStorageItemMetadata'
    PalletStorage:
      type: object
      properties:
        pallet:
          type: string
          description: Name of the pallet.
          example: "democracy"
        palletIndex:
          type: string
          description: Index of the pallet for looking up storage.
          example: "15"
        items:
          type: array
          items:
            $ref: '#/components/schemas/PalletStorageItemMetadata'
          description: Array containing metadata for each storage entry of the pallet.
    ParaLifecycle:
      type: string
      enum:
      - onboarding
      - parathread
      - parachain
      - upgradingParathread
      - downgradingParachain
      - offboardingParathread
      - offboardingParachain
      description: |
        The possible states of a para, to take into account delayed lifecycle
        changes.
    OnboardingAs:
      type: string
      enum:
      - parachain
      - parathread
      description: |
        This property only shows up when `paraLifecycle=onboarding`. It
        describes if a particular para is onboarding as a `parachain` or a
        `parathread`.
    Para:
      type: object
      properties:
        paraId:
          type: string
          format: unsignedInteger
        paraLifecycle:
          $ref: '#/components/schemas/ParaLifecycle'
        onboardingAs:
          $ref: '#/components/schemas/OnboardingAs'
    Paras:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        paras:
          type: array
          items:
            $ref: '#/components/schemas/Para'
    ParasLeasesCurrent:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        leasePeriodIndex:
          type: string
          format: unsignedInteger
          description: Current lease period index.
        endOfLeasePeriod:
          type: string
          format: unsignedInteger
          description: Last block (number) of the current lease period.
        currentLeaseHolders:
          type: array
          items:
            type: string
            format: unsignedInteger
          description: List of `paraId`s that currently hold a lease.
    WinningData:
      type: object
      properties:
        bid:
          type: object
          properties:
            accountId:
              type: string
            paraId:
              type: string
              format: unsignedInteger
            amount:
              type: string
              format: unsignedInteger
        leaseSet:
          type: array
          items:
            type: string
            format: unsignedInteger
      description: |
        A currently winning bid and the set of lease periods the bid is for. The
        `amount` of the bid is per lease period. The `bid` property will be `null`
        if no bid has been made for the corresponding `leaseSet`.
    ParasAuctionsCurrent:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        beginEnd:
          type: string
          format: unisgnedInteger or $null
          description: |
            Fist block (number) of the auction ending phase. `null` if there is no ongoing
            auction.
        finishEnd:
          type: string
          format: unisgnedInteger or $null
          description: |
            Last block (number) of the auction ending phase. `null` if there is no ongoing
            auction.
        phase:
          type: string
          enum:
          description: |
            An auction can be in one of 4 phases. Both `startingPeriod` () and `endingPeriod` indicate
            an ongoing auction, while `vrfDelay` lines up with the `AuctionStatus::VrfDelay` . Finally, a value of `null`
            indicates there is no ongoing auction. Keep in mind the that the `finishEnd` field is the block number the 
            `endingPeriod` finishes and the `vrfDelay` period begins. The `vrfDelay` period is typically about an 
            epoch long and no crowdloan contributions are accepted. 
        auctionIndex:
          type: string
          format: unsignedInteger
          description: |
            The auction number. If there is no current auction this will be the number
            of the previous auction.
        leasePeriods:
          type: array
          items:
            type: string
            format: unsignedInteger
          description: |
            Lease period indexes that may be bid on in this auction. `null` if
            there is no ongoing auction.
        winning:
          type: array
          items:
            $ref: '#/components/schemas/WinningData'
    FundInfo:
      type: object
      properties:
        depositor:
          type: string
        verifier:
          type: string
        deposit:
          type: string
          format: unsignedInteger
        raised:
          type: string
          format: unsignedInteger
        end:
          type: string
          format: unsignedInteger
        cap:
          type: string
          format: unsignedInteger
        lastConstribution:
          type: string
          enum:
          - preEnding
          - ending
          type: string
          format: unsignedInteger
          type: string
          format: unsignedInteger
        trieIndex:
          type: string
          format: unsignedInteger
    ParasCrowdloans:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        funds:
          type: array
          items:
            type: object
            properties:
              paraId:
                type: string
                format: unsignedInteger
              fundInfo:
                $ref: '#/components/schemas/FundInfo'
          description: |
            List of paras that have crowdloans.
    ParasCrowdloanInfo:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        fundInfo:
          $ref: '#/components/schemas/FundInfo'
        leasePeriods:
          type: array
          items:
            type: string
            format: unsignedInteger
          description: Lease periods the crowdloan can bid on.
    ParasLeaseInfo:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        paraLifecycle:
          $ref: '#/components/schemas/ParaLifecycle'
        onboardingAs:
          $ref: '#/components/schemas/OnboardingAs'
        leases:
          type: array
          items:
            type: object
            properties:
              leasePeriodIndex:
                type: string
                format: unsignedInteger
              account:
                type: string
              deposit:
                type: string
                format: unsignedInteger
          description: |
            List of lease periods for which the `paraId` holds a lease along with
            the deposit held and the associated `accountId`.
    TraceSpan:
      type: object
      properties:
        id:
          type: string
          format: unsignedInteger
        name:
          type: string
        parentId:
          type: string
          format: unsignedInteger
        target:
            type: string
        wasm:
          type: boolean
    TraceEventDataStringValues:
      type: object
      properties:
        key:
          type: string
          format: hex
          description: The complete storage key for the entry.
        method:
          type: string
          description: Normally one of Put or Get.
        result:
          type: string
          format: hex
          description: Hex scale encoded storage value.
      description: Note these exact values will only be present for storage events.
    TraceEvent:
      type: object
      properties:
        data:
          type: object
          properties:
              stringValues:
                $ref: '#/components/schemas/TraceEventDataStringValues'
        parentId:
          type: string
          format: unsignedInteger
        target:
          type: string
    BlocksTrace:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        blockHash:
          type: string
        events:
          type: array
          items:
            $ref: '#/components/schemas/TraceEvent'
        parentHash:
          type: string
        spans:
          type: array
          items:
            $ref: '#/components/schemas/TraceSpan'
        storageKeys:
          type: string
          description: Hex encoded storage keys used to filter events.
        tracingTargets:
          type: string
          description: Targets used to filter spans and events.
    SpanId:
      type: object
      properties:
        name:
          type: string
        target:
          type: string
        id:
          type: string
          format: unsignedInteger
    OperationAmountCurrency:
      type: object
      properties:
        symbol:
          type: string
          example: KSM
    OperationAmount:
      type: object
      properties:
        values:
          type: string
          format: unsignedInteger
        currency:
          $ref: '#/components/schemas/OperationAmountCurrency'
    OperationPhase:
      type: object
      properties:
        variant:
          type: string
          enum:
          - onInitialize
          - initialChecks
          - applyExtrinsic
          - onFinalize
          - finalChecks
          description: Phase of block execution pipeline.
        extrinsicIndex:
          type: string
          format: unsignedInteger
          description: |
            If phase variant is `applyExtrinsic` this will be the index of
            the extrinsic. Otherwise this field will not be present.
    Operation:
      type: object
      properties:
        phase:
          $ref: '#/components/schemas/OperationPhase'
        parentSpanId:
          $ref: '#/components/schemas/SpanId'
        primarySpanId:
          $ref: '#/components/schemas/SpanId'
        eventIndex:
          type: string
          format: unsignedInteger
          description: Index of the underlying trace event.
        address:
          type: string
          description: |
           Account this operation affects. Note - this will be an object like
           `{ id: address }` if the network uses `MultiAddress`
        storage:
          type: object
          properties:
            pallet:
              type: string
            item:
              type: string
            field1:
              type: string
              description: |
                A field of the storage item. (i.e `system::Account::get(address).data`)
            field2:
              type: string
              description: |
                A field of the struct described by field1 (i.e
                `system::Account::get(address).data.free`)
        amount:
          $ref: '#/components/schemas/OperationAmount'
    BlocksTraceOperations:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        operations:
          type: array
          items:
            $ref: '#/components/schemas/Operation'
  requestBodies:
    Transaction:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Transaction'
      required: true