1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
use crate::prelude::*;

pub struct OracleHeartbeat {
    pub oracle: Pubkey,
    pub oracle_authority: Pubkey,
    pub token_account: Pubkey,
    pub gc_oracle: Pubkey,
    pub oracle_queue: Pubkey,
    pub permission: Pubkey,
    pub data_buffer: Pubkey,
}
#[derive(Clone, AnchorSerialize, AnchorDeserialize)]
pub struct OracleHeartbeatParams {
    pub permission_bump: u8,
}
impl Discriminator for OracleHeartbeat {
    const DISCRIMINATOR: [u8; 8] = [10, 175, 217, 130, 111, 35, 117, 54];
}

impl<'info> OracleHeartbeat {
    #[allow(unused_variables)]
    fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta> {
        vec![
            AccountMeta {
                pubkey: self.oracle.key(),
                is_signer: false,
                is_writable: true,
            },
            AccountMeta {
                pubkey: self.oracle_authority.key(),
                is_signer: true,
                is_writable: false,
            },
            AccountMeta {
                pubkey: self.token_account.key(),
                is_signer: false,
                is_writable: false,
            },
            AccountMeta {
                pubkey: self.gc_oracle.key(),
                is_signer: false,
                is_writable: true,
            },
            AccountMeta {
                pubkey: self.oracle_queue.key(),
                is_signer: false,
                is_writable: true,
            },
            AccountMeta {
                pubkey: self.permission.key(),
                is_signer: false,
                is_writable: false,
            },
            AccountMeta {
                pubkey: self.data_buffer.key(),
                is_signer: false,
                is_writable: true,
            },
        ]
    }
}