pub struct Actions {
pub keypair: Keypair,
pub rpc_client: RpcClient,
pub client: Client,
}Fields§
§keypair: Keypair§rpc_client: RpcClient§client: ClientImplementations§
Source§impl Actions
impl Actions
pub fn new(private_key: String, rpc_url: String) -> Self
pub async fn trade( &self, input_mint: String, input_amount: u64, output_mint: String, slippage_bps: u16, ) -> Result<String, Box<dyn Error>>
pub async fn transfer_sol( &self, to: String, amount: u64, ) -> Result<String, Box<dyn Error>>
Sourcepub async fn transfer_token(
&self,
to: String,
amount: u64,
mint: String,
) -> Result<String, Box<dyn Error>>
pub async fn transfer_token( &self, to: String, amount: u64, mint: String, ) -> Result<String, Box<dyn Error>>
param amount is token amount, accounting for decimals e.g. 1 Fartcoin = 1 * 10^6 (6 decimals)
pub async fn wallet_address(&self) -> String
pub async fn get_balance(&self) -> Result<u64, Box<dyn Error>>
Sourcepub async fn get_token_balance(
&self,
mint: String,
) -> Result<(String, u8), Box<dyn Error>>
pub async fn get_token_balance( &self, mint: String, ) -> Result<(String, u8), Box<dyn Error>>
get_token_balance returns the amount as String and the decimals as u8 in order to convert to UI amount: amount / 10^decimals
pub async fn deploy_token( &self, deploy_token_params: DeployTokenParams, ) -> Result<String, Box<dyn Error>>
pub async fn fetch_token_price( &self, mint: String, ) -> Result<f64, Box<dyn Error>>
pub async fn buy_pump_token() -> Result<String, Box<dyn Error>>
pub async fn sell_pump_token() -> Result<String, Box<dyn Error>>
pub async fn fetch_metadata(&self) -> Result<String, Box<dyn Error>>
Sourcepub async fn research_token(&self) -> Result<String, Box<dyn Error>>
pub async fn research_token(&self) -> Result<String, Box<dyn Error>>
research_token returns aggregated data from any link from metadata
pub async fn get_token_data_by_ticker(&self) -> Result<String, Box<dyn Error>>
pub async fn get_token_data_by_pubkey(&self) -> Result<String, Box<dyn Error>>
Auto Trait Implementations§
impl Freeze for Actions
impl !RefUnwindSafe for Actions
impl Send for Actions
impl Sync for Actions
impl Unpin for Actions
impl !UnwindSafe for Actions
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more