Skip to content

Deposit to MegaVault

Deposit USDC into MegaVault

Method Declaration

Python
async def deposit(
    self, wallet: Wallet, address: str, subaccount_number: int, amount: Decimal
) -> Any

Parameters

ParameterLocationTypeDescription
accountqueryAccountOwner's account information
subaccountquerySubaccountInfoSubaccount information
amountqueryDecimalAmount in usdc to deposit

Response

StatusMeaningSchemaDescription
200OKTxHashThe transaction hash.
400Bad RequestThe request was malformed or invalid.
404Not FoundThe subaccount was not found.

Withdraw from MegaVault

Withdraw funds (USDC) from the subaccount to the address.

Method Declaration

Python
async def withdraw(
    self,
    wallet: Wallet,
    address: str,
    subaccount_number: int,
    min_amount: Decimal,
    shares: Optional[int],
) -> Any

Parameters

ParameterLocationTypeDescription
accountqueryAccountOwner's account
subaccountquerySubaccountInfoSubaccount information
min_amountqueryDecimalMinimum amount to withdraw i usdc
sharesqueryBigIntNumber of shares

Response

StatusMeaningSchemaDescription
200OKTxHashThe transaction hash.
400Bad RequestThe request was malformed or invalid.
404Not FoundThe subaccount was not found.

Get Owner Shares in MegaVault

Query the shares associated with an Address.

Method Declaration

Python
async def get_owner_shares(
    self, address: str
) -> vault_query.QueryMegavaultOwnerSharesResponse

Parameters

ParameterLocationTypeDescription
addressqueryAddressThe wallet address that owns the subaccount.

Response

StatusMeaningSchema
200OKQueryMegavaultOwnerSharesResponse
400Bad RequestThe request was malformed or invalid.

Get Withdrawal Info of MegaVault

Query the withdrawal information for a specified number of shares.

Method Declaration

Python
async def get_withdrawal_info(
    self, shares: int
) -> vault_query.QueryMegavaultWithdrawalInfoResponse

Parameters

ParameterLocationTypeDescription
sharesqueryBigIntNumber of shares

Response

StatusMeaningSchema
200OKQueryMegavaultWithdrawalInfoResponse
400Bad RequestThe request was malformed or invalid.