Skip to main content

iota_types/stardust/
coin_type.rs

1// Copyright (c) 2024 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4use std::fmt::Display;
5
6use iota_sdk_types::{StructTag, TypeTag};
7
8/// The type tag for the outputs used in the migration.
9#[derive(Copy, Clone, Debug, PartialEq, Eq)]
10pub enum CoinType {
11    Iota,
12}
13
14impl CoinType {
15    pub fn to_type_tag(&self) -> TypeTag {
16        match self {
17            Self::Iota => TypeTag::from(StructTag::new_gas()),
18        }
19    }
20}
21
22impl Display for CoinType {
23    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
24        match self {
25            Self::Iota => write!(f, "iota"),
26        }
27    }
28}