iota_rest_api/transactions/
unresolved.rs1use iota_sdk_types::{Address, Command, Digest, ObjectId, TransactionExpiration, Version};
5
6pub(crate) type OptionReadableDisplay =
7 ::serde_with::As<Option<::serde_with::IfIsHumanReadable<::serde_with::DisplayFromStr>>>;
8
9#[derive(serde::Serialize, serde::Deserialize)]
11pub struct UnresolvedTransaction {
12 #[serde(flatten)]
13 pub ptb: UnresolvedProgrammableTransaction,
14 pub sender: Address,
15 pub gas_payment: Option<UnresolvedGasPayment>,
16 pub expiration: TransactionExpiration,
17}
18
19#[derive(serde::Serialize, serde::Deserialize)]
20pub struct UnresolvedProgrammableTransaction {
21 pub inputs: Vec<UnresolvedInputArgument>,
22 pub commands: Vec<Command>,
23}
24
25#[derive(serde::Serialize, serde::Deserialize)]
26pub struct UnresolvedGasPayment {
27 pub objects: Vec<UnresolvedObjectReference>,
28 pub owner: Address,
29 #[serde(with = "OptionReadableDisplay")]
30 pub price: Option<u64>,
31 #[serde(with = "OptionReadableDisplay")]
32 pub budget: Option<u64>,
33}
34
35#[derive(serde::Serialize, serde::Deserialize)]
36pub struct UnresolvedObjectReference {
37 pub object_id: ObjectId,
38 #[serde(with = "OptionReadableDisplay")]
39 pub version: Option<Version>,
40 pub digest: Option<Digest>,
41}
42
43#[derive(serde::Serialize, serde::Deserialize)]
44pub enum UnresolvedInputArgument {
45 Pure {
47 #[serde(with = "::serde_with::As::<::serde_with::Bytes>")]
48 value: Vec<u8>,
49 },
50 ImmutableOrOwned(UnresolvedObjectReference),
52 Shared {
56 object_id: ObjectId,
57 #[serde(with = "OptionReadableDisplay")]
58 initial_shared_version: Option<u64>,
59 mutable: Option<bool>,
60 },
61 Receiving(UnresolvedObjectReference),
63}