Cosmcs 0.5.1

dotnet add package Cosmcs --version 0.5.1
NuGet\Install-Package Cosmcs -Version 0.5.1
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.5.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cosmcs --version 0.5.1
#r "nuget: Cosmcs, 0.5.1"
#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.
// Install Cosmcs as a Cake Addin
#addin nuget:?package=Cosmcs&version=0.5.1

// Install Cosmcs as a Cake Tool
#tool nuget:?package=Cosmcs&version=0.5.1

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 ec = new EasyClient(rpcUrl, 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 options = new EasyClientOptions{
    GrpcChannelOptions = new GrpcChannelOptions{
        HttpHandler = new GrpcWebHandler(GrpcWebMode.GrpcWeb, new HttpClientHandler())
    }
};
var ec = new EasyClient(rpcUrl, 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. 
.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.5.1 101 5/7/2024
0.5.0 104 5/3/2024
0.5.0-rc1 63 5/3/2024
0.4.4 422 10/17/2023
0.4.3 152 10/4/2023
0.4.2 113 10/4/2023
0.4.1 156 9/28/2023
0.4.0 135 9/28/2023
0.4.0-rc3 85 9/28/2023
0.4.0-rc2 84 9/27/2023
0.4.0-rc1 80 9/27/2023
0.3.2 207 9/21/2023
0.3.1 154 8/18/2023
0.3.0 126 8/18/2023
0.2.7 155 8/15/2023
0.2.5 207 8/7/2023
0.2.4 185 8/6/2023
0.2.3 129 8/4/2023
0.2.2 143 8/1/2023
0.2.1 146 8/1/2023
0.2.0 170 7/31/2023
0.1.1 174 7/30/2023
0.1.0 185 7/22/2023
0.0.17 188 7/17/2023
0.0.16 137 7/16/2023
0.0.15 141 7/16/2023
0.0.14 146 7/16/2023
0.0.13 145 7/15/2023
0.0.10 146 7/12/2023
0.0.6 153 7/3/2023
0.0.5 145 7/3/2023
0.0.4 139 7/3/2023
0.0.3 147 7/2/2023
0.0.2 138 6/22/2023
0.0.1 138 6/22/2023