Struct ethers_rs::Signer

source ·
pub struct Signer { /* private fields */ }

Implementations§

source§

impl Signer

source

pub fn new(rpc_client: Client) -> Signer

source

pub async fn sign_eth_transaction<T>(
    &mut self,
    transaction_request: T
) -> impl Future<Output = Result<Bytecode, Error<String, Value>>>where
    T: TryInto<TypedTransactionRequest>,
    <T as TryInto<TypedTransactionRequest>>::Error: Display + Debug,

Returns the signed transaction of the parameter transaction_request

source

pub async fn sign_typed_data<D, T, S, V>(
    &mut self,
    domain: D,
    types: T,
    primary_type: S,
    value: V
) -> impl Future<Output = Result<H520, Error<String, Value>>>where
    S: AsRef<str>,
    D: TryInto<EIP712Domain>,
    <D as TryInto<EIP712Domain>>::Error: Display + Debug,
    T: TryInto<BTreeMap<String, Vec<Eip712DomainType, Global>, Global>>,
    <T as TryInto<BTreeMap<String, Vec<Eip712DomainType, Global>, Global>>>::Error: Display + Debug,
    V: TryInto<BTreeMap<String, Value, Global>>,
    <V as TryInto<BTreeMap<String, Value, Global>>>::Error: Display + Debug,

Returns the signed typed data, using eip-712 algorithm

source

pub async fn decrypt<B>(
    &mut self,
    encrypt_data: B
) -> impl Future<Output = Result<Bytecode, Error<String, Value>>>where
    B: TryInto<Bytecode>,
    <B as TryInto<Bytecode>>::Error: Display + Debug,

Decript data using signer private key.

source

pub async fn accounts(
    &mut self
) -> impl Future<Output = Result<Vec<H160, Global>, Error<String, Value>>>

Get associating signer account addresses

source

pub async fn address(
    &mut self
) -> impl Future<Output = Result<H160, Error<String, Value>>>

Get associating signer account addresses

Trait Implementations§

source§

impl Clone for Signer

source§

fn clone(&self) -> Signer

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Signer

§

impl Send for Signer

§

impl Sync for Signer

§

impl Unpin for Signer

§

impl !UnwindSafe for Signer

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere
    T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere
    V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
    S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more