Struct flow_rust_sdk::FlowConnection [−][src]
pub struct FlowConnection<T> {
    pub client: AccessApiClient<T>,
}Expand description
The FlowConnection object contains a single API connection.
The network transport layer can be optionally substitued by implementing a new FlowConnection
Fields
client: AccessApiClient<T>Implementations
The default implementation of a FlowConnection, using tonic::transport::Channel
Initializes a new connection and checks the availability of the node at the provided address
pub async fn get_account(
    &mut self, 
    account_address: &str
) -> Result<AccountResponse, Box<dyn Error>>
pub async fn get_account(
    &mut self, 
    account_address: &str
) -> Result<AccountResponse, Box<dyn Error>>
get_account will return the flow::AccountResponse of account_address, else an error if it could not be accessed.
execute_script will attempt to run the provided script (as bytes) and return the flow::ExecuteScriptResponse or Error
pub async fn send_transaction(
    &mut self, 
    transaction: Option<Transaction>
) -> Result<SendTransactionResponse, Box<dyn Error>>
pub async fn send_transaction(
    &mut self, 
    transaction: Option<Transaction>
) -> Result<SendTransactionResponse, Box<dyn Error>>
Sends the transaction to the blockchain. Make sure you signed the transactionsign_transaction first.
pub async fn get_transaction_result(
    &mut self, 
    id: Vec<u8>
) -> Result<TransactionResultResponse, Box<dyn Error>>
pub async fn get_transaction_result(
    &mut self, 
    id: Vec<u8>
) -> Result<TransactionResultResponse, Box<dyn Error>>
get transaction result
get_block accepts either the block_id or block_height. If neither are defined it returns the latest block.
pub async fn get_events_for_height_range(
    &mut self, 
    event_type: &str, 
    start_height: u64, 
    end_height: u64
) -> Result<EventsResponse, Box<dyn Error>>
pub async fn get_events_for_height_range(
    &mut self, 
    event_type: &str, 
    start_height: u64, 
    end_height: u64
) -> Result<EventsResponse, Box<dyn Error>>
retrieve the specified events by type for the given height range
pub async fn get_events_for_block_ids(
    &mut self, 
    event_type: &str, 
    ids: Vec<Vec<u8>>
) -> Result<EventsResponse, Box<dyn Error>>
pub async fn get_events_for_block_ids(
    &mut self, 
    event_type: &str, 
    ids: Vec<Vec<u8>>
) -> Result<EventsResponse, Box<dyn Error>>
retrieve the specified events by type for the given blocks
pub async fn get_collection(
    &mut self, 
    collection_id: Vec<u8>
) -> Result<CollectionResponse, Box<dyn Error>>
pub async fn get_collection(
    &mut self, 
    collection_id: Vec<u8>
) -> Result<CollectionResponse, Box<dyn Error>>
retrieve the specified collections
Create an account with the given account_keys and payer
add a key
pub async fn remove_key(
    &mut self, 
    key_to_remove: u64, 
    payer: &str, 
    payer_private_key: &str, 
    key_id: u32
) -> Result<SendTransactionResponse, Box<dyn Error>>
pub async fn remove_key(
    &mut self, 
    key_to_remove: u64, 
    payer: &str, 
    payer_private_key: &str, 
    key_id: u32
) -> Result<SendTransactionResponse, Box<dyn Error>>
remove a key
add a contract
update a contract
pub async fn remove_contract(
    &mut self, 
    contract_name: &str, 
    payer: &str, 
    payer_private_key: &str, 
    key_id: u32
) -> Result<SendTransactionResponse, Box<dyn Error>>
pub async fn remove_contract(
    &mut self, 
    contract_name: &str, 
    payer: &str, 
    payer_private_key: &str, 
    key_id: u32
) -> Result<SendTransactionResponse, Box<dyn Error>>
remove a contract
Auto Trait Implementations
impl<T> RefUnwindSafe for FlowConnection<T> where
    T: RefUnwindSafe, 
impl<T> Send for FlowConnection<T> where
    T: Send, 
impl<T> Sync for FlowConnection<T> where
    T: Sync, 
impl<T> Unpin for FlowConnection<T> where
    T: Unpin, 
impl<T> UnwindSafe for FlowConnection<T> where
    T: UnwindSafe, 
Blanket Implementations
Mutably borrows from an owned value. Read more
Wrap the input message T in a tonic::Request
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more