paritytech / substrate-api-sidecar

REST service that makes it easy to interact with blockchain nodes built using Substrate's FRAME framework.

Home Page:https://paritytech.github.io/substrate-api-sidecar/dist/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: add `version` query param in `transaction/material` endpoint

Imod7 opened this issue · comments

Proposed Change or Idea
Introduce a query parameter named version to the transaction/material endpoint.

A rough overview of its functionality is outlined below:

  • If the user specifies the version query param:
    • First call metadata_versions to retrieve the available metadata versions.
    • Verify if the specified version (from the query param) is present in the retrieved list from previous step.
    • If the version is found, return that version using metadata_at_version call.
    • If not found, either return an error message or the default version.
  • If the user omits the version query parameter, return the default version.

Additional Information
For further inspiration refer to subxt-cli, as this functionality has already been implemented there.