Expand description
Daml ledger GRPC API.
This library provides a client for the Daml ledger GRPC API.
§Example
The following example demonstrates creating a DamlGrpcClient using the DamlGrpcClientBuilder, then creating
a DamlSimpleExecutor using the DamlSimpleExecutorBuilder and finally creating and submitting a
DamlCreateCommand to the ledger:
let client = DamlGrpcClientBuilder::uri("http://localhost:8082").connect().await?;
let executor = DamlSimpleExecutorBuilder::new(&client).act_as("Alice").build()?;
let template_id = DamlIdentifier::new("...", "Fuji.PingPong", "Ping");
let record = DamlRecord::new(vec![], None::<DamlIdentifier>);
let command = DamlCreateCommand::new(template_id, record);
let create_event = executor.execute_create(command).await?;Note that Daml commands such as DamlCreateCommand can be automatically
generated for existing Daml templates using the various functions and macros provided in the daml-codegen crate.
Note also that the daml_value macro is
provided to simplify the construction of DamlRecord and
DamlValue types.
Modules§
- data
- Daml API domain objects (i.e. values, commands, events).
- nat
- Nat types for specifying Daml Numeric types.
- primitive_
types - Daml primitive data types.
- serialize
- Serialize & Deserialize Daml types.
- service
- Daml GRPC API services (i.e. command & transaction services).
Structs§
- Daml
Command Factory - Factory for creating
DamlCommandsto submit to a Daml ledger. - Daml
Grpc Client - Daml ledger client connection.
- Daml
Grpc Client Builder - Construct a
DamlGrpcClient. - Daml
Simple Executor - A simple async Daml command executor.
- Daml
Simple Executor Builder - Construct a
DamlSimpleExecutor.
Traits§
- Command
Executor - An async failable Daml command executor.
- Executor
- A generic failable executor.