ResearchCave.Wallet.Client (1.0.0)
Installation
dotnet nuget add source --name ResearchCave --username your_username --password your_token https://git.researchcave.com/api/packages/ResearchCave/nuget/index.jsondotnet add package --source ResearchCave --version 1.0.0 ResearchCave.Wallet.ClientAbout this package
Typed service client for ResearchCave Wallet assets and reward-backed reservations.
ResearchCave.Wallet.Client
Typed service client for ResearchCave Wallet.
builder.Services.AddResearchCaveWalletClient(builder.Configuration);
Configuration:
{
"Services": {
"Wallet": {
"BaseUrl": "https+http://researchcave-wallet",
"PublicBaseUrl": "https://wallet.researchcave.com",
"UseServiceAuthentication": true,
"Scope": "wallet.rewards",
"TimeoutSeconds": 15,
"CurrencyCacheSeconds": 30
}
}
}
BaseUrl is used for server-to-server calls. PublicBaseUrl converts Wallet-owned
relative asset image paths, such as /img/coin/tbt.svg, into URLs that browser-facing
consumers can use.
GetCurrenciesAsync reads the public Wallet currency catalog without a service token.
The client caches successful responses in process for CurrencyCacheSeconds (1–300 seconds)
and merges concurrent cache misses into one request. The API also caches its database
snapshot for 30 seconds and clears that snapshot when an admin changes a currency.
GetAvailableAssetsAsync returns the canonical asset code, gateway asset identifier,
symbol, display name, decimals, active state, icon filename, Wallet-hosted icon URL,
chain, and Wallet-managed display Priority. Results are ordered by descending priority
and then asset code, so consuming services should preserve the returned order. Consumers should use AssetCode when creating Wallet operations, Symbol
and Name for display, and Decimals to validate amounts.
IsReadyAsync probes Wallet's unauthenticated /health readiness endpoint. A
non-success response returns false; connection and timeout failures remain exceptions
so callers can log the dependency failure.
When service authentication is enabled, the client obtains a client-credentials token
from oidc:Authority using oidc:ClientId and oidc:ClientSecret.