Module 0xa6::swap_type
use 0x2::bcs;
Enum SwapType
public enum SwapType has copy, drop, store
Variants
-
Variant
DeepbookV3
-
-
Variant
SuiTransfer
-
-
Variant
ItsTransfer
-
Constants
#[error]
const EInvalidSwapType: vector<u8> = b"invalid swap type.";
Function deepbook_v3
public(friend) fun deepbook_v3(): swap_type::SwapType
Implementation
public(package) fun deepbook_v3(): SwapType {
SwapType::DeepbookV3
}
Function sui_transfer
public(friend) fun sui_transfer(): swap_type::SwapType
Implementation
public(package) fun sui_transfer(): SwapType {
SwapType::SuiTransfer
}
Function its_transfer
public(friend) fun its_transfer(): swap_type::SwapType
Implementation
public(package) fun its_transfer(): SwapType {
SwapType::ItsTransfer
}
Function peel
public(friend) fun peel(bcs: &mut bcs::BCS): swap_type::SwapType
Implementation
public(package) fun peel(bcs: &mut BCS): SwapType {
let swap_type = bcs.peel_u8();
if (swap_type == 0) {
SwapType::DeepbookV3
} else if (swap_type == 1) {
SwapType::SuiTransfer
} else if (swap_type == 2) {
SwapType::ItsTransfer
} else {
abort (EInvalidSwapType)
}
}