oil_chat_api/
instruction.rs1use steel::*;
2
3#[repr(u8)]
4#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
5pub enum ChatInstruction {
6 SendMessage = 0,
7 ReplyToMessage = 1,
8 AddReaction = 2,
9 RemoveReaction = 3,
10}
11
12#[repr(C)]
13#[derive(Clone, Copy, Debug, Pod, Zeroable)]
14pub struct SendMessage {
15 pub message_hash: [u8; 32], }
17
18#[repr(C)]
19#[derive(Clone, Copy, Debug, Pod, Zeroable)]
20pub struct ReplyToMessage {
21 pub parent_message_pda: [u8; 32], pub message_hash: [u8; 32], }
24
25#[repr(C)]
26#[derive(Clone, Copy, Debug, Pod, Zeroable)]
27pub struct AddReaction {
28 pub message_pda: [u8; 32], pub emoji: [u8; 4], }
31
32#[repr(C)]
33#[derive(Clone, Copy, Debug, Pod, Zeroable)]
34pub struct RemoveReaction {
35 pub message_pda: [u8; 32], pub emoji: [u8; 4], }
38
39instruction!(ChatInstruction, SendMessage);
40instruction!(ChatInstruction, ReplyToMessage);
41instruction!(ChatInstruction, AddReaction);
42instruction!(ChatInstruction, RemoveReaction);