hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
model_transaction_builder.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SHARED_MODEL_MODEL_TRANSACTION_BUILDER_HPP
7 #define IROHA_SHARED_MODEL_MODEL_TRANSACTION_BUILDER_HPP
8 
12 
13 namespace shared_model {
14  namespace bindings {
20  private:
21  template <int Sp>
22  explicit ModelTransactionBuilder(
24  : builder_(o) {}
25 
26  public:
28 
34  ModelTransactionBuilder creatorAccountId(
35  const interface::types::AccountIdType &account_id);
36 
42  ModelTransactionBuilder createdTime(
43  interface::types::TimestampType created_time);
44 
50  ModelTransactionBuilder quorum(interface::types::QuorumType quorum);
51 
58  ModelTransactionBuilder batchMeta(
60  const std::vector<interface::types::HashType> &hashes);
61 
68  ModelTransactionBuilder addAssetQuantity(
69  const interface::types::AssetIdType &asset_id,
70  const std::string &amount);
71 
78  ModelTransactionBuilder addPeer(
79  const interface::types::AddressType &address,
80  const crypto::PublicKey &peer_key);
81 
88  ModelTransactionBuilder addSignatory(
89  const interface::types::AddressType &account_id,
90  const crypto::PublicKey &public_key);
91 
98  ModelTransactionBuilder removeSignatory(
99  const interface::types::AddressType &account_id,
100  const crypto::PublicKey &public_key);
101 
108  ModelTransactionBuilder appendRole(
109  const interface::types::AccountIdType &account_id,
110  const interface::types::RoleIdType &role_name);
111 
119  ModelTransactionBuilder createAsset(
120  const interface::types::AssetNameType &asset_name,
121  const interface::types::DomainIdType &domain_id,
123 
131  ModelTransactionBuilder createAccount(
132  const interface::types::AccountNameType &account_name,
133  const interface::types::AddressType &domain_id,
134  const crypto::PublicKey &main_pubkey);
135 
142  ModelTransactionBuilder createDomain(
143  const interface::types::AddressType &domain_id,
144  const interface::types::RoleIdType &default_role);
145 
152  ModelTransactionBuilder createRole(
153  const interface::types::RoleIdType &role_name,
154  const interface::RolePermissionSet &permissions);
155 
162  ModelTransactionBuilder detachRole(
163  const interface::types::AccountIdType &account_id,
164  const interface::types::RoleIdType &role_name);
165 
172  ModelTransactionBuilder grantPermission(
173  const interface::types::AccountIdType &account_id,
175 
182  ModelTransactionBuilder revokePermission(
183  const interface::types::AccountIdType &account_id,
185 
193  ModelTransactionBuilder setAccountDetail(
194  const interface::types::AccountIdType &account_id,
197 
204  ModelTransactionBuilder setAccountQuorum(
205  const interface::types::AddressType &account_id,
207 
214  ModelTransactionBuilder subtractAssetQuantity(
215  const interface::types::AssetIdType &asset_id,
216  const std::string &amount);
217 
227  ModelTransactionBuilder transferAsset(
228  const interface::types::AccountIdType &src_account_id,
229  const interface::types::AccountIdType &dest_account_id,
230  const interface::types::AssetIdType &asset_id,
231  const std::string &description,
232  const std::string &amount);
233 
239 
240  private:
243  builder_;
244  };
245  } // namespace bindings
246 } // namespace shared_model
247 
248 #endif // IROHA_SHARED_MODEL_MODEL_TRANSACTION_BUILDER_HPP
ModelTransactionBuilder addSignatory(const interface::types::AddressType &account_id, const crypto::PublicKey &public_key)
Definition: model_transaction_builder.cpp:48
Definition: model_transaction_builder.hpp:19
ModelTransactionBuilder addPeer(const interface::types::AddressType &address, const crypto::PublicKey &peer_key)
Definition: model_transaction_builder.cpp:42
ModelTransactionBuilder setAccountDetail(const interface::types::AccountIdType &account_id, const interface::types::AccountDetailKeyType &key, const interface::types::AccountDetailValueType &value)
Definition: model_transaction_builder.cpp:120
ModelTransactionBuilder createAsset(const interface::types::AssetNameType &asset_name, const interface::types::DomainIdType &domain_id, interface::types::PrecisionType precision)
Definition: model_transaction_builder.cpp:69
ModelTransactionBuilder grantPermission(const interface::types::AccountIdType &account_id, interface::permissions::Grantable permission)
Definition: model_transaction_builder.cpp:106
Grantable
Definition: permissions.hpp:66
std::string AddressType
Type of peer address.
Definition: types.hpp:43
std::string DomainIdType
Iroha domain id type.
Definition: types.hpp:51
Definition: permissions.hpp:92
ModelTransactionBuilder revokePermission(const interface::types::AccountIdType &account_id, interface::permissions::Grantable permission)
Definition: model_transaction_builder.cpp:113
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
ModelTransactionBuilder detachRole(const interface::types::AccountIdType &account_id, const interface::types::RoleIdType &role_name)
Definition: model_transaction_builder.cpp:99
ModelTransactionBuilder appendRole(const interface::types::AccountIdType &account_id, const interface::types::RoleIdType &role_name)
Definition: model_transaction_builder.cpp:62
std::string AccountDetailKeyType
Type of account detail key.
Definition: types.hpp:75
description
Definition: setup.py:71
ModelTransactionBuilder transferAsset(const interface::types::AccountIdType &src_account_id, const interface::types::AccountIdType &dest_account_id, const interface::types::AssetIdType &asset_id, const std::string &description, const std::string &amount)
Definition: model_transaction_builder.cpp:142
ModelTransactionBuilder createRole(const interface::types::RoleIdType &role_name, const interface::RolePermissionSet &permissions)
Definition: model_transaction_builder.cpp:92
std::string AccountIdType
Type of account id.
Definition: types.hpp:37
ModelTransactionBuilder creatorAccountId(const interface::types::AccountIdType &account_id)
Definition: model_transaction_builder.cpp:14
ModelTransactionBuilder createDomain(const interface::types::AddressType &domain_id, const interface::types::RoleIdType &default_role)
Definition: model_transaction_builder.cpp:85
ModelTransactionBuilder removeSignatory(const interface::types::AddressType &account_id, const crypto::PublicKey &public_key)
Definition: model_transaction_builder.cpp:55
Definition: transaction_template.hpp:36
ModelTransactionBuilder createAccount(const interface::types::AccountNameType &account_name, const interface::types::AddressType &domain_id, const crypto::PublicKey &main_pubkey)
Definition: model_transaction_builder.cpp:77
ModelTransactionBuilder subtractAssetQuantity(const interface::types::AssetIdType &asset_id, const std::string &amount)
Definition: model_transaction_builder.cpp:135
ModelTransactionBuilder setAccountQuorum(const interface::types::AddressType &account_id, interface::types::QuorumType quorum)
Definition: model_transaction_builder.cpp:128
Definition: unsigned_proto.hpp:25
ModelTransactionBuilder createdTime(interface::types::TimestampType created_time)
Definition: model_transaction_builder.cpp:19
uint8_t PrecisionType
Type of precision.
Definition: types.hpp:39
std::string AccountNameType
Type of account name.
Definition: types.hpp:67
proto::UnsignedWrapper< proto::Transaction > build()
Definition: model_transaction_builder.cpp:153
Definition: public_key.hpp:16
ModelTransactionBuilder quorum(interface::types::QuorumType quorum)
Definition: model_transaction_builder.cpp:24
BatchType
Definition: types.hpp:83
std::string AccountDetailValueType
Type of account detail value.
Definition: types.hpp:77
ModelTransactionBuilder addAssetQuantity(const interface::types::AssetIdType &asset_id, const std::string &amount)
Definition: model_transaction_builder.cpp:35
Definition: command_executor.hpp:12
uint16_t QuorumType
Type of Quorum used in transaction and set quorum.
Definition: types.hpp:59
std::string AssetNameType
Type of asset name.
Definition: types.hpp:69
ModelTransactionBuilder()
Definition: model_transaction_builder.cpp:10
std::string RoleIdType
Type of role (i.e admin, user)
Definition: types.hpp:49
uint64_t TimestampType
Type of timestamp.
Definition: types.hpp:61
ModelTransactionBuilder batchMeta(interface::types::BatchType type, const std::vector< interface::types::HashType > &hashes)
Definition: model_transaction_builder.cpp:29
std::string AssetIdType
Type of asset id.
Definition: types.hpp:53