Documentation
¶
Overview ¶
Package client provides the high-level Canton SDK client.
It exposes a unified interface for interacting with a Canton ledger, including identity, token, and optional bridge operations.
Index ¶
- type Client
- type Config
- type Option
- func WithBridgeConfig(cfg *bridge.Config) Option
- func WithGRPCDialOptions(opts ...grpc.DialOption) Option
- func WithHTTPClient(c *http.Client) Option
- func WithKeyResolver(kr token.KeyResolver) Option
- func WithLogger(l *zap.Logger) Option
- func WithPrometheusRegisterer(reg sharedmetrics.NamespacedRegisterer) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Ledger ledger.Ledger
Identity identity.Identity
Token token.Token
Bridge bridge.Bridge // optional; nil when disabled
}
Client is the SDK facade.
type Config ¶
type Config struct {
// Common fields propagated to all sub-components by New().
DomainID string `yaml:"domain_id" validate:"required"`
IssuerParty string `yaml:"issuer_party" validate:"required"` // maps to IssuerParty (identity/token) and OperatorParty (bridge)
// Sub-component configs. Each only carries its unique fields in YAML.
Ledger *ledger.Config `yaml:"ledger" validate:"required"`
Identity *identity.Config `yaml:"identity" validate:"required"`
Token *token.Config `yaml:"token" validate:"required"`
Bridge *bridge.Config `yaml:"bridge" default:"-"` // nil = bridge disabled
}
Config is the top-level Canton SDK config; YAML-importable directly into app configs.
type Option ¶
type Option func(*settings)
Option configures client settings using the functional options pattern.
func WithBridgeConfig ¶
WithBridgeConfig enables and configures the optional bridge client. If nil, the bridge client is not initialized.
func WithGRPCDialOptions ¶
func WithGRPCDialOptions(opts ...grpc.DialOption) Option
WithGRPCDialOptions appends additional gRPC dial options to the underlying ledger connection. Use this to inject interceptors, custom credentials, etc.
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client for the SDK client.
func WithKeyResolver ¶
func WithKeyResolver(kr token.KeyResolver) Option
WithKeyResolver provides a function to look up signing keys by party ID. Required for transfers involving external parties (Interactive Submission).
func WithLogger ¶
WithLogger sets a custom logger for the SDK client.
func WithPrometheusRegisterer ¶
func WithPrometheusRegisterer(reg sharedmetrics.NamespacedRegisterer) Option
WithPrometheusRegisterer enables Canton client metrics and registers them against the provided NamespacedRegisterer. When set, a gRPC unary interceptor is automatically installed that records <namespace>_client_rpc_duration_seconds.