Struct sapio::contract::object::Object [−][src]
Object holds a contract’s complete context required post-compilation There is no guarantee that Object is properly constructed presently.
Fields
ctv_to_tx: HashMap<Hash, Template>
a map of template hashes to the corresponding template, that in the policy are a CTV protected
suggested_txs: HashMap<Hash, Template>
a map of template hashes to the corresponding template, that in the policy are not necessarily CTV protected but we might want to know about anyways.
policy: Option<Clause>
The Object’s Policy – if known
address: Address
The Object’s address
descriptor: Option<Descriptor<PublicKey>>
The Object’s descriptor – if there is one known/available
amount_range: AmountRange
The amount_range safe to send this object
Implementations
impl Object
[src]
pub fn from_address(address: Address, a: Option<AmountRange>) -> Object
[src]
Creates an object from a given address. The optional AmountRange argument determines the safe bounds the contract can receive, otherwise it is set to any.
pub fn from_script(
script: Script,
a: Option<AmountRange>,
net: Network
) -> Result<Object, ObjectError>
[src]
script: Script,
a: Option<AmountRange>,
net: Network
) -> Result<Object, ObjectError>
Creates an object from a given script. The optional AmountRange argument determines the safe bounds the contract can receive, otherwise it is set to any.
pub fn bind(&self, out_in: OutPoint) -> (Vec<Transaction>, Vec<Value>)
[src]
bind attaches an Object to a specific UTXO and returns a vec of transactions and transaction metadata.
pub fn bind_psbt(
&self,
out_in: OutPoint,
output_map: HashMap<Sha256, Vec<Option<OutPoint>>>,
blockdata: Rc<dyn TxIndex>,
emulator: &dyn CTVEmulator
) -> Result<(Vec<PartiallySignedTransaction>, Vec<Value>), ObjectError>
[src]
&self,
out_in: OutPoint,
output_map: HashMap<Sha256, Vec<Option<OutPoint>>>,
blockdata: Rc<dyn TxIndex>,
emulator: &dyn CTVEmulator
) -> Result<(Vec<PartiallySignedTransaction>, Vec<Value>), ObjectError>
bind_psbt attaches and Object
to a specific UTXO, returning a
Vector of PSBTs and transaction metadata.
bind_psbt
accepts a CTVEmulator, a txindex, and a map of outputs to be
bound to specific template hashes.
Trait Implementations
impl Clone for Object
[src]
impl Compilable for Compiled
[src]
Implements a basic identity
impl Debug for Object
[src]
impl<'de> Deserialize<'de> for Object
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl JsonSchema for Object
[src]
fn schema_name() -> String
[src]
fn json_schema(gen: &mut SchemaGenerator) -> Schema
[src]
pub fn is_referenceable() -> bool
[src]
impl Serialize for Object
[src]
Auto Trait Implementations
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,