Kusama rc transaction API

The rc transaction API from Kusama — 5 operation(s) for rc transaction.

OpenAPI Specification

kusama-rc-transaction-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Substrate API Sidecar accounts rc transaction API
  description: '> ⚠️ **Deprecation Notice** — `substrate-api-sidecar` is deprecated in favor of

    > [`polkadot-rest-api`](https://github.com/paritytech/polkadot-rest-api), a ground-up Rust rewrite

    > built on [`subxt`](https://github.com/paritytech/subxt) with 1:1 API compatibility (endpoints

    > served under `/v1/`, e.g. `/v1/blocks/head`), stable memory under sustained load, significantly

    > lower latency and higher throughput, and native SCALE decoding via `parity-scale-codec`.

    >

    > **Migrate today:** Docker `paritytech/polkadot-rest-api:v0.1.0` ·

    > [crate](https://crates.io/crates/polkadot-rest-api) ·

    > [migration guide](https://github.com/paritytech/polkadot-rest-api/blob/main/docs/guides/MIGRATION.md) ·

    > [docs](https://paritytech.github.io/polkadot-rest-api/) ·

    > [issues](https://github.com/paritytech/polkadot-rest-api/issues)


    Substrate API Sidecar is a REST service that makes it easy to interact with blockchain nodes

    built using Substrate''s FRAME framework.

    '
  contact:
    url: https://github.com/paritytech/substrate-api-sidecar
  license:
    name: GPL-3.0-or-later
    url: https://github.com/paritytech/substrate-api-sidecar/blob/master/LICENSE
  version: 20.14.1
servers:
- url: https://polkadot-public-sidecar.parity-chains.parity.io/
  description: Polkadot Parity public sidecar
- url: https://kusama-public-sidecar.parity-chains.parity.io/
  description: Kusama Parity public sidecar
- url: https://polkadot-asset-hub-public-sidecar.parity-chains.parity.io/
  description: Polkadot Asset Hub Parity public sidecar
- url: https://kusama-asset-hub-public-sidecar.parity-chains.parity.io/
  description: Kusama Asset Hub Parity public sidecar
- url: http://localhost:8080
  description: Localhost
tags:
- name: rc transaction
paths:
  /rc/transaction:
    post:
      tags:
      - rc transaction
      summary: Submit a transaction to the relay chain node's transaction pool.
      description: Accepts a valid signed extrinsic for the relay chain. Replaces `/tx` from versions < v1.0.0.
      operationId: submitRcTransaction
      requestBody:
        $ref: '#/components/requestBodies/Transaction'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionSuccess'
        '400':
          description: failed to parse or submit transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionFailure'
  /rc/transaction/dry-run:
    post:
      tags:
      - rc transaction
      summary: Dry run an extrinsic on the relay chain.
      description: Use the `dryRun` call to simulate the submission of a transaction to the relay chain without executing it so that you can check for potential errors and validate the expected outcome.
      operationId: dryrunRcTransaction
      requestBody:
        $ref: '#/components/requestBodies/TransactionDryRun'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionDryRun'
        '400':
          description: failed to dry-run transaction
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionFailure'
  /rc/transaction/fee-estimate:
    post:
      tags:
      - rc transaction
      summary: Receive a fee estimate for a relay chain transaction.
      description: 'Send a serialized transaction and receive back a naive fee estimate for the relay chain. Note: `partialFee` does not include any tips that you may add to increase a transaction''s priority. See the reference on `compute_fee`. Replaces `/tx/fee-estimate` from versions < v1.0.0. Substrate Reference: - `RuntimeDispatchInfo`: https://crates.parity.io/pallet_transaction_payment_rpc_runtime_api/struct.RuntimeDispatchInfo.html - `query_info`: https://crates.parity.io/pallet_transaction_payment/struct.Module.html#method.query_info - `compute_fee`: https://crates.parity.io/pallet_transaction_payment/struct.Module.html#method.compute_fee'
      operationId: feeEstimateRcTransaction
      requestBody:
        $ref: '#/components/requestBodies/Transaction'
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionFeeEstimate'
        '400':
          description: fee estimation failure
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionFeeEstimateFailure'
  /rc/transaction/material:
    get:
      tags:
      - rc transaction
      summary: Get all the relay chain network information needed to construct a transaction offline.
      description: Returns the material that is universal to constructing any signed transaction offline for the relay chain. Replaces `/tx/artifacts` from versions < v1.0.0.
      operationId: getRcTransactionMaterial
      parameters:
      - name: at
        in: query
        description: Block at which to retrieve the transaction construction material from the relay chain.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: noMeta
        in: query
        description: DEPRECATED! This is no longer supported
        schema:
          type: boolean
          default: false
      - name: metadata
        in: query
        description: Specifies the format of the metadata to be returned. Accepted values are 'json', and 'scale'. 'json' being the decoded metadata, and 'scale' being the SCALE encoded metadata. When `metadata` is not inputted, the `metadata` field will be absent.
        schema:
          type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionMaterial'
        '400':
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /rc/transaction/material/{metadataVersion}:
    get:
      tags:
      - rc transaction
      summary: Get all the relay chain network information needed to construct a transaction offline and the version of metadata specified in `metadataVersion`.
      description: Returns all the materials necessary for constructing any signed transactions offline for the relay chain.
      operationId: getRcTransactionMaterialwithVersionedMetadata
      parameters:
      - name: metadataVersion
        in: path
        description: The version of metadata. The input is expected in a `vX` format, where `X` represents the version number (e.g. `v14`, `v15`). By default, metadata is outputted in 'json' format, unless the `metadata` query parameter is provided, in which case it can be either in 'json' or 'scale' format.
        required: true
        schema:
          type: string
      - name: at
        in: query
        description: Block at which to retrieve the transaction construction material from the relay chain.
        required: false
        schema:
          type: string
          description: Block identifier, as the block height or block hash.
          format: unsignedInteger or $hex
      - name: metadata
        in: query
        description: Specifies the format of the metadata to be returned. Accepted values are 'json', and 'scale'. 'json' being the decoded metadata, and 'scale' being the SCALE encoded metadata.
        schema:
          type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TransactionMaterial'
        '400':
          description: invalid blockId supplied for at query param
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Transaction:
      type: object
      properties:
        tx:
          type: string
          format: hex
    DryRunBody:
      type: object
      properties:
        at:
          type: string
          format: unsignedInteger
        tx:
          type: string
          format: hex
        senderAddress:
          type: string
          format: ss58
    TransactionFeeEstimateFailure:
      type: object
      properties:
        code:
          type: number
        at:
          type: object
          properties:
            hash:
              type: string
        error:
          type: string
          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:
          $ref: '#/components/schemas/WeightsV2'
          description: Weights represented as WeightsV2 (two dimensional weights). When querying historical blocks that use WeightsV1, the weight will be returned as a weight key that points to a number represented as a string.
        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).'
    WeightsV2:
      type: object
      properties:
        refTime:
          type: string
          description: The weight of computational time used based on some reference hardware.
        proofSize:
          type: string
          description: The weight of storage space used by proof of validity.
    TransactionDryRun:
      type: object
      properties:
        resultType:
          type: string
          enum:
          - DispatchOutcome
          - DispatchError
          - TransactionValidityError
          description: The result will be either a `DispatchOutcome` if the transaction is valid, a `DispatchError` if the transaction failed, or a `TransactionValidityError` if the transaction is invalid.
        result:
          oneOf:
          - $ref: '#/components/schemas/TransactionDispatchOutcome'
          - $ref: '#/components/schemas/TransactionDispatchError'
          - $ref: '#/components/schemas/TransactionValidityError'
      description: "References:\n  - `PostDispatchInfo`: https://docs.rs/frame-support/38.0.0/frame_support/dispatch/struct.PostDispatchInfo.html\n  - `DispatchError`: https://docs.rs/sp-runtime/39.0.1/sp_runtime/enum.DispatchError.html\n  - `Error Type`: https://paritytech.github.io/polkadot-sdk/master/xcm_runtime_apis/dry_run/enum.Error.html"
    BlockIdentifiers:
      type: object
      properties:
        hash:
          type: string
          description: The block's hash.
          format: hex
        height:
          type: string
          description: The block's height.
          format: unsignedInteger
    Error:
      type: object
      properties:
        code:
          type: number
        message:
          type: string
        stack:
          type: string
        level:
          type: string
    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. It will only be present when the metadata query param is used.
      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:
        hash:
          type: string
          description: The hash of the encoded transaction.
    TransactionDispatchOutcome:
      type: object
      description: The result of a valid transaction submitted via the `dry-run` endpoint.
      properties:
        actualWeight:
          type: string
          format: unsignedInteger
          description: The actual weight of the transaction.
        paysFee:
          type: string
          format: boolean
          description: Whether the transaction pays a fee.
    TransactionFailedToSubmit:
      type: object
      properties:
        code:
          type: number
        error:
          type: string
          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.
    TransactionValidityError:
      type: object
      description: The error result from an invalid transaction submitted via the `dry-run` endpoint.
      properties:
        errorType:
          type: string
          enum:
          - Unimplemented
          - VersionedConversionFailed
          description: The type of transaction error, either `Unimplemented` or `VersionedConversionFailed`.
    TransactionDispatchError:
      type: object
      description: The reason why the dispatch call failed.
      properties:
        errorType:
          type: string
          enum:
          - Other
          - CannotLookup
          - BadOrigin
          - ModuleError
          - ConsumerRemaining
          - NoProviders
          - TooManyConsumers
          - TokenError
          - ArithmeticError
          - TransactionalError
          - Exhausted
          - Corruption
          - Unavailable
          - RootNotAllowed
          description: The type of transaction error.
    TransactionFailure:
      oneOf:
      - $ref: '#/components/schemas/TransactionFailedToSubmit'
      - $ref: '#/components/schemas/TransactionFailedToParse'
    TransactionFailedToParse:
      type: object
      properties:
        code:
          type: number
        error:
          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.
  requestBodies:
    TransactionDryRun:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DryRunBody'
      required: true
    Transaction:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Transaction'
      required: true