Cosmcs 0.7.0

dotnet add package Cosmcs --version 0.7.0
                    
NuGet\Install-Package Cosmcs -Version 0.7.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cosmcs" Version="0.7.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cosmcs" Version="0.7.0" />
                    
Directory.Packages.props
<PackageReference Include="Cosmcs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cosmcs --version 0.7.0
                    
#r "nuget: Cosmcs, 0.7.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cosmcs@0.7.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cosmcs&version=0.7.0
                    
Install as a Cake Addin
#tool nuget:?package=Cosmcs&version=0.7.0
                    
Install as a Cake Tool

Cosmcs

A C# client library for Cosmos SDK blockchains for netstandard2.1 with Unity support This is modeled after cosmrs

Build

git submodule sync
./gen_proto.sh
dotnet build

Usage

With EasyClient

Cosmcs.Client.EasyClient is an easy to use client object

var rpcUrl = "http://localhost:9090";
var chainId = "mychain1";
var prefix = "cosmos";
byte[] privateKey = new byte[32]
{
    176, 139, 111, 219, 136, 19, 183,
    176, 135, 218, 199, 231, 70, 249,
    129, 238, 212, 167, 207, 147, 217,
    51, 43, 217, 82, 136, 182, 245,
    189, 104, 186, 17
};  // Place byte privateKey here
var queryClient = new QueryClient(rpcUrl);
var ec = new EasyClient(queryClient, chainId, privateKey, "cosmos");
// Using pregenerated routes
var authzTxClient = new Cosmos.Authz.V1beta1.MsgClient(ec);
// Using pregenerated queries
var authzQueryClient = new Cosmos.Authz.V1beta1.Query.QueryClient(ec.Channel);

Unity

Due to Unity's lack of support for HTTP/2.0 and the fact that gRPC exclusively utilizes HTTP/2.0, specific options must be provided when initializing EasyClient. This adjustment allows the internal gRPC channel to utilize gRPC-Web, which is compatible with HTTP/1.x. Cosmos blockchains start a grpc server on port 9090 and a grpc-web server on port 9091.

// ...
var rpcUrl = "http://localhost:9091";
var queryClient = new QueryClient(rpcUrl, new GrpcChannelOptions{
    HttpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, new HttpClientHandler())
});
var ec = new EasyClient(queryClient, chainId, privateKey, "cosmos", options);
// ...

Examples

For a fully working example with codegeneration see CardchainCs.

License and Development

This is licensed under the GPL-v3 License, part of the DecentralCardgame project and developed by lxgr-linux.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Cosmcs:

Package Downloads
CardchainCs

A C# client library for cosmos-sdk blockchains

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.7.0 488 4/19/2025
0.7.0-rc4 253 3/22/2025
0.7.0-rc2 224 2/19/2025
0.7.0-rc1 209 2/19/2025
0.6.0 417 10/30/2024
0.5.1 423 5/7/2024
0.5.0 337 5/3/2024
0.5.0-rc1 207 5/3/2024
0.4.4 710 10/17/2023
0.4.3 320 10/4/2023
0.4.2 273 10/4/2023
0.4.1 364 9/28/2023
0.4.0 310 9/28/2023
0.4.0-rc3 214 9/28/2023
0.4.0-rc2 240 9/27/2023
0.4.0-rc1 225 9/27/2023
0.3.2 469 9/21/2023
0.3.1 335 8/18/2023
0.3.0 286 8/18/2023
0.2.7 354 8/15/2023
Loading failed