Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Collection of Internet Computer Protocol (ICP) libraries for .NET/Blazor/Unity
- Start coding 💻

# 📡 Generating a client for a canister
You can specify all the models and api calls yourself, but this is a tool to automatically generate a client and models based on the cansiter or .did file
You can specify all the models and api calls yourself, but this is a tool to automatically generate a client and models based on the canister or .did file
- Prerequisite: Have .Net 6 installed (https://dotnet.microsoft.com/en-us/download/dotnet)
- Navigate to directory of .Net project
```
Expand Down Expand Up @@ -141,4 +141,4 @@ public enum MyVariantTag
- [IC Http Interface Spec](https://smartcontracts.org/docs/current/references/ic-interface-spec)
- [Candid Spec](https://github.com/dfinity/candid/blob/master/spec/Candid.md)
- [Candid Decoder](https://fxa77-fiaaa-aaaae-aaana-cai.raw.ic0.app/explain)
- [Candid UI Tester](https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app)
- [Candid UI Tester](https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app)
92 changes: 46 additions & 46 deletions src/Agent/API.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions src/Agent/Agents/IAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace EdjCase.ICP.Agent.Agents
{
/// <summary>
/// An agent is used to communicate with the Internet Computer with certain protocols that
/// An agent is used to communicate with the Internet Computer with certain protocols that
/// are specific to an `IAgent` implementation
/// </summary>
public interface IAgent
Expand All @@ -24,7 +24,7 @@ public interface IAgent
/// <param name="canisterId">Canister to read state for</param>
/// <param name="paths">The state paths to get information for. Other state data will be pruned if not specified</param>
/// <param name="cancellationToken">Optional. Token to cancel request</param>
/// <returns>A response that contains the certificate of the current cansiter state</returns>
/// <returns>A response that contains the certificate of the current canister state</returns>
Task<ReadStateResponse> ReadStateAsync(Principal canisterId, List<StatePath> paths, CancellationToken? cancellationToken = null);

/// <summary>
Expand All @@ -37,12 +37,12 @@ public interface IAgent
Task<RequestStatus?> GetRequestStatusAsync(Principal canisterId, RequestId id, CancellationToken? cancellationToken = null);

/// <summary>
/// Sends a call request to a specified canister method and gets back an id of the
/// Sends a call request to a specified canister method and gets back an id of the
/// request that is being processed. This call does NOT wait for the request to be complete.
/// Either check the status with `GetRequestStatusAsync` or use the `CallAndWaitAsync` method
/// </summary>
/// <param name="canisterId">Canister to read state for</param>
/// <param name="method">The name of the method to call on the cansiter</param>
/// <param name="method">The name of the method to call on the canister</param>
/// <param name="arg">The candid arg to send with the request</param>
/// <param name="effectiveCanisterId">Optional. Specifies the relevant canister id if calling the root canister</param>
/// <param name="cancellationToken">Optional. Token to cancel request</param>
Expand All @@ -60,7 +60,7 @@ public interface IAgent
/// Sends a query request to a specified canister method
/// </summary>
/// <param name="canisterId">Canister to read state for</param>
/// <param name="method">The name of the method to call on the cansiter</param>
/// <param name="method">The name of the method to call on the canister</param>
/// <param name="arg">The candid arg to send with the request</param>
/// <param name="cancellationToken">Optional. Token to cancel request</param>
/// <returns>The response data of the query call</returns>
Expand All @@ -86,7 +86,7 @@ public static class IAgentExtensions
/// </summary>
/// <param name="agent">The agent to use for the call</param>
/// <param name="canisterId">Canister to read state for</param>
/// <param name="method">The name of the method to call on the cansiter</param>
/// <param name="method">The name of the method to call on the canister</param>
/// <param name="arg">The candid arg to send with the request</param>
/// <param name="effectiveCanisterId">Optional. Specifies the relevant canister id if calling the root canister</param>
/// <param name="cancellationToken">Optional. Token to cancel request</param>
Expand Down
4 changes: 2 additions & 2 deletions src/Agent/Responses/QueryResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public enum QueryResponseType
/// </summary>
Replied,
/// <summary>
/// When the cansiter request has errors to query request
/// When the canister request has errors to query request
/// </summary>
Rejected
}
Expand Down Expand Up @@ -229,4 +229,4 @@ internal QueryRejectInfo(RejectCode code, string? message, string? errorCode)
this.ErrorCode = errorCode;
}
}
}
}
6 changes: 3 additions & 3 deletions src/Candid/API.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/Candid/Models/Principal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public string ToHex()
///
/// The method expects a sub-account byte array of exactly 32 bytes in length. If the provided array does not meet this
/// requirement, an <see cref="ArgumentException"/> is thrown.
///
///
/// The account identifier format follows the specification:
/// account_identifier(principal, subaccount_identifier) = CRC32(h) || h
/// where h = sha224("\x0Aaccount-id" || principal || subaccount_identifier).
Expand All @@ -119,7 +119,7 @@ public byte[] ToLedgerAccount(byte[]? subAccount)
if (subAccount == null)
{
// Empty byte array of 32 bytes for no subaccount
subAccount = new byte[32];
subAccount = new byte[32];
}
// Ensure the subAccount is of expected length (32 bytes)
if (subAccount.Length != 32)
Expand Down Expand Up @@ -147,9 +147,9 @@ public byte[] ToLedgerAccount(byte[]? subAccount)
}

/// <summary>
/// Helper method to create the principal for the Internet Computer management cansiter "aaaaa-aa"
/// Helper method to create the principal for the Internet Computer management canister "aaaaa-aa"
/// </summary>
/// <returns>Principal for the management cansiter</returns>
/// <returns>Principal for the management canister</returns>
public static Principal ManagementCanisterId()
{
return new Principal(PrincipalType.Opaque, new byte[0]);
Expand Down Expand Up @@ -287,4 +287,4 @@ public override int GetHashCode()
return !v1.Equals(v2);
}
}
}
}
Loading