Struct raiden_blockchain::proxies::UserDeposit
source · pub struct UserDeposit<T: Transport> { /* private fields */ }
Expand description
User deposit proxy to interact with the on-chain contract.
Implementations§
source§impl<T> UserDeposit<T>
impl<T> UserDeposit<T>
sourcepub fn new(
web3: Web3<T>,
gas_metadata: Arc<GasMetadata>,
contract: Contract<T>
) -> Self
pub fn new( web3: Web3<T>, gas_metadata: Arc<GasMetadata>, contract: Contract<T> ) -> Self
Returns a new instance of UserDeposit
.
sourcepub async fn token_address(
&self,
block: Option<BlockHash>
) -> Result<Address, ProxyError>
pub async fn token_address( &self, block: Option<BlockHash> ) -> Result<Address, ProxyError>
Get the user deposit token contract address.
sourcepub async fn balance(
&self,
owner: Address,
block: Option<BlockHash>
) -> Result<U256, ProxyError>
pub async fn balance( &self, owner: Address, block: Option<BlockHash> ) -> Result<U256, ProxyError>
Get the balance of an account.
sourcepub async fn effective_balance(
&self,
owner: Address,
block: Option<BlockHash>
) -> Result<U256, ProxyError>
pub async fn effective_balance( &self, owner: Address, block: Option<BlockHash> ) -> Result<U256, ProxyError>
Retrieve the effective balance of an account.
sourcepub async fn total_deposit(
&self,
owner: Address,
block: Option<BlockHash>
) -> Result<U256, ProxyError>
pub async fn total_deposit( &self, owner: Address, block: Option<BlockHash> ) -> Result<U256, ProxyError>
Retrieve the total deposit of an account.
sourcepub async fn whole_balance(
&self,
block: Option<BlockHash>
) -> Result<U256, ProxyError>
pub async fn whole_balance( &self, block: Option<BlockHash> ) -> Result<U256, ProxyError>
Retrieve the whole balance of the user deposit contract.
sourcepub async fn whole_balance_limit(
&self,
block: Option<BlockHash>
) -> Result<U256, ProxyError>
pub async fn whole_balance_limit( &self, block: Option<BlockHash> ) -> Result<U256, ProxyError>
Retrieve the limit of deposits the user deposit contract will manage.
sourcepub async fn withdraw_plan(
&self,
address: Address,
block: Option<BlockHash>
) -> Result<WithdrawPlan, ProxyError>
pub async fn withdraw_plan( &self, address: Address, block: Option<BlockHash> ) -> Result<WithdrawPlan, ProxyError>
Retrieve planned withdraw info.
sourcepub async fn deposit(
&self,
account: Account<T>,
token_proxy: TokenProxy<T>,
new_total_deposit: U256,
block_hash: BlockHash
) -> Result<H256, ProxyError>
pub async fn deposit( &self, account: Account<T>, token_proxy: TokenProxy<T>, new_total_deposit: U256, block_hash: BlockHash ) -> Result<H256, ProxyError>
Deposit an amount into user deposit.
sourcepub async fn plan_withdraw(
&self,
account: Account<T>,
amount: U256,
block_hash: BlockHash
) -> Result<H256, ProxyError>
pub async fn plan_withdraw( &self, account: Account<T>, amount: U256, block_hash: BlockHash ) -> Result<H256, ProxyError>
Plan a withdraw from user deposit balance.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for UserDeposit<T>where
T: Freeze,
impl<T> !RefUnwindSafe for UserDeposit<T>
impl<T> Send for UserDeposit<T>where
T: Send,
impl<T> Sync for UserDeposit<T>where
T: Sync,
impl<T> Unpin for UserDeposit<T>where
T: Unpin,
impl<T> !UnwindSafe for UserDeposit<T>
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> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
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> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.