logo
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

Daml API domain objects (i.e. values, commands, events).

Nat types for specifying Daml Numeric types.

Daml primitive data types.

Serialize & Deserialize Daml types.

Daml GRPC API services (i.e. command & transaction services).

Structs

Factory for creating DamlCommands to submit to a Daml ledger.

Daml ledger client connection.

A simple async Daml command executor.

Traits

An async failable Daml command executor.

A generic failable executor.