Skip to content

.NET project to handle Substrate Metadata versions. Based on Substrate.NET.API

License

Notifications You must be signed in to change notification settings

SubstrateGaming/Substrate.NET.Metadata

Repository files navigation

Substrate.NET.Metadata

Build & Analyse Reliability Rating GitHub issues license Nuget

Project to manage Substrate based blockchain Metadata from V9 to V14

How to use ?

Instanciate metadata classes

Please check the getMetadataAsync() method from the Substrate.NET.API library allows you to get the hexadecimal string representation of the metadata for a given Substrate blockchain. Once you have the hexadecimal string representation of the metadata, you can instantiate the corresponding Metadata class by instanciating the right Metadata class.

  string hexMetadataFromSubstrateNetApi = "0x...";
  var v11 = new MetadataV11(hexMetadataFromSubstrateNetApi);
  var v12 = new MetadataV12(hexMetadataFromSubstrateNetApi);
  var v13 = new MetadataV13(hexMetadataFromSubstrateNetApi);
  var v14 = new MetadataV14(hexMetadataFromSubstrateNetApi);

If you are not sure of your metadata version you can call :

  string hexMetadataFromSubstrateNetApi = "0x...";
  var metadataInfo = new CheckRuntimeMetadata(hexMetadataFromSubstrateNetApi);

  // metadataInfo.MetaDataInfo.Version.Value -> 11 / 12 / 13 / 14

Compare metadata

You can also compare metadata between each other, but it should be the same major version (compare V12 with V12 and V14 with V14)

The package also provides a MetadataService class that can be instantiated directly or used with dependency injection. Metadata comparison can provide a differential between two versions, including removed or added pallets, as well as more precise information such as function calls that have been renamed. The MetadataService class supports comparison from version 9 to 14.

Dependencies

About

.NET project to handle Substrate Metadata versions. Based on Substrate.NET.API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages