solagent_plugin_solana/
lib.rsmod close_empty_token_accounts;
pub use close_empty_token_accounts::{close_empty_token_accounts, CloseEmptyTokenAccountsData};
mod get_balance;
pub use get_balance::get_balance;
mod request_faucet_funds;
pub use request_faucet_funds::request_faucet_funds;
mod get_tps;
pub use get_tps::get_tps;
mod transfer;
pub use transfer::transfer;
mod deploy_token;
pub use deploy_token::deploy_token;
mod deploy_collection;
pub use deploy_collection::deploy_collection;
mod get_balance_other;
pub use get_balance_other::get_balance_other;
mod get_wallet_address;
pub use get_wallet_address::get_wallet_address;
mod mint_nft;
pub use mint_nft::mint_nft_to_collection;
use mpl_token_metadata::types::Creator;
use serde::{Deserialize, Serialize};
use solagent_core::solana_sdk::pubkey::Pubkey;
#[derive(Serialize, Deserialize, Debug)]
pub struct DeployedData {
pub mint: String, pub signature: String, }
impl DeployedData {
pub fn new(mint: String, signature: String) -> Self {
DeployedData { mint, signature }
}
}
#[derive(serde::Serialize, serde::Deserialize)]
pub struct NFTMetadata {
pub name: String,
pub uri: String,
pub basis_points: Option<u16>, pub creators: Option<Vec<Creator>>, }
impl NFTMetadata {
pub fn new(name: &str, uri: &str, basis_points: Option<u16>, creators: Option<Vec<(Pubkey, u8)>>) -> Self {
let creators = creators.map(|creator_tuples| {
creator_tuples
.into_iter()
.map(|(pubkey, share)| Creator { address: pubkey, verified: true, share })
.collect::<Vec<Creator>>()
});
NFTMetadata { name: name.to_string(), uri: uri.to_string(), basis_points, creators }
}
}