/// <summary> Constructor. </summary> /// <remarks> 19.09.2020. </remarks> /// <param name="uri"> URI of the resource. </param> public SubstrateClient(Uri uri) { _uri = uri; System = new Modules.System(this); Chain = new Chain(this); State = new State(this); Author = new Author(this); // types used by the client need to be registred RegisterTypeConverter(new GenericTypeConverter <Bool>()); RegisterTypeConverter(new GenericTypeConverter <U8>()); RegisterTypeConverter(new GenericTypeConverter <U16>()); RegisterTypeConverter(new GenericTypeConverter <U32>()); RegisterTypeConverter(new GenericTypeConverter <U64>()); RegisterTypeConverter(new GenericTypeConverter <BlockNumber>()); RegisterTypeConverter(new GenericTypeConverter <AccountId>()); RegisterTypeConverter(new GenericTypeConverter <AccountInfo>()); RegisterTypeConverter(new GenericTypeConverter <AccountData>()); RegisterTypeConverter(new GenericTypeConverter <Hash>()); RegisterTypeConverter(new GenericTypeConverter <Vec <U8> >()); RegisterTypeConverter(new GenericTypeConverter <Vec <U32> >()); RegisterTypeConverter(new GenericTypeConverter <Vec <Hash> >()); RegisterTypeConverter(new GenericTypeConverter <Vec <AccountId> >()); //RegisterTypeConverter(new AccountInfoTypeConverter()); _requestTokenSourceDict = new ConcurrentDictionary <CancellationTokenSource, string>(); }
/// <summary> Constructor. </summary> /// <remarks> 19.09.2020. </remarks> /// <param name="uri"> URI of the resource. </param> public SubstrateClient(Uri uri) { _uri = uri; System = new Modules.System(this); Chain = new Modules.Chain(this); State = new Modules.State(this); Author = new Modules.Author(this); RegisterTypeConverter(new U8TypeConverter()); RegisterTypeConverter(new U16TypeConverter()); RegisterTypeConverter(new U32TypeConverter()); RegisterTypeConverter(new U64TypeConverter()); RegisterTypeConverter(new AccountIdTypeConverter()); RegisterTypeConverter(_hashTypeConverter); RegisterTypeConverter(new AccountInfoTypeConverter()); }