pub struct PrivySigner {
pub app_id: String,
pub app_secret: String,
pub wallet_id: String,
pub api_base_url: String,
pub client: Client,
pub public_key: Pubkey,
}Fields§
§app_id: String§app_secret: String§wallet_id: String§api_base_url: String§client: Client§public_key: PubkeyImplementations§
Source§impl PrivySigner
impl PrivySigner
Sourcepub fn new(app_id: String, app_secret: String, wallet_id: String) -> Self
pub fn new(app_id: String, app_secret: String, wallet_id: String) -> Self
Create a new PrivySigner
Sourcepub async fn init(&mut self) -> Result<(), PrivyError>
pub async fn init(&mut self) -> Result<(), PrivyError>
Initialize the signer by fetching the public key
Sourcepub fn solana_pubkey(&self) -> Pubkey
pub fn solana_pubkey(&self) -> Pubkey
Get the cached public key
Sourcepub async fn get_public_key(&self) -> Result<Pubkey, PrivyError>
pub async fn get_public_key(&self) -> Result<Pubkey, PrivyError>
Get the public key for this wallet
Sourcepub async fn sign_solana(
&self,
transaction: &[u8],
) -> Result<Signature, PrivyError>
pub async fn sign_solana( &self, transaction: &[u8], ) -> Result<Signature, PrivyError>
Sign a transaction
The transaction parameter should be a fully serialized Solana transaction (including empty signature placeholders), not just the message bytes.
pub async fn sign(&self, message: &[u8]) -> Result<Vec<u8>, PrivyError>
Trait Implementations§
Source§impl Clone for PrivySigner
impl Clone for PrivySigner
Source§fn clone(&self) -> PrivySigner
fn clone(&self) -> PrivySigner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PrivySigner
impl !RefUnwindSafe for PrivySigner
impl Send for PrivySigner
impl Sync for PrivySigner
impl Unpin for PrivySigner
impl UnsafeUnpin for PrivySigner
impl !UnwindSafe for PrivySigner
Blanket Implementations§
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