1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//! Daml ledger GRPC [API](https://docs.daml.com/app-dev/grpc/index.html).
//!
//! 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`](data::command::DamlCreateCommand) to the ledger:
//!
//! ```no_run
//! # use futures::future::Future;
//! # use daml_grpc::data::command::DamlCommand;
//! # use daml_grpc::DamlGrpcClientBuilder;
//! # use daml_grpc::DamlSimpleExecutorBuilder;
//! # use daml_grpc::data::DamlResult;
//! # use daml_grpc::CommandExecutor;
//! # use daml_grpc::data::command::DamlCreateCommand;
//! # use daml_grpc::data::DamlIdentifier;
//! # use daml_grpc::data::value::DamlRecord;
//! # use std::error::Error;
//! # fn main() -> DamlResult<()> {
//! # futures::executor::block_on(async {
//! 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?;
//! # Ok(())
//! # })
//! # }
//! ```
//!
//! Note that Daml commands such as [`DamlCreateCommand`](data::command::DamlCreateCommand) can be automatically
//! generated for existing Daml templates using the various functions and macros provided in the [`daml-codegen`](https://docs.rs/daml-codegen/0.3.0) crate.
//!
//! Note also that the [`daml_value`](https://docs.rs/daml-macro/0.3.0/daml_macro/macro.daml_value.html) macro is
//! provided to simplify the construction of [`DamlRecord`](data::value::DamlRecord) and
//! [`DamlValue`](data::value::DamlValue) types.
/// Daml API domain objects (i.e. values, commands, events).
/// Daml GRPC API services (i.e. command & transaction services).
/// Daml primitive data types.
/// Serialize & Deserialize Daml types.
/// Nat types for specifying Daml Numeric types.
pub use ;
pub use DamlCommandFactory;
pub use ;
/// Raw prost-generated Ledger API v2 protobuf bindings.
///
/// Exposed so downstream crates (e.g. `roadrunner-proto`) can re-use the
/// `transaction.proto` / `value.proto` types without re-vendoring the
/// protos. The DTO wrappers in [`data`] sit on top of these; most user
/// code should reach for the DTOs rather than the raw prost types.