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)
6async fn main() -> Result<()> {
7 dotenv::dotenv().ok();
8
9 let api_key =
10 std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
11 let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
12
13 let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
14
15 let account = tensor_trade_client.this_account();
16
17 println!("Account: {}", account);
18
19 Ok(())
20}
More examples
examples/get_this_balance.rs (line 13)
6async fn main() -> Result<()> {
7 dotenv::dotenv().ok();
8
9 let api_key =
10 std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
11 let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
12
13 let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
14
15 let balance = tensor_trade_client.this_balance().unwrap();
16
17 println!("Balance: {}", balance);
18
19 Ok(())
20}
examples/sell_now.rs (line 13)
6async fn main() -> Result<()> {
7 dotenv::dotenv().ok();
8
9 let api_key =
10 std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
11 let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
12
13 let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
14
15 let signature = tensor_trade_client
16 .execute()
17 .sell_now("64nfraAs39sJJXmmdt4tUGQRbkxNC6Aw58wCSwFcysYy")
18 .await?;
19
20 println!("Signature: {}", signature);
21
22 Ok(())
23}
examples/buy_listing.rs (line 13)
6async fn main() -> Result<()> {
7 dotenv::dotenv().ok();
8
9 let api_key =
10 std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
11 let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
12
13 let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
14
15 let signature = tensor_trade_client
16 .execute()
17 .buy_listing("EEp26HaWWp5JPr1TazUXRmGnDhUVNFa2pjWYD4QhQFFp")
18 .await?;
19
20 println!("Signature: {}", signature);
21
22 Ok(())
23}
pub fn collection(&self) -> Collection<'_>
pub fn user(&self) -> User<'_>
pub fn tensorswap(&self) -> Tensorswap<'_>
Sourcepub fn execute(&self) -> Execute<'_>
pub fn execute(&self) -> Execute<'_>
Examples found in repository?
examples/sell_now.rs (line 16)
6async fn main() -> Result<()> {
7 dotenv::dotenv().ok();
8
9 let api_key =
10 std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
11 let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
12
13 let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
14
15 let signature = tensor_trade_client
16 .execute()
17 .sell_now("64nfraAs39sJJXmmdt4tUGQRbkxNC6Aw58wCSwFcysYy")
18 .await?;
19
20 println!("Signature: {}", signature);
21
22 Ok(())
23}
More examples
examples/buy_listing.rs (line 16)
6async fn main() -> Result<()> {
7 dotenv::dotenv().ok();
8
9 let api_key =
10 std::env::var("TENSOR_TRADE_API_KEY").expect("tensor trade api key variable must be set");
11 let private_key = std::env::var("PRIVATE_KEY").expect("private key variable must be set");
12
13 let tensor_trade_client = TensorTradeClient::new(api_key, private_key, None)?;
14
15 let signature = tensor_trade_client
16 .execute()
17 .buy_listing("EEp26HaWWp5JPr1TazUXRmGnDhUVNFa2pjWYD4QhQFFp")
18 .await?;
19
20 println!("Signature: {}", signature);
21
22 Ok(())
23}
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) -> 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 Freeze for TensorTradeClient
impl !RefUnwindSafe for TensorTradeClient
impl Send for TensorTradeClient
impl Sync for TensorTradeClient
impl Unpin for TensorTradeClient
impl !UnwindSafe for TensorTradeClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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