Skip to content
openapi-v1.yaml 45.4 KiB
Newer Older
          items:
            $ref: '#/components/schemas/PeerInfo'
    RuntimeSpec:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        authoringVersion:
          type: string
          description: The version of the authorship interface. An authoring node
            will not attempt to author blocks unless this is equal to its native runtime.
        chainType:
          type: string
          description: Type of the chain.
          enum:
          - Development
          - Local
          - Live
        implVersion:
          type: string
          description: Version of the implementation specification. Non-consensus-breaking
            optimizations are about the only changes that could be made which would
            result in only the `impl_version` changing. The `impl_version` is set to 0
            when `spec_version` is incremented.
        specName:
          type: string
          description: Identifies the different Substrate runtimes.
        specVersion:
          type: string
          description: Version of the runtime specification.
        transactionVersion:
          type: string
          description: All existing dispatches are fully compatible when this number
            doesn't change. This number must change when an existing dispatchable
            (module ID, dispatch ID) is changed, either through an alteration in its
            user-level semantics, a parameter added/removed/changed, a dispatchable
            being removed, a module being removed, or a dispatchable/module changing
            its index.
        properties:
          type: object
          description: Arbitrary properties defined in the chain spec.
      description: Version information related to the runtime.
    UnappliedSlash:
      type: object
      properties:
        validator:
          type: string
          description: Stash account ID of the offending validator.
          format: ss58
        own:
          type: string
          description: The amount the validator will be slashed.
          format: unsignedInteger
        others:
          type: array
          description: Array of tuples(`[accountId, amount]`) representing all the
            stashes of other slashed stakers and the amount they will be slashed.
          items:
            type: string
            format: tuple[ss58, unsignedInteger]
        reporters:
          type: array
          description: Array of account IDs of the reporters of the offense.
          items:
            type: string
            format: ss58
        payout:
          type: string
          description: Amount of bounty payout to reporters.
          format: unsignedInteger
    ElectionStatus:
      type: object
      properties:
        status:
          type: object
          description: >-
            Era election status: either `Close: null` or `Open: <BlockNumber>`.
            A status of `Close` indicates that the submission window for solutions
            from off-chain Phragmen is not open. A status of `Open` indicates that the
            submission window for off-chain Phragmen solutions has been open since
            BlockNumber. N.B. when the submission window is open, certain
            extrinsics are not allowed because they would mutate the state that the
            off-chain Phragmen calculation relies on for calculating results.
        toggleEstimate:
          type: string
          description: Upper bound estimate of the block height at which the `status`
            will switch.
          format: unsignedInteger
      description: Information about the off-chain election. Not included in response when
        `forceEra.isForceNone`.
    StakingProgress:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        activeEra:
          type: string
          description: |
            `EraIndex` of the era being rewarded.
          format: unsignedInteger
        forceEra:
          type: string
          description: Current status of era forcing.
          enum:
          - ForceNone
          - NotForcing
          - ForceAlways
          - ForceNew
        nextActiveEraEstimate:
          type: string
          description: Upper bound estimate of the block height at which the next
            active era will start. Not included in response when `forceEra.isForceNone`.
          format: unsignedInteger
        nextSessionEstimate:
          type: string
          description: Upper bound estimate of the block height at which the next
            session will start.
          format: unsignedInteger
        unappliedSlashes:
          type: array
          items:
            $ref: '#/components/schemas/UnappliedSlash'
          description: Array of upcoming `UnappliedSlash` indexed by era.
        electionStatus:
          $ref: '#/components/schemas/ElectionStatus'
        idealValidatorCount:
          type: string
          description: Upper bound of validator set size; considered the ideal size.
            Not included in response when `forceEra.isForceNone`.
          format: unsignedInteger
        validatorSet:
          type: array
          description: Stash account IDs of the validators for the current session.
            Not included in response when `forceEra.isForceNone`.
          items:
            type: string
            format: ss58
    TransactionDryRun:
      type: object
      properties:
        resultType:
          type: string
          enum:
          - DispatchOutcome
          - TransactionValidityError
          description: Either `DispatchOutcome` if the transaction is valid or `TransactionValidityError` if the result is invalid.
        result:
          type: string
          enum:
          - Ok
          - CannotLookup
          - NoUnsignedValidator
          - Custom(u8)
          - Call
          - Payment
          - Future
          - Stale
          - BadProof
          - AncientBirthBlock
          - ExhaustsResources
          - BadMandatory
          - MandatoryDispatch
          description: 'If there was an error it will be the cause of the error. If the
            transaction executed correctly it will be `Ok: []`'
        validityErrorType:
          type: string
          enum:
          - InvalidTransaction
          - UnknownTransaction
      description: >-
        References:
        - `UnknownTransaction`: https://crates.parity.io/sp_runtime/transaction_validity/enum.UnknownTransaction.html
        - `InvalidTransaction`: https://crates.parity.io/sp_runtime/transaction_validity/enum.InvalidTransaction.html
    Transaction:
      type: object
      properties:
          type: string
          format: hex
    TransactionMaterial:
      type: object
      properties:
        at:
          $ref: '#/components/schemas/BlockIdentifiers'
        genesisHash:
          type: string
          description: The hash of the chain's genesis block.
          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:
        transactionHash:
          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
  requestBodies:
    Transaction:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Transaction'
      required: true