crate_token/events.rs
1//! Crate events
2#![deny(missing_docs)]
3
4use anchor_lang::prelude::*;
5
6/// Emitted when a crate is created.
7#[event]
8pub struct NewCrateEvent {
9 /// Key of the created crate.
10 #[index]
11 pub crate_key: Pubkey,
12 /// Issue authority.
13 #[index]
14 pub issue_authority: Pubkey,
15 /// Withdraw authority.
16 #[index]
17 pub withdraw_authority: Pubkey,
18}
19
20/// Emitted when crate tokens are issued.
21#[event]
22pub struct IssueEvent {
23 /// Key of the created crate.
24 #[index]
25 pub crate_key: Pubkey,
26 /// Destination token account.
27 pub destination: Pubkey,
28 /// Amount of tokens issued.
29 pub amount: u64,
30 /// Author fee.
31 pub author_fee: u64,
32 /// Protocol fee.
33 pub protocol_fee: u64,
34}
35
36/// Emitted when crate tokens are withdrawn.
37#[event]
38pub struct WithdrawEvent {
39 /// Key of the crate withdrawn from.
40 #[index]
41 pub crate_key: Pubkey,
42 /// Mint of the withdrawn token.
43 pub token: Pubkey,
44 /// Destination of tokens.
45 pub destination: Pubkey,
46 /// Amount of tokens withdrawn.
47 pub amount: u64,
48 /// Author fee.
49 pub author_fee: u64,
50 /// Protocol fee.
51 pub protocol_fee: u64,
52}