Alexandre RAY-BERNAT f483834391
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Retrieves social infos + post on Telegram
2025-05-13 09:21:28 +02:00

100 lines
2.4 KiB
Rust

use borsh_derive::BorshDeserialize;
use serde::Deserialize;
use solana_program::clock::Slot;
use solana_program::program_option::COption;
use solana_program::pubkey::Pubkey;
use solana_sdk::transaction::TransactionError;
#[derive(BorshDeserialize, Debug, Deserialize)]
pub struct TokenInfo {
pub(crate) mint_address: String,
pub(crate) decimals: u8,
pub(crate) mint_authority: bool,
pub(crate) freeze_authority: bool,
pub(crate) supply: u64,
}
#[derive(BorshDeserialize, Debug, Deserialize)]
pub struct TokenAmount {
amount: String,
decimals: u8,
pub(crate) uiAmount: Option<f64>,
uiAmountString: String,
}
#[derive(BorshDeserialize, Debug, Deserialize)]
pub struct ParsedAccount {
pub(crate) info: TokenInfoWithAmount,
}
#[derive(BorshDeserialize, Debug, Deserialize)]
pub struct TokenInfoWithAmount {
isNative: bool,
mint: String,
owner: String,
state: String,
pub(crate) tokenAmount: TokenAmount,
}
#[derive(BorshDeserialize, Debug, Deserialize)]
pub struct UiParsedTokenAccount {
program: String,
parsed: ParsedAccount,
space: Option<u64>,
}
#[derive( Debug)]
pub struct Transaction {
pub(crate) signature: String,
pub(crate) slot: Slot,
pub(crate) block_time: Option<i64>,
pub(crate) status: Option<TransactionError>,
pub(crate) account_keys: AccountKeys,
}
#[derive(Debug)]
pub struct AccountKeys {
pub(crate) payer: Pubkey,
pub(crate) mint_account: Pubkey,
pub(crate) rent_account: Pubkey,
pub(crate) mint_authority: Pubkey,
pub(crate) token_program: Pubkey,
}
#[derive(Debug, Clone)]
pub struct TokenData {
pub(crate) name: String,
pub(crate) symbol: String,
pub(crate) uri: String,
pub(crate) supply: u64,
pub(crate) dev_balance: f64,
pub(crate) mint_authority: bool,
pub(crate) freeze_authority: bool,
}
#[derive(Debug, Deserialize)]
pub struct TokenSocials {
pub(crate) createdOn: String,
pub(crate) description: String,
pub(crate) image: String,
pub(crate) name: String,
pub(crate) symbol: String,
pub(crate) twitter: String,
pub(crate) website: String
}
impl Default for TokenSocials {
fn default() -> Self {
Self {
createdOn: "".to_string(),
description: "".to_string(),
image: "".to_string(),
name: "".to_string(),
symbol: "".to_string(),
twitter: "".to_string(),
website: "".to_string(),
}
}
}