casper_client/cli/transaction_str_params.rs
1/// Container for `Transaction` construction options.
2///
3///
4/// ## `session_args_simple`
5///
6/// For methods taking `session_args_simple`, this parameter is the session contract arguments, in
7/// the form `<NAME:TYPE='VALUE'>` or `<NAME:TYPE=null>`.
8///
9/// There are further details in
10/// [the docs for the equivalent
11/// `payment_args_simple`](struct.PaymentStrParams.html#payment_args_simple).
12///
13/// ## `session_args_json`
14///
15/// For methods taking `session_args_json`, this parameter is the session contract arguments, as a
16/// JSON-encoded Array of JSON Objects of the form:
17/// ```json
18/// [{"name":<String>,"type":<VALUE>,"value":<VALUE>}]
19/// ```
20///
21/// There are further details in
22/// [the docs for the equivalent `payment_args_json`](struct.PaymentStrParams.html#payment_args_json).
23#[derive(Default, Debug, Clone)]
24pub struct TransactionStrParams<'a> {
25 /// Path to secret key file.
26 ///
27 /// If `secret_key` is empty, the new transaction will not be signed and will need to be signed (e.g.
28 /// via [`sign_transaction_file`](super::sign_transaction_file)) at least once in order to be made valid.
29 pub secret_key: &'a str,
30 /// RFC3339-like formatted timestamp. e.g. `2018-02-16T00:31:37Z`.
31 ///
32 /// If `timestamp` is empty, the current time will be used. Note that timestamp is UTC, not
33 /// local.
34 ///
35 /// See [`humantime::parse_rfc3339_weak`] for more information.
36 pub timestamp: &'a str,
37 /// Time that the `transaction` will remain valid for.
38 ///
39 /// A `transaction` can only be included in a `Block` between `timestamp` and `timestamp + ttl`.
40 /// Input examples: '1hr 12min', '30min 50sec', '1day'.
41 ///
42 /// See [`humantime::parse_duration`] for more information.
43 pub ttl: &'a str,
44 /// Name of the chain, to avoid the `transaction` from being accidentally or maliciously included in
45 /// a different chain.
46 pub chain_name: &'a str,
47 /// The hex-encoded public key, account hash, or entity address of the account context under which
48 /// the session code will be executed.
49 ///
50 /// If `initiator_addr` is empty, the initiator address will be derived from the provided
51 /// `secret_key`. It is an error for both fields to be empty.
52 pub initiator_addr: String,
53 /// Simple session args for use in the transaction
54 pub session_args_simple: Vec<&'a str>,
55 /// Session args in json for use with the transaction
56 pub session_args_json: &'a str,
57 /// The pricing mode to use with the transaction
58 pub pricing_mode: &'a str,
59 /// User-specified additional computation factor for "fixed" pricing_mode (minimum 0)
60 /// if "0" is provided, no additional logic is applied to the computation limit.
61 pub additional_computation_factor: &'a str,
62 /// The optional output path for the transaction, if writing it to a file.
63 pub output_path: &'a str,
64 /// The payment amount for executing the transaction
65 pub payment_amount: &'a str,
66 /// User-specified gas_price tolerance.
67 pub gas_price_tolerance: &'a str,
68 /// The digest of a previous transaction that represents the receipt for the current transaction.
69 pub receipt: &'a str,
70 /// Standard payment.
71 pub standard_payment: &'a str,
72 /// Transaferred value.
73 pub transferred_value: &'a str,
74 /// The entry point for the session.
75 ///
76 /// None means "call" (aka default) entry point.
77 pub session_entry_point: Option<&'a str>,
78 /// Chunked arguments for the transaction.
79 pub chunked_args: Option<Vec<u8>>,
80 /// Whether to override the minimum bid amount checks.
81 pub min_bid_override: bool,
82}