pub struct VaultV2TransactionClient { /* private fields */ }Expand description
Client for executing transactions against V2 vaults.
Implementations§
Source§impl VaultV2TransactionClient
impl VaultV2TransactionClient
Sourcepub fn new(
rpc_url: &str,
private_key: &str,
) -> Result<VaultV2TransactionClient, ContractError>
pub fn new( rpc_url: &str, private_key: &str, ) -> Result<VaultV2TransactionClient, ContractError>
Create a new V2 transaction client.
Sourcepub async fn get_decimals(&self, token: Address) -> Result<u8, ContractError>
pub async fn get_decimals(&self, token: Address) -> Result<u8, ContractError>
Get the decimals of a token.
Sourcepub async fn get_balance(
&self,
token: Address,
owner: Address,
) -> Result<Uint<256, 4>, ContractError>
pub async fn get_balance( &self, token: Address, owner: Address, ) -> Result<Uint<256, 4>, ContractError>
Get the balance of a token for an address.
Sourcepub async fn get_allowance(
&self,
token: Address,
owner: Address,
spender: Address,
) -> Result<Uint<256, 4>, ContractError>
pub async fn get_allowance( &self, token: Address, owner: Address, spender: Address, ) -> Result<Uint<256, 4>, ContractError>
Get the allowance of a token for a spender.
Sourcepub fn approve(
&self,
token: Address,
spender: Address,
amount: Uint<256, 4>,
) -> PreparedCall<'_, approveCall>
pub fn approve( &self, token: Address, spender: Address, amount: Uint<256, 4>, ) -> PreparedCall<'_, approveCall>
Create a prepared approval transaction.
Returns a PreparedCall that can be sent or used with MulticallBuilder.
Sourcepub async fn approve_if_needed(
&self,
token: Address,
spender: Address,
amount: Uint<256, 4>,
) -> Result<Option<PreparedCall<'_, approveCall>>, ContractError>
pub async fn approve_if_needed( &self, token: Address, spender: Address, amount: Uint<256, 4>, ) -> Result<Option<PreparedCall<'_, approveCall>>, ContractError>
Approve a spender to use tokens if needed.
Returns a PreparedCall if approval is needed, None otherwise.
Source§impl VaultV2TransactionClient
impl VaultV2TransactionClient
Sourcepub fn deposit(
&self,
vault: Address,
amount: Uint<256, 4>,
receiver: Address,
) -> PreparedCall<'_, depositCall>
pub fn deposit( &self, vault: Address, amount: Uint<256, 4>, receiver: Address, ) -> PreparedCall<'_, depositCall>
Create a prepared deposit transaction.
Returns a PreparedCall that can be sent or used with MulticallBuilder.
Sourcepub fn withdraw(
&self,
vault: Address,
amount: Uint<256, 4>,
receiver: Address,
owner: Address,
) -> PreparedCall<'_, withdrawCall>
pub fn withdraw( &self, vault: Address, amount: Uint<256, 4>, receiver: Address, owner: Address, ) -> PreparedCall<'_, withdrawCall>
Create a prepared withdraw transaction.
Returns a PreparedCall that can be sent or used with MulticallBuilder.
Sourcepub fn mint(
&self,
vault: Address,
shares: Uint<256, 4>,
receiver: Address,
) -> PreparedCall<'_, mintCall>
pub fn mint( &self, vault: Address, shares: Uint<256, 4>, receiver: Address, ) -> PreparedCall<'_, mintCall>
Create a prepared mint transaction.
Returns a PreparedCall that can be sent or used with MulticallBuilder.
Sourcepub fn redeem(
&self,
vault: Address,
shares: Uint<256, 4>,
receiver: Address,
owner: Address,
) -> PreparedCall<'_, redeemCall>
pub fn redeem( &self, vault: Address, shares: Uint<256, 4>, receiver: Address, owner: Address, ) -> PreparedCall<'_, redeemCall>
Create a prepared redeem transaction.
Returns a PreparedCall that can be sent or used with MulticallBuilder.
Trait Implementations§
Source§impl Erc4626Client for VaultV2TransactionClient
impl Erc4626Client for VaultV2TransactionClient
Source§fn provider(
&self,
) -> &FillProvider<JoinFill<JoinFill<Identity, JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>>, WalletFiller<EthereumWallet>>, RootProvider>
fn provider( &self, ) -> &FillProvider<JoinFill<JoinFill<Identity, JoinFill<GasFiller, JoinFill<BlobGasFiller, JoinFill<NonceFiller, ChainIdFiller>>>>, WalletFiller<EthereumWallet>>, RootProvider>
Source§fn signer_address(&self) -> Address
fn signer_address(&self) -> Address
Source§async fn get_asset(&self, vault: Address) -> Result<Address, ContractError>
async fn get_asset(&self, vault: Address) -> Result<Address, ContractError>
Source§async fn total_assets(
&self,
vault: Address,
) -> Result<Uint<256, 4>, ContractError>
async fn total_assets( &self, vault: Address, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn convert_to_assets(
&self,
vault: Address,
shares: Uint<256, 4>,
) -> Result<Uint<256, 4>, ContractError>
async fn convert_to_assets( &self, vault: Address, shares: Uint<256, 4>, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn max_deposit(
&self,
vault: Address,
receiver: Address,
) -> Result<Uint<256, 4>, ContractError>
async fn max_deposit( &self, vault: Address, receiver: Address, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn max_withdraw(
&self,
vault: Address,
owner: Address,
) -> Result<Uint<256, 4>, ContractError>
async fn max_withdraw( &self, vault: Address, owner: Address, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn max_mint(
&self,
vault: Address,
receiver: Address,
) -> Result<Uint<256, 4>, ContractError>
async fn max_mint( &self, vault: Address, receiver: Address, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn max_redeem(
&self,
vault: Address,
owner: Address,
) -> Result<Uint<256, 4>, ContractError>
async fn max_redeem( &self, vault: Address, owner: Address, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn preview_deposit(
&self,
vault: Address,
assets: Uint<256, 4>,
) -> Result<Uint<256, 4>, ContractError>
async fn preview_deposit( &self, vault: Address, assets: Uint<256, 4>, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn preview_mint(
&self,
vault: Address,
shares: Uint<256, 4>,
) -> Result<Uint<256, 4>, ContractError>
async fn preview_mint( &self, vault: Address, shares: Uint<256, 4>, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn preview_withdraw(
&self,
vault: Address,
assets: Uint<256, 4>,
) -> Result<Uint<256, 4>, ContractError>
async fn preview_withdraw( &self, vault: Address, assets: Uint<256, 4>, ) -> Result<Uint<256, 4>, ContractError>
Source§async fn preview_redeem(
&self,
vault: Address,
shares: Uint<256, 4>,
) -> Result<Uint<256, 4>, ContractError>
async fn preview_redeem( &self, vault: Address, shares: Uint<256, 4>, ) -> Result<Uint<256, 4>, ContractError>
Auto Trait Implementations§
impl Freeze for VaultV2TransactionClient
impl !RefUnwindSafe for VaultV2TransactionClient
impl Send for VaultV2TransactionClient
impl Sync for VaultV2TransactionClient
impl Unpin for VaultV2TransactionClient
impl !UnwindSafe for VaultV2TransactionClient
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> 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