From d1d134df6d97d13a63c27c8c0aeb994be2c96822 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Wed, 11 Sep 2024 12:41:38 +0200 Subject: [PATCH] iface: add contract state accessing methods to IfaceWrapper --- src/interface/iface.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/interface/iface.rs b/src/interface/iface.rs index c6cbfaaf..26fa99f9 100644 --- a/src/interface/iface.rs +++ b/src/interface/iface.rs @@ -30,7 +30,8 @@ use amplify::{ByteArray, Bytes32}; use baid64::{Baid64ParseError, DisplayBaid64, FromBaid64Str}; use chrono::{DateTime, TimeZone, Utc}; use commit_verify::{CommitId, CommitmentId, DigestExt, Sha256}; -use rgb::{Identity, Occurrences}; +use rgb::vm::WitnessOrd; +use rgb::{ContractId, Identity, Occurrences, SchemaId, XWitnessId}; use strict_encoding::{ FieldName, StrictDecode, StrictDeserialize, StrictDumb, StrictEncode, StrictSerialize, StrictType, TypeName, VariantName, @@ -355,6 +356,15 @@ pub trait IfaceWrapper { /// Constructs information object describing a specific class in terms of /// the interface class. fn info(&self) -> Self::Info; + + /// Returns contract id. + fn contract_id(&self) -> ContractId; + + /// Returns schema id of the contract. + fn schema_id(&self) -> SchemaId; + + /// Returns information about a witness, if it is known to the contract state. + fn witness_info(&self, witness_id: XWitnessId) -> Option; } /// Interface definition.