psrgbt

Trait RgbInExt

Source
pub trait RgbInExt {
    // Required methods
    fn rgb_consumer(
        &self,
        contract_id: ContractId,
    ) -> Result<Option<OpId>, FromSliceError>;
    fn set_rgb_consumer(
        &mut self,
        contract_id: ContractId,
        opid: OpId,
    ) -> Result<bool, KeyAlreadyPresent>;
}

Required Methods§

Source

fn rgb_consumer( &self, contract_id: ContractId, ) -> Result<Option<OpId>, FromSliceError>

Returns information which state transition consumes this PSBT input.

We do not error on invalid data in order to support future update of this proprietary key to a standard one. In this case, the invalid data will be filtered at the moment of PSBT deserialization and this function will return None only in situations when the key is absent.

Source

fn set_rgb_consumer( &mut self, contract_id: ContractId, opid: OpId, ) -> Result<bool, KeyAlreadyPresent>

Adds information about state transition consuming this PSBT input.

§Returns

Ok(false), if the same node id under the same contract was already present in the input. Ok(true), if the id node was successfully added to the input.

§Errors

If the input already contains [PSBT_IN_RGB_NODE_ID] key with the given contract_id but referencing different OpId.

Implementors§