Struct aleo_rust::RecordFinder
source · pub struct RecordFinder<N: Network> { /* private fields */ }
Expand description
Helper struct for finding records on chain during program development
Implementations§
source§impl<N: Network> RecordFinder<N>
impl<N: Network> RecordFinder<N>
pub fn new(api_client: AleoAPIClient<N>) -> Self
sourcepub fn find_amount_and_fee_records(
&self,
amount: u64,
fee: u64,
private_key: &PrivateKey<N>
) -> Result<(Record<N, Plaintext<N>>, Record<N, Plaintext<N>>)>
pub fn find_amount_and_fee_records( &self, amount: u64, fee: u64, private_key: &PrivateKey<N> ) -> Result<(Record<N, Plaintext<N>>, Record<N, Plaintext<N>>)>
Resolve two records for a transfer amount and fee respectively
Basic Usage: let (amount_record, fee_record) = self.resolve_amount_and_fee(amount, fee, private_key);
sourcepub fn find_one_record(
&self,
private_key: &PrivateKey<N>,
amount: u64,
found_nonces: Option<&[Group<N>]>
) -> Result<Record<N, Plaintext<N>>>
pub fn find_one_record( &self, private_key: &PrivateKey<N>, amount: u64, found_nonces: Option<&[Group<N>]> ) -> Result<Record<N, Plaintext<N>>>
Resolve a record with a specific value. If successful it will return a record with a gate value equal to or greater than the specified amount.
sourcepub fn find_record_amounts(
&self,
amounts: Vec<u64>,
private_key: &PrivateKey<N>
) -> Result<Vec<Record<N, Plaintext<N>>>>
pub fn find_record_amounts( &self, amounts: Vec<u64>, private_key: &PrivateKey<N> ) -> Result<Vec<Record<N, Plaintext<N>>>>
Attempt to resolve records with specific gate values specified as a vector of u64s. If the function is successful at resolving the records, it will return a vector of records with microcredits equal to or greater than the specified amounts. If it cannot resolve records with the specified amounts, it will return an error.
pub fn find_unspent_records_on_chain( &self, amounts: Option<&Vec<u64>>, max_microcredits: Option<u64>, private_key: &PrivateKey<N> ) -> Result<Vec<Record<N, Plaintext<N>>>>
sourcepub fn find_matching_records_from_program(
&self,
private_key: &PrivateKey<N>,
program_id: &ProgramID<N>,
matching_function: impl FnOnce(Vec<Record<N, Plaintext<N>>>) -> Result<Vec<Record<N, Plaintext<N>>>>,
unspent_only: bool,
max_records: Option<usize>
) -> Result<Vec<Record<N, Plaintext<N>>>>
pub fn find_matching_records_from_program( &self, private_key: &PrivateKey<N>, program_id: &ProgramID<N>, matching_function: impl FnOnce(Vec<Record<N, Plaintext<N>>>) -> Result<Vec<Record<N, Plaintext<N>>>>, unspent_only: bool, max_records: Option<usize> ) -> Result<Vec<Record<N, Plaintext<N>>>>
Find matching records from a program using a user-specified function to match records