Struct tensor_trade::TensorTradeClient
source · pub struct TensorTradeClient { /* private fields */ }Implementations§
source§impl TensorTradeClient
impl TensorTradeClient
sourcepub fn new(
api_key: String,
private_key: String,
rpc_url: Option<String>
) -> Result<Self>
pub fn new( api_key: String, private_key: String, rpc_url: Option<String> ) -> Result<Self>
Examples found in repository?
examples/get_this_account.rs (line 13)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
async fn main() -> Result<()> {
dotenv::dotenv().ok();
let api_key =
std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
let account_balance = tensor_trade_client.this_account().unwrap();
println!("Account balance: {}", account_balance);
Ok(())
}More examples
examples/get_this_balance.rs (line 13)
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
async fn main() -> Result<()> {
dotenv::dotenv().ok();
let api_key =
std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
let account_balance = tensor_trade_client.this_balance().unwrap();
println!("Account balance: {}", account_balance);
Ok(())
}pub fn collection(&self) -> Collection<'_>
pub fn user(&self) -> User<'_>
pub fn tensorswap(&self) -> Tensorswap<'_>
pub fn execute(&self) -> Execute<'_>
pub fn utils(&self) -> Utils<'_>
Trait Implementations§
source§impl Clone for TensorTradeClient
impl Clone for TensorTradeClient
source§fn clone(&self) -> TensorTradeClient
fn clone(&self) -> TensorTradeClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for TensorTradeClient
impl Debug for TensorTradeClient
source§impl Getters for TensorTradeClient
impl Getters for TensorTradeClient
fn this_account(&self) -> Result<Pubkey>
fn this_balance(&self) -> Result<u64>
source§impl Settings for TensorTradeClient
impl Settings for TensorTradeClient
fn update_private_key(&mut self, private_key: String)
fn update_rpc_url(&mut self, rpc_url: String)
Auto Trait Implementations§
impl !RefUnwindSafe for TensorTradeClient
impl Send for TensorTradeClient
impl Sync for TensorTradeClient
impl Unpin for TensorTradeClient
impl !UnwindSafe for TensorTradeClient
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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