{"id":17109208,"url":"https://github.com/dkackman/chia-dotnet","last_synced_at":"2025-04-13T02:32:15.290Z","repository":{"id":39897405,"uuid":"376350536","full_name":"dkackman/chia-dotnet","owner":"dkackman","description":"A dotnetcore client library for chia RPC","archived":false,"fork":false,"pushed_at":"2025-03-07T16:15:25.000Z","size":53038,"stargazers_count":22,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-10T07:02:16.035Z","etag":null,"topics":["bech32m","chia","chia-blockchain","cryptocurrency","dotnet-core"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dkackman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-12T17:41:04.000Z","updated_at":"2025-03-07T16:15:29.000Z","dependencies_parsed_at":"2023-10-11T03:44:17.555Z","dependency_job_id":"d3b50887-24b8-4a71-91a2-00b187bac118","html_url":"https://github.com/dkackman/chia-dotnet","commit_stats":{"total_commits":557,"total_committers":6,"mean_commits":92.83333333333333,"dds":0.04847396768402157,"last_synced_commit":"aeea1f2892fd838f799e76c7d7bca95762ca774e"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2Fchia-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2Fchia-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2Fchia-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dkackman%2Fchia-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dkackman","download_url":"https://codeload.github.com/dkackman/chia-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248657793,"owners_count":21140842,"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","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":["bech32m","chia","chia-blockchain","cryptocurrency","dotnet-core"],"created_at":"2024-10-14T16:22:27.816Z","updated_at":"2025-04-13T02:32:10.278Z","avatar_url":"https://github.com/dkackman.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chia-dotnet\n\nA [.net](https://dotnet.microsoft.com/download/dotnet/6.0) client library for [chia](https://github.com/Chia-Network/chia-blockchain)™ RPC interfaces that runs on linux and windows, including a bech32 implementation.\n\n[![build](https://github.com/dkackman/chia-dotnet/actions/workflows/dotnet.yml/badge.svg)](https://github.com/dkackman/chia-dotnet/actions)\n[![CodeQL](https://github.com/dkackman/chia-dotnet/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/dkackman/chia-dotnet/actions/workflows/github-code-scanning/codeql)\n[![NuGet](https://img.shields.io/nuget/dt/chia-dotnet)](https://www.nuget.org/packages/chia-dotnet/)\n\n## Getting Started\n\n### See Also\n\n- [Documentation](https://dkackman.github.io/chia-dotnet/)\n- [chia-dotnet-bls](https://www.nuget.org/packages/chia-dotnet-bls/)\n- [chia-dotnet-clvm](https://www.nuget.org/packages/chia-dotnet-clvm/)\n- [chia-blockchain](https://chia.net)\n\n### Features\n\n- Coverage of all of chia's rpc endpoints\n  - Daemon, Full Node, Farmer, Harvester, Wallet, Plotter, Crawler, DataLayer\n- Coverage of all of the methods at each endpoint\n  - as of 2.2.0\n- Static types for chia input and outputs\n- Supports connecting via the `daemon` on `wss` or directly to each service with `https`\n  - both `https` and `wss` use tha same interfaces so switching is seamless\n  \n### Examples\n\n_Test carefully and in one of the testnets!_\n\n#### Example app\n\nTry the [example code](https://github.com/dkackman/chia-dotnet/tree/main/Examples/crops) or take a look at [`rchia` remote chia management CLI](https://github.com/dkackman/rchia).\n\n#### Connect to the Node and find out about the blockchain\n\n```csharp\nvar endpoint = Config.Open().GetEndpoint(\"daemon\");\nusing var rpcClient = new WebSocketRpcClient(endpoint);\nawait rpcClient.Connect();\n\nvar daemon = new DaemonProxy(rpcClient, \"unit_tests\");\nawait daemon.RegisterService();\n\nvar fullNode = new FullNodeProxy(rpcClient, \"unit_tests\");\nvar state = await fullNode.GetBlockchainState();\nConsole.WriteLine($\"This node is synced: {state.Sync.Synced}\");\n```\n\n#### Send me some chia\n\n```csharp\nvar endpoint = Config.Open().GetEndpoint(\"wallet\");\nusing var rpcClient = new HttpRpcClient(endpoint);\n\nvar wallet = new WalletProxy(rpcClient, \"unit_tests\");\nawait wallet.WaitForSync();\n\n// walletId of 1 is the main XCH wallet\nvar standardWallet = new Wallet(1, wallet);\n\n// this is my receive address. feel free to run this code on mainnet as often as you like :-)\nvar transaction = await standardWallet.SendTransaction(\"xch1ls2w9l2tksmp8u3a8xewhn86na3fjhxq79gnsccxr0v3rpa5ejcsuugha7\", 1, 1);\n```\n\n### Listen for events\n\n```csharp\nusing chia.dotnet;\n\nvar endpoint = Config.Open().GetEndpoint(\"daemon\");\nusing var rpcClient = new WebSocketRpcClient(endpoint);\nawait rpcClient.Connect();\n\nvar daemon = new DaemonProxy(rpcClient, \"eventing_testharness\");\n// this listens for the messages sent to the ui\nawait daemon.RegisterService(\"wallet_ui\"); \ndaemon.StateChanged += (sender, data) =\u003e Console.WriteLine($\"daemon state change: {data}\");\n\nvar farmer = daemon.CreateProxyFrom\u003cFarmerProxy\u003e();\nfarmer.ConnectionAdded += (sender, data) =\u003e Console.WriteLine($\"Connection added: {data}\");\nfarmer.NewFarmingInfo += (sender, data) =\u003e Console.WriteLine($\"Farming info: {data}\");\nfarmer.NewSignagePoint += (sender, data) =\u003e Console.WriteLine($\"Signage point: {data}\");\n\nwhile (true)\n{\n    await Task.Delay(100);\n}\n\n```\n\n### Build\n\n````bash\ndotnet build ./src\n````\n\n### Install from nuget.org\n\n````bash\ndotnet add package chia-dotnet\n````\n\n### Tests\n\nThere are various unit and integration tests in the test project that have example usage. Some tests might be set to skip because they either need input data specific to a wallet or they may be destructive.\n\n### Some Notes About Types and Naming\n\nIn addition to static vs dynamic typing, C# and Python have very different conventions for naming and formatting. For the most part I've tried to make this library fit into dotnet conventions. Please open an issue if something doesn't feel `dotnet-y`.\n\n- Method and property names are `ProperCased`.\n- Parameter names are `camelCased`.\n- The chia RPC uses unsigned integers where dotnet might use signed. In cases where chia expects an unsigned number, it is unsigned on the dotnet side.\n- `ulong` is used for the python 64 bit unsigned int.\n- `System.Numerics.BigInteger` is used for the python 128 bit unsigned int.\n- Where the RPC return a scalar value, the dotnet code will as well. If it is optional in python it will be `Nullable\u003cT\u003e` in dotnet\n- Where the RPC returns a list of named scalar values, they are returned as a Tuple with named fields.\n- Lists of things are returned as [`IEnumberable\u003cT\u003e`](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1?view=net-5.0).\n- Where the python code returns a differently shaped object based on its input or logic, the dotnet code is turned into multiple methods.\n- When the RPC returns a success flag equal to `false`, the dotnet code throws an exception.\n\n___\n\n_chia and its logo are the registered trademark or trademark of Chia Network, Inc. in the United States and worldwide._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkackman%2Fchia-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdkackman%2Fchia-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdkackman%2Fchia-dotnet/lists"}