Struct solana::thin_client::ThinClient [−][src]
pub struct ThinClient { /* fields omitted */ }
An object for querying and sending transactions to the network.
Methods
impl ThinClient
[src]
impl ThinClient
pub fn new(
requests_addr: SocketAddr,
requests_socket: UdpSocket,
transactions_addr: SocketAddr,
transactions_socket: UdpSocket
) -> Self
[src]
pub fn new(
requests_addr: SocketAddr,
requests_socket: UdpSocket,
transactions_addr: SocketAddr,
transactions_socket: UdpSocket
) -> Self
Create a new ThinClient that will interface with Rpu
over requests_socket
and transactions_socket
. To receive responses, the caller must bind socket
to a public address before invoking ThinClient methods.
pub fn recv_response(&self) -> Result<Response>
[src]
pub fn recv_response(&self) -> Result<Response>
pub fn process_response(&mut self, resp: Response)
[src]
pub fn process_response(&mut self, resp: Response)
pub fn transfer_signed(&self, tx: Transaction) -> Result<usize>
[src]
pub fn transfer_signed(&self, tx: Transaction) -> Result<usize>
Send a signed Transaction to the server for processing. This method does not wait for a response.
pub fn transfer(
&self,
n: i64,
keypair: &KeyPair,
to: PublicKey,
last_id: &Hash
) -> Result<Signature>
[src]
pub fn transfer(
&self,
n: i64,
keypair: &KeyPair,
to: PublicKey,
last_id: &Hash
) -> Result<Signature>
Creates, signs, and processes a Transaction. Useful for writing unit-tests.
pub fn get_balance(&mut self, pubkey: &PublicKey) -> Result<i64>
[src]
pub fn get_balance(&mut self, pubkey: &PublicKey) -> Result<i64>
Request the balance of the user holding pubkey
. This method blocks
until the server sends a response. If the response packet is dropped
by the network, this method will hang indefinitely.
pub fn transaction_count(&mut self) -> u64
[src]
pub fn transaction_count(&mut self) -> u64
Request the transaction count. If the response packet is dropped by the network, this method will hang.
pub fn get_last_id(&mut self) -> Hash
[src]
pub fn get_last_id(&mut self) -> Hash
Request the last Entry ID from the server. This method blocks until the server sends a response.
pub fn poll_get_balance(&mut self, pubkey: &PublicKey) -> Result<i64>
[src]
pub fn poll_get_balance(&mut self, pubkey: &PublicKey) -> Result<i64>
pub fn check_signature(&mut self, sig: &Signature) -> bool
[src]
pub fn check_signature(&mut self, sig: &Signature) -> bool
Check a signature in the bank. This method blocks until the server sends a response.
Auto Trait Implementations
impl Send for ThinClient
impl Send for ThinClient
impl Sync for ThinClient
impl Sync for ThinClient