| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Collection of Internet Computer Protocol (ICP) libraries for .NET/Blazor/Unity
Agent - Library to communicate to and from the Internet Computer
Candid - Library of Candid Encoding, Models and Helpers
Client Generator - Client source code generator for ICP canisters
Internet Identity (Experimental) - Internet Identity authenticater (experimental and not secure)
Note: WebGL/IL2CPP is not supported YET due to an issue with IL2CPP, working on it
Prerequisite: Have .Net 6 installed (https://dotnet.microsoft.com/en-us/download/dotnet)
Navigate to directory of .Net project
cd {path/to/project}
Add Agent nuget package to project
dotnet add package EdjCase.ICP.Agent
Install ClientGenerator
dotnet tool install -g EdjCase.ICP.ClientGenerator
This will allow a client to be automatically be generated for a canister. See ClientGenerator README for more details and advanced config
Initialize ClientGenerator config (first run only)
candid-client-generator init
This will create a TOML config file in the directory that can be changed for more advanced options
Update created config file candid-client.toml
If using a canister id:
namespace = "ProjectGovernance" # Base namespace to use
output-directory = "./Clients" # Output directory
[[clients]]
name = "Governance" # Label of client to use
type = "canister" # Indicates to make client from a canister id
canister-id = "rrkah-fqaaa-aaaaa-aaaaq-cai" # Canister id to make client forIf using a service definition file (.did)
namespace = "ProjectGovernance" # Base namespace to use
output-directory = "./Clients" # Output directory
[[clients]]
name = "Governance" # Label of client to use
type = "file" # Indicates to make client from a service definition file
file-path = "Governance.did" # File to useFor all configuration options see ClientGenerator README for more details
Generate Client
candid-client-generator gen
Will output C# file to the output directory specified in the config
Use client in code
var agent = new HttpAgent();
Principal canisterId = Principal.FromText("rrkah-fqaaa-aaaaa-aaaaq-cai");
var client = new GovernanceApiClient(agent, canisterId);
OptionalValue<Sample.Shared.Governance.Models.ProposalInfo> proposalInfo = await client.GetProposalInfo(110174);
...SHIP IT! 🚀
| Back | FazBrowse Home | New Git URL |