{"id":21528515,"url":"https://github.com/fibercrypto/libskyfiber-dotnet","last_synced_at":"2025-08-11T09:05:24.710Z","repository":{"id":38069557,"uuid":"130543323","full_name":"fibercrypto/libskyfiber-dotnet","owner":"fibercrypto","description":"Skycoin client libraries for .NET ( C# )","archived":false,"fork":false,"pushed_at":"2022-12-08T04:30:38.000Z","size":1658,"stargazers_count":1,"open_issues_count":10,"forks_count":4,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-04-09T23:43:41.546Z","etag":null,"topics":["client-library","csharp","csharp-library","dotnet","dotnet-assembly","dotnet-library","openapi","pinvoke","pinvoke-wrapper","rest-api","rest-client","restapi","skycoin","swagger","swig","vbnet"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fibercrypto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-22T07:01:04.000Z","updated_at":"2019-12-23T13:21:52.000Z","dependencies_parsed_at":"2023-01-25T09:45:58.590Z","dependency_job_id":null,"html_url":"https://github.com/fibercrypto/libskyfiber-dotnet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/fibercrypto/libskyfiber-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Flibskyfiber-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Flibskyfiber-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Flibskyfiber-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Flibskyfiber-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fibercrypto","download_url":"https://codeload.github.com/fibercrypto/libskyfiber-dotnet/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fibercrypto%2Flibskyfiber-dotnet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269857440,"owners_count":24486392,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client-library","csharp","csharp-library","dotnet","dotnet-assembly","dotnet-library","openapi","pinvoke","pinvoke-wrapper","rest-api","rest-client","restapi","skycoin","swagger","swig","vbnet"],"created_at":"2024-11-24T01:53:31.539Z","updated_at":"2025-08-11T09:05:24.683Z","avatar_url":"https://github.com/fibercrypto.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Libskycoin for .Net\n\n[![Build Status](https://travis-ci.org/libskycoin-dotnet.svg?branch=develop)](https://travis-ci.org/simelo/libskycoin-dotnet)\n\n.Net client library for Skycoin API. This library is a .Net composed assembly generated with SWIG and OPENAPI to access Skycoin API from .Net.\n\n## Table of Contents\n\n\u003c!-- MarkdownTOC levels=\"1,2,3,4,5\" autolink=\"true\" bracket=\"round\" --\u003e\n\n- [LibSkycoinNet wrappers for the Skycoin cipher](#libskycoinnet-wrappers-for-the-skycoin-cipher)\n  - [Installation](#installation)\n  - [Using the API](#usage)\n    - [Naming](#naming)\n    - [Parameters](#parameters)\n      - [Handles](#handles)\n      - [Byte Slices](#byte-slices)\n      - [Structures](#structures)\n      - [Fixed Sized Arrays](#fixed-sized-arrays)\n      - [Other Slices](#other-slices)\n    - [Memory Managemanet](#memory-management)\n- [SkyApi wrapper for Skycoin REST API](#skyapi-wrapper-for-skycoin-rest-api)\n- [Make rules](#make-rules)\n- [Development setup](#development-setup)\n  \u003c!-- /MarkdownTOC --\u003e\n\n\n## LibSkycoinNet wrappers for the Skycoin cipher\n\n**LibSkycoinNet** is an assembly that provides wrappers to the Skycoin core cipher API's, implemented in `golang`, hence linking directly to the original node code. No transpilation involved.\n\n### Installation\n\nBefore installing, make sure you understand the choices available to [install a Nuget package](https://docs.microsoft.com/en-us/nuget/consume-packages/ways-to-install-a-package) and the [level of support in your platform](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) for each possible configuration. For instance, in case of [installing Nuget client tools](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools) the process would look like this, using [`dotnet add package` command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-add-package).\n\n```sh\n\ndotnet add package LibSkycoinNet\n```\n\n... or using [Nuget install command](https://docs.microsoft.com/en-us/nuget/tools/cli-ref-install) ...\n\n```sh\n\nnuget install LibSkycoinNet\n```\n\nIt is possible to install the package using [Visual Studio Package Manager Console](https://docs.microsoft.com/en-us/nuget/tools/package-manager-console) by executing the following command and then follow the instructions to [install and use a package in Visual Studio](https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio).\n\n```sh\n\nInstall-Package LibSkycoinNet\n```\n\nFor getting similar results using a graphical IDE interface consider package name to be `LibSkycoinNet` and consult the articles listed below:\n\n- [Install and use a package in Visual Studio](https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio)\n- [Package Manager UI reference for Windows users](https://docs.microsoft.com/en-us/nuget/tools/package-manager-ui)\n- [Including a NuGet package in your project using Mac OS](https://docs.microsoft.com/en-us/visualstudio/mac/nuget-walkthrough)\n\n### Install from sources\n\nDownload the repository from http://github.com/simelo/libskycoin-dotnet.git.\nExecute (`nuget restore LibskycoinNet.sln`) to install the library. Although executing (`nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory testrunner`) is a better choice for making changes to the library. However, when using tox these commands are not required at all because calling tox will make any necessary installation and execute the tests.\n\n### Usage\n\n#### Naming\n\nThe exported function in Libskycoin .NET have the following naming format: `SKY_package_func_name` where package is replace by the package where the original Skycoin function is and func_name is the name of the function. For example, `LoadConfig` function from `cli` package is called in .Net `SKY_cli_LoadConfig`\n\n#### Parameters\n\nAll skycoin exported functions return an error object as the last of the return parameters. In .NET error is return as an `uint` and it is the first return parameter. The rest of the parameters are returned in the same order.\n\nReceivers in Skycoin are the first of the input parameters. Simple types, like integer, float, string will be used as the corresponding types in .NET, except what act as pointers.\n\n##### Handles\n\nSome of Skycoin types are too complex to be exported to a scripting language. So, handles are used instead. Therefore all functions taking a complex type will receive a handle instead of the original Skycoin type. For example, having these functions exported from Skycoin:\n\n```go\n  func LoadConfig() (Config, error)\n  func (c Config) FullWalletPath() string\n```\n\nConfig is a struct type that is treated as a handle in Libskycoin .Net . The usage in .Net will be:\n\n```csharp\n\nusing skycoin;\nnamespace LibskycoinNet\n{\n    public class Skycoin : skycoin.skycoin\n    {\n    public function main(){\n      var configHandle = new_Config_HandlePtr();\n      var err = SKY_cli_LoadConfig(configHandle);\n      if(err == SKY_OK) {\n        // SkY_OK means no error\n        var fullWalletPath = new _GoString()_;\n        err = SKY_cli_FullWalletPath(configHandle,fullWallerPath);\n        Assert.AreEqual(err,SKY_OK);\n        Console.WriteLine(fullWallerPath.p);\n\n        //Close the handle after using the it\n        //so the garbage collector can delete the object associated with  it.\n        SKY_handle_close( configHandle );\n      } else {\n        #Error\n        Console.WriteLine(err);\n      }\n    }\n  }\n}\n```\n\n##### Byte slices\n\nParameters of type byte[] will treated as string . Example, this function in Skycoin:\n\n```go\nfunc (s ScryptChacha20poly1305) Encrypt(data, password []byte) ([]byte, error)\n```\n\n... should be invoked like this:\n\n```csharp\nvar encrypt_settings = new encrypt__ScryptChacha20poly1305();\nvar data = new GoSlice(); //It will be passed as a parameter of type []byte\nvar pwd = new GoSlice(); //As []byte too\nvar dataStr = new _GoString();\nvar pwdStr = new _GoString();\nvar encrypted = new GoSlice();\n\ndataStr.setString(\"Data to encrypt\" );\ndata.convertString(dataStr);\npwdStr.SetString(\"password\");\npwd.convertString(pwdStr);\n\nvar err = SKY_encrypt_ScryptChacha20poly1305_Encrypt(encrypt_settings, data, pwd,encrypted);\nif(err == SKY_OK){\n  Console.WriteLine(encrypted.getString().p); //Encrypted is GoSlice\n}\n```\n\n##### Structures\n\nStructures that are not exported as handles are treated like .NET classes. In the previous example type ScryptChacha20poly1305 is created in .NET like:\n\n```csharp\nvar encrypt_settings = new encrypt__ScryptChacha20poly1305()\n```\n\nAnd passed as first parameter in call to `SKY_encrypt_ScryptChacha20poly1305_Encrypt`.\n\n##### Fixed Sized Arrays\n\nParameters of fixed size array are wrapped in structures when called from .NET.\n\nGiven these types in Skycoin and this exported function:\n\n```go\n  type PubKey [33]byte\n  type SecKey [32]byte\n\n  func GenerateDeterministicKeyPair(seed []byte) (PubKey, SecKey)\n```\n\nThis is a way to use them to write assertions in .NET:\n\n```csharp\n//Generates random seed\nvar data = new GoSlice();\nvar err = SKY_cipher_RandByte(32,data);\n\nAssert.AreEqual(err,SKY_OK);\n\nvar pubkey = new cipher_PubKey();\nvar seckey = new cipher_SecKey();\n\nerr = SKY_cipher_GenerateDeterministicKeyPair(data, pubkey,seckey);\n```\n\nIn the example above `pubkey` and `seckey` are objects of an structure type containing a field named `data` holding the corresponding instance of `PubKey` and `SecKey`. Something like:\n\n```cpp\n  cipher_PubKey struct{\n    data [33]byte;\n  } cipher_PubKey;\n\n  cipher_SecKey struct{\n    data [32]byte;\n  } ;\n```\n\n##### Other Slices\n\nOther slices of base type different from `byte` are indeed wrapped inside classes. Let's see how to call the following function:\n\n```go\nfunc GenerateDeterministicKeyPairs(seed []byte, n int) []SecKey\n```\n\nIn C# this how it should be used to generate a deterministic sequence of pairs of public / private keys given a random seed:\n\n```csharp\n//Generates random seed\nvar seed = new GoSlice();\nvar err = SKY_cipher_RandByte(32,seed);\nvar seckeys = new cipher__SecKeys();\n\nerr = SKY_cipher_GenerateDeterministicKeyPairs(seed, 2,seckeys);\n\nfor(int i=0;i\u003cseckeys.count,i++){\n  var pubkey = new cipher_PubKey();\n  var seckey = new cipher_SecKey();\n  seckeys.getAt(seckey,i);\n\n  SKY_cipher_PubKeyFromSecKey(seckey, pubkey);\n  err = SKY_cipher_PubKey_Verify(pubkey);\n  Assert.AreEqual(err,SKY_OK);\n}\n```\n\n### Memory Management\n\nMemory management is transparent to the user. Any object allocated inside the library is left to be managed by the .NET garbage collector.\n\n## SkyApi wrapper for Skycoin REST API\n\nThis wrapper is Auto generated by openapi-generator directly from `Skycoin Api` code for version v0.25.1.\n\nFor further details of usage of `RestCsharp wrapper for Skycoin Api` see [Autogenerated documentation](./lib/restsharp/README.md)\n\n### Specific Node Address\n\nFor use a specific node of Skycoin, you just need to create a instance of `ApiClient` passing the node address:\n\n```csharp\nvar restSharpClient = new ApiClient(\"specific_node_address\")\n```\n\nThen in `restSharpClient` you can use all methods related to Api Client.\n\n## Make Rules\n\nThe following `make` rules are available after `git checkout` of this repository. They all require [Skycoin](https://github.com/skycoin/skycoin) to be checked out as a `git submodule` of libskycoin .NET .\n\n```\n$ make help\n\nconfigure                      Setup build environment\nbuild-libc                     Build libskycoin static C client library\nbuild-swig                     Generate csharp source code from SWIG interface definitions\nbuild-libsky-shared            Build shared library including SWIG wrappers\ninstall-deps-libsky            Install development dependencies for LibSkycoinNet\nbuild-libsky                   Build LibSkycoinNet Assembly\nbuild-skyapi                   Build SkyApi Assembly\nbuild                          Build library\ntest-libsky                    Run LibSkycoinNet test suite\ntest-skyapi                    Run SkyApi test suite\ntest                           Run all tests\n```\n\n## Development setup\n\nIt is highly recommended for developers to setup their environment using\nthe available Docker images.\nRead the [LibSkycoinNet Docker docs](docker/images/dev-cli/README.md) for further\ndetails.\n\nThe project has two branches: `master` and `develop`.\n\n- `develop` is the default branch and will always have the latest code.\n  The submodule at `gopath/src/github.com/skycoin/skycoin` has to be\n  in sync with `skycoin/skycoin` `develop` branch.\n- `master` will always be equal to the current stable release on the website, and should correspond with the latest release tag.\n  The submodule at `gopath/src/github.com/skycoin/skycoin` has to be\n  in sync with `skycoin/skycoin` `master` branch.\n\nSeparate stable development branches will be created to work on releases for supporting the\nmost recent stable version of Skycoin. The name of these branches should be the Skycoin\nmajor and minor version numbers followed by `dev` suffix e.g. `0.25dev`.\nThese branches may be forked out of either `master` or `develop` branches, and \nthe submodule at `gopath/src/github.com/skycoin/skycoin` has to be\nin sync with the corresponding tag of `skycoin/skycoin` official repository.\n\nStable development branches are created most of the time for the following reasons:\n\n- A Skycoin release increasing [patch version number](https://semver.org/).\n- Enhanced support and bug fixes for a version of LibSkycoinNet compiled against an\n  stable version of Skycoin\n- Backporting useful features added in `develop`.\n\n### Running tests\n\n```sh\n$ make test\n```\n\n### Releases\n\n#### Update the version\n\n0. If the `master` branch has commits that are not in `develop` (e.g. due to a hotfix applied to `master`), merge `master` into `develop` (and fix any build or test failures)\n0. Switch to a new release branch named `release-X.Y.Z` for preparing the release.\n0. Ensure that the submodule at `gopath/src/github.com/skycoin/skycoin` is in sync with respect to the corresponding tag in https://github.com/skycoin/skycoin repository.\n0. Update package version (`LibskycoinNet/LibskycoinNet.csproj`)\n0. Run `make build` to make sure that the code base is up to date\n0. Update `CHANGELOG.md`: move the \"unreleased\" changes to the version and add the date.\n0. Follow the steps in [pre-release testing](#pre-release-testing)\n0. Make a PR merging the release branch into `master`\n0. Review the PR and merge it\n0. Update files in https://github.com/skycoin/repo-info/tree/master/repos/skycoin/remote for `skycoin/skycoindev-dotnet` Docker image, adding a new file for the new version and adjusting any configuration text that may have changed\n0. Tag the `master` branch with the version number. Version tags start with `v`, e.g. `v0.20.0`. Sign the tag. If you have your GPG key in github, creating a release on the Github website will automatically tag the release. It can be tagged from the command line with `git tag -as v0.20.0 $COMMIT_ID`, but Github will not recognize it as a \"release\".\n0. Release builds are created and uploaded by travis. To do it manually, checkout the master branch and follow the [create release builds instructions](#creating-release-builds).\n0. Checkout `develop` branch and bump package up to next [`dev` version number](https://docs.microsoft.com/en-us/nuget/create-packages/prerelease-packages).\n\n#### Pre-release testing\n\nPerform these actions before releasing:\n\n    make test\n\n#### Creating release builds\n\nRelease builds should be created from `master` branch . After [updating release version](#update-the-version) it is necessary to follow these steps\n\n##### Requirements\nHave installed the `mono` for the creation of the package.\n\nhttps://www.mono-project.com/download/stable/\n\n##### Building\n\n    msbuild /p:Configuration=Release LibskycoinNet.sln\n\nFinal results are placed in the LibskycoinNet/bin/Release/ folder.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibercrypto%2Flibskyfiber-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffibercrypto%2Flibskyfiber-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffibercrypto%2Flibskyfiber-dotnet/lists"}