Cosmcs 0.6.0
dotnet add package Cosmcs --version 0.6.0
NuGet\Install-Package Cosmcs -Version 0.6.0
<PackageReference Include="Cosmcs" Version="0.6.0" />
paket add Cosmcs --version 0.6.0
#r "nuget: Cosmcs, 0.6.0"
// Install Cosmcs as a Cake Addin #addin nuget:?package=Cosmcs&version=0.6.0 // Install Cosmcs as a Cake Tool #tool nuget:?package=Cosmcs&version=0.6.0
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 | Versions 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. |
-
.NETStandard 2.1
- CardanoBech32 (>= 0.9.1)
- Cryptography.ECDSA.Secp256k1 (>= 1.1.3)
- DevHawk.RIPEMD160 (>= 3.0.27)
- Google.Protobuf (>= 3.23.3)
- Grpc.Core (>= 2.46.6)
- Grpc.Net.Client (>= 2.55.0)
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.6.0 | 92 | 10/30/2024 |
0.5.1 | 207 | 5/7/2024 |
0.5.0 | 143 | 5/3/2024 |
0.5.0-rc1 | 90 | 5/3/2024 |
0.4.4 | 502 | 10/17/2023 |
0.4.3 | 189 | 10/4/2023 |
0.4.2 | 140 | 10/4/2023 |
0.4.1 | 205 | 9/28/2023 |
0.4.0 | 172 | 9/28/2023 |
0.4.0-rc3 | 111 | 9/28/2023 |
0.4.0-rc2 | 112 | 9/27/2023 |
0.4.0-rc1 | 105 | 9/27/2023 |
0.3.2 | 293 | 9/21/2023 |
0.3.1 | 196 | 8/18/2023 |
0.3.0 | 149 | 8/18/2023 |
0.2.7 | 192 | 8/15/2023 |
0.2.5 | 253 | 8/7/2023 |
0.2.4 | 228 | 8/6/2023 |
0.2.3 | 153 | 8/4/2023 |
0.2.2 | 167 | 8/1/2023 |
0.2.1 | 169 | 8/1/2023 |
0.2.0 | 212 | 7/31/2023 |
0.1.1 | 216 | 7/30/2023 |
0.1.0 | 225 | 7/22/2023 |
0.0.17 | 229 | 7/17/2023 |
0.0.16 | 161 | 7/16/2023 |
0.0.15 | 165 | 7/16/2023 |
0.0.14 | 169 | 7/16/2023 |
0.0.13 | 171 | 7/15/2023 |
0.0.10 | 170 | 7/12/2023 |
0.0.6 | 178 | 7/3/2023 |
0.0.5 | 171 | 7/3/2023 |
0.0.4 | 166 | 7/3/2023 |
0.0.3 | 169 | 7/2/2023 |
0.0.2 | 164 | 6/22/2023 |
0.0.1 | 163 | 6/22/2023 |