5 releases

0.2.2 Mar 8, 2022
0.2.1 Mar 7, 2022
0.2.0 Mar 4, 2022
0.1.1 Mar 3, 2022
0.1.0 Mar 1, 2022

#2603 in Development tools

34 downloads per month
Used in 7 crates (5 directly)

Apache-2.0

220KB
5K SLoC

Documentation Crate maintenance-status

Daml GRPC

This crate provides a library for using the Daml GRPC API.

This crate should not be used directly, instead you should depend on the daml crate and enable the grpc feature:

[dependencies]
daml = { version = "0.2.2", features = [ "grpc" ] }

License

daml-grpc is distributed under the terms of the Apache License (Version 2.0).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in time by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See LICENSE for details.

Copyright 2022


lib.rs:

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.

Dependencies

~17–27MB
~510K SLoC