axelar-cgp-sui

Module 0xa6::swap_type

use 0x2::bcs;

Enum SwapType

public enum SwapType has copy, drop, store
Variants
Variant DeepbookV3
Variant SuiTransfer
Variant ItsTransfer

Constants

const EInvalidSwapType: vector<u8> = [105, 110, 118, 97, 108, 105, 100, 32, 115, 119, 97, 112, 32, 116, 121, 112, 101, 46];

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)
    }
}