pub struct ContractSourceMetadata {
pub version: Option<String>,
pub link: Option<String>,
pub standards: Vec<Standard>,
pub build_info: Option<BuildInfo>,
}Expand description
The struct provides information about deployed contract’s source code and supported standards.
Contract source metadata follows NEP-330 standard for smart contracts
See the documentation of Contract::contract_source_metadata on how to query this for a contract via this crate
Fields§
§version: Option<String>Optional version identifier, typically a semantic version
§Examples:
// Semantic version
Some("1.0.0".into())// Git commit
Some("39f2d2646f2f60e18ab53337501370dc02a5661c".into())link: Option<String>Optional URL to source code repository/tree
§Examples:
// GitHub URL
Some("https://github.com/org/repo/tree/8d8a8a0fe86a1d8eb3bce45f04ab1a65fecf5a1b".into())// GitHub URL
Some("https://github.com/near-examples/nft-tutorial".into())// IPFS CID
Some("bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwq".into())standards: Vec<Standard>List of supported NEAR standards (NEPs) with their versions
This field is an addition of 1.1.0 NEP-330 revision
§Examples:
This field will always include NEP-330 itself:
// this is always at least 1.1.0
vec![Standard { standard: "nep330".into(), version: "1.1.0".into() }]vec![Standard { standard: "nep330".into(), version: "1.2.0".into() }]build_info: Option<BuildInfo>Optional details that are required for formal contract WASM build reproducibility verification
This field is an addition of 1.2.0 NEP-330 revision
Trait Implementations§
Source§impl Clone for ContractSourceMetadata
impl Clone for ContractSourceMetadata
Source§fn clone(&self) -> ContractSourceMetadata
fn clone(&self) -> ContractSourceMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContractSourceMetadata
impl Debug for ContractSourceMetadata
Source§impl Default for ContractSourceMetadata
impl Default for ContractSourceMetadata
Source§fn default() -> ContractSourceMetadata
fn default() -> ContractSourceMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ContractSourceMetadata
impl<'de> Deserialize<'de> for ContractSourceMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContractSourceMetadata
impl PartialEq for ContractSourceMetadata
Source§impl Serialize for ContractSourceMetadata
impl Serialize for ContractSourceMetadata
impl Eq for ContractSourceMetadata
impl StructuralPartialEq for ContractSourceMetadata
Auto Trait Implementations§
impl Freeze for ContractSourceMetadata
impl RefUnwindSafe for ContractSourceMetadata
impl Send for ContractSourceMetadata
impl Sync for ContractSourceMetadata
impl Unpin for ContractSourceMetadata
impl UnwindSafe for ContractSourceMetadata
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