Crate flow_rust_sdk[][src]

Expand description

Welcome to the Flow-Rust-SDK! We’re glad to have you here. There are a few important items that we should cover real quick before you dive in.

Signing Algorithms

– Only ECDSA_P256 is supported at this time

Hashing

– Only SHA3_256 is supported at this time

Documentation

Documentation is currently a work in progress. Please open an issue in the GitHub repository if you find any bugs. For general questions, please join the Flow Discord. There is a flow-rust channel which is an excellent place for discussion!

// basic usage
 
let service_account = std::env::vars().filter(|kv| kv.0 == "SERVICE_ACCT").map(|kv| kv.1).collect::<Vec<String>>();
let private_key = std::env::vars().filter(|kv| kv.0 == "PRIV_K").map(|kv| kv.1).collect::<Vec<String>>();
let public_key = std::env::vars().filter(|kv| kv.0 == "PUB_K").map(|kv| kv.1).collect::<Vec<String>>();
 
// create the account
 
let network_address = "https://access.devnet.nodes.onflow.org:9000".to_string();
let payer = &service_account[0];
let payer_private_key = &private_key[0];
let public_keys = vec![public_key[0].to_owned()];
 
let acct = create_account(
    &network_address,
    public_keys.to_vec(),
    &payer,
    &payer_private_key,
    0,
)
.await
.expect("Could not create account");
println!("{:?}", acct);

Re-exports

pub extern crate hex;

Modules

The flow module is generated from the flow.proto file. More information on the flow gRPC API can be found here

Structs

Functions

build

check the availability of the node at network_address if this times out, it’s probably because the endpoint timed out.

execute_script will attempt to run the script and return the result as T or Error

get_account expects the address and will return the Account or an Err

get_block accepts either the block_id or block_height. If neither are defined it returns the latest block.

retrieve the specified collections

retrieve the specified events by type for the given blocks

retrieve the specified events by type for the given height range

get transaction result

get transaction result

Sends the transaction to the blockchain.

sign