pub struct ReadKeypair {
pub pubkey: Pubkey,
}Fields§
§pubkey: PubkeyImplementations§
Source§impl ReadKeypair
impl ReadKeypair
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/vault_oracle.rs (line 17)
10async fn main() -> anyhow::Result<()> {
11 let rpc_url =
12 dotenv::var("RPC_URL").unwrap_or("https://api.mainnet-beta.solana.com".to_string());
13 let cluster = Cluster::from_str(rpc_url.as_str())?;
14
15 let price = get_oracle_price_liquidate(
16 Pubkey::from_str_const("6QBKbRU6bgjDxLeP8XwZmrikkRR5v913b7xwLPVoeNQ5"),
17 &get_vault_program(cluster, Arc::new(ReadKeypair::new()), Default::default())?,
18 )
19 .await?;
20
21 dbg!(price);
22
23 Ok(())
24}pub fn from_pubkey(pubkey: Pubkey) -> Self
Trait Implementations§
Source§impl Clone for ReadKeypair
impl Clone for ReadKeypair
Source§fn clone(&self) -> ReadKeypair
fn clone(&self) -> ReadKeypair
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ReadKeypair
impl Debug for ReadKeypair
Source§impl Signer for ReadKeypair
impl Signer for ReadKeypair
Source§fn pubkey(&self) -> Pubkey
fn pubkey(&self) -> Pubkey
Infallibly gets the implementor’s public key. Returns the all-zeros
Pubkey if the implementor has none.Source§fn try_pubkey(&self) -> Result<Pubkey, SignerError>
fn try_pubkey(&self) -> Result<Pubkey, SignerError>
Fallibly gets the implementor’s public key
Source§fn try_sign_message(&self, _message: &[u8]) -> Result<Signature, SignerError>
fn try_sign_message(&self, _message: &[u8]) -> Result<Signature, SignerError>
Fallibly produces an Ed25519 signature over the provided
message bytes.Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Whether the implementation requires user interaction to sign
Source§fn sign_message(&self, message: &[u8]) -> Signature
fn sign_message(&self, message: &[u8]) -> Signature
Infallibly produces an Ed25519 signature over the provided
message
bytes. Returns the all-zeros Signature if signing is not possible.Auto Trait Implementations§
impl Freeze for ReadKeypair
impl RefUnwindSafe for ReadKeypair
impl Send for ReadKeypair
impl Sync for ReadKeypair
impl Unpin for ReadKeypair
impl UnwindSafe for ReadKeypair
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,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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