[][src]Trait grin_wallet_impls::WalletCommAdapter

pub trait WalletCommAdapter {
    fn supports_sync(&self) -> bool;
fn send_tx_sync(&self, addr: &str, slate: &Slate) -> Result<Slate, Error>;
fn send_tx_async(&self, addr: &str, slate: &Slate) -> Result<(), Error>;
fn receive_tx_async(&self, params: &str) -> Result<Slate, Error>;
fn listen(
        &self,
        params: HashMap<String, String>,
        config: WalletConfig,
        passphrase: &str,
        account: &str,
        node_api_secret: Option<String>
    ) -> Result<(), Error>; }

Encapsulate wallet to wallet communication functions

Required methods

fn supports_sync(&self) -> bool

Whether this adapter supports sync mode

fn send_tx_sync(&self, addr: &str, slate: &Slate) -> Result<Slate, Error>

Send a transaction slate to another listening wallet and return result TODO: Probably need a slate wrapper type

fn send_tx_async(&self, addr: &str, slate: &Slate) -> Result<(), Error>

Send a transaction asynchronously (result will be returned via the listener)

fn receive_tx_async(&self, params: &str) -> Result<Slate, Error>

Receive a transaction async. (Actually just read it from wherever and return the slate)

fn listen(
    &self,
    params: HashMap<String, String>,
    config: WalletConfig,
    passphrase: &str,
    account: &str,
    node_api_secret: Option<String>
) -> Result<(), Error>

Start a listener, passing received messages to the wallet api directly Takes a wallet config for now to avoid needing all sorts of awkward type parameters on this trait

Loading content...

Implementors

impl WalletCommAdapter for FileWalletCommAdapter[src]

impl WalletCommAdapter for HTTPWalletCommAdapter[src]

impl WalletCommAdapter for KeybaseWalletCommAdapter[src]

fn send_tx_async(&self, _addr: &str, _slate: &Slate) -> Result<(), Error>[src]

Send a transaction asynchronously (result will be returned via the listener)

fn receive_tx_async(&self, _params: &str) -> Result<Slate, Error>[src]

Receive a transaction async. (Actually just read it from wherever and return the slate)

fn listen(
    &self,
    _params: HashMap<String, String>,
    config: WalletConfig,
    passphrase: &str,
    account: &str,
    node_api_secret: Option<String>
) -> Result<(), Error>
[src]

Start a listener, passing received messages to the wallet api directly

impl WalletCommAdapter for NullWalletCommAdapter[src]

impl WalletCommAdapter for LocalWalletClient[src]

fn send_tx_sync(&self, dest: &str, slate: &Slate) -> Result<Slate, Error>[src]

Send the slate to a listening wallet instance

Loading content...