spl_token_2022/extension/pausable/
mod.rs

1#[cfg(feature = "serde-traits")]
2use serde::{Deserialize, Serialize};
3use {
4    crate::extension::{Extension, ExtensionType},
5    bytemuck::{Pod, Zeroable},
6    spl_pod::{optional_keys::OptionalNonZeroPubkey, primitives::PodBool},
7};
8
9/// Instruction types for the pausable extension
10pub mod instruction;
11/// Instruction processor for the pausable extension
12pub mod processor;
13
14/// Indicates that the tokens from this mint can be paused
15#[cfg_attr(feature = "serde-traits", derive(Serialize, Deserialize))]
16#[cfg_attr(feature = "serde-traits", serde(rename_all = "camelCase"))]
17#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
18#[repr(C)]
19pub struct PausableConfig {
20    /// Authority that can pause or resume activity on the mint
21    pub authority: OptionalNonZeroPubkey,
22    /// Whether minting / transferring / burning tokens is paused
23    pub paused: PodBool,
24}
25
26/// Indicates that the tokens from this account belong to a pausable mint
27#[cfg_attr(feature = "serde-traits", derive(Serialize, Deserialize))]
28#[cfg_attr(feature = "serde-traits", serde(rename_all = "camelCase"))]
29#[derive(Clone, Copy, Debug, Default, PartialEq, Pod, Zeroable)]
30#[repr(transparent)]
31pub struct PausableAccount;
32
33impl Extension for PausableConfig {
34    const TYPE: ExtensionType = ExtensionType::Pausable;
35}
36
37impl Extension for PausableAccount {
38    const TYPE: ExtensionType = ExtensionType::PausableAccount;
39}