carbon_tcomp_decoder/instructions/
mod.rs

1use super::TcompDecoder;
2pub mod bid;
3pub mod buy;
4pub mod buy_core;
5pub mod buy_spl;
6pub mod cancel_bid;
7pub mod close_expired_bid;
8pub mod close_expired_listing;
9pub mod close_expired_listing_core;
10pub mod delist;
11pub mod delist_core;
12pub mod edit;
13pub mod list;
14pub mod list_core;
15pub mod take_bid_core;
16pub mod take_bid_full_meta;
17pub mod take_bid_legacy;
18pub mod take_bid_meta_hash;
19pub mod take_bid_t22;
20pub mod take_bid_wns;
21pub mod tcomp_noop;
22pub mod withdraw_fees;
23
24#[derive(
25    carbon_core::InstructionType,
26    serde::Serialize,
27    serde::Deserialize,
28    PartialEq,
29    Eq,
30    Debug,
31    Clone,
32    Hash,
33)]
34pub enum TcompInstruction {
35    TcompNoop(tcomp_noop::TcompNoop),
36    WithdrawFees(withdraw_fees::WithdrawFees),
37    Buy(buy::Buy),
38    BuySpl(buy_spl::BuySpl),
39    BuyCore(buy_core::BuyCore),
40    List(list::List),
41    Delist(delist::Delist),
42    Edit(edit::Edit),
43    ListCore(list_core::ListCore),
44    DelistCore(delist_core::DelistCore),
45    Bid(bid::Bid),
46    CancelBid(cancel_bid::CancelBid),
47    CloseExpiredBid(close_expired_bid::CloseExpiredBid),
48    CloseExpiredListing(close_expired_listing::CloseExpiredListing),
49    CloseExpiredListingCore(close_expired_listing_core::CloseExpiredListingCore),
50    TakeBidMetaHash(take_bid_meta_hash::TakeBidMetaHash),
51    TakeBidFullMeta(take_bid_full_meta::TakeBidFullMeta),
52    TakeBidLegacy(take_bid_legacy::TakeBidLegacy),
53    TakeBidT22(take_bid_t22::TakeBidT22),
54    TakeBidWns(take_bid_wns::TakeBidWns),
55    TakeBidCore(take_bid_core::TakeBidCore),
56}
57
58impl<'a> carbon_core::instruction::InstructionDecoder<'a> for TcompDecoder {
59    type InstructionType = TcompInstruction;
60
61    fn decode_instruction(
62        &self,
63        instruction: &solana_instruction::Instruction,
64    ) -> Option<carbon_core::instruction::DecodedInstruction<Self::InstructionType>> {
65        carbon_core::try_decode_instructions!(instruction,
66            TcompInstruction::TcompNoop => tcomp_noop::TcompNoop,
67            TcompInstruction::WithdrawFees => withdraw_fees::WithdrawFees,
68            TcompInstruction::Buy => buy::Buy,
69            TcompInstruction::BuySpl => buy_spl::BuySpl,
70            TcompInstruction::BuyCore => buy_core::BuyCore,
71            TcompInstruction::List => list::List,
72            TcompInstruction::Delist => delist::Delist,
73            TcompInstruction::Edit => edit::Edit,
74            TcompInstruction::ListCore => list_core::ListCore,
75            TcompInstruction::DelistCore => delist_core::DelistCore,
76            TcompInstruction::Bid => bid::Bid,
77            TcompInstruction::CancelBid => cancel_bid::CancelBid,
78            TcompInstruction::CloseExpiredBid => close_expired_bid::CloseExpiredBid,
79            TcompInstruction::CloseExpiredListing => close_expired_listing::CloseExpiredListing,
80            TcompInstruction::CloseExpiredListingCore => close_expired_listing_core::CloseExpiredListingCore,
81            TcompInstruction::TakeBidMetaHash => take_bid_meta_hash::TakeBidMetaHash,
82            TcompInstruction::TakeBidFullMeta => take_bid_full_meta::TakeBidFullMeta,
83            TcompInstruction::TakeBidLegacy => take_bid_legacy::TakeBidLegacy,
84            TcompInstruction::TakeBidT22 => take_bid_t22::TakeBidT22,
85            TcompInstruction::TakeBidWns => take_bid_wns::TakeBidWns,
86            TcompInstruction::TakeBidCore => take_bid_core::TakeBidCore,
87        )
88    }
89}