CanDoItAll.Ledger.Sdk
0.1.18
dotnet add package CanDoItAll.Ledger.Sdk --version 0.1.18
NuGet\Install-Package CanDoItAll.Ledger.Sdk -Version 0.1.18
<PackageReference Include="CanDoItAll.Ledger.Sdk" Version="0.1.18" />
<PackageVersion Include="CanDoItAll.Ledger.Sdk" Version="0.1.18" />
<PackageReference Include="CanDoItAll.Ledger.Sdk" />
paket add CanDoItAll.Ledger.Sdk --version 0.1.18
#r "nuget: CanDoItAll.Ledger.Sdk, 0.1.18"
#:package CanDoItAll.Ledger.Sdk@0.1.18
#addin nuget:?package=CanDoItAll.Ledger.Sdk&version=0.1.18
#tool nuget:?package=CanDoItAll.Ledger.Sdk&version=0.1.18
CanDoItAll.Ledger.Sdk
Typed node client and dependency-injection integration for CanDoItAll Ledger account and transaction workflows.
Use this package to connect .NET applications, services, tools, and drivers to a running Ledger node. It provides health and bootstrap contracts, account and transaction queries, transaction submission, treasury/admin request models, business-object account composition, and configurable API-key or JWT authentication.
Requirements
- .NET 10
- A reachable CanDoItAll Ledger node
Install
dotnet add package CanDoItAll.Ledger.Sdk
Connect Directly
using CanDoItAll.Ledger.Sdk;
using var node = new LedgerNodeLedgerClient(
new Uri("http://127.0.0.1:8080/"),
new LedgerNodeLedgerClientOptions
{
ApiBasePath = "api/v1",
ApiKey = Environment.GetEnvironmentVariable("LEDGER_API_KEY")
?? throw new InvalidOperationException(
"Set LEDGER_API_KEY for protected node reads.")
});
NodeHealthResponse health =
await node.GetHealthAsync(CancellationToken.None);
NodeBootstrapInfo bootstrap =
await node.GetBootstrapInfoAsync(CancellationToken.None);
The default API base path is api/v1.
Register With Dependency Injection
using CanDoItAll.Ledger.Sdk;
builder.Services.AddLedgerSdkWithNodeDriver(
new Uri(builder.Configuration["Ledger:NodeBaseUri"]
?? throw new InvalidOperationException("Node URI is missing.")),
options =>
{
options.ApiBasePath = "api/v1";
options.BearerToken =
builder.Configuration["Ledger:BearerToken"];
});
Registration choices:
AddLedgerSdk()adds client-side canonicalization, hashing, rules, clock, andLedgerClient, but does not choose a gateway.AddLedgerSdkWithBusinessObjectLayer()adds the account layer and defaults to the in-process gateway unless the host registeredILedgerGatewayandILedgerReadClientfirst.AddLedgerSdkWithNodeDriver(...)selects the HTTP node gateway and read client.AddLedgerSdkWithBrowserNodeDriver(...)adds browser account signing and node access. Register Web Crypto and IndexedDB separately withCanDoItAll.Ledger.Cryptography.BrowserandAddCanDoItAllBrowserCrypto().AddLedgerSdkWithGateway<TGateway>()selects an application-owned gateway.
Authentication And Results
LedgerNodeLedgerClientOptions supports ApiBasePath, ApiKeyHeaderName,
ApiKey, and BearerToken. A bearer token takes precedence when both token and
API key are configured.
- Liveness may be public while readiness, bootstrap, reads, or writes require node authorization.
- Never embed API keys or bearer tokens in published WebAssembly. Put privileged calls behind a server or trusted same-origin proxy.
- Catch
LedgerNodeRequestExceptionto inspect HTTP status and Problem Details returned by the node. - Check
LedgerSubmitResult.Acceptedfor submitted signed transactions; HTTP transport success alone is not ledger acceptance.
See the Node and AccountApp quickstart, driver integration guide, and full source.
This package is part of the CanDoItAll ecosystem and uses the repository's MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- CanDoItAll.Ledger.BusinessObjects (>= 0.1.18)
- CanDoItAll.Ledger.Core (>= 0.1.18)
- CanDoItAll.Ledger.Cryptography (>= 0.1.18)
- CanDoItAll.Ledger.Rules.NCalc (>= 0.1.18)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CanDoItAll.Ledger.Sdk:
| Package | Downloads |
|---|---|
|
CanDoItAll.Ledger.Components
Reusable Blazor components and workspaces for ledger accounts, transactions, business objects, analytics, and node operations. |
GitHub repositories
This package is not used by any popular GitHub repositories.