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
//! A library for interacting with the Concordium blockchain. The library is
//! structured around multiple modules.
//!
//! - [`v2`] contains the main entrypoint to the library. In particular it
//!   contains the [`Client`](v2::Client) struct
//! which maintains a connection to the node, and supports queries and node
//! manipulation. This client uses gRPC API version 2 of the Concordium node.
//! - [`constants`] contains a number of constants and type definitions that are
//!   relevant when using the chain.
//! - [`types`] contains most type definitions to model responses as well as
//!   types defining transactions.
//! The latter are in a submodule [`types::transactions`].
//!
//! In addition to these, the library re-exports a number of core crates that
//! implement the core cryptographic protocols of the Concordium blockchain.
//!
//! - [`id`] is the implementation of most of the protocols in the identity
//!   layer
//! - [`common`] has some common type definitions, as well as traits and helpers
//!   for binary serialization
//! - [`encrypted_transfers`] implements structures and zero knowledge proofs
//!   related to encrypted transfers
//! - [`eddsa_ed25519`] is a re-export of the signature scheme used for blocks
//!   and accounts on the Concordium blockchain.
//! - [`aggregate_sig`] is a re-export of the BLS signature scheme, used by the
//!   finalizers.
//! - [`ecvrf`] is a re-export of the implementation of the VRF function used to
//!   determine lottery winners in consensus.

/// Various constants and types that apply to the chain.
pub mod constants;
/// Wrapper for the node's GRPC API. The return values are parsed and wrapped in
/// structured values.
pub mod endpoints;
mod internal;
/// Interface to the (optional) postgres database that the node logs finalized
/// transactions in.
#[cfg(feature = "postgres")]
pub mod postgres;
/// Type definitions used throughout the rest of the SDK.
pub mod types;

/// A generic client for interacting with smart contracts.
pub mod contract_client;

/// Types and functions for working with CIS-0 smart contracts.
pub mod cis0;
/// Types and functions for working with CIS-2 smart contracts.
pub mod cis2;
/// Types and functions for working with CIS-4 credential registry standard
/// contracts.
pub mod cis4;

pub mod web3id;

/// Re-export of the identity library.
pub use concordium_base::id;

/// Re-export of common helper functionality.
pub use concordium_base::common;

/// Re-export of functionality for constructing and verifying encrypted
/// transfers.
pub use concordium_base::encrypted_transfers;

/// Re-export of functionality for constructing and verifying aggregate
/// signatures. This is useful for constructing baker transactions.
pub use concordium_base::aggregate_sig;

/// Re-export of Elgamal encryption.
pub use concordium_base::eddsa_ed25519;

/// Re-export the VRF function implementation.
pub use concordium_base::ecvrf;

/// A [client](v2::Client) for the concordium node gRPC API version 2.
pub mod v2;

/// Functionality related to smart contracts.
pub mod smart_contracts;

/// Re-export of [`concordium_base`]. The main purpose of this is
/// to enable the use of `concordium_base_derive` serialization macros.
pub use concordium_base as base;

pub mod indexer;