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

Class Asset

core/station/impl/src/models/asset.rs:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#[storable]
17#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
18pub struct Asset {
19 pub id: AssetId,
20 /// The blockchain identifier (e.g., `ethereum`, `bitcoin`, `icp`, etc.)
21 pub blockchain: Blockchain,
22 // The asset standard that is supported (e.g. `erc20`, `icp_native`, etc.), canonically
23 // represented as a lowercase string with spaces replaced with underscores.
24 pub standards: BTreeSet<TokenStandard>,
25 /// The asset symbol (e.g. `ICP`, `BTC`, `ETH`, etc.)
26 pub symbol: String,
27 /// The asset name (e.g. `Internet Computer`, `Bitcoin`, `Ethereum`, etc.)
28 pub name: String,
29 /// The number of decimal places that the asset supports (e.g. `8` for `BTC`, `18` for `ETH`, etc.)
30 pub decimals: u32,
31 /// The asset metadata (e.g. `{"logo": "https://example.com/logo.png"}`).
32 pub metadata: Metadata,
33}
34
35impl Asset {
36 pub const DECIMALS_RANGE: (u32, u32) = (0, 18);

Callers 6

to_expanded_listMethod · 0.70
to_resourcesMethod · 0.50
fromMethod · 0.50
fromMethod · 0.50
listMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected