carbon-heaven-decoder 2.0.0

Heaven program decoder
Documentation
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
//! This code was AUTOGENERATED using the Codama library.
use crate::{HeavenDecoder, PROGRAM_ID};

#[cfg(feature = "postgres")]
pub mod postgres;

#[cfg(feature = "graphql")]
pub mod graphql;

pub mod add_liquidity_pro_pool;
pub mod admin_borrow_sol;
pub mod admin_claim_msol;
pub mod admin_claim_pro_creator_trading_fees;
pub mod admin_claim_staking_rewards;
pub mod admin_claim_standard_creator_trading_fees;
pub mod admin_deposit_msol;
pub mod admin_mint_msol;
pub mod admin_repay_sol;
pub mod admin_set_transfer_fee;
pub mod admin_unstake_msol;
pub mod admin_update_pro_liquidity_pool_state;
pub mod admin_update_standard_liquidity_pool_state;
pub mod admin_withdraw_msol;
pub mod admin_withdraw_transfer_fee;
pub mod buy;
pub mod claim_pro_creator_trading_fee_protocol_fees;
pub mod claim_pro_creator_trading_fees;
pub mod claim_pro_liquidity_provider_trading_fees;
pub mod claim_pro_protocol_trading_fees;
pub mod claim_pro_reflection_trading_fees;
pub mod claim_standard_creator_trading_fee_protocol_fees;
pub mod claim_standard_creator_trading_fees;
pub mod claim_standard_protocol_trading_fees;
pub mod claim_standard_reflection_trading_fees;
pub mod close_protocol_lookup_table;
pub mod cpi_event;
pub mod create_or_update_protocol_fee_admin;
pub mod create_or_update_protocol_owner;
pub mod create_or_update_protocol_staking_admin;
pub mod create_pro_liquidity_pool;
pub mod create_protocol_config;
pub mod create_protocol_lookup_table;
pub mod create_standard_liquidity_pool;
pub mod creator_set_pro_market_cap_creator_fee;
pub mod creator_set_pro_market_cap_lp_fee;
pub mod creator_set_pro_market_cap_reflection_fee;
pub mod creator_set_pro_slot_creator_fee;
pub mod creator_toggle_pro_deposit;
pub mod creator_toggle_pro_swap;
pub mod creator_toggle_pro_withdraw;
pub mod deactivate_protocol_lookup_table;
pub mod extend_protocol_lookup_table;
pub mod initialize_protocol_lending;
pub mod pro_buy;
pub mod pro_sell;
pub mod remaining_accounts_stub;
pub mod remove_liquidity_pro_pool;
pub mod sell;
pub mod set_protocol_slot_fees;
pub mod transfer_lp_tokens;
pub mod update_allow_create_pool;
pub mod update_creator_trading_fee_receiver;
pub mod update_pro_creator_trading_fee_receiver;
pub mod update_protocol_config;

pub use self::{
    add_liquidity_pro_pool::*, admin_borrow_sol::*, admin_claim_msol::*,
    admin_claim_pro_creator_trading_fees::*, admin_claim_staking_rewards::*,
    admin_claim_standard_creator_trading_fees::*, admin_deposit_msol::*, admin_mint_msol::*,
    admin_repay_sol::*, admin_set_transfer_fee::*, admin_unstake_msol::*,
    admin_update_pro_liquidity_pool_state::*, admin_update_standard_liquidity_pool_state::*,
    admin_withdraw_msol::*, admin_withdraw_transfer_fee::*, buy::*,
    claim_pro_creator_trading_fee_protocol_fees::*, claim_pro_creator_trading_fees::*,
    claim_pro_liquidity_provider_trading_fees::*, claim_pro_protocol_trading_fees::*,
    claim_pro_reflection_trading_fees::*, claim_standard_creator_trading_fee_protocol_fees::*,
    claim_standard_creator_trading_fees::*, claim_standard_protocol_trading_fees::*,
    claim_standard_reflection_trading_fees::*, close_protocol_lookup_table::*, cpi_event::*,
    create_or_update_protocol_fee_admin::*, create_or_update_protocol_owner::*,
    create_or_update_protocol_staking_admin::*, create_pro_liquidity_pool::*,
    create_protocol_config::*, create_protocol_lookup_table::*, create_standard_liquidity_pool::*,
    creator_set_pro_market_cap_creator_fee::*, creator_set_pro_market_cap_lp_fee::*,
    creator_set_pro_market_cap_reflection_fee::*, creator_set_pro_slot_creator_fee::*,
    creator_toggle_pro_deposit::*, creator_toggle_pro_swap::*, creator_toggle_pro_withdraw::*,
    deactivate_protocol_lookup_table::*, extend_protocol_lookup_table::*,
    initialize_protocol_lending::*, pro_buy::*, pro_sell::*, remaining_accounts_stub::*,
    remove_liquidity_pro_pool::*, sell::*, set_protocol_slot_fees::*, transfer_lp_tokens::*,
    update_allow_create_pool::*, update_creator_trading_fee_receiver::*,
    update_pro_creator_trading_fee_receiver::*, update_protocol_config::*,
};

#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
pub enum HeavenInstruction {
    AddLiquidityProPool {
        program_id: solana_pubkey::Pubkey,
        data: AddLiquidityProPool,
        accounts: AddLiquidityProPoolInstructionAccounts,
    },
    AdminBorrowSol {
        program_id: solana_pubkey::Pubkey,
        data: AdminBorrowSol,
        accounts: AdminBorrowSolInstructionAccounts,
    },
    AdminClaimMsol {
        program_id: solana_pubkey::Pubkey,
        data: AdminClaimMsol,
        accounts: AdminClaimMsolInstructionAccounts,
    },
    AdminClaimProCreatorTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: AdminClaimProCreatorTradingFees,
        accounts: AdminClaimProCreatorTradingFeesInstructionAccounts,
    },
    AdminClaimStakingRewards {
        program_id: solana_pubkey::Pubkey,
        data: AdminClaimStakingRewards,
        accounts: AdminClaimStakingRewardsInstructionAccounts,
    },
    AdminClaimStandardCreatorTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: AdminClaimStandardCreatorTradingFees,
        accounts: AdminClaimStandardCreatorTradingFeesInstructionAccounts,
    },
    AdminDepositMsol {
        program_id: solana_pubkey::Pubkey,
        data: AdminDepositMsol,
        accounts: AdminDepositMsolInstructionAccounts,
    },
    AdminMintMsol {
        program_id: solana_pubkey::Pubkey,
        data: AdminMintMsol,
        accounts: AdminMintMsolInstructionAccounts,
    },
    AdminRepaySol {
        program_id: solana_pubkey::Pubkey,
        data: AdminRepaySol,
        accounts: AdminRepaySolInstructionAccounts,
    },
    AdminSetTransferFee {
        program_id: solana_pubkey::Pubkey,
        data: AdminSetTransferFee,
        accounts: AdminSetTransferFeeInstructionAccounts,
    },
    AdminUnstakeMsol {
        program_id: solana_pubkey::Pubkey,
        data: AdminUnstakeMsol,
        accounts: AdminUnstakeMsolInstructionAccounts,
    },
    AdminUpdateProLiquidityPoolState {
        program_id: solana_pubkey::Pubkey,
        data: AdminUpdateProLiquidityPoolState,
        accounts: AdminUpdateProLiquidityPoolStateInstructionAccounts,
    },
    AdminUpdateStandardLiquidityPoolState {
        program_id: solana_pubkey::Pubkey,
        data: AdminUpdateStandardLiquidityPoolState,
        accounts: AdminUpdateStandardLiquidityPoolStateInstructionAccounts,
    },
    AdminWithdrawMsol {
        program_id: solana_pubkey::Pubkey,
        data: AdminWithdrawMsol,
        accounts: AdminWithdrawMsolInstructionAccounts,
    },
    AdminWithdrawTransferFee {
        program_id: solana_pubkey::Pubkey,
        data: AdminWithdrawTransferFee,
        accounts: AdminWithdrawTransferFeeInstructionAccounts,
    },
    Buy {
        program_id: solana_pubkey::Pubkey,
        data: Buy,
        accounts: BuyInstructionAccounts,
    },
    ClaimProCreatorTradingFeeProtocolFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimProCreatorTradingFeeProtocolFees,
        accounts: ClaimProCreatorTradingFeeProtocolFeesInstructionAccounts,
    },
    ClaimProCreatorTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimProCreatorTradingFees,
        accounts: ClaimProCreatorTradingFeesInstructionAccounts,
    },
    ClaimProLiquidityProviderTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimProLiquidityProviderTradingFees,
        accounts: ClaimProLiquidityProviderTradingFeesInstructionAccounts,
    },
    ClaimProProtocolTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimProProtocolTradingFees,
        accounts: ClaimProProtocolTradingFeesInstructionAccounts,
    },
    ClaimProReflectionTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimProReflectionTradingFees,
        accounts: ClaimProReflectionTradingFeesInstructionAccounts,
    },
    ClaimStandardCreatorTradingFeeProtocolFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimStandardCreatorTradingFeeProtocolFees,
        accounts: ClaimStandardCreatorTradingFeeProtocolFeesInstructionAccounts,
    },
    ClaimStandardCreatorTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimStandardCreatorTradingFees,
        accounts: ClaimStandardCreatorTradingFeesInstructionAccounts,
    },
    ClaimStandardProtocolTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimStandardProtocolTradingFees,
        accounts: ClaimStandardProtocolTradingFeesInstructionAccounts,
    },
    ClaimStandardReflectionTradingFees {
        program_id: solana_pubkey::Pubkey,
        data: ClaimStandardReflectionTradingFees,
        accounts: ClaimStandardReflectionTradingFeesInstructionAccounts,
    },
    CloseProtocolLookupTable {
        program_id: solana_pubkey::Pubkey,
        data: CloseProtocolLookupTable,
        accounts: CloseProtocolLookupTableInstructionAccounts,
    },
    CreateOrUpdateProtocolFeeAdmin {
        program_id: solana_pubkey::Pubkey,
        data: CreateOrUpdateProtocolFeeAdmin,
        accounts: CreateOrUpdateProtocolFeeAdminInstructionAccounts,
    },
    CreateOrUpdateProtocolOwner {
        program_id: solana_pubkey::Pubkey,
        data: CreateOrUpdateProtocolOwner,
        accounts: CreateOrUpdateProtocolOwnerInstructionAccounts,
    },
    CreateOrUpdateProtocolStakingAdmin {
        program_id: solana_pubkey::Pubkey,
        data: CreateOrUpdateProtocolStakingAdmin,
        accounts: CreateOrUpdateProtocolStakingAdminInstructionAccounts,
    },
    CreateProLiquidityPool {
        program_id: solana_pubkey::Pubkey,
        data: CreateProLiquidityPool,
        accounts: CreateProLiquidityPoolInstructionAccounts,
    },
    CreateProtocolConfig {
        program_id: solana_pubkey::Pubkey,
        data: CreateProtocolConfig,
        accounts: CreateProtocolConfigInstructionAccounts,
    },
    CreateProtocolLookupTable {
        program_id: solana_pubkey::Pubkey,
        data: CreateProtocolLookupTable,
        accounts: CreateProtocolLookupTableInstructionAccounts,
    },
    CreateStandardLiquidityPool {
        program_id: solana_pubkey::Pubkey,
        data: CreateStandardLiquidityPool,
        accounts: CreateStandardLiquidityPoolInstructionAccounts,
    },
    CreatorSetProMarketCapCreatorFee {
        program_id: solana_pubkey::Pubkey,
        data: CreatorSetProMarketCapCreatorFee,
        accounts: CreatorSetProMarketCapCreatorFeeInstructionAccounts,
    },
    CreatorSetProMarketCapLpFee {
        program_id: solana_pubkey::Pubkey,
        data: CreatorSetProMarketCapLpFee,
        accounts: CreatorSetProMarketCapLpFeeInstructionAccounts,
    },
    CreatorSetProMarketCapReflectionFee {
        program_id: solana_pubkey::Pubkey,
        data: CreatorSetProMarketCapReflectionFee,
        accounts: CreatorSetProMarketCapReflectionFeeInstructionAccounts,
    },
    CreatorSetProSlotCreatorFee {
        program_id: solana_pubkey::Pubkey,
        data: CreatorSetProSlotCreatorFee,
        accounts: CreatorSetProSlotCreatorFeeInstructionAccounts,
    },
    CreatorToggleProDeposit {
        program_id: solana_pubkey::Pubkey,
        data: CreatorToggleProDeposit,
        accounts: CreatorToggleProDepositInstructionAccounts,
    },
    CreatorToggleProSwap {
        program_id: solana_pubkey::Pubkey,
        data: CreatorToggleProSwap,
        accounts: CreatorToggleProSwapInstructionAccounts,
    },
    CreatorToggleProWithdraw {
        program_id: solana_pubkey::Pubkey,
        data: CreatorToggleProWithdraw,
        accounts: CreatorToggleProWithdrawInstructionAccounts,
    },
    DeactivateProtocolLookupTable {
        program_id: solana_pubkey::Pubkey,
        data: DeactivateProtocolLookupTable,
        accounts: DeactivateProtocolLookupTableInstructionAccounts,
    },
    ExtendProtocolLookupTable {
        program_id: solana_pubkey::Pubkey,
        data: ExtendProtocolLookupTable,
        accounts: ExtendProtocolLookupTableInstructionAccounts,
    },
    InitializeProtocolLending {
        program_id: solana_pubkey::Pubkey,
        data: InitializeProtocolLending,
        accounts: InitializeProtocolLendingInstructionAccounts,
    },
    ProBuy {
        program_id: solana_pubkey::Pubkey,
        data: ProBuy,
        accounts: ProBuyInstructionAccounts,
    },
    ProSell {
        program_id: solana_pubkey::Pubkey,
        data: ProSell,
        accounts: ProSellInstructionAccounts,
    },
    RemainingAccountsStub {
        program_id: solana_pubkey::Pubkey,
        data: RemainingAccountsStub,
        accounts: RemainingAccountsStubInstructionAccounts,
    },
    RemoveLiquidityProPool {
        program_id: solana_pubkey::Pubkey,
        data: RemoveLiquidityProPool,
        accounts: RemoveLiquidityProPoolInstructionAccounts,
    },
    Sell {
        program_id: solana_pubkey::Pubkey,
        data: Sell,
        accounts: SellInstructionAccounts,
    },
    SetProtocolSlotFees {
        program_id: solana_pubkey::Pubkey,
        data: SetProtocolSlotFees,
        accounts: SetProtocolSlotFeesInstructionAccounts,
    },
    TransferLpTokens {
        program_id: solana_pubkey::Pubkey,
        data: TransferLpTokens,
        accounts: TransferLpTokensInstructionAccounts,
    },
    UpdateAllowCreatePool {
        program_id: solana_pubkey::Pubkey,
        data: UpdateAllowCreatePool,
        accounts: UpdateAllowCreatePoolInstructionAccounts,
    },
    UpdateCreatorTradingFeeReceiver {
        program_id: solana_pubkey::Pubkey,
        data: UpdateCreatorTradingFeeReceiver,
        accounts: UpdateCreatorTradingFeeReceiverInstructionAccounts,
    },
    UpdateProCreatorTradingFeeReceiver {
        program_id: solana_pubkey::Pubkey,
        data: UpdateProCreatorTradingFeeReceiver,
        accounts: UpdateProCreatorTradingFeeReceiverInstructionAccounts,
    },
    UpdateProtocolConfig {
        program_id: solana_pubkey::Pubkey,
        data: UpdateProtocolConfig,
        accounts: UpdateProtocolConfigInstructionAccounts,
    },
    CpiEvent {
        program_id: solana_pubkey::Pubkey,
        data: CpiEvent,
        accounts: CpiEventInstructionAccounts,
    },
}

impl carbon_core::instruction::InstructionDecoder<'_> for HeavenDecoder {
    type InstructionType = HeavenInstruction;

    fn decode_instruction(
        &self,
        instruction: &solana_instruction::Instruction,
    ) -> Option<Self::InstructionType> {
        if instruction.program_id != PROGRAM_ID {
            return None;
        }

        carbon_core::try_decode_instructions!(
            instruction,
            PROGRAM_ID,
            HeavenInstruction::AddLiquidityProPool => AddLiquidityProPool,
            HeavenInstruction::AdminBorrowSol => AdminBorrowSol,
            HeavenInstruction::AdminClaimMsol => AdminClaimMsol,
            HeavenInstruction::AdminClaimProCreatorTradingFees => AdminClaimProCreatorTradingFees,
            HeavenInstruction::AdminClaimStakingRewards => AdminClaimStakingRewards,
            HeavenInstruction::AdminClaimStandardCreatorTradingFees => AdminClaimStandardCreatorTradingFees,
            HeavenInstruction::AdminDepositMsol => AdminDepositMsol,
            HeavenInstruction::AdminMintMsol => AdminMintMsol,
            HeavenInstruction::AdminRepaySol => AdminRepaySol,
            HeavenInstruction::AdminSetTransferFee => AdminSetTransferFee,
            HeavenInstruction::AdminUnstakeMsol => AdminUnstakeMsol,
            HeavenInstruction::AdminUpdateProLiquidityPoolState => AdminUpdateProLiquidityPoolState,
            HeavenInstruction::AdminUpdateStandardLiquidityPoolState => AdminUpdateStandardLiquidityPoolState,
            HeavenInstruction::AdminWithdrawMsol => AdminWithdrawMsol,
            HeavenInstruction::AdminWithdrawTransferFee => AdminWithdrawTransferFee,
            HeavenInstruction::Buy => Buy,
            HeavenInstruction::ClaimProCreatorTradingFeeProtocolFees => ClaimProCreatorTradingFeeProtocolFees,
            HeavenInstruction::ClaimProCreatorTradingFees => ClaimProCreatorTradingFees,
            HeavenInstruction::ClaimProLiquidityProviderTradingFees => ClaimProLiquidityProviderTradingFees,
            HeavenInstruction::ClaimProProtocolTradingFees => ClaimProProtocolTradingFees,
            HeavenInstruction::ClaimProReflectionTradingFees => ClaimProReflectionTradingFees,
            HeavenInstruction::ClaimStandardCreatorTradingFeeProtocolFees => ClaimStandardCreatorTradingFeeProtocolFees,
            HeavenInstruction::ClaimStandardCreatorTradingFees => ClaimStandardCreatorTradingFees,
            HeavenInstruction::ClaimStandardProtocolTradingFees => ClaimStandardProtocolTradingFees,
            HeavenInstruction::ClaimStandardReflectionTradingFees => ClaimStandardReflectionTradingFees,
            HeavenInstruction::CloseProtocolLookupTable => CloseProtocolLookupTable,
            HeavenInstruction::CreateOrUpdateProtocolFeeAdmin => CreateOrUpdateProtocolFeeAdmin,
            HeavenInstruction::CreateOrUpdateProtocolOwner => CreateOrUpdateProtocolOwner,
            HeavenInstruction::CreateOrUpdateProtocolStakingAdmin => CreateOrUpdateProtocolStakingAdmin,
            HeavenInstruction::CreateProLiquidityPool => CreateProLiquidityPool,
            HeavenInstruction::CreateProtocolConfig => CreateProtocolConfig,
            HeavenInstruction::CreateProtocolLookupTable => CreateProtocolLookupTable,
            HeavenInstruction::CreateStandardLiquidityPool => CreateStandardLiquidityPool,
            HeavenInstruction::CreatorSetProMarketCapCreatorFee => CreatorSetProMarketCapCreatorFee,
            HeavenInstruction::CreatorSetProMarketCapLpFee => CreatorSetProMarketCapLpFee,
            HeavenInstruction::CreatorSetProMarketCapReflectionFee => CreatorSetProMarketCapReflectionFee,
            HeavenInstruction::CreatorSetProSlotCreatorFee => CreatorSetProSlotCreatorFee,
            HeavenInstruction::CreatorToggleProDeposit => CreatorToggleProDeposit,
            HeavenInstruction::CreatorToggleProSwap => CreatorToggleProSwap,
            HeavenInstruction::CreatorToggleProWithdraw => CreatorToggleProWithdraw,
            HeavenInstruction::DeactivateProtocolLookupTable => DeactivateProtocolLookupTable,
            HeavenInstruction::ExtendProtocolLookupTable => ExtendProtocolLookupTable,
            HeavenInstruction::InitializeProtocolLending => InitializeProtocolLending,
            HeavenInstruction::ProBuy => ProBuy,
            HeavenInstruction::ProSell => ProSell,
            HeavenInstruction::RemainingAccountsStub => RemainingAccountsStub,
            HeavenInstruction::RemoveLiquidityProPool => RemoveLiquidityProPool,
            HeavenInstruction::Sell => Sell,
            HeavenInstruction::SetProtocolSlotFees => SetProtocolSlotFees,
            HeavenInstruction::TransferLpTokens => TransferLpTokens,
            HeavenInstruction::UpdateAllowCreatePool => UpdateAllowCreatePool,
            HeavenInstruction::UpdateCreatorTradingFeeReceiver => UpdateCreatorTradingFeeReceiver,
            HeavenInstruction::UpdateProCreatorTradingFeeReceiver => UpdateProCreatorTradingFeeReceiver,
            HeavenInstruction::UpdateProtocolConfig => UpdateProtocolConfig,
            HeavenInstruction::CpiEvent => CpiEvent,
        )
    }
}