instruction.rs 628 B

12345678910111213141516171819202122232425262728293031
  1. use steel::*;
  2. #[repr(u8)]
  3. #[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
  4. pub enum SteelInstruction {
  5. Init = 0,
  6. Create = 1,
  7. Mint = 2,
  8. }
  9. #[repr(C)]
  10. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  11. pub struct Init {}
  12. #[repr(C)]
  13. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  14. pub struct Create {
  15. pub token_name: [u8; 32],
  16. pub token_symbol: [u8; 8],
  17. pub token_uri: [u8; 64],
  18. }
  19. #[repr(C)]
  20. #[derive(Clone, Copy, Debug, Pod, Zeroable)]
  21. pub struct Mint {
  22. pub amount: [u8; 8],
  23. }
  24. instruction!(SteelInstruction, Init);
  25. instruction!(SteelInstruction, Create);
  26. instruction!(SteelInstruction, Mint);