MCPcopy Create free account
hub / github.com/dfinity/orbit / capabilities

Method capabilities

core/station/impl/src/controllers/capabilities.rs:35–74  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

33
34 #[with_middleware(guard = authorize(&call_context(), &[Resource::System(SystemResourceAction::Capabilities)]))]
35 async fn capabilities(&self) -> ApiResult<CapabilitiesResponse> {
36 let system = read_system_info();
37
38 Ok(CapabilitiesResponse {
39 capabilities: CapabilitiesDTO {
40 name: system.get_name().to_string(),
41 version: SYSTEM_VERSION.to_string(),
42 supported_assets: ASSET_REPOSITORY
43 .list()
44 .into_iter()
45 .map(|asset| asset.into())
46 .collect(),
47 supported_blockchains: SUPPORTED_BLOCKCHAINS
48 .iter()
49 .map(|suported_blockchain| SupportedBlockchainDTO {
50 blockchain: suported_blockchain.blockchain.to_string(),
51 supported_standards: suported_blockchain
52 .supported_standards
53 .iter()
54 .map(|standard| StandardDataDTO {
55 required_metadata_fields: standard.get_required_metadata(),
56 standard: standard.to_string(),
57 supported_operations: standard
58 .get_supported_operations()
59 .iter()
60 .map(|operation| operation.to_string())
61 .collect(),
62 supported_address_formats: standard
63 .get_info()
64 .address_formats
65 .iter()
66 .map(|format| format.to_string())
67 .collect(),
68 })
69 .collect(),
70 })
71 .collect(),
72 },
73 })
74 }
75}

Callers 1

capabilitiesFunction · 0.45

Calls 8

read_system_infoFunction · 0.85
get_nameMethod · 0.80
mapMethod · 0.80
iterMethod · 0.80
get_required_metadataMethod · 0.80
get_infoMethod · 0.80
listMethod · 0.45

Tested by

no test coverage detected