pub struct PaymentVaultHandler<P, N>{
pub contract: IPaymentVaultInstance<P, N>,
}Fields§
§contract: IPaymentVaultInstance<P, N>Implementations§
Source§impl<P, N> PaymentVaultHandler<P, N>
impl<P, N> PaymentVaultHandler<P, N>
Sourcepub fn new(contract_address: Address, provider: P) -> PaymentVaultHandler<P, N>
pub fn new(contract_address: Address, provider: P) -> PaymentVaultHandler<P, N>
Create a new PaymentVaultHandler instance from a (proxy) contract’s address
Sourcepub fn set_provider(&mut self, provider: P)
pub fn set_provider(&mut self, provider: P)
Set the provider
Sourcepub async fn pay_for_quotes<I>(
&self,
data_payments: I,
transaction_config: &TransactionConfig,
) -> Result<(FixedBytes<32>, GasInfo), Error>
pub async fn pay_for_quotes<I>( &self, data_payments: I, transaction_config: &TransactionConfig, ) -> Result<(FixedBytes<32>, GasInfo), Error>
Pay for quotes. Returns the transaction hash and gas information.
Sourcepub fn pay_for_quotes_calldata<I>(
&self,
data_payments: I,
) -> Result<(Bytes, Address), Error>
pub fn pay_for_quotes_calldata<I>( &self, data_payments: I, ) -> Result<(Bytes, Address), Error>
Returns the pay for quotes transaction calldata.
Sourcepub async fn pay_for_merkle_tree<I, T>(
&self,
depth: u8,
pool_commitments: I,
merkle_payment_timestamp: u64,
transaction_config: &TransactionConfig,
) -> Result<([u8; 32], Uint<256, 4>, GasInfo), Error>
pub async fn pay_for_merkle_tree<I, T>( &self, depth: u8, pool_commitments: I, merkle_payment_timestamp: u64, transaction_config: &TransactionConfig, ) -> Result<([u8; 32], Uint<256, 4>, GasInfo), Error>
Pay for Merkle tree batch.
Sends payForMerkleTree with unpacked PoolCommitment structs (candidates have price).
§Returns
- Tuple of (winner pool hash, total amount paid, gas info)
Sourcepub fn pay_for_merkle_tree_calldata<I, T>(
&self,
depth: u8,
pool_commitments: I,
merkle_payment_timestamp: u64,
) -> Result<(Bytes, Address), Error>
pub fn pay_for_merkle_tree_calldata<I, T>( &self, depth: u8, pool_commitments: I, merkle_payment_timestamp: u64, ) -> Result<(Bytes, Address), Error>
Get calldata for payForMerkleTree.
Public so external signers can generate calldata without a wallet.
Sourcepub async fn get_completed_merkle_payment(
&self,
winner_pool_hash: [u8; 32],
) -> Result<CompletedMerklePayment, Error>
pub async fn get_completed_merkle_payment( &self, winner_pool_hash: [u8; 32], ) -> Result<CompletedMerklePayment, Error>
Get completed merkle payment info for a winner pool hash.
Calls getCompletedMerklePayment on the contract, which returns
CompletedMerklePayment containing depth, timestamp, and paid nodes
(each with rewards address, pool index, and amount).
Auto Trait Implementations§
impl<P, N> Freeze for PaymentVaultHandler<P, N>where
P: Freeze,
impl<P, N> RefUnwindSafe for PaymentVaultHandler<P, N>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<P, N> Send for PaymentVaultHandler<P, N>
impl<P, N> Sync for PaymentVaultHandler<P, N>
impl<P, N> Unpin for PaymentVaultHandler<P, N>
impl<P, N> UnsafeUnpin for PaymentVaultHandler<P, N>where
P: UnsafeUnpin,
impl<P, N> UnwindSafe for PaymentVaultHandler<P, N>where
P: UnwindSafe,
N: UnwindSafe,
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
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>
Converts
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>
Converts
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