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

#2333 in Development tools

Download history 4/week @ 2024-01-15 1/week @ 2024-02-05 9/week @ 2024-02-12 18/week @ 2024-02-19 28/week @ 2024-02-26 15/week @ 2024-03-04 28/week @ 2024-03-11 20/week @ 2024-03-18 20/week @ 2024-03-25 50/week @ 2024-04-01 13/week @ 2024-04-08 14/week @ 2024-04-15 19/week @ 2024-04-22

100 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

~16–27MB
~495K SLoC