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 Initialize = 4,
11}
12
13#[repr(C)]
14#[derive(Clone, Copy, Debug, Pod, Zeroable)]
15pub struct Initialize {
16 }
18
19#[repr(C)]
20#[derive(Clone, Copy, Debug, Pod, Zeroable)]
21pub struct SendMessage {
22 pub message_hash: [u8; 32], }
24
25#[repr(C)]
26#[derive(Clone, Copy, Debug, Pod, Zeroable)]
27pub struct ReplyToMessage {
28 pub parent_message_pda: [u8; 32], pub message_hash: [u8; 32], }
31
32#[repr(C)]
33#[derive(Clone, Copy, Debug, Pod, Zeroable)]
34pub struct AddReaction {
35 pub message_pda: [u8; 32], pub emoji: [u8; 4], }
38
39#[repr(C)]
40#[derive(Clone, Copy, Debug, Pod, Zeroable)]
41pub struct RemoveReaction {
42 pub message_pda: [u8; 32], pub emoji: [u8; 4], }
45
46instruction!(ChatInstruction, Initialize);
47instruction!(ChatInstruction, SendMessage);
48instruction!(ChatInstruction, ReplyToMessage);
49instruction!(ChatInstruction, AddReaction);
50instruction!(ChatInstruction, RemoveReaction);