{"id":19423197,"url":"https://github.com/make-software/casper-net-sdk-web","last_synced_at":"2025-04-24T16:30:46.428Z","repository":{"id":58594576,"uuid":"472088745","full_name":"make-software/casper-net-sdk-web","owner":"make-software","description":"This library is an extension of the Casper .NET SDK to build web applications with Blazor or ASP.NET Core.","archived":false,"fork":false,"pushed_at":"2024-02-20T20:16:29.000Z","size":796,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-27T05:32:05.487Z","etag":null,"topics":["asp-net-core","blazor","blockchain","casper-network","library","sdk"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/make-software.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2022-03-20T19:59:55.000Z","updated_at":"2024-07-07T08:48:48.377Z","dependencies_parsed_at":"2024-01-31T14:31:18.533Z","dependency_job_id":"f9870960-69ee-434c-b0ce-5ca961a90424","html_url":"https://github.com/make-software/casper-net-sdk-web","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-net-sdk-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-net-sdk-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-net-sdk-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/make-software%2Fcasper-net-sdk-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/make-software","download_url":"https://codeload.github.com/make-software/casper-net-sdk-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250663544,"owners_count":21467366,"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":["asp-net-core","blazor","blockchain","casper-network","library","sdk"],"created_at":"2024-11-10T13:37:11.034Z","updated_at":"2025-04-24T16:30:46.050Z","avatar_url":"https://github.com/make-software.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Casper .NET SDK Web\n\nThis library is an extension of the [Casper .NET SDK](https://github.com/make-software/casper-net-sdk) to build web applications with Blazor or ASP.NET Core.\n\nThe main components are:\n\n* `CasperRPCService`: a service class to call RPC endpoints in a Casper node.\n* `CasperSSEService`: a service class to listen for server side events from a Casper node.\n* `CasperSignerInterop`: a service class to communicate with the Casper Signer browser extension.\n* `CasperLedgerInterop`: a service class to communicate with a Ledger device via the browser WebUSB API.\n\n## Documentation\n\nThe main SDK documentation, examples and tutorials can be found [here](https://make-software.github.io/casper-net-sdk/). Articles for the web extensions is in progress and will be added soon to the site.\n\n## Prerequisites\n\nTo use this Clients library you'll need to have .NET 5 or later installed in your system.\n\n## Get started\n\nThis library is published as a nuget package in [nuget.org](https://www.nuget.org/packages/Casper.Network.SDK.Clients).\n\nTo add a reference to the Web library in your project, use the Package Manager in Visual Studio or the `dotnet` cli tool.\n\n#### Package Manager (Windows)\n```\nInstall-Package Casper.Network.SDK.Web\n``` \n\n#### dotnet cli tool (Windows/Mac/Linux)\n```\ndotnet add package Casper.Network.SDK.Web\n``` \n\n### Add services to the DI container\n\nYou need to register the services you'll use in your application into the Dependency Injection container. Add to your `Program.cs` file the services you need:\n\n```c#\nbuilder.Services.AddCasperRPCService(builder.Configuration);\nbuilder.Services.AddCasperSSEService(builder.Configuration);\nbuilder.Services.AddCasperSignerInterop();\nbuilder.Services.AddCasperLedgerInterop();\n```\n\nIf you need one of the contract clients classes, you may register it as well. For example, for the [CEP47 client](https://github.com/make-software/casper-net-sdk-clients) class, add to the `Program.cs` file the following code:\n\n```c#\nbuilder.Services.AddTransient\u003cICEP47Client, CEP47Client\u003e(provider =\u003e\n{\n    if (provider.GetService(typeof(ICasperClient)) is not ICasperClient rpcService)\n        throw new Exception(\"Not able to get an ICasperClient instance to boot up.\");\n    \n    if (provider.GetService(typeof(IConfiguration)) is not IConfiguration configService)\n        throw new Exception(\"Not able to get an IConfiguration instance to boot up.\");\n    \n    return new CEP47Client(rpcService, configService[\"Casper.Network.SDK.Web:ChainName\"]);\n});\n```\n\nFinally, in your `appsettings.json` you must specify some configuration variables the services will look up during construction:\n\n```\n{\n  ...  \n  \"Casper.Network.SDK.Web\" : {\n    \"NodeAddress\": \"http://testnet-node.make.services:7777/rpc\",\n    \"ClientFactory\": \"caspernode\",\n    \"ChainName\": \"casper-net-1\"\n  },\n  ...\n}\n```\n\n## Demo\n\nThe directory `Docs/Demos` contains a demo project that shows how to configure the service classes in the Dependency Injection container and use them in the components classes. The application is built with the Blazor framework and demonstrates also the integration with the ERC20 client in the [Clients](https://github.com/make-software/casper-net-sdk-clients) library as well as how to interact with the Casper Signer extension.\n\n## Create a workspace in Gitpod\n\nClick the button to start coding in Gitpod with an online IDE.\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/make-software/casper-net-sdk-web)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmake-software%2Fcasper-net-sdk-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmake-software%2Fcasper-net-sdk-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmake-software%2Fcasper-net-sdk-web/lists"}