Skip to main content

Module iota::ptb_call_arg

use iota::address; use iota::hex; use iota::object; use iota::tx_context; use std::ascii; use std::bcs; use std::option; use std::string; use std::vector;

Struct ObjectRef

public struct ObjectRef has copy, drop

Fields

Enum CallArg

public enum CallArg has copy, drop

Variants

Variant PureData

0: vector<u8>

Variant ObjectData

0: iota::ptb_call_arg::ObjectArg

Enum ObjectArg

public enum ObjectArg has copy, drop

Variants

Variant ImmOrOwnedObject

0: iota::ptb_call_arg::ObjectRef

Variant SharedObject

id: iota::object::ID
initial_shared_version: u64
mutable: bool

Variant ReceivingObject

0: iota::ptb_call_arg::ObjectRef

Function is_pure_data

public fun is_pure_data(arg: &iota::ptb_call_arg::CallArg): bool

Implementation

public fun is_pure_data(arg: &CallArg): bool { match (arg) { CallArg::PureData(_) => true, _ => false, } }

Function is_object_data

public fun is_object_data(arg: &iota::ptb_call_arg::CallArg): bool

Implementation

public fun is_object_data(arg: &CallArg): bool { match (arg) { CallArg::ObjectData(_) => true, _ => false, } }

Function as_pure_data

public fun as_pure_data(arg: &iota::ptb_call_arg::CallArg): std::option::Option<vector<u8>>

Implementation

public fun as_pure_data(arg: &CallArg): Option<vector<u8>> { match (arg) { CallArg::PureData(data) => some(*data), _ => none(), } }

Function as_object_data

public fun as_object_data(arg: &iota::ptb_call_arg::CallArg): std::option::Option<iota::ptb_call_arg::ObjectArg>

Implementation

public fun as_object_data(arg: &CallArg): Option<ObjectArg> { match (arg) { CallArg::ObjectData(obj) => some(*obj), _ => none(), } }

Function is_shared_object

public fun is_shared_object(obj_arg: &iota::ptb_call_arg::ObjectArg): bool

Implementation

public fun is_shared_object(obj_arg: &ObjectArg): bool { match (obj_arg) { ObjectArg::SharedObject { id: _, initial_shared_version: _, mutable: _ } => true, _ => false, } }

Function is_imm_or_owned_object

public fun is_imm_or_owned_object(obj_arg: &iota::ptb_call_arg::ObjectArg): bool

Implementation

public fun is_imm_or_owned_object(obj_arg: &ObjectArg): bool { match (obj_arg) { ObjectArg::ImmOrOwnedObject(_) => true, _ => false, } }

Function is_receiving_object

public fun is_receiving_object(obj_arg: &iota::ptb_call_arg::ObjectArg): bool

Implementation

public fun is_receiving_object(obj_arg: &ObjectArg): bool { match (obj_arg) { ObjectArg::ReceivingObject(_) => true, _ => false, } }

Function object_id

public fun object_id(obj_arg: &iota::ptb_call_arg::ObjectArg): std::option::Option<iota::object::ID>

Implementation

public fun object_id(obj_arg: &ObjectArg): Option<ID> { match (obj_arg) { ObjectArg::ImmOrOwnedObject(obj_ref) => some(obj_ref.object_id), ObjectArg::ReceivingObject(obj_ref) => some(obj_ref.object_id), ObjectArg::SharedObject { id, initial_shared_version: _, mutable: _ } => some(*id), _ => none(), } }

Function object_version

public fun object_version(obj_arg: &iota::ptb_call_arg::ObjectArg): std::option::Option<u64>

Implementation

public fun object_version(obj_arg: &ObjectArg): Option<u64> { match (obj_arg) { ObjectArg::ImmOrOwnedObject(obj_ref) => some(obj_ref.sequence_number), ObjectArg::ReceivingObject(obj_ref) => some(obj_ref.sequence_number), ObjectArg::SharedObject { id: _, initial_shared_version, mutable: _ } => some( *initial_shared_version, ), _ => none(), } }

Function object_digest

public fun object_digest(obj_arg: &iota::ptb_call_arg::ObjectArg): std::option::Option<vector<u8>>

Implementation

public fun object_digest(obj_arg: &ObjectArg): Option<vector<u8>> { match (obj_arg) { ObjectArg::ImmOrOwnedObject(obj_ref) => some(obj_ref.object_digest), ObjectArg::ReceivingObject(obj_ref) => some(obj_ref.object_digest), _ => none(), } }

Function object_ref

public fun object_ref(obj_arg: &iota::ptb_call_arg::ObjectArg): std::option::Option<iota::ptb_call_arg::ObjectRef>

Implementation

public fun object_ref(obj_arg: &ObjectArg): Option<ObjectRef> { match (obj_arg) { ObjectArg::ImmOrOwnedObject(obj_ref) => some(*obj_ref), ObjectArg::ReceivingObject(obj_ref) => some(*obj_ref), _ => none(), } }

Function is_mutable_shared_object

public fun is_mutable_shared_object(obj_arg: &iota::ptb_call_arg::ObjectArg): std::option::Option<bool>

Implementation

public fun is_mutable_shared_object(obj_arg: &ObjectArg): Option<bool> { match (obj_arg) { ObjectArg::SharedObject { id: _, initial_shared_version: _, mutable } => some(*mutable), _ => none(), } }

Function id

public fun id(obj_ref: &iota::ptb_call_arg::ObjectRef): &iota::object::ID

Implementation

public fun id(obj_ref: &ObjectRef): &ID { &obj_ref.object_id }

Function sequence_number

public fun sequence_number(obj_ref: &iota::ptb_call_arg::ObjectRef): u64

Implementation

public fun sequence_number(obj_ref: &ObjectRef): u64 { obj_ref.sequence_number }

Function digest

public fun digest(obj_ref: &iota::ptb_call_arg::ObjectRef): &vector<u8>

Implementation

public fun digest(obj_ref: &ObjectRef): &vector<u8> { &obj_ref.object_digest }