pub struct Stock<S = MemStash, H = MemState, P = MemIndex>{ /* private fields */ }Implementations§
Source§impl<S, H, I> Stock<S, H, I>
impl<S, H, I> Stock<S, H, I>
pub fn load<P>(
provider: P,
autosave: bool,
) -> Result<Stock<S, H, I>, PersistenceError>where
P: Clone + PersistenceProvider<S> + PersistenceProvider<H> + PersistenceProvider<I> + 'static,
pub fn make_persistent<P>(
&mut self,
provider: P,
autosave: bool,
) -> Result<bool, PersistenceError>where
P: Clone + PersistenceProvider<S> + PersistenceProvider<H> + PersistenceProvider<I> + 'static,
pub fn store(&mut self) -> Result<(), PersistenceError>
Source§impl<S, H, P> Stock<S, H, P>
impl<S, H, P> Stock<S, H, P>
pub fn with( stash_provider: S, state_provider: H, index_provider: P, ) -> Stock<S, H, P>
pub fn schemata( &self, ) -> Result<impl Iterator<Item = SchemaInfo>, StockError<S, H, P>>
pub fn schema( &self, schema_id: SchemaId, ) -> Result<&Schema, StockError<S, H, P>>
pub fn contracts( &self, ) -> Result<impl Iterator<Item = ContractInfo>, StockError<S, H, P>>
Sourcepub fn contracts_assigning(
&self,
outputs: impl IntoIterator<Item = impl Into<OutPoint>>,
) -> Result<impl Iterator<Item = ContractId>, StockError<S, H, P>>
pub fn contracts_assigning( &self, outputs: impl IntoIterator<Item = impl Into<OutPoint>>, ) -> Result<impl Iterator<Item = ContractId>, StockError<S, H, P>>
Iterates over ids of all contract assigning state to the provided set of output seals.
pub fn contract_info( &self, contract_id: ContractId, ) -> Result<ContractInfo, StockError<S, H, P>>
pub fn contract_state( &self, contract_id: ContractId, ) -> Result<<H as StateReadProvider>::ContractRead<'_>, StockError<S, H, P>>
pub fn contract_wrapper<C>(
&self,
contract_id: ContractId,
) -> Result<<C as IssuerWrapper>::Wrapper<<H as StateReadProvider>::ContractRead<'_>>, StockError<S, H, P>>where
C: IssuerWrapper,
Sourcepub fn contract_data(
&self,
contract_id: ContractId,
) -> Result<ContractData<<H as StateReadProvider>::ContractRead<'_>>, StockError<S, H, P>>
pub fn contract_data( &self, contract_id: ContractId, ) -> Result<ContractData<<H as StateReadProvider>::ContractRead<'_>>, StockError<S, H, P>>
Returns the contract data for the given contract ID
pub fn contract_assignments_for( &self, contract_id: ContractId, outpoints: impl IntoIterator<Item = impl Into<OutPoint>>, ) -> Result<HashMap<ExplicitSeal<Txid>, HashMap<Opout, AllocatedState>>, StockError<S, H, P>>
pub fn contract_builder( &self, issuer: impl Into<Identity>, schema_id: SchemaId, chain_net: ChainNet, ) -> Result<ContractBuilder, StockError<S, H, P>>
pub fn transition_builder( &self, contract_id: ContractId, transition_name: impl Into<FieldName>, ) -> Result<TransitionBuilder, StockError<S, H, P>>
pub fn transition_builder_raw( &self, contract_id: ContractId, transition_type: TransitionType, ) -> Result<TransitionBuilder, StockError<S, H, P>>
pub fn export_schema( &self, schema_id: SchemaId, ) -> Result<ValidKit, StockError<S, H, P>>
pub fn export_contract( &self, contract_id: ContractId, ) -> Result<Consignment<false>, StockError<S, H, P, ConsignError>>
pub fn transfer( &self, contract_id: ContractId, outputs: impl AsRef<[ExplicitSeal<Txid>]>, secret_seals: impl AsRef<[SecretSeal]>, opids: impl IntoIterator<Item = OpId>, witness_id: Option<Txid>, ) -> Result<Consignment<true>, StockError<S, H, P, ConsignError>>
pub fn transfer_with_dag( &self, contract_id: ContractId, outputs: impl AsRef<[ExplicitSeal<Txid>]>, secret_seals: impl AsRef<[SecretSeal]>, opids: impl IntoIterator<Item = OpId>, witness_id: Option<Txid>, ) -> Result<(Consignment<true>, (Dag<Opout, ()>, HashMap<Opout, NodeIndex>)), StockError<S, H, P, ConsignError>>
pub fn import_kit( &mut self, kit: ValidKit, ) -> Result<Status, StockError<S, H, P>>
pub fn import_contract<R>(
&mut self,
contract: ValidConsignment<false>,
resolver: R,
) -> Result<Status, StockError<S, H, P>>where
R: ResolveWitness,
pub fn accept_transfer<R>(
&mut self,
contract: ValidConsignment<true>,
resolver: R,
) -> Result<Status, StockError<S, H, P>>where
R: ResolveWitness,
Sourcepub fn consume_fascia<WP>(
&mut self,
fascia: Fascia,
witness_ord_provider: WP,
) -> Result<(), StockError<S, H, P, FasciaError>>where
WP: WitnessOrdProvider,
pub fn consume_fascia<WP>(
&mut self,
fascia: Fascia,
witness_ord_provider: WP,
) -> Result<(), StockError<S, H, P, FasciaError>>where
WP: WitnessOrdProvider,
Imports fascia into the stash, index and inventory.
Part of the transfer workflow. Called once PSBT is completed and an RGB fascia containing anchor and all state transitions is exported from it.
Must be called before the consignment is created, when witness transaction is not yet mined.
pub fn store_secret_seal( &mut self, seal: BlindSeal<TxPtr>, ) -> Result<bool, StockError<S, H, P>>
pub fn update_witnesses( &mut self, resolver: impl ResolveWitness, after_height: u32, force_witnesses: Vec<Txid>, ) -> Result<UpdateRes, StockError<S, H, P>>
pub fn upsert_witness( &mut self, witness_id: Txid, witness_ord: WitnessOrd, ) -> Result<(), StockError<S, H, P>>
pub fn get_outpoint_unsafe_history( &self, outpoint: OutPoint, safe_height: NonZero<u32>, ) -> Result<HashMap<ContractId, HashMap<u32, HashSet<Txid>>>, StockError<S, H, P>>
Trait Implementations§
Source§impl<S, H, P> CloneNoPersistence for Stock<S, H, P>
impl<S, H, P> CloneNoPersistence for Stock<S, H, P>
fn clone_no_persistence(&self) -> Stock<S, H, P>
Auto Trait Implementations§
impl<S, H, P> Freeze for Stock<S, H, P>
impl<S, H, P> RefUnwindSafe for Stock<S, H, P>
impl<S, H, P> Send for Stock<S, H, P>
impl<S, H, P> Sync for Stock<S, H, P>
impl<S, H, P> Unpin for Stock<S, H, P>
impl<S, H, P> UnwindSafe for Stock<S, H, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more