Skip to content
12 changes: 12 additions & 0 deletions crates/iota-sdk-ffi/src/types/type_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

use std::sync::Arc;

use iota_types::StructTag;

/// Type of a move value
///
/// # BCS
Expand Down Expand Up @@ -166,4 +168,14 @@ impl TypeTag {
pub fn signer() -> Self {
Self(iota_types::TypeTag::Signer)
}

#[uniffi::constructor]
pub fn vector(type_tag: &TypeTag) -> Self {
Self(iota_types::TypeTag::Vector(Box::new(type_tag.0.clone())))
}

#[uniffi::constructor]
pub fn struct_tag(struct_tag: &super::struct_tag::StructTag) -> Self {
Self(iota_types::TypeTag::Struct(Box::new(struct_tag.0.clone())))
}
}