circles_types/wrapper.rs
1use alloy_primitives::U256;
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5/// CirclesType enum
6/// Represents the type of Circles ERC20 wrapper
7#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
8#[repr(u8)]
9pub enum CirclesType {
10 Demurrage = 0,
11 Inflation = 1,
12}
13
14/// Information about a wrapped token found in a transfer path
15/// Maps wrapper address to [amount used in path, wrapper type]
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct WrappedTokenInfo {
18 /// Amount of the wrapped token used in the path
19 pub amount: U256,
20 /// The type of wrapper (e.g., 'CrcV2_ERC20WrapperDeployed_Demurraged' or 'CrcV2_ERC20WrapperDeployed_Inflationary')
21 pub token_type: String,
22}
23
24/// Record of wrapped tokens found in a transfer path
25/// Maps wrapper address to wrapped token information
26pub type WrappedTokensRecord = HashMap<String, WrappedTokenInfo>;