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
Trait Implementations§
Source§impl<N: Clone + Network> Clone for RecordFinder<N>
impl<N: Clone + Network> Clone for RecordFinder<N>
Source§fn clone(&self) -> RecordFinder<N>
fn clone(&self) -> RecordFinder<N>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<N> Freeze for RecordFinder<N>
impl<N> !RefUnwindSafe for RecordFinder<N>
impl<N> Send for RecordFinder<N>
impl<N> Sync for RecordFinder<N>
impl<N> Unpin for RecordFinder<N>where
N: Unpin,
impl<N> !UnwindSafe for RecordFinder<N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more