diff --git a/core/client/src/lib.rs b/core/client/src/lib.rs index 8062fae500199..f5d1298f941bb 100644 --- a/core/client/src/lib.rs +++ b/core/client/src/lib.rs @@ -35,6 +35,7 @@ pub mod in_mem; #[cfg(feature = "std")] pub mod genesis; pub mod block_builder; +pub mod transaction_builder; #[cfg(feature = "std")] pub mod light; #[cfg(feature = "std")] diff --git a/core/client/src/transaction_builder.rs b/core/client/src/transaction_builder.rs new file mode 100644 index 0000000000000..700de8c4c7456 --- /dev/null +++ b/core/client/src/transaction_builder.rs @@ -0,0 +1,40 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + +//! The runtime api for building transactions. + +use sr_api_macros::decl_runtime_apis; +use runtime_primitives::KeyTypeId; +use rstd::vec::Vec; + +decl_runtime_apis! { + /// The `TransactionBuilder` trait that provides required functions + /// for building a transaction from a Call for the runtime. + pub trait TransactionBuilder { + /// Construct the payload. + fn signing_payload(encoded_call: Vec, encoded_account_id: Vec) -> Vec; + + /// Build the transaction. + fn build_transaction( + signing_payload: Vec, + encoded_account_id: Vec, + signature: Vec, + ) -> Vec; + + /// Get list of supported crypto types. + fn possible_crypto() -> Vec; + } +}