solagent_plugin_solana/
lib.rs1mod close_empty_token_accounts;
16pub use close_empty_token_accounts::{close_empty_token_accounts, CloseEmptyTokenAccountsData};
17
18mod get_balance;
19pub use get_balance::get_balance;
20
21mod request_faucet_funds;
22pub use request_faucet_funds::request_faucet_funds;
23
24mod get_tps;
25pub use get_tps::get_tps;
26
27mod transfer;
28pub use transfer::transfer;
29
30mod deploy_token;
31pub use deploy_token::deploy_token;
32
33mod deploy_collection;
34pub use deploy_collection::deploy_collection;
35
36mod get_balance_other;
37pub use get_balance_other::get_balance_other;
38
39mod get_wallet_address;
40pub use get_wallet_address::get_wallet_address;
41
42mod mint_nft;
43pub use mint_nft::mint_nft_to_collection;
44
45use mpl_token_metadata::types::Creator;
46use serde::{Deserialize, Serialize};
47use solagent_core::solana_sdk::pubkey::Pubkey;
48
49#[derive(Serialize, Deserialize, Debug)]
50pub struct DeployedData {
51 pub mint: String, pub signature: String, }
54
55impl DeployedData {
56 pub fn new(mint: String, signature: String) -> Self {
57 DeployedData { mint, signature }
58 }
59}
60
61#[derive(serde::Serialize, serde::Deserialize)]
72pub struct NFTMetadata {
73 pub name: String,
74 pub uri: String,
75 pub basis_points: Option<u16>, pub creators: Option<Vec<Creator>>, }
78
79impl NFTMetadata {
80 pub fn new(
81 name: &str,
82 uri: &str,
83 basis_points: Option<u16>,
84 creators: Option<Vec<(Pubkey, u8)>>,
85 ) -> Self {
86 let creators = creators.map(|creator_tuples| {
87 creator_tuples
88 .into_iter()
89 .map(|(pubkey, share)| Creator {
90 address: pubkey,
91 verified: true,
92 share,
93 })
94 .collect::<Vec<Creator>>()
95 });
96
97 NFTMetadata {
98 name: name.to_string(),
99 uri: uri.to_string(),
100 basis_points,
101 creators,
102 }
103 }
104}