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
) -> Result<Record<N, Plaintext<N>>>
pub fn find_one_record( &self, private_key: &PrivateKey<N>, amount: u64 ) -> 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>>>>
Trait Implementations§
Auto Trait Implementations§
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
Mutably borrows from an owned value. Read more